PageSourceSearch

https://southliu.github.io/assets/js/@[email protected]__f409274a03f44b3197cf7a6186adcbc9.BtrQEPr1.js

js southliu.github.io collected 2026-10-03 09:59:47 UTC 8,238 bytes, 1 lines download raw bytes

1var e=Object.defineProperty,t=(t,s,n)=>((t,s,n)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n)(t,"symbol"!=typeof s?s+"":s,n);import{a as s,e as n}from"./[email protected]";import{F as o,p as r}from"./@[email protected]_r_39d8c4b197f541c8c42d43536a2b7ff2.BzDRMfiV.js";import"./[email protected]_q3uNA6.js";import"./[email protected][email protected]";import{c as i}from"./[email protected]";function a(e){const t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(s){return t}}function l(e){const t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),e.onProgress(t)});const s=new FormData;e.data&&Object.keys(e.data).forEach(t=>{const n=e.data[t];Array.isArray(n)?n.forEach(e=>{s.append("".concat(t,"[]"),e)}):s.append(t,n)}),e.file instanceof Blob?s.append(e.filename,e.file,e.file.name):s.append(e.filename,e.file),t.onerror=function(t){e.onError(t)},t.onload=function(){return t.status<200||t.status>=300?e.onError(function(e,t){const s="cannot ".concat(e.method," ").concat(e.action," ").concat(t.status,"'"),n=new Error(s);return n.status=t.status,n.method=e.method,n.url=e.action,n}(e,t),a(t)):e.onSuccess(a(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);const n=e.headers||{};return null!==n["X-Requested-With"]&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(n).forEach(e=>{null!==n[e]&&t.setRequestHeader(e,n[e])}),t.send(s),{abort(){t.abort()}}}const c=async(e,t)=>{const s=[],n=[];e.forEach(e=>n.push(e.webkitGetAsEntry()));const o=async(e,o)=>{if(e)if(e.path="",e.isFile){const n=await async function(e){return new Promise(s=>{e.file(n=>{t(n)?(e.fullPath&&!n.webkitRelativePath&&(Object.defineProperties(n,{webkitRelativePath:{writable:!0}}),n.webkitRelativePath=e.fullPath.replace(/^\//,""),Object.defineProperties(n,{webkitRelativePath:{writable:!1}})),s(n)):s(null)})})}(e);n&&s.push(n)}else if(e.isDirectory){const t=await async function(e){const t=e.createReader(),s=[];for(;;){const e=await new Promise(e=>{t.readEntries(e,()=>e([]))}),n=e.length;if(!n)break;for(let t=0;t<n;t++)s.push(e[t])}return s}(e);n.push(...t)}};let r=0;for(;r<n.length;)await o(n[r]),r++;return s},p=+new Date;let u=0;function d(){return"rc-upload-".concat(p,"-").concat(++u)}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},h.apply(this,arguments)}class f extends s.Component{constructor(){super(...arguments),t(this,"state",{uid:d()}),t(this,"reqs",{}),t(this,"fileInput"),t(this,"_isMounted"),t(this,"filterFile",(e,t=!1)=>{const{accept:s,directory:n}=this.props;let r,i;if("string"==typeof s)i=s;else{const{filter:e,format:t}=s||{};i=t,r="native"===e?()=>!0:e}const a=r||(n||t?e=>((e,t)=>{if(e&&t){const s=Array.isArray(t)?t:t.split(","),n=e.name||"",r=e.type||"",i=r.replace(/\/.*$/,"");return s.some(e=>{const t=e.trim();if(/^\*(\/\*)?$/.test(e))return!0;if("."===t.charAt(0)){const e=n.toLowerCase(),s=t.toLowerCase();let o=[s];return".jpg"!==s&&".jpeg"!==s||(o=[".jpg",".jpeg"]),o.some(t=>e.endsWith(t))}return/\/\*$/.test(t)?i===t.replace(/\/.*$/,""):r===t||!!/^\w+$/.test(t)&&(o(!1,"Upload takes an invalidate 'accept' type '".concat(t,"'.Skip for check.")),!0)})}return!0})(e,i):()=>!0);return a(e)}),t(this,"onChange",e=>{const{files:t}=e.target,s=[...t].filter(e=>this.filterFile(e));this.uploadFiles(s),this.reset()}),t(this,"onClick",e=>{const t=this.fileInput;if(!t)return;const s=e.target,{onClick:n}=this.props;if(s&&"BUTTON"===s.tagName){t.parentNode.focus(),s.blur()}t.click(),n&&n(e)}),t(this,"onKeyDown",e=>{"Enter"===e.key&&this.onClick(e)}),t(this,"onDataTransferFiles",async(e,t)=>{const{multiple:s,directory:n}=this.props,o=[...e.items||[]];let r=[...e.files||[]];if((r.length>0||o.some(e=>"file"===e.kind))&&(null==t||t()),n)r=await c(Array.prototype.slice.call(o),this.filterFile),this.uploadFiles(r);else{let e=[...r].filter(e=>this.filterFile(e,!0));!1===s&&(e=r.slice(0,1)),this.uploadFiles(e)}}),t(this,"onFilePaste",async e=>{const{pastable:t}=this.props;if(t&&"paste"===e.type){const t=e.clipboardData;return this.onDataTransferFiles(t,()=>{e.preventDefault()})}}),t(this,"onFileDragOver",e=>{e.preventDefault()}),t(this,"onFileDrop",async e=>{if(e.preventDefault(),"drop"===e.type){const t=e.dataTransfer;return this.onDataTransferFiles(t)}}),t(this,"uploadFiles",e=>{const t=[...e],s=t.map(e=>(e.uid=d(),this.processFile(e,t)));Promise.all(s).then(e=>{const{onBatchStart:t}=this.props;null==t||t(e.map(({origin:e,parsedFile:t})=>({file:e,parsedFile:t}))),e.filter(e=>
1null!==e.parsedFile).forEach(e=>{this.post(e)})})}),t(this,"processFile",async(e,t)=>{const{beforeUpload:s}=this.props;let n=e;if(s){try{n=await s(e,t)}catch(u){n=!1}if(!1===n)return{origin:e,parsedFile:null,action:null,data:null}}const{action:o}=this.props;let r;r="function"==typeof o?await o(e):o;const{data:i}=this.props;let a;a="function"==typeof i?await i(e):i;const l="object"!=typeof n&&"string"!=typeof n||!n?e:n;let c;c=l instanceof File?l:new File([l],e.name,{type:e.type});const p=c;return p.uid=e.uid,{origin:e,data:a,parsedFile:p,action:r}}),t(this,"saveFileInput",e=>{this.fileInput=e})}componentDidMount(){this._isMounted=!0;const{pastable:e}=this.props;e&&document.addEventListener("paste",this.onFilePaste)}componentWillUnmount(){this._isMounted=!1,this.abort(),document.removeEventListener("paste",this.onFilePaste)}componentDidUpdate(e){const{pastable:t}=this.props;t&&!e.pastable?document.addEventListener("paste",this.onFilePaste):!t&&e.pastable&&document.removeEventListener("paste",this.onFilePaste)}post({data:e,origin:t,action:s,parsedFile:n}){if(!this._isMounted)return;const{onStart:o,customRequest:r,name:i,headers:a,withCredentials:c,method:p}=this.props,{uid:u}=t,d=r||l,h={action:s,filename:i,data:e,file:n,headers:a,withCredentials:c,method:p||"post",onProgress:e=>{const{onProgress:t}=this.props;null==t||t(e,n)},onSuccess:(e,t)=>{const{onSuccess:s}=this.props;null==s||s(e,n,t),delete this.reqs[u]},onError:(e,t)=>{const{onError:s}=this.props;null==s||s(e,t,n),delete this.reqs[u]}};o(t),this.reqs[u]=d(h,{defaultRequest:l})}reset(){this.setState({uid:d()})}abort(e){const{reqs:t}=this;if(e){const s=e.uid?e.uid:e;t[s]&&t[s].abort&&t[s].abort(),delete t[s]}else Object.keys(t).forEach(e=>{t[e]&&t[e].abort&&t[e].abort(),delete t[e]})}render(){const{component:e,prefixCls:t,className:s,classNames:o={},disabled:a,id:l,name:c,style:p,styles:u={},multiple:d,accept:f,capture:m,children:y,directory:b,openFileDialogOnClick:w,onMouseEnter:g,onMouseLeave:F,hasControlInside:v,...k}=this.props,C="string"==typeof f?f:null==f?void 0:f.format,P=i(t,{["".concat(t,"-disabled")]:a,[s]:s}),E=b?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},D=a?{}:{onClick:w?this.onClick:()=>{},onKeyDown:w?this.onKeyDown:()=>{},onMouseEnter:g,onMouseLeave:F,onDrop:this.onFileDrop,onDragOver:this.onFileDragOver,tabIndex:v?void 0:"0"};return n.createElement(e,h({},D,{className:P,role:v?void 0:"button",style:p}),n.createElement("input",h({},r(k,{aria:!0,data:!0}),{id:l,name:c,disabled:a,type:"file",ref:this.saveFileInput,onClick:e=>e.stopPropagation(),key:this.state.uid,style:{display:"none",...u.input},className:o.input,accept:C},E,{multiple:d,onChange:this.onChange},null!=m?{capture:m}:{})),y)}}function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},m.apply(this,arguments)}function y(){}class b extends s.Component{constructor(){super(...arguments),t(this,"uploader"),t(this,"saveUploader",e=>{this.uploader=e})}abort(e){this.uploader.abort(e)}render(){return n.createElement(f,m({},this.props,{ref:this.saveUploader}))}}t(b,"defaultProps",{component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:y,onError:y,onSuccess:y,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0,hasControlInside:!1});export{b as U};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.