$.widget("ui.containers-property",$.ui.SceneResourceProperty,{options:{category:"container"},_createSourceProperty:function(){this._super();var e=this,t=this.$sourceProperty;t.append("<div>"+i18n("background")+"</div><div class = 'fill'><div class = 'select-image'></div>"+i18n("or")+"<input class = 'select-color ui-widget-content ui-corner-all'/></div><div>"+i18n("background_repeat")+"</div><div class = 'background-repeat'></div>");t.find(".select-image").selectButton({allowEmpty:!0,callback:this.selectImageDialog.bind(this),emptyText:i18n("select_image"),select:function(t){if(e.fill()!==t){e.onchange("fill",{fill:t});t&&$.utils.getFileSize(t,function(t){e.onchange("size",{size:t})})}}});t.find(".select-color").minicolors({change:function(t){var i=e.fill();e.fill()!==t&&(!t&&$.utils.isColor(i)||$.utils.isColor(t))&&e.onchange("fill",{fill:t||""})}});t.find(".background-repeat").select({options:[{value:"no-repeat",label:i18n("no_repeat")},{value:"repeat",label:i18n("repeat")},{value:"repeat-x",label:i18n("repeat_x")},{value:"repeat-y",label:i18n("repeat_y")}],select:function(t){e.onchange("repeat",{repeat:t})}})},value:function(e){if(e){this._super(e);this.fill(e.fill||"");this.repeat(e.repeat||"no-repeat");this.customInput(e.isTemplate||!1)}},customInput:function(e){var t=this.element.find(".isTemplate");0!==t.size()&&(e?this.element.find(".isTemplate").customInput("checked",!0):this.element.find(".isTemplate").customInput("checked",!1))},fill:function(e){var t=this.element.find(".fill");if(void 0===e)return t.data("fill");"string"!=typeof e&&(e="");t.data("fill",e);if($.utils.isColor(e)){t.find(".select-color").minicolors("value",e);t.find(".select-image").selectButton("value","")}else{t.find(".select-color").minicolors("value","");t.find(".select-image").selectButton("value",e);e&&t.find(".select-image .ui-button-text").text(e.split("/").pop())}},repeat:function(e){var t=this.element.find(".background-repeat");if(void 0===e)return t.data("repeat");t.data("repeat",e).select("value",e);return void 0},selectImageDialog:function(e){$.utils.selectImage({fileType:"image",multiple:!1,callback:function(t){e&&e(t);return!0}})}});