module.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, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// 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 = "lib/leaflet/";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 522);
/******/ })
/************************************************************************/
/******/ ({

/***/ 0:
/***/ (function(module, exports) {

module.exports = require("@babel/runtime/helpers/interopRequireDefault");

/***/ }),

/***/ 10:
/***/ (function(module, exports) {

module.exports = require("vue");

/***/ }),

/***/ 11:
/***/ (function(module, exports) {

module.exports = require("vue-property-decorator");

/***/ }),

/***/ 14:
/***/ (function(module, exports) {

module.exports = require("@babel/runtime/helpers/createClass");

/***/ }),

/***/ 20:
/***/ (function(module, exports) {

module.exports = require("@supermap/vue-iclient-leaflet/lib/_utils/global-event.js");

/***/ }),

/***/ 246:
/***/ (function(module, exports) {

module.exports = require("@supermap/vue-iclient-leaflet/lib/_utils/style/color/serialColors.js");

/***/ }),

/***/ 522:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _interopRequireDefault = __webpack_require__(0);

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _createClass2 = _interopRequireDefault(__webpack_require__(14));

var _inheritsLoose2 = _interopRequireDefault(__webpack_require__(6));

var _vue = _interopRequireDefault(__webpack_require__(10));

var _vuePropertyDecorator = __webpack_require__(11);

var _globalEvent = _interopRequireDefault(__webpack_require__(20));

var _util = __webpack_require__(9);

var _serialColors = __webpack_require__(246);

var __decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
  var c = arguments.length,
      r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
      d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
    if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  }
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};

var Theme_1;

var Theme = Theme_1 = /*#__PURE__*/function (_Vue) {
  (0, _inheritsLoose2.default)(Theme, _Vue);

  function Theme() {
    var _this;

    _this = _Vue.apply(this, arguments) || this;
    _this.backgroundData = '';
    _this.textColorsData = '';
    _this.collapseCardBackgroundData = '';
    _this.collapseCardHeaderBgData = '';
    _this.subComponentSpanBgData = '';
    _this.tablePopupBgData = '';
    _this.colorGroupsData = [];
    _this.themeStyleName = [];
    return _this;
  }

  var _proto = Theme.prototype;

  _proto.themeStyleChanged = function themeStyleChanged(value) {
    return value;
  };

  _proto.created = function created() {
    this.initThemeData();
    this.registerPropListener();
  };

  _proto.mounted = function mounted() {
    _globalEvent.default.$on('change-theme', this.changeThemeCallback);
  };

  _proto.beforeDestroy = function beforeDestroy() {
    _globalEvent.default.$off('change-theme', this.changeThemeCallback);
  };

  _proto.changeThemeCallback = function changeThemeCallback(themeStyle) {
    this.setDataRelatedProps(themeStyle, true);

    if ('background' in themeStyle) {
      this.setDataRelatedWithBackgound('', themeStyle);
    }

    this.themeStyleChanged();
    this.initNeedTheme(themeStyle);
  };

  _proto.initThemeData = function initThemeData() {
    this.setDataRelatedProps();
    this.setDataRelatedWithBackgound(this.background);
  };

  _proto.initNeedTheme = function initNeedTheme(themeStyle) {
    var _this2 = this;

    this.themeStyleName.forEach(function (name) {
      if (name === 'primaryColor') {
        _this2[name] = themeStyle.colorGroup && themeStyle.colorGroup[0];
      } else {
        _this2[name] = _this2.getRealColor(name, themeStyle);
      }
    });
  };

  _proto.registerPropListener = function registerPropListener() {
    var _this3 = this;

    var vm = this;
    var $props = this.getSelfProps();
    $props.forEach(function (prop) {
      _this3.$watch(prop, function (next) {
        var dataName = this.getDataNameOfProp(prop);
        vm[dataName] = next || this.getRealColor(prop);

        if (prop === 'background') {
          vm.setDataRelatedWithBackgound(next);
        }
      });
    });
  };

  _proto.setDataRelatedProps = function setDataRelatedProps(themeStyle, themePriority) {
    var _this4 = this;

    var themeStyleData = themeStyle || _globalEvent.default.$options.theme || {};
    var $props = this.getSelfProps();
    $props.forEach(function (prop) {
      if (prop in themeStyleData) {
        var dataName = _this4.getDataNameOfProp(prop);

        var propValue = themePriority ? '' : _this4[prop];
        _this4[dataName] = propValue || _this4.getRealColor(prop, themeStyle);
      }
    });
  };

  _proto.setDataRelatedWithBackgound = function setDataRelatedWithBackgound(background, themeStyle) {
    this.collapseCardHeaderBgData = background || this.getRealColor('collapseCardHeaderBg', themeStyle);
    this.subComponentSpanBgData = background || this.getRealColor('subComponentSpanBg', themeStyle);
    this.collapseCardBackgroundData = background || this.getRealColor('collapseCardBackground', themeStyle);
    this.tablePopupBgData = background || this.getRealColor('messageBackground', themeStyle);
  };

  _proto.getSelfProps = function getSelfProps() {
    return Object.keys(Theme_1.extendOptions.props);
  };

  _proto.getRealColor = function getRealColor(prop, acceptThemeStyle) {
    var themeStyle = acceptThemeStyle || _globalEvent.default.$options.theme || {};

    if (prop === 'colorGroup' || !themeStyle[prop] || !themeStyle[prop].includes('var')) {
      return themeStyle[prop];
    }

    var rootStyleSelector = (0, _serialColors.getRootStyleSelector)(themeStyle);
    var computedStyle = window.getComputedStyle(document.querySelector(rootStyleSelector));
    var themeColor = themeStyle[prop].replace(/var\((.+)\)/g, '$1');
    var colorValue = computedStyle.getPropertyValue(themeColor);
    return colorValue.trim();
  };

  _proto.getDataNameOfProp = function getDataNameOfProp(prop) {
    switch (prop) {
      case 'textColor':
        return 'textColorsData';

      case 'colorGroup':
        return 'colorGroupsData';

      default:
        return prop + "Data";
    }
  };

  _proto.render = function render(h) {
    return h('template', null);
  };

  (0, _createClass2.default)(Theme, [{
    key: "getBackgroundStyle",
    get: function get() {
      return {
        background: this.backgroundData
      };
    }
  }, {
    key: "collapseCardBackgroundStyle",
    get: function get() {
      return {
        background: this.collapseCardBackgroundData
      };
    }
  }, {
    key: "collapseCardBackgroundLightStyle",
    get: function get() {
      return {
        background: (0, _serialColors.getPrimarySerialColors)({
          colorGroup: [this.collapseCardBackgroundData]
        })[2]
      };
    }
  }, {
    key: "collapseCardHeaderBgStyle",
    get: function get() {
      return {
        background: this.collapseCardHeaderBgData
      };
    }
  }, {
    key: "subComponentSpanBgStyle",
    get: function get() {
      return {
        background: this.subComponentSpanBgData
      };
    }
  }, {
    key: "tablePopupBgStyle",
    get: function get() {
      return {
        background: this.tablePopupBgData
      };
    }
  }, {
    key: "getTextColorStyle",
    get: function get() {
      return {
        color: this.textColorsData
      };
    }
  }, {
    key: "headingTextColorStyle",
    get: function get() {
      return {
        color: (0, _util.getDerivedColorsByTextColor)(this.textColorsData, 0.85)
      };
    }
  }, {
    key: "secondaryTextColorStyle",
    get: function get() {
      return {
        color: (0, _util.getDerivedColorsByTextColor)(this.textColorsData, 0.45)
      };
    }
  }, {
    key: "disabledTextColorStyle",
    get: function get() {
      return {
        color: (0, _util.getDerivedColorsByTextColor)(this.textColorsData, 0.25)
      };
    }
  }, {
    key: "getBackground",
    get: function get() {
      return this.backgroundData;
    }
  }, {
    key: "getTextColor",
    get: function get() {
      return this.textColorsData;
    }
  }, {
    key: "getColorStyle",
    get: function get() {
      return function (index) {
        return {
          color: this.colorGroupsData[index]
        };
      };
    }
  }, {
    key: "getColor",
    get: function get() {
      return function (index) {
        return this.colorGroupsData[index];
      };
    }
  }]);
  return Theme;
}(_vue.default);

__decorate([(0, _vuePropertyDecorator.Prop)()], Theme.prototype, "background", void 0);

__decorate([(0, _vuePropertyDecorator.Prop)()], Theme.prototype, "textColor", void 0);

__decorate([(0, _vuePropertyDecorator.Prop)()], Theme.prototype, "colorGroup", void 0);

__decorate([(0, _vuePropertyDecorator.Emit)()], Theme.prototype, "themeStyleChanged", null);

Theme = Theme_1 = __decorate([(0, _vuePropertyDecorator.Component)({
  name: 'Theme'
})], Theme);
var _default = Theme;
exports.default = _default;

/***/ }),

/***/ 6:
/***/ (function(module, exports) {

module.exports = require("@babel/runtime/helpers/inheritsLoose");

/***/ }),

/***/ 9:
/***/ (function(module, exports) {

module.exports = require("@supermap/vue-iclient-leaflet/lib/_utils/util.js");

/***/ })

/******/ });