!function(){function n(n){return function(n){if(Array.isArray(n))return r(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||function(n,t){if(!n)return;if("string"==typeof n)return r(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);"Object"===e&&n.constructor&&(e=n.constructor.name);if("Map"===e||"Set"===e)return Array.from(n);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return r(n,t)}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(n,r){(null==r||r>n.length)&&(r=n.length);for(var t=0,e=new Array(r);t<r;t++)e[t]=n[t];return e}System.register(["./base-legacy-173045dc.js","./index-legacy-b5b2d9a0.js"],(function(r,t){"use strict";var e;return{setters:[function(n){e=n.s},null],execute:function(){r("a",(function(r,t){var e,o=r.name,a=r.url;if(!t||!a||!o)return console.error("构建 kkFileView URL 失败：缺少必要参数。"),null;var c,i=o.lastIndexOf("."),u=-1!==i?o.substring(i):"";c="function"==typeof(null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)?window.crypto.randomUUID():Date.now().toString(36)+Math.random().toString(36).substring(2);var l="".concat(c).concat(u),f=a.includes("?")?"&":"?",s="".concat(a).concat(f,"fullfilename=").concat(l),d=(new TextEncoder).encode(s),h=String.fromCharCode.apply(String,n(d)),p=btoa(h),y=encodeURIComponent(p);return"".concat(t,"/onlinePreview?url=").concat(y)}));var t=r("c",(function(){for(var n=null,r=arguments.length,t=new Array(r),e=0;e<r;e++)t[e]=arguments[e];for(var a=0,c=t;a<c.length;a++){var i=c[a];i&&(n=null!==n?n+"/"+i:i)}return null===n?"":o(n)})),o=(r("d",(function(){return a(t.apply(void 0,arguments))})),r("r",(function(n){var r="";0===n.indexOf("http://")?r="http://":0===n.indexOf("https://")&&(r="https://");for(var t=r.length;t<n.length-1;t++){var e=n.charAt(t),o=n.charAt(t+1);"/"===e&&"/"===o||(r+=e)}return r+=n.charAt(n.length-1)}))),a=function(n){if(e(n))return"";for(var r="",t=-1,o=0;o<n.length;o++){var a=n.charAt(o);if("/"===a){if(t<o){var c=n.substring(t+1,o);r+=encodeURIComponent(c),t=o}r+=a}if(o===n.length-1&&t<o){var i=n.substring(t+1,o+1);r+=encodeURIComponent(i)}}return r};r("b",(function(n){if(!n)return"/share";try{return"/share/".concat(encodeURIComponent(n))}catch(r){return"/share/".concat(n)}}))}}}))}();
