Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

idcrop

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

idcrop - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

44

dist/js/bundle.min.js

@@ -1,7 +0,22 @@

!function(I){function g(e){if(C[e])return C[e].exports;var n=C[e]={i:e,l:!1,exports:{}};return I[e].call(n.exports,n,n.exports,g),n.l=!0,n.exports}var C={};g.m=I,g.c=C,g.d=function(I,C,e){g.o(I,C)||Object.defineProperty(I,C,{configurable:!1,enumerable:!0,get:e})},g.n=function(I){var C=I&&I.__esModule?function(){return I.default}:function(){return I};return g.d(C,"a",C),C},g.o=function(I,g){return Object.prototype.hasOwnProperty.call(I,g)},g.p="",g(g.s=1)}([/*!**************************!*\
!*** ./lib/js/idcrop.js ***!
\**************************/
!function(n){function t(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return n[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var e={};t.m=n,t.c=e,t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:r})},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=4)}([/*!********************************!*\
!*** ./lib/js/idcrop/Point.js ***!
\********************************/
/*! dynamic exports provided */
/*! all exports used */
function(module,exports,__webpack_require__){"use strict";eval('\n\nvar IdCrop = function () {\n "use strict";\n\n var elements = {},\n is_moving = false,\n is_resizing = false,\n displayContainerId = void 0,\n previewContainerId = void 0,\n cropped = "";\n\n var init = function init(container_id, _displayContainerId, _previewContainerId) {\n\n displayContainerId = _displayContainerId;\n previewContainerId = _previewContainerId;\n\n // Generate the UI.\n createUI(container_id);\n fakeInput(elements.upload, elements.upload_fake);\n\n // File input by clicking event.\n elements.upload.addEventListener("change", startCropping, false);\n // File input by dragging event.\n var draggables = [].concat(Array.from(elements.overlays), elements.display, elements.crop);\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = draggables[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var draggable = _step.value;\n\n // All of this events will not do anything if there isn"t a file.\n draggable.addEventListener("dragenter", dragFileEnter, false);\n draggable.addEventListener("dragover", dragFileOver, false);\n draggable.addEventListener("dragleave", dragFileLeave, false);\n draggable.addEventListener("drop", startCropping, false);\n }\n // Event for moving the crop area.\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n elements.crop.addEventListener("mousedown", startMoving, false);\n // Event for resizing the crop area.\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = Array.from(elements.handles)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var handle = _step2.value;\n\n handle.addEventListener("mousedown", startResizing, false);\n }\n // Clear resize and move events.\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n window.addEventListener("mouseup", clear, false);\n };\n\n var createUI = function createUI(container_id) {\n\n /*\n * Injects HTML needed for the UI into the user chosen container.\n *\n * @param string containerId - ID of the chosen outer container.\n */\n\n var html = "",\n htmlDisplayArea = "";\n\n // Display Area content\n\n // Containers for displaying the dragged file.\n var displayArea = document.getElementById(displayContainerId);\n var previewArea = document.getElementById(previewContainerId);\n\n // Add classes to containers\n displayArea.classList.add("idwall-display");\n previewArea.classList.add("idwall-preview");\n\n // Overlays for blurring out area outside the cropping area.\n htmlDisplayArea += "<div id=\\"idwall-overlay-top\\"></div>";\n htmlDisplayArea += "<div id=\\"idwall-overlay-bottom\\"></div>";\n htmlDisplayArea += "<div id=\\"idwall-overlay-left\\"></div>";\n htmlDisplayArea += "<div id=\\"idwall-overlay-right\\"></div>";\n // Actual cropping container.\n htmlDisplayArea += "<div id=\\"idwall-crop\\">";\n // Resize handles.\n htmlDisplayArea += "<div id=\\"idwall-resize-nw\\"></div>";\n htmlDisplayArea += "<div id=\\"idwall-resize-n\\"></div>";\n htmlDisplayArea += "<div id=\\"idwall-resize-ne\\"></div>";\n htmlDisplayArea += "<div id=\\"idwall-resize-e\\"></div>";\n htmlDisplayArea += "<div id=\\"idwall-resize-se\\"></div>";\n htmlDisplayArea += "<div id=\\"idwall-resize-s\\"></div>";\n htmlDisplayArea += "<div id=\\"idwall-resize-sw\\"></div>";\n htmlDisplayArea += "<div id=\\"idwall-resize-w\\"></div>";\n // End of cropping area.\n htmlDisplayArea += "</div>";\n htmlDisplayArea += "<p>Drop files here or ";\n // Fake button for better style handling of the file input.\n htmlDisplayArea += "<a href=\\"\\" id=\\"idwall-upload-fake\\">browse...</a>";\n htmlDisplayArea += "</p>";\n\n // End of file display area.\n displayArea.insertAdjacentHTML(\'beforeend\', htmlDisplayArea);\n\n // File input for convenience.\n html += "<input type=\\"file\\" name=\\"upload\\" id=\\"idwall-upload\\" />";\n html += "<p id=\\"idwall-file-name\\">No file selected.</p>";\n\n // Append to body.\n document.body.insertAdjacentHTML(\'beforeend\', html);\n // Populate elements JSON, now that they exist.\n elements = getElements(container_id);\n };\n\n var getElements = function getElements(container_id) {\n\n /*\n * Generates JSON with all the elements from the injected HTML.\n *\n * @param string containerId - ID of the chosen outer container.\n */\n\n return {\n container: document.getElementById(container_id),\n // Display area.\n display: document.getElementById(displayContainerId),\n hint: document.querySelector(".idwall-display p"),\n overlays: document.querySelectorAll("[id^=idwall-overlay-]"),\n crop: document.getElementById("idwall-crop"),\n handles: document.querySelectorAll("[id^=idwall-resize-]"),\n // Upload area.\n upload: document.getElementById("idwall-upload"),\n upload_fake: document.getElementById("idwall-upload-fake"),\n filename: document.getElementById("idwall-file-name"),\n // Preview crop area.\n preview: document.getElementById(previewContainerId)\n };\n };\n\n var fakeInput = function fakeInput(input, fake_input) {\n\n /*\n * Gets a fake input to answer as if it were the real one.\n *\n * @param Node input - the input to be hidden and faked.\n * @param Node fake_input - the input that will simulate the hidden one.\n */\n\n input.style.display = "none";\n fake_input.addEventListener("click", function (event) {\n event = event || window.event;\n event.preventDefault();\n\n input.click();\n });\n };\n\n var startCropping = function startCropping(event) {\n\n /*\n * Displays the inputted file and and the cropping UI.\n */\n event = event || window.event;\n event.preventDefault();\n\n elements.display.classList.remove("hovered");\n\n if (typeof event.target.files !== "undefined" || checkForFile(event)) {\n // Get the file object and start the reader.\n var file = typeof event.target.files === "undefined" ? event.dataTransfer.files[0] : event.target.files[0],\n reader = new FileReader();\n\n displayFilename(file.name);\n\n // Display the image, hide the label and show cropping area.\n reader.onload = function (event) {\n elements.display.style.backgroundImage = "url(" + event.target.result + ")";\n elements.hint.style.display = "none";\n elements.crop.style.display = "block";\n previewCropped();\n sizeOverlays();\n };\n\n reader.readAsDataURL(file);\n }\n };\n\n var displayFilename = function displayFilename(name) {\n\n /*\n * Add actual filename to the filename element.\n *\n * @param string name - the name of the file being uploaded.\n */\n\n elements.filename.innerHTML = name;\n };\n\n var checkForFile = function checkForFile(event) {\n\n /*\n * Checks if a file is being dragged over the window.\n *\n * @return false if no file, true if there is a file.\n */\n\n event = event || window.event;\n return typeof event.dataTransfer !== "undefined" ? true : false;\n };\n\n var sizeOverlays = function sizeOverlays() {\n\n /*\n * Resizes the overlay divs based on the position\n * and size of the cropping area.\n */\n\n var crop = elements.crop;\n var overlays = elements.overlays;\n var crop_offset = crop.offsetParent;\n\n // 0. overlay-top\n // 1. overlay-bottom\n // 2. overlay-left\n // 3. overlay-right\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = overlays[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var overlay = _step3.value;\n\n overlay.style.display = "block";\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n var top = crop.offsetTop;\n var bottom = crop_offset.offsetHeight - (crop.offsetHeight + crop.offsetTop);\n overlays[0].style.height = top + "px";\n overlays[1].style.height = bottom + "px";\n\n var middle = crop_offset.offsetHeight - (top + bottom);\n overlays[2].style.height = middle + "px";\n overlays[3].style.height = middle + "px";\n\n overlays[2].style.top = top + "px";\n overlays[3].style.top = top + "px";\n\n overlays[2].style.width = crop.offsetLeft + "px";\n overlays[3].style.width = crop_offset.offsetWidth - (crop.offsetLeft + crop.offsetWidth) + "px";\n };\n\n var dragFileEnter = function dragFileEnter(event) {\n\n /*\n * Gives feedback when the file enterd the display area.\n */\n\n if (checkForFile(event)) {\n elements.display.classList.add("hovered");\n }\n };\n\n var dragFileLeave = function dragFileLeave(event) {\n\n /*\n * Gives feedback when the file left the display area.\n */\n\n if (checkForFile(event)) {\n elements.display.classList.remove("hovered");\n }\n };\n\n var dragFileOver = function dragFileOver(event) {\n\n /*\n * Make sure the source item if copied when dropped.\n */\n\n event = event || window.event;\n\n if (checkForFile(event)) {\n event.stopPropagation();\n event.preventDefault();\n event.dataTransfer.dropEffect = "copy";\n }\n };\n\n var startMoving = function startMoving(event) {\n\n /*\n * Gets all starting positions for the moving action and starts it.\n */\n\n if (!is_resizing) {\n\n is_moving = true;\n event = event || window.event;\n\n var crop = elements.crop;\n var display = elements.display;\n\n var mouse_x = event.clientX,\n mouse_y = event.clientY,\n top = crop.offsetTop,\n left = crop.offsetLeft,\n crop_width = crop.offsetWidth,\n crop_height = crop.offsetHeight,\n display_width = display.offsetWidth,\n display_height = display.offsetHeight;\n\n var diff_x = mouse_x - left,\n diff_y = mouse_y - top;\n\n document.onmousemove = function (event) {\n event = event || window.event;\n\n var mouse_x = event.clientX,\n mouse_y = event.clientY;\n\n var next_x = mouse_x - diff_x,\n next_y = mouse_y - diff_y;\n\n if (next_x < 0) next_x = 0;\n if (next_y < 0) next_y = 0;\n if (next_x + crop_width > display_width) next_x = display_width - crop_width;\n if (next_y + crop_height > display_height) next_y = display_height - crop_height;\n\n move(crop, next_x, next_y);\n };\n }\n };\n\n var move = function move(div, next_x, next_y) {\n div.style.left = next_x + "px";\n div.style.top = next_y + "px";\n sizeOverlays();\n };\n\n var startResizing = function startResizing(event) {\n\n /*\n * Gets all starting positions for the resizing action and starts it.\n */\n\n is_resizing = true;\n\n var container = document.getElementById(displayContainerId),\n container_bounds = container.getBoundingClientRect(),\n direction = event.target.id;\n\n var crop = elements.crop,\n init_size = crop.getBoundingClientRect();\n\n var init_pos_x = event.clientX,\n init_pos_y = event.clientY;\n\n document.onmousemove = function (event) {\n event = event || window.event;\n\n var pos_x = event.clientX,\n pos_y = event.clientY;\n\n var x = pos_x - init_size.left,\n y = pos_y - init_size.top;\n\n if (direction == "idwall-resize-e") crop.style.width = x + "px";\n if (direction == "idwall-resize-s") crop.style.height = y + "px";\n\n if (direction == "idwall-resize-w") {\n var reverse_x = init_pos_x - pos_x + init_size.width;\n var rel_pos_x = pos_x - container_bounds.left;\n crop.style.width = reverse_x + "px";\n crop.style.left = rel_pos_x + "px";\n }\n if (direction == "idwall-resize-n") {\n var reverse_y = init_pos_y - pos_y + init_size.height;\n var rel_pos_y = pos_y - container_bounds.top;\n crop.style.height = reverse_y + "px";\n crop.style.top = rel_pos_y + "px";\n }\n\n if (direction == "idwall-resize-nw") {\n var _reverse_x = init_pos_x - pos_x + init_size.width;\n var _rel_pos_x = pos_x - container_bounds.left;\n crop.style.width = _reverse_x + "px";\n crop.style.left = _rel_pos_x + "px";\n var _reverse_y = init_pos_y - pos_y + init_size.height;\n var _rel_pos_y = pos_y - container_bounds.top;\n crop.style.height = _reverse_y + "px";\n crop.style.top = _rel_pos_y + "px";\n }\n if (direction == "idwall-resize-ne") {\n crop.style.width = x + "px";\n var _reverse_y2 = init_pos_y - pos_y + init_size.height;\n var _rel_pos_y2 = pos_y - container_bounds.top;\n crop.style.height = _reverse_y2 + "px";\n crop.style.top = _rel_pos_y2 + "px";\n }\n\n if (direction == "idwall-resize-se") {\n crop.style.width = x + "px";\n crop.style.height = y + "px";\n }\n if (direction == "idwall-resize-sw") {\n var _reverse_x2 = init_pos_x - pos_x + init_size.width;\n var _rel_pos_x2 = pos_x - container_bounds.left;\n crop.style.width = _reverse_x2 + "px";\n crop.style.left = _rel_pos_x2 + "px";\n crop.style.height = y + "px";\n }\n\n sizeOverlays();\n };\n };\n\n var previewCropped = function previewCropped() {\n\n /*\n * Crops and displays image in preview area.\n */\n\n var cropped = "";\n\n var base64 = elements.display.style.backgroundImage.slice(5, -2);\n\n var screenshot_bounds = elements.crop.getBoundingClientRect();\n var container_bounds = elements.display.getBoundingClientRect();\n var preview_bounds = elements.preview.getBoundingClientRect();\n\n var canvas = document.createElement("canvas");\n var context = canvas.getContext("2d");\n var image = new Image();\n image.onload = function () {\n // Check image orientation.\n var orientation = image.width > image.height ? "horizontal" : "vertical";\n // Get background image size.\n var bg_width = 0,\n bg_height = 0,\n border_top = 0,\n border_left = 0;\n if (orientation === "horizontal") {\n // Width of the image will be the same as the container.\n bg_width = container_bounds.width;\n bg_height = image.height * container_bounds.width / image.width;\n border_top = (container_bounds.height - bg_height) / 2;\n } else if (orientation === "vertical") {\n // Height of the image will be the same as the container.\n bg_height = container_bounds.height;\n bg_width = image.width * container_bounds.height / image.height;\n border_left = (container_bounds.width - bg_width) / 2;\n }\n var resize_ratio = image.height / bg_height;\n\n // Get crop area position relative to container.\n var relTop = screenshot_bounds.top - container_bounds.top;\n var relLeft = screenshot_bounds.left - container_bounds.left;\n\n // Get the crop area position relative to the real image.\n var top = (relTop - border_top) * resize_ratio;\n var left = (relLeft - border_left) * resize_ratio;\n // Get width and height of crop relative to real image.\n var width = screenshot_bounds.width * resize_ratio;\n var height = screenshot_bounds.height * resize_ratio;\n\n canvas.width = width;\n canvas.height = height;\n context.clearRect(0, 0, preview_bounds.width, preview_bounds.height);\n context.drawImage(image, left, top, width, height, 0, 0, width, height);\n\n cropped = canvas.toDataURL();\n elements.preview.style.backgroundImage = "url(" + cropped + ")";\n };\n\n image.src = base64;\n };\n\n var clear = function clear() {\n is_moving = false;\n is_resizing = false;\n previewCropped();\n document.onmousemove = function () {};\n };\n\n return {\n init: init\n };\n}();\n\nmodule.exports = exports = IdCrop;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9saWIvanMvaWRjcm9wLmpzPzQ4N2UiXSwic291cmNlc0NvbnRlbnQiOlsiY29uc3QgSWRDcm9wID0gKGZ1bmN0aW9uKCkge1xuICAgIFwidXNlIHN0cmljdFwiO1xuXG4gICAgbGV0IGVsZW1lbnRzID0ge30sXG4gICAgICAgIGlzX21vdmluZyA9IGZhbHNlLFxuICAgICAgICBpc19yZXNpemluZyA9IGZhbHNlLFxuICAgICAgICBkaXNwbGF5Q29udGFpbmVySWQsXG4gICAgICAgIHByZXZpZXdDb250YWluZXJJZCxcbiAgICAgICAgY3JvcHBlZCA9IFwiXCI7XG5cbiAgICBjb25zdCBpbml0ID0gZnVuY3Rpb24gKGNvbnRhaW5lcl9pZCwgX2Rpc3BsYXlDb250YWluZXJJZCwgX3ByZXZpZXdDb250YWluZXJJZCkge1xuXG4gICAgICAgIGRpc3BsYXlDb250YWluZXJJZCA9IF9kaXNwbGF5Q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lbnQgfHwgd2luZG93LmV2ZW50O1xuICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuXG4gICAgICAgIGVsZW1lbnRzLmRpc3BsYXkuY2xhc3NMaXN0LnJlbW92ZShcImhvdmVyZWRcIik7XG5cbiAgICAgICAgaWYgKHR5cGVvZiBldmVudC50YXJnZXQuZmlsZXMgIT09IFwidW5kZWZpbmVkXCIgfHwgY2hlY2tGb3JGaWxlKGV2ZW50KSkge1xuICAgICAgICAgICAgLy8gR2V0IHRoZSBmaWxlIG9iamVjdCBhbmQgc3RhcnQgdGhlIHJlYWRlci5cbiAgICAgICAgICAgIGNvbnN0IGZpbGUgPSB0eXBlb2YgZXZlbnQudGFyZ2V0LmZpbGVzID09PSBcInVuZGVmaW5lZFwiID9cbiAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQuZGF0YVRyYW5zZmVyLmZpbGVzWzBdIDpcbiAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQudGFyZ2V0LmZpbGVzWzBdLFxuICAgICAgICAgICAgICAgICAgcmVhZGVyID0gbmV3IEZpbGVSZWFkZXIoKTtcblxuICAgICAgICAgICAgZGlzcGxheUZpbGVuYW1lKGZpbGUubmFtZSk7XG5cbiAgICAgICAgICAgIC8vIERpc3BsYXkgdGhlIGltYWdlLCBoaWRlIHRoZSBsYWJlbCBhbmQgc2hvdyBjcm9wcGluZyBhcmVhLlxuICAgICAgICAgICAgcmVhZGVyLm9ubG9hZCA9IGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgICAgIGVsZW1lbnRzLmRpc3BsYXkuc3R5bGUuYmFja2dyb3VuZEltYWdlID1cbiAgICAgICAgICAgICAgICAgICAgXCJ1cmwoXCIgKyBldmVudC50YXJnZXQucmVzdWx0ICsgXCIpXCI7XG4gICAgICAgICAgICAgICAgZWxlbWVudHMuaGludC5zdHlsZS5kaXNwbGF5ID0gXCJub25lXCI7XG4gICAgICAgICAgICAgICAgZWxlbWVudHMuY3JvcC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ik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBjb25zdCBkcmFnRmlsZU92ZXIgPSBmdW5jdGlvbiAoZXZlbnQpIHtcblxuICAgICAgICAvKlxuICAgICAgICAgKiBNYWtlIHN1cmUgdGhlIHNvdXJjZSBpdGVtIGlmIGNvcGllZCB3aGVuIGRyb3BwZWQuXG4gICAgICAgICAqL1xuXG4gICAgICAgIGV2ZW50ID0gZXZlbnQgfHwgd2luZG93LmV2ZW50O1xuXG4gICAgICAgIGlmIChjaGVja0ZvckZpbGUoZXZlbnQpKSB7XG4gICAgICAgICAgICBldmVudC5zdG9wUHJvcGFnYXRpb24oKTtcbiAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICBldmVudC5kYXRhVHJhbnNmZXIuZHJvcEVmZmVjdCA9IFwiY29weVwiO1xuICAgICAgICB9XG5cblxuICAgIH1cblxuICAgIGNvbnN0IHN0YXJ0TW92aW5nID0gZnVuY3Rpb24gKGV2ZW50KSB7XG5cbiAgICAgICAgLypcbiAgICAgICAgICogR2V0cyBhbGwgc3RhcnRpbmcgcG9zaXRpb25zIGZvciB0aGUgbW92aW5nIGFjdGlvbiBhbmQgc3RhcnRzIGl0LlxuICAgICAgICAgKi9cblxuICAgICAgICBpZighaXNfcmVzaXppbmcpIHtcblxuICAgICAgICAgICAgaXNfbW92aW5nID0gdHJ1ZTtcbiAgICAgICAgICAgIGV2ZW50ID0gZXZlbnQgfHwgd2luZG93LmV2ZW50O1xuXG4gICAgICAgICAgICBjb25zdCBjcm9wID0gZWxlbWVudHMuY3JvcDtcbiAgICAgICAgICAgIGNvbnN0IGRpc3BsYXkgPSBlbGVtZW50cy5kaXNwbGF5O1xuXG4gICAgICAgICAgICB2YXIgbW91c2VfeCA9IGV2ZW50LmNsaWVudFgsXG4gICAgICAgICAgICAgICAgbW91c2VfeSA9IGV2ZW50LmNsaWVudFksXG4gICAgICAgICAgICAgICAgdG9wID0gY3JvcC5vZmZzZXRUb3AsXG4gICAgICAgICAgICAgICAgbGVmdCA9IGNyb3Aub2Zmc2V0TGVmdCxcbiAgICAgICAgICAgICAgICBjcm9wX3dpZHRoID0gY3JvcC5vZmZzZXRXaWR0aCxcbiAgICAgICAgICAgICAgICBjcm9wX2hlaWdodCA9IGNyb3Aub2Zmc2V0SGVpZ2h0LFxuICAgICAgICAgICAgICAgIGRpc3BsYXlfd2lkdGggPSBkaXNwbGF5Lm9mZnNldFdpZHRoLFxuICAgICAgICAgICAgICAgIGRpc3BsYXlfaGVpZ2h0ID0gZGlzcGxheS5vZmZzZXRIZWlnaHQ7XG5cbiAgICAgICAgICAgIHZhciBkaWZmX3ggPSBtb3VzZV94IC0gbGVmdCxcbiAgICAgICAgICAgICAgICBkaWZmX3kgPSBtb3VzZV95IC0gdG9wO1xuXG4gICAgICAgICAgICBkb2N1bWVudC5vbm1vdXNlbW92ZSA9IGZ1bmN0aW9uKGV2ZW50KXtcbiAgICAgICAgICAgICAgICBldmVudCA9IGV2ZW50IHx8IHdpbmRvdy5ldmVudDtcblxuICAgICAgICAgICAgICAgIHZhciBtb3VzZV94ID0gZXZlbnQuY2xpZW50WCxcbiAgICAgICAgICAgICAgICAgICAgbW91c2VfeSA9IGV2ZW50LmNsaWVudFk7XG5cbiAgICAgICAgICAgICAgICB2YXIgbmV4dF94ID0gbW91c2VfeCAtIGRpZmZfeCxcbiAgICAgICAgICAgICAgICAgICAgbmV4dF95ID0gbW91c2VfeSAtIGRpZmZfeTtcblxuICAgICAgICAgICAgICAgIGlmIChuZXh0X3ggPCAwKSBuZXh0X3ggPSAwO1xuICAgICAgICAgICAgICAgIGlmIChuZXh0X3kgPCAwKSBuZXh0X3kgPSAwO1xuICAgICAgICAgICAgICAgIGlmIChuZXh0X3ggKyBjcm9wX3dpZHRoID4gZGlzcGxheV93aWR0aClcbiAgICAgICAgICAgICAgICAgICAgbmV4dF94ID0gZGlzcGxheV93aWR0aCAtIGNyb3Bfd2lkdGg7XG4gICAgICA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AgIGNvbnN0IGluaXRfcG9zX3ggPSBldmVudC5jbGllbnRYLFxuICAgICAgICAgICAgICBpbml0X3Bvc195ID0gZXZlbnQuY2xpZW50WTtcblxuICAgICAgICBkb2N1bWVudC5vbm1vdXNlbW92ZSA9IGZ1bmN0aW9uKGV2ZW50KSB7XG4gICAgICAgICAgICBldmVudCA9IGV2ZW50IHx8IHdpbmRvdy5ldmVudDtcblxuICAgICAgICAgICAgbGV0IHBvc194ID0gZXZlbnQuY2xpZW50WCxcbiAgICAgICAgICAgICAgICBwb3NfeSA9IGV2ZW50LmNsaWVudFk7XG5cbiAgICAgICAgICAgIGxldCB4ID0gcG9zX3ggLSBpbml0X3NpemUubGVmdCxcbiAgICAgICAgICAgICAgICB5ID0gcG9zX3kgLSBpbml0X3NpemUudG9wO1xuXG4gICAgICAgICAgICBpZiAoZGlyZWN0aW9uID09IFwiaWR3YWxsLXJlc2l6ZS1lXCIpIGNyb3Auc3R5bGUud2lkdGggPSB4ICsgXCJweFwiO1xuICAgICAgICAgICAgaWYgKGRpcmVjdGlvbiA9PSBcImlkd2FsbC1yZXNpemUtc1wiKSBjcm9wLnN0eWxlLmhlaWdodCA9IHkgKyBcInB4XCI7XG5cbiAgICAgICAgICAgIGlmIChkaXJlY3Rpb24gPT0gXCJpZHdhbGwtcmVzaXplLXdcIikge1xuICAgICAgICAgICAgICAgIGNvbnN0IHJldmVyc2VfeCA9IGluaXRfcG9zX3ggLSBwb3NfeCArIGluaXRfc2l6ZS53aWR0aDtcbiAgICAgICAgICAgICAgICBjb25zdCByZWxfcG9zX3ggPSBwb3NfeCAtIGNvbnRhaW5lcl9ib3VuZHMubGVmdDtcbiAgICAgICAgICAgICAgICBjcm9wLnN0eWxlLndpZHRoID0gcmV2ZXJzZV94ICsgXCJweFwiO1xuICAgICAgICAgICAgICAgIGNyb3Auc3R5bGUubGVmdCA9IHJlbF9wb3NfeCArIFwicHhcIjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChkaXJlY3Rpb24gPT0gXCJpZHdhbGwtcmVzaXplLW5cIikge1xuICAgICAgICAgICAgICAgIGNvbnN0IHJldmVyc2VfeSA9IGluaXRfcG9zX3kgLSBwb3NfeSArIGluaXRfc2l6ZS5oZWlnaHQ7XG4gICAgICAgICAgICAgICAgY29uc3QgcmVsX3Bvc195ID0gcG9zX3kgLSBjb250YWluZXJfYm91bmRzLnRvcDtcbiAgICAgICAgICAgICAgICBjcm9wLnN0eWxlLmhlaWdodCA9IHJldmVyc2VfeSArIFwicHhcIjtcbiAgICAgICAgICAgICAgICBjcm9wLnN0eWxlLnRvcCA9IHJlbF9wb3NfeSArIFwicHhcIjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGRpcmVjdGlvbiA9PSBcImlkd2FsbC1yZXNpemUtbndcIikge1xuICAgICAgICAgICAgICAgIGNvbnN0IHJldmVyc2VfeCA9IGluaXRfcG9zX3ggLSBwb3NfeCArIGluaXRfc2l6ZS53aWR0aDtcbiAgICAgICAgICAgICAgICBjb25zdCByZWxfcG9zX3ggPSBwb3NfeCAtIGNvbnRhaW5lcl9ib3VuZHMubGVmdDtcbiAgICAgICAgICAgICAgICBjcm9wLnN0eWxlLndpZHRoID0gcmV2ZXJzZV94ICsgXCJweFwiO1xuICAgICAgICAgICAgICAgIGNyb3Auc3R5bGUubGVmdCA9IHJlbF9wb3NfeCArIFwicHhcIjtcbiAgICAgICAgICAgICAgICBjb25zdCByZXZlcnNlX3kgPSBpbml0X3Bvc195IC0gcG9zX3kgKyBpbml0X3NpemUuaGVpZ2h0O1xuICAgICAgICAgICAgICAgIGNvbnN0IHJlbF9wb3NfeSA9IHBvc195IC0gY29udGFpbmVyX2JvdW5kcy50b3A7XG4gICAgICAgICAgICAgICAgY3JvcC5zdHlsZS5oZWlnaHQgPSByZXZlcnNlX3kgKyBcInB4XCI7XG4gICAgICAgICAgICAgICAgY3JvcC5zdHlsZS50b3AgPSByZWxfcG9zX3kgKyBcInB4XCI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZGlyZWN0aW9uID09IFwiaWR3YWxsLXJlc2l6ZS1uZVwiKSB7XG4gICAgICAgICAgICAgICAgY3JvcC5zdHlsZS53aWR0aCA9IHggKyBcInB4XCI7XG4gICAgICAgICAgICAgICAgY29uc3QgcmV2ZXJzZV95ID0gaW5pdF9wb3NfeSAtIHBvc195ICsgaW5pdF9zaXplLmhlaWdodDtcbiAgICAgICAgICAgICAgICBjb25zdCByZWxfcG9zX3kgPSBwb3NfeSAtIGNvbnRhaW5lcl9ib3VuZHMudG9wO1xuICAgICAgICAgICAgICAgIGNyb3Auc3R5bGUuaGVpZ2h0ID0gcmV2ZXJzZV95ICsgXCJweFwiO1xuICAgICAgICAgICAgICAgIGNyb3Auc3R5bGUudG9wID0gcmVsX3Bvc195ICsgXCJweFwiO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoZGlyZWN0aW9uID09IFwiaWR3YWxsLXJlc2l6ZS1zZVwiKSB7XG4gICAgICAgICAgICAgICAgY3JvcC5zdHlsZS53aWR0aCA9IHggKyBcInB4XCI7XG4gICAgICAgICAgICAgICAgY3JvcC5zdHlsZS5oZWlnaHQgPSB5ICsgXCJweFwiO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGRpcmVjdGlvbiA9PSBcImlkd2FsbC1yZXNpemUtc3dcIikge1xuICAgICAgICAgICAgICAgIGNvbnN0IHJldmVyc2VfeCA9IGluaXRfcG9zX3ggLSBwb3NfeCArIGluaXRfc2l6ZS53aWR0aDtcbiAgICAgICAgICAgICAgICBjb25zdCByZWxfcG9zX3ggPSBwb3NfeCAtIGNvbnRhaW5lcl9ib3VuZHMubGVmdDtcbiAgICAgICAgICAgICAgICBjcm9wLnN0eWxlLndpZHRoID0gcmV2ZXJzZV94ICsgXCJweFwiO1xuICAgICAgICAgICAgICAgIGNyb3Auc3R5bGUubGVmdCA9IHJlbF9wb3NfeCArIFwicHhcIjtcbiAg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GggPiBpbWFnZS5oZWlnaHQgPyBcImhvcml6b250YWxcIiA6IFwidmVydGljYWxcIjtcbiAgICAgICAgICAgIC8vIEdldCBiYWNrZ3JvdW5kIGltYWdlIHNpemUuXG4gICAgICAgICAgICBsZXQgYmdfd2lkdGggPSAwLFxuICAgICAgICAgICAgICAgIGJnX2hlaWdodCA9IDAsXG4gICAgICAgICAgICAgICAgYm9yZGVyX3RvcCA9IDAsXG4gICAgICAgICAgICAgICAgYm9yZGVyX2xlZnQgPSAwO1xuICAgICAgICAgICAgaWYgKG9yaWVudGF0aW9uID09PSBcImhvcml6b250YWxcIikge1xuICAgICAgICAgICAgICAgIC8vIFdpZHRoIG9mIHRoZSBpbWFnZSB3aWxsIGJlIHRoZSBzYW1lIGFzIHRoZSBjb250YWluZXIuXG4gICAgICAgICAgICAgICAgYmdfd2lkdGggPSBjb250YWluZXJfYm91bmRzLndpZHRoO1xuICAgICAgICAgICAgICAgIGJnX2hlaWdodCA9IChpbWFnZS5oZWlnaHQgKiBjb250YWluZXJfYm91bmRzLndpZHRoKSAvIGltYWdlLndpZHRoO1xuICAgICAgICAgICAgICAgIGJvcmRlcl90b3AgPSAoY29udGFpbmVyX2JvdW5kcy5oZWlnaHQgLSBiZ19oZWlnaHQpIC8gMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAob3JpZW50YXRpb24gPT09IFwidmVydGljYWxcIil7XG4gICAgICAgICAgICAgICAgLy8gSGVpZ2h0IG9mIHRoZSBpbWFnZSB3aWxsIGJlIHRoZSBzYW1lIGFzIHRoZSBjb250YWluZXIuXG4gICAgICAgICAgICAgICAgYmdfaGVpZ2h0ID0gY29udGFpbmVyX2JvdW5kcy5oZWlnaHQ7XG4gICAgICAgICAgICAgICAgYmdfd2lkdGggPSAoaW1hZ2Uud2lkdGggKiBjb250YWluZXJfYm91bmRzLmhlaWdodCkgLyBpbWFnZS5oZWlnaHQ7XG4gICAgICAgICAgICAgICAgYm9yZGVyX2xlZnQgPSAoY29udGFpb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QTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBREE7QUFJQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///0\n')},/*!*************************!*\
function(module,exports,__webpack_require__){"use strict";eval('\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nvar Point = function () {\n function Point(x, y) {\n _classCallCheck(this, Point);\n\n this.x = x;\n this.y = y;\n }\n\n _createClass(Point, [{\n key: "findAngle",\n value: function findAngle(other) {\n var dx = this.x - other.x;\n var dy = this.y - other.y;\n\n return Math.atan2(dx, dy);\n }\n }, {\n key: "move",\n value: function move(xStep, yStep) {\n this.x += xStep;\n this.y += yStep;\n }\n }], [{\n key: "findCenter",\n value: function findCenter(points) {\n var x = 0;\n var y = 0;\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = points[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var point = _step.value;\n\n x += point.x;\n y += point.y;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return new Point(x / points.length, y / points.length);\n }\n }, {\n key: "sort",\n value: function sort(points) {\n var center = this.findCenter(points);\n\n return points.sort(function (a, b) {\n var aa = a.findAngle(center);\n var ab = b.findAngle(center);\n return aa > ab;\n });\n }\n }]);\n\n return Point;\n}();\n\nmodule.exports = exports = Point;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9saWIvanMvaWRjcm9wL1BvaW50LmpzPzEzZDUiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmNsYXNzIFBvaW50IHtcbiAgY29uc3RydWN0b3IoeCwgeSkge1xuICAgIHRoaXMueCA9IHg7XG4gICAgdGhpcy55ID0geTtcbiAgfVxuXG4gIGZpbmRBbmdsZShvdGhlcikge1xuICAgIGNvbnN0IGR4ID0gdGhpcy54IC0gb3RoZXIueDtcbiAgICBjb25zdCBkeSA9IHRoaXMueSAtIG90aGVyLnk7XG5cbiAgICByZXR1cm4gTWF0aC5hdGFuMihkeCwgZHkpO1xuICB9XG5cbiAgbW92ZSh4U3RlcCwgeVN0ZXApIHtcbiAgICB0aGlzLnggKz0geFN0ZXA7XG4gICAgdGhpcy55ICs9IHlTdGVwO1xuICB9XG5cbiAgc3RhdGljIGZpbmRDZW50ZXIocG9pbnRzKSB7XG4gICAgbGV0IHggPSAwO1xuICAgIGxldCB5ID0gMDtcblxuICAgIGZvciAoY29uc3QgcG9pbnQgb2YgcG9pbnRzKSB7XG4gICAgICB4ICs9IHBvaW50Lng7XG4gICAgICB5ICs9IHBvaW50Lnk7XG4gICAgfVxuXG4gICAgcmV0dXJuIG5ldyBQb2ludCh4IC8gcG9pbnRzLmxlbmd0aCwgeSAvIHBvaW50cy5sZW5ndGgpO1xuICB9XG5cbiAgc3RhdGljIHNvcnQocG9pbnRzKSB7XG4gICAgY29uc3QgY2VudGVyID0gdGhpcy5maW5kQ2VudGVyKHBvaW50cyk7XG5cbiAgICByZXR1cm4gcG9pbnRzLnNvcnQoZnVuY3Rpb24oYSwgYikge1xuICAgICAgY29uc3QgYWEgPSBhLmZpbmRBbmdsZShjZW50ZXIpO1xuICAgICAgY29uc3QgYWIgPSBiLmZpbmRBbmdsZShjZW50ZXIpO1xuICAgICAgcmV0dXJuIGFhID4gYWI7XG4gICAgfSk7XG4gIH1cbn1cblxubW9kdWxlLmV4cG9ydHMgPSBleHBvcnRzID0gUG9pbnQ7XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gbGliL2pzL2lkY3JvcC9Qb2ludC5qcyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTs7Ozs7QUFDQTtBQUNBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBOzs7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUhBO0FBQUE7QUFBQTtBQUNBO0FBREE7QUFJQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFQQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFRQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7OztBQUdBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///0\n')},/*!*********************************!*\
!*** ./lib/js/idcrop/IdCrop.js ***!
\*********************************/
/*! dynamic exports provided */
/*! all exports used */
function(module,exports,__webpack_require__){"use strict";eval('\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nvar Point = __webpack_require__(/*! ./Point.js */ 0);\nvar Handle = __webpack_require__(/*! ./Handle.js */ 6);\nvar Polygon = __webpack_require__(/*! ./Polygon.js */ 2);\nvar CropArea = __webpack_require__(/*! ./CropArea.js */ 7);\n\nvar helpers = __webpack_require__(/*! ./helpers.js */ 3);\n\nvar IdCrop = function () {\n function IdCrop(displayId) {\n var previewId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";\n var toolbarId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";\n var sides = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 4;\n\n _classCallCheck(this, IdCrop);\n\n /* eslint-disable */\n this.displayArea = document.querySelector(displayId);\n this.toolbarArea = toolbarId ? document.querySelector(toolbarId) : false;\n /* eslint-disable */\n this.previewArea = previewId ? document.querySelector(previewId) : false;\n\n this.cropArea = undefined;\n this.cropPolygon = undefined;\n\n this.input = undefined;\n this.filenameArea = undefined;\n\n this.handles = [];\n this.points = [];\n\n this.image = "data:image/jpeg;base64,";\n this.numSides = sides;\n }\n\n _createClass(IdCrop, [{\n key: "init",\n value: function init() {\n this.displayArea.classList.add("idwall-display");\n if (this.previewArea) this.previewArea.classList.add("idwall-preview");\n\n if (this.toolbarArea) {\n var htmlDisplay = "";\n var htmlToolbar = "";\n\n var hint = document.createElement("p");\n var hintText = document.createTextNode("Drop files here or ");\n var fakeInput = document.createElement("a");\n var fakeInputText = document.createTextNode("Browse...");\n fakeInput.title = "Browse";\n fakeInput.href = "";\n fakeInput.appendChild(fakeInputText);\n hint.appendChild(hintText);\n hint.appendChild(fakeInput);\n this.displayArea.appendChild(hint);\n\n this.input = document.createElement("input");\n this.input.type = "file";\n this.toolbarArea.appendChild(this.input);\n helpers.fakeInput(this.input, fakeInput);\n\n this.filenameArea = document.createElement("p");\n this.filenameArea.appendChild(document.createTextNode("No file selected."));\n if (this.numSides === Infinity) {\n var closeButton = document.createElement("a");\n var closeButtonText = document.createTextNode("Close path");\n closeButton.title = "Close path";\n closeButton.href = "";\n closeButton.appendChild(closeButtonText);\n this.toolbarArea.appendChild(closeButton);\n }\n this.toolbarArea.appendChild(this.filenameArea);\n this.dragDropInput();\n }\n\n this.createEvents();\n }\n }, {\n key: "createEvents",\n value: function createEvents() {\n var self = this;\n window.addEventListener("mouseup", function () {\n self.clear(self);\n });\n if (!this.toolbarArea) {\n document.addEventListener("DOMContentLoaded", function () {\n var src = helpers.getBgSource(self.displayArea);\n helpers.dataURIFromSrc(src).then(function (base64) {\n self.startCroppingArea(base64, self);\n });\n });\n }\n }\n }, {\n key: "dragDropInput",\n value: function dragDropInput() {\n var self = this;\n this.input.addEventListener("change", function (event) {\n self.getDroppedFile(event, self);\n });\n this.displayArea.addEventListener("dragenter", function () {\n self.displayArea.classList.add("hovered");\n });\n this.displayArea.addEventListener("dragleave", function () {\n self.displayArea.classList.remove("hovered");\n });\n this.displayArea.addEventListener("dragover", function (event) {\n event = event || window.event;\n event.stopPropagation();\n event.preventDefault();\n event.dataTransfer.dropEffect = "copy";\n });\n this.displayArea.addEventListener("drop", function (event) {});\n }\n }, {\n key: "getDroppedFile",\n value: function getDroppedFile(event, self) {\n event = event || window.event;\n event.preventDefault();\n\n self.displayArea.classList.remove("hovered");\n\n var file = typeof event.target !== "undefined" ? event.target.files[0] : event.dataTransfer.files[0];\n\n var reader = new FileReader();\n\n if (this.toolbarArea) self.filenameArea.innerHTML = file.name;\n\n reader.onload = function (event) {\n startCroppingArea(event.target.result, self);\n };\n\n reader.readAsDataURL(file);\n }\n }, {\n key: "startCroppingArea",\n value: function startCroppingArea(base64, self) {\n self.cropArea = new CropArea(self.displayArea, base64);\n self.cropArea.create().then(function (img) {\n self.image = img;\n self.displayArea.style.backgroundImage = "url(\'" + base64 + "\')";\n });\n\n // Clear all handles.\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = self.handles[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var handle = _step.value;\n\n handle.deleteNode();\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n self.handles = [];\n\n // Add event listener to create new handles.\n self.cropArea.canvas.addEventListener("mousedown", function (event) {\n self.createHandles(event, self);\n });\n }\n }, {\n key: "createHandles",\n value: function createHandles(event, self) {\n if (self.cropArea.isDrawing) {\n var canvas = self.cropArea.canvas,\n cbounds = canvas.getBoundingClientRect();\n // Mouse position relative to canvas.\n var x = event.clientX - cbounds.left,\n y = event.clientY - cbounds.top;\n\n var point = new Point(x, y),\n handle = new Handle(self.displayArea, self.image.left, self.image.top, point);\n\n handle.create();\n self.handles.push(handle);\n self.points.push(point);\n\n if (self.handles.length == self.numSides) {\n self.points = Point.sort(self.points);\n self.polygon = new Polygon(self.displayArea, canvas);\n self.polygon.drawWithOverlay(self.points, 0.7, "white");\n\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = self.handles[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n handle = _step2.value;\n\n handle.direction = handle.setDirection(self.points);\n handle.node.addEventListener("mousedown", function (event) {\n self.polygon.startResizing(event, self.points);\n });\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n }\n }\n }, {\n key: "clear",\n value: function clear(self) {\n if (typeof self.cropArea !== "undefined" && self.handles.length == self.numSides) {\n var base64 = self.cropArea.crop(self.previewArea, self.points);\n self.previewArea.style.backgroundImage = "url(\'" + base64 + "\')";\n document.onmousemove = function () {};\n }\n }\n }]);\n\n return IdCrop;\n}();\n\nmodule.exports = exports = IdCrop;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9saWIvanMvaWRjcm9wL0lkQ3JvcC5qcz9jYTcwIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5jb25zdCBQb2ludCA9IHJlcXVpcmUoXCIuL1BvaW50LmpzXCIpO1xuY29uc3QgSGFuZGxlID0gcmVxdWlyZShcIi4vSGFuZGxlLmpzXCIpO1xuY29uc3QgUG9seWdvbiA9IHJlcXVpcmUoXCIuL1BvbHlnb24uanNcIik7XG5jb25zdCBDcm9wQXJlYSA9IHJlcXVpcmUoXCIuL0Nyb3BBcmVhLmpzXCIpO1xuXG5jb25zdCBoZWxwZXJzID0gcmVxdWlyZShcIi4vaGVscGVycy5qc1wiKTtcblxuY2xhc3MgSWRDcm9wIHtcbiAgY29uc3RydWN0b3IoZGlzcGxheUlkLCBwcmV2aWV3SWQgPSBcIlwiLCB0b29sYmFySWQgPSBcIlwiLCBzaWRlcyA9IDQpIHtcbiAgICAvKiBlc2xpbnQtZGlzYWJsZSAqL1xuICAgIHRoaXMuZGlzcGxheUFyZWEgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKGRpc3BsYXlJZCk7XG4gICAgdGhpcy50b29sYmFyQXJlYSA9IHRvb2xiYXJJZCA/IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IodG9vbGJhcklkKSA6IGZhbHNlO1xuICAgIC8qIGVzbGludC1kaXNhYmxlICovXG4gICAgdGhpcy5wcmV2aWV3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QUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBVUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUFBO0FBRUE7QUFDQTtBQUFBO0FBQ0E7QUFFQTtBQUFBO0FBQ0E7QUFPQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFKQTtBQUFBO0FBQUE7QUFDQTtBQURBO0FBS0E7QUFBQTtBQUNBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQVZBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFXQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7QUFHQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///1\n')},/*!**********************************!*\
!*** ./lib/js/idcrop/Polygon.js ***!
\**********************************/
/*! dynamic exports provided */
/*! all exports used */
function(module,exports,__webpack_require__){"use strict";eval('\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nvar Point = __webpack_require__(/*! ./Point.js */ 0);\n\nvar Polygon = function () {\n function Polygon(container, canvas) {\n _classCallCheck(this, Polygon);\n\n this.container = container;\n this.canvas = canvas;\n }\n\n _createClass(Polygon, [{\n key: "drawWithOverlay",\n value: function drawWithOverlay(points, overlayAlpha, strokeStyle) {\n var img = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "";\n var fill = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "";\n\n var context = this.canvas.getContext("2d");\n // Save context for clipping and clear canvas.\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n context.save();\n // Draw overlay\n context.fillStyle = "rgba(0, 0, 0," + overlayAlpha + ")";\n context.fillRect(0, 0, this.canvas.width, this.canvas.height);\n context.restore();\n // Draw quadrilateral.\n context.save();\n context.setLineDash([5, 3]);\n context.strokeStyle = strokeStyle;\n context.lineWidth = 2;\n this.draw(context, points);\n // Create a "hole" on the overlay inside the quadrilateral.\n context.clip();\n if (!img && !fill) {\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n } else if (!img && fill) {\n context.fillStyle = fill;\n context.fillRect(0, 0, this.canvas.width, this.canvas.height);\n } else {\n context.drawImage(img, 0, 0, this.canvas.width, this.canvas.height);\n }\n // Add stroke outside the cleared area.\n if (strokeStyle) context.stroke();\n // Remove clipping mask.\n context.restore();\n }\n }, {\n key: "draw",\n value: function draw(context, points) {\n context.beginPath();\n context.moveTo(points[0].x, points[0].y);\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = points.slice(1)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var point = _step.value;\n\n context.lineTo(point.x, point.y);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n context.closePath();\n }\n }, {\n key: "startResizing",\n value: function startResizing(event, points) {\n if (!this.isDrawing && event.target.className === "handle") {\n var handle = event.target;\n var hdim = handle.offsetWidth;\n var direction = parseInt(handle.id.substr(10), 10);\n var bounds = this.canvas.getBoundingClientRect();\n\n var that = this;\n document.onmousemove = function (event) {\n var x = event.clientX;\n var y = event.clientY;\n\n if (x < bounds.left) x = bounds.left;\n if (x > bounds.right - hdim) x = bounds.right - hdim;\n if (y < bounds.top) y = bounds.top;\n if (y > bounds.bottom - hdim) y = bounds.bottom - hdim;\n\n that.resize(handle, direction, points, x, y);\n };\n }\n }\n }, {\n key: "resize",\n value: function resize(target, direction, points, x, y) {\n var cbounds = this.canvas.getBoundingClientRect();\n var dbounds = this.container.getBoundingClientRect();\n var hdim = target.offsetWidth;\n\n var displayX = x - dbounds.left;\n var displayY = y - dbounds.top;\n var canvasX = x - cbounds.left + hdim / 2;\n var canvasY = y - cbounds.top + hdim / 2;\n\n target.style.left = displayX + "px";\n target.style.top = displayY + "px";\n\n points[direction] = new Point(canvasX, canvasY);\n this.drawWithOverlay(points, 0.7, true);\n }\n }]);\n\n return Polygon;\n}();\n\nmodule.exports = exports = Polygon;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9saWIvanMvaWRjcm9wL1BvbHlnb24uanM/NThhMiJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuY29uc3QgUG9pbnQgPSByZXF1aXJlKFwiLi9Qb2ludC5qc1wiKTtcblxuY2xhc3MgUG9seWdvbiB7XG4gIGNvbnN0cnVjdG9yKGNvbnRhaW5lciwgY2FudmFzKSB7XG4gICAgdGhpcy5jb250YWluZXIgPSBjb250YWluZXI7XG4gICAgdGhpcy5jYW52YXMgPSBjYW52YXM7XG4gIH1cblxuICBkcmF3V2l0aE92ZXJsYXkocG9pbnRzLCBvdmVybGF5QWxwaGEsIHN0cm9rZVN0eWxlLCBpbWcgPSBcIlwiLCBmaWxsID0gXCJcIikge1xuICAgIGNvbnN0IGNvbnRleHQgPSB0a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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7QUFHQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///2\n')},/*!**********************************!*\
!*** ./lib/js/idcrop/helpers.js ***!
\**********************************/
/*! dynamic exports provided */
/*! all exports used */
function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\nfunction loadImage(src) {\n var img = new Image();\n\n /* eslint-disable */\n img.src = src.substring(0, 1) === "\\"" ? src.substring(1, src.length - 1) : src;\n /* eslint-enable */\n\n return new Promise(function (resolve, reject) {\n img.onload = function () {\n resolve(img);\n };\n img.onerror = function (error) {\n reject(error);\n };\n });\n}\n\nfunction dataURIFromSrc(src) {\n var canvas = document.createElement("canvas");\n var context = canvas.getContext("2d");\n\n return loadImage(src).then(function (img) {\n canvas.width = img.width;\n canvas.height = img.height;\n context.drawImage(img, 0, 0, canvas.width, canvas.height);\n return canvas.toDataURL();\n });\n}\n\nfunction getBgSource(element) {\n var style = element.currentStyle || window.getComputedStyle(element, false);\n return style.backgroundImage.slice(4, -1);\n}\n\nfunction fakeInput(input, fakeInput) {\n input.style.display = "none";\n fakeInput.addEventListener("click", function (event) {\n event = event || window.event;\n event.preventDefault();\n input.click();\n });\n}\n\nexports.loadImage = loadImage;\nexports.dataURIFromSrc = dataURIFromSrc;\nexports.getBgSource = getBgSource;\nexports.fakeInput = fakeInput;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9saWIvanMvaWRjcm9wL2hlbHBlcnMuanM/NGQ3YiJdLCJzb3VyY2VzQ29udGVudCI6WyJmdW5j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5kb3cuZ2V0Q29tcHV0ZWRTdHlsZShlbGVtZW50LCBmYWxzZSk7XG4gIHJldHVybiBzdHlsZS5iYWNrZ3JvdW5kSW1hZ2Uuc2xpY2UoNCwgLTEpO1xufVxuXG5mdW5jdGlvbiBmYWtlSW5wdXQoaW5wdXQsIGZha2VJbnB1dCkge1xuICBpbnB1dC5zdHlsZS5kaXNwbGF5ID0gXCJub25lXCI7XG4gIGZha2VJbnB1dC5hZGRFdmVudExpc3RlbmVyKFwiY2xpY2tcIiwgZnVuY3Rpb24oZXZlbnQpIHtcbiAgICBldmVudCA9IGV2ZW50IHx8IHdpbmRvdy5ldmVudDtcbiAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgIGlucHV0LmNsaWNrKCk7XG4gIH0pO1xufVxuXG5leHBvcnQgeyBsb2FkSW1hZ2UsIGRhdGFVUklGcm9tU3JjLCBnZXRCZ1NvdXJjZSwgZmFrZUlucHV0IH07XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gbGliL2pzL2lkY3JvcC9oZWxwZXJzLmpzIl0sIm1hcHBpbmdzIjoiOzs7OztBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUFBO0FBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///3\n')},/*!*************************!*\
!*** ./lib/js/index.js ***!

@@ -11,3 +26,3 @@ \*************************/

/*! all exports used */
function(module,exports,__webpack_require__){"use strict";eval("\n\n__webpack_require__(/*! ../scss/main.scss */ 2);\n\n__webpack_require__(/*! ./idcrop.js */ 0);\n\n__webpack_require__(/*! ./main.js */ 3);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9saWIvanMvaW5kZXguanM/NjIwYyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBJbXBvcnQgU0NTUyBmaWxlcy5cbmltcG9ydCBcIi4uL3Njc3MvbWFpbi5zY3NzXCI7XG5cbi8vIEltcG9ydCBKUy5cbmltcG9ydCBcIi4vaWRjcm9wLmpzXCI7XG5pbXBvcnQgXCIuL21haW4uanNcIjtcblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gbGliL2pzL2luZGV4LmpzIl0sIm1hcHBpbmdzIjoiOztBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///1\n")},/*!****************************!*\
function(module,exports,__webpack_require__){"use strict";eval("\n\n__webpack_require__(/*! ../scss/main.scss */ 5);\n\n__webpack_require__(/*! ./idcrop/IdCrop.js */ 1);\n\n__webpack_require__(/*! ./main.js */ 9);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9saWIvanMvaW5kZXguanM/NjIwYyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBJbXBvcnQgU0NTUyBmaWxlcy5cbmltcG9ydCBcIi4uL3Njc3MvbWFpbi5zY3NzXCI7XG5cbi8vIEltcG9ydCBKUy5cbmltcG9ydCBcIi4vaWRjcm9wL0lkQ3JvcC5qc1wiO1xuaW1wb3J0IFwiLi9tYWluLmpzXCI7XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gbGliL2pzL2luZGV4LmpzIl0sIm1hcHBpbmdzIjoiOztBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///4\n")},/*!****************************!*\
!*** ./lib/scss/main.scss ***!

@@ -17,3 +32,18 @@ \****************************/

/*! all exports used */
function(module,exports){eval("// removed by extract-text-webpack-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2xpYi9zY3NzL21haW4uc2Nzcz8yODI1Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIHJlbW92ZWQgYnkgZXh0cmFjdC10ZXh0LXdlYnBhY2stcGx1Z2luXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9saWIvc2Nzcy9tYWluLnNjc3Ncbi8vIG1vZHVsZSBpZCA9IDJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///2\n")},/*!************************!*\
function(module,exports){eval("// removed by extract-text-webpack-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2xpYi9zY3NzL21haW4uc2Nzcz8yODI1Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIHJlbW92ZWQgYnkgZXh0cmFjdC10ZXh0LXdlYnBhY2stcGx1Z2luXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9saWIvc2Nzcy9tYWluLnNjc3Ncbi8vIG1vZHVsZSBpZCA9IDVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///5\n")},/*!*********************************!*\
!*** ./lib/js/idcrop/Handle.js ***!
\*********************************/
/*! dynamic exports provided */
/*! all exports used */
function(module,exports,__webpack_require__){"use strict";eval('\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nvar Point = __webpack_require__(/*! ./Point.js */ 0);\n\n/*\n * TODO: Change this class to extend HTMLElement when it\'s stabilized and\n * available in most browsers. Right now it only works in Chrome.\n * https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements\n */\n\nvar Handle = function () {\n function Handle(parent, offsetX, offsetY, point) {\n _classCallCheck(this, Handle);\n\n this.parent = parent;\n this.offsetX = offsetX;\n this.offsetY = offsetY;\n this.point = new Point(point.x + offsetX, point.y + offsetY);\n\n this.node = document.createElement("div");\n }\n\n _createClass(Handle, [{\n key: "create",\n value: function create() {\n this.node.className = "handle";\n this.parent.appendChild(this.node);\n this.node.style.left = this.point.x - this.node.offsetWidth / 2 + "px";\n this.node.style.top = this.point.y - this.node.offsetWidth / 2 + "px";\n }\n }, {\n key: "setDirection",\n value: function setDirection(points) {\n /* eslint-disable */\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = points.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _ref = _step.value;\n\n var _ref2 = _slicedToArray(_ref, 2),\n index = _ref2[0],\n point = _ref2[1];\n\n if (point.x === this.point.x - this.offsetX && point.y === this.point.y - this.offsetY && this.node.id === "") {\n this.node.id = "direction-" + index;\n }\n }\n /* eslint-enable */\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n }, {\n key: "deleteNode",\n value: function deleteNode() {\n this.parent.removeChild(this.node);\n this.node = document.createElement("div");\n }\n }]);\n\n return Handle;\n}();\n\nmodule.exports = exports = Handle;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9saWIvanMvaWRjcm9wL0hhbmRsZS5qcz82YWEwIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5jb25zdCBQb2ludCA9IHJlcXVpcmUoXCIuL1BvaW50LmpzXCIpO1xuXG4vKlxuICogVE9ETzogQ2hhbmdlIHRoaXMgY2xhc3MgdG8gZXh0ZW5kIEhUTUxFbGVtZW50IHdoZW4gaXQncyBzdGFiaWxpemVkIGFuZFxuICogYXZhaWxhYmxlIGluIG1vc3QgYnJvd3Nlc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rop/CropArea.js ***!
\***********************************/
/*! dynamic exports provided */
/*! all exports used */
function(module,exports,__webpack_require__){"use strict";eval('\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nvar BgImage = __webpack_require__(/*! ./BgImage.js */ 8);\nvar Polygon = __webpack_require__(/*! ./Polygon.js */ 2);\nvar Point = __webpack_require__(/*! ./Point.js */ 0);\n\nvar helpers = __webpack_require__(/*! ./helpers.js */ 3);\n\nvar CropArea = function () {\n function CropArea(container, base64) {\n _classCallCheck(this, CropArea);\n\n this.container = container;\n this.base64 = base64;\n\n this.canvas = document.createElement("canvas");\n this.isDrawing = false;\n this.img = "";\n }\n\n _createClass(CropArea, [{\n key: "clearCanvas",\n value: function clearCanvas() {\n this.isDrawing = true;\n\n var context = this.canvas.getContext("2d");\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n }, {\n key: "create",\n value: function create() {\n this.clearCanvas();\n\n this.container.innerHTML = "";\n this.container.style.backgroundImage = "url(" + this.base64 + ")";\n this.container.appendChild(this.canvas);\n\n var that = this;\n return helpers.loadImage(this.base64).then(function (img) {\n that.img = new BgImage(img, that.container);\n that.canvas.width = that.img.width;\n that.canvas.height = that.img.height;\n that.canvas.style.left = that.img.left + "px";\n that.canvas.style.top = that.img.top + "px";\n return that.img;\n });\n }\n }, {\n key: "crop",\n value: function crop(preview, points) {\n var auxCanvas = document.createElement("canvas");\n\n auxCanvas.width = this.img.realWidth;\n auxCanvas.height = this.img.realHeight;\n\n var realPoints = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = points[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var point = _step.value;\n\n realPoints.push(new Point(point.x * this.img.ratio, point.y * this.img.ratio));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n var renderer = new Polygon(preview, auxCanvas);\n renderer.drawWithOverlay(realPoints, 1, false, false, "white");\n\n return auxCanvas.toDataURL();\n }\n }]);\n\n return CropArea;\n}();\n\nmodule.exports = exports = CropArea;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9saWIvanMvaWRjcm9wL0Nyb3BBcmVhLmpzPzZkODkiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmNvbnN0IEJnSW1hZ2UgPSByZXF1aXJlKFwiLi9CZ0ltYWdlLmpzXCIpO1xuY29uc3QgUG9seWdvbiA9IHJlcXVpcmUoXCIuL1BvbHlnb24uanNcIik7XG5jb25zdCBQb2ludCA9IHJlcXVpcmUoXCIuL1BvaW50LmpzXCIpO1xuXG5jb25zdCBoZWxwZXJzID0gcmVxdWlyZShcIi4vaGVscGVycy5qc1wiKTtcblxuY2xhc3MgQ3JvcEFyZWEge1xuICBjb25zdHJ1Y3Rvcihjb250YWluZXIsIGJhc2U2NCkge1xuICAgIHRoaXMuY29udGFpbmVyID0gY29udGFpbmVyO1xuICAgIHRoaXMuYmFzZTY0ID0gYmFzZTY0O1xuXG4gICAgdGhpcy5jYW52YXMgPSBkb2N1bWVudC5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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQU5BO0FBQUE7QUFBQTtBQUNBO0FBREE7QUFPQTtBQUFBO0FBQ0E7QUFBQTtBQUdBO0FBWEE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBWUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7O0FBR0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///7\n')},/*!**********************************!*\
!*** ./lib/js/idcrop/BgImage.js ***!
\**********************************/
/*! dynamic exports provided */
/*! all exports used */
function(module,exports,__webpack_require__){"use strict";eval('\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nvar BgImage = function () {\n function BgImage(img, container) {\n _classCallCheck(this, BgImage);\n\n this.container = container;\n this.img = img;\n }\n\n _createClass(BgImage, [{\n key: "calcDimensions",\n value: function calcDimensions() {\n var bounds = this.container.getBoundingClientRect();\n\n // Possible resized width and height.\n var height = this.realHeight * bounds.width / this.realWidth;\n var width = this.realWidth * bounds.height / this.realHeight;\n\n if (height <= bounds.height) {\n return {\n width: bounds.width,\n height: height,\n top: (bounds.height - height) / 2,\n left: 0\n };\n } else {\n return {\n height: bounds.height,\n width: width,\n top: 0,\n left: (bounds.width - width) / 2\n };\n }\n }\n }, {\n key: "realWidth",\n get: function get() {\n return this.img.width;\n }\n }, {\n key: "realHeight",\n get: function get() {\n return this.img.height;\n }\n }, {\n key: "left",\n get: function get() {\n return this.calcDimensions().left;\n }\n }, {\n key: "top",\n get: function get() {\n return this.calcDimensions().top;\n }\n }, {\n key: "width",\n get: function get() {\n return this.calcDimensions().width;\n }\n }, {\n key: "height",\n get: function get() {\n return this.calcDimensions().height;\n }\n }, {\n key: "ratio",\n get: function get() {\n return this.realHeight / this.height;\n }\n }]);\n\n return BgImage;\n}();\n\nmodule.exports = exports = BgImage;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9saWIvanMvaWRjcm9wL0JnSW1hZ2UuanM/ZDY2YiJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuY2xhc3MgQmdJbWFnZSB7XG4gIGNvbnN0cnVjdG9yKGltZywgY29udGFpbmVyKSB7XG4gICAgdGhpcy5jb250YWluZXIgPSBjb250YWluZXI7XG4gICAgdGhpcy5pbWcgPSBpbWc7XG4gIH1cblxuICBnZXQgcmVhbFdpZHRoKCkge1xuICAgIHJldHVybiB0aGlzLmltZy53aWR0aDtcbiAgfVxuXG4gIGdldCByZWFsSGVpZ2h0KCkge1xuICAgIHJldHVybiB0aGlzLmltZy5oZWlnaHQ7XG4gIH1cblxuICBnZXQgbGVmdCgpIHtcbiAgICByZXR1cm4gdGhpcy5jYWxjRGltZW5zaW9ucygpLmxlZnQ7XG4gIH1cblxuICBnZXQgdG9wKCkge1xuICAg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gpIC8gMlxuICAgICAgfTtcbiAgICB9XG4gIH1cbn1cblxubW9kdWxlLmV4cG9ydHMgPSBleHBvcnRzID0gQmdJbWFnZTtcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBsaWIvanMvaWRjcm9wL0JnSW1hZ2UuanMiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Ozs7O0FBQ0E7QUFDQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTs7O0FBNkJBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBSkE7QUFNQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFKQTtBQU1BO0FBQ0E7OztBQWxEQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7Ozs7OztBQTJCQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///8\n')},/*!************************!*\
!*** ./lib/js/main.js ***!

@@ -23,2 +53,2 @@ \************************/

/*! all exports used */
function(module,exports,__webpack_require__){"use strict";eval('\n\nvar idcrop = __webpack_require__(/*! ./idcrop.js */ 0);\n\nidcrop.init("toolbarContainer", "displayContainer", "previewContainer");//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9saWIvanMvbWFpbi5qcz8zNDc1Il0sInNvdXJjZXNDb250ZW50IjpbImNvbnN0IGlkY3JvcCA9IHJlcXVpcmUoXCIuL2lkY3JvcC5qc1wiKTtcblxuaWRjcm9wLmluaXQoXCJ0b29sYmFyQ29udGFpbmVyXCIsIFwiZGlzcGxheUNvbnRhaW5lclwiLCBcInByZXZpZXdDb250YWluZXJcIik7XG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIGxpYi9qcy9tYWluLmpzIl0sIm1hcHBpbmdzIjoiOztBQUFBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///3\n')}]);
function(module,exports,__webpack_require__){"use strict";eval('\n\nvar IdCrop = __webpack_require__(/*! ./idcrop/IdCrop.js */ 1);\n\nvar idcrop = new IdCrop("#displayContainer", "#previewContainer", false, 6);\n\nidcrop.init();//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9saWIvanMvbWFpbi5qcz8zNDc1Il0sInNvdXJjZXNDb250ZW50IjpbImNvbnN0IElkQ3JvcCA9IHJlcXVpcmUoXCIuL2lkY3JvcC9JZENyb3AuanNcIik7XG5cbmNvbnN0IGlkY3JvcCA9IG5ldyBJZENyb3AoXCIjZGlzcGxheUNvbnRhaW5lclwiLCBcIiNwcmV2aWV3Q29udGFpbmVyXCIsIGZhbHNlLCA2KTtcblxuaWRjcm9wLmluaXQoKTtcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBsaWIvanMvbWFpbi5qcyJdLCJtYXBwaW5ncyI6Ijs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///9\n')}]);

2

package.json
{
"name": "idcrop",
"version": "1.2.3",
"version": "1.2.4",
"description": "Image cropper utility that crops an image in any polygonal shape chosen and returns a base64 of the cropped area.",

@@ -5,0 +5,0 @@ "main": "dist/js/bundle.min.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc