mirror of
https://github.com/AlexKrunch/AnonIB-3D.git
synced 2024-11-22 03:54:17 -05:00
1 line
5.4 KiB
JavaScript
1 line
5.4 KiB
JavaScript
(function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,b.DragDrop=a()}})(function(){return function(){function b(d,e,g){function a(j,i){if(!e[j]){if(!d[j]){var f="function"==typeof require&&require;if(!i&&f)return f(j,!0);if(h)return h(j,!0);var c=new Error("Cannot find module '"+j+"'");throw c.code="MODULE_NOT_FOUND",c}var k=e[j]={exports:{}};d[j][0].call(k.exports,function(b){var c=d[j][1][b];return a(c||b)},k,k.exports,b,d,e,g)}return e[j].exports}for(var h="function"==typeof require&&require,c=0;c<g.length;c++)a(g[c]);return a}return b}()({1:[function(a,b){b.exports=function(a,b){function c(a,e){return a.reduce(function(a,d){return Array.isArray(d)&&e<b?a.concat(c(d,e+1)):a.concat(d)},[])}return b="number"==typeof b?b:1/0,b?c(a,1):Array.isArray(a)?a.map(function(a){return a}):a}},{}],2:[function(a,b){function c(){throw new Error("setTimeout has not been defined")}function d(){throw new Error("clearTimeout has not been defined")}function e(a){if(k===setTimeout)return setTimeout(a,0);if((k===c||!k)&&setTimeout)return k=setTimeout,setTimeout(a,0);try{return k(a,0)}catch(b){try{return k.call(null,a,0)}catch(b){return k.call(this,a,0)}}}function f(a){if(l===clearTimeout)return clearTimeout(a);if((l===d||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(a);try{return l(a)}catch(b){try{return l.call(null,a)}catch(b){return l.call(this,a)}}}function g(){p&&n&&(p=!1,n.length?o=n.concat(o):q=-1,o.length&&h())}function h(){if(!p){var a=e(g);p=!0;for(var b=o.length;b;){for(n=o,o=[];++q<b;)n&&n[q].run();q=-1,b=o.length}n=null,p=!1,f(a)}}function j(a,b){this.fun=a,this.array=b}function i(){}var k,l,m=b.exports={};(function(){try{k="function"==typeof setTimeout?setTimeout:c}catch(a){k=c}try{l="function"==typeof clearTimeout?clearTimeout:d}catch(a){l=d}})();var n,o=[],p=!1,q=-1;m.nextTick=function(a){var b=Array(arguments.length-1);if(1<arguments.length)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];o.push(new j(a,b)),1!==o.length||p||e(h)},j.prototype.run=function(){this.fun.apply(null,this.array)},m.title="browser",m.browser=!0,m.env={},m.argv=[],m.version="",m.versions={},m.on=i,m.addListener=i,m.once=i,m.off=i,m.removeListener=i,m.removeAllListeners=i,m.emit=i,m.prependListener=i,m.prependOnceListener=i,m.listeners=function(){return[]},m.binding=function(){throw new Error("process.binding is not supported")},m.cwd=function(){return"/"},m.chdir=function(){throw new Error("process.chdir is not supported")},m.umask=function(){return 0}},{}],3:[function(a,b){(function(a){b.exports=function(b,c){function d(b){function d(){c&&c(b,f),c=null}i?a.nextTick(d):d()}function e(a,b,c){f[a]=c,(0==--g||b)&&d(b)}var f,g,h,i=!0;Array.isArray(b)?(f=[],g=b.length):(h=Object.keys(b),f={},g=h.length),g?h?h.forEach(function(a){b[a](function(b,c){e(a,b,c)})}):b.forEach(function(a,b){a(function(a,c){e(b,a,c)})}):d(null),i=!1}}).call(this,a("_process"))},{_process:2}],"/":[function(a,b){function c(a,b){function d(){h.readEntries(function(a){0<a.length?(g=g.concat(Array.from(a)),d()):e()})}function e(){f(g.map(function(a){return function(b){c(a,b)}}),function(c,d){c?b(c):(d.push({fullPath:a.fullPath,name:a.name,isFile:!1,isDirectory:!0}),b(null,d))})}var g=[];if(a.isFile)a.file(function(c){c.fullPath=a.fullPath,c.isFile=!0,c.isDirectory=!1,b(null,c)},function(a){b(a)});else if(a.isDirectory){var h=a.createReader();d()}}b.exports=function(a,b){function e(a){return b.onDragEnter&&b.onDragEnter(a),a.stopPropagation(),a.preventDefault(),!1}function g(c){if(c.stopPropagation(),c.preventDefault(),b.onDragOver&&b.onDragOver(c),c.dataTransfer.items){var d=Array.from(c.dataTransfer.items),e=d.filter(function(a){return"file"===a.kind}),f=d.filter(function(a){return"string"===a.kind});if(0===e.length&&!b.onDropText)return;if(0===f.length&&!b.onDrop)return;if(0===e.length&&0===f.length)return}return a.classList.add("drag"),clearTimeout(l),c.dataTransfer.dropEffect="copy",!1}function h(a){return a.stopPropagation(),a.preventDefault(),b.onDragLeave&&b.onDragLeave(a),clearTimeout(l),l=setTimeout(j,50),!1}function i(a){a.stopPropagation(),a.preventDefault(),b.onDragLeave&&b.onDragLeave(a),clearTimeout(l),j();var e={x:a.clientX,y:a.clientY},g=a.dataTransfer.getData("text");if(g&&b.onDropText&&b.onDropText(g,e),b.onDrop&&a.dataTransfer.items){var h=a.dataTransfer.files,i=Array.from(a.dataTransfer.items).filter(function(a){return"file"===a.kind});if(0===i.length)return;f(i.map(function(a){return function(b){c(a.webkitGetAsEntry(),b)}}),function(a,c){if(a)throw a;var f=d(c),g=f.filter(function(a){return a.isFile}),i=f.filter(function(a){return a.isDirectory});b.onDrop(g,e,h,i)})}return!1}function j(){a.classList.remove("drag")}if("string"==typeof a){var k=a;if(a=window.document.querySelector(a),!a)throw new Error("\""+k+"\" does not match any HTML elements")}if(!a)throw new Error("\""+a+"\" is not a valid HTML element");"function"==typeof b&&(b={onDrop:b});var l;return a.addEventListener("dragenter",e,!1),a.addEventListener("dragover",g,!1),a.addEventListener("dragleave",h,!1),a.addEventListener("drop",i,!1),function(){j(),a.removeEventListener("dragenter",e,!1),a.removeEventListener("dragover",g,!1),a.removeEventListener("dragleave",h,!1),a.removeEventListener("drop",i,!1)}};var d=a("flatten"),f=a("run-parallel")},{flatten:1,"run-parallel":3}]},{},[])("/")}); |