// ==UserScript== // @name 网盘文件批量重命名 // @namespace cloud-disk-plugin // @version 0.0.6-beta // @author realafei // @description 网盘文件批量重命名,支持百度网盘 // @license MIT // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAACUpJREFUeJzlm3lzU2UUxnEZxhH1f78AX6AK7oIi4gAuuO+iMygqyqKOS10HUUSxilKoIDsFtYCgoixSWWQVrFWg+5KUdN/bdD+e35sbTdPc9jZNm3RyZs6khOTe9znvOc9Z3psRIwZZEt7Pulx1mupc1UWqG1T3qZ5Vrbf0rPXeBuszc63vXD7Y64u46KLPVx2rOl81Q1UGqBnWtbjm+dHGZyu6uEtVX1ItiABoOy2w7nFptPH+J7qYi1VfVq0YRODBWmHd8+JoAj9P9WFV1xACD1aXtYbzhhr8aNX0KAIPVtYyeqjAz1RtjgHQwcqaZg4m8ItU18UA0L6UNV4UafCjVPfGADinylpHRQr8hao7YwBUf5U1XxgJAyTHAJhwNXmg4GfGAIiBanjEqF8co9oaAwAGqmAY01/wl6nmxcDiI6Vguaw/Blg51Iu8ckGW3JmcL69tPSdLfq2QjceqZeff9fLDX3Xy9aEqmf9jqczc4JLbv8yXqxdmh3OPlU7BT1DtGirgYz7IkqfWFsu6I9VyvLBJCqtapaKhXRpaOqWto0ta27uktrlDSmraJLusRU4WN8u2P2tl1ia3XL8opz/3AtOEvsCPVM0aKvATk3LNbv/papY6b4d0dolUNXbIX26v7D3TIJtP1Mg3qvz9d4nXGKZDP9Tc1ik55S2y/mi13JdSoEZ07BFgG9mbAeYMFfgHviqUradqpazeByqvolVW/14lsze75ZGvi+TuZQUy+Yt8o/z9qL43Y71LFu0qMwZrUc+oU884nN9kQuMa52Exxw78JQlD1NI+tqpI9uiu4uZNrZ2SdrJWntvokkmf5cmtqk8r0Hd/KJWl6RWyZF+FvLHtnPnOTYtzZbwqBlpxsEo8de3SqmGCQWasK5arPnRkBDBeEsoA8yIF8NqPcmSqktX0NcXyfKrbLH7ykjxDXnfo+7/8U2+A4+6AvCu5QG77PM8Q3b6sBskqbRG3xnxlY7tx+yLlhX/OeeX3vEb5XEMGIuTzb37vkbzyVsMVB3Mb5f6UQrligaM1zgsGf4Fq0UCB46qLd5fL3rMNhqxOe7ySo8TF4v8oapZf9f392Y2G1NCkveVm1wmHLRoOLgUNGDvp0v8qV4NwjWfU7Sd8mms8BWN5lRfWHq4213OwVrBeEGiAKQMBfoOy8Yc/l5l4JKbbO30giFPcvMP6N68A5JXF4hWPrCySXafrzefsoXcXrgFRYoSJSXmySrmjpqlDyvXec78tcZompwQaIDVc8OM/yZWU/ZVSXNVmgJdqXH6vaQp3flEJ7VmNbXI7ufxYQZPUezslUxl9+uoimaIE92NmnTRqOPRXMCJuf+/yAhNCR/XaGIbagRBxsPbUwNRXH16sZ8uy3yrFU+tz3d26k/N0B1jAdcoDGIdY5RXXfHBFoTHGLOWFcZ/kyKd7ys2uhSu4/dL0SuMFeCDGr9HQgnfG9p0awTwSA4wLd/ff3u6RgspWs/PbM+oM2QEMFielHchplBMa+7x+daBSntBdxxi4KIY5oiHjD49wJV/TJ/edqt6UodmAyyXrptys/OAAwzgMkBgOeNz3kLIyOw87T19dbFJYigKlaCFH+7HxWq0xiuu/s8NjjESswu4DFYz//k+l5prUFWQXSPjOpY7CIBEDpPUXPNZdrO4L4QH01S3nzAKwPLnZblNhcUC/klYiq5QTSIORkE3Ha4xHUVWSOsk6ZBYHWNIwQKYT0JSbVGPLlfBwaWrzdt19/ib94fZnPC224APlkJIXhNjY0n/yCyXUFXfoji/YWWp4gLB4eKUjA2RigBon7o5rU3Gxa8QtCoF9vKvcVGjsvtMdxU3xHhqdSMhPmkkg3kW/lJnr0jQ9tMKRAWowQK+dH2UnN/ADz9XK69s/auQtJUB2fZK6Ht5B2+ptcw6I2O2KDH5JPeYLATYJrjmlRdh9KY4M0DWitw/cr3G054yvbCXWUzXWaDzwiBs/zpFpyb4mhVwMEbb3UsUNplB9wkH0FKzVVd0mL39XYkryvoxga4AbFCA7TYUGsZCzqe9hekiPtEe5C+FkuJtNaRupHe2PsOM0UuR9higUWmQm+okFmh0Iz7AMQKNBdUecLlPiw9UZXFC5FWrupwiJzn53F0JvqlX5QcYLtSCCjDECPcJHygu9GSGkAfhCunZltJr7leVJKQweaGYYRsSSAJadf0+bIkLxlqRc0xqzbjaJcKAkt+sPQpLg7G/cZjTFBRK3eUy807zg5rEm7DT8xG5TdVJqU21SHUKG8JI/TdqRYI80SOMCWDoudp+LEesDrFoHXVgfNUCihi9G8PcHjNueXFNsmwZ7FEIwP5aFVWlZ/fl1uAgECF8xTsMrMAzjNLtCqEcpTGsJo9PAEFNMbLHicJGOTt/aJ2rGokwmk9kYIC1kM8R4GoH9mbps1EKD9DKchCELcU/PwhTJxgCJIdthGJSqD3Yl/X2xjyZj+HgAstsywAc7fTxgY4BxIQcizONxG/r1e5b7Gh3G1sNJ/OUxQ9TK0B7gG4iEGolR59PtEfdzNCXerHUBvXY4o6toCLNIRumcHPl6lJAckGo7FMVy8ABh4J+xUfNT+rbHei4UX/z7+5TTmr67QmeBbkPRbmNxDioXWqkPL6DlJRvQCDGI9MZYNRgobBxgqWY3H/eRN6U70+cA8N3H4qEORkghtMF0V0xx3t7hMRmBwihJmRUrk2+5ASVzWxSVucRv2Q0m3h/Xoo3KlSLIbZ0zcPgSNCPsfjBidzSGC1FIABArUiHScOAN0/SVm+EVTGFnRVFnrHOZPoBdp1X/UgH7h7X0L7T1V/5/YhT6aCzU4SgtJocPFEYQC60nLrZeC6P52mqSHUg1pMqoqXoqmYpxPFMpRnS+U2QxBzU0RkGNUOjD0YAzgm7H4xw44gk0Q+RTrAovkCUIARoOvOSEGiZayjicHoCpFc0P66OMp/4POjXu/XjcMkKPByQ4cCQzcHTNvP+oWpbCKJYSAuO4Mx6vAf66doRkrrHdT4v7fkAiwAghH5Hhgv7DTNz/hU1u02vHgvpPoTkgYdev6Ll+Z4/IWAaI74ekLCPE72NyAUaI3wclA4wQv4/KWgaI74elLSPE7+PyAUaI3x9MBBkiPn8yE2SE+P3RVIAR4vdnc0GGiM8fTgZLQrz+dDZYEuL1x9N2khDjP5//F09WbW9U5XehAAAAAElFTkSuQmCC // @homepage https://github.com/realafei/cloud-disk-plugin // @source https://github.com/realafei/cloud-disk-plugin // @match https://pan.quark.cn/* // @match https://pan.baidu.com/* // @match https://www.alipan.com/* // @match https://www.aliyundrive.com/* // @require https://cdn.jsdelivr.net/npm/vue@3.4.15/dist/vue.global.prod.js // @grant none // @downloadURL none // ==/UserScript== (e=>{if(typeof GM_addStyle=="function"){GM_addStyle(e);return}const a=document.createElement("style");a.textContent=e,document.head.append(a)})(' .fade-enter-from,.fade-leave-to{opacity:0}.fade-enter-to,.fade-leave-from{opacity:1}.fade-enter-active,.fade-leave-active{transition:opacity var(--transition-default)}.fade-bottom-enter-from,.fade-bottom-leave-to{opacity:0;transform:translateY(10%)}.fade-bottom-enter-to,.fade-bottom-leave-from{opacity:1;transform:none}.fade-bottom-enter-active,.fade-bottom-leave-active{transition:opacity .3s,transform .3s ease}:root{--color-white: var(--color-gray-0);--color-black: var(--color-gray-1000);--color-gray: var(--color-gray-500);--color-gray-0: #ffffff;--color-gray-50: #f2f2f2;--color-gray-100: #e6e6e6;--color-gray-200: #cccccc;--color-gray-300: #b3b3b3;--color-gray-400: #989898;--color-gray-500: #808080;--color-gray-600: #656565;--color-gray-700: #4d4d4d;--color-gray-800: #333333;--color-gray-900: #1a1a1a;--color-gray-950: #0d0d0d;--color-gray-1000: #000000;--color-red: var(--color-red-500);--color-red-50: #fef2f2;--color-red-100: #fee2e2;--color-red-200: #fecaca;--color-red-300: #fca5a5;--color-red-400: #f87171;--color-red-500: #ef4444;--color-red-600: #dc2626;--color-red-700: #b91c1c;--color-red-800: #991b1b;--color-red-900: #7f1d1d;--color-red-950: #450a0a;--color-blue: var(--color-blue-500);--color-blue-50: #eff6ff;--color-blue-100: #dbeafe;--color-blue-200: #bfdbfe;--color-blue-300: #93c5fd;--color-blue-400: #60a5fa;--color-blue-500: #3b82f6;--color-blue-600: #2563eb;--color-blue-700: #1d4ed8;--color-blue-800: #1e40af;--color-blue-900: #1e3a8a;--color-blue-950: #172554;--color-green: var(--color-green-500);--color-green-50: #f0fdf4;--color-green-100: #dcfce7;--color-green-200: #bbf7d0;--color-green-300: #86efac;--color-green-400: #4ade80;--color-green-500: #22c55e;--color-green-600: #16a34a;--color-green-700: #15803d;--color-green-800: #166534;--color-green-900: #14532d;--color-green-950: #052e16;--color-yellow: var(--color-yellow-500);--color-yellow-50: #fefce8;--color-yellow-100: #fef9c3;--color-yellow-200: #fef08a;--color-yellow-300: #fde047;--color-yellow-400: #facc15;--color-yellow-500: #eab308;--color-yellow-600: #ca8a04;--color-yellow-700: #a16207;--color-yellow-800: #854d0e;--color-yellow-900: #713f12;--color-yellow-950: #422006;--font-size: var(--font-size-base);--font-size-xs: 10px;--font-size-sm: 12px;--font-size-base: 14px;--font-size-lg: 16px;--font-size-xl: 18px;--line-height: var(--line-height-base);--line-height-xs: 12px;--line-height-sm: 16px;--line-height-base: 20px;--line-height-lg: 24px;--line-height-xl: 28px;--gutter: 10px;--box-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);--box-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--box-shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--box-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--box-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--box-shadow-around: 0px 0px 5px 0px rgb(0 0 0 / .1);--box-shadow-around-hover: 0px 0px 7px 2px rgb(0 0 0 / .1);--transition-all: all var(--transition-default);--transition-default: var(--transition-duration) var(--transition-timing-function);--transition-duration: .3s;--transition-timing-function: ease-in-out}*{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.material-input[data-v-91bc29e1]{--material-input-size: .4em;--material-label-size: .8em;color:var(--color-gray);display:flex;position:relative;font-size:inherit;box-sizing:border-box;margin-top:var(--material-input-size);padding-top:calc(var(--material-input-size) + var(--material-label-size));padding-bottom:var(--material-input-size);margin-bottom:var(--material-input-size);border-bottom:1px solid var(--color-gray);background-color:transparent}.material-input.is-focus[data-v-91bc29e1]{border-bottom-color:var(--color-blue)}.material-input-input[data-v-91bc29e1],.material-input-textarea[data-v-91bc29e1]{color:var(--color-gray-700);width:100%;outline:none;font-size:inherit;min-height:calc(var(--material-input-size) + 1em);transition:border-bottom-color var(--transition-default);box-sizing:content-box;line-height:calc(var(--material-input-size) + 1em);background-color:transparent;border-block-end-width:0;border-inline-end-width:0;border-block-start-width:0;border-inline-start-width:0}.material-input.is-focus .material-input-input[data-v-91bc29e1],.material-input.is-focus .material-input-textarea[data-v-91bc29e1]{border-bottom-color:var(--color-blue);border-block-end-color:var(--color-blue)}.material-input.is-disabled .material-input-input[data-v-91bc29e1],.material-input.is-disabled .material-input-textarea[data-v-91bc29e1]{color:var(--color-gray)}.material-input-label[data-v-91bc29e1]{top:calc(var(--material-label-size) + var(--material-input-size) * 1.5);left:calc(var(--material-input-size) * 2);color:var(--color-gray-700);position:absolute;transition:top var(--transition-default),left var(--transition-default),color var(--transition-default),font-size var(--transition-default);line-height:1;background-color:transparent}.material-input.is-active .material-input-label[data-v-91bc29e1]{top:0;left:0;color:var(--color-gray-900);font-size:var(--material-label-size)}.material-input.is-focus .material-input-label[data-v-91bc29e1]{color:var(--color-blue)}.material-input.is-disabled .material-input-label[data-v-91bc29e1]{color:var(--color-gray-300)}.material-radio[data-v-0f22e97c]{cursor:pointer;font-size:inherit;--primary-color: var(--color-blue)}.material-radio.radio[data-v-0f22e97c]{display:inline-flex;min-width:1em;min-height:1em;white-space:nowrap;align-items:center}.material-radio.is-disabled[data-v-0f22e97c]{--primary-color: var(--color-gray)}.material-radio.is-disabled .material-radio-label[data-v-0f22e97c]{color:var(--color-gray-300)}.material-checkbox+.material-radio[data-v-0f22e97c],.material-radio.radio+.material-radio.radio[data-v-0f22e97c]{margin-left:.5em}.material-radio.radio .material-radio-input[data-v-0f22e97c]{width:1em;height:1em;display:inline-block;position:relative}.material-radio.radio .material-radio-input[data-v-0f22e97c]:before{width:100%;height:100%;border:2px solid var(--primary-color);content:"";display:block;box-sizing:border-box;transition:var(--transition-all);border-radius:50%;background-color:transparent}.material-radio.radio .material-radio-input[data-v-0f22e97c]:after{top:50%;left:50%;width:0;height:0;content:"";display:block;position:absolute;transform:translate(-50%,-50%);box-sizing:border-box;transition:var(--transition-all);border-radius:50%;background-color:var(--primary-color)}.material-radio.radio.is-checked .material-radio-input[data-v-0f22e97c]:after{width:50%;height:50%}.material-radio.radio .material-radio-input-original[data-v-0f22e97c]{top:0;left:0;width:0;height:0;margin:0;z-index:-1;opacity:0;outline:none;position:absolute}.material-radio.radio .material-radio-label[data-v-0f22e97c]{margin-left:.5em}.material-radio.button[data-v-0f22e97c]{color:var(--color-gray-900);height:auto;border:1px solid var(--color-gray-300);padding:.5em 1em;transition:var(--transition-all);line-height:1;border-radius:var(--gutter);background-color:var(--color-white)}.material-radio.button[data-v-0f22e97c]:has(+.material-radio.button){border-right:none;border-top-right-radius:0;border-bottom-right-radius:0}.material-radio.button+.material-radio.button[data-v-0f22e97c]{border-left:none;border-top-left-radius:0;border-bottom-left-radius:0}.material-radio.button.is-checked[data-v-0f22e97c]{color:var(--color-gray-50);border-color:var(--primary-color);background-color:var(--primary-color)}.material-radio.button .material-radio-input-original[data-v-0f22e97c]{top:0;left:0;width:0;height:0;margin:0;z-index:-1;opacity:0;outline:none;position:absolute}.icon[data-v-fa5bb538]{animation:spin-fa5bb538 1s linear infinite}.icon-path[data-v-fa5bb538]{stroke:var(--color-blue);animation:loading-dash-fa5bb538 1.5s ease-in-out infinite;stroke-width:.1em;stroke-linecap:round;stroke-dasharray:90,150;stroke-dashoffset:0}@keyframes spin-fa5bb538{to{transform:rotate(1turn)}}@keyframes loading-dash-fa5bb538{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}*:has(>.material-loading){position:relative}.material-loading[data-v-228696a7]{top:0;left:0;right:0;bottom:0;margin:0;z-index:2000;display:flex;position:absolute;transition:opacity var(--el-transition-default);align-items:center;justify-content:center;background-color:#ffffffe6}.material-loading-icon[data-v-228696a7]{font-size:calc(var(--font-size) * 2)}.material-checkbox[data-v-a9407da1]{cursor:pointer;display:inline-flex;font-size:inherit;min-width:1em;min-height:1em;white-space:nowrap;align-items:center;--primary-color: var(--color-blue)}.material-checkbox.is-disabled[data-v-a9407da1]{--primary-color: var(--color-gray)}.material-checkbox.is-disabled .material-checkbox-label[data-v-a9407da1]{color:var(--color-gray-300)}.material-radio+.material-checkbox[data-v-a9407da1],.material-checkbox+.material-checkbox[data-v-a9407da1]{margin-left:.5em}.material-checkbox-input[data-v-a9407da1]{width:1em;height:1em;display:inline-block;position:relative}.material-checkbox-input[data-v-a9407da1]:before{width:100%;height:100%;content:"";display:block;box-sizing:border-box;transition:var(--transition-all);border-top:2px solid var(--primary-color);border-left:2px solid var(--primary-color);border-right:2px solid var(--primary-color);border-bottom:2px solid var(--primary-color);border-radius:2px;background-color:transparent}.material-checkbox .material-checkbox-input[data-v-a9407da1]:after{top:50%;left:50%;width:0;height:0;content:"";display:block;position:absolute}.material-checkbox:not(.is-indeterminate) .material-checkbox-input[data-v-a9407da1]:after{top:30%;left:50%;width:40%;height:75%;content:"";display:block;position:absolute;transform:rotate(45deg);box-sizing:border-box;transition:var(--transition-all);border-right:2px solid transparent;border-bottom:2px solid transparent;transform-origin:100% 0}.material-checkbox.is-checked .material-checkbox-input[data-v-a9407da1]:before{background-color:var(--primary-color)}.material-checkbox.is-checked:not(.is-indeterminate) .material-checkbox-input[data-v-a9407da1]:after{border-right-color:#fff;border-bottom-color:#fff}.material-checkbox.is-indeterminate .material-checkbox-input[data-v-a9407da1]:before{background-color:var(--primary-color)}.material-checkbox.is-indeterminate .material-checkbox-input[data-v-a9407da1]:after{top:50%;left:50%;width:60%;height:2px;content:"";display:block;position:absolute;transform:translate(-50%,-50%);box-sizing:border-box;transition:var(--transition-all);background-color:var(--color-white)}.material-checkbox-input-original[data-v-a9407da1]{top:0;left:0;width:0;height:0;margin:0;z-index:-1;outline:none;opacity:0;position:absolute}.material-checkbox-label[data-v-a9407da1]{margin-left:.5em}.rename-control[data-v-87f94a13]{padding:var(--gutter);background:linear-gradient(180deg,var(--color-gray-50) 0%,var(--color-gray-100) 100%);box-shadow:var(--box-shadow-md);transition:box-shadow var(--transition-default);border-radius:var(--gutter)}.rename-control[data-v-87f94a13]:hover{box-shadow:var(--box-shadow-xl)}.rename-control-header[data-v-87f94a13]{display:flex;align-items:top;justify-content:space-between}.rename-control-header-content[data-v-87f94a13]{font-size:var(--font-size-lg)}.rename-control-header-current-version[data-v-87f94a13]{font-size:var(--font-size-xs)}.rename-control-header-new-version[data-v-87f94a13]{color:var(--color-red);font-size:var(--font-size-xs)}.rename-control-body[data-v-87f94a13]{display:grid;grid-gap:var(--gutter);align-items:end;grid-template-columns:1fr 1fr}.rename-control-footer[data-v-87f94a13]{display:grid;grid-gap:var(--gutter);margin-top:var(--gutter);grid-template-columns:1fr auto auto}.rename-control-footer-option[data-v-87f94a13]{display:flex;align-items:center}.rename-control-footer-button[data-v-87f94a13]{border:none;cursor:pointer;padding:0;font-size:var(--font-size);transition:var(--transition-all);line-height:1;background-color:transparent}.rename-control-footer-button.reset[data-v-87f94a13]{color:var(--color-gray-900)}.rename-control-footer-button.reset[data-v-87f94a13]:hover{color:var(--color-gray-700)}.rename-control-footer-button.confirm[data-v-87f94a13]{color:var(--color-blue)}.rename-control-footer-button.confirm[data-v-87f94a13]:hover{color:var(--color-blue-700)}.rename-control-footer-button[disabled][data-v-87f94a13]{color:var(--color-gray-300);cursor:not-allowed}.rename-control-footer-button[disabled][data-v-87f94a13]:hover{color:var(--color-gray-400)}.icon[data-v-cd1f4e7c]{color:var(--color-yellow)}.icon[data-v-e582b7b3]{color:var(--color-green)}.icon[data-v-f8e7a690]{color:var(--color-red)}.icon[data-v-21cac17e]{color:var(--color-green)}.icon[data-v-07dfecd2]{color:var(--color-red)}.icon[data-v-43b6007f]{color:var(--color-blue)}.rename-preview[data-v-89c571a5]{display:grid;grid-gap:var(--gutter);grid-template-rows:auto minmax(200px,1fr)}.rename-preview-status[data-v-89c571a5]{display:flex;flex-wrap:wrap;font-size:var(--font-size-sm);align-items:center}.rename-preview-status-item[data-v-89c571a5]{margin:calc(var(--gutter) / 2)}.rename-preview-status-item.blue[data-v-89c571a5]{color:var(--color-blue)}.rename-preview-status-item.red[data-v-89c571a5]{color:var(--color-red)}.rename-preview-status-item.gray[data-v-89c571a5]{color:var(--color-gray)}.rename-preview-status-item.green[data-v-89c571a5]{color:var(--color-green)}.rename-preview-status-item.yellow[data-v-89c571a5]{color:var(--color-yellow)}.rename-preview-content[data-v-89c571a5]{overflow:auto;position:relative;max-height:50vh}.rename-preview-grid[data-v-89c571a5]{display:grid;grid-gap:var(--gutter);font-size:var(--font-size-sm);line-height:1;grid-template-columns:auto minmax(200px,1fr) auto minmax(200px,1fr) 2em}.rename-preview-grid-header[data-v-89c571a5]{top:0;z-index:1;position:sticky;margin-bottom:var(--gutter);background-color:var(--color-white)}.rename-preview-grid-item[data-v-89c571a5]{color:var(--color-gray-300);display:contents;transition:color var(--transition-default)}.rename-preview-grid-item.is-checked[data-v-89c571a5]{color:var(--color-gray-600)}.rename-preview-grid-item.is-checked.is-change[data-v-89c571a5]{color:var(--color-gray-900)}.rename-preview-grid-item.is-checked.is-error[data-v-89c571a5]{color:var(--color-red)}.rename-preview-grid-item-old-file-name[data-v-89c571a5],.rename-preview-grid-item-new-file-name[data-v-89c571a5],.rename-preview-grid-item-new-file-status[data-v-89c571a5]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.rename-preview-grid-item-new-file-status[data-v-89c571a5]{display:flex;text-align:right;align-items:center;padding-right:calc(var(--gutter) / 2);justify-content:flex-end}.rename-panel[data-v-a9a4dbf6]{top:0;left:0;right:0;z-index:10000;display:flex;position:fixed;font-size:var(--font-size);align-items:end;justify-content:center}.rename-panel[data-v-a9a4dbf6]:has(.rename-panel-container){height:100vh}.rename-panel-mask[data-v-a9a4dbf6]{width:100vw;height:100vh;position:absolute;-webkit-backdrop-filter:blur(calc(var(--gutter) / 2));backdrop-filter:blur(calc(var(--gutter) / 2))}.rename-panel-container[data-v-a9a4dbf6]{z-index:1}.rename-panel-container-content[data-v-a9a4dbf6]{display:grid;padding:var(--gutter);grid-gap:var(--gutter);overflow:hidden;max-width:100vw;min-width:33vw;max-height:90vh;min-height:60vh;box-sizing:border-box;box-shadow:var(--box-shadow-around);transition:box-shadow var(--transition-default);background-color:var(--color-white);grid-template-rows:auto minmax(200px,1fr);border-top-left-radius:var(--gutter);border-top-right-radius:var(--gutter)}.rename-panel-container-content[data-v-a9a4dbf6]:hover{box-shadow:var(--box-shadow-around-hover)}.enter-component[data-v-cc9839e5]{margin-top:8px}.enter-component-button[data-v-cc9839e5]{color:var(--context_primary);width:60px;border:none;cursor:pointer;display:flex;padding:2px 6px;position:relative;transition:all .3s ease;min-height:61px;font-weight:400;align-items:center;border-radius:8px;flex-direction:column;justify-content:center;background-color:transparent}.enter-component-button[data-v-cc9839e5]:hover{background-color:var(--divider_tertiary)}.enter-component-button[data-v-cc9839e5]:active{background-color:var(--divider_secondary)}.enter-component-button[disabled][data-v-cc9839e5]{color:var(--color-blue-700);cursor:not-allowed}.enter-component-button-icon[data-v-cc9839e5]{width:28px;height:28px;display:flex;font-size:26px;align-items:center;justify-content:center}.enter-component-button-text[data-v-cc9839e5]{overflow:hidden;font-size:12px;text-align:center;font-weight:500;white-space:nowrap;text-overflow:ellipsis}.m-message-container{position:fixed;z-index:20000;pointer-events:none;display:flex;flex-direction:column;box-sizing:border-box;padding:15px;background-color:#fff0;transition:all 1s ease-in-out}.m-message-container.is-top-left,.m-message-container.is-top-center,.m-message-container.is-top-right{width:100%;top:0;left:0}.m-message-container.is-top-left{align-items:flex-start}.m-message-container.is-top-center{align-items:center}.m-message-container.is-top-right{align-items:flex-end}.m-message-container.is-center{width:100%;height:100%;left:0;top:0;align-items:center;justify-content:center}.m-message-container.is-bottom-left,.m-message-container.is-bottom-center,.m-message-container.is-bottom-right{bottom:0;left:0;width:100%;justify-content:flex-end}.m-message-container.is-bottom-left{align-items:flex-start}.m-message-container.is-bottom-center{align-items:center}.m-message-container.is-bottom-right{align-items:flex-end}.m-message-container.has-mask{background-color:#ffffff4d;width:100%;height:100%;pointer-events:all}.m-message-wrapper{z-index:20000;display:inline-block;max-width:500px}.m-message-wrapper+.m-message-wrapper{margin-top:15px}.m-message-wrapper:before,.m-message-wrapper:after{content:"";clear:both;display:table}.m-message{display:flex;align-items:center;padding:10px;font-size:14px;overflow:hidden;border-radius:4px;box-sizing:border-box;box-shadow:0 1px 8px #00000026;background:#fff;pointer-events:all;position:relative;min-width:150px}.m-message-icons{float:left;box-sizing:border-box;margin-right:10px}.m-message--title{font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.m-message-content{box-sizing:border-box;overflow:auto;width:100%}.m-message--description{line-height:1.6;color:#0e1921}.m-message--title+.m-message--description{margin-top:5px}.m-message--icon{width:25px;height:25px;vertical-align:middle;display:inline-block;border-radius:50%}.m-message--control{position:relative;height:100%;align-self:flex-start;white-space:nowrap;margin-right:-5px;margin-left:10px;margin-top:3px}.m-message--button{border:none;outline:none;background:none;cursor:pointer;font-size:15px;color:#646464;font-weight:600;padding:0;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle}.m-message--button:hover{color:#f56c6c}.m-message--arrow-down.is-collapsed{transform:rotate(90deg)}.m-message-fade-enter-active{animation:m-message-fade-in-down .3s}.m-message-fade-leave-active{animation:m-message-fade-out .3s}@keyframes m-message-fade-in-down{0%{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}@keyframes m-message-fade-out{0%{opacity:1;margin-top:0}to{opacity:0;margin-top:-45px}}.enter-component[data-v-2eae985c]{width:58px;color:#636d7e;display:inline-block;position:relative;font-size:11px;margin-top:0;min-height:60px;padding-top:2px;margin-bottom:1px;border-radius:8px}.enter-component[data-v-2eae985c]:hover{background-color:#f1f3f8}.enter-component-button[data-v-2eae985c]{position:relative;text-align:center;background-color:transparent}.enter-component-button-icon[data-v-2eae985c]{display:block;font-size:24px;margin-top:6px}.enter-component-button-text[data-v-2eae985c]{display:block;overflow:hidden;max-width:80px;margin-top:4px;white-space:nowrap;text-overflow:ellipsis}#ice-container .section-main>.section-header.list-header>.btn-operate>.btn-main{display:flex;align-items:center}.enter-component[data-v-cccc696e]{margin-right:12px}.enter-component-button[data-v-cccc696e]{color:#52565e;cursor:pointer;height:36px;border:1px solid #ddd;padding:0 14px;outline:none;display:inline-block;position:relative;font-size:14px;text-align:center;box-shadow:0 2px #00000004;transition:all .3s cubic-bezier(.645,.045,.355,1);font-weight:700;-webkit-user-select:none;user-select:none;line-height:1.499;white-space:nowrap;touch-action:manipulation;border-radius:8px;background-image:none;background-color:transparent}.enter-component-button-icon[data-v-cccc696e]{width:16px;height:16px;display:inline-block;font-size:16px;margin-right:3px;vertical-align:-.2em}.enter-component-button-text[data-v-cccc696e]{display:inline-block;transition:margin-left .3s cubic-bezier(.645,.045,.355,1);pointer-events:none} '); (async function (vue) { 'use strict'; var __defProp = Object.defineProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __publicField = (obj, key, value) => { __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; const regexp$1 = /@version\s+(.+)\n/; const getNewVersion = () => { return fetch(`${"https://update.greasyfork.icu/scripts/488421/%E7%BD%91%E7%9B%98%E6%96%87%E4%BB%B6%E6%89%B9%E9%87%8F%E9%87%8D%E5%91%BD%E5%90%8D.meta.js"}?t=${Date.now()}`).then((res) => { if (res.ok) { return res.text(); } else { return Promise.reject(new Error("getNewVersion error")); } }).then((res) => { var _a; return ((_a = regexp$1.exec(res)) == null ? void 0 : _a[1]) || ""; }); }; const useVersion = () => { const currentVersion = "0.0.6-beta"; const newVersion = vue.ref(""); const hasNewVersion = vue.ref(false); const updateUrl = "https://update.greasyfork.icu/scripts/488421/%E7%BD%91%E7%9B%98%E6%96%87%E4%BB%B6%E6%89%B9%E9%87%8F%E9%87%8D%E5%91%BD%E5%90%8D.user.js"; vue.onMounted(() => { getNewVersion().then((res) => { newVersion.value = res; hasNewVersion.value = currentVersion !== res; }); }); return { currentVersion, newVersion, hasNewVersion, updateUrl }; }; const is = (val, type) => Object.prototype.toString.call(val) === `[object ${type}]`; const isString = (val) => is(val, "String"); const isBoolean = (val) => is(val, "Boolean"); const isNull = (val) => val === null; const isUndefined = (val) => val === void 0; const isVoid = (val) => isNull(val) || isUndefined(val); const isEmpty = (val) => isVoid(val) || val === ""; const _sfc_main$k = vue.defineComponent({ name: "MaterialInput", props: { modelValue: { type: [String, Number], default: "" }, label: { type: String, default: "" }, type: { type: String, default: "textarea" }, disabled: { type: Boolean, default: false }, readonly: { type: Boolean, default: false }, placeholder: { type: String, default: "" } }, emits: ["update:modelValue"], setup(props, { emit }) { const computedValue = vue.computed({ get: () => props.modelValue, set: (val) => { if (!props.disabled && !props.readonly) { emit("update:modelValue", val); } } }); const computedPlaceholder = vue.computed( () => props.label ? "" : props.placeholder ); const isFocus = vue.ref(false); const isActive = vue.computed( () => !isEmpty(props.modelValue) || isFocus.value ); const inputRef = vue.ref(); const textareaRef = vue.ref(); const textareaStyle = vue.ref({}); const onInputBlur = () => { isFocus.value = false; }; const onInputFocus = () => { isFocus.value = true; }; const onTextareaBlur = () => { isFocus.value = false; calcTextareaStyle(); }; const onTextareaFocus = () => { isFocus.value = true; calcTextareaStyle(); }; const calcTextareaStyle = () => { textareaStyle.value.height = "auto"; vue.nextTick(() => { var _a; textareaStyle.value.height = ((_a = textareaRef.value) == null ? void 0 : _a.value) ? textareaRef.value.scrollHeight + "px" : "auto"; }); }; vue.watch( () => [props.type, props.modelValue], ([_type]) => { if (_type === "textarea") { calcTextareaStyle(); } } ); vue.onMounted(() => { if (props.type === "textarea") { calcTextareaStyle(); } }); return { computedValue, computedPlaceholder, isFocus, isActive, inputRef, textareaRef, textareaStyle, onInputBlur, onInputFocus, onTextareaBlur, onTextareaFocus }; } }); const _export_sfc = (sfc, props) => { const target = sfc.__vccOpts || sfc; for (const [key, val] of props) { target[key] = val; } return target; }; const _hoisted_1$k = { key: 0, class: "material-input-label" }; const _hoisted_2$i = ["type", "value", "disabled", "readonly", "placeholder"]; const _hoisted_3$i = ["disabled", "readonly", "placeholder"]; function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("label", { class: vue.normalizeClass(["material-input", { "is-focus": _ctx.isFocus, "is-active": _ctx.isActive, "is-disabled": _ctx.disabled }]) }, [ _ctx.label ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$k, vue.toDisplayString(_ctx.label), 1)) : vue.createCommentVNode("", true), _ctx.type !== "textarea" ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", { key: 1, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.computedValue = $event), ref: "inputRef", class: "material-input-input", type: _ctx.type, value: _ctx.modelValue, disabled: _ctx.disabled, readonly: _ctx.readonly, placeholder: _ctx.computedPlaceholder, onBlur: _cache[1] || (_cache[1] = (...args) => _ctx.onInputBlur && _ctx.onInputBlur(...args)), onFocus: _cache[2] || (_cache[2] = (...args) => _ctx.onInputFocus && _ctx.onInputFocus(...args)) }, null, 40, _hoisted_2$i)), [ [vue.vModelDynamic, _ctx.computedValue] ]) : vue.withDirectives((vue.openBlock(), vue.createElementBlock("textarea", { key: 2, "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.computedValue = $event), ref: "textareaRef", rows: "1", class: "material-input-textarea", style: vue.normalizeStyle(_ctx.textareaStyle), disabled: _ctx.disabled, readonly: _ctx.readonly, placeholder: _ctx.computedPlaceholder, onBlur: _cache[4] || (_cache[4] = (...args) => _ctx.onTextareaBlur && _ctx.onTextareaBlur(...args)), onFocus: _cache[5] || (_cache[5] = (...args) => _ctx.onTextareaFocus && _ctx.onTextareaFocus(...args)) }, null, 44, _hoisted_3$i)), [ [vue.vModelText, _ctx.computedValue] ]) ], 2); } const MaterialInput = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$k], ["__scopeId", "data-v-91bc29e1"]]); const _sfc_main$j = vue.defineComponent({ name: "MaterialRadio", props: { modelValue: { type: [String, Number, Boolean], default: false }, label: { type: [String, Number, Boolean], default: "" }, disabled: { type: Boolean, default: false }, readonly: { type: Boolean, default: false }, type: { type: String, default: "radio" } }, emits: ["update:modelValue"], setup(props, { emit }) { const isChecked = vue.computed(() => props.modelValue === props.label); const onChange = () => { if (!props.disabled && !props.readonly) { emit("update:modelValue", props.label); } }; return { isChecked, onChange }; } }); const _hoisted_1$j = { class: "material-radio-input" }; const _hoisted_2$h = ["value", "checked"]; const _hoisted_3$h = { key: 0, class: "material-radio-label" }; function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("label", { class: vue.normalizeClass(["material-radio", { "is-checked": _ctx.isChecked, "is-disabled": _ctx.disabled, "is-readonly": _ctx.readonly, [_ctx.type]: true }]), onChange: _cache[0] || (_cache[0] = (...args) => _ctx.onChange && _ctx.onChange(...args)) }, [ vue.createElementVNode("span", _hoisted_1$j, [ vue.createElementVNode("input", { class: "material-radio-input-original", type: "radio", value: _ctx.label, checked: _ctx.isChecked }, null, 8, _hoisted_2$h) ]), _ctx.label || _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$h, [ !_ctx.$slots.default && _ctx.label ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ vue.createTextVNode(vue.toDisplayString(_ctx.label), 1) ], 64)) : vue.createCommentVNode("", true), vue.renderSlot(_ctx.$slots, "default", {}, void 0, true) ])) : vue.createCommentVNode("", true) ], 34); } const MaterialRadio = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$j], ["__scopeId", "data-v-0f22e97c"]]); const _sfc_main$i = vue.defineComponent({ name: "IconLoading" }); const _withScopeId$b = (n) => (vue.pushScopeId("data-v-fa5bb538"), n = n(), vue.popScopeId(), n); const _hoisted_1$i = { class: "icon", "data-icon": "loading", fill: "currentColor", width: "1em", height: "1em", viewBox: "0 0 50 50", focusable: "false", "aria-hidden": "true" }; const _hoisted_2$g = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("circle", { class: "icon-path", r: "20", cx: "25", cy: "25", fill: "none" }, null, -1)); const _hoisted_3$g = [ _hoisted_2$g ]; function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$i, _hoisted_3$g); } const IconLoading = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$i], ["__scopeId", "data-v-fa5bb538"]]); const _sfc_main$h = vue.defineComponent({ name: "MaterialLoading", components: { IconLoading } }); const _hoisted_1$h = { class: "material-loading" }; function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) { const _component_icon_loading = vue.resolveComponent("icon-loading"); return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$h, [ vue.createVNode(_component_icon_loading, { class: "material-loading-icon" }) ]); } const MaterialLoading = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$h], ["__scopeId", "data-v-228696a7"]]); const _sfc_main$g = vue.defineComponent({ name: "MaterialCheckbox", props: { modelValue: { type: Boolean, default: false }, label: { type: String, default: "" }, disabled: { type: Boolean, default: false }, readonly: { type: Boolean, default: false }, indeterminate: { type: Boolean, default: false } }, emits: ["update:modelValue"], setup(props, { emit }) { const onChange = () => { if (!props.disabled && !props.readonly) { emit("update:modelValue", !props.modelValue); } }; return { onChange }; } }); const _hoisted_1$g = { class: "material-checkbox-input" }; const _hoisted_2$f = ["checked"]; const _hoisted_3$f = { key: 0, class: "material-checkbox-label" }; function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("label", { class: vue.normalizeClass(["material-checkbox", { "is-checked": _ctx.modelValue, "is-disabled": _ctx.disabled, "is-readonly": _ctx.readonly, "is-indeterminate": _ctx.indeterminate }]), onChange: _cache[0] || (_cache[0] = (...args) => _ctx.onChange && _ctx.onChange(...args)) }, [ vue.createElementVNode("span", _hoisted_1$g, [ vue.createElementVNode("input", { class: "material-checkbox-input-original", type: "checkbox", checked: _ctx.modelValue }, null, 8, _hoisted_2$f) ]), _ctx.label || _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$f, [ !_ctx.$slots.default && _ctx.label ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ vue.createTextVNode(vue.toDisplayString(_ctx.label), 1) ], 64)) : vue.createCommentVNode("", true), vue.renderSlot(_ctx.$slots, "default", {}, void 0, true) ])) : vue.createCommentVNode("", true) ], 34); } const MaterialCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$g], ["__scopeId", "data-v-a9407da1"]]); const _sfc_main$f = vue.defineComponent({ name: "RenameControl", components: { MaterialInput, MaterialRadio, MaterialLoading, MaterialCheckbox }, setup() { const version = vue.inject("version"); const providerRef2 = vue.inject("providerRef"); const isDisabled = vue.computed( () => (providerRef2 == null ? void 0 : providerRef2.value.replaceParamsDisabled) || (providerRef2 == null ? void 0 : providerRef2.value.isLoading) ); const onResetClick = () => { providerRef2 == null ? void 0 : providerRef2.value.reset(); }; const onConfirmClick = () => { providerRef2 == null ? void 0 : providerRef2.value.batchRename(); }; return { ...version, providerRef: providerRef2, isDisabled, onResetClick, onConfirmClick }; } }); const _withScopeId$a = (n) => (vue.pushScopeId("data-v-87f94a13"), n = n(), vue.popScopeId(), n); const _hoisted_1$f = { key: 0, class: "rename-control" }; const _hoisted_2$e = { class: "rename-control-header" }; const _hoisted_3$e = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "rename-control-header-content" }, " 批量重命名当前目录下所有文件 ", -1)); const _hoisted_4$6 = ["href"]; const _hoisted_5$4 = { key: 1, class: "rename-control-header-current-version" }; const _hoisted_6$2 = { key: 0, class: "rename-control-body" }; const _hoisted_7$2 = { class: "rename-control-body-item" }; const _hoisted_8$2 = { class: "rename-control-body-item" }; const _hoisted_9$2 = { class: "rename-control-body-item" }; const _hoisted_10$2 = { class: "rename-control-body-item" }; const _hoisted_11$2 = { class: "rename-control-footer" }; const _hoisted_12$2 = { class: "rename-control-footer-option" }; const _hoisted_13$1 = ["disabled"]; const _hoisted_14$1 = ["disabled"]; function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) { const _component_material_input = vue.resolveComponent("material-input"); const _component_material_radio = vue.resolveComponent("material-radio"); const _component_material_checkbox = vue.resolveComponent("material-checkbox"); const _component_material_loading = vue.resolveComponent("material-loading"); return _ctx.providerRef ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, [ vue.createElementVNode("div", _hoisted_2$e, [ _hoisted_3$e, _ctx.hasNewVersion ? (vue.openBlock(), vue.createElementBlock("a", { key: 0, href: _ctx.updateUrl, target: "_blank", class: "rename-control-header-new-version" }, " 发现新版本:" + vue.toDisplayString(_ctx.newVersion) + " 点击更新 ", 9, _hoisted_4$6)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$4, " 当前版本:" + vue.toDisplayString(_ctx.currentVersion), 1)) ]), _ctx.providerRef.replaceParams ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$2, [ _ctx.providerRef.replaceParams.renameMode === "series" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ vue.createElementVNode("div", _hoisted_7$2, [ vue.createVNode(_component_material_input, { modelValue: _ctx.providerRef.replaceParams.title, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.providerRef.replaceParams.title = $event), label: "剧名", disabled: _ctx.isDisabled }, null, 8, ["modelValue", "disabled"]) ]), vue.createElementVNode("div", _hoisted_8$2, [ vue.createVNode(_component_material_input, { modelValue: _ctx.providerRef.replaceParams.season, "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.providerRef.replaceParams.season = $event), label: "季数", type: "number", disabled: _ctx.isDisabled }, null, 8, ["modelValue", "disabled"]) ]) ], 64)) : vue.createCommentVNode("", true), _ctx.providerRef.replaceParams.renameMode === "pattern" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [ vue.createElementVNode("div", _hoisted_9$2, [ vue.createVNode(_component_material_input, { modelValue: _ctx.providerRef.replaceParams.pattern, "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.providerRef.replaceParams.pattern = $event), label: "正则", disabled: _ctx.isDisabled }, null, 8, ["modelValue", "disabled"]) ]), vue.createElementVNode("div", _hoisted_10$2, [ vue.createVNode(_component_material_input, { modelValue: _ctx.providerRef.replaceParams.replace, "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.providerRef.replaceParams.replace = $event), label: "替换文本", disabled: _ctx.isDisabled }, null, 8, ["modelValue", "disabled"]) ]) ], 64)) : vue.createCommentVNode("", true) ])) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_11$2, [ vue.createElementVNode("div", _hoisted_12$2, [ vue.createVNode(_component_material_radio, { modelValue: _ctx.providerRef.replaceParams.renameMode, "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => _ctx.providerRef.replaceParams.renameMode = $event), label: "series", disabled: _ctx.isDisabled }, { default: vue.withCtx(() => [ vue.createTextVNode(" 剧集模式 ") ]), _: 1 }, 8, ["modelValue", "disabled"]), vue.createVNode(_component_material_radio, { modelValue: _ctx.providerRef.replaceParams.renameMode, "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => _ctx.providerRef.replaceParams.renameMode = $event), label: "pattern", disabled: _ctx.isDisabled }, { default: vue.withCtx(() => [ vue.createTextVNode(" 正则模式 ") ]), _: 1 }, 8, ["modelValue", "disabled"]), vue.createVNode(_component_material_checkbox, { modelValue: _ctx.providerRef.replaceParams.autoEpisode, "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => _ctx.providerRef.replaceParams.autoEpisode = $event), disabled: _ctx.isDisabled }, { default: vue.withCtx(() => [ vue.createTextVNode(" 自动集数 ") ]), _: 1 }, 8, ["modelValue", "disabled"]) ]), vue.createElementVNode("button", { class: "rename-control-footer-button reset", disabled: _ctx.isDisabled, onClick: _cache[7] || (_cache[7] = (...args) => _ctx.onResetClick && _ctx.onResetClick(...args)) }, " 重置 ", 8, _hoisted_13$1), vue.createElementVNode("button", { class: "rename-control-footer-button confirm", disabled: !_ctx.providerRef.shouldContinue || _ctx.isDisabled, onClick: _cache[8] || (_cache[8] = (...args) => _ctx.onConfirmClick && _ctx.onConfirmClick(...args)) }, " 应用 ", 8, _hoisted_14$1) ]), _ctx.providerRef.isControlLoading ? (vue.openBlock(), vue.createBlock(_component_material_loading, { key: 1 })) : vue.createCommentVNode("", true) ])) : vue.createCommentVNode("", true); } const RenameControl = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$f], ["__scopeId", "data-v-87f94a13"]]); const _sfc_main$e = vue.defineComponent({ name: "IconMehOutlined" }); const _withScopeId$9 = (n) => (vue.pushScopeId("data-v-cd1f4e7c"), n = n(), vue.popScopeId(), n); const _hoisted_1$e = { class: "icon", "data-icon": "meh", fill: "currentColor", width: "1em", height: "1em", viewBox: "64 64 896 896", focusable: "false", "aria-hidden": "true" }; const _hoisted_2$d = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("path", { d: "M288 421a48 48 0 1096 0 48 48 0 10-96 0zm352 0a48 48 0 1096 0 48 48 0 10-96 0zM512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm263 711c-34.2 34.2-74 61-118.3 79.8C611 874.2 562.3 884 512 884c-50.3 0-99-9.8-144.8-29.2A370.4 370.4 0 01248.9 775c-34.2-34.2-61-74-79.8-118.3C149.8 611 140 562.3 140 512s9.8-99 29.2-144.8A370.4 370.4 0 01249 248.9c34.2-34.2 74-61 118.3-79.8C413 149.8 461.7 140 512 140c50.3 0 99 9.8 144.8 29.2A370.4 370.4 0 01775.1 249c34.2 34.2 61 74 79.8 118.3C874.2 413 884 461.7 884 512s-9.8 99-29.2 144.8A368.89 368.89 0 01775 775zM664 565H360c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z" }, null, -1)); const _hoisted_3$d = [ _hoisted_2$d ]; function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$e, _hoisted_3$d); } const IconMehOutlined = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$e], ["__scopeId", "data-v-cd1f4e7c"]]); const _sfc_main$d = vue.defineComponent({ name: "IconSmileOutlined" }); const _withScopeId$8 = (n) => (vue.pushScopeId("data-v-e582b7b3"), n = n(), vue.popScopeId(), n); const _hoisted_1$d = { class: "icon", "data-icon": "smile", fill: "currentColor", width: "1em", height: "1em", viewBox: "64 64 896 896", focusable: "false", "aria-hidden": "true" }; const _hoisted_2$c = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("path", { d: "M288 421a48 48 0 1096 0 48 48 0 10-96 0zm352 0a48 48 0 1096 0 48 48 0 10-96 0zM512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm263 711c-34.2 34.2-74 61-118.3 79.8C611 874.2 562.3 884 512 884c-50.3 0-99-9.8-144.8-29.2A370.4 370.4 0 01248.9 775c-34.2-34.2-61-74-79.8-118.3C149.8 611 140 562.3 140 512s9.8-99 29.2-144.8A370.4 370.4 0 01249 248.9c34.2-34.2 74-61 118.3-79.8C413 149.8 461.7 140 512 140c50.3 0 99 9.8 144.8 29.2A370.4 370.4 0 01775.1 249c34.2 34.2 61 74 79.8 118.3C874.2 413 884 461.7 884 512s-9.8 99-29.2 144.8A368.89 368.89 0 01775 775zM664 533h-48.1c-4.2 0-7.8 3.2-8.1 7.4C604 589.9 562.5 629 512 629s-92.1-39.1-95.8-88.6c-.3-4.2-3.9-7.4-8.1-7.4H360a8 8 0 00-8 8.4c4.4 84.3 74.5 151.6 160 151.6s155.6-67.3 160-151.6a8 8 0 00-8-8.4z" }, null, -1)); const _hoisted_3$c = [ _hoisted_2$c ]; function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$d, _hoisted_3$c); } const IconSmileOutlined = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$d], ["__scopeId", "data-v-e582b7b3"]]); const _sfc_main$c = vue.defineComponent({ name: "IconFrownOutlined" }); const _withScopeId$7 = (n) => (vue.pushScopeId("data-v-f8e7a690"), n = n(), vue.popScopeId(), n); const _hoisted_1$c = { class: "icon", "data-icon": "frown", fill: "currentColor", width: "1em", height: "1em", viewBox: "64 64 896 896", focusable: "false", "aria-hidden": "true" }; const _hoisted_2$b = /* @__PURE__ */ _withScopeId$7(() => /* @__PURE__ */ vue.createElementVNode("path", { d: "M288 421a48 48 0 1096 0 48 48 0 10-96 0zm352 0a48 48 0 1096 0 48 48 0 10-96 0zM512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm263 711c-34.2 34.2-74 61-118.3 79.8C611 874.2 562.3 884 512 884c-50.3 0-99-9.8-144.8-29.2A370.4 370.4 0 01248.9 775c-34.2-34.2-61-74-79.8-118.3C149.8 611 140 562.3 140 512s9.8-99 29.2-144.8A370.4 370.4 0 01249 248.9c34.2-34.2 74-61 118.3-79.8C413 149.8 461.7 140 512 140c50.3 0 99 9.8 144.8 29.2A370.4 370.4 0 01775.1 249c34.2 34.2 61 74 79.8 118.3C874.2 413 884 461.7 884 512s-9.8 99-29.2 144.8A368.89 368.89 0 01775 775zM512 533c-85.5 0-155.6 67.3-160 151.6a8 8 0 008 8.4h48.1c4.2 0 7.8-3.2 8.1-7.4C420 636.1 461.5 597 512 597s92.1 39.1 95.8 88.6c.3 4.2 3.9 7.4 8.1 7.4H664a8 8 0 008-8.4C667.6 600.3 597.5 533 512 533z" }, null, -1)); const _hoisted_3$b = [ _hoisted_2$b ]; function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$c, _hoisted_3$b); } const IconFrownOutlined = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$c], ["__scopeId", "data-v-f8e7a690"]]); const _sfc_main$b = vue.defineComponent({ name: "IconCheckOutlined" }); const _withScopeId$6 = (n) => (vue.pushScopeId("data-v-21cac17e"), n = n(), vue.popScopeId(), n); const _hoisted_1$b = { "data-icon": "check", class: "icon", fill: "currentColor", width: "1em", height: "1em", viewBox: "64 64 896 896", focusable: "false", "aria-hidden": "true" }; const _hoisted_2$a = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("path", { d: "M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" }, null, -1)); const _hoisted_3$a = [ _hoisted_2$a ]; function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$b, _hoisted_3$a); } const IconCheckOutlined = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-21cac17e"]]); const _sfc_main$a = vue.defineComponent({ name: "IconCloseOutlined" }); const _withScopeId$5 = (n) => (vue.pushScopeId("data-v-07dfecd2"), n = n(), vue.popScopeId(), n); const _hoisted_1$a = { class: "icon", "data-icon": "close", "fill-rule": "evenodd", fill: "currentColor", width: "1em", height: "1em", viewBox: "64 64 896 896", focusable: "false", "aria-hidden": "true" }; const _hoisted_2$9 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("path", { d: "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" }, null, -1)); const _hoisted_3$9 = [ _hoisted_2$9 ]; function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$a, _hoisted_3$9); } const IconCloseOutlined = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$a], ["__scopeId", "data-v-07dfecd2"]]); const _sfc_main$9 = vue.defineComponent({ name: "IconCheckCircleOutlined" }); const _withScopeId$4 = (n) => (vue.pushScopeId("data-v-43b6007f"), n = n(), vue.popScopeId(), n); const _hoisted_1$9 = { "data-icon": "check-circle", class: "icon", fill: "currentColor", width: "1em", height: "1em", viewBox: "64 64 896 896", focusable: "false", "aria-hidden": "true" }; const _hoisted_2$8 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("path", { d: "M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z" }, null, -1)); const _hoisted_3$8 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("path", { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" }, null, -1)); const _hoisted_4$5 = [ _hoisted_2$8, _hoisted_3$8 ]; function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$9, _hoisted_4$5); } const IconCheckCircleOutlined = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9], ["__scopeId", "data-v-43b6007f"]]); const _sfc_main$8 = vue.defineComponent({ name: "RenamePreview", components: { IconLoading, IconMehOutlined, MaterialLoading, MaterialCheckbox, IconSmileOutlined, IconFrownOutlined, IconCheckOutlined, IconCloseOutlined, IconCheckCircleOutlined }, setup() { const providerRef2 = vue.inject("providerRef"); const currentList = vue.ref((providerRef2 == null ? void 0 : providerRef2.value.currentList) || []); const onCurrentListUpdate = (val) => { currentList.value = val; }; const onCheckedAllUpdate = (val) => { providerRef2 == null ? void 0 : providerRef2.value.updateCheckedAll(val); }; const onItemIsCheckedUpdate = (item, val) => { providerRef2 == null ? void 0 : providerRef2.value.updateItemIsCheck(item, val); }; vue.onMounted(() => { providerRef2 == null ? void 0 : providerRef2.value.onCurrentListUpdate(onCurrentListUpdate); }); vue.onUnmounted(() => { providerRef2 == null ? void 0 : providerRef2.value.offCurrentListUpdate(onCurrentListUpdate); }); return { providerRef: providerRef2, currentList, onCheckedAllUpdate, onItemIsCheckedUpdate }; } }); const _withScopeId$3 = (n) => (vue.pushScopeId("data-v-89c571a5"), n = n(), vue.popScopeId(), n); const _hoisted_1$8 = { key: 0, class: "rename-preview" }; const _hoisted_2$7 = { class: "rename-preview-status" }; const _hoisted_3$7 = { class: "rename-preview-content" }; const _hoisted_4$4 = { class: "rename-preview-grid rename-preview-grid-header" }; const _hoisted_5$3 = { class: "rename-preview-grid-item-checkbox" }; const _hoisted_6$1 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "rename-preview-grid-item-old-file-name" }, "原文件名", -1)); const _hoisted_7$1 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "rename-preview-grid-item-right-arrow" }, "⮕", -1)); const _hoisted_8$1 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "rename-preview-grid-item-new-file-name" }, "新文件名", -1)); const _hoisted_9$1 = { class: "rename-preview-grid-item-new-file-status" }; const _hoisted_10$1 = { class: "rename-preview-grid rename-preview-grid-body" }; const _hoisted_11$1 = { class: "rename-preview-grid-item-checkbox" }; const _hoisted_12$1 = ["title"]; const _hoisted_13 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "rename-preview-grid-item-right-arrow" }, "⮕", -1)); const _hoisted_14 = ["title"]; const _hoisted_15 = { class: "rename-preview-grid-item-new-file-status" }; function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) { const _component_material_checkbox = vue.resolveComponent("material-checkbox"); const _component_icon_frown_outlined = vue.resolveComponent("icon-frown-outlined"); const _component_icon_meh_outlined = vue.resolveComponent("icon-meh-outlined"); const _component_icon_smile_outlined = vue.resolveComponent("icon-smile-outlined"); const _component_icon_check_circle_outlined = vue.resolveComponent("icon-check-circle-outlined"); const _component_icon_loading = vue.resolveComponent("icon-loading"); const _component_icon_check_outlined = vue.resolveComponent("icon-check-outlined"); const _component_icon_close_outlined = vue.resolveComponent("icon-close-outlined"); const _component_material_loading = vue.resolveComponent("material-loading"); return _ctx.providerRef ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [ vue.createElementVNode("div", _hoisted_2$7, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.providerRef.statusList, (item) => { return vue.openBlock(), vue.createElementBlock("span", { key: item.message, class: vue.normalizeClass(["rename-preview-status-item", item.className]) }, vue.toDisplayString(item.message), 3); }), 128)) ]), vue.createElementVNode("div", _hoisted_3$7, [ vue.createElementVNode("ul", _hoisted_4$4, [ vue.createElementVNode("li", { class: vue.normalizeClass(["rename-preview-grid-item", { "is-error": _ctx.providerRef.hasError, "is-change": _ctx.providerRef.hasChange, "is-checked": !_ctx.providerRef.hasUncheckedAll }]) }, [ vue.createElementVNode("div", _hoisted_5$3, [ vue.createVNode(_component_material_checkbox, { "model-value": _ctx.providerRef.hasCheckedAll, indeterminate: !_ctx.providerRef.hasCheckedAll && !_ctx.providerRef.hasUncheckedAll, "onUpdate:modelValue": _ctx.onCheckedAllUpdate }, null, 8, ["model-value", "indeterminate", "onUpdate:modelValue"]) ]), _hoisted_6$1, _hoisted_7$1, _hoisted_8$1, vue.createElementVNode("div", _hoisted_9$1, [ _ctx.providerRef.hasError ? (vue.openBlock(), vue.createBlock(_component_icon_frown_outlined, { key: 0 })) : !_ctx.providerRef.hasChange ? (vue.openBlock(), vue.createBlock(_component_icon_meh_outlined, { key: 1 })) : _ctx.providerRef.shouldContinue ? (vue.openBlock(), vue.createBlock(_component_icon_smile_outlined, { key: 2 })) : vue.createCommentVNode("", true) ]) ], 2) ]), vue.createElementVNode("ul", _hoisted_10$1, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.currentList, (item) => { return vue.openBlock(), vue.createElementBlock("li", { key: item.id, class: vue.normalizeClass(["rename-preview-grid-item", { "is-error": item.isError, "is-change": item.isChange, "is-checked": item.isChecked }]) }, [ vue.createElementVNode("div", _hoisted_11$1, [ vue.createVNode(_component_material_checkbox, { "model-value": item.isChecked, readonly: item.status !== "none", "onUpdate:modelValue": ($event) => _ctx.onItemIsCheckedUpdate(item, $event) }, null, 8, ["model-value", "readonly", "onUpdate:modelValue"]) ]), vue.createElementVNode("div", { class: "rename-preview-grid-item-old-file-name", title: item.oldFileName }, vue.toDisplayString(item.oldFileName), 9, _hoisted_12$1), _hoisted_13, vue.createElementVNode("div", { class: "rename-preview-grid-item-new-file-name", title: item.newFileName }, vue.toDisplayString(item.newFileName), 9, _hoisted_14), vue.createElementVNode("div", _hoisted_15, [ item.status === "ready" ? (vue.openBlock(), vue.createBlock(_component_icon_check_circle_outlined, { key: 0 })) : item.status === "pending" ? (vue.openBlock(), vue.createBlock(_component_icon_loading, { key: 1 })) : item.status === "success" ? (vue.openBlock(), vue.createBlock(_component_icon_check_outlined, { key: 2 })) : item.status === "fail" ? (vue.openBlock(), vue.createBlock(_component_icon_close_outlined, { key: 3 })) : vue.createCommentVNode("", true) ]) ], 2); }), 128)) ]) ]), _ctx.providerRef.isPreviewLoading ? (vue.openBlock(), vue.createBlock(_component_material_loading, { key: 0 })) : vue.createCommentVNode("", true) ])) : vue.createCommentVNode("", true); } const RenamePreview = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$8], ["__scopeId", "data-v-89c571a5"]]); const _sfc_main$7 = vue.defineComponent({ name: "RenamePanel", components: { RenameControl, RenamePreview, MaterialLoading }, setup() { const providerRef2 = vue.inject("providerRef"); const onMaskClick = () => { if (!(providerRef2 == null ? void 0 : providerRef2.value.isLoading)) { providerRef2 == null ? void 0 : providerRef2.value.setVisible(false); } }; return { providerRef: providerRef2, onMaskClick }; } }); const _hoisted_1$7 = { key: 0, class: "rename-panel" }; const _hoisted_2$6 = { key: 0, class: "rename-panel-container" }; const _hoisted_3$6 = { class: "rename-panel-container-content" }; const _hoisted_4$3 = { class: "rename-panel-container-content-header" }; const _hoisted_5$2 = { class: "rename-panel-container-content-body" }; function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) { const _component_rename_control = vue.resolveComponent("rename-control"); const _component_rename_preview = vue.resolveComponent("rename-preview"); const _component_material_loading = vue.resolveComponent("material-loading"); return vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [ _ctx.providerRef ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [ vue.createVNode(vue.Transition, { name: "fade" }, { default: vue.withCtx(() => [ _ctx.providerRef.visible ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: "rename-panel-mask", onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onMaskClick && _ctx.onMaskClick(...args)) })) : vue.createCommentVNode("", true) ]), _: 1 }), vue.createVNode(vue.Transition, { name: "fade-bottom" }, { default: vue.withCtx(() => [ _ctx.providerRef.visible ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$6, [ vue.createElementVNode("div", _hoisted_3$6, [ vue.createElementVNode("div", _hoisted_4$3, [ vue.createVNode(_component_rename_control) ]), vue.createElementVNode("div", _hoisted_5$2, [ vue.createVNode(_component_rename_preview) ]), _ctx.providerRef.isLoading ? (vue.openBlock(), vue.createBlock(_component_material_loading, { key: 0 })) : vue.createCommentVNode("", true) ]) ])) : vue.createCommentVNode("", true) ]), _: 1 }) ])) : vue.createCommentVNode("", true) ]); } const RenamePanel = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7], ["__scopeId", "data-v-a9a4dbf6"]]); const _sfc_main$6 = vue.defineComponent({ name: "App", components: { RenamePanel }, setup() { vue.provide("version", useVersion()); const providerRef2 = vue.inject("providerRef"); const EnterComponent2 = vue.computed( () => { var _a, _b; return (_b = (_a = providerRef2 == null ? void 0 : providerRef2.value) == null ? void 0 : _a.EnterComponent) == null ? void 0 : _b.call(_a); } ); return { EnterComponent: EnterComponent2 }; } }); const _hoisted_1$6 = { key: 1 }; function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) { const _component_rename_panel = vue.resolveComponent("rename-panel"); return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [ vue.createVNode(vue.Transition, { name: "fade" }, { default: vue.withCtx(() => [ _ctx.EnterComponent ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.EnterComponent), { key: 0 })) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6)) ]), _: 1 }), vue.createVNode(_component_rename_panel) ], 64); } const App = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6]]); const _sfc_main$5 = vue.defineComponent({ name: "IconEditCircleOutlined" }); const _hoisted_1$5 = { class: "icon", "data-icon": "edit-circle", fill: "currentColor", width: "1em", height: "1em", viewBox: "64 64 896 896", focusable: "false", "aria-hidden": "true" }; const _hoisted_2$5 = /* @__PURE__ */ vue.createElementVNode("path", { d: "M712.533333 288c-25.6-25.6-66.133333-25.6-89.6 0L362.666667 546.133333c-6.4 6.4-12.8 14.933333-17.066667 23.466667l-53.333333 117.333333c-14.933333 32 19.2 66.133333 51.2 51.2l117.333333-53.333333c8.533333-4.266667 17.066667-10.666667 23.466667-17.066667l258.133333-258.133333c25.6-25.6 25.6-66.133333 0-89.6l-29.866667-32zM448 631.466667c-2.133333 2.133333-6.4 4.266667-10.666667 6.4l-85.333333 38.4 38.4-85.333334c2.133333-4.266667 4.266667-6.4 6.4-10.666666l194.133333-194.133334 49.066667 49.066667-192 196.266667z m258.133333-258.133334l-27.733333 27.733334-49.066667-49.066667 27.733334-27.733333c4.266667-4.266667 12.8-4.266667 17.066666 0l29.866667 29.866666c6.4 4.266667 6.4 12.8 2.133333 19.2z" }, null, -1); const _hoisted_3$5 = /* @__PURE__ */ vue.createElementVNode("path", { d: "M512 85.333333C277.333333 85.333333 85.333333 277.333333 85.333333 512s192 426.666667 426.666667 426.666667 426.666667-192 426.666667-426.666667S746.666667 85.333333 512 85.333333z m0 802.133334c-206.933333 0-375.466667-168.533333-375.466667-375.466667S305.066667 136.533333 512 136.533333 887.466667 305.066667 887.466667 512 718.933333 887.466667 512 887.466667z" }, null, -1); const _hoisted_4$2 = [ _hoisted_2$5, _hoisted_3$5 ]; function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$5, _hoisted_4$2); } const IconEditCircleOutlined = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]); const _sfc_main$4 = vue.defineComponent({ name: "EnterComponentAli", components: { IconEditCircleOutlined }, setup() { const providerRef2 = vue.inject("providerRef"); const onClick = () => { providerRef2 == null ? void 0 : providerRef2.value.setVisible(true); }; return { onClick }; } }); const _withScopeId$2 = (n) => (vue.pushScopeId("data-v-cc9839e5"), n = n(), vue.popScopeId(), n); const _hoisted_1$4 = { class: "enter-component" }; const _hoisted_2$4 = { class: "enter-component-button-icon" }; const _hoisted_3$4 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "enter-component-button-text" }, "重命名", -1)); function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) { const _component_icon_edit_circle_outlined = vue.resolveComponent("icon-edit-circle-outlined"); return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [ vue.createElementVNode("button", { type: "button", class: "enter-component-button", onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args)) }, [ vue.createElementVNode("span", _hoisted_2$4, [ vue.createVNode(_component_icon_edit_circle_outlined) ]), _hoisted_3$4 ]) ]); } const EnterComponent$2 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__scopeId", "data-v-cc9839e5"]]); const error = { name: "error", fill: "#F56C6C", viewBox: "0 0 1024 1024", path: "M512,952C269,952,72,755,72,512S269,72,512,72s440,197,440,440S755,952,512,952z M579.7,512l101.6-101.6 c18.7-18.7,18.7-49,0-67.7c-18.7-18.7-49-18.7-67.7,0l0,0L512,444.3L410.4,342.7c-18.7-18.7-49-18.7-67.7,0s-18.7,49,0,67.7 L444.3,512L342.7,613.6c-18.7,18.7-18.7,49,0,67.7c18.7,18.7,49,18.7,67.7,0L512,579.7l101.6,101.6c18.7,18.7,49,18.7,67.7,0 c18.7-18.7,18.7-49,0-67.7L579.7,512z" }; const info = { name: "info", fill: "#1CADF2", viewBox: "0 0 1024 1024", path: "M512,72C269,72,72,269,72,512s197,440,440,440s440-197,440-440S755,72,512,72z M581,673.9 c-33.2,49.9-67,88.3-123.8,88.3c-38.8-6.3-54.7-34.1-46.3-62.4L484,457.6c1.8-5.9-1.2-12.3-6.6-14.2c-5.4-1.9-15.9,5.1-25.1,15.1 l-44.2,53.2c-1.2-8.9-0.1-23.7-0.1-29.6c33.2-49.9,87.8-89.2,124.8-89.2c35.2,3.6,51.8,31.7,45.7,62.6l-73.6,243.3 c-1,5.5,1.9,11.1,6.9,12.8c5.4,1.9,16.8-5.1,26-15.1l44.2-53.1C583,652.3,581,667.9,581,673.9z M571.2,357.6 c-28,0-50.6-20.4-50.6-50.4c0-30,22.7-50.3,50.6-50.3c28,0,50.6,20.4,50.6,50.3C621.8,337.3,599.1,357.6,571.2,357.6z" }; const success = { name: "success", fill: "#17B77E", viewBox: "0 0 1024 1024", path: "M512,72C269,72,72,269,72,512s197,440,440,440s440-197,440-440S755,72,512,72L512,72z M758.9,374 c-48.5,48.6-81.2,76.9-172.3,186.8c-52.6,63.4-102.3,131.5-102.7,132L462.1,720c-4.6,6.1-13.5,6.8-19.1,1.6L267.9,558.9 c-17.8-16.5-18.8-44.4-2.3-62.2s44.4-18.8,62.2-2.3l104.9,97.5c5.5,5.1,14.1,4.5,18.9-1.3c16.2-20.1,38.4-44.5,62.4-68.6 c90.2-90.9,145.6-139.7,175.2-161.3c36-26.2,77.3-48.6,87.3-36.2C792,343.9,782.5,350.3,758.9,374L758.9,374z" }; const warning = { name: "warning", fill: "#FFC603", viewBox: "0 0 1024 1024", path: "M512,952C269,952,72,755,72,512S269,72,512,72s440,197,440,440S755,952,512,952z M510,770.8 c30.4,0,55-24.6,55-55s-24.6-55-55-55s-55,24.6-55,55S479.6,770.8,510,770.8z M509.8,255.3c-39.3,0-71.2,31.9-71.2,71.2 c0,3.1,0.2,6.2,0.6,9.3L472.4,588c2.5,19.3,18.9,33.7,38.4,33.7c19.4,0,35.8-14.4,38.2-33.7l31.8-252.2c5-39.2-22.8-75-62-79.9 C515.9,255.5,512.8,255.3,509.8,255.3z" }; const loading = { name: "loading", viewBox: "0 0 50 50", html: '' }; const icons = { error, info, success, warning, loading }; const _sfc_main$3 = vue.defineComponent({ name: "MaterialIcon", props: { name: String, color: String }, setup(props) { const svg = vue.computed(() => { if (!props.name) return void 0; return icons[props.name]; }); const style = vue.computed(() => ({ color: props.color ? props.color : svg.value.fill ? svg.value.fill : null })); return { svg, style }; } }); const _hoisted_1$3 = ["viewBox"]; const _hoisted_2$3 = ["innerHTML"]; const _hoisted_3$3 = ["d"]; const _hoisted_4$1 = ["innerHTML"]; const _hoisted_5$1 = { key: 1, class: "m-svg-icon" }; function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) { return _ctx.svg ? (vue.openBlock(), vue.createElementBlock("span", { key: 0, class: vue.normalizeClass(["m-svg-icon", "m-svg-icon--" + _ctx.name]) }, [ (vue.openBlock(), vue.createElementBlock("svg", { version: "1.1", xmlns: "http://www.w3.org/2000/svg", viewBox: _ctx.svg.viewBox, style: vue.normalizeStyle(_ctx.style), class: vue.normalizeClass(_ctx.svg.class) }, [ _ctx.svg.defs ? (vue.openBlock(), vue.createElementBlock("defs", { key: 0, innerHTML: _ctx.svg.defs }, null, 8, _hoisted_2$3)) : vue.createCommentVNode("", true), _ctx.svg.path ? (vue.openBlock(), vue.createElementBlock("path", { key: 1, fill: "currentColor", d: _ctx.svg.path }, null, 8, _hoisted_3$3)) : vue.createCommentVNode("", true), _ctx.svg.html ? (vue.openBlock(), vue.createElementBlock("g", { key: 2, innerHTML: _ctx.svg.html }, null, 8, _hoisted_4$1)) : vue.createCommentVNode("", true), vue.renderSlot(_ctx.$slots, "default") ], 14, _hoisted_1$3)) ], 2)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$1)); } const MaterialIcon = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]); function useTimeout(cb, time) { const t = vue.ref(0); t.value = window.setTimeout(cb, time); return { stop() { window.clearTimeout(t.value); } }; } const _sfc_main$2 = vue.defineComponent({ components: { MaterialIcon }, name: "MaterialMessage", emits: ["close", "destroy", "collapsed"], props: { id: String, type: { type: String, default: "info" }, title: String, message: String, iconURL: String, duration: { type: Number, default: 3e3 }, isCollapsed: Boolean, collapsable: Boolean, supportHTML: Boolean, width: String, className: String, wrapperClassName: String, closable: Boolean, stopTimerOnHover: { type: Boolean, default: true } }, setup(props, { expose, emit }) { const state = vue.reactive({ visible: true, collapsed: props.isCollapsed, timer: null }); let stopTimer; const startTimer = () => { if (props.duration < 0) return; ({ stop: stopTimer } = useTimeout(() => { close(); }, props.duration)); }; const clearTimer = () => { stopTimer == null ? void 0 : stopTimer(); }; const close = () => { state.visible = false; }; const triggerCollapse = () => { state.collapsed = !state.collapsed; emit("collapsed", state.collapsed); }; const handleClose = () => { state.visible = false; }; const handleClearTimer = () => { props.stopTimerOnHover && clearTimer(); }; const handleStartTimer = () => { props.stopTimerOnHover && startTimer(); }; vue.onBeforeMount(() => { clearTimer(); }); vue.onMounted(() => { startTimer(); }); expose({ close }); return { state, handleClearTimer, handleStartTimer, triggerCollapse, handleClose }; } }); const _hoisted_1$2 = ["id"]; const _hoisted_2$2 = { key: 0, class: "m-message-icons" }; const _hoisted_3$2 = ["src"]; const _hoisted_4 = { class: "m-message-content" }; const _hoisted_5 = { key: 0, class: "m-message--title" }; const _hoisted_6 = ["innerHTML"]; const _hoisted_7 = { key: 0, class: "m-message--description" }; const _hoisted_8 = { class: "m-message--control" }; const _hoisted_9 = /* @__PURE__ */ vue.createElementVNode("svg", { viewBox: "0 0 35 35", width: "20", height: "20", version: "1.1", fill: "currentColor" }, [ /* @__PURE__ */ vue.createElementVNode("path", { d: "M9.4,13.9c-0.2,0.2-0.2,0.6,0,0.8l8.1,8.1l0,0l0,0l8.1-8.1c0.2-0.2,0.2-0.6,0-0.8l-1.3-1.3 c-0.2-0.2-0.6-0.2-0.8,0l-5.5,5.5c-0.2,0.2-0.6,0.2-0.8,0l-5.5-5.5c-0.2-0.2-0.6-0.2-0.8,0L9.4,13.9z" }) ], -1); const _hoisted_10 = [ _hoisted_9 ]; const _hoisted_11 = /* @__PURE__ */ vue.createElementVNode("svg", { viewBox: "0 0 35 35", width: "20", height: "20", version: "1.1", fill: "currentColor" }, [ /* @__PURE__ */ vue.createElementVNode("path", { d: "M19.5,17.5l5.1,5.1l-2,2l-5.1-5.1l-5.1,5.1l-2-2l5.1-5.1l-5.1-5.1l2-2l5.1,5.1l5.1-5.1l2,2L19.5,17.5z" }) ], -1); const _hoisted_12 = [ _hoisted_11 ]; function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) { const _component_MaterialIcon = vue.resolveComponent("MaterialIcon"); return vue.openBlock(), vue.createBlock(vue.Transition, { name: "m-message-fade", appear: "", mode: "in-out", onBeforeLeave: _cache[4] || (_cache[4] = ($event) => _ctx.$emit("close")), onAfterLeave: _cache[5] || (_cache[5] = ($event) => _ctx.$emit("destroy")) }, { default: vue.withCtx(() => [ _ctx.state.visible ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: vue.normalizeClass(["m-message-wrapper", _ctx.wrapperClassName]), id: _ctx.id, style: vue.normalizeStyle({ width: _ctx.width }) }, [ vue.createElementVNode("div", { class: vue.normalizeClass(["m-message", _ctx.className]), onMouseenter: _cache[2] || (_cache[2] = (...args) => _ctx.handleClearTimer && _ctx.handleClearTimer(...args)), onMouseleave: _cache[3] || (_cache[3] = (...args) => _ctx.handleStartTimer && _ctx.handleStartTimer(...args)) }, [ _ctx.iconURL || _ctx.type ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, [ _ctx.iconURL ? (vue.openBlock(), vue.createElementBlock("img", { key: 0, src: _ctx.iconURL, class: "m-message--icon" }, null, 8, _hoisted_3$2)) : _ctx.type ? (vue.openBlock(), vue.createBlock(_component_MaterialIcon, { key: 1, name: _ctx.type, class: "m-message--icon" }, null, 8, ["name"])) : vue.createCommentVNode("", true) ])) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_4, [ _ctx.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [ vue.renderSlot(_ctx.$slots, "title", {}, () => [ vue.createTextVNode(vue.toDisplayString(_ctx.title), 1) ]) ])) : vue.createCommentVNode("", true), _ctx.supportHTML && _ctx.message ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [ !_ctx.state.collapsed ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: "m-message--description", innerHTML: _ctx.message }, null, 8, _hoisted_6)) : vue.createCommentVNode("", true) ], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [ !_ctx.state.collapsed ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [ vue.renderSlot(_ctx.$slots, "default", {}, () => [ vue.createTextVNode(vue.toDisplayString(_ctx.message), 1) ]) ])) : vue.createCommentVNode("", true) ], 64)) ]), vue.createElementVNode("div", _hoisted_8, [ _ctx.collapsable && (_ctx.title || _ctx.$slots.title) ? (vue.openBlock(), vue.createElementBlock("button", { key: 0, class: vue.normalizeClass(["m-message--button m-message--arrow-down", { "is-collapsed": _ctx.state.collapsed }]), onClick: _cache[0] || (_cache[0] = (...args) => _ctx.triggerCollapse && _ctx.triggerCollapse(...args)) }, _hoisted_10, 2)) : vue.createCommentVNode("", true), _ctx.closable ? (vue.openBlock(), vue.createElementBlock("button", { key: 1, class: "m-message--button m-message--close", onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleClose && _ctx.handleClose(...args)) }, _hoisted_12)) : vue.createCommentVNode("", true) ]) ], 34) ], 14, _hoisted_1$2)) : vue.createCommentVNode("", true) ]), _: 3 }); } const MessageComponent = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]); const instances = []; let seed = 0; const containers = {}; let globalsOptions = {}; const defaultOptions = { stopTimerOnHover: true, duration: 3e3 }; const message = (options) => { const id = "m-message-" + seed++; const props = { ...defaultOptions, ...globalsOptions, ...options, id }; delete props.hasMask; delete props.position; delete props.zIndex; const position = options.position || "top-center"; const hasMask = options.hasMask || false; const containerKey = position + (hasMask ? "-mask" : ""); let container = containers[containerKey]; if (!container) { container = containers[containerKey] = { el: document.createElement("div"), count: 1 }; container.el.className = [ "m-message-container", "is-" + position, hasMask ? "has-mask" : "" ].filter(function(e) { return !!e; }).join(" "); document.body.appendChild(container.el); } else { container.count++; } if (options.zIndex) { container.el.style.zIndex = String(options.zIndex); } let children = null; if (vue.isVNode(options.message)) { children = { default: () => options.message }; props.message = ""; } else if (typeof options.message === "function") { children = { default: options.message }; props.message = ""; } const vm = vue.createVNode(MessageComponent, props, children); const div = document.createElement("div"); vm.appContext = options.ctx || message._context || null; vm.props.onClose = options.onClose; vm.props.onDestroy = () => { container.count--; if (container.count === 0) { delete containers[containerKey]; container.el.remove(); } vue.render(null, div); }; vue.render(vm, div); if (position.indexOf("bottom") === 0 && container.el.firstChild) { container.el.insertBefore(div.firstElementChild, container.el.firstChild); } else { container.el.appendChild(div.firstElementChild); } const instance = { id, close() { var _a, _b; (_b = (_a = vm == null ? void 0 : vm.component) == null ? void 0 : _a.exposed) == null ? void 0 : _b.close(); } }; instances.push(instance); return instance; }; message.success = (msg, options) => message({ ...options, type: "success", message: msg }); message.info = (msg, options) => message({ ...options, type: "info", message: msg }); message.warning = (msg, options) => message({ ...options, type: "warning", message: msg }); message.error = (msg, options) => message({ ...options, type: "error", message: msg }); message.loading = (msg, options) => message({ ...options, type: "loading", message: msg }); message.closeAll = function() { for (let i = instances.length - 1; i >= 0; i--) { instances[i].close(); } }; message.setDefault = (opts) => { globalsOptions = { ...opts }; }; const complementZero = (payload) => { if (isString(payload)) { payload = parseInt(payload); if (isNaN(payload)) { return ""; } } return (payload < 10 ? "0" : "") + payload; }; class Provider { constructor() { // 显示加载 __publicField(this, "isLoading", false); // 更新加载中 __publicField(this, "isUpdateLoading", false); // 控制加载中 __publicField(this, "isControlLoading", false); // 预览加载中 __publicField(this, "isPreviewLoading", false); // 主面板显示控制 __publicField(this, "visible", false); // 替换参数 __publicField(this, "replaceParams", new ReplaceParams( () => this._onReplaceParamsUpdate.call(this) )); // 替换参数禁用 __publicField(this, "replaceParamsDisabled", false); // 原始文件列表数据 __publicField(this, "originList", []); // 当前文件列表数据 __publicField(this, "_currentList", []); // 文件列表更新回调函数集合 __publicField(this, "_currentListUpdateHandlerSet", /* @__PURE__ */ new Set()); // 取消选中的文件列表 __publicField(this, "_uncheckedList", /* @__PURE__ */ new Set()); // 空名计数 __publicField(this, "_emptyCount", 0); // 错误计数 __publicField(this, "_errorCount", 0); // 重复计数 __publicField(this, "_repeatCount", 0); // 变更计数 __publicField(this, "_changeCount", 0); // 匹配计数 __publicField(this, "_matchedCount", 0); // 状态计数 __publicField(this, "_failStatusCount", 0); __publicField(this, "_pendingStatusCount", 0); __publicField(this, "_successStatusCount", 0); // 是否有错误 __publicField(this, "hasError", false); // 是否有变更 __publicField(this, "hasChange", false); // 是否全选 __publicField(this, "hasCheckedAll", false); // 是否全不选 __publicField(this, "hasUncheckedAll", false); // 是否可继续 __publicField(this, "shouldContinue", false); // 状态列表 __publicField(this, "statusList", []); } // 匹配测试 static test() { return false; } setVisible(val = false) { if (!val && (this.isLoading || this.isUpdateLoading || this.isControlLoading || this.isPreviewLoading)) { return false; } this.visible = val; if (val) { this._updateOriginList(); } } // 替换参数更新回调函数 _onReplaceParamsUpdate() { this._updateCurrentList(); } // 重置替换参数 _resetReplaceParams() { this.replaceParams.reset(); } // 更新原始文件列表数据 _updateOriginList() { this.isLoading = true; this._uncheckedList = /* @__PURE__ */ new Set(); this.getOriginList().then((res) => { this.isLoading = false; this.originList = res; this._updateCurrentList(); }).catch(() => { this.isLoading = false; this.originList = []; this._updateCurrentList(); }); } get currentList() { return this._currentList; } // 更新当前文件列表数据 _updateCurrentList() { const renameMode = this.replaceParams.renameMode; const result = this.originList.map((item) => { return { id: item.id, ext: item.ext, status: "none", isEmpty: false, isError: false, isRepeat: false, fileName: item.fileName, isChange: false, isMatched: true, isChecked: !this._uncheckedList.has(item.id), isLoading: false, oldFileName: item.fullFileName, newFileName: "" }; }); const newFileNameSet = /* @__PURE__ */ new Set(); if (renameMode === RENAME_MODE_SERIES) { if (this.replaceParams.title || this.replaceParams.season) { const season = this.replaceParams.season ? ".S" + complementZero(this.replaceParams.season) : ""; result.forEach((item, index) => { const fileName = this.replaceParams.title || item.fileName; let newFileName = fileName + season; if (this.replaceParams.autoEpisode) { const episode = (season ? "" : ".") + "E" + complementZero(index + 1); newFileName += episode; } newFileName += "." + item.ext; item.newFileName = newFileName.trim(); this._listItemGeneralMethod(item, newFileNameSet); }); } } if (renameMode === RENAME_MODE_PATTERN) { let regexp2; if (this.replaceParams.pattern) { try { regexp2 = new RegExp(this.replaceParams.pattern); } catch (error2) { console.error("regexp error", error2); } if (regexp2) { result.forEach((item, index) => { if (this.replaceParams.autoEpisode) { item.isMatched = !!(regexp2 == null ? void 0 : regexp2.test(item.fileName)); if (item.isMatched) { let newFileName = item.fileName.replace( regexp2, this.replaceParams.replace ); newFileName += (newFileName ? ".E" : "E") + complementZero(index + 1); if (newFileName) { newFileName += "." + item.ext; } item.newFileName = newFileName.trim(); this._listItemGeneralMethod(item, newFileNameSet); } } else { item.isMatched = !!(regexp2 == null ? void 0 : regexp2.test(item.oldFileName)); if (item.isMatched) { item.newFileName = item.oldFileName.replace( regexp2, this.replaceParams.replace ); this._listItemGeneralMethod(item, newFileNameSet); } } }); } } } this._currentList = result; this._updateStatus(); this._emitCurrentListUpdateHandler(); } // 文件列表项通用处理 _listItemGeneralMethod(item, newFileNameSet) { item.isChange = item.oldFileName !== item.newFileName; item.isEmpty = item.isChecked && !item.newFileName; item.isRepeat = item.isChecked && !!item.newFileName && newFileNameSet.has(item.newFileName); item.isError = item.isEmpty || item.isRepeat; item.isChecked && newFileNameSet.add(item.newFileName); } // 绑定文件列表更新回调函数 onCurrentListUpdate(handler) { if (!this._currentListUpdateHandlerSet.has(handler)) { this._currentListUpdateHandlerSet.add(handler); } } // 解绑文件列表更新回调函数 offCurrentListUpdate(handler) { if (this._currentListUpdateHandlerSet.has(handler)) { this._currentListUpdateHandlerSet.delete(handler); } } // 触发文件列表更新回调函数 _emitCurrentListUpdateHandler() { this._currentListUpdateHandlerSet.forEach((handler) => { handler(this._currentList); }); } // 更新是否选中文件列表 updateItemIsCheck(item, val) { if (val) { this._uncheckedList.delete(item.id); } else { this._uncheckedList.add(item.id); } this._updateCurrentList(); } // 更新是否全选 updateCheckedAll(val) { if (val) { this._uncheckedList = /* @__PURE__ */ new Set(); } else { this._currentList.forEach((item) => { this._uncheckedList.add(item.id); }); } this._updateCurrentList(); } _updateStatus() { let emptyCount = 0; let errorCount = 0; let repeatCount = 0; let changeCount = 0; let matchedCount = 0; let failStatusCount = 0; let pendingStatusCount = 0; let successStatusCount = 0; this._currentList.forEach((item) => { if (item.isChecked) { item.isEmpty && emptyCount++; item.isError && errorCount++; item.isRepeat && repeatCount++; item.isChange && changeCount++; item.isMatched && matchedCount++; } if (item.status === "success") { successStatusCount++; } else if (item.status === "fail") { failStatusCount++; } else if (item.status === "pending") { pendingStatusCount++; } }); this._emptyCount = emptyCount; this._errorCount = errorCount; this._repeatCount = repeatCount; this._changeCount = changeCount; this._matchedCount = matchedCount; this._failStatusCount = failStatusCount; this._pendingStatusCount = pendingStatusCount; this._successStatusCount = successStatusCount; this.hasError = this._errorCount > 0; this.hasChange = this._changeCount > 0; this.shouldContinue = !this.hasError && this.hasChange; this.hasCheckedAll = this._uncheckedList.size === 0; this.hasUncheckedAll = this._uncheckedList.size === this._currentList.length; this._updateStatusList(); } _updateStatusList() { const result = []; if (!this._currentList.length) { result.push({ message: "❌" }, { message: " 无文件" }); } else { if (this.isUpdateLoading) { if (this._pendingStatusCount) { result.push({ message: `加载中(${this._pendingStatusCount})`, className: "blue" }); } if (this._successStatusCount) { result.push({ message: `成功(${this._successStatusCount})`, className: "green" }); } if (this._failStatusCount) { result.push({ message: `失败(${this._failStatusCount})`, className: "red" }); } } else if (this.shouldContinue) { result.push( { message: "✅" }, { message: "准备就绪", className: "green" } ); } if (!this.hasChange) { result.push( { message: "❕" }, { message: "暂无改动", className: "yellow" } ); } if (this._emptyCount) { result.push( { message: "❌" }, { message: `文件名为空(${this._emptyCount})`, className: "red" } ); } if (this._repeatCount) { result.push( { message: "❌" }, { message: `文件名重复(${this._repeatCount})`, className: "red" } ); } const checked = this._currentList.length - this._uncheckedList.size; if (this._uncheckedList.size && checked) { if (this._uncheckedList.size > checked) { result.push({ message: `已选中(${checked})`, className: "blue" }); } else { result.push({ message: `未选中(${this._uncheckedList.size})`, className: "yellow" }); } } const unmatchedCount = checked - this._matchedCount; if (unmatchedCount && this._matchedCount) { if (unmatchedCount > this._matchedCount) { result.push({ message: `已匹配(${this._matchedCount})`, className: "blue" }); } else { result.push({ message: `未匹配(${unmatchedCount})`, className: "yellow" }); } } } this.statusList = result; } // 批量重命名 batchRename() { if (!this.shouldContinue) { return; } this.isUpdateLoading = true; this.replaceParamsDisabled = true; this._updateStatusList(); const data = this.currentList.filter( (item) => item.isChecked && item.isChange && !item.isError ); this.renameRequest(data).then(() => { this.type !== "baidu" && message.success("批量重命名成功"); this.visible = false; this._resetReplaceParams(); }).catch(() => { this.refresh().then(() => { this._updateOriginList(); }); }).finally(() => { this.isUpdateLoading = false; this.replaceParamsDisabled = false; this._updateStatusList(); }); } // 重置 reset() { this._resetReplaceParams(); this._updateOriginList(); } } class ReplaceParams { constructor(onUpdateHandler) { // 剧名 __publicField(this, "_title", ""); // 季数 __publicField(this, "_season", ""); // 正则 __publicField(this, "_pattern", ""); // 替换文本 __publicField(this, "_replace", ""); // 自动集数 __publicField(this, "_autoEpisode", true); // 重命名模式 __publicField(this, "_renameMode", RENAME_MODE_SERIES); // private _onUpdateTimer: NodeJS.Timeout | undefined; __publicField(this, "_onUpdate", () => { this.onUpdateHandler && this.onUpdateHandler(this); }); __publicField(this, "onUpdateHandler"); this.onUpdateHandler = onUpdateHandler; } get title() { return this._title; } set title(val) { this._title = val; this._onUpdate(); } get season() { return this._season; } set season(val) { this._season = val; this._onUpdate(); } get pattern() { return this._pattern; } set pattern(val) { this._pattern = val; this._onUpdate(); } get replace() { return this._replace; } set replace(val) { this._replace = val; this._onUpdate(); } get autoEpisode() { return this._autoEpisode; } set autoEpisode(val) { this._autoEpisode = val; this._onUpdate(); } get renameMode() { return this._renameMode; } set renameMode(val) { this._renameMode = val; this._onUpdate(); } reset(val) { this.title = (val == null ? void 0 : val.title) || ""; this.season = (val == null ? void 0 : val.season) || ""; this.pattern = (val == null ? void 0 : val.pattern) || ""; this.replace = (val == null ? void 0 : val.replace) || ""; this.autoEpisode = val ? !!val.autoEpisode : true; this.renameMode = (val == null ? void 0 : val.renameMode) || RENAME_MODE_SERIES; } } const RENAME_MODE_SERIES = "series"; const RENAME_MODE_PATTERN = "pattern"; function querySelector(selectors, isPromise, timeout = 100) { let element = document.querySelector(selectors); if (isUndefined(isPromise)) { return element; } else if (isBoolean(isPromise)) { if (isPromise) { return element ? Promise.resolve(element) : Promise.reject(selectors + " is not found"); } return element; } else if (element) { return Promise.resolve(element); } else if (isPromise > 0) { return new Promise((resolve, reject) => { const timer = setTimeout(() => { element = document.querySelector(selectors); if (element) { resolve(element); clearInterval(timer); } else if (--isPromise <= 0) { reject(selectors + " is not found"); clearInterval(timer); } }, timeout); }); } else { return Promise.reject(selectors + " is not found"); } } const regexp = /^((.|\n)+)\.([^.]+)$/; const fileNameParse = (payload) => { const matchResult = payload.match(regexp); return { ext: (matchResult == null ? void 0 : matchResult[3]) || "", fileName: (matchResult == null ? void 0 : matchResult[1]) || payload }; }; const findReactFiberNode = (node, check) => { const list = [node]; while (list.length) { const item = list.shift(); if (check(item)) { return item; } else { if (item.child) { list.push(item.child); } if (item.sibling) { list.push(item.sibling); } } } }; let rootReactContainer; function _getRootReactContainer(selectors, isPromise = true) { if (rootReactContainer) { return isPromise ? Promise.resolve(rootReactContainer) : rootReactContainer; } const rootElement = querySelector(selectors); if (!rootElement) { return isPromise ? Promise.reject() : void 0; } const keys = Object.keys(rootElement); const reactContainerKey = keys.find( (item) => item.startsWith("__reactContainer") ); if (!reactContainerKey) { return isPromise ? Promise.reject() : void 0; } rootReactContainer = rootElement[reactContainerKey]; return isPromise ? Promise.resolve(rootReactContainer) : rootReactContainer; } const getRootReactContainer = _getRootReactContainer; class ProviderAli extends Provider { constructor() { super(...arguments); __publicField(this, "type", "ali"); __publicField(this, "rootElementId", "cloud-disk-plugin"); __publicField(this, "rootElementInsertTarget", "[class^=nav-tab-content--]"); __publicField(this, "rootElementInsertMethod", "append"); __publicField(this, "EnterComponent", () => EnterComponent$2); __publicField(this, "_rootReactContainerSelectors", "#root"); } async getOriginList() { const rootReactContainer2 = await getRootReactContainer( this._rootReactContainerSelectors, true ); const reactFiberNode = findReactFiberNode( rootReactContainer2, (node) => { var _a, _b, _c; return (_c = (_b = (_a = node.pendingProps) == null ? void 0 : _a.localStore) == null ? void 0 : _b.listModel) == null ? void 0 : _c.listModel; } ); if (!reactFiberNode) { return Promise.reject(); } const listModel = reactFiberNode.pendingProps.localStore.listModel.listModel; while (listModel.nextMarker) { await listModel.loadMoreData(); } const originList = reactFiberNode.pendingProps.localStore.list; if (!originList) { return Promise.reject(); } const result = []; originList.forEach((item) => { if (item.type === "file") { result.push({ id: item.fileId, fullFileName: item.name, ...fileNameParse(item.name) }); } }); return result; } async renameRequest(data) { const rootReactContainer2 = await getRootReactContainer( this._rootReactContainerSelectors, true ); const reactFiberNode = findReactFiberNode( rootReactContainer2, (node) => { var _a, _b; return (_b = (_a = node.pendingProps) == null ? void 0 : _a.localStore) == null ? void 0 : _b.list; } ); if (!reactFiberNode) { return Promise.reject(); } const originListMap = new Map( reactFiberNode.pendingProps.localStore.list.map((item) => [ item.fileId, item ]) ); const taskList = []; data.forEach((item) => { const originItem = originListMap.get(item.id); if (originItem) { item.status = "ready"; return taskList.push({ item, originItem }); } else { item.status = "fail"; } }); while (taskList.length) { const { item, originItem } = taskList.shift(); item.status = "pending"; try { await originItem.rename(item.newFileName); if (originItem.name === item.newFileName) { item.status = "success"; } else { item.status = "fail"; } } catch (error2) { item.status = "fail"; } this._updateStatus(); } return Promise.resolve(); } async refresh() { const rootReactContainer2 = await getRootReactContainer( this._rootReactContainerSelectors, true ); const reactFiberNode = findReactFiberNode( rootReactContainer2, (node) => { var _a, _b, _c; return (_c = (_b = (_a = node.pendingProps) == null ? void 0 : _a.localStore) == null ? void 0 : _b.listModel) == null ? void 0 : _c.reload; } ); if (!reactFiberNode) { location.reload(); return Promise.resolve(); } const tbodyScroller = querySelector( "[class^=node-list-table-view--]>[class^=tbody--]>div>[class^=scroller---]" ); if (tbodyScroller) { tbodyScroller.scrollTop = 0; } const reload = reactFiberNode.pendingProps.localStore.listModel.reload; return reload(); } } __publicField(ProviderAli, "test", () => /^https:\/\/www\.ali(pan|yundrive)\.com\/drive\/file\/(backup|resource)/.test( location.href )); const _sfc_main$1 = vue.defineComponent({ name: "EnterComponentBaidu", components: { IconEditCircleOutlined }, setup() { const providerRef2 = vue.inject("providerRef"); const onClick = () => { providerRef2 == null ? void 0 : providerRef2.value.setVisible(true); }; return { onClick }; } }); const _withScopeId$1 = (n) => (vue.pushScopeId("data-v-2eae985c"), n = n(), vue.popScopeId(), n); const _hoisted_1$1 = { class: "enter-component" }; const _hoisted_2$1 = { class: "enter-component-button-icon" }; const _hoisted_3$1 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "enter-component-button-text" }, "重命名", -1)); function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { const _component_icon_edit_circle_outlined = vue.resolveComponent("icon-edit-circle-outlined"); return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [ vue.createElementVNode("button", { type: "button", class: "enter-component-button", onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args)) }, [ vue.createElementVNode("span", _hoisted_2$1, [ vue.createVNode(_component_icon_edit_circle_outlined) ]), _hoisted_3$1 ]) ]); } const EnterComponent$1 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-2eae985c"]]); const sleep = (timeout) => { return new Promise((resolve) => { setTimeout(resolve, timeout); }); }; class ProviderBaidu extends Provider { constructor() { super(...arguments); __publicField(this, "type", "baidu"); __publicField(this, "rootElementId", "cloud-disk-plugin"); __publicField(this, "rootElementInsertTarget", ".wp-s-aside-nav__main-top"); __publicField(this, "rootElementInsertMethod", "append"); __publicField(this, "EnterComponent", () => EnterComponent$1); __publicField(this, "_vueInstance"); } async getOriginList() { const vue = this._getVue(); const originList = vue == null ? void 0 : vue.fileList; if (!originList) { return Promise.reject(); } const result = []; originList.forEach((item) => { if (item.isdir === 0) { result.push({ id: item.fs_id, fullFileName: item.formatName, ...fileNameParse(item.formatName) }); } }); return result; } async renameRequest(data) { var _a, _b; const token = (_b = (_a = this._vueInstance) == null ? void 0 : _a.yunData) == null ? void 0 : _b.bdstoken; if (!token) { return Promise.reject(); } const path = this._vueInstance.currentPath + "/"; const body = new FormData(); const filelist = data.map((item) => { item.status = "pending"; return { id: item.id, path: path + item.oldFileName, newname: item.newFileName }; }); this._updateStatus(); this._vueInstance.renameFileList = filelist; body.append("filelist", JSON.stringify(filelist)); this._vueInstance.editLoading = true; return fetch( `https://pan.baidu.com/api/filemanager?async=2&onnest=fail&opera=rename&bdstoken=${token}&clienttype=0&app_id=250528&web=1`, { body, method: "POST" } ).then((res) => { if (res.ok) { return res.json(); } else { return Promise.reject(new Error("filemanager error")); } }).then((res) => { var _a2; if (res.errno === 0) { return res.taskid ? this.waitResult(res, data) : (_a2 = this._vueInstance) == null ? void 0 : _a2.renameSuccess(); } return Promise.reject(res); }).then(() => { this.refresh(); }); } async refresh() { const vue = this._getVue(); if (!(vue == null ? void 0 : vue.reloadList)) { location.reload(); return Promise.resolve(); } vue.reloadList(); return new Promise((resolve) => { let count = 20; const timer = setInterval(() => { if (vue.$store.state.fileList.loadingList === false || --count < 0) { resolve(); clearInterval(timer); } }, 500); }); } async waitResult(res, data) { var _a, _b; (_a = this._vueInstance) == null ? void 0 : _a.pollTask(res.taskid); while ((_b = this._vueInstance) == null ? void 0 : _b.editLoading) { await sleep(100); } } _getVue() { if (this._vueInstance) { return this._vueInstance; } const element = querySelector(".nd-main-list, .nd-new-main-list"); if (!(element == null ? void 0 : element.__vue__)) { return; } this._vueInstance = element.__vue__; return this._vueInstance; } } __publicField(ProviderBaidu, "test", () => /^https:\/\/pan\.baidu\.com\/disk\/main(.+)?#\/index\?category=all/.test( location.href )); const _sfc_main = vue.defineComponent({ name: "EnterComponentQuark", components: { IconEditCircleOutlined }, setup() { const providerRef2 = vue.inject("providerRef"); const onClick = () => { providerRef2 == null ? void 0 : providerRef2.value.setVisible(true); }; return { onClick }; } }); const _withScopeId = (n) => (vue.pushScopeId("data-v-cccc696e"), n = n(), vue.popScopeId(), n); const _hoisted_1 = { class: "enter-component" }; const _hoisted_2 = { class: "enter-component-button-icon" }; const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "enter-component-button-text" }, "重命名", -1)); function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { const _component_icon_edit_circle_outlined = vue.resolveComponent("icon-edit-circle-outlined"); return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [ vue.createElementVNode("button", { type: "button", class: "enter-component-button", onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args)) }, [ vue.createElementVNode("span", _hoisted_2, [ vue.createVNode(_component_icon_edit_circle_outlined) ]), _hoisted_3 ]) ]); } const EnterComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-cccc696e"]]); class ProviderQuark extends Provider { constructor() { super(...arguments); __publicField(this, "type", "quark"); __publicField(this, "rootElementId", "cloud-disk-plugin"); __publicField(this, "rootElementInsertTarget", "#ice-container .section-main > .section-header.list-header > .btn-operate > .btn-main"); __publicField(this, "rootElementInsertMethod", "prepend"); __publicField(this, "EnterComponent", () => EnterComponent); __publicField(this, "_rootReactContainerSelectors", "#ice-container"); } async getOriginList() { var _a, _b; const rootReactContainer2 = await getRootReactContainer( this._rootReactContainerSelectors, true ); const reactFiberNode = findReactFiberNode( rootReactContainer2, (node) => { var _a2, _b2, _c, _d, _e; return (_e = (_d = (_c = (_b2 = (_a2 = node.pendingProps) == null ? void 0 : _a2.store) == null ? void 0 : _b2.getState) == null ? void 0 : _c.call(_b2)) == null ? void 0 : _d.file) == null ? void 0 : _e.listType; } ); if (!reactFiberNode) { return Promise.reject(); } const state = reactFiberNode.pendingProps.store.getState(); const originList = (_b = (_a = state.file) == null ? void 0 : _a[state.file.listType]) == null ? void 0 : _b.list; if (!originList) { return Promise.reject(); } const result = []; originList.forEach((item) => { if (item.file) { result.push({ id: item.fid, fullFileName: item.file_name, ...fileNameParse(item.file_name) }); } }); return result; } async renameRequest(data) { const rootReactContainer2 = await getRootReactContainer( this._rootReactContainerSelectors, true ); const reactFiberNode = findReactFiberNode( rootReactContainer2, (node) => { var _a; return (_a = node.pendingProps) == null ? void 0 : _a.rename; } ); if (!reactFiberNode) { return Promise.reject(); } const taskList = []; data.forEach((item) => { item.status = "ready"; taskList.push(item); }); while (taskList.length) { const item = taskList.shift(); item.status = "pending"; try { const res = await reactFiberNode.pendingProps.rename({ fid: item.id, fileName: item.newFileName }); if (res.status === 200 && res.code === 0) { item.status = "success"; } else { item.status = "fail"; } } catch (error2) { item.status = "fail"; } this._updateStatus(); } return this.refresh(); } async refresh() { const rootReactContainer2 = await getRootReactContainer( this._rootReactContainerSelectors, true ); const reactFiberNode = findReactFiberNode( rootReactContainer2, (node) => { var _a; return (_a = node.pendingProps) == null ? void 0 : _a.onRefresh; } ); if (!reactFiberNode) { location.reload(); return Promise.resolve(); } const reload = reactFiberNode.pendingProps.onRefresh; return reload(); } } __publicField(ProviderQuark, "test", () => /^https:\/\/pan.quark.cn\/list#\/list\//.test(location.href)); let provider; const getProvider = () => { if (ProviderAli.test()) { provider = provider instanceof ProviderAli ? provider : new ProviderAli(); } else if (ProviderBaidu.test()) { provider = provider instanceof ProviderBaidu ? provider : new ProviderBaidu(); } else if (ProviderQuark.test()) { provider = provider instanceof ProviderQuark ? provider : new ProviderQuark(); } else { return void 0; } return provider; }; const providerRef = vue.ref(); const getProviderRef = () => { const instance = getProvider(); if (!providerRef.value && instance || providerRef.value && !instance) { providerRef.value = instance; } return providerRef; }; const loop = () => { const providerRef2 = getProviderRef(); if (!(providerRef2 == null ? void 0 : providerRef2.value)) { return; } const target = querySelector(providerRef2.value.rootElementInsertTarget); const rootElement = querySelector("#" + providerRef2.value.rootElementId); if (target && !rootElement) { const app = vue.createApp(App); app.provide("providerRef", providerRef2); app.mount( (() => { const root = document.createElement("div"); root.setAttribute("id", providerRef2.value.rootElementId); target[providerRef2.value.rootElementInsertMethod](root); return root; })() ); } }; while ((window == null ? void 0 : window.parent) === window) { loop(); await( sleep(300)); } })(Vue);