6 lines
203 KiB
JavaScript
6 lines
203 KiB
JavaScript
|
/*!
|
||
|
* FilePond 4.25.1
|
||
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
||
|
* Please visit https://pqina.nl/filepond/ for details.
|
||
|
*/
|
||
|
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports):"function"==typeof define&&define.amd?define(["exports"],factory):factory((global=global||self).FilePond={})}(this,(function(exports){"use strict";var isNode=function isNode(value){return value instanceof HTMLElement},createStore=function createStore(initialState){var queries=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],actions=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],state=Object.assign({},initialState),actionQueue=[],dispatchQueue=[],getState=function getState(){return Object.assign({},state)},processActionQueue=function processActionQueue(){var queue=[].concat(actionQueue);return actionQueue.length=0,queue},processDispatchQueue=function processDispatchQueue(){var queue=[].concat(dispatchQueue);dispatchQueue.length=0,queue.forEach((function(_ref){var type=_ref.type,data=_ref.data;dispatch(type,data)}))},dispatch=function dispatch(type,data,isBlocking){!isBlocking||document.hidden?(actionHandlers[type]&&actionHandlers[type](data),actionQueue.push({type:type,data:data})):dispatchQueue.push({type:type,data:data})},query=function query(str){for(var _queryHandles,_len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return queryHandles[str]?(_queryHandles=queryHandles)[str].apply(_queryHandles,args):null},api={getState:getState,processActionQueue:processActionQueue,processDispatchQueue:processDispatchQueue,dispatch:dispatch,query:query},queryHandles={};queries.forEach((function(query){queryHandles=Object.assign({},query(state),{},queryHandles)}));var actionHandlers={};return actions.forEach((function(action){actionHandlers=Object.assign({},action(dispatch,query,state),{},actionHandlers)})),api},defineProperty=function defineProperty(obj,property,definition){"function"!=typeof definition?Object.defineProperty(obj,property,Object.assign({},definition)):obj[property]=definition},forin=function forin(obj,cb){for(var key in obj)obj.hasOwnProperty(key)&&cb(key,obj[key])},createObject=function createObject(definition){var obj={};return forin(definition,(function(property){defineProperty(obj,property,definition[property])})),obj},attr=function attr(node,name){var value=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(null===value)return node.getAttribute(name)||node.hasAttribute(name);node.setAttribute(name,value)},ns="http://www.w3.org/2000/svg",svgElements=["svg","path"],isSVGElement=function isSVGElement(tag){return svgElements.includes(tag)},createElement=function createElement(tag,className){var attributes=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"object"==typeof className&&(attributes=className,className=null);var element=isSVGElement(tag)?document.createElementNS(ns,tag):document.createElement(tag);return className&&(isSVGElement(tag)?attr(element,"class",className):element.className=className),forin(attributes,(function(name,value){attr(element,name,value)})),element},appendChild=function appendChild(parent){return function(child,index){void 0!==index&&parent.children[index]?parent.insertBefore(child,parent.children[index]):parent.appendChild(child)}},appendChildView=function appendChildView(parent,childViews){return function(view,index){return void 0!==index?childViews.splice(index,0,view):childViews.push(view),view}},removeChildView=function removeChildView(parent,childViews){return function(view){return childViews.splice(childViews.indexOf(view),1),view.element.parentNode&&parent.removeChild(view.element),view}},IS_BROWSER="undefined"!=typeof window&&void 0!==window.document,isBrowser=function isBrowser(){return IS_BROWSER},testElement,getChildCount="children"in(isBrowser()?createElement("svg"):{})?function(el){return el.children.length}:function(el){return el.childNodes.length},getViewRect=function getViewRect(elementRect,childViews,offset,scale){var left=offset[0]||elementRect.left,top=offset[1]||elementRect.top,right=left+elementRect.width,bottom=top+elementRect.height*(scale[1]||1),rect={element:Object.assign(
|