var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,b,c){a instanceof String&&(a=String(a));for(var e=a.length,d=0;d<e;d++){var k=a[d];if(b.call(c,k,d,a))return{i:d,v:k}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,b){var c=$jscomp.propertyToPolyfillSymbol[b];if(null==c)return a[b];c=a[c];return void 0!==c?c:a[b]};
$jscomp.polyfill=function(a,b,c,e){b&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,b,c,e):$jscomp.polyfillUnisolated(a,b,c,e))};$jscomp.polyfillUnisolated=function(a,b,c,e){c=$jscomp.global;a=a.split(".");for(e=0;e<a.length-1;e++){var d=a[e];if(!(d in c))return;c=c[d]}a=a[a.length-1];e=c[a];b=b(e);b!=e&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})};
$jscomp.polyfillIsolated=function(a,b,c,e){var d=a.split(".");a=1===d.length;e=d[0];e=!a&&e in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var k=0;k<d.length-1;k++){var q=d[k];if(!(q in e))return;e=e[q]}d=d[d.length-1];c=$jscomp.IS_SYMBOL_NATIVE&&"es6"===c?e[d]:null;b=b(c);null!=b&&(a?$jscomp.defineProperty($jscomp.polyfills,d,{configurable:!0,writable:!0,value:b}):b!==c&&($jscomp.propertyToPolyfillSymbol[d]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(d):$jscomp.POLYFILL_PREFIX+d,d=
$jscomp.propertyToPolyfillSymbol[d],$jscomp.defineProperty(e,d,{configurable:!0,writable:!0,value:b})))};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(b,c){return $jscomp.findInternal(this,b,c).v}},"es6","es3");
require(["jquery","xwiki-meta"],function(a,b){var c=["Poor","Satisfactory","Good","Very good","Excellent"],e=(new XWiki.Document("RatingsUIX","XWiki.Ratings")).getURL("get"),d=function(g,h,f,m){var l=new XWiki.widgets.Notification("Your vote is being saved...","inprogress");a.post(e,{outputSyntax:"plain",vote:f,doc:h,form_token:b.form_token}).done(function(n){var p=n.avgvote;n=n.totalvotes;(p=parseFloat(p))?(p=20*p+"%",g.find("li.current-rating").first().width(p),m.text(n+" Votes"),m.previousMessage=
"",l.replace(new XWiki.widgets.Notification("Your vote has been saved!","done"))):l.replace(new XWiki.widgets.Notification("Error when saving your vote.","error"))}).fail(function(n){l.replace(new XWiki.widgets.Notification("Error when saving your vote. "+n,"error"))})},k=function(g,h,f,m,l){h=a(h);f.previousMessage="";h.on("click",function(){d(l,m,g+1,f)});h.on("mouseout",function(){""!=f.previousMessage&&f.text(f.previousMessage)});h.on("mouseover",function(){""==f.previousMessage&&(f.previousMessage=
f.text());f.text(c[g])})},q=function(){var g=a(this);if(!g.hasClass("locked")&&!g.hasClass("initialized")){var h=g.data("reference"),f=g.find(".rating-message").first();h&&g.find(".star-rating").first().find("a").each(function(m,l){k(m,l,f,h,g)});g.addClass("initialized")}},r=function(){a(".rating-wrapper").each(q)};a(document).ready(r);a(document).on("xwiki:dom:updated",r)});