Gazebo_simulation-Frontend/node_modules/file-selector/dist/bundles/file-selector.umd.min.js
2020-12-21 10:29:31 -05:00

3 lines
4.6 KiB
JavaScript

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.fileSelector={})}(this,function(e){"use strict";function f(o,a,u,c){return new(u||(u=Promise))(function(e,t){function n(e){try{i(c.next(e))}catch(e){t(e)}}function r(e){try{i(c.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new u(function(e){e(t.value)}).then(n,r)}i((c=c.apply(o,a||[])).next())})}function l(n,r){var i,o,a,e,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,o&&(a=2&t[0]?o.return:t[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,t[1])).done)return a;switch(o=0,a&&(t=[2&t[0],a.value]),t[0]){case 0:case 1:a=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,o=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(a=0<(a=u.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){u.label=t[1];break}if(6===t[0]&&u.label<a[1]){u.label=a[1],a=t;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(t);break}a[2]&&u.ops.pop(),u.trys.pop();continue}t=r.call(n,u)}catch(e){t=[6,e],o=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function n(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function o(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(n(arguments[t]));return e}var i=new Map([["avi","video/avi"],["gif","image/gif"],["ico","image/x-icon"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["mkv","video/x-matroska"],["mov","video/quicktime"],["mp4","video/mp4"],["pdf","application/pdf"],["png","image/png"],["zip","application/zip"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]]);function a(e,t){var n=function(e){var t=e.name;if(t&&-1!==t.lastIndexOf(".")&&!e.type){var n=t.split(".").pop().toLowerCase(),r=i.get(n);r&&Object.defineProperty(e,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return e}(e);if("string"!=typeof n.path){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:"string"==typeof t?t:"string"==typeof r&&0<r.length?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}var t=[".DS_Store","Thumbs.db"];function u(e){return e.filter(function(e){return-1===t.indexOf(e.name)})}function c(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function s(e){if("function"!=typeof e.webkitGetAsEntry)return r(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?d(t):r(e)}function r(e){var t=e.getAsFile();if(!t)return Promise.reject(e+" is not a File");var n=a(t);return Promise.resolve(n)}function p(t){return f(this,void 0,void 0,function(){return l(this,function(e){return[2,t.isDirectory?d(t):function(r){return f(this,void 0,void 0,function(){return l(this,function(e){return[2,new Promise(function(n,t){r.file(function(e){var t=a(e,r.fullPath);n(t)},function(e){t(e)})})]})})}(t)]})})}function d(e){var t=e.createReader();return new Promise(function(a,u){var c=[];!function o(){var e=this;t.readEntries(function(i){return f(e,void 0,void 0,function(){var t,n,r;return l(this,function(e){switch(e.label){case 0:if(i.length)return[3,5];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Promise.all(c)];case 2:return t=e.sent(),a(t),[3,4];case 3:return n=e.sent(),u(n),[3,4];case 4:return[3,6];case 5:r=Promise.all(i.map(p)),c.push(r),o(),e.label=6;case 6:return[2]}})})},function(e){u(e)})}()})}e.fromEvent=function(i){return f(this,void 0,void 0,function(){return l(this,function(e){return[2,(r=i,r.dataTransfer&&i.dataTransfer?function(n,r){return f(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return n.items?(t=c(n.items).filter(function(e){return"file"===e.kind}),"drop"!==r?[2,t]:[4,Promise.all(t.map(s))]):[3,2];case 1:return[2,u(function n(e){return e.reduce(function(e,t){return o(e,Array.isArray(t)?n(t):[t])},[])}(e.sent()))];case 2:return[2,u(c(n.files).map(function(e){return a(e)}))]}})})}(i.dataTransfer,i.type):(t=i,(n=t.target,null!==n&&t.target.files?c(t.target.files):[]).map(function(e){return a(e)})))];var t,n,r})})},Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=file-selector.umd.min.js.map