!function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(1)},function(e,t,n){"use strict";var r=n(2),a=(n.n(r),n(3)),__=wp.i18n.__;wp.blocks.createBlock;(0,wp.blocks.registerBlockType)("emg-gallery/block",{title:__("Media Gallery"),icon:"format-gallery",category:"common",keywords:[__("gallery"),__("media")],supports:{html:!1,customClassName:!1},edit:a.a,save:function(e){}})},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(4),c=(n.n(i),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}()),l=wp.element.Component,__=wp.i18n.__,s=function(e){function t(){r(this,t);var e=a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.cloneBlock=e.cloneBlock.bind(e),e.save=e.save.bind(e),e}return o(t,e),c(t,[{key:"cloneBlock",value:function(){emgallery.data.that=null,emgallery.data.that=jQuery.extend({},this)}},{key:"getBlockData",value:function(e){try{var t=JSON.parse(this.props.attributes.data);return!!t.hasOwnProperty("params")&&(!!e||t)}catch(e){return!1}}},{key:"setShortcodeType",value:function(e){return-1!==e.indexOf("easy-media med=")?"Basic Media - Single Media":-1!==e.indexOf("easy-media cat=")?"Basic Media - Category":-1!==e.indexOf("easymedia-gallery med=")&&-1==e.indexOf("pag=")?"Grid Gallery":void 0}},{key:"generateProperties",value:function(){var e=this.getBlockData();if(e)return wp.element.createElement("div",{className:"sc-info-cont"},wp.element.createElement("span",{className:"sc-info info-type"}," ",__("Shortcode Type: ")+this.setShortcodeType(e.params.type)),wp.element.createElement("span",{className:"sc-info info-type-value"}))}},{key:"isValidJSONString",value:function(e){try{JSON.parse(e)}catch(e){return!1}return!0}},{key:"save",value:function(e){this.isValidJSONString(e)&&emgallery.data.that.props.setAttributes({data:e}),this.generateProperties,emgallery.data.thickbox()}},{key:"render",value:function(){return wp.element.createElement("div",{className:"emg-shortcode-block"},wp.element.createElement("div",{className:"gall-cont"},this.generateProperties(),wp.element.createElement("div",{className:"sc-btn-cont"},wp.element.createElement("span",{onClick:this.cloneBlock,className:"butn emg-sc-generator"},__(this.getBlockData(!0)?"Update Gallery":"Insert Gallery")))))}}]),t}(l);t.a=s},function(e,t){}]);