File "slidein-trigger-block.min.js"

Full Path: /home/londdqdw/public_html/06/wp-content/plugins/wordpress-popup/inc/providers/gutenberg/js/slidein-trigger-block.min.js
File size: 6.48 KB
MIME-type: text/plain
Charset: utf-8

!function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function o(e,n){return!n||"object"!==t(n)&&"function"!=typeof n?r(e):n}function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var l=wp.blocks,a=l.registerBlockType,c=l.createBlock,d=wp.element,u=d.createElement,_=d.Component,p=(d.RawHTML,wp.shortcode),h=p.string,g=p.next,m=u("svg",{class:"dashicon",viewBox:"0 0 24 24",width:20,height:20,xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid meet","aria-hidden":"true",role:"img"},u("path",{d:"M24 6H10.5a1.45 1.45 0 0 0-1.066.434A1.45 1.45 0 0 0 9 7.5v9c0 .422.145.777.434 1.066.289.29.644.434 1.066.434H24v4.5c0 .422-.145.777-.434 1.066A1.45 1.45 0 0 1 22.5 24h-21a1.45 1.45 0 0 1-1.066-.434A1.45 1.45 0 0 1 0 22.5v-21C0 1.078.145.723.434.434A1.45 1.45 0 0 1 1.5 0h21c.422 0 .777.145 1.066.434.29.289.434.644.434 1.066V6z"}),u("path",{d:"M21.5 7c.422 0 .777.145 1.066.434.29.289.434.644.434 1.066 0 .422-.145.777-.434 1.066A1.45 1.45 0 0 1 21.5 10a1.45 1.45 0 0 1-1.066-.434A1.45 1.45 0 0 1 20 8.5c0-.422.145-.777.434-1.066A1.45 1.45 0 0 1 21.5 7z"})),f=function(t){function l(){var t;return e(this,l),(t=o(this,i(l).apply(this,arguments))).update_id=t.update_id.bind(r(r(t))),t.update_css_class=t.update_css_class.bind(r(r(t))),t.update_content=t.update_content.bind(r(r(t))),t.state={loading:!1},t}var a,c;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(l,t),a=l,(c=[{key:"update_module_id",value:function(t){this.props.setAttributes({module_id:t})}},{key:"update_id",value:function(t){this.props.setAttributes({id:t})}},{key:"update_content",value:function(t){this.props.setAttributes({content:t})}},{key:"update_css_class",value:function(t){this.props.setAttributes({css_class:t})}},{key:"set_module_id_from_shortcode_id",value:function(t){var e=this;if(!this.state.loading){this.setState({loading:!0});var n=ajaxurl+"?action=hustle_get_module_id_by_shortcode&_wpnonce="+hustle_slidein_trigger_data.nonce+"&shortcode_id="+t;window.fetch(n).then((function(t){return t.json()})).then((function(t){t.success&&t.data.module_id&&e.update_module_id(t.data.module_id),e.setState({loading:!1})}))}}},{key:"componentDidUpdate",value:function(t){var e=this.props.attributes.id;t.attributes.id!==e&&e&&this.set_module_id_from_shortcode_id(e)}},{key:"componentDidMount",value:function(){var t=this.props.attributes,e=t.module_id,n=t.id;n&&!e&&this.set_module_id_from_shortcode_id(n)}},{key:"open_settings",value:function(t){var e=hustle_slidein_trigger_data.admin_url+"?page="+hustle_slidein_trigger_data.wizard_page+"&id="+t;window.open(e)}},{key:"render",value:function(){var t=this,e=this.state.loading,n=this.props,o=n.attributes,i=n.isSelected,s=o.module_id,r=o.id,l=o.content,a=o.css_class,c=hustle_slidein_trigger_data.modules,d=[i&&u(wp.editor.InspectorControls,{key:"inspector"},u(wp.components.PanelBody,{title:hustle_slidein_trigger_data.l10n.module,initialOpen:!0},u(wp.components.PanelRow,null,u(wp.components.SelectControl,{label:hustle_slidein_trigger_data.l10n.name,value:r,options:c,onChange:this.update_id}))),u(wp.components.PanelBody,{title:hustle_slidein_trigger_data.l10n.advanced,initialOpen:!0},u(wp.components.PanelRow,null,u(wp.components.TextControl,{label:hustle_slidein_trigger_data.l10n.trigger_content,value:l,onChange:this.update_content})),u(wp.components.PanelRow,null,u(wp.components.TextControl,{label:hustle_slidein_trigger_data.l10n.additional_css_classes,value:a,onChange:this.update_css_class})))),u(wp.editor.BlockControls,null,!!r&&u(wp.components.Toolbar,null,u(wp.components.IconButton,{className:"components-toolbar__control",label:hustle_slidein_trigger_data.l10n.customize_module,icon:"edit",onClick:function(e){return t.open_settings(s)}})))];return e?[d,u("div",{key:"loading",className:"wp-block-embed is-loading"},u(wp.components.Spinner,null),u("span",null,hustle_slidein_trigger_data.l10n.rendering))]:r?[d,u(wp.editor.RichText,{tagName:"a",multiline:!1,formattingControls:[],value:l,onChange:this.update_content,keepPlaceholderOnFocus:!0,placeholder:hustle_popup_trigger_data.l10n.content_here})]:[d,u(wp.components.Placeholder,{key:"placeholder",className:"wp-block-embed",instructions:hustle_slidein_trigger_data.l10n.block_description,icon:m,label:hustle_slidein_trigger_data.l10n.block_name},u("form",null,u("select",{value:r,onChange:function(e){return t.update_id(e.target.value)}},c.map((function(t){return u("option",{key:t.value,value:t.value},t.label)})))),u("div",{class:"components-placeholder__instructions"},hustle_slidein_trigger_data.l10n.block_more_description))]}}])&&n(a.prototype,c),l}(_);a("hustle/slidein-trigger",{title:hustle_slidein_trigger_data.l10n.block_name,description:hustle_slidein_trigger_data.l10n.block_description,icon:m,category:"hustle",keywords:["Hustle",hustle_slidein_trigger_data.l10n.block_name],attributes:{module_id:{type:"string"},id:{type:"string"},type:{type:"string"},content:{type:"string",default:hustle_slidein_trigger_data.l10n.click_here},css_class:{type:"string"}},supports:{customClassName:!1,className:!1,html:!1},transforms:{to:[{type:"block",blocks:["core/shortcode"],transform:function(t){var e=t.id,n=t.content,o=t.css_class,i={tag:hustle_slidein_trigger_data.shortcode_tag,attrs:{id:e||"",css_class:o||"",type:"slidein"},content:n,type:"closed"},s=h(i);return c("core/shortcode",{text:s})}}],from:[{type:"block",blocks:["core/shortcode"],isMatch:function(t){var e=t.text,n=g("wd_hustle",e);return void 0!==n&&"slidein"===n.shortcode.attrs.named.type},transform:function(t){var e=t.text,n=g("wd_hustle",e).shortcode,o=n.content,i=n.attrs.named,s=i.id,r=i.type,l=i.css_class;return c("hustle/slidein-trigger",{id:s,type:r,css_class:l,content:o})}}]},edit:f,save:function(){return null}})}();