X7ROOT File Manager
Current Path:
/home/notabjze/caribbeansee.com/wp-content/plugins/feedzy-rss-feeds/js/build
home
/
notabjze
/
caribbeansee.com
/
wp-content
/
plugins
/
feedzy-rss-feeds
/
js
/
build
/
ðŸ“
..
📄
action-popup.asset.php
(173 B)
📄
action-popup.js
(52.93 KB)
📄
block.asset.php
(91 B)
📄
block.js
(39.04 KB)
📄
feedback.asset.php
(146 B)
📄
feedback.js
(4.81 KB)
📄
import-onboarding.asset.php
(156 B)
📄
import-onboarding.js
(98.67 KB)
📄
style-block-rtl.css
(4.23 KB)
📄
style-block.css
(4.23 KB)
Editing: block.js
(()=>{var e,t={663:(e,t,s)=>{"use strict";const a=window.React;var r=s(44);const{isEmpty:i}=lodash,{BaseControl:o}=wp.components,{withInstanceId:l}=wp.compose,n=l((function({label:e,selected:t,help:s,instanceId:r,onChange:l,disabled:n,options:p=[]}){const d=`inspector-radio-image-control-${r}`,u=e=>l(e.target.value);return!i(p)&&(0,a.createElement)(o,{label:e,id:d,help:s,className:"components-radio-image-control feedzy-template"},(0,a.createElement)("div",{className:"components-radio-image-control__container"},p.map(((e,r)=>(0,a.createElement)("div",{key:`${d}-${r}`,className:"components-radio-image-control__option"},(0,a.createElement)("input",{id:`${d}-${r}`,className:"components-radio-image-control__input",type:"radio",name:d,value:e.value,onChange:u,checked:e.value===t,"aria-describedby":s?`${d}__help`:void 0,disabled:n}),(0,a.createElement)("label",{htmlFor:`${d}-${r}`,title:e.label},(0,a.createElement)("img",{src:e.src}),(0,a.createElement)("span",{class:"image-clickable"})),(0,a.createElement)("span",null,e.label))))))}));var p=s(485),d=s.n(p);const{__}=wp.i18n,{applyFilters:u}=wp.hooks,{InspectorControls:c,MediaUpload:m}=wp.blockEditor||wp.editor,{Component:h,Fragment:f}=wp.element,{BaseControl:y,ExternalLink:b,PanelBody:g,RangeControl:v,TextControl:E,TextareaControl:w,Button:z,ToggleControl:k,SelectControl:T,ResponsiveWrapper:C,Dashicon:N}=wp.components,x=class extends h{constructor(){super(...arguments),this.state={tab:"content"}}render(){let e="",t=u("feedzy_widget_refresh_feed",[{label:__("1 Hour"),value:"1_hours"},{label:__("2 Hours"),value:"3_hours"},{label:__("12 Hours"),value:"12_hours"},{label:__("1 Day"),value:"1_days"},{label:__("3 Days"),value:"3_days"},{label:__("15 Days"),value:"15_days"}]);return"https"===this.props.attributes.http&&(e+=__("Please verify that the images exist on HTTPS.")),(0,a.createElement)(f,null,(0,a.createElement)(c,{key:"inspector"},(0,a.createElement)(g,{className:"fz-section-header-panel"},(0,a.createElement)(z,{className:d()("header-tab",{"is-selected":"content"===this.state.tab}),onClick:()=>this.setState({tab:"content"})},(0,a.createElement)("span",null,(0,a.createElement)(N,{icon:"editor-table"}),__("Content"))),(0,a.createElement)(z,{className:d()("header-tab",{"is-selected":"style"===this.state.tab}),onClick:()=>this.setState({tab:"style"})},(0,a.createElement)("span",null,(0,a.createElement)(N,{icon:"admin-customizer"}),__("Style"))),(0,a.createElement)(z,{className:d()("header-tab",{"is-selected":"advanced"===this.state.tab}),onClick:()=>this.setState({tab:"advanced"})},(0,a.createElement)("span",null,(0,a.createElement)(N,{icon:"admin-generic"}),__("Advanced")))),"content"===this.state.tab&&(0,a.createElement)(f,null,(0,a.createElement)(g,{title:__("Feed Source"),initialOpen:!0},0!==this.props.attributes.status&&!feedzyjs.isPro&&[(0,a.createElement)("div",{className:"fz-upgrade-alert"},(0,a.createElement)("strong",null,__("NEW!")," "),__("Enable Amazon Product Advertising feeds to generate affiliate revenue by "),(0,a.createElement)(b,{href:"https://themeisle.com/plugins/feedzy-rss-feeds/upgrade/?utm_source=wpadmin&utm_medium=blockeditor&utm_campaign=amazonproductadvertising&utm_content=feedzy-rss-feeds"},__("upgrading to Feedzy Pro.")),(0,a.createElement)(N,{icon:"no-alt",onClick:e=>{e.target.parentNode.style.display="none"}}))],0!==this.props.attributes.status&&[(0,a.createElement)(E,{label:__("Feed Source"),className:"feedzy-source",value:this.props.attributes.feeds,onChange:this.props.edit.onChangeFeed}),(0,a.createElement)(z,{isLarge:!0,isPrimary:!0,type:"submit",onClick:this.props.edit.loadFeed,className:"loadFeed"},__("Load Feed")),(0,a.createElement)(w,{label:__("Message to show when feed is empty"),value:this.props.attributes.error_empty,onChange:this.props.edit.onErrorEmpty})],"fetched"===this.props.state.route&&[(0,a.createElement)(v,{label:__("Number of Items"),value:Number(this.props.attributes.max)||5,onChange:this.props.edit.onChangeMax,min:1,max:this.props.attributes.feedData.items.length||10,beforeIcon:"sort",className:"feedzy-max"}),(0,a.createElement)(T,{label:__("Sorting Order"),value:this.props.attributes.sort,options:[{label:__("Default"),value:"default"},{label:__("Date Descending"),value:"date_desc"},{label:__("Date Ascending"),value:"date_asc"},{label:__("Title Descending"),value:"title_desc"},{label:__("Title Ascending"),value:"title_asc"}],onChange:this.props.edit.onSort,className:"feedzy-sort"}),(0,a.createElement)(T,{label:__("Feed Caching Time"),value:this.props.attributes.refresh,options:t,onChange:this.props.edit.onRefresh,className:"feedzy-refresh"})]),(0,a.createElement)(g,{title:__("Item Options"),initialOpen:!1,className:"feedzy-item-options"},(0,a.createElement)(T,{label:__("Open Links In"),value:this.props.attributes.target,options:[{label:__("New Tab"),value:"_blank"},{label:__("Same Tab"),value:"_self"}],onChange:this.props.edit.onTarget}),(0,a.createElement)(T,{label:__('Make this link a "nofollow" link?'),value:this.props.attributes.follow,options:[{label:__("No"),value:"no"},{label:__("Yes"),value:"yes"}],onChange:this.props.edit.onLinkNoFollow}),(0,a.createElement)(k,{label:__("Display item Title"),checked:!!this.props.attributes.itemTitle,onChange:this.props.edit.onToggleItemTitle,className:"feedzy-summary"}),this.props.attributes.itemTitle&&(0,a.createElement)(E,{label:__("Title Character Limit"),help:__("Leave empty to show full title. A value of 0 will remove the title."),type:"number",value:this.props.attributes.title,onChange:this.props.edit.onTitle,className:"feedzy-title-length"}),(0,a.createElement)(k,{label:__("Display post description?"),checked:!!this.props.attributes.summary,onChange:this.props.edit.onToggleSummary,className:"feedzy-summary"}),this.props.attributes.summary&&(0,a.createElement)(E,{label:__("Description Character Limit"),help:__("Leave empty to show full description."),type:"number",value:this.props.attributes.summarylength,onChange:this.props.edit.onSummaryLength,className:"feedzy-summary-length",min:0})),(0,a.createElement)(g,{title:[__("Filter items"),!feedzyjs.isPro&&(0,a.createElement)("span",{className:"fz-pro-label"},"Pro")],initialOpen:!1,className:feedzyjs.isPro?"feedzy-item-filter":"feedzy-item-filter fz-locked"},!feedzyjs.isPro&&(0,a.createElement)("div",{className:"fz-upsell-notice"},__("Unlock this feature and more advanced options with")," ",(0,a.createElement)(b,{href:"https://themeisle.com/plugins/feedzy-rss-feeds/upgrade/?utm_source=wpadmin&utm_medium=blockeditor&utm_campaign=keywordsfilter&utm_content=feedzy-rss-feeds"},__("Feedzy Pro"))),(0,a.createElement)(E,{label:__("Only display if selected field contains:"),help:__("Use comma(,) and plus(+) keyword"),value:this.props.attributes.keywords_title,onChange:this.props.edit.onKeywordsTitle,className:"feedzy-include"}),(0,a.createElement)(T,{label:__("Select a field if you want to inc keyword."),value:this.props.attributes.keywords_inc_on,options:[{label:__("Title"),value:"title"},{label:__("Author"),value:"author"},{label:__("Description"),value:"description"}],onChange:this.props.edit.onKeywordsIncludeOn}),(0,a.createElement)(E,{label:__("Exclude if selected field contains:"),help:__("Use comma(,) and plus(+) keyword"),value:this.props.attributes.keywords_ban,onChange:this.props.edit.onKeywordsBan,className:"feedzy-ban"}),(0,a.createElement)(T,{label:__("Select a field if you want to exc keyword."),value:this.props.attributes.keywords_exc_on,options:[{label:__("Title"),value:"title"},{label:__("Author"),value:"author"},{label:__("Description"),value:"description"}],onChange:this.props.edit.onKeywordsExcludeOn}),(0,a.createElement)("p",{className:"fz-main-label"},__("Filter feed item by date range.")),(0,a.createElement)(E,{type:"datetime-local",label:__("From:"),value:this.props.attributes.from_datetime,onChange:this.props.edit.onFromDateTime}),(0,a.createElement)(E,{type:"datetime-local",label:__("To:"),value:this.props.attributes.to_datetime,onChange:this.props.edit.onToDateTime}))),"fetched"===this.props.state.route&&"style"===this.state.tab&&[(0,a.createElement)(f,null,(0,a.createElement)(g,{title:__("Item Image Options"),initialOpen:!1,className:"feedzy-image-options"},(0,a.createElement)(T,{label:__("Display first image if available?"),value:this.props.attributes.thumb,options:[{label:__("Yes (without a fallback image)"),value:"auto"},{label:__("Yes (with a fallback image)"),value:"yes"},{label:__("No"),value:"no"}],onChange:this.props.edit.onThumb,className:"feedzy-thumb"}),"no"!==this.props.attributes.thumb&&["auto"!==this.props.attributes.thumb&&(0,a.createElement)("div",{className:"feedzy-blocks-base-control"},(0,a.createElement)("label",{className:"blocks-base-control__label",for:"inspector-media-upload"},__("Fallback image if no image is found.")),(0,a.createElement)(m,{type:"image",id:"inspector-media-upload",value:this.props.attributes.default,onSelect:this.props.edit.onDefault,render:({open:e})=>[void 0!==this.props.attributes.default&&[(0,a.createElement)(C,{naturalWidth:this.props.attributes.default.width,naturalHeight:this.props.attributes.default.height},(0,a.createElement)("img",{src:this.props.attributes.default.url,alt:__("Featured image")})),(0,a.createElement)(z,{isLarge:!0,isSecondary:!0,onClick:()=>this.props.setAttributes({default:void 0}),style:{marginTop:"10px"}},__("Remove Image"))],(0,a.createElement)(z,{isLarge:!0,isPrimary:!0,onClick:e,style:{marginTop:"10px"},className:void 0===this.props.attributes.default&&"feedzy_image_upload"},__("Upload Image"))]})),(0,a.createElement)(E,{label:__("Thumbnails dimension."),type:"number",value:this.props.attributes.size,onChange:this.props.edit.onSize}),(0,a.createElement)(T,{label:__("How should we treat HTTP images?"),value:this.props.attributes.http,options:[{label:__("Show with HTTP link"),value:"auto"},{label:__("Force HTTPS"),value:"https"},{label:__("Ignore and show the default image instead"),value:"default"}],onChange:this.props.edit.onHTTP,className:"feedzy-http",help:e})]),(0,a.createElement)(g,{title:[__("Feed Layout"),!feedzyjs.isPro&&(0,a.createElement)("span",{className:"fz-pro-label"},"Pro")],initialOpen:!1,className:feedzyjs.isPro?"feedzy-layout":"feedzy-layout fz-locked"},!feedzyjs.isPro&&(0,a.createElement)("div",{className:"fz-upsell-notice"},__("Unlock this feature and more advanced options with")," ",(0,a.createElement)(b,{href:"https://themeisle.com/plugins/feedzy-rss-feeds/upgrade/?utm_source=wpadmin&utm_medium=blockeditor&utm_campaign=layouts&utm_content=feedzy-rss-feeds"},__("Feedzy Pro"))),(0,a.createElement)(v,{label:__("Columns"),help:__("How many columns we should use to display the feed items?"),value:this.props.attributes.columns||1,onChange:this.props.edit.onColumns,min:1,max:6,beforeIcon:"sort",allowReset:!0}),(0,a.createElement)(n,{label:__("Template"),selected:this.props.attributes.template,options:[{label:__("Default"),src:feedzyjs.imagepath+"feedzy-default-template.png",value:"default"},{label:__("Round"),src:feedzyjs.imagepath+"feedzy-style1-template.png",value:"style1"},{label:__("Cards"),src:feedzyjs.imagepath+"feedzy-style2-template.png",value:"style2"}],onChange:this.props.edit.onTemplate})),(0,a.createElement)(g,{title:__("Disable default style"),initialOpen:!1,className:"feedzy-disable-style"},(0,a.createElement)(k,{label:__("Disable default style?"),checked:!!this.props.attributes.disableStyle,onChange:this.props.edit.onToggleDisableStyle,className:"feedzy-summary",help:__("If disabled, it will be considered the global setting.")})))],"fetched"===this.props.state.route&&"advanced"===this.state.tab&&[(0,a.createElement)(f,null,(0,a.createElement)(g,{title:__("Feed Items Custom Options"),className:"feedzy-advanced-options",initialOpen:!1},(0,a.createElement)(y,null,(0,a.createElement)(E,{label:feedzyjs.isPro?__("Should we display additional meta fields out of author, date, time or categories? (comma-separated list, in order of display)."):__("Should we display additional meta fields out of author, date or time? (comma-separated list, in order of display)."),help:__('Leave empty to display all and "no" to display nothing.'),placeholder:feedzyjs.isPro?__("(eg: author, date, time, tz=local, categories)"):__("(eg: author, date, time, tz=local)"),value:this.props.attributes.metafields,onChange:this.props.edit.onChangeMeta,className:"feedzy-meta"}),(0,a.createElement)(E,{label:__("When using multiple sources, should we display additional meta fields? - source (comma-separated list)."),placeholder:__("(eg: source)"),value:this.props.attributes.multiple_meta,onChange:this.props.edit.onChangeMultipleMeta,className:"feedzy-multiple-meta"}),(0,a.createElement)(b,{href:"https://docs.themeisle.com/article/1089-how-to-display-author-date-or-time-from-the-feed"},__("You can find more info about available meta field values here."))),(0,a.createElement)(k,{label:__("Display price if available?"),help:this.props.attributes.price&&"default"===this.props.attributes.template?__("Choose a different template for this to work."):null,checked:!!this.props.attributes.price,onChange:this.props.edit.onTogglePrice,className:feedzyjs.isPro?"feedzy-pro-price":"feedzy-pro-price fz-locked"}),null!==this.props.attributes.feedData.channel&&(0,a.createElement)(k,{label:__("Display feed title?"),checked:!!this.props.attributes.feed_title,onChange:this.props.edit.onToggleFeedTitle,className:"feedzy-title"}),(0,a.createElement)(v,{label:__("Ignore first N items"),value:Number(this.props.attributes.offset)||0,onChange:this.props.edit.onChangeOffset,min:0,max:this.props.attributes.feedData.items.length,beforeIcon:"sort",className:"feedzy-offset"}),(0,a.createElement)(k,{label:__("Lazy load feed?"),checked:!!this.props.attributes.lazy,onChange:this.props.edit.onToggleLazy,className:"feedzy-lazy",help:__("Only on the front end.")})),(0,a.createElement)(g,{title:[__("Referral URL"),!feedzyjs.isPro&&(0,a.createElement)("span",{className:"fz-pro-label"},"Pro")],initialOpen:!1,className:feedzyjs.isPro?"feedzy-pro-options":"feedzy-pro-options fz-locked"},!feedzyjs.isPro&&(0,a.createElement)("div",{className:"fz-upsell-notice"},__("Unlock this feature and more advanced options with")," ",(0,a.createElement)(b,{href:"https://themeisle.com/plugins/feedzy-rss-feeds/upgrade/?utm_source=wpadmin&utm_medium=blockeditor&utm_campaign=refferal&utm_content=feedzy-rss-feeds"},__("Feedzy Pro"))),(0,a.createElement)(E,{label:__("Referral URL parameters."),help:__('Without ("?")'),placeholder:_("(eg. promo_code=feedzy_is_awesome)"),value:this.props.attributes.referral_url,onChange:this.props.edit.onReferralURL})),(0,a.createElement)(g,{title:__("Additional options"),initialOpen:!1,className:"feedzy-additional-options"},(0,a.createElement)(E,{label:__("Wrap custom class"),value:this.props.attributes.className,onChange:this.props.edit.onclassName}),(0,a.createElement)(T,{label:__("Dry run?"),value:this.props.attributes._dryrun_,options:[{label:__("No"),value:"no"},{label:__("Yes"),value:"yes"}],onChange:this.props.edit.onDryRun}),(0,a.createElement)(E,{label:__("Dry run tags"),value:this.props.attributes._dry_run_tags_,onChange:this.props.edit.onDryRunTags})))]))}},F=e=>{const t=document.createElement("div");return t.innerHTML=e,void 0!==t.innerText?t.innerText:t.textContent},S=(e="")=>{let t="",s=[];return""!==e&&e.replace(/[^a-zA-Z]/g,"").length<=500&&(e.split(",").forEach((e=>{""!==(e=e.trim())&&(e=e.split("+").map((e=>"(?=.*"+(e=e.trim())+")")),s.push(e.join("")))})),t=s.join("|"),t="^"+t+".*$",t=new RegExp(t,"i")),t},{__:j}=wp.i18n,{apiFetch:O,apiRequest:A}=wp,{Component:D,Fragment:R}=wp.element,{ExternalLink:L,Placeholder:P,TextControl:U,Button:I,Spinner:M}=wp.components,{date:$}=wp.date,{__:K}=wp.i18n,{registerBlockType:H}=wp.blocks;H("feedzy-rss-feeds/feedzy-block",{title:K("Feedzy RSS Feeds"),category:"common",icon:"rss",keywords:[K("Feedzy RSS Feeds"),K("RSS"),K("Feeds")],supports:{html:!1},attributes:{feeds:{type:"string"},max:{type:"number",default:5},offset:{type:"number",default:0},feed_title:{type:"boolean",default:!0},refresh:{type:"string",default:"12_hours"},sort:{type:"string",default:"default"},target:{type:"string",default:"_blank"},title:{type:"number"},meta:{type:"boolean",default:!0},lazy:{type:"boolean",default:!1},metafields:{type:"string",default:""},multiple_meta:{type:"string",default:""},summary:{type:"boolean",default:!0},summarylength:{type:"number"},keywords_title:{type:"string"},keywords_inc_on:{type:"string",default:"title"},keywords_ban:{type:"string"},keywords_exc_on:{type:"string",default:"title"},thumb:{type:"string",default:"auto"},default:{type:"object"},size:{type:"number",default:150},http:{type:"string"},referral_url:{type:"string"},columns:{type:"number",default:1},template:{type:"string",default:"default"},price:{type:"boolean",default:!0},route:{type:"string",default:"home"},feedData:{type:"object"},categories:{type:"object"},from_datetime:{type:"string"},to_datetime:{type:"string"},itemTitle:{type:"boolean",default:!0},disableStyle:{type:"boolean",default:!1},follow:{type:"string",default:"no"},error_empty:{type:"string",default:""},className:{type:"string",default:""},_dryrun_:{type:"string",default:"no"},_dry_run_tags_:{type:"string",default:""}},edit:class extends D{constructor(){super(...arguments),this.loadFeed=this.loadFeed.bind(this),this.loadCategories=this.loadCategories.bind(this),this.metaExists=this.metaExists.bind(this),this.multipleMetaExists=this.multipleMetaExists.bind(this),this.getImageURL=this.getImageURL.bind(this),this.getValidateURL=this.getValidateURL.bind(this),this.onChangeFeed=this.onChangeFeed.bind(this),this.onChangeMax=this.onChangeMax.bind(this),this.onChangeOffset=this.onChangeOffset.bind(this),this.onToggleFeedTitle=this.onToggleFeedTitle.bind(this),this.onRefresh=this.onRefresh.bind(this),this.onSort=this.onSort.bind(this),this.onTarget=this.onTarget.bind(this),this.onTitle=this.onTitle.bind(this),this.onChangeMeta=this.onChangeMeta.bind(this),this.onChangeMultipleMeta=this.onChangeMultipleMeta.bind(this),this.onToggleSummary=this.onToggleSummary.bind(this),this.onToggleLazy=this.onToggleLazy.bind(this),this.onSummaryLength=this.onSummaryLength.bind(this),this.onKeywordsTitle=this.onKeywordsTitle.bind(this),this.onKeywordsBan=this.onKeywordsBan.bind(this),this.onThumb=this.onThumb.bind(this),this.onDefault=this.onDefault.bind(this),this.onSize=this.onSize.bind(this),this.onHTTP=this.onHTTP.bind(this),this.onReferralURL=this.onReferralURL.bind(this),this.onColumns=this.onColumns.bind(this),this.onTemplate=this.onTemplate.bind(this),this.onTogglePrice=this.onTogglePrice.bind(this),this.onKeywordsIncludeOn=this.onKeywordsIncludeOn.bind(this),this.onKeywordsExcludeOn=this.onKeywordsExcludeOn.bind(this),this.onFromDateTime=this.onFromDateTime.bind(this),this.onToDateTime=this.onToDateTime.bind(this),this.feedzyCategoriesList=this.feedzyCategoriesList.bind(this),this.onToggleItemTitle=this.onToggleItemTitle.bind(this),this.onToggleDisableStyle=this.onToggleDisableStyle.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this),this.onLinkNoFollow=this.onLinkNoFollow.bind(this),this.onErrorEmpty=this.onErrorEmpty.bind(this),this.onclassName=this.onclassName.bind(this),this.onDryRun=this.onDryRun.bind(this),this.onDryRunTags=this.onDryRunTags.bind(this),this.state={route:this.props.attributes.route,loading:!1,error:!1}}async componentDidMount(){this.loadFeed(),void 0===this.props.attributes.categories&&(this.props.attributes.meta||this.props.setAttributes({meta:!0,metafields:"no"}),setTimeout((()=>{this.loadCategories()})))}async componentDidUpdate(e){"reload"===this.state.route&&this.loadFeed()}loadFeed(){let e=this.props.attributes.feeds;if(void 0!==e){if(((e,t)=>{if(void 0===t)return!1;let s=!1;for(let a=0;a<t.length;a++)if(t[a]===e){s=!0;break}return s})(e,this.props.attributes.categories)){let t=e;e=r.stringify({category:t},{arrayFormat:"bracket"})}else e=e.replace(/\s/g,"").split(",").filter((e=>""!==e)),e=r.stringify({url:e},{arrayFormat:"bracket"});this.setState({route:"home",loading:!0}),A({path:`/feedzy/v1/feed?${e}`,method:"POST",data:this.props.attributes}).then((e=>this.unmounting?e:e.error?(this.setState({route:"home",loading:!1,error:!0}),e):(this.props.setAttributes({feedData:e}),this.setState({route:"fetched",loading:!1}),e))).fail((e=>(this.setState({route:"home",loading:!1,error:!0}),e)))}}loadCategories(){A({path:"/wp/v2/feedzy_categories?per_page=100"}).then((e=>{if(this.unmounting)return e;let t=0,s=[];e.forEach((e=>{s[t]=e.slug,t+=1}));let a=this;a.props.setAttributes({categories:s});var r=jQuery('iframe[name="editor-canvas"]'),i=jQuery(".feedzy-source input");r.length>0&&(i=jQuery(".feedzy-source input",r.contents())),i.autocomplete({disabled:!1}).autocomplete({classes:{"ui-autocomplete":"feedzy-ui-autocomplete"},source:s,minLength:0,select:function(e,t){a.props.setAttributes({feeds:t.item.label})}})})).fail((e=>e))}metaExists(e){return 0<=this.props.attributes.metafields.replace(/\s/g,"").split(",").indexOf(e)||""===this.props.attributes.metafields}multipleMetaExists(e){return 0<=this.props.attributes.multiple_meta.replace(/\s/g,"").split(",").indexOf(e)||""===this.props.attributes.multiple_meta}getImageURL(e,t){let s=e.thumbnail?e.thumbnail:this.props.attributes.default?this.props.attributes.default.url:feedzyjs.imagepath+"feedzy.svg";switch(this.props.attributes.http){case"default":-1===s.indexOf("https")&&0===s.indexOf("http")&&(s=this.props.attributes.default?this.props.attributes.default.url:feedzyjs.imagepath+"feedzy.svg");break;case"https":s=s.replace(/http:/g,"https:")}return t&&(s='url("'+s+'")'),s}onChangeFeed(e){window.tiTrk?.with("feedzy").set("feedzy-url-feed",{feature:"block-url-feed",featureValue:e}),this.props.setAttributes({feeds:e})}onChangeMax(e){this.props.setAttributes({max:e?Number(e):5})}onChangeOffset(e){this.props.setAttributes({offset:Number(e)})}onToggleFeedTitle(e){this.props.setAttributes({feed_title:!this.props.attributes.feed_title})}onRefresh(e){window.tiTrk?.with("feedzy").set("feedzy-caching",{feature:"block-caching-refresh",featureValue:e}),this.props.setAttributes({refresh:e})}onSort(e){this.props.setAttributes({sort:e})}onTarget(e){this.props.setAttributes({target:e})}onTitle(e){""!==e&&(e=Number(e))<0&&(e=0),this.props.setAttributes({title:e})}onChangeMeta(e){window.tiTrk?.with("feedzy").set("feedzy-meta",{feature:"block-meta-fields",featureValue:e}),this.props.setAttributes({metafields:e})}onChangeMultipleMeta(e){window.tiTrk?.with("feedzy").set("feedzy-multiple-meta",{feature:"block-multiple-meta-fields",featureValue:e}),this.props.setAttributes({multiple_meta:e})}onToggleSummary(e){this.props.setAttributes({summary:!this.props.attributes.summary})}onToggleLazy(e){window.tiTrk?.with("feedzy").set("feedzy-lazy-loading",{feature:"block-lazy-loading-feed",featureValue:e}),this.props.setAttributes({lazy:!this.props.attributes.lazy})}onSummaryLength(e){this.props.setAttributes({summarylength:Number(e)})}onKeywordsTitle(e){this.props.setAttributes({keywords_title:e})}onKeywordsBan(e){this.props.setAttributes({keywords_ban:e})}onThumb(e){this.props.setAttributes({thumb:e})}onDefault(e){this.props.setAttributes({default:e}),this.setState({route:"reload"})}onSize(e){this.props.setAttributes({size:e?Number(e):150})}onHTTP(e){this.props.setAttributes({http:e}),this.setState({route:"reload"})}onReferralURL(e){window.tiTrk?.with("feedzy").add({feature:"block-referral-url"}),this.props.setAttributes({referral_url:e})}onColumns(e){window.tiTrk?.with("feedzy").set("feedzy-columns",{feature:"block-columns",featureValue:e}),this.props.setAttributes({columns:e})}onTemplate(e){window.tiTrk?.with("feedzy").set("feedzy-template",{feature:"block-template",featureValue:e}),this.props.setAttributes({template:e})}onTogglePrice(e){window.tiTrk?.with("feedzy").set("feedzy-price",{feature:"block-price",featureValue:!this.props.attributes.price}),this.props.setAttributes({price:!this.props.attributes.price})}onKeywordsIncludeOn(e){this.props.setAttributes({keywords_inc_on:e})}onKeywordsExcludeOn(e){this.props.setAttributes({keywords_exc_on:e})}onFromDateTime(e){this.props.setAttributes({from_datetime:e})}onToDateTime(e){this.props.setAttributes({to_datetime:e})}feedzyCategoriesList(e){var t=jQuery('iframe[name="editor-canvas"]'),s=jQuery(".feedzy-source input");t.length>0&&(s=jQuery(".feedzy-source input",t.contents())),s.autocomplete({disabled:!1}).autocomplete("search","")}getValidateURL(){let e="https://validator.w3.org/feed/";return this.props.attributes.feeds&&(e+="check.cgi?url="+this.props.attributes.feeds),e}onToggleItemTitle(e){this.props.setAttributes({itemTitle:!this.props.attributes.itemTitle})}onToggleDisableStyle(e){this.props.setAttributes({disableStyle:!this.props.attributes.disableStyle})}onLinkNoFollow(e){this.props.setAttributes({follow:e})}onErrorEmpty(e){this.props.setAttributes({error_empty:e})}onclassName(e){this.props.setAttributes({className:e})}onDryRun(e){window.tiTrk?.with("feedzy").add({feature:"block-dry-run"}),this.props.setAttributes({_dryrun_:e})}onDryRunTags(e){window.tiTrk?.with("feedzy").set("feedzy-dry-run-tags",{feature:"block-dry-run-tags",featureValue:e}),this.props.setAttributes({_dry_run_tags_:e})}handleKeyUp(e){13===e.keyCode&&this.loadFeed()}render(){return["fetched"===this.state.route&&(0,a.createElement)(x,{edit:this,state:this.state,...this.props}),"home"===this.state.route&&(0,a.createElement)("div",{className:this.props.className},(0,a.createElement)(P,{key:"placeholder",icon:"rss",label:j("Feedzy RSS Feeds")},this.state.loading?(0,a.createElement)("div",{key:"loading",className:"wp-block-embed is-loading"},(0,a.createElement)(M,null),(0,a.createElement)("p",null,j("Fetching..."))):[(0,a.createElement)("div",{className:"feedzy-source-wrap"},(0,a.createElement)(U,{type:"url",className:"feedzy-source",placeholder:j("Enter URL or category of your feed here..."),onChange:this.onChangeFeed,onKeyUp:this.handleKeyUp,value:this.props.attributes.feeds}),(0,a.createElement)("span",{className:"dashicons dashicons-arrow-down-alt2",onClick:this.feedzyCategoriesList})),(0,a.createElement)(I,{isLarge:!0,isPrimary:!0,type:"submit",onClick:this.loadFeed},j("Load Feed")),(0,a.createElement)(L,{href:this.getValidateURL(),title:j("Validate Feed ")},j("Validate ")),!feedzyjs.isPro&&(0,a.createElement)("div",{className:"fz-source-upgrade-alert"},(0,a.createElement)("strong",null,j("NEW!")," "),j("Enable Amazon Product Advertising feeds to generate affiliate revenue by "),(0,a.createElement)(L,{href:"https://themeisle.com/plugins/feedzy-rss-feeds/upgrade/?utm_source=wpadmin&utm_medium=blockeditor&utm_campaign=keywordsfilter&utm_content=feedzy-rss-feeds"},j("upgrading to Feedzy Pro."))),this.state.error&&(0,a.createElement)("div",null,j("Feed URL is invalid or unreachable by WordPress SimplePie and will NOT display items.")),(0,a.createElement)("p",null,j("Enter the full URL of the feed source you wish to display here, or the name of a category you've created. Also you can add multiple URLs just separate them with a comma. You can manage your categories feed from")," ",(0,a.createElement)("a",{href:"edit.php?post_type=feedzy_categories",title:j("feedzy categories "),target:"_blank"},j("here ")))])),!("fetched"!==this.state.route||void 0===this.props.attributes.feedData)&&(0,a.createElement)("div",{className:"feedzy-rss"},this.props.attributes.feed_title&&null!==this.props.attributes.feedData.channel&&(0,a.createElement)("div",{className:"rss_header"},(0,a.createElement)("h2",null,(0,a.createElement)("a",{className:"rss_title"},F(this.props.attributes.feedData.channel.title)),(0,a.createElement)("span",{className:"rss_description"}," "+F(this.props.attributes.feedData.channel.description)))),(0,a.createElement)("ul",{className:`feedzy-${this.props.attributes.template}`},(e=this.props.attributes.feedData.items,t=this.props.attributes.sort,s=S(this.props.attributes.keywords_title),r=S(this.props.attributes.keywords_ban),i=this.props.attributes.max,o=this.props.attributes.offset,l=this.props.attributes.keywords_inc_on,n=this.props.attributes.keywords_exc_on,p=this.props.attributes.from_datetime,d=this.props.attributes.to_datetime,l="author"===l?"creator":l,n="author"===n?"creator":n,p=""!==p&&void 0!==p&&moment(p).format("X"),d=""!==d&&void 0!==d&&moment(d).format("X"),e=Array.from(e).sort(((e,s)=>{let a,r;return"date_desc"===t||"date_asc"===t?(a=e.pubDate,r=s.pubDate):"title_desc"!==t&&"title_asc"!==t||(a=e.title.toUpperCase(),r=s.title.toUpperCase()),a<r?"date_desc"===t||"title_desc"===t?1:-1:a>r?"date_desc"===t||"title_desc"===t?-1:1:0})).filter((e=>!s||s.test(e[l]))).filter((e=>!r||!r.test(e[n]))).filter((e=>{let t=e.date+" "+e.time;return t=moment(new Date(t)).format("X"),!p||!d||p<=t&&t<=d})).slice(o,i+o)).map(((e,t)=>{const s=(e.date||"")+" "+(e.time||"")+" UTC +0000";let r=F(e.date)||"",i=F(e.time)||"",o=F(e.categories)||"";if(this.metaExists("tz=local")){let e=new Date(s);e=e.toUTCString(),r=moment.utc(e).format("MMMM D, YYYY"),i=moment.utc(e).format("h:mm A")}let l=e.creator&&this.metaExists("author")?e.creator:"";""!==this.props.attributes.multiple_meta&&"no"!==this.props.attributes.multiple_meta&&((this.multipleMetaExists("source")||this.multipleMetaExists("yes"))&&""!==l&&""!==e.source?l=l+" ("+e.source+")":(this.multipleMetaExists("source")||this.multipleMetaExists("yes"))&&""!==e.source&&(l=e.source)),""!==e.thumbnail||"auto"!==this.props.attributes.thumb||e.default_img?.endsWith("img/feedzy.svg")||(e.thumbnail=e.default_img);let n=new Object;return n.author=j("by")+" "+l,n.date=j("on")+" "+F(r),n.time=j("at")+" "+F(i),n.categories=j("in")+" "+F(o),(0,a.createElement)("li",{key:t,style:{padding:"15px 0 25px"},className:`rss_item feedzy-rss-col-${this.props.attributes.columns}`},(e.thumbnail&&"auto"===this.props.attributes.thumb||"yes"===this.props.attributes.thumb)&&(0,a.createElement)("div",{className:"rss_image",style:{width:this.props.attributes.size+"px",height:this.props.attributes.size+"px"}},(0,a.createElement)("a",{title:F(e.title),style:{width:this.props.attributes.size+"px",height:this.props.attributes.size+"px"}},(0,a.createElement)("span",{className:"fetched",style:{width:this.props.attributes.size+"px",height:this.props.attributes.size+"px",backgroundImage:this.getImageURL(e,!0)},title:F(e.title)}))),(0,a.createElement)("div",{className:"rss_content_wrap"},this.props.attributes.itemTitle&&0!==this.props.attributes.title?(0,a.createElement)("span",{className:"title"},(0,a.createElement)("a",null,this.props.attributes.title&&F(e.title).length>this.props.attributes.title?F(e.title).substring(0,this.props.attributes.title)+"...":F(e.title))):"",(0,a.createElement)("div",{className:"rss_content"},"no"!==this.props.attributes.metafields&&(0,a.createElement)("small",{className:"meta"},((e,t)=>{let s="";""===t&&(t="author, date, time");let a=t.replace(/\s/g,"").split(",");for(let t=0;t<a.length;t++)void 0!==e[a[t]]&&(s=s+" "+e[a[t]]);return s})(n,this.props.attributes.metafields)),this.props.attributes.summary&&(0,a.createElement)("p",{className:"description"},this.props.attributes.summarylength&&F(e.description).length>this.props.attributes.summarylength?F(e.description).substring(0,this.props.attributes.summarylength)+" [...]":F(e.description)),feedzyjs.isPro&&e.media&&e.media.src&&(0,a.createElement)("audio",{controls:!0,controlsList:"nodownload"},(0,a.createElement)("source",{src:e.media.src,type:e.media.type}),j("Your browser does not support the audio element. But you can check this for the original link: "),(0,a.createElement)("a",{href:e.media.src},e.media.src)),feedzyjs.isPro&&this.props.attributes.price&&e.price&&"default"!==this.props.attributes.template&&(0,a.createElement)("div",{className:"price-wrap"},(0,a.createElement)("a",null,(0,a.createElement)("button",{className:"price"},e.price))))))}))))];var e,t,s,r,i,o,l,n,p,d}},save:()=>null})},485:(e,t)=>{var s;!function(){"use strict";var a={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var s=arguments[t];if(s){var i=typeof s;if("string"===i||"number"===i)e.push(s);else if(Array.isArray(s)){if(s.length){var o=r.apply(null,s);o&&e.push(o)}}else if("object"===i){if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]")){e.push(s.toString());continue}for(var l in s)a.call(s,l)&&s[l]&&e.push(l)}}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(s=function(){return r}.apply(t,[]))||(e.exports=s)}()},454:e=>{"use strict";var t="%[a-f0-9]{2}",s=new RegExp(t,"gi"),a=new RegExp("("+t+")+","gi");function r(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var s=e.slice(0,t),a=e.slice(t);return Array.prototype.concat.call([],r(s),r(a))}function i(e){try{return decodeURIComponent(e)}catch(i){for(var t=e.match(s),a=1;a<t.length;a++)t=(e=r(t,a).join("")).match(s);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},s=a.exec(e);s;){try{t[s[0]]=decodeURIComponent(s[0])}catch(e){var r=i(s[0]);r!==s[0]&&(t[s[0]]=r)}s=a.exec(e)}t["%C2"]="�";for(var o=Object.keys(t),l=0;l<o.length;l++){var n=o[l];e=e.replace(new RegExp(n,"g"),t[n])}return e}(e)}}},55:e=>{"use strict";e.exports=function(e,t){for(var s={},a=Object.keys(e),r=Array.isArray(t),i=0;i<a.length;i++){var o=a[i],l=e[o];(r?-1!==t.indexOf(o):t(o,l,e))&&(s[o]=l)}return s}},44:(e,t,s)=>{"use strict";const a=s(280),r=s(454),i=s(528),o=s(55);function l(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function n(e,t){return t.encode?t.strict?a(e):encodeURIComponent(e):e}function p(e,t){return t.decode?r(e):e}function d(e){return Array.isArray(e)?e.sort():"object"==typeof e?d(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function u(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function c(e){const t=(e=u(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function m(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function h(e,t){l((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const s=function(e){let t;switch(e.arrayFormat){case"index":return(e,s,a)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===a[e]&&(a[e]={}),a[e][t[1]]=s):a[e]=s};case"bracket":return(e,s,a)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==a[e]?a[e]=[].concat(a[e],s):a[e]=[s]:a[e]=s};case"comma":case"separator":return(t,s,a)=>{const r="string"==typeof s&&s.includes(e.arrayFormatSeparator),i="string"==typeof s&&!r&&p(s,e).includes(e.arrayFormatSeparator);s=i?p(s,e):s;const o=r||i?s.split(e.arrayFormatSeparator).map((t=>p(t,e))):null===s?s:p(s,e);a[t]=o};case"bracket-separator":return(t,s,a)=>{const r=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!r)return void(a[t]=s?p(s,e):s);const i=null===s?[]:s.split(e.arrayFormatSeparator).map((t=>p(t,e)));void 0!==a[t]?a[t]=[].concat(a[t],i):a[t]=i};default:return(e,t,s)=>{void 0!==s[e]?s[e]=[].concat(s[e],t):s[e]=t}}}(t),a=Object.create(null);if("string"!=typeof e)return a;if(!(e=e.trim().replace(/^[?#&]/,"")))return a;for(const r of e.split("&")){if(""===r)continue;let[e,o]=i(t.decode?r.replace(/\+/g," "):r,"=");o=void 0===o?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?o:p(o,t),s(p(e,t),o,a)}for(const e of Object.keys(a)){const s=a[e];if("object"==typeof s&&null!==s)for(const e of Object.keys(s))s[e]=m(s[e],t);else a[e]=m(s,t)}return!1===t.sort?a:(!0===t.sort?Object.keys(a).sort():Object.keys(a).sort(t.sort)).reduce(((e,t)=>{const s=a[t];return Boolean(s)&&"object"==typeof s&&!Array.isArray(s)?e[t]=d(s):e[t]=s,e}),Object.create(null))}t.extract=c,t.parse=h,t.stringify=(e,t)=>{if(!e)return"";l((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const s=s=>t.skipNull&&null==e[s]||t.skipEmptyString&&""===e[s],a=function(e){switch(e.arrayFormat){case"index":return t=>(s,a)=>{const r=s.length;return void 0===a||e.skipNull&&null===a||e.skipEmptyString&&""===a?s:null===a?[...s,[n(t,e),"[",r,"]"].join("")]:[...s,[n(t,e),"[",n(r,e),"]=",n(a,e)].join("")]};case"bracket":return t=>(s,a)=>void 0===a||e.skipNull&&null===a||e.skipEmptyString&&""===a?s:null===a?[...s,[n(t,e),"[]"].join("")]:[...s,[n(t,e),"[]=",n(a,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return s=>(a,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?a:(r=null===r?"":r,0===a.length?[[n(s,e),t,n(r,e)].join("")]:[[a,n(r,e)].join(e.arrayFormatSeparator)])}default:return t=>(s,a)=>void 0===a||e.skipNull&&null===a||e.skipEmptyString&&""===a?s:null===a?[...s,n(t,e)]:[...s,[n(t,e),"=",n(a,e)].join("")]}}(t),r={};for(const t of Object.keys(e))s(t)||(r[t]=e[t]);const i=Object.keys(r);return!1!==t.sort&&i.sort(t.sort),i.map((s=>{const r=e[s];return void 0===r?"":null===r?n(s,t):Array.isArray(r)?0===r.length&&"bracket-separator"===t.arrayFormat?n(s,t)+"[]":r.reduce(a(s),[]).join("&"):n(s,t)+"="+n(r,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[s,a]=i(e,"#");return Object.assign({url:s.split("?")[0]||"",query:h(c(e),t)},t&&t.parseFragmentIdentifier&&a?{fragmentIdentifier:p(a,t)}:{})},t.stringifyUrl=(e,s)=>{s=Object.assign({encode:!0,strict:!0},s);const a=u(e.url).split("?")[0]||"",r=t.extract(e.url),i=t.parse(r,{sort:!1}),o=Object.assign(i,e.query);let l=t.stringify(o,s);l&&(l=`?${l}`);let p=function(e){let t="";const s=e.indexOf("#");return-1!==s&&(t=e.slice(s)),t}(e.url);return e.fragmentIdentifier&&(p=`#${n(e.fragmentIdentifier,s)}`),`${a}${l}${p}`},t.pick=(e,s,a)=>{a=Object.assign({parseFragmentIdentifier:!0},a);const{url:r,query:i,fragmentIdentifier:l}=t.parseUrl(e,a);return t.stringifyUrl({url:r,query:o(i,s),fragmentIdentifier:l},a)},t.exclude=(e,s,a)=>{const r=Array.isArray(s)?e=>!s.includes(e):(e,t)=>!s(e,t);return t.pick(e,r,a)}},528:e=>{"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const s=e.indexOf(t);return-1===s?[e]:[e.slice(0,s),e.slice(s+t.length)]}},280:e=>{"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))}},s={};function a(e){var r=s[e];if(void 0!==r)return r.exports;var i=s[e]={exports:{}};return t[e](i,i.exports,a),i.exports}a.m=t,e=[],a.O=(t,s,r,i)=>{if(!s){var o=1/0;for(d=0;d<e.length;d++){for(var[s,r,i]=e[d],l=!0,n=0;n<s.length;n++)(!1&i||o>=i)&&Object.keys(a.O).every((e=>a.O[e](s[n])))?s.splice(n--,1):(l=!1,i<o&&(o=i));if(l){e.splice(d--,1);var p=r();void 0!==p&&(t=p)}}return t}i=i||0;for(var d=e.length;d>0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[s,r,i]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var s in t)a.o(t,s)&&!a.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={366:0,337:0};a.O.j=t=>0===e[t];var t=(t,s)=>{var r,i,[o,l,n]=s,p=0;if(o.some((t=>0!==e[t]))){for(r in l)a.o(l,r)&&(a.m[r]=l[r]);if(n)var d=n(a)}for(t&&t(s);p<o.length;p++)i=o[p],a.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return a.O(d)},s=globalThis.webpackChunkfeedzy_rss_feeds=globalThis.webpackChunkfeedzy_rss_feeds||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))})();var r=a.O(void 0,[337],(()=>a(663)));r=a.O(r)})();
Upload File
Create Folder