require(["jquery"],function(c){var a=function(e){var d=this;d.selectWidget=c(e);d.triggerSelectionChange=function(){d.selectWidget.trigger("xwiki:select:updated",{elements:d.selectWidget[0]})};d.onOptionClicked=function(){var g=c(this);var f=g.find("input");if(f.prop("checked")){return}f.prop("checked",true);d.selectWidget.find(".xwiki-select-option-selected").removeClass("xwiki-select-option-selected");g.addClass("xwiki-select-option-selected");d.triggerSelectionChange()};d.init=function(){d.selectWidget.find(".xwiki-select-option").click(d.onOptionClicked)};d.clearSelection=function(){d.selectWidget.find(".xwiki-select-option-selected").removeClass("xwiki-select-option-selected");d.selectWidget.find('input[type="radio"]:checked').prop("checked",false);d.triggerSelectionChange()};d.getValue=function(){return d.selectWidget.find('input[type="radio"]:checked').val()};d.init()};var b=new Map();c.fn.xwikiSelectWidget=function(e){if(!e||e=="init"){for(var d=0;d<this.length;++d){var f=this[d];if(b.get(f)){continue}b.set(f,new a(f))}}else{if(e=="clearSelection"){for(var d=0;d<this.length;++d){b.get(this[d]).clearSelection()}}else{if(e=="getValue"){return b.get(this[0]).getValue()}}}return this};c(document).ready(function(){c(".xwiki-select").xwikiSelectWidget()})});