File "social-share-block.min.js"
Full Path: /home/londdqdw/public_html/06/wp-content/plugins/wordpress-popup/inc/providers/gutenberg/js/social-share-block.min.js
File size: 6.28 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 s=e[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function s(e,n){return!n||"object"!==t(n)&&"function"!=typeof n?r(e):n}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=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 i=wp.blocks,l=i.registerBlockType,c=i.createBlock,u=wp.element,d=u.createElement,p=u.Component,_=u.RawHTML,h=wp.shortcode,f=h.string,m=h.next,y=d("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"},d("path",{d:"M18.628 8.578v-.023h.023c.918 0 1.705.336 2.363 1.008.657.671.986 1.484.986 2.437a3.33 3.33 0 0 1-.986 2.414c-.658.672-1.445 1.008-2.363 1.008-.214 0-.42-.02-.619-.059-.199-.039-.39-.09-.573-.152l-8.716 5.156V20.578a3.33 3.33 0 0 1-.986 2.414C7.099 23.664 6.312 24 5.394 24c-.932 0-1.727-.336-2.385-1.008a3.33 3.33 0 0 1-.986-2.414c0-.953.329-1.762.986-2.426a3.233 3.233 0 0 1 2.385-.996c.367 0 .72.055 1.056.164.336.11.634.274.894.492l8.096-4.757a4.427 4.427 0 0 1-.114-.504 3.277 3.277 0 0 1 .114-1.559L7.344 6.211a2.907 2.907 0 0 1-.917.492 3.39 3.39 0 0 1-1.055.164 3.233 3.233 0 0 1-2.386-.996C2.33 5.207 2 4.398 2 3.445c0-.953.329-1.765.986-2.437C3.644.336 4.44 0 5.372 0c.917 0 1.704.336 2.362 1.008a3.33 3.33 0 0 1 .986 2.414V3.656l8.693 5.156a3.205 3.205 0 0 1 1.216-.234z"})),b=function(t){function i(){var t;return e(this,i),(t=s(this,o(i).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.preview=t.preview.bind(r(r(t))),t.state={loading:!1,markup:""},t}var l,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&&a(t,e)}(i,t),l=i,(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_css_class",value:function(t){this.props.setAttributes({css_class:t})}},{key:"preview",value:function(t){var e=this,n=(t.module_id,t.id),s=t.type;if(!this.state.loading){this.setState({loading:!0});var o="";if(n){var a=void 0===s?"":"&type="+s;o=ajaxurl+"?action=hustle_render_module&_wpnonce="+hustle_embed_data.nonce+"&shortcode_id="+n+a,window.fetch(o).then((function(t){return t.json()})).then((function(t){if(t.success){var s=t.data.html,o=t.data.style,a=t.data.data;e.setState({markup:s+o,loading:!1}),n||e.update_id(a.shortcode_id),e.update_module_id(a.module_id)}})).catch((function(t){console.log(t)}))}}}},{key:"componentDidMount",value:function(){var t=this.props.attributes;t.id&&this.preview(t)}},{key:"componentDidUpdate",value:function(t){var e=this.props.attributes,n=e.id;t.attributes.id!==n&&(n?this.preview(e):this.setState({markup:""}))}},{key:"open_settings",value:function(t){var e=hustle_ss_data.admin_url+"?page=hustle_sshare&id="+t;window.open(e)}},{key:"render",value:function(){var t=this,e=this.state,n=e.loading,s=e.markup,o=this.props,a=o.attributes,r=o.isSelected,i=a.module_id,l=a.id,c=a.css_class,u=hustle_ss_data.modules,p=[r&&d(wp.editor.InspectorControls,{key:"inspector"},d(wp.components.PanelBody,{title:hustle_ss_data.l10n.module,initialOpen:!0},d(wp.components.PanelRow,null,d(wp.components.SelectControl,{label:hustle_ss_data.l10n.name,value:l,options:u,onChange:this.update_id}))),d(wp.components.PanelBody,{title:hustle_ss_data.l10n.advanced,initialOpen:!0},d(wp.components.PanelRow,null,d(wp.components.TextControl,{label:hustle_ss_data.l10n.additional_css_classes,value:c,onChange:this.update_css_class})))),d(wp.editor.BlockControls,null,!!l&&d(wp.components.Toolbar,null,d(wp.components.IconButton,{className:"components-toolbar__control",label:hustle_ss_data.l10n.customize_module,icon:"edit",onClick:function(e){return t.open_settings(i)}})))];return n?[p,d("div",{key:"loading",className:"wp-block-embed is-loading"},d(wp.components.Spinner,null),d("span",null,hustle_ss_data.l10n.rendering))]:s?[p,d(_,null,s)]:[p,d(wp.components.Placeholder,{key:"placeholder",className:"wp-block-embed",instructions:hustle_ss_data.l10n.block_description,icon:y,label:hustle_ss_data.l10n.block_name},d("form",null,d("select",{value:l,onChange:function(e){return t.update_id(e.target.value)}},u.map((function(t){return d("option",{key:t.value,value:t.value},t.label)})))))]}}])&&n(l.prototype,c),i}(p);l("hustle/social-share",{title:hustle_ss_data.l10n.block_name,description:hustle_ss_data.l10n.block_description,icon:y,category:"hustle",keywords:["Hustle",hustle_ss_data.l10n.block_name],attributes:{module_id:{type:"string"},id:{type:"string"},type:{type:"string"},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.css_class,s={tag:hustle_popup_trigger_data.shortcode_tag,attrs:{id:e||"",css_class:n||"",type:"social_sharing"},type:"single"},o=f(s);return c("core/shortcode",{text:o})}}],from:[{type:"shortcode",tag:["wd_hustle_ss"],attributes:{id:{type:"string",shortcode:function(t){return t.named.id}},type:{type:"string",shortcode:function(t){return t.named.type}}}},{type:"block",blocks:["core/shortcode"],isMatch:function(t){var e=t.text,n=m("wd_hustle",e);if(void 0===n&&void 0===(n=m("wd_hustle_ss",e)))return!1;var s=n.shortcode;return"social_sharing"===s.attrs.named.type||"wd_hustle_ss"===s.attrs.tag},transform:function(t){var e=t.text,n=m("wd_hustle",e).shortcode;"undefined"===n&&(n=m("wd_hustle_ss",e));var s=n.attrs.named,o=s.id,a=s.type,r=s.css_class;return c("hustle/social-share",{id:o,css_class:r,type:a})}}]},edit:b,save:function(){return null}})}();