!function(e){var t={};function n(r){if(t[r])return t[r].exports;var l=t[r]={i:r,l:!1,exports:{}};return e[r].call(l.exports,l,l.exports,n),l.l=!0,l.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var l in e)n.d(r,l,function(t){return e[t]}.bind(null,l));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){const{createElement:n,render:r,useState:l,useEffect:a,Fragment:s,useRef:o}=wp.element,{select:d,dispatch:i}=wp.data,u=e=>{var t=React.useRef();const[r,o]=l(!0),[i,u]=l([]),[c,f]=l(""),[p,_]=l(!1);return a(()=>{if(!document.getElementById("flickityjs")){const e=document.createElement("script");e.src=window.wplms_course_data.flickityjs,e.id="flickityjs",document.body.appendChild(e),e.onload=()=>{_(!0)}}},[]),a(()=>{fetch(`${window.dashboard_news.api}/get_news/`,{method:"post",body:JSON.stringify({user_id:window.dashboard_news.user_id,token:d("vibebp").getToken(),number:window.dashboard_news.settings.number})}).then(e=>e.json()).then(e=>{e.status&&(e.data&&u(e.data),e.extras&&f(e.extras)),o(!1)})},[]),a(()=>{if(!r&&i.length&&p){var e=t.current;new Flickity(e,{cellAlign:"left",contain:!0})}},[i,r,p]),n("div",{className:"wplms_dashboard_news_widget"},r?n("div",{class:"widget_loader"},n("div",null),n("div",null),n("div",null),n("div",null)):n(s,null,c.length?n(s,null,n("div",{dangerouslySetInnerHTML:{__html:c}})):"",i.length?n(s,null,n("ul",{className:"wplms_news_slides",ref:t},i.map(e=>n("div",{className:"wplms_news_slide",dangerouslySetInnerHTML:{__html:e}})))):n("div",{className:"overlay_message"},window.dashboard_news.translations.no_data)))};document.addEventListener("wplms_dashboard_news_widget",e=>{e.target.removeEventListener(e.type,arguments.callee),document.querySelectorAll(".wplms_dashboard_news_widget").forEach(e=>{r(n(u,{type:e.getAttribute("data-type")}),e)})})}]);