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AASd,GAAIF,EAAIgB,SAASd,GAEtD,EACA9H,EAAcS,UAAU2C,eAAiB,SAAUN,EAAG7B,EAAMoC,GACxD,GAAIP,GAAKO,EAAQ,CACb,IAAIwF,EAAM7G,SAAS8G,YAAY,SAAUC,EAAIjG,EAAEoC,QAAUpC,EAAEoC,QAAQ,GAAKpC,EAQxE,OAPA+F,EAAIG,UAAU/H,GAAM,GAAM,GAC1B4H,EAAII,OAAS,EACbJ,EAAIK,MAAQL,EAAIM,QAAU,EAC1BhJ,KAAKwH,WAAWkB,EAAK/F,EAAG9C,EAAcoJ,WACtCjJ,KAAKwH,WAAWkB,EAAKE,EAAG/I,EAAcqJ,UACtCR,EAAIS,aAAenJ,KAAKsF,cACxBpC,EAAOkG,cAAcV,GACdA,EAAI5D,gBACf,CACA,OAAO,CACX,EAEAjF,EAAcS,UAAUiD,kBAAoB,SAAUZ,GAClD,KAAOA,EAAGA,EAAIA,EAAE0D,cACZ,GAAI1D,EAAE0G,aAAa,cAAgB1G,EAAE2G,UACjC,OAAO3G,EAGf,OAAO,IACX,EACO9C,CACX,CArToB,GAsTRA,EAAcyB,UAAY,IAAIzB,EAE1CA,EAAcuF,WAAa,EAC3BvF,EAAciH,SAAW,GACzBjH,EAAcmD,UAAY,IAC1BnD,EAAciE,SAAW,IACzBjE,EAAckE,kBAAmB,EACjClE,EAAcqE,gBAAkB,IAChCrE,EAAcqF,iBAAmB,GACjCrF,EAAcwF,oBAAsB,EAEpCxF,EAAc+H,SAAW,2BAA2B2B,MAAM,KAG1D1J,EAAcoJ,UAAY,kCAAkCM,MAAM,KAClE1J,EAAcqJ,SAAW,8CAA8CK,MAAM,KAC7EzJ,EAAgBD,cAAgBA,CACnC,EAvcD,CAucGA,IAAkBA,EAAgB,CAAC,G","sources":["webpack://signly-british/./node_modules/drag-drop-touch/DragDropTouch.js"],"sourcesContent":["var DragDropTouch;\r\n(function (DragDropTouch_1) {\r\n 'use strict';\r\n /**\r\n * Object used to hold the data that is being dragged during drag and drop operations.\r\n *\r\n * It may hold one or more data items of different types. For more information about\r\n * drag and drop operations and data transfer objects, see\r\n * HTML Drag and Drop API.\r\n *\r\n * This object is created automatically by the @see:DragDropTouch singleton and is\r\n * accessible through the @see:dataTransfer property of all drag events.\r\n */\r\n var DataTransfer = (function () {\r\n function DataTransfer() {\r\n this._dropEffect = 'move';\r\n this._effectAllowed = 'all';\r\n this._data = {};\r\n }\r\n Object.defineProperty(DataTransfer.prototype, 'dropEffect', {\r\n /**\r\n * Gets or sets the type of drag-and-drop operation currently selected.\r\n * The value must be 'none', 'copy', 'link', or 'move'.\r\n */\r\n get: function () {\r\n return this._dropEffect;\r\n },\r\n set: function (value) {\r\n this._dropEffect = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataTransfer.prototype, 'effectAllowed', {\r\n /**\r\n * Gets or sets the types of operations that are possible.\r\n * Must be one of 'none', 'copy', 'copyLink', 'copyMove', 'link',\r\n * 'linkMove', 'move', 'all' or 'uninitialized'.\r\n */\r\n get: function () {\r\n return this._effectAllowed;\r\n },\r\n set: function (value) {\r\n this._effectAllowed = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataTransfer.prototype, 'types', {\r\n /**\r\n * Gets an array of strings giving the formats that were set in the @see:dragstart event.\r\n */\r\n get: function () {\r\n return Object.keys(this._data);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Removes the data associated with a given type.\r\n *\r\n * The type argument is optional. If the type is empty or not specified, the data\r\n * associated with all types is removed. If data for the specified type does not exist,\r\n * or the data transfer contains no data, this method will have no effect.\r\n *\r\n * @param type Type of data to remove.\r\n */\r\n DataTransfer.prototype.clearData = function (type) {\r\n if (type != null) {\r\n delete this._data[type];\r\n }\r\n else {\r\n this._data = null;\r\n }\r\n };\r\n /**\r\n * Retrieves the data for a given type, or an empty string if data for that type does\r\n * not exist or the data transfer contains no data.\r\n *\r\n * @param type Type of data to retrieve.\r\n */\r\n DataTransfer.prototype.getData = function (type) {\r\n return this._data[type] || '';\r\n };\r\n /**\r\n * Set the data for a given type.\r\n *\r\n * For a list of recommended drag types, please see\r\n * https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Recommended_Drag_Types.\r\n *\r\n * @param type Type of data to add.\r\n * @param value Data to add.\r\n */\r\n DataTransfer.prototype.setData = function (type, value) {\r\n this._data[type] = value;\r\n };\r\n /**\r\n * Set the image to be used for dragging if a custom one is desired.\r\n *\r\n * @param img An image element to use as the drag feedback image.\r\n * @param offsetX The horizontal offset within the image.\r\n * @param offsetY The vertical offset within the image.\r\n */\r\n DataTransfer.prototype.setDragImage = function (img, offsetX, offsetY) {\r\n var ddt = DragDropTouch._instance;\r\n ddt._imgCustom = img;\r\n ddt._imgOffset = { x: offsetX, y: offsetY };\r\n };\r\n return DataTransfer;\r\n }());\r\n DragDropTouch_1.DataTransfer = DataTransfer;\r\n /**\r\n * Defines a class that adds support for touch-based HTML5 drag/drop operations.\r\n *\r\n * The @see:DragDropTouch class listens to touch events and raises the\r\n * appropriate HTML5 drag/drop events as if the events had been caused\r\n * by mouse actions.\r\n *\r\n * The purpose of this class is to enable using existing, standard HTML5\r\n * drag/drop code on mobile devices running IOS or Android.\r\n *\r\n * To use, include the DragDropTouch.js file on the page. The class will\r\n * automatically start monitoring touch events and will raise the HTML5\r\n * drag drop events (dragstart, dragenter, dragleave, drop, dragend) which\r\n * should be handled by the application.\r\n *\r\n * For details and examples on HTML drag and drop, see\r\n * https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Drag_operations.\r\n */\r\n var DragDropTouch = (function () {\r\n /**\r\n * Initializes the single instance of the @see:DragDropTouch class.\r\n */\r\n function DragDropTouch() {\r\n this._lastClick = 0;\r\n // enforce singleton pattern\r\n if (DragDropTouch._instance) {\r\n throw 'DragDropTouch instance already created.';\r\n }\r\n // detect passive event support\r\n // https://github.com/Modernizr/Modernizr/issues/1894\r\n var supportsPassive = false;\r\n document.addEventListener('test', function () { }, {\r\n get passive() {\r\n supportsPassive = true;\r\n return true;\r\n }\r\n });\r\n // listen to touch events\r\n if ('ontouchstart' in document) {\r\n var d = document, ts = this._touchstart.bind(this), tm = this._touchmove.bind(this), te = this._touchend.bind(this), opt = supportsPassive ? { passive: false, capture: false } : false;\r\n d.addEventListener('touchstart', ts, opt);\r\n d.addEventListener('touchmove', tm, opt);\r\n d.addEventListener('touchend', te);\r\n d.addEventListener('touchcancel', te);\r\n }\r\n }\r\n /**\r\n * Gets a reference to the @see:DragDropTouch singleton.\r\n */\r\n DragDropTouch.getInstance = function () {\r\n return DragDropTouch._instance;\r\n };\r\n // ** event handlers\r\n DragDropTouch.prototype._touchstart = function (e) {\r\n var _this = this;\r\n if (this._shouldHandle(e)) {\r\n // raise double-click and prevent zooming\r\n if (Date.now() - this._lastClick < DragDropTouch._DBLCLICK) {\r\n if (this._dispatchEvent(e, 'dblclick', e.target)) {\r\n if (e.cancelable) {\r\n e.preventDefault();\r\n }\r\n this._reset();\r\n return;\r\n }\r\n }\r\n // clear all variables\r\n this._reset();\r\n // get nearest draggable element\r\n var src = this._closestDraggable(e.target);\r\n if (src) {\r\n // give caller a chance to handle the hover/move events\r\n if (!this._dispatchEvent(e, 'mousemove', e.target) &&\r\n !this._dispatchEvent(e, 'mousedown', e.target)) {\r\n // get ready to start dragging\r\n this._dragSource = src;\r\n this._ptDown = this._getPoint(e);\r\n this._lastTouch = e;\r\n if (e.cancelable) {\r\n e.preventDefault();\r\n }\r\n // show context menu if the user hasn't started dragging after a while\r\n setTimeout(function () {\r\n if (_this._dragSource == src && _this._img == null) {\r\n if (_this._dispatchEvent(e, 'contextmenu', src)) {\r\n _this._reset();\r\n }\r\n }\r\n }, DragDropTouch._CTXMENU);\r\n if (DragDropTouch._ISPRESSHOLDMODE) {\r\n this._pressHoldInterval = setTimeout(function () {\r\n _this._isDragEnabled = true;\r\n _this._touchmove(e);\r\n }, DragDropTouch._PRESSHOLDAWAIT);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n DragDropTouch.prototype._touchmove = function (e) {\r\n if (this._shouldCancelPressHoldMove(e)) {\r\n this._reset();\r\n return;\r\n }\r\n if (this._shouldHandleMove(e) || this._shouldHandlePressHoldMove(e)) {\r\n // see if target wants to handle move\r\n var target = this._getTarget(e);\r\n if (this._dispatchEvent(e, 'mousemove', target)) {\r\n this._lastTouch = e;\r\n if (e.cancelable) {\r\n e.preventDefault();\r\n }\r\n return;\r\n }\r\n // start dragging\r\n if (this._dragSource && !this._img && this._shouldStartDragging(e)) {\r\n this._dispatchEvent(e, 'dragstart', this._dragSource);\r\n this._createImage(e);\r\n this._dispatchEvent(e, 'dragenter', target);\r\n }\r\n // continue dragging\r\n if (this._img) {\r\n this._lastTouch = e;\r\n if (e.cancelable) {\r\n e.preventDefault(); // prevent scrolling\r\n }\r\n if (target != this._lastTarget) {\r\n this._dispatchEvent(this._lastTouch, 'dragleave', this._lastTarget);\r\n this._dispatchEvent(e, 'dragenter', target);\r\n this._lastTarget = target;\r\n }\r\n this._moveImage(e);\r\n this._isDropZone = this._dispatchEvent(e, 'dragover', target);\r\n }\r\n }\r\n };\r\n DragDropTouch.prototype._touchend = function (e) {\r\n if (this._shouldHandle(e)) {\r\n // see if target wants to handle up\r\n if (this._dispatchEvent(this._lastTouch, 'mouseup', e.target)) {\r\n if (e.cancelable) {\r\n e.preventDefault();\r\n }\r\n return;\r\n }\r\n // user clicked the element but didn't drag, so clear the source and simulate a click\r\n if (!this._img) {\r\n this._dragSource = null;\r\n this._dispatchEvent(this._lastTouch, 'click', e.target);\r\n this._lastClick = Date.now();\r\n }\r\n // finish dragging\r\n this._destroyImage();\r\n if (this._dragSource) {\r\n if (e.type.indexOf('cancel') < 0 && this._isDropZone) {\r\n this._dispatchEvent(this._lastTouch, 'drop', this._lastTarget);\r\n }\r\n this._dispatchEvent(this._lastTouch, 'dragend', this._dragSource);\r\n this._reset();\r\n }\r\n }\r\n };\r\n // ** utilities\r\n // ignore events that have been handled or that involve more than one touch\r\n DragDropTouch.prototype._shouldHandle = function (e) {\r\n return e &&\r\n !e.defaultPrevented &&\r\n e.touches && e.touches.length < 2;\r\n };\r\n\r\n // use regular condition outside of press & hold mode\r\n DragDropTouch.prototype._shouldHandleMove = function (e) {\r\n return !DragDropTouch._ISPRESSHOLDMODE && this._shouldHandle(e);\r\n };\r\n\r\n // allow to handle moves that involve many touches for press & hold\r\n DragDropTouch.prototype._shouldHandlePressHoldMove = function (e) {\r\n return DragDropTouch._ISPRESSHOLDMODE &&\r\n this._isDragEnabled && e && e.touches && e.touches.length;\r\n };\r\n\r\n // reset data if user drags without pressing & holding\r\n DragDropTouch.prototype._shouldCancelPressHoldMove = function (e) {\r\n return DragDropTouch._ISPRESSHOLDMODE && !this._isDragEnabled &&\r\n this._getDelta(e) > DragDropTouch._PRESSHOLDMARGIN;\r\n };\r\n\r\n // start dragging when specified delta is detected\r\n DragDropTouch.prototype._shouldStartDragging = function (e) {\r\n var delta = this._getDelta(e);\r\n return delta > DragDropTouch._THRESHOLD ||\r\n (DragDropTouch._ISPRESSHOLDMODE && delta >= DragDropTouch._PRESSHOLDTHRESHOLD);\r\n }\r\n\r\n // clear all members\r\n DragDropTouch.prototype._reset = function () {\r\n this._destroyImage();\r\n this._dragSource = null;\r\n this._lastTouch = null;\r\n this._lastTarget = null;\r\n this._ptDown = null;\r\n this._isDragEnabled = false;\r\n this._isDropZone = false;\r\n this._dataTransfer = new DataTransfer();\r\n clearInterval(this._pressHoldInterval);\r\n };\r\n // get point for a touch event\r\n DragDropTouch.prototype._getPoint = function (e, page) {\r\n if (e && e.touches) {\r\n e = e.touches[0];\r\n }\r\n return { x: page ? e.pageX : e.clientX, y: page ? e.pageY : e.clientY };\r\n };\r\n // get distance between the current touch event and the first one\r\n DragDropTouch.prototype._getDelta = function (e) {\r\n if (DragDropTouch._ISPRESSHOLDMODE && !this._ptDown) { return 0; }\r\n var p = this._getPoint(e);\r\n return Math.abs(p.x - this._ptDown.x) + Math.abs(p.y - this._ptDown.y);\r\n };\r\n // get the element at a given touch event\r\n DragDropTouch.prototype._getTarget = function (e) {\r\n var pt = this._getPoint(e), el = document.elementFromPoint(pt.x, pt.y);\r\n while (el && getComputedStyle(el).pointerEvents == 'none') {\r\n el = el.parentElement;\r\n }\r\n return el;\r\n };\r\n // create drag image from source element\r\n DragDropTouch.prototype._createImage = function (e) {\r\n // just in case...\r\n if (this._img) {\r\n this._destroyImage();\r\n }\r\n // create drag image from custom element or drag source\r\n var src = this._imgCustom || this._dragSource;\r\n this._img = src.cloneNode(true);\r\n this._copyStyle(src, this._img);\r\n this._img.style.top = this._img.style.left = '-9999px';\r\n // if creating from drag source, apply offset and opacity\r\n if (!this._imgCustom) {\r\n var rc = src.getBoundingClientRect(), pt = this._getPoint(e);\r\n this._imgOffset = { x: pt.x - rc.left, y: pt.y - rc.top };\r\n this._img.style.opacity = DragDropTouch._OPACITY.toString();\r\n }\r\n // add image to document\r\n this._moveImage(e);\r\n document.body.appendChild(this._img);\r\n };\r\n // dispose of drag image element\r\n DragDropTouch.prototype._destroyImage = function () {\r\n if (this._img && this._img.parentElement) {\r\n this._img.parentElement.removeChild(this._img);\r\n }\r\n this._img = null;\r\n this._imgCustom = null;\r\n };\r\n // move the drag image element\r\n DragDropTouch.prototype._moveImage = function (e) {\r\n var _this = this;\r\n requestAnimationFrame(function () {\r\n if (_this._img) {\r\n var pt = _this._getPoint(e, true), s = _this._img.style;\r\n s.position = 'absolute';\r\n s.pointerEvents = 'none';\r\n s.zIndex = '999999';\r\n s.left = Math.round(pt.x - _this._imgOffset.x) + 'px';\r\n s.top = Math.round(pt.y - _this._imgOffset.y) + 'px';\r\n }\r\n });\r\n };\r\n // copy properties from an object to another\r\n DragDropTouch.prototype._copyProps = function (dst, src, props) {\r\n for (var i = 0; i < props.length; i++) {\r\n var p = props[i];\r\n dst[p] = src[p];\r\n }\r\n };\r\n DragDropTouch.prototype._copyStyle = function (src, dst) {\r\n // remove potentially troublesome attributes\r\n DragDropTouch._rmvAtts.forEach(function (att) {\r\n dst.removeAttribute(att);\r\n });\r\n // copy canvas content\r\n if (src instanceof HTMLCanvasElement) {\r\n var cSrc = src, cDst = dst;\r\n cDst.width = cSrc.width;\r\n cDst.height = cSrc.height;\r\n cDst.getContext('2d').drawImage(cSrc, 0, 0);\r\n }\r\n // copy style (without transitions)\r\n var cs = getComputedStyle(src);\r\n for (var i = 0; i < cs.length; i++) {\r\n var key = cs[i];\r\n if (key.indexOf('transition') < 0) {\r\n dst.style[key] = cs[key];\r\n }\r\n }\r\n dst.style.pointerEvents = 'none';\r\n // and repeat for all children\r\n for (var i = 0; i < src.children.length; i++) {\r\n this._copyStyle(src.children[i], dst.children[i]);\r\n }\r\n };\r\n DragDropTouch.prototype._dispatchEvent = function (e, type, target) {\r\n if (e && target) {\r\n var evt = document.createEvent('Event'), t = e.touches ? e.touches[0] : e;\r\n evt.initEvent(type, true, true);\r\n evt.button = 0;\r\n evt.which = evt.buttons = 1;\r\n this._copyProps(evt, e, DragDropTouch._kbdProps);\r\n this._copyProps(evt, t, DragDropTouch._ptProps);\r\n evt.dataTransfer = this._dataTransfer;\r\n target.dispatchEvent(evt);\r\n return evt.defaultPrevented;\r\n }\r\n return false;\r\n };\r\n // gets an element's closest draggable ancestor\r\n DragDropTouch.prototype._closestDraggable = function (e) {\r\n for (; e; e = e.parentElement) {\r\n if (e.hasAttribute('draggable') && e.draggable) {\r\n return e;\r\n }\r\n }\r\n return null;\r\n };\r\n return DragDropTouch;\r\n }());\r\n /*private*/ DragDropTouch._instance = new DragDropTouch(); // singleton\r\n // constants\r\n DragDropTouch._THRESHOLD = 5; // pixels to move before drag starts\r\n DragDropTouch._OPACITY = 0.5; // drag image opacity\r\n DragDropTouch._DBLCLICK = 500; // max ms between clicks in a double click\r\n DragDropTouch._CTXMENU = 900; // ms to hold before raising 'contextmenu' event\r\n DragDropTouch._ISPRESSHOLDMODE = false; // decides of press & hold mode presence\r\n DragDropTouch._PRESSHOLDAWAIT = 400; // ms to wait before press & hold is detected\r\n DragDropTouch._PRESSHOLDMARGIN = 25; // pixels that finger might shiver while pressing\r\n DragDropTouch._PRESSHOLDTHRESHOLD = 0; // pixels to move before drag starts\r\n // copy styles/attributes from drag source to drag image element\r\n DragDropTouch._rmvAtts = 'id,class,style,draggable'.split(',');\r\n // synthesize and dispatch an event\r\n // returns true if the event has been handled (e.preventDefault == true)\r\n DragDropTouch._kbdProps = 'altKey,ctrlKey,metaKey,shiftKey'.split(',');\r\n DragDropTouch._ptProps = 'pageX,pageY,clientX,clientY,screenX,screenY'.split(',');\r\n DragDropTouch_1.DragDropTouch = DragDropTouch;\r\n})(DragDropTouch || (DragDropTouch = {}));\r\n"],"names":["DragDropTouch","DragDropTouch_1","DataTransfer","this","_dropEffect","_effectAllowed","_data","Object","defineProperty","prototype","get","set","value","enumerable","configurable","keys","clearData","type","getData","setData","setDragImage","img","offsetX","offsetY","ddt","_instance","_imgCustom","_imgOffset","x","y","_lastClick","supportsPassive","document","addEventListener","passive","d","ts","_touchstart","bind","tm","_touchmove","te","_touchend","opt","capture","getInstance","e","_this","_shouldHandle","Date","now","_DBLCLICK","_dispatchEvent","target","cancelable","preventDefault","_reset","src","_closestDraggable","_dragSource","_ptDown","_getPoint","_lastTouch","setTimeout","_img","_CTXMENU","_ISPRESSHOLDMODE","_pressHoldInterval","_isDragEnabled","_PRESSHOLDAWAIT","_shouldCancelPressHoldMove","_shouldHandleMove","_shouldHandlePressHoldMove","_getTarget","_shouldStartDragging","_createImage","_lastTarget","_moveImage","_isDropZone","_destroyImage","indexOf","defaultPrevented","touches","length","_getDelta","_PRESSHOLDMARGIN","delta","_THRESHOLD","_PRESSHOLDTHRESHOLD","_dataTransfer","clearInterval","page","pageX","clientX","pageY","clientY","p","Math","abs","pt","el","elementFromPoint","getComputedStyle","pointerEvents","parentElement","cloneNode","_copyStyle","style","top","left","rc","getBoundingClientRect","opacity","_OPACITY","toString","body","appendChild","removeChild","requestAnimationFrame","s","position","zIndex","round","_copyProps","dst","props","i","_rmvAtts","forEach","att","removeAttribute","HTMLCanvasElement","cSrc","cDst","width","height","getContext","drawImage","cs","key","children","evt","createEvent","t","initEvent","button","which","buttons","_kbdProps","_ptProps","dataTransfer","dispatchEvent","hasAttribute","draggable","split"],"sourceRoot":""}