bibhamrokhanpin/wp-content/plugins/wp-trending-post-slider-and-widget/assets/js/blocks.build.js
2024-04-10 17:46:06 +05:45

1 line
43 KiB
JavaScript

!function(e){function t(l){if(n[l])return n[l].exports;var a=n[l]={i:l,l:!1,exports:{}};return e[l].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,l){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:l})},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 l=n(2),a=(n.n(l),n(3)),o=(n.n(a),n(4)),r=n(5),s=n(6),__=wp.i18n.__,p=wp.blocks.registerBlockType;p("wtpsw-free/trending-slider",{title:__("Trending Slider","wtpsw"),description:__("Display trending post in a slider view with various layouts.","wtpsw"),icon:"star-filled",category:"wpos_guten_block",keywords:[__("wpos"),__("trending slider","wtpsw"),__("wtpsw_popular_post")],supports:{html:!1,multiple:!0},getEditWrapperProps:function(e){var t=e.align;if(["wide","full"].includes(t))return{"data-align":t,"data-block-type":"wtpsw-trending-slider"}},edit:o.a,save:function(){return null}}),p("wtpsw-free/trending-carousel",{title:__("Trending Carousel","wtpsw"),description:__("Display trending post in a carousel view with various layouts.","wtpsw"),icon:"star-filled",category:"wpos_guten_block",keywords:[__("wpos"),__("trending carousel","wtpsw"),__("wtpsw_carousel")],supports:{html:!1,multiple:!0},getEditWrapperProps:function(e){var t=e.align;if(["wide","full"].includes(t))return{"data-align":t,"data-block-type":"wtpsw-trending-carousel"}},edit:r.a,save:function(){return null}}),p("wtpsw-free/trending-gridbox",{title:__("Trending Gridbox","wtpsw"),description:__("Display trending post in a gridbox view with various layouts.","wtpsw"),icon:"star-filled",category:"wpos_guten_block",keywords:[__("wpos"),__("trending gridbox","wtpsw"),__("wtpsw_gridbox")],supports:{html:!1,multiple:!0},getEditWrapperProps:function(e){var t=e.align;if(["wide","full"].includes(t))return{"data-align":t,"data-block-type":"wtpsw-trending-gridbox"}},edit:s.a,save:function(){return null}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function l(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 r=function(){function e(e,t){for(var n=0;n<t.length;n++){var l=t[n];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}return function(t,n,l){return n&&e(t.prototype,n),l&&e(t,l),t}}(),s=wp.element,p=s.Component,i=s.Fragment,w=wp.components,m=w.PanelBody,c=w.TextControl,u=w.Disabled,d=w.ToggleControl,h=w.RangeControl,g=w.SelectControl,__=wp.i18n.__,f=(wp.data.select,wp.blockEditor),E=f.InspectorControls,b=f.BlockControls,y=f.BlockAlignmentToolbar,_=function(e){function t(){l(this,t);var e=a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.state={isLoading:!1},e}return o(t,e),r(t,[{key:"ObjToString",value:function(e){var t=wp.blocks.getBlockAttributes("wtpsw-free/trending-slider"),n="";for(var l in e)e.hasOwnProperty(l)&&"undefined"!==typeof e[l]&&e[l]!==t[l]&&""!=jQuery.trim(e[l])&&(n+=l+'="'+e[l]+'" ');return n}},{key:"GetBooleanDropdown",value:function(){return[{value:"true",label:__("True","wtpsw")},{value:"false",label:__("False","wtpsw")}]}},{key:"GetLinkTargetDropdown",value:function(){return[{value:"self",label:__("Same Window","wtpsw")}]}},{key:"GetPostViewsOrderby",value:function(){return[{value:"views",label:__("Views","wtpsw")},{value:"comment",label:__("Comment Count","wtpsw")}]}},{key:"GetPostOrder",value:function(){return[{value:"desc",label:__("Descending","wtpsw")},{value:"asc",label:__("Ascending","wtpsw")}]}},{key:"GetLazyloadDropdown",value:function(){return[{value:"",label:__("Select Lazyload","wtpsw")}]}},{key:"componentDidMount",value:function(){}},{key:"componentDidUpdate",value:function(e){e.attributes}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.setAttributes,l=t.align,a=(t.className,t.showdate),o=t.showauthor,r=t.show_comment_count,s=t.hide_empty_comment_count,p=t.showcontent,w=t.words_limit,f=t.dots,_=t.arrows,k=t.autoplay,v=t.autoplayinterval,C=t.speed,P=t.limit,B=t.post_type,N=t.view_by,W=t.order,O=(this.state.isLoading,wp.element.createElement(E,null,wp.element.createElement(m,{title:__("General Parameters","wtpsw")},wp.element.createElement(d,{label:__("Show Date","wtpsw"),checked:!!a,onChange:function(){return n({showdate:!a})}}),wp.element.createElement(d,{label:__("Show Author","wtpsw"),checked:!!o,onChange:function(){return n({showauthor:!o})}}),wp.element.createElement(u,null,wp.element.createElement(d,{label:__("Show Views","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Show views. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(d,{label:__("Show Comment Count","wtpsw"),checked:!!r,onChange:function(){return n({show_comment_count:!r})}}),wp.element.createElement(d,{label:__("Hide Empty Comment Count","wtpsw"),checked:!!s,onChange:function(){return n({hide_empty_comment_count:!s})}}),wp.element.createElement(d,{label:__("Show Content","wtpsw"),checked:!!p,onChange:function(){return n({showcontent:!p})}}),1==p&&wp.element.createElement(h,{label:__("Words Limit","wtpsw"),value:w,onChange:function(e){return n({words_limit:e})},min:1,max:1e3}),wp.element.createElement(u,null,wp.element.createElement(g,{label:__("Link Behaviour","wtpsw"),options:this.GetLinkTargetDropdown(),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Choose link behaviour. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(c,{label:__("Media Size","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Choose WordPress registered image size. e.g thumbnail, medium, large, full. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))}))),wp.element.createElement(m,{title:__("Slider Parameters","wtpsw"),initialOpen:!1},wp.element.createElement(g,{label:__("Dots","wtpsw"),value:f,options:this.GetBooleanDropdown(),onChange:function(e){return n({dots:e})},help:__("Show pagination dots.","wtpsw")}),wp.element.createElement(g,{label:__("Arrows","wtpsw"),value:_,options:this.GetBooleanDropdown(),onChange:function(e){return n({arrows:e})},help:__("Show prev - next arrows.","wtpsw")}),wp.element.createElement(g,{label:__("Autoplay","wtpsw"),value:k,options:this.GetBooleanDropdown(),onChange:function(e){return n({autoplay:e})}}),"true"==k&&wp.element.createElement(h,{label:__("Autoplay Interval","wtpsw"),value:v,onChange:function(e){return n({autoplayinterval:e})},min:100,max:5e4,help:__("Enter autoplay interval speed.","wtpsw")}),wp.element.createElement(h,{label:__("Speed","wtpsw"),value:C,onChange:function(e){return n({speed:e})},min:100,max:5e4,help:__("Enter slide speed.","wtpsw")}),wp.element.createElement(u,null,wp.element.createElement(g,{label:__("Loop","wtpsw"),options:this.GetBooleanDropdown(),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enable infinite loop for continuous sliding. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(g,{label:__("Pause On Hover","wtpsw"),options:this.GetBooleanDropdown(),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Pause slider autoplay on hover. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(g,{label:__("Pause On Focus","wtpsw"),options:this.GetBooleanDropdown(),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Pause slider autoplay when slider element is focused. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(h,{label:__("Slider Height","wtpsw"),min:0,max:5e3,help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Control height of the trending image. You can enter any numeric number. e.g 500. Leave empty for default height. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(g,{label:__("Slider Lazyload","wtpsw"),options:this.GetLazyloadDropdown(),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Select option to use lazy loading in slider. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))}))),wp.element.createElement(m,{title:__("Query Parameters","wtpsw"),initialOpen:!1},wp.element.createElement(h,{label:__("Limit","wtpsw"),value:P,onChange:function(e){return n({limit:e})},min:-1,max:1e3,help:__("Enter number of trending post to be displayed. Enter -1 to display all.","wtpsw")}),wp.element.createElement(c,{label:__("Post Type","wtpsw"),value:B,onChange:function(e){return n({post_type:e})},help:wp.element.createElement("span",{title:__("Note: Be sure you have added valid post type name otherwise no result will be displayed.","wtpsw")},__("Enter registered post type name. You can find it on plugin setting page.","wtpsw")," [?]")}),wp.element.createElement(u,null,wp.element.createElement(c,{label:__("Taxonomy","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enter registered taxonomy name. You can find it on plugin setting page. Note: Be sure you have added valid taxonomy name otherwise no result will be displayed. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(g,{label:__("View By","wtpsw"),value:N,options:this.GetPostViewsOrderby(),onChange:function(e){return n({view_by:e})}}),wp.element.createElement(g,{label:__("Order","wtpsw"),value:W,options:this.GetPostOrder(),onChange:function(e){return n({order:e})}}),wp.element.createElement(u,null,wp.element.createElement(c,{label:__("Display Specific Category","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enter category id to display categories wise. You can pass multiple ids with comma seperated. You can find id at relevant category listing page. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(g,{label:__("Display Child Category","wtpsw"),options:this.GetBooleanDropdown(),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("If you are using parent category then whether to display child category or not. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(c,{label:__("Exclude Category","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Exclude post category. Works only if `Category` field is empty. You can pass multiple ids with comma seperated. You can find id at relevant category listing page. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(c,{label:__("Display Specific Posts","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enter id of the post which you want to display. You can pass multiple ids with comma seperated. You can find id at relevant post listing page. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(c,{label:__("Exclude Post","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enter id of the post which you do not want to display. You can pass multiple ids with comma seperated. You can find id at relevant post listing page. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(c,{label:__("Include Author","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enter author id to display posts of particular author. You can pass multiple ids with comma seperated. You can find id at users listing page. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(c,{label:__("Exclude Author","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enter author id to hide post of particular author. Works only if `Include Author` field is empty. You can pass multiple ids with comma seperated. You can find id at relevant users listing page. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(h,{label:__("Query Offset","wtpsw"),min:0,max:100,help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Exclude number of posts from starting. e.g if you pass 5 then it will skip first five post. Note: This will not work with limit=-1. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})))));return wp.element.createElement(i,null,O,wp.element.createElement(b,null,wp.element.createElement(y,{value:l,onChange:function(e){return n({align:e})},controls:["wide","full"]})),wp.element.createElement("div",{className:this.props.className},this.renderOutput()))}},{key:"renderOutput",value:function(){var e=this.props.attributes,t=this.ObjToString(e);t=t.trim();var n=t?"[wtpsw_popular_post "+t+"]":"[wtpsw_popular_post]";return wp.element.createElement("div",{className:"wpos-pro-guten-shrt"},wp.element.createElement("div",{className:"wpos-pro-guten-shrt-title"},wp.element.createElement("span",null,__("WP Trending Post Slider and Widget - Slider","wtpsw"))),n,wp.element.createElement("div",{className:"wpos-guten-shrt-footer"},wp.element.createElement("span",null),__("Do you want to check demo of this plugin.","wtpsw")," ",wp.element.createElement("a",{href:Wtpsw_Block.free_demo_link,target:"_blank"},__("Click here","wtpsw"))),wp.element.createElement("div",{className:"wpos-guten-shrt-footer"},__("Do you also want to check premium version demo of this plugin.","wtpsw")," ",wp.element.createElement("a",{href:Wtpsw_Block.pro_demo_link,target:"_blank"},__("Click here","wtpsw"))))}}]),t}(p);t.a=_},function(e,t,n){"use strict";function l(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 r=function(){function e(e,t){for(var n=0;n<t.length;n++){var l=t[n];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}return function(t,n,l){return n&&e(t.prototype,n),l&&e(t,l),t}}(),s=wp.element,p=s.Component,i=s.Fragment,w=wp.components,m=w.PanelBody,c=w.TextControl,u=w.ToggleControl,d=w.Disabled,h=w.RangeControl,g=w.SelectControl,__=wp.i18n.__,f=(wp.data.select,wp.blockEditor),E=f.InspectorControls,b=f.BlockControls,y=f.BlockAlignmentToolbar,_=function(e){function t(){l(this,t);var e=a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.state={isLoading:!1},e}return o(t,e),r(t,[{key:"ObjToString",value:function(e){var t=wp.blocks.getBlockAttributes("wtpsw-free/trending-carousel"),n="";for(var l in e)e.hasOwnProperty(l)&&"undefined"!==typeof e[l]&&e[l]!==t[l]&&""!=jQuery.trim(e[l])&&(n+=l+'="'+e[l]+'" ');return n}},{key:"GetBooleanDropdown",value:function(){return[{value:"true",label:__("True","wtpsw")},{value:"false",label:__("False","wtpsw")}]}},{key:"GetLinkTargetDropdown",value:function(){return[{value:"self",label:__("Same Window","wtpsw")}]}},{key:"GetPostViewsOrderby",value:function(){return[{value:"views",label:__("Views","wtpsw")},{value:"comment",label:__("Comment Count","wtpsw")}]}},{key:"GetPostOrder",value:function(){return[{value:"desc",label:__("Descending","wtpsw")},{value:"asc",label:__("Ascending","wtpsw")}]}},{key:"GetLazyloadDropdown",value:function(){return[{value:"",label:__("Select Lazyload","wtpsw")}]}},{key:"componentDidMount",value:function(){}},{key:"componentDidUpdate",value:function(e){e.attributes}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.setAttributes,l=t.align,a=(t.className,t.showdate),o=t.showauthor,r=t.show_comment_count,s=t.hide_empty_comment_count,p=t.showcontent,w=t.words_limit,f=t.slides_to_show,_=t.slides_to_scroll,k=t.dots,v=t.arrows,C=t.autoplay,P=t.autoplayinterval,B=t.speed,N=t.limit,W=t.post_type,O=t.view_by,S=t.order,x=(this.state.isLoading,wp.element.createElement(E,null,wp.element.createElement(m,{title:__("General Parameters","wtpsw")},wp.element.createElement(u,{label:__("Show Date","wtpsw"),checked:!!a,onChange:function(){return n({showdate:!a})}}),wp.element.createElement(u,{label:__("Show Author","wtpsw"),checked:!!o,onChange:function(){return n({showauthor:!o})}}),wp.element.createElement(d,null,wp.element.createElement(u,{label:__("Show Views","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Show views. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,{label:__("Show Comment Count","wtpsw"),checked:!!r,onChange:function(){return n({show_comment_count:!r})}}),wp.element.createElement(u,{label:__("Hide Empty Comment Count","wtpsw"),checked:!!s,onChange:function(){return n({hide_empty_comment_count:!s})}}),wp.element.createElement(u,{label:__("Show Content","wtpsw"),checked:!!p,onChange:function(){return n({showcontent:!p})}}),1==p&&wp.element.createElement(h,{label:__("Words Limit","wtpsw"),value:w,onChange:function(e){return n({words_limit:e})},min:1,max:1e3}),wp.element.createElement(d,null,wp.element.createElement(g,{label:__("Link Behaviour","wtpsw"),options:this.GetLinkTargetDropdown(),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Choose link behaviour. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(d,null,wp.element.createElement(c,{label:__("Media Size","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Choose WordPress registered image size. e.g thumbnail, medium, large, full. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))}))),wp.element.createElement(m,{title:__("Slider Parameters","wtpsw"),initialOpen:!1},wp.element.createElement(h,{label:__("Slides To Show","wtpsw"),value:f,onChange:function(e){return n({slides_to_show:e})},min:1,max:1e3}),wp.element.createElement(h,{label:__("Slides To Scroll","wtpsw"),value:_,onChange:function(e){return n({slides_to_scroll:e})},min:1,max:1e3}),wp.element.createElement(g,{label:__("Dots","wtpsw"),value:k,options:this.GetBooleanDropdown(),onChange:function(e){return n({dots:e})},help:__("Show pagination dots.","wtpsw")}),wp.element.createElement(g,{label:__("Arrows","wtpsw"),value:v,options:this.GetBooleanDropdown(),onChange:function(e){return n({arrows:e})},help:__("Show prev - next arrows.","wtpsw")}),wp.element.createElement(g,{label:__("Autoplay","wtpsw"),value:C,options:this.GetBooleanDropdown(),onChange:function(e){return n({autoplay:e})}}),"true"==C&&wp.element.createElement(h,{label:__("Autoplay Interval","wtpsw"),value:P,onChange:function(e){return n({autoplayinterval:e})},min:100,max:5e4,help:__("Enter autoplay interval speed.","wtpsw")}),wp.element.createElement(h,{label:__("Speed","wtpsw"),value:B,onChange:function(e){return n({speed:e})},min:100,max:5e4,help:__("Enter slide speed.","wtpsw")}),wp.element.createElement(d,null,wp.element.createElement(g,{label:__("Loop","wtpsw"),options:this.GetBooleanDropdown(),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enable infinite loop for continuous sliding. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(d,null,wp.element.createElement(g,{label:__("Centermode","wtpsw"),options:this.GetBooleanDropdown(),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enable centered view with partial prev/next slides. Use with odd numbered `Slides to Scroll` and `Slider Column` counts. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(d,null,wp.element.createElement(g,{label:__("Pause On Hover","wtpsw"),options:this.GetBooleanDropdown(),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Pause slider autoplay on hover. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(d,null,wp.element.createElement(g,{label:__("Pause On Focus","wtpsw"),options:this.GetBooleanDropdown(),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Pause slider autoplay when slider element is focused. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(d,null,wp.element.createElement(h,{label:__("Slider Height","wtpsw"),min:0,max:5e3,help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Control height of the trending image. You can enter any numeric number. e.g 500. Leave empty for default height. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(d,null,wp.element.createElement(g,{label:__("Slider Lazyload","wtpsw"),options:this.GetLazyloadDropdown(),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Select option to use lazy loading in slider. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))}))),wp.element.createElement(m,{title:__("Query Parameters","wtpsw"),initialOpen:!1},wp.element.createElement(h,{label:__("Limit","wtpsw"),value:N,onChange:function(e){return n({limit:e})},min:-1,max:1e3,help:__("Enter number of trending post to be displayed. Enter -1 to display all.","wtpsw")}),wp.element.createElement(c,{label:__("Post Type","wtpsw"),value:W,onChange:function(e){return n({post_type:e})},help:wp.element.createElement("span",{title:__("Note: Be sure you have added valid post type name otherwise no result will be displayed.","wtpsw")},__("Enter registered post type name. You can find it on plugin setting page.","wtpsw")," [?]")}),wp.element.createElement(d,null,wp.element.createElement(c,{label:__("Taxonomy","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enter registered taxonomy name. You can find it on plugin setting page. Note: Be sure you have added valid taxonomy name otherwise no result will be displayed. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(g,{label:__("View By","wtpsw"),value:O,options:this.GetPostViewsOrderby(),onChange:function(e){return n({view_by:e})}}),wp.element.createElement(g,{label:__("Order","wtpsw"),value:S,options:this.GetPostOrder(),onChange:function(e){return n({order:e})}}),wp.element.createElement(d,null,wp.element.createElement(c,{label:__("Display Specific Category","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enter category id to display categories wise. You can pass multiple ids with comma seperated. You can find id at relevant category listing page. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(d,null,wp.element.createElement(g,{label:__("Display Child Category","wtpsw"),options:this.GetBooleanDropdown(),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("If you are using parent category then whether to display child category or not. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(d,null,wp.element.createElement(c,{label:__("Exclude Category","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Exclude post category. Works only if `Category` field is empty. You can pass multiple ids with comma seperated. You can find id at relevant category listing page. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(d,null,wp.element.createElement(c,{label:__("Display Specific Posts","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enter id of the post which you want to display. You can pass multiple ids with comma seperated. You can find id at relevant post listing page. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(d,null,wp.element.createElement(c,{label:__("Exclude Post","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enter id of the post which you do not want to display. You can pass multiple ids with comma seperated. You can find id at relevant post listing page. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(d,null,wp.element.createElement(c,{label:__("Include Author","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enter author id to display posts of particular author. You can pass multiple ids with comma seperated. You can find id at users listing page. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(d,null,wp.element.createElement(c,{label:__("Exclude Author","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enter author id to hide post of particular author. Works only if `Include Author` field is empty. You can pass multiple ids with comma seperated. You can find id at relevant users listing page. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(d,null,wp.element.createElement(h,{label:__("Query Offset","wtpsw"),min:0,max:100,help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Exclude number of posts from starting. e.g if you pass 5 then it will skip first five post. Note: This will not work with limit=-1. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})))));return wp.element.createElement(i,null,x,wp.element.createElement(b,null,wp.element.createElement(y,{value:l,onChange:function(e){return n({align:e})},controls:["wide","full"]})),wp.element.createElement("div",{className:this.props.className},this.renderOutput()))}},{key:"renderOutput",value:function(){var e=this.props.attributes,t=this.ObjToString(e);t=t.trim();var n=t?"[wtpsw_carousel "+t+"]":"[wtpsw_carousel]";return wp.element.createElement("div",{className:"wpos-pro-guten-shrt"},wp.element.createElement("div",{className:"wpos-pro-guten-shrt-title"},wp.element.createElement("span",null,__("WP Trending Post Slider and Widget - Carousel","wtpsw"))),n,wp.element.createElement("div",{className:"wpos-guten-shrt-footer"},wp.element.createElement("span",null),__("Do you want to check demo of this plugin.","wtpsw")," ",wp.element.createElement("a",{href:Wtpsw_Block.free_demo_link,target:"_blank"},__("Click here","wtpsw"))),wp.element.createElement("div",{className:"wpos-guten-shrt-footer"},__("Do you also want to check premium version demo of this plugin.","wtpsw")," ",wp.element.createElement("a",{href:Wtpsw_Block.pro_demo_link,target:"_blank"},__("Click here","wtpsw"))))}}]),t}(p);t.a=_},function(e,t,n){"use strict";function l(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 r=function(){function e(e,t){for(var n=0;n<t.length;n++){var l=t[n];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}return function(t,n,l){return n&&e(t.prototype,n),l&&e(t,l),t}}(),s=wp.element,p=s.Component,i=s.Fragment,w=wp.components,m=w.PanelBody,c=w.TextControl,u=w.Disabled,d=w.ToggleControl,h=w.RangeControl,g=w.SelectControl,__=wp.i18n.__,f=(wp.data.select,wp.blockEditor),E=f.InspectorControls,b=f.BlockControls,y=f.BlockAlignmentToolbar,_=function(e){function t(){l(this,t);var e=a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.state={isLoading:!1},e}return o(t,e),r(t,[{key:"ObjToString",value:function(e){var t=wp.blocks.getBlockAttributes("wtpsw-free/trending-gridbox"),n="";for(var l in e)e.hasOwnProperty(l)&&"undefined"!==typeof e[l]&&e[l]!==t[l]&&""!=jQuery.trim(e[l])&&(n+=l+'="'+e[l]+'" ');return n}},{key:"GetBooleanDropdown",value:function(){return[{value:"true",label:__("True","wtpsw")},{value:"false",label:__("False","wtpsw")}]}},{key:"GetLinkTargetDropdown",value:function(){return[{value:"self",label:__("Same Window","wtpsw")}]}},{key:"GetPostViewsOrderby",value:function(){return[{value:"views",label:__("Views","wtpsw")},{value:"comment",label:__("Comment Count","wtpsw")}]}},{key:"GetPostOrder",value:function(){return[{value:"desc",label:__("Descending","wtpsw")},{value:"asc",label:__("Ascending","wtpsw")}]}},{key:"GetPaginationType",value:function(){return[{value:"numeric",label:__("Numeric Pagination","wtpsw")}]}},{key:"componentDidMount",value:function(){}},{key:"componentDidUpdate",value:function(e){e.attributes}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.setAttributes,l=t.align,a=(t.className,t.showdate),o=t.showauthor,r=t.show_comment_count,s=t.hide_empty_comment_count,p=t.showcontent,w=t.words_limit,f=t.limit,_=t.post_type,k=t.view_by,v=t.order,C=(this.state.isLoading,wp.element.createElement(E,null,wp.element.createElement(m,{title:__("General Parameters","wtpsw")},wp.element.createElement(d,{label:__("Show Date","wtpsw"),checked:!!a,onChange:function(){return n({showdate:!a})}}),wp.element.createElement(d,{label:__("Show Author","wtpsw"),checked:!!o,onChange:function(){return n({showauthor:!o})}}),wp.element.createElement(u,null,wp.element.createElement(d,{label:__("Show Views","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Show views. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(d,{label:__("Show Comment Count","wtpsw"),checked:!!r,onChange:function(){return n({show_comment_count:!r})}}),wp.element.createElement(d,{label:__("Hide Empty Comment Count","wtpsw"),checked:!!s,onChange:function(){return n({hide_empty_comment_count:!s})}}),wp.element.createElement(d,{label:__("Show Content","wtpsw"),checked:!!p,onChange:function(){return n({showcontent:!p})}}),1==p&&wp.element.createElement(h,{label:__("Words Limit","wtpsw"),value:w,onChange:function(e){return n({words_limit:e})},min:1,max:1e3}),wp.element.createElement(u,null,wp.element.createElement(h,{label:__("Image Height","wtpsw"),min:0,max:5e3,help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Control height of the trending image. You can enter any numeric number. e.g 500. Leave empty for default height. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(g,{label:__("Link Behaviour","wtpsw"),options:this.GetLinkTargetDropdown(),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Choose link behaviour. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(c,{label:__("Media Size","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Choose WordPress registered image size. e.g thumbnail, medium, large, full. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))}))),wp.element.createElement(m,{title:__("Query Parameters","wtpsw"),initialOpen:!1},wp.element.createElement(h,{label:__("Limit","wtpsw"),value:f,onChange:function(e){return n({limit:e})},min:-1,max:1e3,help:__("Enter number of trending post to be displayed. Enter -1 to display all.","wtpsw")}),wp.element.createElement(c,{label:__("Post Type","wtpsw"),value:_,onChange:function(e){return n({post_type:e})},help:wp.element.createElement("span",{title:__("Note: Be sure you have added valid post type name otherwise no result will be displayed.","wtpsw")},__("Enter registered post type name. You can find it on plugin setting page.","wtpsw")," [?]")}),wp.element.createElement(u,null,wp.element.createElement(c,{label:__("Taxonomy","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enter registered taxonomy name. You can find it on plugin setting page. Note: Be sure you have added valid taxonomy name otherwise no result will be displayed. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(g,{label:__("View By","wtpsw"),value:k,options:this.GetPostViewsOrderby(),onChange:function(e){return n({view_by:e})}}),wp.element.createElement(g,{label:__("Order","wtpsw"),value:v,options:this.GetPostOrder(),onChange:function(e){return n({order:e})}}),wp.element.createElement(u,null,wp.element.createElement(c,{label:__("Display Specific Category","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enter category id to display categories wise. You can pass multiple ids with comma seperated. You can find id at relevant category listing page. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(g,{label:__("Display Child Category","wtpsw"),options:this.GetBooleanDropdown(),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("If you are using parent category then whether to display child category or not. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(c,{label:__("Exclude Category","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Exclude post category. Works only if `Category` field is empty. You can pass multiple ids with comma seperated. You can find id at relevant category listing page. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(c,{label:__("Display Specific Posts","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enter id of the post which you want to display. You can pass multiple ids with comma seperated. You can find id at relevant post listing page. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(c,{label:__("Exclude Post","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enter id of the post which you do not want to display. You can pass multiple ids with comma seperated. You can find id at relevant post listing page. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(c,{label:__("Include Author","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enter author id to display posts of particular author. You can pass multiple ids with comma seperated. You can find id at users listing page. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(c,{label:__("Exclude Author","wtpsw"),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Enter author id to hide post of particular author. Works only if `Include Author` field is empty. You can pass multiple ids with comma seperated. You can find id at relevant users listing page. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(g,{label:__("Pagination","wtpsw"),options:this.GetBooleanDropdown(),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Display pagination. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(g,{label:__("Pagination Type","wtpsw"),options:this.GetPaginationType(),help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Choose pagination type. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})),wp.element.createElement(u,null,wp.element.createElement(h,{label:__("Query Offset","wtpsw"),min:0,max:100,help:wp.element.createElement("span",{className:"wpos-hidden-opts-desc"},__("Exclude number of posts from starting. e.g if you pass 5 then it will skip first five post. Note: This will not work with limit=-1. Upgarade to ","wtpsw"),wp.element.createElement("a",{href:Wtpsw_Block.pro_link,target:"_blank"},__("Premium version ","wtpsw")),__("to get this option.","wtpsw"))})))));return wp.element.createElement(i,null,C,wp.element.createElement(b,null,wp.element.createElement(y,{value:l,onChange:function(e){return n({align:e})},controls:["wide","full"]})),wp.element.createElement("div",{className:this.props.className},this.renderOutput()))}},{key:"renderOutput",value:function(){var e=this.props.attributes,t=this.ObjToString(e);t=t.trim();var n=t?"[wtpsw_gridbox "+t+"]":"[wtpsw_gridbox]";return wp.element.createElement("div",{className:"wpos-pro-guten-shrt"},wp.element.createElement("div",{className:"wpos-pro-guten-shrt-title"},wp.element.createElement("span",null,__("WP Trending Post Slider and Widget - Gridbox","wtpsw"))),n,wp.element.createElement("div",{className:"wpos-guten-shrt-footer"},wp.element.createElement("span",null),__("Do you want to check demo of this plugin.","wtpsw")," ",wp.element.createElement("a",{href:Wtpsw_Block.free_demo_link,target:"_blank"},__("Click here","wtpsw"))),wp.element.createElement("div",{className:"wpos-guten-shrt-footer"},__("Do you also want to check premium version demo of this plugin.","wtpsw")," ",wp.element.createElement("a",{href:Wtpsw_Block.pro_demo_link,target:"_blank"},__("Click here","wtpsw"))))}}]),t}(p);t.a=_}]);