!function(){"use strict";function e(e,t,n,a,s,i,c){try{var r=e[i](c),l=r.value}catch(e){return void n(e)}r.done?t(l):Promise.resolve(l).then(a,s)}var t=window.wp.hooks,n=window.wp.element,a=window.wp.i18n,s=window.wp.date;(0,t.addFilter)("dr_pro_changelog","WhatsNewChangelog",()=>{let t=null;const[s,r]=(0,n.useState)(!t),[l,o]=(0,n.useState)(t),[d,p]=(0,n.useState)(0),u=function(){var n,a=(n=function*(e=!1){e&&r(!0);const n=new FormData;n.append("action","wp_del_get_latest_changelog");try{const e=yield fetch(DeliciousRecipes.ajaxURL,{method:"POST",body:n});if(200===e.status){const{success:n,data:a}=yield e.json();n&&a.changelog&&(o(a.changelog),t=a.changelog)}}catch(e){}r(!1)},function(){var t=this,a=arguments;return new Promise(function(s,i){var c=n.apply(t,a);function r(t){e(c,s,i,r,l,"next",t)}function l(t){e(c,s,i,r,l,"throw",t)}r(void 0)})});return function(){return a.apply(this,arguments)}}();return(0,n.useEffect)(()=>{u(!t),console.log(t)},[]),React.createElement(React.Fragment,null,l&&l[d].changelog?i(l[d].changelog,{hasBetas:!1}).map(e=>React.createElement(c,{key:e.version,versionDescriptor:e})):React.createElement("div",{className:"dr-changelog-loading"},s?React.createElement("div",{id:"dr-loading"}):React.createElement("span",null,(0,a.__)("No changelog found.","delicious-recipes"))))});const i=(e,{hasBetas:t}={})=>e.replace(/\r/g,"").replace(/(\r\n|\r|\n){3,}/g,"$1\n\n").split("\n\n").map(e=>{let[t,n]=e.split(/\r?\n/)[0].split(":");return{version:t,date:n&&n.trim()?(0,s.dateI18n)("F j, Y",new Date(n.trim())):"",descriptor:e}}).filter(({version:e})=>!!t||-1===e.indexOf("beta")).filter(({version:e})=>!!t||3===e.split(".").length),c=({versionDescriptor:e})=>{const[t,...n]=e.descriptor.split(/\r?\n/);return React.createElement("div",{className:"updated-version"},React.createElement("p",{className:"version"},(0,a.sprintf)(
// translators: placeholder here means the actual version.
// translators: placeholder here means the actual version.
(0,a.__)("Version: %s","delicious-recipes"),e.version)),React.createElement("p",{className:"released-on"},(0,a.sprintf)(
// translators: placeholder here means the actual date.
// translators: placeholder here means the actual date.
(0,a.__)("Released on %s","delicious-recipes"),e.date)),React.createElement("div",{className:"dr-release-info",dangerouslySetInnerHTML:{__html:`<ul class="dr-updated-list"><li>\n        \n                                ${n.join("\n").trim().split("\n").map(e=>e.replace(/^-\s/,"")).map(e=>e.replace(/`(.*?)`/g,"<code>$1</code>")).join("</li><li>")}\n                                </li></ul>`.replace(/New Feature:/g,`<div class="dr-updated-list-title"><span class="tag tag-success" >${(0,a.__)("New Feature","delicious-recipes")}</span></div>`).replace(/Enhancement:/g,`<div class="dr-updated-list-title"><span class="tag tag-info">${(0,a.__)("Enhancement","delicious-recipes")}</span></div>`).replace(/Fixes:/g,`<div class="dr-updated-list-title"><span class="tag tag-danger">${(0,a.__)("Fixes","delicious-recipes")}</span></div>`)}}))}}();