/* Picasso * A Framework to build dinamic forms using MVC * Build date: Sun, 11 Oct 2015 03:00:09 GMT * @author Rubens Pinheiro Gonçalves Cavalcante * @version 0.9.4 * @license GPL-3.0 */ var Picasso=Picasso||{},P=P||Picasso;Picasso.info={author:"%author%",version:"%version%",build:"%buildDate%",license:"%license%"},Picasso.load=function(t){var e=t.split("."),i=Picasso;"Picasso"===e[0]&&(e=e.slice(1));for(var o=0;oi;i++)e(t[i],i)}};return{find:t,equals:e,each:i}}(),Picasso.load("utils.html"),Picasso.utils.html=function(){var t=function(t,e){for(var i in e)e.hasOwnProperty(i)&&t.setAttribute(i,e[i])},e=function(t,e){var i,o,s=t.classList;for(i=-1!=e.indexOf(" ")?e.split(" "):[e],o=0;ot;t++)this.pop()},this.each=function(t){for(var e=0,i=this.length;i>e;e++)t(this[e],e)},this.getElement=function(t){for(var e=0;ei;i++){var o=this._UIActions[i];t._subscribe(o.eventName,o.callback)}},Picasso.Controller.prototype.construct=function(t){Picasso.Controller.apply(this,arguments),this._model=t;var e=arguments.length;if(e>1)for(var i=1;e>i;i++)arguments[i]instanceof Picasso.View&&(this.registerView(arguments[i]),arguments[i].setModel(t))},Picasso.Controller.prototype.registerView=function(t){t.setModel(this._model),this._views[t._seq]=t,this._registerUIAction(t)},Picasso.Controller.prototype.listen=function(t,e){var i=new Picasso.pjo.EventHandler(t,e,this);this._UIActions.push(i);for(var o in this._views)this._views.hasOwnProperty(o)&&this._views[o]._subscribe(t,e)},Picasso.Controller.prototype.getModel=function(){return this._model},Picasso.Controller.prototype.setModel=function(t){for(var e in this._views)this._views.hasOwnProperty(e)&&this._views[e].setModel(t)},Picasso.Controller.extend=function(t){return Picasso.utils.object.extend(t,Picasso.Controller)},Picasso.load("Model"),Picasso.Model=function(){},Picasso.Model.prototype=new Picasso.core.Subject,Picasso.Model.prototype.set=function(t,e){this.hasOwnProperty(t)&&(this[t]instanceof Picasso.Model?this[t].update(e):(this[t]=e,this.fire("propertyChange",{property:t,value:e})))},Picasso.Model.prototype.get=function(t){return this.hasOwnProperty(t)?this[t]:void 0},Picasso.Model.prototype.update=function(t){for(var e in t)t.hasOwnProperty(e)&&this.set(e,t[e])},Picasso.Model.prototype.toPlainObject=function(){var t=new this.constructor;for(var e in t)t.hasOwnProperty(e)&&"function"!=typeof t[e]&&(t[e]=this[e]);return t},Picasso.Model.extend=function(t){var e=[],i=new t;for(var o in i)i.hasOwnProperty(o)&&e.push(o);for(var s=Picasso.utils.object.extend(t,Picasso.Model),r=0;r