/******/ (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 = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 9); /******/ }) /************************************************************************/ /******/ ([ /* 0 */, /* 1 */, /* 2 */, /* 3 */, /* 4 */, /* 5 */, /* 6 */, /* 7 */, /* 8 */, /* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(10); __webpack_require__(109); /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(wp) { var _pick2 = __webpack_require__(12); var _pick3 = _interopRequireDefault(_pick2); var _isEmpty2 = __webpack_require__(90); var _isEmpty3 = _interopRequireDefault(_isEmpty2); var _classnames7 = __webpack_require__(108); var _classnames8 = _interopRequireDefault(_classnames7); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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; } /** * BLOCK: split-block * * Registering a basic test block with Gutenberg. */ /** * External Dependencies */ /** * WordPress dependencies */ var _wp$i18n = wp.i18n, __ = _wp$i18n.__, sprintf = _wp$i18n.sprintf; var registerBlockType = wp.blocks.registerBlockType; var _wp$editor = wp.editor, InnerBlocks = _wp$editor.InnerBlocks, MediaUpload = _wp$editor.MediaUpload, ImagePlaceholder = _wp$editor.ImagePlaceholder, BlockControls = _wp$editor.BlockControls, InspectorControls = _wp$editor.InspectorControls, RichText = _wp$editor.RichText, ColorPalette = _wp$editor.ColorPalette, ContrastChecker = _wp$editor.ContrastChecker, BlockAlignmentToolbar = _wp$editor.BlockAlignmentToolbar, getColorClass = _wp$editor.getColorClass, withColors = _wp$editor.withColors; var compose = wp.element.compose; var _wp$components = wp.components, Button = _wp$components.Button, IconButton = _wp$components.IconButton, PanelBody = _wp$components.PanelBody, PanelColor = _wp$components.PanelColor, RangeControl = _wp$components.RangeControl, ToggleControl = _wp$components.ToggleControl, Toolbar = _wp$components.Toolbar, withState = _wp$components.withState; var blockAttributes = { url: { type: 'string' }, id: { type: 'number' }, alt: { type: 'string' }, splitAlign: { type: 'string', default: 'left' }, headlineContent: { type: 'array', source: 'children', selector: 'h1,h2,h3,h4,h5,h6', default: [] }, headlineNodeName: { type: 'string', source: 'property', selector: 'h1,h2,h3,h4,h5,h6', property: 'nodeName', default: 'H2' }, content: { type: 'array', source: 'children', selector: 'div.split-content-text', default: [] }, textColor: { type: 'string' }, customTextColor: { type: 'string' }, backgroundColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, alignment: { type: 'string' } }; var allowedBlockAligmnents = ['center', 'wide', 'full']; /** * Register: a Gutenberg Block. * * Registers a new block provided a unique name and an object defining its * behavior. Once registered, the block is made editor as an option to any * editor interface where blocks are implemented. * * @param {string} name Block name. * @param {Object} settings Block settings. * @return {?WPBlock} The block, if it has been successfully * registered; otherwise `undefined`. */ registerBlockType('agncy/split', { // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block. title: __('Split', 'agncy-js'), // Block title. description: __('A block to show an image on one side and text on the other side.', 'agncy-js'), icon: 'forms', // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/. category: 'common', // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed. keywords: [__('agncy', 'agncy-js'), __('split', 'agncy-js')], attributes: blockAttributes, getEditWrapperProps: function getEditWrapperProps(attributes) { var alignment = attributes.alignment; if ('wide' === alignment || 'full' === alignment) { return { 'data-align': alignment }; } }, // The "edit" property must be a valid function. edit: compose(withState({ editable: 'heading' }), withColors(function (getColor, setColor, _ref) { var attributes = _ref.attributes, setAttributes = _ref.setAttributes; return { backgroundColor: getColor(attributes.backgroundColor, attributes.customBackgroundColor, 'background-color'), setBackgroundColor: setColor('backgroundColor', 'customBackgroundColor', setAttributes), textColor: getColor(attributes.textColor, attributes.customTextColor, 'color'), setTextColor: setColor('textColor', 'customTextColor', setAttributes) }; }))(function (_ref2) { var _classnames2, _classnames3; var attributes = _ref2.attributes, setAttributes = _ref2.setAttributes, isSelected = _ref2.isSelected, className = _ref2.className, editable = _ref2.editable, setState = _ref2.setState, backgroundColor = _ref2.backgroundColor, textColor = _ref2.textColor, setBackgroundColor = _ref2.setBackgroundColor, setTextColor = _ref2.setTextColor; var url = attributes.url, id = attributes.id, alt = attributes.alt, splitAlign = attributes.splitAlign, headlineNodeName = attributes.headlineNodeName, headlineContent = attributes.headlineContent, content = attributes.content, alignment = attributes.alignment; var hasUrl = !(0, _isEmpty3.default)(url); var onSelectImage = function onSelectImage(media) { return setAttributes((0, _pick3.default)(media, ['alt', 'id', 'url'])); }; var onSetActiveEditable = function onSetActiveEditable(newEditable) { return function () { return setState({ editable: newEditable }); }; }; var onChangeAlignment = function onChangeAlignment(newAlignment) { return setAttributes({ splitAlign: newAlignment }); }; var onChangeBlockAlignment = function onChangeBlockAlignment(newAlignment) { return setAttributes({ alignment: newAlignment }); }; var imagePlaceholder = React.createElement(ImagePlaceholder, { key: 'image-placeholder', icon: 'format-image', label: __('Image'), onSelectImage: onSelectImage }); var imgDisplay = imagePlaceholder; if (hasUrl) { var imgClassName = (0, _classnames8.default)("split-image", _defineProperty({}, 'wp-image-' + id, id)); var imgTag = React.createElement('img', { className: imgClassName, src: url, alt: alt }); imgDisplay = imgTag; } // Create the needed controls var controls = isSelected && [React.createElement( BlockControls, { key: 'controls' }, React.createElement(BlockAlignmentToolbar, { value: alignment, onChange: onChangeBlockAlignment, controls: allowedBlockAligmnents }), React.createElement( Toolbar, null, React.createElement(IconButton, { className: (0, _classnames8.default)('components-toolbar__control', { 'is-active': splitAlign === 'left' }), label: __('Image left', 'agncy-js'), icon: 'arrow-left', onClick: function onClick() { onChangeAlignment('left'); } }), React.createElement(IconButton, { className: (0, _classnames8.default)('components-toolbar__control', { 'is-active': splitAlign === 'right' }), label: __('Image right', 'agncy-js'), icon: 'arrow-right', onClick: function onClick() { onChangeAlignment('right'); } }) ), React.createElement(Toolbar, { controls: '234'.split('').map(function (level) { return { icon: 'heading', title: sprintf(__('Heading %s'), level), isActive: 'H' + level === headlineNodeName, onClick: function onClick() { return setAttributes({ headlineNodeName: 'H' + level }); }, subscript: level }; }) }), React.createElement( Toolbar, null, React.createElement(MediaUpload, { onSelect: onSelectImage, type: 'image', value: id, render: function render(_ref3) { var open = _ref3.open; return React.createElement(IconButton, { className: 'components-toolbar__control', label: __('Edit image', 'agncy-js'), icon: 'edit', onClick: open }); } }) ) ), React.createElement( InspectorControls, { key: 'inspector' }, React.createElement( PanelColor, { title: __('Background Color'), colorValue: backgroundColor.value, initialOpen: false }, React.createElement(ColorPalette, { value: backgroundColor.value, onChange: setBackgroundColor }) ), React.createElement( PanelColor, { title: __('Text Color'), colorValue: textColor.value, initialOpen: false }, React.createElement(ColorPalette, { value: textColor.value, onChange: setTextColor }) ) )]; var textClass = getColorClass('color', textColor); var backgroundClass = getColorClass('background-color', backgroundColor); var blockClassNames = (0, _classnames8.default)(className, (_classnames2 = {}, _defineProperty(_classnames2, 'is-split-' + splitAlign, splitAlign), _defineProperty(_classnames2, 'align' + alignment, alignment), _classnames2)); var contentClassNames = (0, _classnames8.default)('split-content-body', (_classnames3 = {}, _defineProperty(_classnames3, textColor.class, textColor.value), _defineProperty(_classnames3, backgroundColor.class, backgroundColor.value), _classnames3)); var blockStyles = { backgroundColor: backgroundClass ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor }; // Creates the editor output return [controls, React.createElement( 'div', { className: blockClassNames }, React.createElement( 'div', { 'class': 'split-content-image' }, imgDisplay ), React.createElement( 'div', { className: contentClassNames, style: blockStyles }, React.createElement(RichText, { key: 'editable', wrapperClassName: 'split-content-heading', tagName: headlineNodeName.toLowerCase(), value: headlineContent, onChange: function onChange(value) { return setAttributes({ headlineContent: value }); }, placeholder: __('Heading…', 'agncy-js'), isSelected: isSelected && editable === 'heading', onFocus: onSetActiveEditable('heading') }), React.createElement(RichText, { key: 'editable', wrapperClassName: 'split-content-text', tagName: 'div', multiline: 'p', value: content, onChange: function onChange(value) { return setAttributes({ content: value }); }, placeholder: __('Content…', 'agncy-js'), isSelected: isSelected && editable === 'content', onFocus: onSetActiveEditable('content') }) ) )]; }), // The "save" property must be specified and must be a valid function. save: function save(_ref4) { var _classnames5, _classnames6; var attributes = _ref4.attributes, setAttributes = _ref4.setAttributes, isSelected = _ref4.isSelected, className = _ref4.className; var content = attributes.content, headlineUrl = attributes.headlineUrl, url = attributes.url, alt = attributes.alt, id = attributes.id, splitAlign = attributes.splitAlign, headlineContent = attributes.headlineContent, headlineNodeName = attributes.headlineNodeName, alignment = attributes.alignment, backgroundColor = attributes.backgroundColor, textColor = attributes.textColor, customBackgroundColor = attributes.customBackgroundColor, customTextColor = attributes.customTextColor; var hasUrl = !(0, _isEmpty3.default)(url); var imgTag = null; if (hasUrl) { var imgClassName = (0, _classnames8.default)("split-image", _defineProperty({}, 'wp-image-' + id, id)); imgTag = React.createElement('img', { className: imgClassName, src: url, alt: alt }); } var textClass = getColorClass('color', textColor); var backgroundClass = getColorClass('background-color', backgroundColor); var blockClassNames = (0, _classnames8.default)(className, (_classnames5 = {}, _defineProperty(_classnames5, 'is-split-' + splitAlign, splitAlign), _defineProperty(_classnames5, 'align' + alignment, alignment), _classnames5)); var contentClassNames = (0, _classnames8.default)('split-content-body', (_classnames6 = {}, _defineProperty(_classnames6, textClass, textClass), _defineProperty(_classnames6, backgroundClass, backgroundClass), _classnames6)); var blockStyles = { backgroundColor: backgroundClass ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor }; var Tag = headlineNodeName.toLowerCase(); return React.createElement( 'div', { className: blockClassNames, style: blockStyles }, React.createElement( 'div', { 'class': 'split-content-image' }, imgTag ), React.createElement( 'div', { className: contentClassNames }, React.createElement( Tag, { 'class': 'split-content-heading' }, headlineContent ), React.createElement( 'div', { 'class': 'split-content-text' }, content ) ) ); } }); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(11))) /***/ }), /* 11 */ /***/ (function(module, exports) { module.exports = wp; /***/ }), /* 12 */ /***/ (function(module, exports, __webpack_require__) { var basePick = __webpack_require__(13), flatRest = __webpack_require__(78); /** * Creates an object composed of the picked `object` properties. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ var pick = flatRest(function(object, paths) { return object == null ? {} : basePick(object, paths); }); module.exports = pick; /***/ }), /* 13 */ /***/ (function(module, exports, __webpack_require__) { var basePickBy = __webpack_require__(14), hasIn = __webpack_require__(72); /** * The base implementation of `_.pick` without support for individual * property identifiers. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @returns {Object} Returns the new object. */ function basePick(object, paths) { return basePickBy(object, paths, function(value, path) { return hasIn(object, path); }); } module.exports = basePick; /***/ }), /* 14 */ /***/ (function(module, exports, __webpack_require__) { var baseGet = __webpack_require__(15), baseSet = __webpack_require__(67), castPath = __webpack_require__(16); /** * The base implementation of `_.pickBy` without support for iteratee shorthands. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @param {Function} predicate The function invoked per property. * @returns {Object} Returns the new object. */ function basePickBy(object, paths, predicate) { var index = -1, length = paths.length, result = {}; while (++index < length) { var path = paths[index], value = baseGet(object, path); if (predicate(value, path)) { baseSet(result, castPath(path, object), value); } } return result; } module.exports = basePickBy; /***/ }), /* 15 */ /***/ (function(module, exports, __webpack_require__) { var castPath = __webpack_require__(16), toKey = __webpack_require__(66); /** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. */ function baseGet(object, path) { path = castPath(path, object); var index = 0, length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return (index && index == length) ? object : undefined; } module.exports = baseGet; /***/ }), /* 16 */ /***/ (function(module, exports, __webpack_require__) { var isArray = __webpack_require__(17), isKey = __webpack_require__(18), stringToPath = __webpack_require__(28), toString = __webpack_require__(63); /** * Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. * @param {Object} [object] The object to query keys on. * @returns {Array} Returns the cast property path array. */ function castPath(value, object) { if (isArray(value)) { return value; } return isKey(value, object) ? [value] : stringToPath(toString(value)); } module.exports = castPath; /***/ }), /* 17 */ /***/ (function(module, exports) { /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; module.exports = isArray; /***/ }), /* 18 */ /***/ (function(module, exports, __webpack_require__) { var isArray = __webpack_require__(17), isSymbol = __webpack_require__(19); /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/; /** * Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { if (isArray(value)) { return false; } var type = typeof value; if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object)); } module.exports = isKey; /***/ }), /* 19 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(20), isObjectLike = __webpack_require__(27); /** `Object#toString` result references. */ var symbolTag = '[object Symbol]'; /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || (isObjectLike(value) && baseGetTag(value) == symbolTag); } module.exports = isSymbol; /***/ }), /* 20 */ /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(21), getRawTag = __webpack_require__(25), objectToString = __webpack_require__(26); /** `Object#toString` result references. */ var nullTag = '[object Null]', undefinedTag = '[object Undefined]'; /** Built-in value references. */ var symToStringTag = Symbol ? Symbol.toStringTag : undefined; /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag && symToStringTag in Object(value)) ? getRawTag(value) : objectToString(value); } module.exports = baseGetTag; /***/ }), /* 21 */ /***/ (function(module, exports, __webpack_require__) { var root = __webpack_require__(22); /** Built-in value references. */ var Symbol = root.Symbol; module.exports = Symbol; /***/ }), /* 22 */ /***/ (function(module, exports, __webpack_require__) { var freeGlobal = __webpack_require__(23); /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); module.exports = root; /***/ }), /* 23 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; module.exports = freeGlobal; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(24))) /***/ }), /* 24 */ /***/ (function(module, exports) { var g; // This works in non-strict mode g = (function() { return this; })(); try { // This works if eval is allowed (see CSP) g = g || Function("return this")() || (1, eval)("this"); } catch (e) { // This works if the window reference is available if (typeof window === "object") g = window; } // g can still be undefined, but nothing to do about it... // We return undefined, instead of nothing here, so it's // easier to handle this case. if(!global) { ...} module.exports = g; /***/ }), /* 25 */ /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(21); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Built-in value references. */ var symToStringTag = Symbol ? Symbol.toStringTag : undefined; /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; var unmasked = true; } catch (e) {} var result = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } module.exports = getRawTag; /***/ }), /* 26 */ /***/ (function(module, exports) { /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } module.exports = objectToString; /***/ }), /* 27 */ /***/ (function(module, exports) { /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } module.exports = isObjectLike; /***/ }), /* 28 */ /***/ (function(module, exports, __webpack_require__) { var memoizeCapped = __webpack_require__(29); /** Used to match property names within property paths. */ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ var stringToPath = memoizeCapped(function(string) { var result = []; if (string.charCodeAt(0) === 46 /* . */) { result.push(''); } string.replace(rePropName, function(match, number, quote, subString) { result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); }); return result; }); module.exports = stringToPath; /***/ }), /* 29 */ /***/ (function(module, exports, __webpack_require__) { var memoize = __webpack_require__(30); /** Used as the maximum memoize cache size. */ var MAX_MEMOIZE_SIZE = 500; /** * A specialized version of `_.memoize` which clears the memoized function's * cache when it exceeds `MAX_MEMOIZE_SIZE`. * * @private * @param {Function} func The function to have its output memoized. * @returns {Function} Returns the new memoized function. */ function memoizeCapped(func) { var result = memoize(func, function(key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key; }); var cache = result.cache; return result; } module.exports = memoizeCapped; /***/ }), /* 30 */ /***/ (function(module, exports, __webpack_require__) { var MapCache = __webpack_require__(31); /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function'; /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `clear`, `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */ function memoize(func, resolver) { if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result) || cache; return result; }; memoized.cache = new (memoize.Cache || MapCache); return memoized; } // Expose `MapCache`. memoize.Cache = MapCache; module.exports = memoize; /***/ }), /* 31 */ /***/ (function(module, exports, __webpack_require__) { var mapCacheClear = __webpack_require__(32), mapCacheDelete = __webpack_require__(57), mapCacheGet = __webpack_require__(60), mapCacheHas = __webpack_require__(61), mapCacheSet = __webpack_require__(62); /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `MapCache`. MapCache.prototype.clear = mapCacheClear; MapCache.prototype['delete'] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; module.exports = MapCache; /***/ }), /* 32 */ /***/ (function(module, exports, __webpack_require__) { var Hash = __webpack_require__(33), ListCache = __webpack_require__(48), Map = __webpack_require__(56); /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.size = 0; this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; } module.exports = mapCacheClear; /***/ }), /* 33 */ /***/ (function(module, exports, __webpack_require__) { var hashClear = __webpack_require__(34), hashDelete = __webpack_require__(44), hashGet = __webpack_require__(45), hashHas = __webpack_require__(46), hashSet = __webpack_require__(47); /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `Hash`. Hash.prototype.clear = hashClear; Hash.prototype['delete'] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; module.exports = Hash; /***/ }), /* 34 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(35); /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } module.exports = hashClear; /***/ }), /* 35 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(36); /* Built-in method references that are verified to be native. */ var nativeCreate = getNative(Object, 'create'); module.exports = nativeCreate; /***/ }), /* 36 */ /***/ (function(module, exports, __webpack_require__) { var baseIsNative = __webpack_require__(37), getValue = __webpack_require__(43); /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } module.exports = getNative; /***/ }), /* 37 */ /***/ (function(module, exports, __webpack_require__) { var isFunction = __webpack_require__(38), isMasked = __webpack_require__(40), isObject = __webpack_require__(39), toSource = __webpack_require__(42); /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used for built-in method references. */ var funcProto = Function.prototype, objectProto = Object.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } module.exports = baseIsNative; /***/ }), /* 38 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(20), isObject = __webpack_require__(39); /** `Object#toString` result references. */ var asyncTag = '[object AsyncFunction]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', proxyTag = '[object Proxy]'; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } module.exports = isFunction; /***/ }), /* 39 */ /***/ (function(module, exports) { /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } module.exports = isObject; /***/ }), /* 40 */ /***/ (function(module, exports, __webpack_require__) { var coreJsData = __webpack_require__(41); /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } module.exports = isMasked; /***/ }), /* 41 */ /***/ (function(module, exports, __webpack_require__) { var root = __webpack_require__(22); /** Used to detect overreaching core-js shims. */ var coreJsData = root['__core-js_shared__']; module.exports = coreJsData; /***/ }), /* 42 */ /***/ (function(module, exports) { /** Used for built-in method references. */ var funcProto = Function.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** * Converts `func` to its source code. * * @private * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } module.exports = toSource; /***/ }), /* 43 */ /***/ (function(module, exports) { /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } module.exports = getValue; /***/ }), /* 44 */ /***/ (function(module, exports) { /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { var result = this.has(key) && delete this.__data__[key]; this.size -= result ? 1 : 0; return result; } module.exports = hashDelete; /***/ }), /* 45 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(35); /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } return hasOwnProperty.call(data, key) ? data[key] : undefined; } module.exports = hashGet; /***/ }), /* 46 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(35); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } module.exports = hashHas; /***/ }), /* 47 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(35); /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } module.exports = hashSet; /***/ }), /* 48 */ /***/ (function(module, exports, __webpack_require__) { var listCacheClear = __webpack_require__(49), listCacheDelete = __webpack_require__(50), listCacheGet = __webpack_require__(53), listCacheHas = __webpack_require__(54), listCacheSet = __webpack_require__(55); /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; module.exports = ListCache; /***/ }), /* 49 */ /***/ (function(module, exports) { /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; this.size = 0; } module.exports = listCacheClear; /***/ }), /* 50 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(51); /** Used for built-in method references. */ var arrayProto = Array.prototype; /** Built-in value references. */ var splice = arrayProto.splice; /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } module.exports = listCacheDelete; /***/ }), /* 51 */ /***/ (function(module, exports, __webpack_require__) { var eq = __webpack_require__(52); /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } module.exports = assocIndexOf; /***/ }), /* 52 */ /***/ (function(module, exports) { /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } module.exports = eq; /***/ }), /* 53 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(51); /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } module.exports = listCacheGet; /***/ }), /* 54 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(51); /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } module.exports = listCacheHas; /***/ }), /* 55 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(51); /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } module.exports = listCacheSet; /***/ }), /* 56 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(36), root = __webpack_require__(22); /* Built-in method references that are verified to be native. */ var Map = getNative(root, 'Map'); module.exports = Map; /***/ }), /* 57 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(58); /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { var result = getMapData(this, key)['delete'](key); this.size -= result ? 1 : 0; return result; } module.exports = mapCacheDelete; /***/ }), /* 58 */ /***/ (function(module, exports, __webpack_require__) { var isKeyable = __webpack_require__(59); /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } module.exports = getMapData; /***/ }), /* 59 */ /***/ (function(module, exports) { /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); } module.exports = isKeyable; /***/ }), /* 60 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(58); /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return getMapData(this, key).get(key); } module.exports = mapCacheGet; /***/ }), /* 61 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(58); /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return getMapData(this, key).has(key); } module.exports = mapCacheHas; /***/ }), /* 62 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(58); /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { var data = getMapData(this, key), size = data.size; data.set(key, value); this.size += data.size == size ? 0 : 1; return this; } module.exports = mapCacheSet; /***/ }), /* 63 */ /***/ (function(module, exports, __webpack_require__) { var baseToString = __webpack_require__(64); /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {string} Returns the converted string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : baseToString(value); } module.exports = toString; /***/ }), /* 64 */ /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(21), arrayMap = __webpack_require__(65), isArray = __webpack_require__(17), isSymbol = __webpack_require__(19); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined; /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (isArray(value)) { // Recursively convert values (susceptible to call stack limits). return arrayMap(value, baseToString) + ''; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } module.exports = baseToString; /***/ }), /* 65 */ /***/ (function(module, exports) { /** * A specialized version of `_.map` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } module.exports = arrayMap; /***/ }), /* 66 */ /***/ (function(module, exports, __webpack_require__) { var isSymbol = __webpack_require__(19); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */ function toKey(value) { if (typeof value == 'string' || isSymbol(value)) { return value; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } module.exports = toKey; /***/ }), /* 67 */ /***/ (function(module, exports, __webpack_require__) { var assignValue = __webpack_require__(68), castPath = __webpack_require__(16), isIndex = __webpack_require__(71), isObject = __webpack_require__(39), toKey = __webpack_require__(66); /** * The base implementation of `_.set`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseSet(object, path, value, customizer) { if (!isObject(object)) { return object; } path = castPath(path, object); var index = -1, length = path.length, lastIndex = length - 1, nested = object; while (nested != null && ++index < length) { var key = toKey(path[index]), newValue = value; if (index != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined; if (newValue === undefined) { newValue = isObject(objValue) ? objValue : (isIndex(path[index + 1]) ? [] : {}); } } assignValue(nested, key, newValue); nested = nested[key]; } return object; } module.exports = baseSet; /***/ }), /* 68 */ /***/ (function(module, exports, __webpack_require__) { var baseAssignValue = __webpack_require__(69), eq = __webpack_require__(52); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } module.exports = assignValue; /***/ }), /* 69 */ /***/ (function(module, exports, __webpack_require__) { var defineProperty = __webpack_require__(70); /** * The base implementation of `assignValue` and `assignMergeValue` without * value checks. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function baseAssignValue(object, key, value) { if (key == '__proto__' && defineProperty) { defineProperty(object, key, { 'configurable': true, 'enumerable': true, 'value': value, 'writable': true }); } else { object[key] = value; } } module.exports = baseAssignValue; /***/ }), /* 70 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(36); var defineProperty = (function() { try { var func = getNative(Object, 'defineProperty'); func({}, '', {}); return func; } catch (e) {} }()); module.exports = defineProperty; /***/ }), /* 71 */ /***/ (function(module, exports) { /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == 'number' || (type != 'symbol' && reIsUint.test(value))) && (value > -1 && value % 1 == 0 && value < length); } module.exports = isIndex; /***/ }), /* 72 */ /***/ (function(module, exports, __webpack_require__) { var baseHasIn = __webpack_require__(73), hasPath = __webpack_require__(74); /** * Checks if `path` is a direct or inherited property of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.hasIn(object, 'a'); * // => true * * _.hasIn(object, 'a.b'); * // => true * * _.hasIn(object, ['a', 'b']); * // => true * * _.hasIn(object, 'b'); * // => false */ function hasIn(object, path) { return object != null && hasPath(object, path, baseHasIn); } module.exports = hasIn; /***/ }), /* 73 */ /***/ (function(module, exports) { /** * The base implementation of `_.hasIn` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHasIn(object, key) { return object != null && key in Object(object); } module.exports = baseHasIn; /***/ }), /* 74 */ /***/ (function(module, exports, __webpack_require__) { var castPath = __webpack_require__(16), isArguments = __webpack_require__(75), isArray = __webpack_require__(17), isIndex = __webpack_require__(71), isLength = __webpack_require__(77), toKey = __webpack_require__(66); /** * Checks if `path` exists on `object`. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @param {Function} hasFunc The function to check properties. * @returns {boolean} Returns `true` if `path` exists, else `false`. */ function hasPath(object, path, hasFunc) { path = castPath(path, object); var index = -1, length = path.length, result = false; while (++index < length) { var key = toKey(path[index]); if (!(result = object != null && hasFunc(object, key))) { break; } object = object[key]; } if (result || ++index != length) { return result; } length = object == null ? 0 : object.length; return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } module.exports = hasPath; /***/ }), /* 75 */ /***/ (function(module, exports, __webpack_require__) { var baseIsArguments = __webpack_require__(76), isObjectLike = __webpack_require__(27); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Built-in value references. */ var propertyIsEnumerable = objectProto.propertyIsEnumerable; /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); }; module.exports = isArguments; /***/ }), /* 76 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(20), isObjectLike = __webpack_require__(27); /** `Object#toString` result references. */ var argsTag = '[object Arguments]'; /** * The base implementation of `_.isArguments`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } module.exports = baseIsArguments; /***/ }), /* 77 */ /***/ (function(module, exports) { /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } module.exports = isLength; /***/ }), /* 78 */ /***/ (function(module, exports, __webpack_require__) { var flatten = __webpack_require__(79), overRest = __webpack_require__(83), setToString = __webpack_require__(85); /** * A specialized version of `baseRest` which flattens the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ function flatRest(func) { return setToString(overRest(func, undefined, flatten), func + ''); } module.exports = flatRest; /***/ }), /* 79 */ /***/ (function(module, exports, __webpack_require__) { var baseFlatten = __webpack_require__(80); /** * Flattens `array` a single level deep. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flatten([1, [2, [3, [4]], 5]]); * // => [1, 2, [3, [4]], 5] */ function flatten(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, 1) : []; } module.exports = flatten; /***/ }), /* 80 */ /***/ (function(module, exports, __webpack_require__) { var arrayPush = __webpack_require__(81), isFlattenable = __webpack_require__(82); /** * The base implementation of `_.flatten` with support for restricting flattening. * * @private * @param {Array} array The array to flatten. * @param {number} depth The maximum recursion depth. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. * @param {Array} [result=[]] The initial result value. * @returns {Array} Returns the new flattened array. */ function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; predicate || (predicate = isFlattenable); result || (result = []); while (++index < length) { var value = array[index]; if (depth > 0 && predicate(value)) { if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). baseFlatten(value, depth - 1, predicate, isStrict, result); } else { arrayPush(result, value); } } else if (!isStrict) { result[result.length] = value; } } return result; } module.exports = baseFlatten; /***/ }), /* 81 */ /***/ (function(module, exports) { /** * Appends the elements of `values` to `array`. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to append. * @returns {Array} Returns `array`. */ function arrayPush(array, values) { var index = -1, length = values.length, offset = array.length; while (++index < length) { array[offset + index] = values[index]; } return array; } module.exports = arrayPush; /***/ }), /* 82 */ /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(21), isArguments = __webpack_require__(75), isArray = __webpack_require__(17); /** Built-in value references. */ var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; /** * Checks if `value` is a flattenable `arguments` object or array. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); } module.exports = isFlattenable; /***/ }), /* 83 */ /***/ (function(module, exports, __webpack_require__) { var apply = __webpack_require__(84); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * A specialized version of `baseRest` which transforms the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ function overRest(func, start, transform) { start = nativeMax(start === undefined ? (func.length - 1) : start, 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); while (++index < length) { array[index] = args[start + index]; } index = -1; var otherArgs = Array(start + 1); while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = transform(array); return apply(func, this, otherArgs); }; } module.exports = overRest; /***/ }), /* 84 */ /***/ (function(module, exports) { /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } module.exports = apply; /***/ }), /* 85 */ /***/ (function(module, exports, __webpack_require__) { var baseSetToString = __webpack_require__(86), shortOut = __webpack_require__(89); /** * Sets the `toString` method of `func` to return `string`. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var setToString = shortOut(baseSetToString); module.exports = setToString; /***/ }), /* 86 */ /***/ (function(module, exports, __webpack_require__) { var constant = __webpack_require__(87), defineProperty = __webpack_require__(70), identity = __webpack_require__(88); /** * The base implementation of `setToString` without support for hot loop shorting. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var baseSetToString = !defineProperty ? identity : function(func, string) { return defineProperty(func, 'toString', { 'configurable': true, 'enumerable': false, 'value': constant(string), 'writable': true }); }; module.exports = baseSetToString; /***/ }), /* 87 */ /***/ (function(module, exports) { /** * Creates a function that returns `value`. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {*} value The value to return from the new function. * @returns {Function} Returns the new constant function. * @example * * var objects = _.times(2, _.constant({ 'a': 1 })); * * console.log(objects); * // => [{ 'a': 1 }, { 'a': 1 }] * * console.log(objects[0] === objects[1]); * // => true */ function constant(value) { return function() { return value; }; } module.exports = constant; /***/ }), /* 88 */ /***/ (function(module, exports) { /** * This method returns the first argument it receives. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. * @returns {*} Returns `value`. * @example * * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true */ function identity(value) { return value; } module.exports = identity; /***/ }), /* 89 */ /***/ (function(module, exports) { /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800, HOT_SPAN = 16; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeNow = Date.now; /** * Creates a function that'll short out and invoke `identity` instead * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` * milliseconds. * * @private * @param {Function} func The function to restrict. * @returns {Function} Returns the new shortable function. */ function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(undefined, arguments); }; } module.exports = shortOut; /***/ }), /* 90 */ /***/ (function(module, exports, __webpack_require__) { var baseKeys = __webpack_require__(91), getTag = __webpack_require__(95), isArguments = __webpack_require__(75), isArray = __webpack_require__(17), isArrayLike = __webpack_require__(100), isBuffer = __webpack_require__(101), isPrototype = __webpack_require__(92), isTypedArray = __webpack_require__(104); /** `Object#toString` result references. */ var mapTag = '[object Map]', setTag = '[object Set]'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Checks if `value` is an empty object, collection, map, or set. * * Objects are considered empty if they have no own enumerable string keyed * properties. * * Array-like values such as `arguments` objects, arrays, buffers, strings, or * jQuery-like collections are considered empty if they have a `length` of `0`. * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * * _.isEmpty(null); * // => true * * _.isEmpty(true); * // => true * * _.isEmpty(1); * // => true * * _.isEmpty([1, 2, 3]); * // => false * * _.isEmpty({ 'a': 1 }); * // => false */ function isEmpty(value) { if (value == null) { return true; } if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } var tag = getTag(value); if (tag == mapTag || tag == setTag) { return !value.size; } if (isPrototype(value)) { return !baseKeys(value).length; } for (var key in value) { if (hasOwnProperty.call(value, key)) { return false; } } return true; } module.exports = isEmpty; /***/ }), /* 91 */ /***/ (function(module, exports, __webpack_require__) { var isPrototype = __webpack_require__(92), nativeKeys = __webpack_require__(93); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeys(object) { if (!isPrototype(object)) { return nativeKeys(object); } var result = []; for (var key in Object(object)) { if (hasOwnProperty.call(object, key) && key != 'constructor') { result.push(key); } } return result; } module.exports = baseKeys; /***/ }), /* 92 */ /***/ (function(module, exports) { /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { var Ctor = value && value.constructor, proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; return value === proto; } module.exports = isPrototype; /***/ }), /* 93 */ /***/ (function(module, exports, __webpack_require__) { var overArg = __webpack_require__(94); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeKeys = overArg(Object.keys, Object); module.exports = nativeKeys; /***/ }), /* 94 */ /***/ (function(module, exports) { /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } module.exports = overArg; /***/ }), /* 95 */ /***/ (function(module, exports, __webpack_require__) { var DataView = __webpack_require__(96), Map = __webpack_require__(56), Promise = __webpack_require__(97), Set = __webpack_require__(98), WeakMap = __webpack_require__(99), baseGetTag = __webpack_require__(20), toSource = __webpack_require__(42); /** `Object#toString` result references. */ var mapTag = '[object Map]', objectTag = '[object Object]', promiseTag = '[object Promise]', setTag = '[object Set]', weakMapTag = '[object WeakMap]'; var dataViewTag = '[object DataView]'; /** Used to detect maps, sets, and weakmaps. */ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap); /** * Gets the `toStringTag` of `value`. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || (Map && getTag(new Map) != mapTag) || (Promise && getTag(Promise.resolve()) != promiseTag) || (Set && getTag(new Set) != setTag) || (WeakMap && getTag(new WeakMap) != weakMapTag)) { getTag = function(value) { var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : ''; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag; case mapCtorString: return mapTag; case promiseCtorString: return promiseTag; case setCtorString: return setTag; case weakMapCtorString: return weakMapTag; } } return result; }; } module.exports = getTag; /***/ }), /* 96 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(36), root = __webpack_require__(22); /* Built-in method references that are verified to be native. */ var DataView = getNative(root, 'DataView'); module.exports = DataView; /***/ }), /* 97 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(36), root = __webpack_require__(22); /* Built-in method references that are verified to be native. */ var Promise = getNative(root, 'Promise'); module.exports = Promise; /***/ }), /* 98 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(36), root = __webpack_require__(22); /* Built-in method references that are verified to be native. */ var Set = getNative(root, 'Set'); module.exports = Set; /***/ }), /* 99 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(36), root = __webpack_require__(22); /* Built-in method references that are verified to be native. */ var WeakMap = getNative(root, 'WeakMap'); module.exports = WeakMap; /***/ }), /* 100 */ /***/ (function(module, exports, __webpack_require__) { var isFunction = __webpack_require__(38), isLength = __webpack_require__(77); /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } module.exports = isArrayLike; /***/ }), /* 101 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(22), stubFalse = __webpack_require__(103); /** Detect free variable `exports`. */ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Built-in value references. */ var Buffer = moduleExports ? root.Buffer : undefined; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; /** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */ var isBuffer = nativeIsBuffer || stubFalse; module.exports = isBuffer; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(102)(module))) /***/ }), /* 102 */ /***/ (function(module, exports) { module.exports = function(module) { if (!module.webpackPolyfill) { module.deprecate = function() {}; module.paths = []; // module.parent = undefined by default if (!module.children) module.children = []; Object.defineProperty(module, "loaded", { enumerable: true, get: function() { return module.l; } }); Object.defineProperty(module, "id", { enumerable: true, get: function() { return module.i; } }); module.webpackPolyfill = 1; } return module; }; /***/ }), /* 103 */ /***/ (function(module, exports) { /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } module.exports = stubFalse; /***/ }), /* 104 */ /***/ (function(module, exports, __webpack_require__) { var baseIsTypedArray = __webpack_require__(105), baseUnary = __webpack_require__(106), nodeUtil = __webpack_require__(107); /* Node.js helper references. */ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /** * Checks if `value` is classified as a typed array. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); * // => true * * _.isTypedArray([]); * // => false */ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; module.exports = isTypedArray; /***/ }), /* 105 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(20), isLength = __webpack_require__(77), isObjectLike = __webpack_require__(27); /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', funcTag = '[object Function]', mapTag = '[object Map]', numberTag = '[object Number]', objectTag = '[object Object]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', weakMapTag = '[object WeakMap]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; /** * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } module.exports = baseIsTypedArray; /***/ }), /* 106 */ /***/ (function(module, exports) { /** * The base implementation of `_.unary` without support for storing metadata. * * @private * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. */ function baseUnary(func) { return function(value) { return func(value); }; } module.exports = baseUnary; /***/ }), /* 107 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(23); /** Detect free variable `exports`. */ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Detect free variable `process` from Node.js. */ var freeProcess = moduleExports && freeGlobal.process; /** Used to access faster Node.js helpers. */ var nodeUtil = (function() { try { return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); module.exports = nodeUtil; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(102)(module))) /***/ }), /* 108 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2016 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ /* global define */ (function () { 'use strict'; var hasOwn = {}.hasOwnProperty; function classNames () { var classes = []; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (!arg) continue; var argType = typeof arg; if (argType === 'string' || argType === 'number') { classes.push(arg); } else if (Array.isArray(arg)) { classes.push(classNames.apply(null, arg)); } else if (argType === 'object') { for (var key in arg) { if (hasOwn.call(arg, key) && arg[key]) { classes.push(key); } } } } return classes.join(' '); } if (typeof module !== 'undefined' && module.exports) { module.exports = classNames; } else if (true) { // register as 'classnames', consistent with npm package name !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { return classNames; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }()); /***/ }), /* 109 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(wp) { var _pick2 = __webpack_require__(12); var _pick3 = _interopRequireDefault(_pick2); var _isEmpty2 = __webpack_require__(90); var _isEmpty3 = _interopRequireDefault(_isEmpty2); var _classnames3 = __webpack_require__(108); var _classnames4 = _interopRequireDefault(_classnames3); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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; } /** * BLOCK: Image Background Block */ /** * External Dependencies */ /** * WordPress dependencies */ var __ = wp.i18n.__; var registerBlockType = wp.blocks.registerBlockType; var _wp$editor = wp.editor, InnerBlocks = _wp$editor.InnerBlocks, MediaUpload = _wp$editor.MediaUpload, ImagePlaceholder = _wp$editor.ImagePlaceholder, BlockControls = _wp$editor.BlockControls, InspectorControls = _wp$editor.InspectorControls, RichText = _wp$editor.RichText, ColorPalette = _wp$editor.ColorPalette, ContrastChecker = _wp$editor.ContrastChecker, BlockAlignmentToolbar = _wp$editor.BlockAlignmentToolbar; var _wp$components = wp.components, ButtonGroup = _wp$components.ButtonGroup, Button = _wp$components.Button, IconButton = _wp$components.IconButton, PanelBody = _wp$components.PanelBody, PanelColor = _wp$components.PanelColor, RangeControl = _wp$components.RangeControl, ToggleControl = _wp$components.ToggleControl, Toolbar = _wp$components.Toolbar, withState = _wp$components.withState; var blockAttributes = { url: { type: 'string' }, id: { type: 'number' }, alt: { type: 'string' }, dim: { type: 'number', default: 0 }, dimColor: { type: 'string', default: '#949494' }, alignment: { type: 'string' } }; var allowedBlockAligmnents = ['center', 'wide', 'full']; /** * Register: a Gutenberg Block. * * Registers a new block provided a unique name and an object defining its * behavior. Once registered, the block is made editor as an option to any * editor interface where blocks are implemented. * * @param {string} name Block name. * @param {Object} settings Block settings. * @return {?WPBlock} The block, if it has been successfully * registered; otherwise `undefined`. */ registerBlockType('agncy/image-background', { // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block. title: __('Image Background', 'agncy-js'), // Block title. description: __('Simple Paragraph block with background-image option.', 'agncy-js'), icon: 'format-image', // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/. category: 'common', // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed. keywords: [__('image background'), __('agncy')], attributes: blockAttributes, getEditWrapperProps: function getEditWrapperProps(attributes) { var alignment = attributes.alignment; if ('wide' === alignment || 'full' === alignment) { return { 'data-align': alignment }; } }, // The "edit" property must be a valid function. edit: function edit(_ref) { var _classnames; var attributes = _ref.attributes, setAttributes = _ref.setAttributes, isSelected = _ref.isSelected, className = _ref.className, setState = _ref.setState; var url = attributes.url, id = attributes.id, alt = attributes.alt, dim = attributes.dim, dimColor = attributes.dimColor, alignment = attributes.alignment; var onSelectImage = function onSelectImage(media) { return setAttributes((0, _pick3.default)(media, ['alt', 'id', 'url'])); }; var onResetImage = function onResetImage(media) { return setAttributes({ alt: null, id: null, url: null }); }; var onChangeDim = function onChangeDim(dim) { return setAttributes({ dim: dim }); }; var onChangeDimColor = function onChangeDimColor(dimColor) { return setAttributes({ dimColor: dimColor }); }; var onChangeBlockAlignment = function onChangeBlockAlignment(newAlignment) { return setAttributes({ alignment: newAlignment }); }; var hasUrl = !(0, _isEmpty3.default)(url); var styleUrl = hasUrl ? 'url(' + url + ')' : null; // Create the needed controls var controls = isSelected && [React.createElement( BlockControls, { key: 'controls' }, React.createElement(BlockAlignmentToolbar, { value: alignment, onChange: onChangeBlockAlignment, controls: allowedBlockAligmnents }), React.createElement( Toolbar, null, React.createElement(MediaUpload, { onSelect: onSelectImage, type: 'image', value: id, render: function render(_ref2) { var open = _ref2.open; return React.createElement(IconButton, { className: 'components-toolbar__control', label: __('Edit image', 'agncy-js'), icon: 'edit', onClick: open }); } }) ) ), React.createElement( InspectorControls, { key: 'inspector' }, React.createElement( PanelBody, { title: __('Background Image') }, React.createElement( ButtonGroup, null, React.createElement(MediaUpload, { onSelect: onSelectImage, type: 'image', value: id, render: function render(_ref3) { var open = _ref3.open; return React.createElement( Button, { className: 'components-button button button-large', icon: 'edit', onClick: open }, __('Edit', 'agncy-js') ); } }), React.createElement( Button, { className: 'components-button button button-large', icon: 'edit', onClick: onResetImage }, __('Reset', 'agncy-js') ) ) ), React.createElement( PanelBody, { title: __('Background Dimness', 'agncy-js'), initialOpen: false }, React.createElement(RangeControl, { value: dim, onChange: onChangeDim, min: 0, max: 100, step: 10 }), React.createElement( PanelColor, { title: __('Dim Color'), colorValue: dimColor.value }, React.createElement(ColorPalette, { value: dimColor.value, onChange: onChangeDimColor }) ) ) )]; var blockClassNames = (0, _classnames4.default)(className, (_classnames = { 'wide-content': true }, _defineProperty(_classnames, 'has-background-image', hasUrl), _defineProperty(_classnames, 'has-background-dim-' + dim, dim), _defineProperty(_classnames, 'align' + alignment, alignment), _defineProperty(_classnames, 'align' + alignment + '-padding', alignment), _classnames)); var backgroundStyles = { backgroundImage: styleUrl }; var dimStyles = { opacity: dim / 100, backgroundColor: dimColor }; return [controls, React.createElement( 'div', { className: blockClassNames, style: backgroundStyles }, React.createElement('div', { 'class': 'background-dim', style: dimStyles }), React.createElement(InnerBlocks, null) )]; }, // The "save" property must be specified and must be a valid function. save: function save(_ref4) { var _classnames2; var attributes = _ref4.attributes, className = _ref4.className; var url = attributes.url, id = attributes.id, alt = attributes.alt, dim = attributes.dim, dimColor = attributes.dimColor, alignment = attributes.alignment; var hasUrl = !(0, _isEmpty3.default)(url); var styleUrl = hasUrl ? 'url(' + url + ')' : null; var backgroundStyles = { backgroundImage: styleUrl }; var blockClassNames = (0, _classnames4.default)(className, (_classnames2 = {}, _defineProperty(_classnames2, 'has-background-dim-' + dim, dim), _defineProperty(_classnames2, 'align' + alignment, alignment), _defineProperty(_classnames2, 'align' + alignment + '-padding', alignment), _classnames2)); var dimStyles = { opacity: dim / 100, backgroundColor: dimColor }; return React.createElement( 'div', { className: blockClassNames, style: backgroundStyles }, dim > 0 && React.createElement('div', { 'class': 'background-dim', style: dimStyles }), React.createElement(InnerBlocks.Content, null) ); } }); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(11))) /***/ }) /******/ ]);