text: var that = this;
  function __skpm_run (key, context) {
    that.context = context;
  
  var exports =
  /******/ (function(modules) { // webpackBootstrap
  /******/ 	// The module cache
  /******/ 	var installedModules = {};
  /******/
  /******/ 	// The require function
  /******/ 	function __webpack_require__(moduleId) {
  /******/
  /******/ 		// Check if module is in cache
  /******/ 		if(installedModules[moduleId]) {
  /******/ 			return installedModules[moduleId].exports;
  /******/ 		}
  /******/ 		// Create a new module (and put it into the cache)
  /******/ 		var module = installedModules[moduleId] = {
  /******/ 			i: moduleId,
  /******/ 			l: false,
  /******/ 			exports: {}
  /******/ 		};
  /******/
  /******/ 		// Execute the module function
  /******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  /******/
  /******/ 		// Flag the module as loaded
  /******/ 		module.l = true;
  /******/
  /******/ 		// Return the exports of the module
  /******/ 		return module.exports;
  /******/ 	}
  /******/
  /******/
  /******/ 	// expose the modules object (__webpack_modules__)
  /******/ 	__webpack_require__.m = modules;
  /******/
  /******/ 	// expose the module cache
  /******/ 	__webpack_require__.c = installedModules;
  /******/
  /******/ 	// define getter function for harmony exports
  /******/ 	__webpack_require__.d = function(exports, name, getter) {
  /******/ 		if(!__webpack_require__.o(exports, name)) {
  /******/ 			Object.defineProperty(exports, name, {
  /******/ 				configurable: false,
  /******/ 				enumerable: true,
  /******/ 				get: getter
  /******/ 			});
  /******/ 		}
  /******/ 	};
  /******/
  /******/ 	// getDefaultExport function for compatibility with non-harmony modules
  /******/ 	__webpack_require__.n = function(module) {
  /******/ 		var getter = module && module.__esModule ?
  /******/ 			function getDefault() { return module['default']; } :
  /******/ 			function getModuleExports() { return module; };
  /******/ 		__webpack_require__.d(getter, 'a', getter);
  /******/ 		return getter;
  /******/ 	};
  /******/
  /******/ 	// Object.prototype.hasOwnProperty.call
  /******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  /******/
  /******/ 	// __webpack_public_path__
  /******/ 	__webpack_require__.p = "";
  /******/
  /******/ 	// Load entry module and return exports
  /******/ 	return __webpack_require__(__webpack_require__.s = 7);
  /******/ })
  /************************************************************************/
  /******/ ([
  /* 0 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(console) {/* globals log */
  
  if (true) {
    var sketchUtils = __webpack_require__(9)
    var sketchDebugger = __webpack_require__(11)
    var actions = __webpack_require__(13)
  
    function getStack() {
      return sketchUtils.prepareStackTrace(new Error().stack)
    }
  }
  
  console._skpmPrefix = 'console> '
  
  function logEverywhere(type, args) {
    var values = Array.prototype.slice.call(args)
  
    // log to the System logs
    values.forEach(function(v) {
      try {
        log(console._skpmPrefix + indentString() + v)
      } catch (e) {
        log(v)
      }
    })
  
    if (true) {
      if (!sketchDebugger.isDebuggerPresent()) {
        return
      }
  
      var payload = {
        ts: Date.now(),
        type: type,
        plugin: String(context.scriptPath),
        values: values.map(sketchUtils.prepareValue),
        stack: getStack(),
      }
  
      sketchDebugger.sendToDebugger(actions.ADD_LOG, payload)
    }
  }
  
  var indentLevel = 0
  function indentString() {
    var indent = ''
    for (var i = 0; i < indentLevel; i++) {
      indent += '  '
    }
    if (indentLevel > 0) {
      indent += '| '
    }
    return indent
  }
  
  var oldGroup = console.group
  
  console.group = function() {
    // log to the JS context
    oldGroup && oldGroup.apply(this, arguments)
    indentLevel += 1
    if (true) {
      sketchDebugger.sendToDebugger(actions.GROUP, {
        plugin: String(context.scriptPath),
        collapsed: false,
      })
    }
  }
  
  var oldGroupCollapsed = console.groupCollapsed
  
  console.groupCollapsed = function() {
    // log to the JS context
    oldGroupCollapsed && oldGroupCollapsed.apply(this, arguments)
    indentLevel += 1
    if (true) {
      sketchDebugger.sendToDebugger(actions.GROUP, {
        plugin: String(context.scriptPath),
        collapsed: true
      })
    }
  }
  
  var oldGroupEnd = console.groupEnd
  
  console.groupEnd = function() {
    // log to the JS context
    oldGroupEnd && oldGroupEnd.apply(this, arguments)
    indentLevel -= 1
    if (indentLevel < 0) {
      indentLevel = 0
    }
    if (true) {
      sketchDebugger.sendToDebugger(actions.GROUP_END, {
        plugin: context.scriptPath,
      })
    }
  }
  
  var counts = {}
  var oldCount = console.count
  
  console.count = function(label) {
    label = typeof label !== 'undefined' ? label : 'Global'
    counts[label] = (counts[label] || 0) + 1
  
    // log to the JS context
    oldCount && oldCount.apply(this, arguments)
    return logEverywhere('log', [label + ': ' + counts[label]])
  }
  
  var timers = {}
  var oldTime = console.time
  
  console.time = function(label) {
    // log to the JS context
    oldTime && oldTime.apply(this, arguments)
  
    label = typeof label !== 'undefined' ? label : 'default'
    if (timers[label]) {
      return logEverywhere('warn', ['Timer "' + label + '" already exists'])
    }
  
    timers[label] = Date.now()
    return
  }
  
  var oldTimeEnd = console.timeEnd
  
  console.timeEnd = function(label) {
    // log to the JS context
    oldTimeEnd && oldTimeEnd.apply(this, arguments)
  
    label = typeof label !== 'undefined' ? label : 'default'
    if (!timers[label]) {
      return logEverywhere('warn', ['Timer "' + label + '" does not exist'])
    }
  
    var duration = Date.now() - timers[label]
    delete timers[label]
    return logEverywhere('log', [label + ': ' + (duration / 1000) + 'ms'])
  }
  
  var oldLog = console.log
  
  console.log = function() {
    // log to the JS context
    oldLog && oldLog.apply(this, arguments)
    return logEverywhere('log', arguments)
  }
  
  var oldWarn = console.warn
  
  console.warn = function() {
    // log to the JS context
    oldWarn && oldWarn.apply(this, arguments)
    return logEverywhere('warn', arguments)
  }
  
  var oldError = console.error
  
  console.error = function() {
    // log to the JS context
    oldError && oldError.apply(this, arguments)
    return logEverywhere('error', arguments)
  }
  
  var oldAssert = console.assert
  
  console.assert = function(condition, text) {
    // log to the JS context
    oldAssert && oldAssert.apply(this, arguments)
    if (!condition) {
      return logEverywhere('assert', [text])
    }
    return undefined
  }
  
  var oldInfo = console.info
  
  console.info = function() {
    // log to the JS context
    oldInfo && oldInfo.apply(this, arguments)
    return logEverywhere('info', arguments)
  }
  
  var oldClear = console.clear
  
  console.clear = function() {
    oldClear && oldClear()
    if (true) {
      return sketchDebugger.sendToDebugger(actions.CLEAR_LOGS)
    }
  }
  
  console._skpmEnabled = true
  
  module.exports = console
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
  
  /***/ }),
  /* 1 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.appVersionSupported = appVersionSupported;
  exports.toSJSON = toSJSON;
  exports.fromSJSON = fromSJSON;
  exports.fromSJSONDictionary = fromSJSONDictionary;
  
  var _invariant = __webpack_require__(15);
  
  var _invariant2 = _interopRequireDefault(_invariant);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  /*
  This is pretty simplistic at the moment, since it doesn't handle references. More work is needed to actually
  */
  
  /*
  Versions based on discussion info: http://sketchplugins.com/d/316-sketch-version
  */
  // Internal Sketch Version (ex: 95 => v47 and below)
  var SKETCH_HIGHEST_COMPATIBLE_VERSION = '95';
  // External Sketch Version
  var SKETCH_LOWEST_COMPATIBLE_APP_VERSION = '43';
  
  var envOK = typeof MSJSONDataArchiver !== 'undefined' && typeof MSJSONDictionaryUnarchiver !== 'undefined';
  
  function appVersion() {
    if (typeof NSBundle !== 'undefined') {
      return NSBundle.mainBundle().infoDictionary().CFBundleShortVersionString;
    } else {
      return undefined;
    }
  }
  
  var _checkEnv = function _checkEnv() {
    return (0, _invariant2.default)(envOK, 'sketchapp-json-plugin needs to run within Sketch v' + SKETCH_LOWEST_COMPATIBLE_APP_VERSION + '+. You are running ' + appVersion());
  };
  
  function appVersionSupported() {
    return envOK;
  }
  
  // Converts an object, eg from context.selection into its JSON string representation
  function toSJSON(sketchObject) {
    _checkEnv();
    if (!sketchObject) {
      return null;
    }
    var imm = sketchObject.immutableModelObject();
    return MSJSONDataArchiver.archiveStringWithRootObject_error_(imm, null);
  }
  
  function fromSJSON(json) {
    _checkEnv();
    var dict = JSON.parse(json);
    if (!dict) return null;
    if (dict._class.length <= 0) {
      return null;
    }
    return fromSJSONDictionary(dict);
  }
  
  // Takes a Sketch JSON tree and turns it into a native object. May throw on invalid data
  function fromSJSONDictionary(jsonTree) {
    _checkEnv();
    var decoded = MSJSONDictionaryUnarchiver.unarchiveObjectFromDictionary_asVersion_corruptionDetected_error(jsonTree, SKETCH_HIGHEST_COMPATIBLE_VERSION, null, null);
    var mutableClass = decoded.class().mutableClass();
    return mutableClass.alloc().initWithImmutableModelObject(decoded);
  }
  
  /***/ }),
  /* 2 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.makeColorFromCSS = undefined;
  exports.generateID = generateID;
  exports.replaceProperties = replaceProperties;
  
  var _normalizeCssColor = __webpack_require__(17);
  
  var _normalizeCssColor2 = _interopRequireDefault(_normalizeCssColor);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  
  var lut = [];
  
  for (var i = 0; i < 256; i += 1) {
    lut[i] = (i < 16 ? '0' : '') + i.toString(16);
  }
  
  // Hack (http://stackoverflow.com/a/21963136)
  function e7() {
    var d0 = Math.random() * 0xffffffff | 0;
    var d1 = Math.random() * 0xffffffff | 0;
    var d2 = Math.random() * 0xffffffff | 0;
    var d3 = Math.random() * 0xffffffff | 0;
  
    return String(lut[d0 & 0xff] + lut[d0 >> 8 & 0xff] + lut[d0 >> 16 & 0xff] + lut[d0 >> 24 & 0xff]) + '-' + String(lut[d1 & 0xff]) + String(lut[d1 >> 8 & 0xff]) + '-' + String(lut[d1 >> 16 & 0x0f | 0x40]) + String(lut[d1 >> 24 & 0xff]) + '-' + String(lut[d2 & 0x3f | 0x80]) + String(lut[d2 >> 8 & 0xff]) + '-' + String(lut[d2 >> 16 & 0xff]) + String(lut[d2 >> 24 & 0xff]) + String(lut[d3 & 0xff]) + String(lut[d3 >> 8 & 0xff]) + String(lut[d3 >> 16 & 0xff]) + String(lut[d3 >> 24 & 0xff]);
  }
  
  function generateID() {
    return e7();
  }
  
  var safeToLower = function safeToLower(input) {
    if (typeof input === 'string') {
      return input.toLowerCase();
    }
  
    return input;
  };
  
  // Takes colors as CSS hex, name, rgb, rgba, hsl or hsla
  var makeColorFromCSS = exports.makeColorFromCSS = function makeColorFromCSS(input) {
    var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
  
    var nullableColor = (0, _normalizeCssColor2['default'])(safeToLower(input));
    var colorInt = nullableColor === null ? 0x00000000 : nullableColor;
  
    var _normalizeColor$rgba = _normalizeCssColor2['default'].rgba(colorInt),
        r = _normalizeColor$rgba.r,
        g = _normalizeColor$rgba.g,
        b = _normalizeColor$rgba.b,
        a = _normalizeColor$rgba.a;
  
    return {
      _class: 'color',
      red: r / 255,
      green: g / 255,
      blue: b / 255,
      alpha: a * alpha
    };
  };
  
  function replaceProperties(dest, src) {
    for (var prop in dest) {
      if (dest.hasOwnProperty(prop)) {
        delete dest[prop];
      }
    }
  
    for (var _prop in src) {
      if (src.hasOwnProperty(_prop)) {
        dest[_prop] = src[_prop];
      }
    }
  }
  
  /***/ }),
  /* 3 */
  /***/ (function(module, exports) {
  
  /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign, no-var, vars-on-top, prefer-template, prefer-arrow-callback, func-names, prefer-destructuring, object-shorthand */
  
  module.exports = function prepareStackTrace(stackTrace) {
    var stack = stackTrace.split('\n')
    stack = stack.map(function (s) {
      return s.replace(/\sg/, '')
    })
  
    stack = stack.map(function (entry) {
      // entry is something like `functionName@path/to/my/file:line:column`
      // or `path/to/my/file:line:column`
      // or `path/to/my/file`
      // or `path/to/@my/file:line:column`
      var parts = entry.split('@')
      var fn = parts.shift()
      var filePath = parts.join('@') // the path can contain @
  
      if (fn.indexOf('/Users/') === 0) {
        // actually we didn't have a fn so just put it back in the filePath
        filePath = fn + (filePath ? ('@' + filePath) : '')
        fn = null
      }
  
      if (!filePath) {
        // we should always have a filePath, so if we don't have one here, it means that the function what actually anonymous and that it is the filePath instead
        filePath = entry
        fn = null
      }
  
      var filePathParts = filePath.split(':')
      filePath = filePathParts[0]
  
      // the file is the last part of the filePath
      var file = filePath.split('/')
      file = file[file.length - 1]
  
      return {
        fn: fn,
        file: file,
        filePath: filePath,
        line: filePathParts[1],
        column: filePathParts[2],
      }
    })
  
    return stack
  }
  
  
  /***/ }),
  /* 4 */
  /***/ (function(module, exports) {
  
  module.exports = function toArray(object) {
    if (Array.isArray(object)) {
      return object
    }
    var arr = []
    for (var j = 0; j < (object || []).length; j += 1) {
      arr.push(object[j])
    }
    return arr
  }
  
  
  /***/ }),
  /* 5 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.fixImageFill = fixImageFill;
  exports['default'] = fixImageFillsInLayer;
  
  var _fixSVG = __webpack_require__(6);
  
  var _fixSVG2 = _interopRequireDefault(_fixSVG);
  
  var _utils = __webpack_require__(2);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  
  // based on https://github.com/airbnb/react-sketchapp/blob/master/src/jsonUtils/hacksForJSONImpl.js
  
  var IMG_SVG = 'svg';
  var IMG_BLOB = 'blob';
  var IMG_UNSUPPORTED = 'unsupported';
  var IMG_ERROR = 'error';
  
  function getImageDataFromUrl(url) {
    var fetchedData = NSData.dataWithContentsOfURL(NSURL.URLWithString(url));
  
    if (!fetchedData) {
      return {
        type: IMG_ERROR,
        data: null
      };
    }
  
    var firstByte = fetchedData.subdataWithRange(NSMakeRange(0, 1)).description();
  
    // Check for first byte. Must use non-type-exact matching (!=).
    // 0xFF = JPEG, 0x89 = PNG, 0x47 = GIF, 0x49 = TIFF, 0x4D = TIFF
    if (
    /* eslint-disable eqeqeq */
    firstByte == '<3c>'
    /* eslint-enable eqeqeq */
    ) {
        var rawSVGString = NSString.alloc().initWithData_encoding_(fetchedData, NSUTF8StringEncoding);
  
        return {
          type: IMG_SVG,
          data: rawSVGString
        };
      } else if (
    /* eslint-disable eqeqeq */
    firstByte != '<ff>' && firstByte != '<89>' && firstByte != '<47>' && firstByte != '<49>' && firstByte != '<4d>'
    /* eslint-enable eqeqeq */
    ) {
        return {
          type: IMG_UNSUPPORTED,
          data: null
        };
      } else {
      return {
        type: IMG_BLOB,
        data: fetchedData
      };
    }
  }
  
  /**
   * @returns {NSImage} big red rectangle - our error image
   */
  function getErrorImage() {
    // eslint-disable-next-line max-len
    var errorUrl = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mM8w8DwHwAEOQHNmnaaOAAAAABJRU5ErkJggg==';
  
    return NSImage.alloc().initWithContentsOfURL(NSURL.URLWithString(errorUrl));
  }
  
  function fixImageFill(layer, fill) {
    if (!fill.image || !fill.image.url) {
      return null;
    }
  
    var _getImageDataFromUrl = getImageDataFromUrl(fill.image.url),
        imageType = _getImageDataFromUrl.type,
        imageData = _getImageDataFromUrl.data;
  
    if (imageType === IMG_SVG) {
      var svgLayer = {
        x: layer.frame.x,
        y: layer.frame.y,
        width: layer.frame.width,
        height: layer.frame.height,
        rawSVGString: imageData
      };
  
      (0, _fixSVG2['default'])(svgLayer);
  
      // we are replacing the parent layer with SVGLayer
      (0, _utils.replaceProperties)(layer, svgLayer);
    } else {
  
      var nsImage = void 0,
          msImage = void 0;
  
      if (imageType === IMG_ERROR || imageType === IMG_UNSUPPORTED) {
        nsImage = getErrorImage();
      } else {
        nsImage = NSImage.alloc().initWithData(imageData);
      }
  
      if (MSImageData.alloc().initWithImage_convertColorSpace !== undefined) {
        msImage = MSImageData.alloc().initWithImage_convertColorSpace(nsImage, false);
      } else {
        msImage = MSImageData.alloc().initWithImage(nsImage);
      }
  
      var data = msImage.data().base64EncodedStringWithOptions(NSDataBase64EncodingEndLineWithCarriageReturn);
      var sha1 = msImage.sha1().base64EncodedStringWithOptions(NSDataBase64EncodingEndLineWithCarriageReturn);
  
      fill.image.data = { _data: data };
      fill.image.sha1 = { _data: sha1 };
  
      delete fill.image.url;
    }
  
    return imageType;
  }
  
  function fixImageFillsInLayer(layer) {
    if (!layer.style || !layer.style.fills) {
      return;
    }
  
    var fills = layer.style.fills;
  
    var _iteratorNormalCompletion = true;
    var _didIteratorError = false;
    var _iteratorError = undefined;
  
    try {
      for (var _iterator = fills[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
        var fill = _step.value;
  
        var imageType = fixImageFill(layer, fill);
  
        if (imageType === IMG_SVG) {
          // since we can't replace the parent twice, we have to bail out
          return;
        }
      }
    } catch (err) {
      _didIteratorError = true;
      _iteratorError = err;
    } finally {
      try {
        if (!_iteratorNormalCompletion && _iterator['return']) {
          _iterator['return']();
        }
      } finally {
        if (_didIteratorError) {
          throw _iteratorError;
        }
      }
    }
  }
  
  /***/ }),
  /* 6 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(console) {
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports['default'] = fixSVGLayer;
  
  var _sketchappJsonPlugin = __webpack_require__(1);
  
  var _utils = __webpack_require__(2);
  
  function makeNativeSVGLayer(layer) {
    var svgString = NSString.stringWithString(layer.rawSVGString);
    var svgData = svgString.dataUsingEncoding(NSUTF8StringEncoding);
    var svgImporter = MSSVGImporter.svgImporter();
  
    var svgLayer = null;
  
    try {
      svgImporter.prepareToImportFromData(svgData);
      svgLayer = svgImporter.importAsLayer();
    } catch (e) {
      console.log('SVG import failed: ' + e);
    }
  
    if (svgLayer === null) {
      return null;
    }
  
    while (svgLayer['class']() instanceof MSLayerGroup && svgLayer.layers().length === 1) {
      svgLayer = svgLayer.layers()[0];
    }
  
    svgLayer.resizingConstraint = layer.resizingConstraint;
    svgLayer.hasClippingMask = layer.hasClippingMask;
  
    var currentSize = svgLayer.rect().size;
    var scale = Math.min(layer.width / currentSize.width, layer.height / currentSize.height);
  
    if (scale !== 1) {
      // scaling instead of resizing (changing width and height directly) recalculates border radius
      svgLayer.multiplyBy(scale);
    }
  
    svgLayer.rect = {
      origin: {
        x: layer.x,
        y: layer.y
      },
      size: {
        width: layer.width,
        height: layer.height
      }
    };
  
    return svgLayer;
  }
  
  function fixSVGLayer(layer) {
    var svgLayer = makeNativeSVGLayer(layer);
  
    if (svgLayer === null) {
      return;
    }
  
    var newLayerString = (0, _sketchappJsonPlugin.toSJSON)(svgLayer);
    var newLayerObject = JSON.parse(newLayerString);
  
    (0, _utils.replaceProperties)(layer, newLayerObject);
  }
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
  
  /***/ }),
  /* 7 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports['default'] = importFiles;
  
  var _asketch2sketch = __webpack_require__(8);
  
  var _asketch2sketch2 = _interopRequireDefault(_asketch2sketch);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  
  function importFiles(context) {
    var panel = NSOpenPanel.openPanel();
  
    panel.setCanChooseDirectories(false);
    panel.setCanChooseFiles(true);
    panel.setAllowsMultipleSelection(true);
    panel.setTitle('Choose *.asketch.json files');
    panel.setPrompt('Choose');
    panel.setAllowedFileTypes(['json']);
  
    if (panel.runModal() !== NSModalResponseOK || panel.URLs().length === 0) {
      return;
    }
  
    var urls = Array.from(panel.URLs());
  
    var asketchFiles = urls.map(function (url) {
      var data = NSData.dataWithContentsOfURL(url);
      var content = NSString.alloc().initWithData_encoding_(data, NSUTF8StringEncoding);
  
      var asketchFile = null;
  
      try {
        asketchFile = JSON.parse(content);
      } catch (e) {
        var alert = NSAlert.alloc().init();
  
        alert.setMessageText('File is not valid JSON.');
        alert.runModal();
      }
  
      return asketchFile;
    });
  
    (0, _asketch2sketch2['default'])(context, asketchFiles);
  }
  
  /***/ }),
  /* 8 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(console) {
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports['default'] = asketch2sketch;
  
  var _ui = __webpack_require__(14);
  
  var _ui2 = _interopRequireDefault(_ui);
  
  var _sketchappJsonPlugin = __webpack_require__(1);
  
  var _fixFont = __webpack_require__(16);
  
  var _fixImageFill = __webpack_require__(5);
  
  var _fixImageFill2 = _interopRequireDefault(_fixImageFill);
  
  var _fixBitmap = __webpack_require__(24);
  
  var _fixBitmap2 = _interopRequireDefault(_fixBitmap);
  
  var _fixSVG = __webpack_require__(6);
  
  var _fixSVG2 = _interopRequireDefault(_fixSVG);
  
  var _zoomToFit = __webpack_require__(25);
  
  var _zoomToFit2 = _interopRequireDefault(_zoomToFit);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  
  function removeExistingLayers(context) {
    if (context.containsLayers()) {
      var loop = context.children().objectEnumerator();
      var currLayer = loop.nextObject();
  
      while (currLayer) {
        if (currLayer !== context) {
          currLayer.removeFromParent();
        }
        currLayer = loop.nextObject();
      }
    }
  }
  
  function getNativeLayer(failingLayers, layer) {
    // debug
    // console.log('Processing ' + layer.name + ' (' + layer._class + ')');
  
    if (layer._class === 'text') {
      (0, _fixFont.fixTextLayer)(layer);
    } else if (layer._class === 'svg') {
      (0, _fixSVG2['default'])(layer);
    } else if (layer._class === 'bitmap') {
      (0, _fixBitmap2['default'])(layer);
    } else {
      (0, _fixImageFill2['default'])(layer);
    }
  
    // Create native object for the current layer, ignore the children for now
    // this alows us to catch and ignore failing layers and finish the import
    var children = layer.layers;
    var nativeObj = null;
  
    layer.layers = [];
  
    try {
      nativeObj = (0, _sketchappJsonPlugin.fromSJSONDictionary)(layer);
    } catch (e) {
      failingLayers.push(layer.name);
  
      console.log('Layer failed to import: ' + layer.name);
      return null;
    }
  
    // Get native object for all child layers and append them to the current object
    if (children && children.length) {
      children.forEach(function (child) {
        var nativeChild = getNativeLayer(failingLayers, child);
  
        if (nativeChild) {
          nativeObj.addLayer(nativeChild);
        }
      });
    }
  
    return nativeObj;
  }
  
  function removeSharedTextStyles(document) {
    document.documentData().layerTextStyles().setObjects([]);
  }
  
  function addSharedTextStyle(document, style) {
    var container = context.document.documentData().layerTextStyles();
  
    if (container.addSharedStyleWithName_firstInstance) {
      container.addSharedStyleWithName_firstInstance(style.name, (0, _sketchappJsonPlugin.fromSJSONDictionary)(style.value));
    } else {
      var sharedStyle = void 0;
      var allocator = MSSharedStyle.alloc();
  
      if (allocator.initWithName_firstInstance) {
        sharedStyle = allocator.initWithName_firstInstance(style.name, (0, _sketchappJsonPlugin.fromSJSONDictionary)(style.value));
      } else {
        sharedStyle = allocator.initWithName_style(style.name, (0, _sketchappJsonPlugin.fromSJSONDictionary)(style.value));
      }
      container.addSharedObject(sharedStyle);
    }
  }
  
  function removeSharedColors(document) {
    var assets = document.documentData().assets();
  
    assets.removeAllColors();
  }
  
  function addSharedColor(document, colorJSON) {
    var assets = document.documentData().assets();
    var color = (0, _sketchappJsonPlugin.fromSJSONDictionary)(colorJSON);
  
    assets.addColor(color);
  }
  
  function asketch2sketch(context, asketchFiles) {
    var document = context.document;
    var page = document.currentPage();
  
    var asketchDocument = null;
    var asketchPage = null;
  
    asketchFiles.forEach(function (asketchFile) {
      if (asketchFile && asketchFile._class === 'document') {
        asketchDocument = asketchFile;
      } else if (asketchFile && asketchFile._class === 'page') {
        asketchPage = asketchFile;
      }
    });
  
    if (asketchDocument) {
      removeSharedColors(document);
      removeSharedTextStyles(document);
  
      if (asketchDocument.assets.colors) {
        asketchDocument.assets.colors.forEach(function (color) {
          return addSharedColor(document, color);
        });
  
        console.log('Shared colors added: ' + asketchDocument.assets.colors.length);
      }
  
      if (asketchDocument.layerTextStyles && asketchDocument.layerTextStyles.objects) {
        asketchDocument.layerTextStyles.objects.forEach(function (style) {
          (0, _fixFont.fixSharedTextStyle)(style);
          addSharedTextStyle(document, style);
        });
  
        console.log('Shared text styles added: ' + asketchDocument.layerTextStyles.objects.length);
      }
    }
  
    if (asketchPage) {
      removeExistingLayers(page);
  
      page.name = asketchPage.name;
  
      var failingLayers = [];
  
      asketchPage.layers.map(getNativeLayer.bind(null, failingLayers)).forEach(function (layer) {
        return layer && page.addLayer(layer);
      });
  
      if (failingLayers.length === 1) {
        _ui2['default'].alert('asketch2sketch', 'One layer couldn\'t be imported and was skipped.');
      } else if (failingLayers.length > 1) {
        _ui2['default'].alert('asketch2sketch', String(failingLayers.length) + ' layers couldn\'t be imported and were skipped.');
      } else {
        var emojis = ['👌', '👍', '✨', '😍', '🍾', '🤩', '🎉', '👏', '💪', '🤘', '💅', '🏆', '🚀'];
  
        _ui2['default'].message('Import successful ' + String(emojis[Math.floor(emojis.length * Math.random())]));
      }
  
      (0, _zoomToFit2['default'])(context);
    }
  }
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
  
  /***/ }),
  /* 9 */
  /***/ (function(module, exports, __webpack_require__) {
  
  var prepareValue = __webpack_require__(10)
  
  module.exports.toArray = __webpack_require__(4)
  module.exports.prepareStackTrace = __webpack_require__(3)
  module.exports.prepareValue = prepareValue
  module.exports.prepareObject = prepareValue.prepareObject
  module.exports.prepareArray = prepareValue.prepareArray
  
  
  /***/ }),
  /* 10 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign, no-var, vars-on-top, prefer-template, prefer-arrow-callback, func-names, prefer-destructuring, object-shorthand */
  var prepareStackTrace = __webpack_require__(3)
  var toArray = __webpack_require__(4)
  
  function prepareArray(array, options) {
    return array.map(function(i) {
      return prepareValue(i, options)
    })
  }
  
  function prepareObject(object, options) {
    const deep = {}
    Object.keys(object).forEach(function(key) {
      deep[key] = prepareValue(object[key], options)
    })
    return deep
  }
  
  function getName(x) {
    return {
      type: 'String',
      primitive: 'String',
      value: String(x.name()),
    }
  }
  
  function getSelector(x) {
    return {
      type: 'String',
      primitive: 'String',
      value: String(x.selector()),
    }
  }
  
  function introspectMochaObject(value, options) {
    options = options || {}
    var mocha = value.class().mocha()
    var introspection = {
      properties: {
        type: 'Array',
        primitive: 'Array',
        value: toArray(
          mocha['properties' + (options.withAncestors ? 'WithAncestors' : '')]()
        ).map(getName),
      },
      classMethods: {
        type: 'Array',
        primitive: 'Array',
        value: toArray(
          mocha['classMethods' + (options.withAncestors ? 'WithAncestors' : '')]()
        ).map(getSelector),
      },
      instanceMethods: {
        type: 'Array',
        primitive: 'Array',
        value: toArray(
          mocha['instanceMethods' + (options.withAncestors ? 'WithAncestors' : '')]()
        ).map(getSelector),
      },
      protocols: {
        type: 'Array',
        primitive: 'Array',
        value: toArray(
          mocha['protocols' + (options.withAncestors ? 'WithAncestors' : '')]()
        ).map(getName),
      },
    }
    if (mocha.treeAsDictionary && options.withTree) {
      introspection.treeAsDictionary = {
        type: 'Object',
        primitive: 'Object',
        value: prepareObject(mocha.treeAsDictionary())
      }
    }
    return introspection
  }
  
  function prepareValue(value, options) {
    var type = 'String'
    var primitive = 'String'
    const typeOf = typeof value
    if (value instanceof Error) {
      type = 'Error'
      primitive = 'Error'
      value = {
        message: value.message,
        name: value.name,
        stack: prepareStackTrace(value.stack),
      }
    } else if (Array.isArray(value)) {
      type = 'Array'
      primitive = 'Array'
      value = prepareArray(value, options)
    } else if (value === null || value === undefined || Number.isNaN(value)) {
      type = 'Empty'
      primitive = 'Empty'
      value = String(value)
    } else if (typeOf === 'object') {
      if (value.isKindOfClass && typeof value.class === 'function') {
        type = String(value.class())
        // TODO: Here could come some meta data saved as value
        if (
          type === 'NSDictionary' ||
          type === '__NSDictionaryM' ||
          type === '__NSSingleEntryDictionaryI' ||
          type === '__NSDictionaryI' ||
          type === '__NSCFDictionary'
        ) {
          primitive = 'Object'
          value = prepareObject(Object(value), options)
        } else if (
          type === 'NSArray' ||
          type === 'NSMutableArray' ||
          type === '__NSArrayM' ||
          type === '__NSSingleObjectArrayI' ||
          type === '__NSArray0'
        ) {
          primitive = 'Array'
          value = prepareArray(toArray(value), options)
        } else if (
          type === 'NSString' ||
          type === '__NSCFString' ||
          type === 'NSTaggedPointerString' ||
          type === '__NSCFConstantString'
        ) {
          primitive = 'String'
          value = String(value)
        } else if (type === '__NSCFNumber' || type === 'NSNumber') {
          primitive = 'Number'
          value = 0 + value
        } else if (type === 'MOStruct') {
          type = String(value.name())
          primitive = 'Object'
          value = value.memberNames().reduce(function(prev, k) {
            prev[k] = prepareValue(value[k], options)
            return prev
          }, {})
        } else if (value.class().mocha) {
          primitive = 'Mocha'
          value = (options || {}).skipMocha ? type : introspectMochaObject(value, options)
        } else {
          primitive = 'Unknown'
          value = type
        }
      } else {
        type = 'Object'
        primitive = 'Object'
        value = prepareObject(value, options)
      }
    } else if (typeOf === 'function') {
      type = 'Function'
      primitive = 'Function'
      value = String(value)
    } else if (value === true || value === false) {
      type = 'Boolean'
      primitive = 'Boolean'
    } else if (typeOf === 'number') {
      primitive = 'Number'
      type = 'Number'
    }
  
    return {
      value,
      type,
      primitive,
    }
  }
  
  module.exports = prepareValue
  module.exports.prepareObject = prepareObject
  module.exports.prepareArray = prepareArray
  
  
  /***/ }),
  /* 11 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign, no-var, vars-on-top, prefer-template, prefer-arrow-callback, func-names, prefer-destructuring, object-shorthand */
  var remoteWebview = __webpack_require__(12)
  
  module.exports.identifier = 'skpm.debugger'
  
  module.exports.isDebuggerPresent = remoteWebview.isWebviewPresent.bind(
    this,
    module.exports.identifier
  )
  
  module.exports.sendToDebugger = function sendToDebugger(name, payload) {
    return remoteWebview.sendToWebview(
      module.exports.identifier,
      'sketchBridge(' +
        JSON.stringify({
          name: name,
          payload: payload,
        }) +
        ');'
    )
  }
  
  
  /***/ }),
  /* 12 */
  /***/ (function(module, exports) {
  
  /* globals NSThread */
  
  var threadDictionary = NSThread.mainThread().threadDictionary()
  
  module.exports.isWebviewPresent = function isWebviewPresent (identifier) {
    return !!threadDictionary[identifier]
  }
  
  module.exports.sendToWebview = function sendToWebview (identifier, evalString) {
    if (!module.exports.isWebviewPresent(identifier)) {
      throw new Error('Webview ' + identifier + ' not found')
    }
  
    var webview = threadDictionary[identifier]
      .contentView()
      .subviews()
    webview = webview[webview.length - 1]
  
    return webview.stringByEvaluatingJavaScriptFromString(evalString)
  }
  
  
  /***/ }),
  /* 13 */
  /***/ (function(module, exports) {
  
  module.exports.SET_TREE = 'elements/SET_TREE'
  module.exports.SET_PAGE_METADATA = 'elements/SET_PAGE_METADATA'
  module.exports.SET_LAYER_METADATA = 'elements/SET_LAYER_METADATA'
  module.exports.ADD_LOG = 'logs/ADD_LOG'
  module.exports.CLEAR_LOGS = 'logs/CLEAR_LOGS'
  module.exports.GROUP = 'logs/GROUP'
  module.exports.GROUP_END = 'logs/GROUP_END'
  module.exports.TIMER_START = 'logs/TIMER_START'
  module.exports.TIMER_END = 'logs/TIMER_END'
  module.exports.ADD_REQUEST = 'network/ADD_REQUEST'
  module.exports.SET_RESPONSE = 'network/SET_RESPONSE'
  module.exports.ADD_ACTION = 'actions/ADD_ACTION'
  module.exports.SET_SCRIPT_RESULT = 'playground/SET_SCRIPT_RESULT'
  
  
  /***/ }),
  /* 14 */
  /***/ (function(module, exports) {
  
  module.exports = require("sketch/ui");
  
  /***/ }),
  /* 15 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * Copyright 2013-2015, Facebook, Inc.
   * All rights reserved.
   *
   * This source code is licensed under the BSD-style license found in the
   * LICENSE file in the root directory of this source tree. An additional grant
   * of patent rights can be found in the PATENTS file in the same directory.
   */
  
  
  
  /**
   * Use invariant() to assert state which your program assumes to be true.
   *
   * Provide sprintf-style format (only %s is supported) and arguments
   * to provide information about what broke and what you were
   * expecting.
   *
   * The invariant message will be stripped in production, but the invariant
   * will remain to ensure logic does not differ in production.
   */
  
  var invariant = function(condition, format, a, b, c, d, e, f) {
    if (true) {
      if (format === undefined) {
        throw new Error('invariant requires an error message argument');
      }
    }
  
    if (!condition) {
      var error;
      if (format === undefined) {
        error = new Error(
          'Minified exception occurred; use the non-minified dev environment ' +
          'for the full error message and additional helpful warnings.'
        );
      } else {
        var args = [a, b, c, d, e, f];
        var argIndex = 0;
        error = new Error(
          format.replace(/%s/g, function() { return args[argIndex++]; })
        );
        error.name = 'Invariant Violation';
      }
  
      error.framesToPop = 1; // we don't care about invariant's own frame
      throw error;
    }
  };
  
  module.exports = invariant;
  
  
  /***/ }),
  /* 16 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(console) {
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.fixTextLayer = fixTextLayer;
  exports.fixSharedTextStyle = fixSharedTextStyle;
  
  var _utils = __webpack_require__(2);
  
  var _sketchConstants = __webpack_require__(18);
  
  var _sketchappJsonPlugin = __webpack_require__(1);
  
  var _findFont = __webpack_require__(19);
  
  var _findFont2 = _interopRequireDefault(_findFont);
  
  var _getSketchVersion = __webpack_require__(23);
  
  var _getSketchVersion2 = _interopRequireDefault(_getSketchVersion);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  
  var TEXT_ALIGN = {
    auto: _sketchConstants.TextAlignment.Left,
    left: _sketchConstants.TextAlignment.Left,
    right: _sketchConstants.TextAlignment.Right,
    center: _sketchConstants.TextAlignment.Center,
    justify: _sketchConstants.TextAlignment.Justified
  }; // taken from https://github.com/airbnb/react-sketchapp/blob/master/src/jsonUtils/hacksForJSONImpl.js
  
  
  var TEXT_DECORATION_UNDERLINE = {
    none: 0,
    underline: 1,
    double: 9
  };
  
  var TEXT_DECORATION_LINETHROUGH = {
    none: 0,
    'line-through': 1
  };
  
  // this doesn't exist in constants
  var TEXT_TRANSFORM = {
    uppercase: 1,
    lowercase: 2,
    initial: 0,
    inherit: 0,
    none: 0,
    capitalize: 0
  };
  
  function makeParagraphStyle(textStyle) {
    var pStyle = NSMutableParagraphStyle.alloc().init();
  
    if (textStyle.lineHeight !== undefined) {
      pStyle.minimumLineHeight = textStyle.lineHeight;
      pStyle.lineHeightMultiple = 1.0;
      pStyle.maximumLineHeight = textStyle.lineHeight;
    }
  
    if (textStyle.textAlign) {
      pStyle.alignment = TEXT_ALIGN[textStyle.textAlign];
    }
  
    return pStyle;
  }
  
  function encodeSketchJSON(sketchObj) {
    var encoded = (0, _sketchappJsonPlugin.toSJSON)(sketchObj);
  
    return encoded ? JSON.parse(encoded) : {};
  }
  
  // This shouldn't need to call into Sketch, but it does currently, which is bad for perf :(
  function createStringAttributes(textStyles) {
    var font = (0, _findFont2['default'])(textStyles);
  
    var attribs = {
      MSAttributedStringFontAttribute: font.fontDescriptor(),
      NSFont: font,
      NSParagraphStyle: makeParagraphStyle(textStyles),
      NSUnderline: TEXT_DECORATION_UNDERLINE[textStyles.textDecoration] || 0,
      NSStrikethrough: TEXT_DECORATION_LINETHROUGH[textStyles.textDecoration] || 0
    };
  
    var color = (0, _utils.makeColorFromCSS)(textStyles.color || 'black');
  
    if ((0, _getSketchVersion2['default'])() >= 50) {
      attribs.MSAttributedStringColorAttribute = color;
    } else {
      attribs.NSColor = NSColor.colorWithDeviceRed_green_blue_alpha(color.red, color.green, color.blue, color.alpha);
    }
  
    if (textStyles.letterSpacing !== undefined) {
      attribs.NSKern = textStyles.letterSpacing;
    }
  
    if (textStyles.textTransform !== undefined) {
      attribs.MSAttributedStringTextTransformAttribute = TEXT_TRANSFORM[textStyles.textTransform] * 1;
    }
  
    return attribs;
  }
  
  function createAttributedString(textNode) {
    var content = textNode.content,
        textStyles = textNode.textStyles;
  
  
    var attribs = createStringAttributes(textStyles);
    var result = null;
  
    try {
      result = NSAttributedString.attributedStringWithString_attributes_(content, attribs);
    } catch (e) {
      console.log('Failed to create attributed string: ' + e);
    }
  
    return result;
  }
  
  function makeEncodedAttributedString(textNodes) {
    var fullStr = NSMutableAttributedString.alloc().init();
  
    textNodes.forEach(function (textNode) {
      var newString = createAttributedString(textNode);
  
      if (newString !== null) {
        fullStr.appendAttributedString(newString);
      }
    });
  
    var encodedAttribStr = MSAttributedString.encodeAttributedString(fullStr);
  
    var msAttribStr = MSAttributedString.alloc().initWithEncodedAttributedString(encodedAttribStr);
  
    return encodeSketchJSON(msAttribStr);
  }
  
  function makeTextStyle(textStyle) {
    var pStyle = makeParagraphStyle(textStyle);
  
    var font = (0, _findFont2['default'])(textStyle);
  
    var color = (0, _utils.makeColorFromCSS)(textStyle.color || 'black');
  
    var value = {
      _class: 'textStyle',
      encodedAttributes: {
        MSAttributedStringFontAttribute: encodeSketchJSON(font.fontDescriptor()),
        NSFont: font,
        NSColor: encodeSketchJSON(NSColor.colorWithDeviceRed_green_blue_alpha(color.red, color.green, color.blue, color.alpha)),
        NSParagraphStyle: encodeSketchJSON(pStyle),
        NSKern: textStyle.letterSpacing || 0,
        MSAttributedStringTextTransformAttribute: TEXT_TRANSFORM[textStyle.textTransform || 'initial'] * 1
      }
    };
  
    return {
      _class: 'style',
      sharedObjectID: (0, _utils.generateID)(),
      miterLimit: 10,
      startDecorationType: 0,
      endDecorationType: 0,
      textStyle: value
    };
  }
  
  function fixTextLayer(layer) {
    layer.attributedString = makeEncodedAttributedString([{ content: layer.text, textStyles: layer.style }]);
    delete layer.style;
    delete layer.text;
  }
  
  function fixSharedTextStyle(sharedStyle) {
    sharedStyle.value = makeTextStyle(sharedStyle.style);
    delete sharedStyle.style;
  }
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
  
  /***/ }),
  /* 17 */
  /***/ (function(module, exports) {
  
  /*
   * Copyright (c) 2015-present, Facebook, Inc.
   * All rights reserved.
   *
   * This source code is licensed under the BSD-style license found in the
   * LICENSE file in the root directory of this source tree. An additional grant
   * of patent rights can be found in the PATENTS file in the same directory.
   *
   */
  
  function normalizeColor(color) {
    var match;
  
    if (typeof color === 'number') {
      if (color >>> 0 === color && color >= 0 && color <= 0xffffffff) {
        return color;
      }
      return null;
    }
  
    // Ordered based on occurrences on Facebook codebase
    if ((match = matchers.hex6.exec(color))) {
      return parseInt(match[1] + 'ff', 16) >>> 0;
    }
  
    if (names.hasOwnProperty(color)) {
      return names[color];
    }
  
    if ((match = matchers.rgb.exec(color))) {
      return (
          parse255(match[1]) << 24 | // r
          parse255(match[2]) << 16 | // g
          parse255(match[3]) << 8 | // b
          0x000000ff // a
        ) >>> 0;
    }
  
    if ((match = matchers.rgba.exec(color))) {
      return (
          parse255(match[1]) << 24 | // r
          parse255(match[2]) << 16 | // g
          parse255(match[3]) << 8 | // b
          parse1(match[4]) // a
        ) >>> 0;
    }
  
    if ((match = matchers.hex3.exec(color))) {
      return parseInt(
          match[1] + match[1] + // r
          match[2] + match[2] + // g
          match[3] + match[3] + // b
          'ff', // a
          16
        ) >>> 0;
    }
  
    // https://drafts.csswg.org/css-color-4/#hex-notation
    if ((match = matchers.hex8.exec(color))) {
      return parseInt(match[1], 16) >>> 0;
    }
  
    if ((match = matchers.hex4.exec(color))) {
      return parseInt(
          match[1] + match[1] + // r
          match[2] + match[2] + // g
          match[3] + match[3] + // b
          match[4] + match[4], // a
          16
        ) >>> 0;
    }
  
    if ((match = matchers.hsl.exec(color))) {
      return (
          hslToRgb(
            parse360(match[1]), // h
            parsePercentage(match[2]), // s
            parsePercentage(match[3]) // l
          ) |
          0x000000ff // a
        ) >>> 0;
    }
  
    if ((match = matchers.hsla.exec(color))) {
      return (
          hslToRgb(
            parse360(match[1]), // h
            parsePercentage(match[2]), // s
            parsePercentage(match[3]) // l
          ) |
          parse1(match[4]) // a
        ) >>> 0;
    }
  
    return null;
  }
  
  function hue2rgb(p, q, t) {
    if (t < 0) {
      t += 1;
    }
    if (t > 1) {
      t -= 1;
    }
    if (t < 1 / 6) {
      return p + (q - p) * 6 * t;
    }
    if (t < 1 / 2) {
      return q;
    }
    if (t < 2 / 3) {
      return p + (q - p) * (2 / 3 - t) * 6;
    }
    return p;
  }
  
  function hslToRgb(h, s, l) {
    var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
    var p = 2 * l - q;
    var r = hue2rgb(p, q, h + 1 / 3);
    var g = hue2rgb(p, q, h);
    var b = hue2rgb(p, q, h - 1 / 3);
  
    return (
      Math.round(r * 255) << 24 |
      Math.round(g * 255) << 16 |
      Math.round(b * 255) << 8
    );
  }
  
  // var INTEGER = '[-+]?\\d+';
  var NUMBER = '[-+]?\\d*\\.?\\d+';
  var PERCENTAGE = NUMBER + '%';
  
  function toArray(arrayLike) {
    return Array.prototype.slice.call(arrayLike, 0);
  }
  
  function call() {
    return '\\(\\s*(' + toArray(arguments).join(')\\s*,\\s*(') + ')\\s*\\)';
  }
  
  var matchers = {
    rgb: new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER)),
    rgba: new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER)),
    hsl: new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE)),
    hsla: new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER)),
    hex3: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
    hex4: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
    hex6: /^#([0-9a-fA-F]{6})$/,
    hex8: /^#([0-9a-fA-F]{8})$/,
  };
  
  function parse255(str) {
    var int = parseInt(str, 10);
    if (int < 0) {
      return 0;
    }
    if (int > 255) {
      return 255;
    }
    return int;
  }
  
  function parse360(str) {
    var int = parseFloat(str);
    return (((int % 360) + 360) % 360) / 360;
  }
  
  function parse1(str) {
    var num = parseFloat(str);
    if (num < 0) {
      return 0;
    }
    if (num > 1) {
      return 255;
    }
    return Math.round(num * 255);
  }
  
  function parsePercentage(str) {
    // parseFloat conveniently ignores the final %
    var int = parseFloat(str, 10);
    if (int < 0) {
      return 0;
    }
    if (int > 100) {
      return 1;
    }
    return int / 100;
  }
  
  var names = {
    transparent: 0x00000000,
  
    // http://www.w3.org/TR/css3-color/#svg-color
    aliceblue: 0xf0f8ffff,
    antiquewhite: 0xfaebd7ff,
    aqua: 0x00ffffff,
    aquamarine: 0x7fffd4ff,
    azure: 0xf0ffffff,
    beige: 0xf5f5dcff,
    bisque: 0xffe4c4ff,
    black: 0x000000ff,
    blanchedalmond: 0xffebcdff,
    blue: 0x0000ffff,
    blueviolet: 0x8a2be2ff,
    brown: 0xa52a2aff,
    burlywood: 0xdeb887ff,
    burntsienna: 0xea7e5dff,
    cadetblue: 0x5f9ea0ff,
    chartreuse: 0x7fff00ff,
    chocolate: 0xd2691eff,
    coral: 0xff7f50ff,
    cornflowerblue: 0x6495edff,
    cornsilk: 0xfff8dcff,
    crimson: 0xdc143cff,
    cyan: 0x00ffffff,
    darkblue: 0x00008bff,
    darkcyan: 0x008b8bff,
    darkgoldenrod: 0xb8860bff,
    darkgray: 0xa9a9a9ff,
    darkgreen: 0x006400ff,
    darkgrey: 0xa9a9a9ff,
    darkkhaki: 0xbdb76bff,
    darkmagenta: 0x8b008bff,
    darkolivegreen: 0x556b2fff,
    darkorange: 0xff8c00ff,
    darkorchid: 0x9932ccff,
    darkred: 0x8b0000ff,
    darksalmon: 0xe9967aff,
    darkseagreen: 0x8fbc8fff,
    darkslateblue: 0x483d8bff,
    darkslategray: 0x2f4f4fff,
    darkslategrey: 0x2f4f4fff,
    darkturquoise: 0x00ced1ff,
    darkviolet: 0x9400d3ff,
    deeppink: 0xff1493ff,
    deepskyblue: 0x00bfffff,
    dimgray: 0x696969ff,
    dimgrey: 0x696969ff,
    dodgerblue: 0x1e90ffff,
    firebrick: 0xb22222ff,
    floralwhite: 0xfffaf0ff,
    forestgreen: 0x228b22ff,
    fuchsia: 0xff00ffff,
    gainsboro: 0xdcdcdcff,
    ghostwhite: 0xf8f8ffff,
    gold: 0xffd700ff,
    goldenrod: 0xdaa520ff,
    gray: 0x808080ff,
    green: 0x008000ff,
    greenyellow: 0xadff2fff,
    grey: 0x808080ff,
    honeydew: 0xf0fff0ff,
    hotpink: 0xff69b4ff,
    indianred: 0xcd5c5cff,
    indigo: 0x4b0082ff,
    ivory: 0xfffff0ff,
    khaki: 0xf0e68cff,
    lavender: 0xe6e6faff,
    lavenderblush: 0xfff0f5ff,
    lawngreen: 0x7cfc00ff,
    lemonchiffon: 0xfffacdff,
    lightblue: 0xadd8e6ff,
    lightcoral: 0xf08080ff,
    lightcyan: 0xe0ffffff,
    lightgoldenrodyellow: 0xfafad2ff,
    lightgray: 0xd3d3d3ff,
    lightgreen: 0x90ee90ff,
    lightgrey: 0xd3d3d3ff,
    lightpink: 0xffb6c1ff,
    lightsalmon: 0xffa07aff,
    lightseagreen: 0x20b2aaff,
    lightskyblue: 0x87cefaff,
    lightslategray: 0x778899ff,
    lightslategrey: 0x778899ff,
    lightsteelblue: 0xb0c4deff,
    lightyellow: 0xffffe0ff,
    lime: 0x00ff00ff,
    limegreen: 0x32cd32ff,
    linen: 0xfaf0e6ff,
    magenta: 0xff00ffff,
    maroon: 0x800000ff,
    mediumaquamarine: 0x66cdaaff,
    mediumblue: 0x0000cdff,
    mediumorchid: 0xba55d3ff,
    mediumpurple: 0x9370dbff,
    mediumseagreen: 0x3cb371ff,
    mediumslateblue: 0x7b68eeff,
    mediumspringgreen: 0x00fa9aff,
    mediumturquoise: 0x48d1ccff,
    mediumvioletred: 0xc71585ff,
    midnightblue: 0x191970ff,
    mintcream: 0xf5fffaff,
    mistyrose: 0xffe4e1ff,
    moccasin: 0xffe4b5ff,
    navajowhite: 0xffdeadff,
    navy: 0x000080ff,
    oldlace: 0xfdf5e6ff,
    olive: 0x808000ff,
    olivedrab: 0x6b8e23ff,
    orange: 0xffa500ff,
    orangered: 0xff4500ff,
    orchid: 0xda70d6ff,
    palegoldenrod: 0xeee8aaff,
    palegreen: 0x98fb98ff,
    paleturquoise: 0xafeeeeff,
    palevioletred: 0xdb7093ff,
    papayawhip: 0xffefd5ff,
    peachpuff: 0xffdab9ff,
    peru: 0xcd853fff,
    pink: 0xffc0cbff,
    plum: 0xdda0ddff,
    powderblue: 0xb0e0e6ff,
    purple: 0x800080ff,
    rebeccapurple: 0x663399ff,
    red: 0xff0000ff,
    rosybrown: 0xbc8f8fff,
    royalblue: 0x4169e1ff,
    saddlebrown: 0x8b4513ff,
    salmon: 0xfa8072ff,
    sandybrown: 0xf4a460ff,
    seagreen: 0x2e8b57ff,
    seashell: 0xfff5eeff,
    sienna: 0xa0522dff,
    silver: 0xc0c0c0ff,
    skyblue: 0x87ceebff,
    slateblue: 0x6a5acdff,
    slategray: 0x708090ff,
    slategrey: 0x708090ff,
    snow: 0xfffafaff,
    springgreen: 0x00ff7fff,
    steelblue: 0x4682b4ff,
    tan: 0xd2b48cff,
    teal: 0x008080ff,
    thistle: 0xd8bfd8ff,
    tomato: 0xff6347ff,
    turquoise: 0x40e0d0ff,
    violet: 0xee82eeff,
    wheat: 0xf5deb3ff,
    white: 0xffffffff,
    whitesmoke: 0xf5f5f5ff,
    yellow: 0xffff00ff,
    yellowgreen: 0x9acd32ff,
  };
  
  function rgba(colorInt) {
    var r = Math.round(((colorInt & 0xff000000) >>> 24));
    var g = Math.round(((colorInt & 0x00ff0000) >>> 16));
    var b = Math.round(((colorInt & 0x0000ff00) >>> 8));
    var a = ((colorInt & 0x000000ff) >>> 0) / 255;
    return {
      r: r,
      g: g,
      b: b,
      a: a,
    };
  };
  
  normalizeColor.rgba = rgba;
  
  module.exports = normalizeColor;
  
  
  /***/ }),
  /* 18 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  Object.defineProperty(exports, "__esModule", {
      value: true
  });
  var FillType = exports.FillType = {
      Solid: 0,
      Gradient: 1,
      Pattern: 4,
      Noise: 5
  };
  
  var GradientType = exports.GradientType = {
      Linear: 0,
      Radial: 1,
      Circular: 2
  };
  
  var PatternFillType = exports.PatternFillType = {
      Tile: 0,
      Fill: 1,
      Stretch: 2,
      Fit: 3
  };
  
  var NoiseFillType = exports.NoiseFillType = {
      Original: 0,
      Black: 1,
      White: 2,
      Color: 3
  };
  
  var BorderLineCapsStyle = exports.BorderLineCapsStyle = {
      Butt: 0,
      Round: 1,
      Square: 2
  };
  
  var BorderLineJoinStyle = exports.BorderLineJoinStyle = {
      Miter: 0,
      Round: 1,
      Bevel: 2
  };
  
  var LineDecorationType = exports.LineDecorationType = {
      None: 0,
      OpenedArrow: 1,
      ClosedArrow: 2,
      Bar: 3
  };
  
  var BlurType = exports.BlurType = {
      GaussianBlur: 0,
      MotionBlur: 1,
      ZoomBlur: 2,
      BackgroundBlur: 3
  };
  
  var BorderPosition = exports.BorderPosition = {
      Center: 0,
      Inside: 1,
      Outside: 2
  };
  
  var MaskMode = exports.MaskMode = {
      Outline: 0,
      Alpha: 1
  };
  
  var BooleanOperation = exports.BooleanOperation = {
      None: -1,
      Union: 0,
      Subtract: 1,
      Intersect: 2,
      Difference: 3
  };
  
  var ExportOptionsFormat = exports.ExportOptionsFormat = {
      PNG: 'png',
      JPG: 'jpg',
      TIFF: 'tiff',
      PDF: 'pdf',
      EPS: 'eps',
      SVG: 'svg'
  };
  
  var BlendingMode = exports.BlendingMode = {
      Normal: 0,
      Darken: 1,
      Multiply: 2,
      ColorBurn: 3,
      Lighten: 4,
      Screen: 5,
      ColorDodge: 6,
      Overlay: 7,
      SoftLight: 8,
      HardLight: 9,
      Difference: 10,
      Exclusion: 11,
      Hue: 12,
      Saturation: 13,
      Color: 14,
      Luminosity: 15
  };
  
  var TextAlignment = exports.TextAlignment = {
      Left: 0,
      Right: 1,
      Center: 2,
      Justified: 3
  };
  
  var TextBehaviour = exports.TextBehaviour = {
      Auto: 0,
      Fixed: 1
  };
  
  var CurvePointMode = exports.CurvePointMode = {
      Straight: 1,
      Mirrored: 2,
      Disconnected: 4,
      Asymmetric: 3
  };
  
  /***/ }),
  /* 19 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(console) {
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  var _hashStyle = __webpack_require__(20);
  
  var _hashStyle2 = _interopRequireDefault(_hashStyle);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  
  // Font displayed if San Francisco fonts are not found
  var APPLE_BROKEN_SYSTEM_FONT = '.AppleSystemUIFont';
  
  // this borrows heavily from react-native's RCTFont class
  // thanks y'all
  // https://github.com/facebook/react-native/blob/master/React/Views/RCTFont.mm
  
  // taken from https://github.com/airbnb/react-sketchapp/blob/master/src/utils/findFont.js
  var FONT_STYLES = {
    normal: false,
    italic: true,
    oblique: true
  };
  
  var FONT_WEIGHTS = {
    normal: NSFontWeightRegular,
    bold: NSFontWeightBold,
    '100': NSFontWeightUltraLight,
    '200': NSFontWeightThin,
    '300': NSFontWeightLight,
    '400': NSFontWeightRegular,
    '500': NSFontWeightMedium,
    '600': NSFontWeightSemibold,
    '700': NSFontWeightBold,
    '800': NSFontWeightHeavy,
    '900': NSFontWeightBlack
  };
  
  var isItalicFont = function isItalicFont(font) {
    var traits = font.fontDescriptor().objectForKey(NSFontTraitsAttribute);
    var symbolicTraits = traits[NSFontSymbolicTrait].unsignedIntValue();
  
    return (symbolicTraits & NSFontItalicTrait) !== 0;
  };
  
  var isCondensedFont = function isCondensedFont(font) {
    var traits = font.fontDescriptor().objectForKey(NSFontTraitsAttribute);
    var symbolicTraits = traits[NSFontSymbolicTrait].unsignedIntValue();
  
    return (symbolicTraits & NSFontCondensedTrait) !== 0;
  };
  
  var weightOfFont = function weightOfFont(font) {
    var traits = font.fontDescriptor().objectForKey(NSFontTraitsAttribute);
  
    var weight = traits[NSFontWeightTrait].doubleValue();
  
    if (weight === 0.0) {
      var weights = Object.keys(FONT_WEIGHTS);
  
      for (var i = 0; i < weights.length; i += 1) {
        var w = weights[i];
  
        if (font.fontName().toLowerCase().endsWith(w)) {
          return FONT_WEIGHTS[w];
        }
      }
    }
  
    return weight;
  };
  
  var fontNamesForFamilyName = function fontNamesForFamilyName(familyName) {
    var manager = NSFontManager.sharedFontManager();
    var members = NSArray.arrayWithArray(manager.availableMembersOfFontFamily(familyName));
  
    var results = [];
  
    for (var i = 0; i < members.length; i += 1) {
      results.push(members[i][0]);
    }
  
    return results;
  };
  
  var useCache = true;
  var _cache = new Map();
  
  var getCached = function getCached(key) {
    if (!useCache) {
      return undefined;
    }
    return _cache.get(key);
  };
  
  var findFont = function findFont(style) {
    var cacheKey = (0, _hashStyle2['default'])(style);
  
    var font = getCached(cacheKey);
  
    if (font) {
      return font;
    }
    var defaultFontFamily = NSFont.systemFontOfSize(14).familyName();
    var defaultFontWeight = NSFontWeightRegular;
    var defaultFontSize = 14;
  
    var fontSize = style.fontSize ? style.fontSize : defaultFontSize;
    var fontWeight = style.fontWeight ? FONT_WEIGHTS[style.fontWeight] : defaultFontWeight;
    // Default to Helvetica if fonts are missing
    var familyName =
    // Must use two equals (==) for compatibility with Cocoascript
    // eslint-disable-next-line eqeqeq
    defaultFontFamily == APPLE_BROKEN_SYSTEM_FONT ? 'Helvetica' : defaultFontFamily;
    var isItalic = false;
    var isCondensed = false;
  
    if (style.fontFamily) {
      familyName = style.fontFamily;
    }
  
    if (style.fontStyle) {
      isItalic = FONT_STYLES[style.fontStyle] || false;
    }
  
    var didFindFont = false;
  
    // Handle system font as special case. This ensures that we preserve
    // the specific metrics of the standard system font as closely as possible.
    if (familyName === defaultFontFamily || familyName === 'System') {
      font = NSFont.systemFontOfSize_weight(fontSize, fontWeight);
  
      if (font) {
        didFindFont = true;
  
        if (isItalic || isCondensed) {
          var fontDescriptor = font.fontDescriptor();
          var symbolicTraits = fontDescriptor.symbolicTraits();
  
          if (isItalic) {
            symbolicTraits |= NSFontItalicTrait;
          }
  
          if (isCondensed) {
            symbolicTraits |= NSFontCondensedTrait;
          }
  
          fontDescriptor = fontDescriptor.fontDescriptorWithSymbolicTraits(symbolicTraits);
          font = NSFont.fontWithDescriptor_size(fontDescriptor, fontSize);
        }
      }
    }
  
    var fontNames = fontNamesForFamilyName(familyName);
  
    // Gracefully handle being given a font name rather than font family, for
    // example: "Helvetica Light Oblique" rather than just "Helvetica".
    if (!didFindFont && fontNames.length === 0) {
      font = NSFont.fontWithName_size(familyName, fontSize);
      if (font) {
        // It's actually a font name, not a font family name,
        // but we'll do what was meant, not what was said.
        familyName = font.familyName();
        fontWeight = style.fontWeight ? fontWeight : weightOfFont(font);
        isItalic = style.fontStyle ? isItalic : isItalicFont(font);
        isCondensed = isCondensedFont(font);
      } else {
        console.log('Unrecognized font family \'' + String(familyName) + '\'');
        font = NSFont.systemFontOfSize_weight(fontSize, fontWeight);
      }
    }
  
    // Get the closest font that matches the given weight for the fontFamily
    var closestWeight = Infinity;
  
    for (var i = 0; i < fontNames.length; i += 1) {
      var match = NSFont.fontWithName_size(fontNames[i], fontSize);
  
      if (isItalic === isItalicFont(match) && isCondensed === isCondensedFont(match)) {
        var testWeight = weightOfFont(match);
  
        if (Math.abs(testWeight - fontWeight) < Math.abs(closestWeight - fontWeight)) {
          font = match;
  
          closestWeight = testWeight;
        }
      }
    }
  
    // If we still don't have a match at least return the first font in the fontFamily
    // This is to support built-in font Zapfino and other custom single font families like Impact
    if (!font) {
      if (fontNames.length > 0) {
        font = NSFont.fontWithName_size(fontNames[0], fontSize);
      }
    }
  
    // TODO(gold): support opentype features: small-caps & number types
  
    if (font) {
      _cache.set(cacheKey, font);
    }
  
    return font;
  };
  
  exports['default'] = findFont;
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
  
  /***/ }),
  /* 20 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports['default'] = hashStyle;
  
  var _murmur2js = __webpack_require__(21);
  
  var _murmur2js2 = _interopRequireDefault(_murmur2js);
  
  var _sortObjectKeys = __webpack_require__(22);
  
  var _sortObjectKeys2 = _interopRequireDefault(_sortObjectKeys);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  
  function hashStyle(obj) {
    return obj ? (0, _murmur2js2['default'])(JSON.stringify((0, _sortObjectKeys2['default'])(obj))) : 0;
  }
  
  /***/ }),
  /* 21 */
  /***/ (function(module, exports) {
  
  /**
   * JS Implementation of MurmurHash2
   *
   * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
   * @see http://github.com/garycourt/murmurhash-js
   * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
   * @see http://sites.google.com/site/murmurhash/
   *
   * @param {string} str ASCII only
   * @return {int} hash result
   */
  module.exports = function murmur2js(str) {
    var l = str.length;
    var h = l;
    var i = 0;
    var k;
  
    while (l >= 4) {
      k = ((str.charCodeAt(i) & 0xff)) |
        ((str.charCodeAt(++i) & 0xff) << 8) |
        ((str.charCodeAt(++i) & 0xff) << 16) |
        ((str.charCodeAt(++i) & 0xff) << 24);
  
      k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16));
      k ^= k >>> 24;
      k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16));
  
      h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)) ^ k;
  
      l -= 4;
      ++i;
    }
  
    switch (l) {
      case 3: h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
      case 2: h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
      case 1: h ^= (str.charCodeAt(i) & 0xff);
        h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16));
    }
  
    h ^= h >>> 13;
    h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16));
    h ^= h >>> 15;
  
    return h >>> 0;
  };
  
  
  /***/ }),
  /* 22 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  
  var sortObjectKeys = function sortObjectKeys(obj) {
    var keys = Object.keys(obj).sort();
  
    return keys.reduce(function (acc, key) {
      return Object.assign({}, acc, _defineProperty({}, key, obj[key]));
    }, {});
  };
  
  exports["default"] = sortObjectKeys;
  
  /***/ }),
  /* 23 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports['default'] = getSketchVersion;
  function getSketchVersion() {
    if (typeof NSBundle !== 'undefined') {
      return parseFloat(NSBundle.mainBundle().infoDictionary().CFBundleShortVersionString);
    }
    return 0;
  }
  
  /***/ }),
  /* 24 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports['default'] = fixBitmapLayer;
  
  var _fixImageFill = __webpack_require__(5);
  
  function fixBitmapLayer(layer) {
    (0, _fixImageFill.fixImageFill)(layer, layer);
  }
  
  /***/ }),
  /* 25 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(console) {
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports['default'] = zoomToFit;
  function _getCurrentView(doc) {
    if (doc.currentView) {
      return doc.currentView();
    } else if (doc.contentDrawView) {
      return doc.contentDrawView();
    }
    console.log('zoomToFit: can not get the currentView');
    return null;
  }
  
  function zoomToFit(context) {
    var doc = context.document;
    var page = doc.currentPage();
    var layers = page.layers();
    var view = _getCurrentView(doc);
  
    var rect = layers.reduce(function (result, layer) {
      var frame = layer.frame();
      var minX = frame.x();
      var minY = frame.y();
      var maxX = frame.x() + frame.width();
      var maxY = frame.y() + frame.height();
  
      if (result === null) {
        return {
          minX: minX,
          minY: minY,
          maxX: maxX,
          maxY: maxY
        };
      }
  
      if (minX < result.minX) {
        result.minX = minX;
      }
      if (minY < result.minY) {
        result.minY = minY;
      }
      if (maxX > result.maxX) {
        result.maxX = maxX;
      }
      if (maxY > result.maxY) {
        result.maxY = maxY;
      }
  
      return result;
    }, null);
  
    if (!rect) {
      return;
    }
  
    var x = rect.minX;
    var y = rect.minY;
    var width = rect.maxX - rect.minX;
    var height = rect.maxY - rect.minY;
  
    view.zoomToFitRect(NSMakeRect(x, y, width, height));
  }
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
  
  /***/ })
  /******/ ]);
    if (key === 'default' && typeof exports === 'function') {
      exports(context);
    } else {
      exports[key](context);
    }
  }
  that['onRun'] = __skpm_run.bind(this, 'default')
  