├── .gitignore ├── babel.config.js ├── dist ├── VueRough.common.js └── VueRough.umd.js ├── package-lock.json ├── package.json ├── readme.md └── src ├── components ├── RoughArc.vue ├── RoughCanvas.vue ├── RoughCircle.vue ├── RoughCurve.vue ├── RoughEllipse.vue ├── RoughLine.vue ├── RoughLinearPath.vue ├── RoughPath.vue ├── RoughPolygon.vue ├── RoughRectangle.vue ├── RoughSvg.vue └── index.js ├── index.js └── mixins └── element.js /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_store 3 | node_modules 4 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /dist/VueRough.common.js: -------------------------------------------------------------------------------- 1 | module.exports = 2 | /******/ (function(modules) { // webpackBootstrap 3 | /******/ // The module cache 4 | /******/ var installedModules = {}; 5 | /******/ 6 | /******/ // The require function 7 | /******/ function __webpack_require__(moduleId) { 8 | /******/ 9 | /******/ // Check if module is in cache 10 | /******/ if(installedModules[moduleId]) { 11 | /******/ return installedModules[moduleId].exports; 12 | /******/ } 13 | /******/ // Create a new module (and put it into the cache) 14 | /******/ var module = installedModules[moduleId] = { 15 | /******/ i: moduleId, 16 | /******/ l: false, 17 | /******/ exports: {} 18 | /******/ }; 19 | /******/ 20 | /******/ // Execute the module function 21 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 22 | /******/ 23 | /******/ // Flag the module as loaded 24 | /******/ module.l = true; 25 | /******/ 26 | /******/ // Return the exports of the module 27 | /******/ return module.exports; 28 | /******/ } 29 | /******/ 30 | /******/ 31 | /******/ // expose the modules object (__webpack_modules__) 32 | /******/ __webpack_require__.m = modules; 33 | /******/ 34 | /******/ // expose the module cache 35 | /******/ __webpack_require__.c = installedModules; 36 | /******/ 37 | /******/ // define getter function for harmony exports 38 | /******/ __webpack_require__.d = function(exports, name, getter) { 39 | /******/ if(!__webpack_require__.o(exports, name)) { 40 | /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 41 | /******/ } 42 | /******/ }; 43 | /******/ 44 | /******/ // define __esModule on exports 45 | /******/ __webpack_require__.r = function(exports) { 46 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 47 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 48 | /******/ } 49 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 50 | /******/ }; 51 | /******/ 52 | /******/ // create a fake namespace object 53 | /******/ // mode & 1: value is a module id, require it 54 | /******/ // mode & 2: merge all properties of value into the ns 55 | /******/ // mode & 4: return value when already ns object 56 | /******/ // mode & 8|1: behave like require 57 | /******/ __webpack_require__.t = function(value, mode) { 58 | /******/ if(mode & 1) value = __webpack_require__(value); 59 | /******/ if(mode & 8) return value; 60 | /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 61 | /******/ var ns = Object.create(null); 62 | /******/ __webpack_require__.r(ns); 63 | /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 64 | /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 65 | /******/ return ns; 66 | /******/ }; 67 | /******/ 68 | /******/ // getDefaultExport function for compatibility with non-harmony modules 69 | /******/ __webpack_require__.n = function(module) { 70 | /******/ var getter = module && module.__esModule ? 71 | /******/ function getDefault() { return module['default']; } : 72 | /******/ function getModuleExports() { return module; }; 73 | /******/ __webpack_require__.d(getter, 'a', getter); 74 | /******/ return getter; 75 | /******/ }; 76 | /******/ 77 | /******/ // Object.prototype.hasOwnProperty.call 78 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 79 | /******/ 80 | /******/ // __webpack_public_path__ 81 | /******/ __webpack_require__.p = ""; 82 | /******/ 83 | /******/ 84 | /******/ // Load entry module and return exports 85 | /******/ return __webpack_require__(__webpack_require__.s = "fb15"); 86 | /******/ }) 87 | /************************************************************************/ 88 | /******/ ({ 89 | 90 | /***/ "00ee": 91 | /***/ (function(module, exports, __webpack_require__) { 92 | 93 | var wellKnownSymbol = __webpack_require__("b622"); 94 | 95 | var TO_STRING_TAG = wellKnownSymbol('toStringTag'); 96 | var test = {}; 97 | 98 | test[TO_STRING_TAG] = 'z'; 99 | 100 | module.exports = String(test) === '[object z]'; 101 | 102 | 103 | /***/ }), 104 | 105 | /***/ "0366": 106 | /***/ (function(module, exports, __webpack_require__) { 107 | 108 | var aFunction = __webpack_require__("1c0b"); 109 | 110 | // optional / simple context binding 111 | module.exports = function (fn, that, length) { 112 | aFunction(fn); 113 | if (that === undefined) return fn; 114 | switch (length) { 115 | case 0: return function () { 116 | return fn.call(that); 117 | }; 118 | case 1: return function (a) { 119 | return fn.call(that, a); 120 | }; 121 | case 2: return function (a, b) { 122 | return fn.call(that, a, b); 123 | }; 124 | case 3: return function (a, b, c) { 125 | return fn.call(that, a, b, c); 126 | }; 127 | } 128 | return function (/* ...args */) { 129 | return fn.apply(that, arguments); 130 | }; 131 | }; 132 | 133 | 134 | /***/ }), 135 | 136 | /***/ "057f": 137 | /***/ (function(module, exports, __webpack_require__) { 138 | 139 | var toIndexedObject = __webpack_require__("fc6a"); 140 | var nativeGetOwnPropertyNames = __webpack_require__("241c").f; 141 | 142 | var toString = {}.toString; 143 | 144 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames 145 | ? Object.getOwnPropertyNames(window) : []; 146 | 147 | var getWindowNames = function (it) { 148 | try { 149 | return nativeGetOwnPropertyNames(it); 150 | } catch (error) { 151 | return windowNames.slice(); 152 | } 153 | }; 154 | 155 | // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window 156 | module.exports.f = function getOwnPropertyNames(it) { 157 | return windowNames && toString.call(it) == '[object Window]' 158 | ? getWindowNames(it) 159 | : nativeGetOwnPropertyNames(toIndexedObject(it)); 160 | }; 161 | 162 | 163 | /***/ }), 164 | 165 | /***/ "06cf": 166 | /***/ (function(module, exports, __webpack_require__) { 167 | 168 | var DESCRIPTORS = __webpack_require__("83ab"); 169 | var propertyIsEnumerableModule = __webpack_require__("d1e7"); 170 | var createPropertyDescriptor = __webpack_require__("5c6c"); 171 | var toIndexedObject = __webpack_require__("fc6a"); 172 | var toPrimitive = __webpack_require__("c04e"); 173 | var has = __webpack_require__("5135"); 174 | var IE8_DOM_DEFINE = __webpack_require__("0cfb"); 175 | 176 | var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; 177 | 178 | // `Object.getOwnPropertyDescriptor` method 179 | // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor 180 | exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { 181 | O = toIndexedObject(O); 182 | P = toPrimitive(P, true); 183 | if (IE8_DOM_DEFINE) try { 184 | return nativeGetOwnPropertyDescriptor(O, P); 185 | } catch (error) { /* empty */ } 186 | if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); 187 | }; 188 | 189 | 190 | /***/ }), 191 | 192 | /***/ "0cfb": 193 | /***/ (function(module, exports, __webpack_require__) { 194 | 195 | var DESCRIPTORS = __webpack_require__("83ab"); 196 | var fails = __webpack_require__("d039"); 197 | var createElement = __webpack_require__("cc12"); 198 | 199 | // Thank's IE8 for his funny defineProperty 200 | module.exports = !DESCRIPTORS && !fails(function () { 201 | return Object.defineProperty(createElement('div'), 'a', { 202 | get: function () { return 7; } 203 | }).a != 7; 204 | }); 205 | 206 | 207 | /***/ }), 208 | 209 | /***/ "159b": 210 | /***/ (function(module, exports, __webpack_require__) { 211 | 212 | var global = __webpack_require__("da84"); 213 | var DOMIterables = __webpack_require__("fdbc"); 214 | var forEach = __webpack_require__("17c2"); 215 | var createNonEnumerableProperty = __webpack_require__("9112"); 216 | 217 | for (var COLLECTION_NAME in DOMIterables) { 218 | var Collection = global[COLLECTION_NAME]; 219 | var CollectionPrototype = Collection && Collection.prototype; 220 | // some Chrome versions have non-configurable methods on DOMTokenList 221 | if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try { 222 | createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach); 223 | } catch (error) { 224 | CollectionPrototype.forEach = forEach; 225 | } 226 | } 227 | 228 | 229 | /***/ }), 230 | 231 | /***/ "17c2": 232 | /***/ (function(module, exports, __webpack_require__) { 233 | 234 | "use strict"; 235 | 236 | var $forEach = __webpack_require__("b727").forEach; 237 | var arrayMethodIsStrict = __webpack_require__("a640"); 238 | var arrayMethodUsesToLength = __webpack_require__("ae40"); 239 | 240 | var STRICT_METHOD = arrayMethodIsStrict('forEach'); 241 | var USES_TO_LENGTH = arrayMethodUsesToLength('forEach'); 242 | 243 | // `Array.prototype.forEach` method implementation 244 | // https://tc39.github.io/ecma262/#sec-array.prototype.foreach 245 | module.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) { 246 | return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); 247 | } : [].forEach; 248 | 249 | 250 | /***/ }), 251 | 252 | /***/ "1be4": 253 | /***/ (function(module, exports, __webpack_require__) { 254 | 255 | var getBuiltIn = __webpack_require__("d066"); 256 | 257 | module.exports = getBuiltIn('document', 'documentElement'); 258 | 259 | 260 | /***/ }), 261 | 262 | /***/ "1c0b": 263 | /***/ (function(module, exports) { 264 | 265 | module.exports = function (it) { 266 | if (typeof it != 'function') { 267 | throw TypeError(String(it) + ' is not a function'); 268 | } return it; 269 | }; 270 | 271 | 272 | /***/ }), 273 | 274 | /***/ "1c7e": 275 | /***/ (function(module, exports, __webpack_require__) { 276 | 277 | var wellKnownSymbol = __webpack_require__("b622"); 278 | 279 | var ITERATOR = wellKnownSymbol('iterator'); 280 | var SAFE_CLOSING = false; 281 | 282 | try { 283 | var called = 0; 284 | var iteratorWithReturn = { 285 | next: function () { 286 | return { done: !!called++ }; 287 | }, 288 | 'return': function () { 289 | SAFE_CLOSING = true; 290 | } 291 | }; 292 | iteratorWithReturn[ITERATOR] = function () { 293 | return this; 294 | }; 295 | // eslint-disable-next-line no-throw-literal 296 | Array.from(iteratorWithReturn, function () { throw 2; }); 297 | } catch (error) { /* empty */ } 298 | 299 | module.exports = function (exec, SKIP_CLOSING) { 300 | if (!SKIP_CLOSING && !SAFE_CLOSING) return false; 301 | var ITERATION_SUPPORT = false; 302 | try { 303 | var object = {}; 304 | object[ITERATOR] = function () { 305 | return { 306 | next: function () { 307 | return { done: ITERATION_SUPPORT = true }; 308 | } 309 | }; 310 | }; 311 | exec(object); 312 | } catch (error) { /* empty */ } 313 | return ITERATION_SUPPORT; 314 | }; 315 | 316 | 317 | /***/ }), 318 | 319 | /***/ "1d80": 320 | /***/ (function(module, exports) { 321 | 322 | // `RequireObjectCoercible` abstract operation 323 | // https://tc39.github.io/ecma262/#sec-requireobjectcoercible 324 | module.exports = function (it) { 325 | if (it == undefined) throw TypeError("Can't call method on " + it); 326 | return it; 327 | }; 328 | 329 | 330 | /***/ }), 331 | 332 | /***/ "1dde": 333 | /***/ (function(module, exports, __webpack_require__) { 334 | 335 | var fails = __webpack_require__("d039"); 336 | var wellKnownSymbol = __webpack_require__("b622"); 337 | var V8_VERSION = __webpack_require__("2d00"); 338 | 339 | var SPECIES = wellKnownSymbol('species'); 340 | 341 | module.exports = function (METHOD_NAME) { 342 | // We can't use this feature detection in V8 since it causes 343 | // deoptimization and serious performance degradation 344 | // https://github.com/zloirock/core-js/issues/677 345 | return V8_VERSION >= 51 || !fails(function () { 346 | var array = []; 347 | var constructor = array.constructor = {}; 348 | constructor[SPECIES] = function () { 349 | return { foo: 1 }; 350 | }; 351 | return array[METHOD_NAME](Boolean).foo !== 1; 352 | }); 353 | }; 354 | 355 | 356 | /***/ }), 357 | 358 | /***/ "23cb": 359 | /***/ (function(module, exports, __webpack_require__) { 360 | 361 | var toInteger = __webpack_require__("a691"); 362 | 363 | var max = Math.max; 364 | var min = Math.min; 365 | 366 | // Helper for a popular repeating case of the spec: 367 | // Let integer be ? ToInteger(index). 368 | // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). 369 | module.exports = function (index, length) { 370 | var integer = toInteger(index); 371 | return integer < 0 ? max(integer + length, 0) : min(integer, length); 372 | }; 373 | 374 | 375 | /***/ }), 376 | 377 | /***/ "23e7": 378 | /***/ (function(module, exports, __webpack_require__) { 379 | 380 | var global = __webpack_require__("da84"); 381 | var getOwnPropertyDescriptor = __webpack_require__("06cf").f; 382 | var createNonEnumerableProperty = __webpack_require__("9112"); 383 | var redefine = __webpack_require__("6eeb"); 384 | var setGlobal = __webpack_require__("ce4e"); 385 | var copyConstructorProperties = __webpack_require__("e893"); 386 | var isForced = __webpack_require__("94ca"); 387 | 388 | /* 389 | options.target - name of the target object 390 | options.global - target is the global object 391 | options.stat - export as static methods of target 392 | options.proto - export as prototype methods of target 393 | options.real - real prototype method for the `pure` version 394 | options.forced - export even if the native feature is available 395 | options.bind - bind methods to the target, required for the `pure` version 396 | options.wrap - wrap constructors to preventing global pollution, required for the `pure` version 397 | options.unsafe - use the simple assignment of property instead of delete + defineProperty 398 | options.sham - add a flag to not completely full polyfills 399 | options.enumerable - export as enumerable property 400 | options.noTargetGet - prevent calling a getter on target 401 | */ 402 | module.exports = function (options, source) { 403 | var TARGET = options.target; 404 | var GLOBAL = options.global; 405 | var STATIC = options.stat; 406 | var FORCED, target, key, targetProperty, sourceProperty, descriptor; 407 | if (GLOBAL) { 408 | target = global; 409 | } else if (STATIC) { 410 | target = global[TARGET] || setGlobal(TARGET, {}); 411 | } else { 412 | target = (global[TARGET] || {}).prototype; 413 | } 414 | if (target) for (key in source) { 415 | sourceProperty = source[key]; 416 | if (options.noTargetGet) { 417 | descriptor = getOwnPropertyDescriptor(target, key); 418 | targetProperty = descriptor && descriptor.value; 419 | } else targetProperty = target[key]; 420 | FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); 421 | // contained in target 422 | if (!FORCED && targetProperty !== undefined) { 423 | if (typeof sourceProperty === typeof targetProperty) continue; 424 | copyConstructorProperties(sourceProperty, targetProperty); 425 | } 426 | // add a flag to not completely full polyfills 427 | if (options.sham || (targetProperty && targetProperty.sham)) { 428 | createNonEnumerableProperty(sourceProperty, 'sham', true); 429 | } 430 | // extend global 431 | redefine(target, key, sourceProperty, options); 432 | } 433 | }; 434 | 435 | 436 | /***/ }), 437 | 438 | /***/ "241c": 439 | /***/ (function(module, exports, __webpack_require__) { 440 | 441 | var internalObjectKeys = __webpack_require__("ca84"); 442 | var enumBugKeys = __webpack_require__("7839"); 443 | 444 | var hiddenKeys = enumBugKeys.concat('length', 'prototype'); 445 | 446 | // `Object.getOwnPropertyNames` method 447 | // https://tc39.github.io/ecma262/#sec-object.getownpropertynames 448 | exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { 449 | return internalObjectKeys(O, hiddenKeys); 450 | }; 451 | 452 | 453 | /***/ }), 454 | 455 | /***/ "25f0": 456 | /***/ (function(module, exports, __webpack_require__) { 457 | 458 | "use strict"; 459 | 460 | var redefine = __webpack_require__("6eeb"); 461 | var anObject = __webpack_require__("825a"); 462 | var fails = __webpack_require__("d039"); 463 | var flags = __webpack_require__("ad6d"); 464 | 465 | var TO_STRING = 'toString'; 466 | var RegExpPrototype = RegExp.prototype; 467 | var nativeToString = RegExpPrototype[TO_STRING]; 468 | 469 | var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); 470 | // FF44- RegExp#toString has a wrong name 471 | var INCORRECT_NAME = nativeToString.name != TO_STRING; 472 | 473 | // `RegExp.prototype.toString` method 474 | // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring 475 | if (NOT_GENERIC || INCORRECT_NAME) { 476 | redefine(RegExp.prototype, TO_STRING, function toString() { 477 | var R = anObject(this); 478 | var p = String(R.source); 479 | var rf = R.flags; 480 | var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf); 481 | return '/' + p + '/' + f; 482 | }, { unsafe: true }); 483 | } 484 | 485 | 486 | /***/ }), 487 | 488 | /***/ "2d00": 489 | /***/ (function(module, exports, __webpack_require__) { 490 | 491 | var global = __webpack_require__("da84"); 492 | var userAgent = __webpack_require__("342f"); 493 | 494 | var process = global.process; 495 | var versions = process && process.versions; 496 | var v8 = versions && versions.v8; 497 | var match, version; 498 | 499 | if (v8) { 500 | match = v8.split('.'); 501 | version = match[0] + match[1]; 502 | } else if (userAgent) { 503 | match = userAgent.match(/Edge\/(\d+)/); 504 | if (!match || match[1] >= 74) { 505 | match = userAgent.match(/Chrome\/(\d+)/); 506 | if (match) version = match[1]; 507 | } 508 | } 509 | 510 | module.exports = version && +version; 511 | 512 | 513 | /***/ }), 514 | 515 | /***/ "342f": 516 | /***/ (function(module, exports, __webpack_require__) { 517 | 518 | var getBuiltIn = __webpack_require__("d066"); 519 | 520 | module.exports = getBuiltIn('navigator', 'userAgent') || ''; 521 | 522 | 523 | /***/ }), 524 | 525 | /***/ "35a1": 526 | /***/ (function(module, exports, __webpack_require__) { 527 | 528 | var classof = __webpack_require__("f5df"); 529 | var Iterators = __webpack_require__("3f8c"); 530 | var wellKnownSymbol = __webpack_require__("b622"); 531 | 532 | var ITERATOR = wellKnownSymbol('iterator'); 533 | 534 | module.exports = function (it) { 535 | if (it != undefined) return it[ITERATOR] 536 | || it['@@iterator'] 537 | || Iterators[classof(it)]; 538 | }; 539 | 540 | 541 | /***/ }), 542 | 543 | /***/ "37e8": 544 | /***/ (function(module, exports, __webpack_require__) { 545 | 546 | var DESCRIPTORS = __webpack_require__("83ab"); 547 | var definePropertyModule = __webpack_require__("9bf2"); 548 | var anObject = __webpack_require__("825a"); 549 | var objectKeys = __webpack_require__("df75"); 550 | 551 | // `Object.defineProperties` method 552 | // https://tc39.github.io/ecma262/#sec-object.defineproperties 553 | module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { 554 | anObject(O); 555 | var keys = objectKeys(Properties); 556 | var length = keys.length; 557 | var index = 0; 558 | var key; 559 | while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]); 560 | return O; 561 | }; 562 | 563 | 564 | /***/ }), 565 | 566 | /***/ "3bbe": 567 | /***/ (function(module, exports, __webpack_require__) { 568 | 569 | var isObject = __webpack_require__("861d"); 570 | 571 | module.exports = function (it) { 572 | if (!isObject(it) && it !== null) { 573 | throw TypeError("Can't set " + String(it) + ' as a prototype'); 574 | } return it; 575 | }; 576 | 577 | 578 | /***/ }), 579 | 580 | /***/ "3ca3": 581 | /***/ (function(module, exports, __webpack_require__) { 582 | 583 | "use strict"; 584 | 585 | var charAt = __webpack_require__("6547").charAt; 586 | var InternalStateModule = __webpack_require__("69f3"); 587 | var defineIterator = __webpack_require__("7dd0"); 588 | 589 | var STRING_ITERATOR = 'String Iterator'; 590 | var setInternalState = InternalStateModule.set; 591 | var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); 592 | 593 | // `String.prototype[@@iterator]` method 594 | // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator 595 | defineIterator(String, 'String', function (iterated) { 596 | setInternalState(this, { 597 | type: STRING_ITERATOR, 598 | string: String(iterated), 599 | index: 0 600 | }); 601 | // `%StringIteratorPrototype%.next` method 602 | // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next 603 | }, function next() { 604 | var state = getInternalState(this); 605 | var string = state.string; 606 | var index = state.index; 607 | var point; 608 | if (index >= string.length) return { value: undefined, done: true }; 609 | point = charAt(string, index); 610 | state.index += point.length; 611 | return { value: point, done: false }; 612 | }); 613 | 614 | 615 | /***/ }), 616 | 617 | /***/ "3f8c": 618 | /***/ (function(module, exports) { 619 | 620 | module.exports = {}; 621 | 622 | 623 | /***/ }), 624 | 625 | /***/ "4160": 626 | /***/ (function(module, exports, __webpack_require__) { 627 | 628 | "use strict"; 629 | 630 | var $ = __webpack_require__("23e7"); 631 | var forEach = __webpack_require__("17c2"); 632 | 633 | // `Array.prototype.forEach` method 634 | // https://tc39.github.io/ecma262/#sec-array.prototype.foreach 635 | $({ target: 'Array', proto: true, forced: [].forEach != forEach }, { 636 | forEach: forEach 637 | }); 638 | 639 | 640 | /***/ }), 641 | 642 | /***/ "428f": 643 | /***/ (function(module, exports, __webpack_require__) { 644 | 645 | var global = __webpack_require__("da84"); 646 | 647 | module.exports = global; 648 | 649 | 650 | /***/ }), 651 | 652 | /***/ "44ad": 653 | /***/ (function(module, exports, __webpack_require__) { 654 | 655 | var fails = __webpack_require__("d039"); 656 | var classof = __webpack_require__("c6b6"); 657 | 658 | var split = ''.split; 659 | 660 | // fallback for non-array-like ES3 and non-enumerable old V8 strings 661 | module.exports = fails(function () { 662 | // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 663 | // eslint-disable-next-line no-prototype-builtins 664 | return !Object('z').propertyIsEnumerable(0); 665 | }) ? function (it) { 666 | return classof(it) == 'String' ? split.call(it, '') : Object(it); 667 | } : Object; 668 | 669 | 670 | /***/ }), 671 | 672 | /***/ "44d2": 673 | /***/ (function(module, exports, __webpack_require__) { 674 | 675 | var wellKnownSymbol = __webpack_require__("b622"); 676 | var create = __webpack_require__("7c73"); 677 | var definePropertyModule = __webpack_require__("9bf2"); 678 | 679 | var UNSCOPABLES = wellKnownSymbol('unscopables'); 680 | var ArrayPrototype = Array.prototype; 681 | 682 | // Array.prototype[@@unscopables] 683 | // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables 684 | if (ArrayPrototype[UNSCOPABLES] == undefined) { 685 | definePropertyModule.f(ArrayPrototype, UNSCOPABLES, { 686 | configurable: true, 687 | value: create(null) 688 | }); 689 | } 690 | 691 | // add a key to Array.prototype[@@unscopables] 692 | module.exports = function (key) { 693 | ArrayPrototype[UNSCOPABLES][key] = true; 694 | }; 695 | 696 | 697 | /***/ }), 698 | 699 | /***/ "4930": 700 | /***/ (function(module, exports, __webpack_require__) { 701 | 702 | var fails = __webpack_require__("d039"); 703 | 704 | module.exports = !!Object.getOwnPropertySymbols && !fails(function () { 705 | // Chrome 38 Symbol has incorrect toString conversion 706 | // eslint-disable-next-line no-undef 707 | return !String(Symbol()); 708 | }); 709 | 710 | 711 | /***/ }), 712 | 713 | /***/ "4d64": 714 | /***/ (function(module, exports, __webpack_require__) { 715 | 716 | var toIndexedObject = __webpack_require__("fc6a"); 717 | var toLength = __webpack_require__("50c4"); 718 | var toAbsoluteIndex = __webpack_require__("23cb"); 719 | 720 | // `Array.prototype.{ indexOf, includes }` methods implementation 721 | var createMethod = function (IS_INCLUDES) { 722 | return function ($this, el, fromIndex) { 723 | var O = toIndexedObject($this); 724 | var length = toLength(O.length); 725 | var index = toAbsoluteIndex(fromIndex, length); 726 | var value; 727 | // Array#includes uses SameValueZero equality algorithm 728 | // eslint-disable-next-line no-self-compare 729 | if (IS_INCLUDES && el != el) while (length > index) { 730 | value = O[index++]; 731 | // eslint-disable-next-line no-self-compare 732 | if (value != value) return true; 733 | // Array#indexOf ignores holes, Array#includes - not 734 | } else for (;length > index; index++) { 735 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; 736 | } return !IS_INCLUDES && -1; 737 | }; 738 | }; 739 | 740 | module.exports = { 741 | // `Array.prototype.includes` method 742 | // https://tc39.github.io/ecma262/#sec-array.prototype.includes 743 | includes: createMethod(true), 744 | // `Array.prototype.indexOf` method 745 | // https://tc39.github.io/ecma262/#sec-array.prototype.indexof 746 | indexOf: createMethod(false) 747 | }; 748 | 749 | 750 | /***/ }), 751 | 752 | /***/ "4df4": 753 | /***/ (function(module, exports, __webpack_require__) { 754 | 755 | "use strict"; 756 | 757 | var bind = __webpack_require__("0366"); 758 | var toObject = __webpack_require__("7b0b"); 759 | var callWithSafeIterationClosing = __webpack_require__("9bdd"); 760 | var isArrayIteratorMethod = __webpack_require__("e95a"); 761 | var toLength = __webpack_require__("50c4"); 762 | var createProperty = __webpack_require__("8418"); 763 | var getIteratorMethod = __webpack_require__("35a1"); 764 | 765 | // `Array.from` method implementation 766 | // https://tc39.github.io/ecma262/#sec-array.from 767 | module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { 768 | var O = toObject(arrayLike); 769 | var C = typeof this == 'function' ? this : Array; 770 | var argumentsLength = arguments.length; 771 | var mapfn = argumentsLength > 1 ? arguments[1] : undefined; 772 | var mapping = mapfn !== undefined; 773 | var iteratorMethod = getIteratorMethod(O); 774 | var index = 0; 775 | var length, result, step, iterator, next, value; 776 | if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); 777 | // if the target is not iterable or it's an array with the default iterator - use a simple case 778 | if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { 779 | iterator = iteratorMethod.call(O); 780 | next = iterator.next; 781 | result = new C(); 782 | for (;!(step = next.call(iterator)).done; index++) { 783 | value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value; 784 | createProperty(result, index, value); 785 | } 786 | } else { 787 | length = toLength(O.length); 788 | result = new C(length); 789 | for (;length > index; index++) { 790 | value = mapping ? mapfn(O[index], index) : O[index]; 791 | createProperty(result, index, value); 792 | } 793 | } 794 | result.length = index; 795 | return result; 796 | }; 797 | 798 | 799 | /***/ }), 800 | 801 | /***/ "4fad": 802 | /***/ (function(module, exports, __webpack_require__) { 803 | 804 | var $ = __webpack_require__("23e7"); 805 | var $entries = __webpack_require__("6f53").entries; 806 | 807 | // `Object.entries` method 808 | // https://tc39.github.io/ecma262/#sec-object.entries 809 | $({ target: 'Object', stat: true }, { 810 | entries: function entries(O) { 811 | return $entries(O); 812 | } 813 | }); 814 | 815 | 816 | /***/ }), 817 | 818 | /***/ "50c4": 819 | /***/ (function(module, exports, __webpack_require__) { 820 | 821 | var toInteger = __webpack_require__("a691"); 822 | 823 | var min = Math.min; 824 | 825 | // `ToLength` abstract operation 826 | // https://tc39.github.io/ecma262/#sec-tolength 827 | module.exports = function (argument) { 828 | return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 829 | }; 830 | 831 | 832 | /***/ }), 833 | 834 | /***/ "5135": 835 | /***/ (function(module, exports) { 836 | 837 | var hasOwnProperty = {}.hasOwnProperty; 838 | 839 | module.exports = function (it, key) { 840 | return hasOwnProperty.call(it, key); 841 | }; 842 | 843 | 844 | /***/ }), 845 | 846 | /***/ "5692": 847 | /***/ (function(module, exports, __webpack_require__) { 848 | 849 | var IS_PURE = __webpack_require__("c430"); 850 | var store = __webpack_require__("c6cd"); 851 | 852 | (module.exports = function (key, value) { 853 | return store[key] || (store[key] = value !== undefined ? value : {}); 854 | })('versions', []).push({ 855 | version: '3.6.5', 856 | mode: IS_PURE ? 'pure' : 'global', 857 | copyright: '© 2020 Denis Pushkarev (zloirock.ru)' 858 | }); 859 | 860 | 861 | /***/ }), 862 | 863 | /***/ "56ef": 864 | /***/ (function(module, exports, __webpack_require__) { 865 | 866 | var getBuiltIn = __webpack_require__("d066"); 867 | var getOwnPropertyNamesModule = __webpack_require__("241c"); 868 | var getOwnPropertySymbolsModule = __webpack_require__("7418"); 869 | var anObject = __webpack_require__("825a"); 870 | 871 | // all object keys, includes non-enumerable and symbols 872 | module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { 873 | var keys = getOwnPropertyNamesModule.f(anObject(it)); 874 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; 875 | return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; 876 | }; 877 | 878 | 879 | /***/ }), 880 | 881 | /***/ "5899": 882 | /***/ (function(module, exports) { 883 | 884 | // a string of all valid unicode whitespaces 885 | // eslint-disable-next-line max-len 886 | module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; 887 | 888 | 889 | /***/ }), 890 | 891 | /***/ "58a8": 892 | /***/ (function(module, exports, __webpack_require__) { 893 | 894 | var requireObjectCoercible = __webpack_require__("1d80"); 895 | var whitespaces = __webpack_require__("5899"); 896 | 897 | var whitespace = '[' + whitespaces + ']'; 898 | var ltrim = RegExp('^' + whitespace + whitespace + '*'); 899 | var rtrim = RegExp(whitespace + whitespace + '*$'); 900 | 901 | // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation 902 | var createMethod = function (TYPE) { 903 | return function ($this) { 904 | var string = String(requireObjectCoercible($this)); 905 | if (TYPE & 1) string = string.replace(ltrim, ''); 906 | if (TYPE & 2) string = string.replace(rtrim, ''); 907 | return string; 908 | }; 909 | }; 910 | 911 | module.exports = { 912 | // `String.prototype.{ trimLeft, trimStart }` methods 913 | // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart 914 | start: createMethod(1), 915 | // `String.prototype.{ trimRight, trimEnd }` methods 916 | // https://tc39.github.io/ecma262/#sec-string.prototype.trimend 917 | end: createMethod(2), 918 | // `String.prototype.trim` method 919 | // https://tc39.github.io/ecma262/#sec-string.prototype.trim 920 | trim: createMethod(3) 921 | }; 922 | 923 | 924 | /***/ }), 925 | 926 | /***/ "5c6c": 927 | /***/ (function(module, exports) { 928 | 929 | module.exports = function (bitmap, value) { 930 | return { 931 | enumerable: !(bitmap & 1), 932 | configurable: !(bitmap & 2), 933 | writable: !(bitmap & 4), 934 | value: value 935 | }; 936 | }; 937 | 938 | 939 | /***/ }), 940 | 941 | /***/ "60da": 942 | /***/ (function(module, exports, __webpack_require__) { 943 | 944 | "use strict"; 945 | 946 | var DESCRIPTORS = __webpack_require__("83ab"); 947 | var fails = __webpack_require__("d039"); 948 | var objectKeys = __webpack_require__("df75"); 949 | var getOwnPropertySymbolsModule = __webpack_require__("7418"); 950 | var propertyIsEnumerableModule = __webpack_require__("d1e7"); 951 | var toObject = __webpack_require__("7b0b"); 952 | var IndexedObject = __webpack_require__("44ad"); 953 | 954 | var nativeAssign = Object.assign; 955 | var defineProperty = Object.defineProperty; 956 | 957 | // `Object.assign` method 958 | // https://tc39.github.io/ecma262/#sec-object.assign 959 | module.exports = !nativeAssign || fails(function () { 960 | // should have correct order of operations (Edge bug) 961 | if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', { 962 | enumerable: true, 963 | get: function () { 964 | defineProperty(this, 'b', { 965 | value: 3, 966 | enumerable: false 967 | }); 968 | } 969 | }), { b: 2 })).b !== 1) return true; 970 | // should work with symbols and should have deterministic property order (V8 bug) 971 | var A = {}; 972 | var B = {}; 973 | // eslint-disable-next-line no-undef 974 | var symbol = Symbol(); 975 | var alphabet = 'abcdefghijklmnopqrst'; 976 | A[symbol] = 7; 977 | alphabet.split('').forEach(function (chr) { B[chr] = chr; }); 978 | return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet; 979 | }) ? function assign(target, source) { // eslint-disable-line no-unused-vars 980 | var T = toObject(target); 981 | var argumentsLength = arguments.length; 982 | var index = 1; 983 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; 984 | var propertyIsEnumerable = propertyIsEnumerableModule.f; 985 | while (argumentsLength > index) { 986 | var S = IndexedObject(arguments[index++]); 987 | var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S); 988 | var length = keys.length; 989 | var j = 0; 990 | var key; 991 | while (length > j) { 992 | key = keys[j++]; 993 | if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key]; 994 | } 995 | } return T; 996 | } : nativeAssign; 997 | 998 | 999 | /***/ }), 1000 | 1001 | /***/ "6547": 1002 | /***/ (function(module, exports, __webpack_require__) { 1003 | 1004 | var toInteger = __webpack_require__("a691"); 1005 | var requireObjectCoercible = __webpack_require__("1d80"); 1006 | 1007 | // `String.prototype.{ codePointAt, at }` methods implementation 1008 | var createMethod = function (CONVERT_TO_STRING) { 1009 | return function ($this, pos) { 1010 | var S = String(requireObjectCoercible($this)); 1011 | var position = toInteger(pos); 1012 | var size = S.length; 1013 | var first, second; 1014 | if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; 1015 | first = S.charCodeAt(position); 1016 | return first < 0xD800 || first > 0xDBFF || position + 1 === size 1017 | || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF 1018 | ? CONVERT_TO_STRING ? S.charAt(position) : first 1019 | : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; 1020 | }; 1021 | }; 1022 | 1023 | module.exports = { 1024 | // `String.prototype.codePointAt` method 1025 | // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat 1026 | codeAt: createMethod(false), 1027 | // `String.prototype.at` method 1028 | // https://github.com/mathiasbynens/String.prototype.at 1029 | charAt: createMethod(true) 1030 | }; 1031 | 1032 | 1033 | /***/ }), 1034 | 1035 | /***/ "65f0": 1036 | /***/ (function(module, exports, __webpack_require__) { 1037 | 1038 | var isObject = __webpack_require__("861d"); 1039 | var isArray = __webpack_require__("e8b5"); 1040 | var wellKnownSymbol = __webpack_require__("b622"); 1041 | 1042 | var SPECIES = wellKnownSymbol('species'); 1043 | 1044 | // `ArraySpeciesCreate` abstract operation 1045 | // https://tc39.github.io/ecma262/#sec-arrayspeciescreate 1046 | module.exports = function (originalArray, length) { 1047 | var C; 1048 | if (isArray(originalArray)) { 1049 | C = originalArray.constructor; 1050 | // cross-realm fallback 1051 | if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; 1052 | else if (isObject(C)) { 1053 | C = C[SPECIES]; 1054 | if (C === null) C = undefined; 1055 | } 1056 | } return new (C === undefined ? Array : C)(length === 0 ? 0 : length); 1057 | }; 1058 | 1059 | 1060 | /***/ }), 1061 | 1062 | /***/ "69f3": 1063 | /***/ (function(module, exports, __webpack_require__) { 1064 | 1065 | var NATIVE_WEAK_MAP = __webpack_require__("7f9a"); 1066 | var global = __webpack_require__("da84"); 1067 | var isObject = __webpack_require__("861d"); 1068 | var createNonEnumerableProperty = __webpack_require__("9112"); 1069 | var objectHas = __webpack_require__("5135"); 1070 | var sharedKey = __webpack_require__("f772"); 1071 | var hiddenKeys = __webpack_require__("d012"); 1072 | 1073 | var WeakMap = global.WeakMap; 1074 | var set, get, has; 1075 | 1076 | var enforce = function (it) { 1077 | return has(it) ? get(it) : set(it, {}); 1078 | }; 1079 | 1080 | var getterFor = function (TYPE) { 1081 | return function (it) { 1082 | var state; 1083 | if (!isObject(it) || (state = get(it)).type !== TYPE) { 1084 | throw TypeError('Incompatible receiver, ' + TYPE + ' required'); 1085 | } return state; 1086 | }; 1087 | }; 1088 | 1089 | if (NATIVE_WEAK_MAP) { 1090 | var store = new WeakMap(); 1091 | var wmget = store.get; 1092 | var wmhas = store.has; 1093 | var wmset = store.set; 1094 | set = function (it, metadata) { 1095 | wmset.call(store, it, metadata); 1096 | return metadata; 1097 | }; 1098 | get = function (it) { 1099 | return wmget.call(store, it) || {}; 1100 | }; 1101 | has = function (it) { 1102 | return wmhas.call(store, it); 1103 | }; 1104 | } else { 1105 | var STATE = sharedKey('state'); 1106 | hiddenKeys[STATE] = true; 1107 | set = function (it, metadata) { 1108 | createNonEnumerableProperty(it, STATE, metadata); 1109 | return metadata; 1110 | }; 1111 | get = function (it) { 1112 | return objectHas(it, STATE) ? it[STATE] : {}; 1113 | }; 1114 | has = function (it) { 1115 | return objectHas(it, STATE); 1116 | }; 1117 | } 1118 | 1119 | module.exports = { 1120 | set: set, 1121 | get: get, 1122 | has: has, 1123 | enforce: enforce, 1124 | getterFor: getterFor 1125 | }; 1126 | 1127 | 1128 | /***/ }), 1129 | 1130 | /***/ "6eeb": 1131 | /***/ (function(module, exports, __webpack_require__) { 1132 | 1133 | var global = __webpack_require__("da84"); 1134 | var createNonEnumerableProperty = __webpack_require__("9112"); 1135 | var has = __webpack_require__("5135"); 1136 | var setGlobal = __webpack_require__("ce4e"); 1137 | var inspectSource = __webpack_require__("8925"); 1138 | var InternalStateModule = __webpack_require__("69f3"); 1139 | 1140 | var getInternalState = InternalStateModule.get; 1141 | var enforceInternalState = InternalStateModule.enforce; 1142 | var TEMPLATE = String(String).split('String'); 1143 | 1144 | (module.exports = function (O, key, value, options) { 1145 | var unsafe = options ? !!options.unsafe : false; 1146 | var simple = options ? !!options.enumerable : false; 1147 | var noTargetGet = options ? !!options.noTargetGet : false; 1148 | if (typeof value == 'function') { 1149 | if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key); 1150 | enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : ''); 1151 | } 1152 | if (O === global) { 1153 | if (simple) O[key] = value; 1154 | else setGlobal(key, value); 1155 | return; 1156 | } else if (!unsafe) { 1157 | delete O[key]; 1158 | } else if (!noTargetGet && O[key]) { 1159 | simple = true; 1160 | } 1161 | if (simple) O[key] = value; 1162 | else createNonEnumerableProperty(O, key, value); 1163 | // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative 1164 | })(Function.prototype, 'toString', function toString() { 1165 | return typeof this == 'function' && getInternalState(this).source || inspectSource(this); 1166 | }); 1167 | 1168 | 1169 | /***/ }), 1170 | 1171 | /***/ "6f53": 1172 | /***/ (function(module, exports, __webpack_require__) { 1173 | 1174 | var DESCRIPTORS = __webpack_require__("83ab"); 1175 | var objectKeys = __webpack_require__("df75"); 1176 | var toIndexedObject = __webpack_require__("fc6a"); 1177 | var propertyIsEnumerable = __webpack_require__("d1e7").f; 1178 | 1179 | // `Object.{ entries, values }` methods implementation 1180 | var createMethod = function (TO_ENTRIES) { 1181 | return function (it) { 1182 | var O = toIndexedObject(it); 1183 | var keys = objectKeys(O); 1184 | var length = keys.length; 1185 | var i = 0; 1186 | var result = []; 1187 | var key; 1188 | while (length > i) { 1189 | key = keys[i++]; 1190 | if (!DESCRIPTORS || propertyIsEnumerable.call(O, key)) { 1191 | result.push(TO_ENTRIES ? [key, O[key]] : O[key]); 1192 | } 1193 | } 1194 | return result; 1195 | }; 1196 | }; 1197 | 1198 | module.exports = { 1199 | // `Object.entries` method 1200 | // https://tc39.github.io/ecma262/#sec-object.entries 1201 | entries: createMethod(true), 1202 | // `Object.values` method 1203 | // https://tc39.github.io/ecma262/#sec-object.values 1204 | values: createMethod(false) 1205 | }; 1206 | 1207 | 1208 | /***/ }), 1209 | 1210 | /***/ "7156": 1211 | /***/ (function(module, exports, __webpack_require__) { 1212 | 1213 | var isObject = __webpack_require__("861d"); 1214 | var setPrototypeOf = __webpack_require__("d2bb"); 1215 | 1216 | // makes subclassing work correct for wrapped built-ins 1217 | module.exports = function ($this, dummy, Wrapper) { 1218 | var NewTarget, NewTargetPrototype; 1219 | if ( 1220 | // it can work only with native `setPrototypeOf` 1221 | setPrototypeOf && 1222 | // we haven't completely correct pre-ES6 way for getting `new.target`, so use this 1223 | typeof (NewTarget = dummy.constructor) == 'function' && 1224 | NewTarget !== Wrapper && 1225 | isObject(NewTargetPrototype = NewTarget.prototype) && 1226 | NewTargetPrototype !== Wrapper.prototype 1227 | ) setPrototypeOf($this, NewTargetPrototype); 1228 | return $this; 1229 | }; 1230 | 1231 | 1232 | /***/ }), 1233 | 1234 | /***/ "7418": 1235 | /***/ (function(module, exports) { 1236 | 1237 | exports.f = Object.getOwnPropertySymbols; 1238 | 1239 | 1240 | /***/ }), 1241 | 1242 | /***/ "746f": 1243 | /***/ (function(module, exports, __webpack_require__) { 1244 | 1245 | var path = __webpack_require__("428f"); 1246 | var has = __webpack_require__("5135"); 1247 | var wrappedWellKnownSymbolModule = __webpack_require__("e538"); 1248 | var defineProperty = __webpack_require__("9bf2").f; 1249 | 1250 | module.exports = function (NAME) { 1251 | var Symbol = path.Symbol || (path.Symbol = {}); 1252 | if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, { 1253 | value: wrappedWellKnownSymbolModule.f(NAME) 1254 | }); 1255 | }; 1256 | 1257 | 1258 | /***/ }), 1259 | 1260 | /***/ "7839": 1261 | /***/ (function(module, exports) { 1262 | 1263 | // IE8- don't enum bug keys 1264 | module.exports = [ 1265 | 'constructor', 1266 | 'hasOwnProperty', 1267 | 'isPrototypeOf', 1268 | 'propertyIsEnumerable', 1269 | 'toLocaleString', 1270 | 'toString', 1271 | 'valueOf' 1272 | ]; 1273 | 1274 | 1275 | /***/ }), 1276 | 1277 | /***/ "7b0b": 1278 | /***/ (function(module, exports, __webpack_require__) { 1279 | 1280 | var requireObjectCoercible = __webpack_require__("1d80"); 1281 | 1282 | // `ToObject` abstract operation 1283 | // https://tc39.github.io/ecma262/#sec-toobject 1284 | module.exports = function (argument) { 1285 | return Object(requireObjectCoercible(argument)); 1286 | }; 1287 | 1288 | 1289 | /***/ }), 1290 | 1291 | /***/ "7c73": 1292 | /***/ (function(module, exports, __webpack_require__) { 1293 | 1294 | var anObject = __webpack_require__("825a"); 1295 | var defineProperties = __webpack_require__("37e8"); 1296 | var enumBugKeys = __webpack_require__("7839"); 1297 | var hiddenKeys = __webpack_require__("d012"); 1298 | var html = __webpack_require__("1be4"); 1299 | var documentCreateElement = __webpack_require__("cc12"); 1300 | var sharedKey = __webpack_require__("f772"); 1301 | 1302 | var GT = '>'; 1303 | var LT = '<'; 1304 | var PROTOTYPE = 'prototype'; 1305 | var SCRIPT = 'script'; 1306 | var IE_PROTO = sharedKey('IE_PROTO'); 1307 | 1308 | var EmptyConstructor = function () { /* empty */ }; 1309 | 1310 | var scriptTag = function (content) { 1311 | return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; 1312 | }; 1313 | 1314 | // Create object with fake `null` prototype: use ActiveX Object with cleared prototype 1315 | var NullProtoObjectViaActiveX = function (activeXDocument) { 1316 | activeXDocument.write(scriptTag('')); 1317 | activeXDocument.close(); 1318 | var temp = activeXDocument.parentWindow.Object; 1319 | activeXDocument = null; // avoid memory leak 1320 | return temp; 1321 | }; 1322 | 1323 | // Create object with fake `null` prototype: use iframe Object with cleared prototype 1324 | var NullProtoObjectViaIFrame = function () { 1325 | // Thrash, waste and sodomy: IE GC bug 1326 | var iframe = documentCreateElement('iframe'); 1327 | var JS = 'java' + SCRIPT + ':'; 1328 | var iframeDocument; 1329 | iframe.style.display = 'none'; 1330 | html.appendChild(iframe); 1331 | // https://github.com/zloirock/core-js/issues/475 1332 | iframe.src = String(JS); 1333 | iframeDocument = iframe.contentWindow.document; 1334 | iframeDocument.open(); 1335 | iframeDocument.write(scriptTag('document.F=Object')); 1336 | iframeDocument.close(); 1337 | return iframeDocument.F; 1338 | }; 1339 | 1340 | // Check for document.domain and active x support 1341 | // No need to use active x approach when document.domain is not set 1342 | // see https://github.com/es-shims/es5-shim/issues/150 1343 | // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 1344 | // avoid IE GC bug 1345 | var activeXDocument; 1346 | var NullProtoObject = function () { 1347 | try { 1348 | /* global ActiveXObject */ 1349 | activeXDocument = document.domain && new ActiveXObject('htmlfile'); 1350 | } catch (error) { /* ignore */ } 1351 | NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame(); 1352 | var length = enumBugKeys.length; 1353 | while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; 1354 | return NullProtoObject(); 1355 | }; 1356 | 1357 | hiddenKeys[IE_PROTO] = true; 1358 | 1359 | // `Object.create` method 1360 | // https://tc39.github.io/ecma262/#sec-object.create 1361 | module.exports = Object.create || function create(O, Properties) { 1362 | var result; 1363 | if (O !== null) { 1364 | EmptyConstructor[PROTOTYPE] = anObject(O); 1365 | result = new EmptyConstructor(); 1366 | EmptyConstructor[PROTOTYPE] = null; 1367 | // add "__proto__" for Object.getPrototypeOf polyfill 1368 | result[IE_PROTO] = O; 1369 | } else result = NullProtoObject(); 1370 | return Properties === undefined ? result : defineProperties(result, Properties); 1371 | }; 1372 | 1373 | 1374 | /***/ }), 1375 | 1376 | /***/ "7dd0": 1377 | /***/ (function(module, exports, __webpack_require__) { 1378 | 1379 | "use strict"; 1380 | 1381 | var $ = __webpack_require__("23e7"); 1382 | var createIteratorConstructor = __webpack_require__("9ed3"); 1383 | var getPrototypeOf = __webpack_require__("e163"); 1384 | var setPrototypeOf = __webpack_require__("d2bb"); 1385 | var setToStringTag = __webpack_require__("d44e"); 1386 | var createNonEnumerableProperty = __webpack_require__("9112"); 1387 | var redefine = __webpack_require__("6eeb"); 1388 | var wellKnownSymbol = __webpack_require__("b622"); 1389 | var IS_PURE = __webpack_require__("c430"); 1390 | var Iterators = __webpack_require__("3f8c"); 1391 | var IteratorsCore = __webpack_require__("ae93"); 1392 | 1393 | var IteratorPrototype = IteratorsCore.IteratorPrototype; 1394 | var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; 1395 | var ITERATOR = wellKnownSymbol('iterator'); 1396 | var KEYS = 'keys'; 1397 | var VALUES = 'values'; 1398 | var ENTRIES = 'entries'; 1399 | 1400 | var returnThis = function () { return this; }; 1401 | 1402 | module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { 1403 | createIteratorConstructor(IteratorConstructor, NAME, next); 1404 | 1405 | var getIterationMethod = function (KIND) { 1406 | if (KIND === DEFAULT && defaultIterator) return defaultIterator; 1407 | if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND]; 1408 | switch (KIND) { 1409 | case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; 1410 | case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; 1411 | case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; 1412 | } return function () { return new IteratorConstructor(this); }; 1413 | }; 1414 | 1415 | var TO_STRING_TAG = NAME + ' Iterator'; 1416 | var INCORRECT_VALUES_NAME = false; 1417 | var IterablePrototype = Iterable.prototype; 1418 | var nativeIterator = IterablePrototype[ITERATOR] 1419 | || IterablePrototype['@@iterator'] 1420 | || DEFAULT && IterablePrototype[DEFAULT]; 1421 | var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); 1422 | var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; 1423 | var CurrentIteratorPrototype, methods, KEY; 1424 | 1425 | // fix native 1426 | if (anyNativeIterator) { 1427 | CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); 1428 | if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { 1429 | if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { 1430 | if (setPrototypeOf) { 1431 | setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); 1432 | } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') { 1433 | createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis); 1434 | } 1435 | } 1436 | // Set @@toStringTag to native iterators 1437 | setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); 1438 | if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; 1439 | } 1440 | } 1441 | 1442 | // fix Array#{values, @@iterator}.name in V8 / FF 1443 | if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { 1444 | INCORRECT_VALUES_NAME = true; 1445 | defaultIterator = function values() { return nativeIterator.call(this); }; 1446 | } 1447 | 1448 | // define iterator 1449 | if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { 1450 | createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator); 1451 | } 1452 | Iterators[NAME] = defaultIterator; 1453 | 1454 | // export additional methods 1455 | if (DEFAULT) { 1456 | methods = { 1457 | values: getIterationMethod(VALUES), 1458 | keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), 1459 | entries: getIterationMethod(ENTRIES) 1460 | }; 1461 | if (FORCED) for (KEY in methods) { 1462 | if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { 1463 | redefine(IterablePrototype, KEY, methods[KEY]); 1464 | } 1465 | } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); 1466 | } 1467 | 1468 | return methods; 1469 | }; 1470 | 1471 | 1472 | /***/ }), 1473 | 1474 | /***/ "7f9a": 1475 | /***/ (function(module, exports, __webpack_require__) { 1476 | 1477 | var global = __webpack_require__("da84"); 1478 | var inspectSource = __webpack_require__("8925"); 1479 | 1480 | var WeakMap = global.WeakMap; 1481 | 1482 | module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap)); 1483 | 1484 | 1485 | /***/ }), 1486 | 1487 | /***/ "825a": 1488 | /***/ (function(module, exports, __webpack_require__) { 1489 | 1490 | var isObject = __webpack_require__("861d"); 1491 | 1492 | module.exports = function (it) { 1493 | if (!isObject(it)) { 1494 | throw TypeError(String(it) + ' is not an object'); 1495 | } return it; 1496 | }; 1497 | 1498 | 1499 | /***/ }), 1500 | 1501 | /***/ "83ab": 1502 | /***/ (function(module, exports, __webpack_require__) { 1503 | 1504 | var fails = __webpack_require__("d039"); 1505 | 1506 | // Thank's IE8 for his funny defineProperty 1507 | module.exports = !fails(function () { 1508 | return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; 1509 | }); 1510 | 1511 | 1512 | /***/ }), 1513 | 1514 | /***/ "8418": 1515 | /***/ (function(module, exports, __webpack_require__) { 1516 | 1517 | "use strict"; 1518 | 1519 | var toPrimitive = __webpack_require__("c04e"); 1520 | var definePropertyModule = __webpack_require__("9bf2"); 1521 | var createPropertyDescriptor = __webpack_require__("5c6c"); 1522 | 1523 | module.exports = function (object, key, value) { 1524 | var propertyKey = toPrimitive(key); 1525 | if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); 1526 | else object[propertyKey] = value; 1527 | }; 1528 | 1529 | 1530 | /***/ }), 1531 | 1532 | /***/ "861d": 1533 | /***/ (function(module, exports) { 1534 | 1535 | module.exports = function (it) { 1536 | return typeof it === 'object' ? it !== null : typeof it === 'function'; 1537 | }; 1538 | 1539 | 1540 | /***/ }), 1541 | 1542 | /***/ "8875": 1543 | /***/ (function(module, exports, __webpack_require__) { 1544 | 1545 | var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller 1546 | // MIT license 1547 | // source: https://github.com/amiller-gh/currentScript-polyfill 1548 | 1549 | // added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505 1550 | 1551 | (function (root, factory) { 1552 | if (true) { 1553 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 1554 | __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 1555 | (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 1556 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 1557 | } else {} 1558 | }(typeof self !== 'undefined' ? self : this, function () { 1559 | function getCurrentScript () { 1560 | var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript') 1561 | // for chrome 1562 | if (!descriptor && 'currentScript' in document && document.currentScript) { 1563 | return document.currentScript 1564 | } 1565 | 1566 | // for other browsers with native support for currentScript 1567 | if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) { 1568 | return document.currentScript 1569 | } 1570 | 1571 | // IE 8-10 support script readyState 1572 | // IE 11+ & Firefox support stack trace 1573 | try { 1574 | throw new Error(); 1575 | } 1576 | catch (err) { 1577 | // Find the second match for the "at" string to get file src url from stack. 1578 | var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig, 1579 | ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig, 1580 | stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack), 1581 | scriptLocation = (stackDetails && stackDetails[1]) || false, 1582 | line = (stackDetails && stackDetails[2]) || false, 1583 | currentLocation = document.location.href.replace(document.location.hash, ''), 1584 | pageSource, 1585 | inlineScriptSourceRegExp, 1586 | inlineScriptSource, 1587 | scripts = document.getElementsByTagName('script'); // Live NodeList collection 1588 | 1589 | if (scriptLocation === currentLocation) { 1590 | pageSource = document.documentElement.outerHTML; 1591 | inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]* 51 | -------------------------------------------------------------------------------- /src/components/RoughCanvas.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 49 | -------------------------------------------------------------------------------- /src/components/RoughCircle.vue: -------------------------------------------------------------------------------- 1 | 31 | -------------------------------------------------------------------------------- /src/components/RoughCurve.vue: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /src/components/RoughEllipse.vue: -------------------------------------------------------------------------------- 1 | 36 | -------------------------------------------------------------------------------- /src/components/RoughLine.vue: -------------------------------------------------------------------------------- 1 | 36 | -------------------------------------------------------------------------------- /src/components/RoughLinearPath.vue: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /src/components/RoughPath.vue: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /src/components/RoughPolygon.vue: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /src/components/RoughRectangle.vue: -------------------------------------------------------------------------------- 1 | 36 | -------------------------------------------------------------------------------- /src/components/RoughSvg.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 38 | -------------------------------------------------------------------------------- /src/components/index.js: -------------------------------------------------------------------------------- 1 | export { default as RoughCanvas } from './RoughCanvas'; 2 | export { default as RoughSvg } from './RoughSvg'; 3 | export { default as RoughLine } from './RoughLine'; 4 | export { default as RoughRectangle } from './RoughRectangle'; 5 | export { default as RoughEllipse } from './RoughEllipse'; 6 | export { default as RoughCircle } from './RoughCircle'; 7 | export { default as RoughLinearPath } from './RoughLinearPath'; 8 | export { default as RoughPolygon } from './RoughPolygon'; 9 | export { default as RoughArc } from './RoughArc'; 10 | export { default as RoughCurve } from './RoughCurve'; 11 | export { default as RoughPath } from './RoughPath'; 12 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import * as components from './components'; 2 | 3 | /** 4 | * Install all components 5 | * 6 | * @param {Vue} Vue The Vue object 7 | * @return {void} 8 | */ 9 | export function install(Vue) { 10 | Object.keys(components).forEach((name) => { 11 | Vue.component(name, components[name]); 12 | }); 13 | } 14 | 15 | // Export each components separately 16 | export * from './components'; 17 | 18 | // Export the install function as default 19 | export default install; 20 | -------------------------------------------------------------------------------- /src/mixins/element.js: -------------------------------------------------------------------------------- 1 | export default { 2 | props: { 3 | roughness: Number, 4 | bowing: Number, 5 | seed: Number, 6 | stroke: String, 7 | strokeWidth: Number, 8 | fill: String, 9 | fillStyle: String, 10 | fillWeight: Number, 11 | hachureAngle: Number, 12 | hachureGap: Number, 13 | curveStepCount: Number, 14 | curveFitting: Number, 15 | strokeLineDash: Array, 16 | strokeLineDashOffset: Number, 17 | fillLineDash: Array, 18 | fillLineDashOffset: Number, 19 | disableMultiStroke: Boolean, 20 | disableMultiStrokeFill: Boolean, 21 | simplification: Number, 22 | dashOffset: Number, 23 | dashGap: Number, 24 | zigzagOffset: Number 25 | }, 26 | data() { 27 | return { 28 | element: null 29 | }; 30 | }, 31 | mounted() { 32 | this.$watch('$props', () => { this.handler() }, { deep: true }); 33 | this.handler(); 34 | }, 35 | render() { 36 | return this.$scopedSlots; 37 | }, 38 | destroyed() { 39 | const rough = this.$parent.rough; 40 | if (rough.svg) { 41 | if (this.element) this.$parent.remove(this.element); 42 | } else { 43 | this.$parent.$emit('rerender'); 44 | } 45 | }, 46 | methods: { 47 | createElement: function (func, ops, forceRender = false) { 48 | const rough = this.$parent.rough; 49 | const props = Object.assign( 50 | {}, 51 | ...Object.entries(this.$props).map(([key, value]) => ( 52 | value !== undefined && { [key]: value } 53 | )) 54 | ); 55 | 56 | if (forceRender) { 57 | rough[func](...ops, props); 58 | 59 | return; 60 | } 61 | 62 | if (rough.svg) { 63 | if (this.element) this.$parent.remove(this.element); 64 | 65 | this.element = rough[func](...ops, props); 66 | 67 | this.$parent.append(this.element); 68 | } else { 69 | this.$parent.$emit('rerender'); 70 | } 71 | } 72 | } 73 | } 74 | --------------------------------------------------------------------------------