/******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ "@wordpress/element":
/*!*********************************!*\
  !*** external ["wp","element"] ***!
  \*********************************/
/***/ (function(module) {

module.exports = window["wp"]["element"];

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// 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 });
/******/ 		};
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
!function() {
/*!*****************************!*\
  !*** ./src/posts-slider.js ***!
  \*****************************/
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);

const {
  registerBlockType
} = wp.blocks;
const {
  InspectorControls
} = wp.blockEditor;
const {
  PanelBody,
  TextControl,
  SelectControl,
  ToggleControl
} = wp.components;
registerBlockType("irankala/posts-slider", {
  title: IRK_BLOCK_DATA.postsSlider,
  description: IRK_BLOCK_DATA.postsSliderDesc,
  icon: "welcome-widgets-menus",
  category: "irankala",
  attributes: {
    title: {
      type: 'string'
    },
    icon: {
      type: 'string'
    },
    postType: {
      type: 'string'
    },
    category: {
      type: 'string'
    },
    newsCat: {
      type: 'string'
    },
    blogCat: {
      type: 'string'
    },
    postIn: {
      type: 'string'
    },
    count: {
      type: 'string'
    },
    orderby: {
      type: 'string'
    },
    includeChildren: {
      type: 'boolean'
    },
    expert: {
      type: 'boolean'
    },
    date: {
      type: 'boolean'
    },
    viewMore: {
      type: 'boolean'
    }
  },
  edit: function (props) {
    const {
      attributes,
      setAttributes
    } = props;
    let cats = JSON.parse(JSON.stringify(IRK_BLOCK_DATA.cats));
    let catsList = [];

    for (const prop in cats) {
      catsList.push({
        label: cats[prop],
        value: prop
      });
    }

    let newsCats = JSON.parse(JSON.stringify(IRK_BLOCK_DATA.newsCats));
    let newCatsList = [];

    for (const prop in newsCats) {
      newCatsList.push({
        label: newsCats[prop],
        value: prop
      });
    }

    let blogCats = JSON.parse(JSON.stringify(IRK_BLOCK_DATA.blogCats));
    let blogCatsList = [];

    for (const prop in blogCats) {
      blogCatsList.push({
        label: blogCats[prop],
        value: prop
      });
    }

    return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PanelBody, {
      title: IRK_BLOCK_DATA.options,
      initialOpen: true
    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "irk-panel-row"
    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(TextControl, {
      label: IRK_BLOCK_DATA.title,
      value: attributes.title,
      onChange: value => setAttributes({
        title: value
      })
    })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "irk-panel-row"
    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(TextControl, {
      label: IRK_BLOCK_DATA.icon,
      value: attributes.icon,
      onChange: value => setAttributes({
        icon: value
      })
    })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "irk-panel-row"
    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(SelectControl, {
      label: IRK_BLOCK_DATA.postType,
      value: attributes.postType,
      options: [{
        label: IRK_BLOCK_DATA.post,
        value: "post"
      }, {
        label: IRK_BLOCK_DATA.news,
        value: "news"
      }, {
        label: IRK_BLOCK_DATA.blog,
        value: "blog"
      }],
      onChange: value => setAttributes({
        postType: value
      })
    })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "irk-panel-row"
    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(SelectControl, {
      label: IRK_BLOCK_DATA.category,
      value: attributes.category,
      options: catsList,
      onChange: value => setAttributes({
        category: value
      })
    })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "irk-panel-row"
    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(SelectControl, {
      label: IRK_BLOCK_DATA.newsCat,
      value: attributes.newsCat,
      options: newCatsList,
      onChange: value => setAttributes({
        newsCat: value
      })
    })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "irk-panel-row"
    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(SelectControl, {
      label: IRK_BLOCK_DATA.blogCat,
      value: attributes.blogCat,
      options: blogCatsList,
      onChange: value => setAttributes({
        blogCat: value
      })
    })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "irk-panel-row"
    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(TextControl, {
      label: IRK_BLOCK_DATA.postIn,
      value: attributes.postIn,
      onChange: value => setAttributes({
        postIn: value
      })
    })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "irk-panel-row"
    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("small", {
      style: {
        color: '#8c8c8c'
      }
    }, IRK_BLOCK_DATA.separateId)), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "irk-panel-row"
    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(TextControl, {
      label: IRK_BLOCK_DATA.count,
      value: attributes.count,
      onChange: value => setAttributes({
        count: value
      })
    })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "irk-panel-row"
    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(SelectControl, {
      label: IRK_BLOCK_DATA.orderby,
      value: attributes.orderby,
      options: [{
        label: IRK_BLOCK_DATA.default,
        value: "default"
      }, {
        label: IRK_BLOCK_DATA.random,
        value: "random"
      }, {
        label: IRK_BLOCK_DATA.commentsCount,
        value: "comment-count"
      }],
      onChange: value => setAttributes({
        orderby: value
      })
    })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "irk-panel-row"
    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(ToggleControl, {
      label: IRK_BLOCK_DATA.includeChildren,
      checked: attributes.includeChildren,
      onChange: value => setAttributes({
        includeChildren: value
      })
    })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "irk-panel-row"
    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(ToggleControl, {
      label: IRK_BLOCK_DATA.expert,
      checked: attributes.expert,
      onChange: value => setAttributes({
        expert: value
      })
    })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "irk-panel-row"
    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(ToggleControl, {
      label: IRK_BLOCK_DATA.showDate,
      checked: attributes.date,
      onChange: value => setAttributes({
        date: value
      })
    })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
      className: "irk-panel-row"
    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(ToggleControl, {
      label: IRK_BLOCK_DATA.ShowViewMore,
      checked: attributes.viewMore,
      onChange: value => setAttributes({
        viewMore: value
      })
    })))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("strong", null, IRK_BLOCK_DATA.postsSlider), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, IRK_BLOCK_DATA.postsSliderDesc)));
  },
  save: function (props) {
    return null;
  }
});
}();
/******/ })()
;
//# sourceMappingURL=posts-slider.js.map