!function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},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 a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},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="modules",n(n.s=375)}({375:function(e,t,n){"use strict";function a(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}n.r(t);var i=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.container=t,this.ajaxUrl=this.container.attr("data-ajax-url"),this.alertContainer=this.container.find("[data-license-alert-container]"),this.header=this.container.find("[data-license-header]"),this.bindEvents()}var t,n,i;return t=e,(n=[{key:"bindEvents",value:function(){this.container.on("click","[data-license-refresh-btn]",this.refreshLicense.bind(this))}},{key:"refreshLicense",value:function(e){var t=this;if(e.preventDefault(),this.ajaxUrl){var n=$(e.currentTarget);n.hasClass("is-loading")||(n.addClass("is-loading"),$.ajax({url:this.ajaxUrl,type:"GET",dataType:"json"}).done((function(e){e&&!0===e.status?(t.updateWidget(e),t.notify("success","License data has been refreshed.")):t.notify("danger",e&&e.error||"License refresh failed.")})).fail((function(){t.notify("danger","Network error during license refresh.")})).always((function(){t.container.find("[data-license-refresh-btn]").removeClass("is-loading")})))}}},{key:"notify",value:function(e,t){"function"!=typeof luNotification?window.console&&console.log&&console.log("[Lagom widget] ".concat(e,": ").concat(t)):luNotification({size:"md",status:e,title:"success"===e?"Success":"Error",body:t})}},{key:"updateWidget",value:function(e){"string"==typeof e.alert_html&&this.alertContainer.html(e.alert_html),e.widget_status&&this.swapStatusClass(e.widget_status),e.info&&this.updateInfoFields(e.info),"string"==typeof e.version&&this.container.find('[data-license-info-field="version"]').text(e.version)}},{key:"swapStatusClass",value:function(e){this.container.find("[data-license-status-class]").each((function(){var t=$(this),n=t.attr("data-license-status-class");if(n){var a=n.split("--")[0],i="".concat(a,"--").concat(e);t.removeClass(n).addClass(i).attr("data-license-status-class",i)}}))}},{key:"updateInfoFields",value:function(e){var t=this;Object.keys(e).forEach((function(n){var a=t.container.find('[data-license-info-field="'.concat(n,'"]'));a.length&&("support_access_text"===n&&e.support_access_class&&a.removeClass((function(e,t){return(t.match(/label--\S+/g)||[]).join(" ")})).addClass("label--".concat(e.support_access_class," label--outline")),a.text(e[n]))}))}}])&&a(t.prototype,n),i&&a(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();var r={initDataSelectors:function(){$("[data-license-widget]").each((function(){new i($(this))}))}};$(document).ready((function(){r.initDataSelectors()}))}});