text: YUI.add("inputex-builder",function(Y,NAME){(function(){var e="	",t="\n",n=!0,r=0,i=function(t){if(!n)return t;for(var i=0;i<r;i++)t[t.length]=e;return t},s=function(e){return n&&(e[e.length]=t),e},o={"\b":"\\b","	":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},u={array:function(e){var t=["["],n,o,a,f=e.length,l;t=s(t),r++;for(a=0;a<f;a+=1)l=e[a],o=u[typeof l],o&&(l=o(l),typeof l=="string"&&(n&&(t[t.length]=",",t=s(t)),t=i(t),t[t.length]=l,n=!0));return r--,t=s(t),t=i(t),t[t.length]="]",t.join("")},"boolean":function(e){return String(e)},"null":function(e){return"null"},number:function(e){return isFinite(e)?String(e):"null"},object:function(e,t){if(e){if(e instanceof Array)return u.array(e);var o=["{"],a,f,l,c;o=s(o),r++;for(l in e)c=e[l],f=u[typeof c],f&&(c=f(c),typeof c=="string"&&(a&&(o[o.length]=",",o=s(o)),o=i(o),o.push(u.string(l),n?" : ":":",c),a=!0));return r--,o=s(o),o=i(o),o[o.length]="}",o.join("")}return"null"},string:function(e){return/["\\\x00-\x1f]/.test(e)&&(e=e.replace(/([\x00-\x1f\\"])/g,function(e,t){var n=o[t];return n?n:(n=t.charCodeAt(),"\\u00"+Math.floor(n/16).toString(16)+(n%16).toString(16))})),'"'+e+'"'}};Object.prototype.toPrettyJSONString=function(){return u.object(this)},Array.prototype.toPrettyJSONString=function(){return u.array(this)}})();var g=new Y.inputEx.Group({parentEl:"container",fields:Y.inputEx.Group.groupOptions});g.setValue({fields:[{type:"string",placeholder:"firstname",name:"firstname",label:"Firstname"},{type:"string",placeholder:"lastname",name:"lastname",label:"Lastname"},{type:"email",label:"Email",name:"",required:!1}],collapsible:!0,legend:"User"},!1);var rebuildPreview=function(){var e=g.getValue(),t=new Y.inputEx.Group(e),n=Y.one("#groupContainer")._node;n.innerHTML="",n.appendChild(t.getEl());var r=Y.one("#codeGenerator")._node;r.innerHTML=e.toPrettyJSONString(!0)};rebuildPreview(),g.on("updated",rebuildPreview),Y.one("#generateButton").on("click",function(){var e=["<html>","<head>","  <title>inputEx Builder: generate inputEx Forms</title>","  <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\n","<link rel='stylesheet' href='http://yui.yahooapis.com/3.14.1/build/cssgrids/grids-min.css'>","<link rel='stylesheet' href='http://yui.yahooapis.com/combo?3.14.1/build/cssreset/reset-min.css&3.14.1/build/cssfonts/fonts-min.css'>","  <style>","#formContainer {","background-color:#EEEEFF;","border:1px solid #9999FF;","margin:50px;","padding:10px;","}","  </style>","</head>\n","<body class='yui3-skin-sam'>","    <div id='formContainer'> </div>","","<script type='text/javascript' src='http://yui.yahooapis.com/3.14.1/build/yui/yui-debug.js'></script>","<script type='text/javascript' src='../../build/inputex-loader/inputex-loader.js'></script>","<script>","YUI_config.groups.inputex.base = '../../build/';","var formDef = "+g.getValue().toPrettyJSONString(!0)+";","YUI().use('inputex-group', function(Y) {","   // Load the modules using Y.use (asynchronously)","   Y.inputEx.use(formDef, function() {","      // Instantiate the form using Y.inputEx","      formDef.parentEl = 'formContainer';","      new Y.inputEx.Group(formDef);","   });","});","</script>","</body>","</html>"],t=screen.width/2,n=screen.height/2;t-=this.windowWidth/2,n-=this.windowHeight/2;var r=window.open("","InputExForm","left="+t+",top="+n+",width=850,height=600,toolbar=no,scrollbars,resizable=yes");r.document.write(e.join("\n")),r.document.close()}),Example1={},Y.one("#loadButton").on("click",function(){Example1.myPanel.show()});var formConfig={type:"form",fields:[{type:"text",name:"code",cols:50,rows:10},{type:"radio",label:"Format",name:"format",choices:["inputEx JSON","JSON Schema"],value:"inputEx JSON"}],buttons:[{type:"submit",value:"Load",onClick:function(){try{var value=Example1.myPanel.get("field").getValue();try{var code=eval("("+value.code+")")}catch(ex){alert("Error during JSON evaluation");return}if(value.format=="JSON Schema")try{var builder=new Y.inputEx.JsonSchema.Builder({schemaIdentifierMap:code,defaultOptions:{showMsg:!0}}),lastSchema=function(e){var t;for(var n in e)e.hasOwnProperty(n)&&(t=e[n]);return t}(code),m=builder.schemaToInputEx(lastSchema);g.setValue(m)}catch(ex){return}else g.setValue(code);Example1.myPanel.hide()}catch(ex){window.console&&Y.Lang.isFunction(console.log)&&console.log(ex)}return!1}},{type:"link",value:"Cancel",onClick:function(){return Example1.myPanel.hide(),!1}}]};Example1.myPanel=new Y.inputEx.Panel({inputEx:formConfig,title:"Copy/Paste your inputEx JSON or JSON Schema here :",constraintoviewport:!0,underlay:"shadow",close:!0,fixedcenter:!0,visible:!1,plugins:[Y.Plugin.Drag],modal:!0,render:!0})},"@VERSION@",{requires:["inputex","inputex-autocomplete","inputex-base","inputex-button","inputex-checkbox","inputex-choice","inputex-color","inputex-combine","inputex-datatable","inputex-date","inputex-datepicker","inputex-dateselectmonth","inputex-datesplit","inputex-datetime","inputex-ddlist","inputex-dsselect","inputex-email","inputex-field","inputex-file","inputex-form","inputex-group","inputex-hidden","inputex-imagecropper","inputex-inplaceedit","inputex-integer","inputex-ipv4","inputex-jsonschema","inputex-jsontreeinspector","inputex-keyopvalue","inputex-keyvalue","inputex-lens","inputex-linkedcombo","inputex-list","inputex-map","inputex-menu","inputex-multiautocomplete","inputex-multiselect","inputex-number","inputex-object","inputex-panel","inputex-password","inputex-radio","inputex-ratingstars","inputex-ratingstarsform","inputex-rpc","inputex-rte","inputex-select","inputex-serialize","inputex-slider","inputex-smdtester","inputex-string","inputex-stringavailability","inputex-textarea","inputex-textautotag","inputex-time","inputex-timeinterval","inputex-timerange","inputex-tinymce","inputex-tree","inputex-type","inputex-uneditable","inputex-uppercase","inputex-url","inputex-vector","inputex-visus","dd-plugin"],skinnable:!0});
  