@rjsf/core
Advanced tools
Comparing version 5.0.0-beta.14 to 5.0.0-beta.15
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@rjsf/utils"),a=require("lodash/get"),r=require("lodash/isEmpty"),o=require("lodash/pick"),i=require("lodash/isObject"),n=require("lodash/set"),l=require("nanoid"),s=require("lodash/unset"),d=require("lodash/has"),c=require("lodash/omit");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=u(e),p=u(a),h=u(r),f=u(o),g=u(i),y=u(n),S=u(s),E=u(d),b=u(c);function v(){return l.nanoid()}function C(e){return Array.isArray(e)?e.map((e=>({key:v(),item:e}))):[]}function F(e){return Array.isArray(e)?e.map((e=>e.item)):[]}class D extends e.Component{constructor(e){super(e),this._getNewFormDataRow=()=>{const{schema:e,registry:a}=this.props,{schemaUtils:r}=a;let o=e.items;return t.isFixedItems(e)&&t.allowAdditionalItems(e)&&(o=e.additionalItems),r.getDefaultFormState(o)},this.onAddClick=e=>{e&&e.preventDefault();const{onChange:t}=this.props,{keyedFormData:a}=this.state,r=[...a,{key:v(),item:this._getNewFormDataRow()}];this.setState({keyedFormData:r,updatedKeyedFormData:!0},(()=>t(F(r))))},this.onAddIndexClick=e=>t=>{t&&t.preventDefault();const{onChange:a}=this.props,{keyedFormData:r}=this.state,o={key:v(),item:this._getNewFormDataRow()},i=[...r];i.splice(e,0,o),this.setState({keyedFormData:i,updatedKeyedFormData:!0},(()=>a(F(i))))},this.onDropIndexClick=e=>t=>{t&&t.preventDefault();const{onChange:a,errorSchema:r}=this.props,{keyedFormData:o}=this.state;let i;if(r){i={};for(const t in r){const a=parseInt(t);a<e?y.default(i,[a],r[t]):a>e&&y.default(i,[a-1],r[t])}}const n=o.filter(((t,a)=>a!==e));this.setState({keyedFormData:n,updatedKeyedFormData:!0},(()=>a(F(n),i)))},this.onReorderClick=(e,t)=>a=>{a&&(a.preventDefault(),a.currentTarget.blur());const{onChange:r,errorSchema:o}=this.props;let i;if(this.props.errorSchema){i={};for(const a in o){const r=parseInt(a);r==e?y.default(i,[t],o[e]):r==t?y.default(i,[e],o[t]):y.default(i,[a],o[r])}}const{keyedFormData:n}=this.state,l=function(){const a=n.slice();return a.splice(e,1),a.splice(t,0,n[e]),a}();this.setState({keyedFormData:l},(()=>r(F(l),i)))},this.onChangeForIndex=e=>(t,a,r)=>{const{formData:o,onChange:i,errorSchema:n}=this.props;i((Array.isArray(o)?o:[]).map(((a,r)=>e===r?void 0===t?null:t:a)),n&&n&&{...n,[e]:a},r)},this.onSelectChange=e=>{const{onChange:t,idSchema:a}=this.props;t(e,void 0,a&&a.$id)};const{formData:a=[]}=e,r=C(a);this.state={keyedFormData:r,updatedKeyedFormData:!1}}static getDerivedStateFromProps(e,t){if(t.updatedKeyedFormData)return{updatedKeyedFormData:!1};const a=Array.isArray(e.formData)?e.formData:[],r=t.keyedFormData||[];return{keyedFormData:a.length===r.length?r.map(((e,t)=>({key:e.key,item:a[t]}))):C(a)}}get itemTitle(){const{schema:e}=this.props;return p.default(e,[t.ITEMS_KEY,"title"],p.default(e,[t.ITEMS_KEY,"description"],"Item"))}isItemRequired(e){return Array.isArray(e.type)?!e.type.includes("null"):"null"!==e.type}canAddItem(e){const{schema:a,uiSchema:r}=this.props;let{addable:o}=t.getUiOptions(r);return!1!==o&&(o=void 0===a.maxItems||e.length<a.maxItems),o}render(){const{schema:e,uiSchema:a,idSchema:r,registry:o}=this.props,{schemaUtils:i}=o;if(!(t.ITEMS_KEY in e)){const i=t.getUiOptions(a),n=t.getTemplate("UnsupportedFieldTemplate",o,i);return m.default.createElement(n,{schema:e,idSchema:r,reason:"Missing items definition",registry:o})}return i.isMultiSelect(e)?this.renderMultiSelect():t.isCustomWidget(a)?this.renderCustomWidget():t.isFixedItems(e)?this.renderFixedArray():i.isFilesArray(e,a)?this.renderFiles():this.renderNormalArray()}renderNormalArray(){const{schema:e,uiSchema:a={},errorSchema:r,idSchema:o,name:i,disabled:n=!1,readonly:l=!1,autofocus:s=!1,required:d=!1,registry:c,onBlur:u,onFocus:p,idPrefix:h,idSeparator:f="_",rawErrors:y}=this.props,{keyedFormData:S}=this.state,E=void 0===e.title?i:e.title,{schemaUtils:b,formContext:v}=c,C=t.getUiOptions(a),D=g.default(e.items)?e.items:{},x=b.retrieveSchema(D),k=F(this.state.keyedFormData),T={canAdd:this.canAddItem(k),items:S.map(((e,t)=>{const{key:n,item:l}=e,d=l,c=b.retrieveSchema(D,d),m=r?r[t]:void 0,g=b.toIdSchema(c,o.$id+f+t,d,h,f);return this.renderArrayFieldItem({key:n,index:t,name:i&&`${i}-${t}`,canMoveUp:t>0,canMoveDown:t<k.length-1,itemSchema:c,itemIdSchema:g,itemErrorSchema:m,itemData:d,itemUiSchema:a.items,autofocus:s&&0===t,onBlur:u,onFocus:p,rawErrors:y})})),className:`field field-array field-array-of-${x.type}`,disabled:n,idSchema:o,uiSchema:a,onAddClick:this.onAddClick,readonly:l,required:d,schema:e,title:E,formContext:v,formData:k,rawErrors:y,registry:c},N=t.getTemplate("ArrayFieldTemplate",c,C);return m.default.createElement(N,{...T})}renderCustomWidget(){const{schema:e,idSchema:a,uiSchema:r,disabled:o=!1,readonly:i=!1,autofocus:n=!1,required:l=!1,hideError:s,placeholder:d,onBlur:c,onFocus:u,formData:p=[],registry:h,rawErrors:f,name:g}=this.props,{widgets:y,formContext:S}=h,E=e.title||g,{widget:b,...v}=t.getUiOptions(r),C=t.getWidget(e,b,y);return m.default.createElement(C,{id:a&&a.$id,multiple:!0,onChange:this.onSelectChange,onBlur:c,onFocus:u,options:v,schema:e,uiSchema:r,registry:h,value:p,disabled:o,readonly:i,hideError:s,required:l,label:E,placeholder:d,formContext:S,autofocus:n,rawErrors:f})}renderMultiSelect(){const{schema:e,idSchema:a,uiSchema:r,formData:o=[],disabled:i=!1,readonly:n=!1,autofocus:l=!1,required:s=!1,placeholder:d,onBlur:c,onFocus:u,registry:p,rawErrors:h,name:f}=this.props,{widgets:g,schemaUtils:y,formContext:S}=p,E=y.retrieveSchema(e.items,o),b=e.title||f,v=t.optionsList(E),{widget:C="select",...F}=t.getUiOptions(r),D=t.getWidget(e,C,g);return m.default.createElement(D,{id:a&&a.$id,multiple:!0,onChange:this.onSelectChange,onBlur:c,onFocus:u,options:{...F,enumOptions:v},schema:e,uiSchema:r,registry:p,value:o,disabled:i,readonly:n,required:s,label:b,placeholder:d,formContext:S,autofocus:l,rawErrors:h})}renderFiles(){const{schema:e,uiSchema:a,idSchema:r,name:o,disabled:i=!1,readonly:n=!1,autofocus:l=!1,required:s=!1,onBlur:d,onFocus:c,registry:u,formData:p=[],rawErrors:h}=this.props,f=e.title||o,{widgets:g,formContext:y}=u,{widget:S="files",...E}=t.getUiOptions(a),b=t.getWidget(e,S,g);return m.default.createElement(b,{options:E,id:r&&r.$id,multiple:!0,onChange:this.onSelectChange,onBlur:d,onFocus:c,schema:e,uiSchema:a,title:f,value:p,disabled:i,readonly:n,required:s,registry:u,formContext:y,autofocus:l,rawErrors:h,label:""})}renderFixedArray(){const{schema:e,uiSchema:a={},formData:r=[],errorSchema:o,idPrefix:i,idSeparator:n="_",idSchema:l,name:s,disabled:d=!1,readonly:c=!1,autofocus:u=!1,required:p=!1,registry:h,onBlur:f,onFocus:y,rawErrors:S}=this.props,{keyedFormData:E}=this.state;let{formData:b=[]}=this.props;const v=e.title||s,C=t.getUiOptions(a),{schemaUtils:F,formContext:D}=h,x=(g.default(e.items)?e.items:[]).map(((e,t)=>F.retrieveSchema(e,r[t]))),k=g.default(e.additionalItems)?F.retrieveSchema(e.additionalItems,r):null;(!b||b.length<x.length)&&(b=b||[],b=b.concat(new Array(x.length-b.length)));const T={canAdd:this.canAddItem(b)&&!!k,className:"field field-array field-array-fixed-items",disabled:d,idSchema:l,formData:r,items:E.map(((t,r)=>{const{key:d,item:c}=t,m=c,p=r>=x.length,h=p&&g.default(e.additionalItems)?F.retrieveSchema(e.additionalItems,m):x[r],E=F.toIdSchema(h,l.$id+n+r,m,i,n),v=p?a.additionalItems||{}:Array.isArray(a.items)?a.items[r]:a.items||{};return this.renderArrayFieldItem({key:d,index:r,name:s&&`${s}-${r}`,canRemove:p,canMoveUp:r>=x.length+1,canMoveDown:p&&r<b.length-1,itemSchema:h,itemData:m,itemUiSchema:v,itemIdSchema:E,itemErrorSchema:o?o[r]:void 0,autofocus:u&&0===r,onBlur:f,onFocus:y,rawErrors:S})})),onAddClick:this.onAddClick,readonly:c,required:p,registry:h,schema:e,uiSchema:a,title:v,formContext:D,rawErrors:S},N=t.getTemplate("ArrayFieldTemplate",h,C);return m.default.createElement(N,{...T})}renderArrayFieldItem(e){const{key:a,index:r,name:o,canRemove:i=!0,canMoveUp:n=!0,canMoveDown:l=!0,itemSchema:s,itemData:d,itemUiSchema:c,itemIdSchema:u,itemErrorSchema:p,autofocus:h,onBlur:f,onFocus:g,rawErrors:y}=e,{disabled:S,hideError:E,idPrefix:b,idSeparator:v,readonly:C,uiSchema:F,registry:D,formContext:x}=this.props,{fields:{ArraySchemaField:k,SchemaField:T}}=D,N=k||T,{orderable:A=!0,removable:w=!0}=t.getUiOptions(F),O={moveUp:A&&n,moveDown:A&&l,remove:w&&i,toolbar:!1};return O.toolbar=Object.keys(O).some((e=>O[e])),{children:m.default.createElement(N,{name:o,index:r,schema:s,uiSchema:c,formData:d,formContext:x,errorSchema:p,idPrefix:b,idSeparator:v,idSchema:u,required:this.isItemRequired(s),onChange:this.onChangeForIndex(r),onBlur:f,onFocus:g,registry:D,disabled:S,readonly:C,hideError:E,autofocus:h,rawErrors:y}),className:"array-item",disabled:S,hasToolbar:O.toolbar,hasMoveUp:O.moveUp,hasMoveDown:O.moveDown,hasRemove:O.remove,index:r,key:a,onAddIndexClick:this.onAddIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:C,registry:D,uiSchema:c}}}function x(e){const{schema:a,name:r,uiSchema:o,idSchema:i,formData:n,registry:l,required:s,disabled:d,readonly:c,autofocus:u,onChange:p,onFocus:h,onBlur:f,rawErrors:y}=e,{title:S}=a,{widgets:E,formContext:b}=l,{widget:v="checkbox",...C}=t.getUiOptions(o),F=t.getWidget(a,v,E);let D;if(Array.isArray(a.oneOf))D=t.optionsList({oneOf:a.oneOf.map((e=>{if(g.default(e))return{...e,title:e.title||(!0===e.const?"Yes":"No")}})).filter((e=>e))});else{const e=a,r=a.enum??[!0,!1];D=!e.enumNames&&2===r.length&&r.every((e=>"boolean"==typeof e))?[{value:r[0],label:r[0]?"Yes":"No"},{value:r[1],label:r[1]?"Yes":"No"}]:t.optionsList({enum:r,enumNames:e.enumNames})}return m.default.createElement(F,{options:{...C,enumOptions:D},schema:a,uiSchema:o,id:i&&i.$id,onChange:p,onFocus:h,onBlur:f,label:void 0===S?r:S,value:n,required:s,disabled:d,readonly:c,registry:l,formContext:b,autofocus:u,rawErrors:y})}class k extends e.Component{constructor(e){super(e),this.onOptionChange=e=>{const a=parseInt(e,10),{formData:r,onChange:o,options:i,registry:n}=this.props,{schemaUtils:l}=n,s=l.retrieveSchema(i[a],r);let d;if("object"===t.guessType(r)&&("object"===s.type||s.properties)){d=Object.assign({},r);const e=i.slice();e.splice(a,1);for(const t of e)if(t.properties)for(const e in t.properties)e in d&&S.default(d,e)}o(l.getDefaultFormState(i[a],d,"excludeObjectChildren"),void 0,this.getFieldId()),this.setState({selectedOption:parseInt(e,10)})};const{formData:a,options:r}=this.props;this.state={selectedOption:this.getMatchingOption(0,a,r)}}componentDidUpdate(e,a){const{formData:r,options:o,idSchema:i}=this.props,{selectedOption:n}=this.state;if(!t.deepEquals(r,e.formData)&&i.$id===e.idSchema.$id){const e=this.getMatchingOption(n,r,o);if(!a||e===n)return;this.setState({selectedOption:e})}}getMatchingOption(e,t,a){const{schemaUtils:r}=this.props.registry,o=r.getMatchingOption(t,a);return 0!==o?o:e||0}getFieldId(){const{idSchema:e,schema:t}=this.props;return`${e.$id}${t.oneOf?"__oneof_select":"__anyof_select"}`}render(){const{name:e,baseType:a,disabled:r=!1,readonly:o=!1,hideError:i=!1,errorSchema:n={},formData:l,formContext:s,idPrefix:d,idSeparator:c,idSchema:u,onBlur:p,onChange:h,onFocus:f,options:g,registry:y,uiSchema:S}=this.props,{widgets:E,fields:b}=y,{SchemaField:v}=b,{selectedOption:C}=this.state,{widget:F="select",...D}=t.getUiOptions(S),x=t.getWidget({type:"number"},F,E),k=g[C]||null;let T;k&&(T=k.type?k:Object.assign({},k,{type:a}));const N=g.map(((e,t)=>({label:e.title||`Option ${t+1}`,value:t})));return m.default.createElement("div",{className:"panel panel-default panel-body"},m.default.createElement("div",{className:"form-group"},m.default.createElement(x,{id:this.getFieldId(),schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:p,onFocus:f,value:C,options:{enumOptions:N},registry:y,formContext:s,...D,label:""})),null!==k&&m.default.createElement(v,{name:e,schema:T,uiSchema:S,errorSchema:n,idSchema:u,idPrefix:d,idSeparator:c,formData:l,formContext:s,onChange:h,onBlur:p,onFocus:f,registry:y,disabled:r,readonly:o,hideError:i}))}}const T=/\.([0-9]*0)*$/,N=/[0.]0*$/;function A(a){const{registry:r,onChange:o,formData:i,value:n}=a,[l,s]=e.useState(n),{StringField:d}=r.fields;let c=i;const u=e.useCallback((e=>{s(e),"."===`${e}`.charAt(0)&&(e=`0${e}`);const a="string"==typeof e&&e.match(T)?t.asNumber(e.replace(N,"")):t.asNumber(e);o(a)}),[o]);if("string"==typeof l&&"number"==typeof c){const e=new RegExp(`${c}`.replace(".","\\.")+"\\.?0*$");l.match(e)&&(c=l)}return m.default.createElement(d,{...a,formData:c,onChange:u})}class w extends e.Component{constructor(){var e;super(...arguments),e=this,this.state={wasPropertyKeyModified:!1,additionalProperties:{}},this.onPropertyChange=function(t,a){return void 0===a&&(a=!1),(r,o,i)=>{const{formData:n,onChange:l,errorSchema:s}=e.props;void 0===r&&a&&(r=""),l({...n,[t]:r},s&&s&&{...s,[t]:o},i)}},this.onDropPropertyClick=e=>t=>{t.preventDefault();const{onChange:a,formData:r}=this.props,o={...r};S.default(o,e),a(o)},this.getAvailableKey=(e,a)=>{const{uiSchema:r}=this.props,{duplicateKeySuffixSeparator:o="-"}=t.getUiOptions(r);let i=0,n=e;for(;n in a;)n=`${e}${o}${++i}`;return n},this.onKeyChange=e=>(t,a)=>{if(e===t)return;const{formData:r,onChange:o,errorSchema:i}=this.props;t=this.getAvailableKey(t,r);const n={...r},l={[e]:t},s=Object.keys(n).map((e=>({[l[e]||e]:n[e]}))),d=Object.assign({},...s);this.setState({wasPropertyKeyModified:!0}),o(d,i&&i&&{...i,[t]:a})},this.handleAddClick=e=>()=>{if(!e.additionalProperties)return;const{formData:a,onChange:r,registry:o}=this.props,i={...a};let n;if(g.default(e.additionalProperties)&&(n=e.additionalProperties.type,t.REF_KEY in e.additionalProperties)){const{schemaUtils:r}=o;n=r.retrieveSchema({$ref:e.additionalProperties[t.REF_KEY]},a).type}const l=this.getAvailableKey("newKey",i);y.default(i,l,this.getDefaultValue(n)),r(i)}}isRequired(e){const{schema:t}=this.props;return Array.isArray(t.required)&&-1!==t.required.indexOf(e)}getDefaultValue(e){switch(e){case"string":default:return"New Value";case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{}}}render(){const{schema:e,uiSchema:a={},formData:r,errorSchema:o,idSchema:i,name:n,required:l=!1,disabled:s=!1,readonly:d=!1,hideError:c,idPrefix:u,idSeparator:h,onBlur:f,onFocus:g,registry:y}=this.props,{fields:S,formContext:b,schemaUtils:v}=y,{SchemaField:C}=S,F=v.retrieveSchema(e,r),D=t.getUiOptions(a),{properties:x={}}=F,k=void 0===F.title?n:F.title,T=D.description||F.description;let N;try{const e=Object.keys(x);N=t.orderProperties(e,D.order)}catch(e){return m.default.createElement("div",null,m.default.createElement("p",{className:"config-error",style:{color:"red"}},"Invalid ",n||"root"," object field configuration:",m.default.createElement("em",null,e.message),"."),m.default.createElement("pre",null,JSON.stringify(F)))}const A=t.getTemplate("ObjectFieldTemplate",y,D),w={title:D.title||k,description:T,properties:N.map((e=>{const n=E.default(F,[t.PROPERTIES_KEY,e,t.ADDITIONAL_PROPERTY_FLAG]),S=n?a.additionalProperties:a[e],v="hidden"===t.getUiOptions(S).widget,D=p.default(i,[e],{});return{content:m.default.createElement(C,{key:e,name:e,required:this.isRequired(e),schema:p.default(F,[t.PROPERTIES_KEY,e],{}),uiSchema:S,errorSchema:p.default(o,e),idSchema:D,idPrefix:u,idSeparator:h,formData:p.default(r,e),formContext:b,wasPropertyKeyModified:this.state.wasPropertyKeyModified,onKeyChange:this.onKeyChange(e),onChange:this.onPropertyChange(e,n),onBlur:f,onFocus:g,registry:y,disabled:s,readonly:d,hideError:c,onDropPropertyClick:this.onDropPropertyClick}),name:e,readonly:d,disabled:s,required:l,hidden:v}})),readonly:d,disabled:s,required:l,idSchema:i,uiSchema:a,schema:F,formData:r,formContext:b,registry:y};return m.default.createElement(A,{...w,onAddClick:this.handleAddClick})}}const O={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function B(e){const{schema:a,idSchema:r,uiSchema:o,formData:i,errorSchema:n,idPrefix:l,idSeparator:s,name:d,onChange:c,onKeyChange:u,onDropPropertyClick:p,required:h,registry:f,wasPropertyKeyModified:y=!1}=e,{formContext:S,schemaUtils:E}=f,v=t.getUiOptions(o),C=t.getTemplate("FieldTemplate",f,v),F=t.getTemplate("DescriptionFieldTemplate",f,v),D=t.getTemplate("FieldHelpTemplate",f,v),x=t.getTemplate("FieldErrorTemplate",f,v),k=E.retrieveSchema(a,i),T=r[t.ID_KEY],N=t.mergeObjects(E.toIdSchema(k,T,i,l,s),r),A=m.default.useCallback(((e,t,a)=>c(e,t,a||T)),[T,c]),w=function(e,a,r,o){const i=a.field,{fields:n}=o;if("function"==typeof i)return i;if("string"==typeof i&&i in n)return n[i];const l=t.getSchemaType(e),s=Array.isArray(l)?l[0]:l||"",d=O[s];return d||!e.anyOf&&!e.oneOf?d in n?n[d]:()=>{const i=t.getTemplate("UnsupportedFieldTemplate",o,a);return m.default.createElement(i,{schema:e,idSchema:r,reason:`Unknown field type ${e.type}`,registry:o})}:()=>null}(k,v,N,f),B=Boolean(e.disabled||v.disabled),I=Boolean(e.readonly||v.readonly||e.schema.readOnly||k.readOnly),U=v.hideError,$=void 0===U?e.hideError:Boolean(U),q=Boolean(e.autofocus||v.autofocus);if(0===Object.keys(k).length)return null;const P=E.getDisplayLabel(k,o),{__errors:_,...R}=n||{},V=b.default(o,["ui:classNames","classNames"]);"ui:options"in V&&(V["ui:options"]=b.default(V["ui:options"],["classNames"]));const M=m.default.createElement(w,{...e,onChange:A,idSchema:N,schema:k,uiSchema:V,disabled:B,readonly:I,hideError:$,autofocus:q,errorSchema:R,formContext:S,rawErrors:_}),K=N[t.ID_KEY];let W;W=y||t.ADDITIONAL_PROPERTY_FLAG in k?d:v.title||e.schema.title||k.title||d;const j=v.description||e.schema.description||k.description||"",L=v.help,Y="hidden"===v.widget,z=["form-group","field",`field-${k.type}`];!$&&_&&_.length>0&&z.push("field-error has-error has-danger"),null!=o&&o.classNames&&z.push(o.classNames),v.classNames&&z.push(v.classNames);const H=m.default.createElement(D,{help:L,idSchema:N,schema:k,uiSchema:o,hasErrors:!$&&_&&_.length>0,registry:f}),J=$?void 0:m.default.createElement(x,{errors:_,errorSchema:n,idSchema:N,schema:k,uiSchema:o,registry:f}),G={description:m.default.createElement(F,{id:`${K}__description`,description:j,schema:k,uiSchema:o,registry:f}),rawDescription:j,help:H,rawHelp:"string"==typeof L?L:void 0,errors:J,rawErrors:$?void 0:_,id:K,label:W,hidden:Y,onChange:c,onKeyChange:u,onDropPropertyClick:p,required:h,disabled:B,readonly:I,hideError:$,displayLabel:P,classNames:z.join(" ").trim(),formContext:S,formData:i,schema:k,uiSchema:o,registry:f},Q=f.fields.AnyOfField,X=f.fields.OneOfField;return m.default.createElement(C,{...G},m.default.createElement(m.default.Fragment,null,M,k.anyOf&&!(null!=o&&o["ui:field"])&&!E.isSelect(k)&&m.default.createElement(Q,{name:d,disabled:B,readonly:I,hideError:$,errorSchema:n,formData:i,formContext:S,idPrefix:l,idSchema:N,idSeparator:s,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:k.anyOf.map((e=>E.retrieveSchema(g.default(e)?e:{},i))),baseType:k.type,registry:f,schema:k,uiSchema:o}),k.oneOf&&!(null!=o&&o["ui:field"])&&!E.isSelect(k)&&m.default.createElement(X,{name:d,disabled:B,readonly:I,hideError:$,errorSchema:n,formData:i,formContext:S,idPrefix:l,idSchema:N,idSeparator:s,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:k.oneOf.map((e=>E.retrieveSchema(g.default(e)?e:{},i))),baseType:k.type,registry:f,schema:k,uiSchema:o})))}class I extends m.default.Component{shouldComponentUpdate(e){return!t.deepEquals(this.props,e)}render(){return m.default.createElement(B,{...this.props})}}function U(e){const{schema:a,name:r,uiSchema:o,idSchema:i,formData:n,required:l,disabled:s=!1,readonly:d=!1,autofocus:c=!1,onChange:u,onBlur:p,onFocus:h,registry:f,rawErrors:g}=e,{title:y,format:S}=a,{widgets:E,formContext:b,schemaUtils:v}=f,C=v.isSelect(a)?t.optionsList(a):void 0;let F=C?"select":"text";S&&t.hasWidget(a,S,E)&&(F=S);const{widget:D=F,placeholder:x="",...k}=t.getUiOptions(o),T=t.getWidget(a,D,E);return m.default.createElement(T,{options:{...k,enumOptions:C},schema:a,uiSchema:o,id:i&&i.$id,label:void 0===y?r:y,value:n,onChange:u,onBlur:p,onFocus:h,required:l,disabled:s,readonly:d,formContext:b,autofocus:c,registry:f,placeholder:x,rawErrors:g})}function $(t){const{formData:a,onChange:r}=t;return e.useEffect((()=>{void 0===a&&r(null)}),[a,r]),null}function q(e){const{idSchema:a,description:r,registry:o,schema:i,uiSchema:n}=e,l=t.getUiOptions(n),{label:s=!0}=l;if(!r||!s)return null;const d=t.getTemplate("DescriptionFieldTemplate",o,l);return m.default.createElement(d,{id:`${a.$id}__description`,description:r,schema:i,uiSchema:n,registry:o})}function P(e){const{children:t,className:a,disabled:r,hasToolbar:o,hasMoveDown:i,hasMoveUp:n,hasRemove:l,index:s,onDropIndexClick:d,onReorderClick:c,readonly:u,registry:p,uiSchema:h}=e,{MoveDownButton:f,MoveUpButton:g,RemoveButton:y}=p.templates.ButtonTemplates,S={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return m.default.createElement("div",{className:a},m.default.createElement("div",{className:o?"col-xs-9":"col-xs-12"},t),o&&m.default.createElement("div",{className:"col-xs-3 array-item-toolbox"},m.default.createElement("div",{className:"btn-group",style:{display:"flex",justifyContent:"space-around"}},(n||i)&&m.default.createElement(g,{style:S,disabled:r||u||!n,onClick:c(s,s-1),uiSchema:h}),(n||i)&&m.default.createElement(f,{style:S,disabled:r||u||!i,onClick:c(s,s+1),uiSchema:h}),l&&m.default.createElement(y,{style:S,disabled:r||u,onClick:d(s),uiSchema:h}))))}function _(e){const{canAdd:a,className:r,disabled:o,idSchema:i,uiSchema:n,items:l,onAddClick:s,readonly:d,registry:c,required:u,schema:p,title:h}=e,f=t.getUiOptions(n),g=t.getTemplate("ArrayFieldDescriptionTemplate",c,f),y=t.getTemplate("ArrayFieldItemTemplate",c,f),S=t.getTemplate("ArrayFieldTitleTemplate",c,f),{ButtonTemplates:{AddButton:E}}=c.templates;return m.default.createElement("fieldset",{className:r,id:i.$id},m.default.createElement(S,{idSchema:i,title:f.title||h,required:u,schema:p,uiSchema:n,registry:c}),m.default.createElement(g,{idSchema:i,description:f.description||p.description,schema:p,uiSchema:n,registry:c}),m.default.createElement("div",{className:"row array-item-list"},l&&l.map((e=>{let{key:t,...a}=e;return m.default.createElement(y,{key:t,...a})}))),a&&m.default.createElement(E,{className:"array-item-add",onClick:s,disabled:o||d,uiSchema:n}))}function R(e){const{idSchema:a,title:r,schema:o,uiSchema:i,required:n,registry:l}=e,s=t.getUiOptions(i),{label:d=!0}=s;if(!r||!d)return null;const c=t.getTemplate("TitleFieldTemplate",l,s);return m.default.createElement(c,{id:`${a.$id}__title`,title:r,required:n,schema:o,uiSchema:i,registry:l})}function V(a){const{id:r,value:o,readonly:i,disabled:n,autofocus:l,onBlur:s,onFocus:d,onChange:c,options:u,schema:p,uiSchema:h,formContext:f,registry:g,rawErrors:y,type:S,...E}=a;if(!r)throw console.log("No id for",a),new Error(`no id for props ${JSON.stringify(a)}`);const b={...E,...t.getInputProps(p,S,u)};let v;v="number"===b.type||"integer"===b.type?o||0===o?o:"":null==o?"":o;const C=e.useCallback((e=>{let{target:{value:t}}=e;return c(""===t?u.emptyValue:t)}),[c,u]),F=e.useCallback((e=>{let{target:{value:t}}=e;return s(r,t)}),[s,r]),D=e.useCallback((e=>{let{target:{value:t}}=e;return d(r,t)}),[d,r]);return m.default.createElement(m.default.Fragment,null,m.default.createElement("input",{id:r,name:r,className:"form-control",readOnly:i,disabled:n,autoFocus:l,value:v,...b,list:p.examples?`examples_${r}`:void 0,onChange:C,onBlur:F,onFocus:D}),Array.isArray(p.examples)&&m.default.createElement("datalist",{key:`datalist_${r}`,id:`examples_${r}`},[...new Set(p.examples.concat(p.default?[p.default]:[]))].map((e=>m.default.createElement("option",{key:e,value:e})))))}function M(e){let{uiSchema:a}=e;const{submitText:r,norender:o,props:i={}}=t.getSubmitButtonOptions(a);return o?null:m.default.createElement("div",null,m.default.createElement("button",{type:"submit",...i,className:`btn btn-info ${i.className}`},r))}function K(e){const{iconType:t="default",icon:a,className:r,uiSchema:o,...i}=e;return m.default.createElement("button",{type:"button",className:`btn btn-${t} ${r}`,...i},m.default.createElement("i",{className:`glyphicon glyphicon-${a}`}))}function W(e){return m.default.createElement(K,{title:"Move down",className:"array-item-move-down",...e,icon:"arrow-down"})}function j(e){return m.default.createElement(K,{title:"Move up",className:"array-item-move-up",...e,icon:"arrow-up"})}function L(e){return m.default.createElement(K,{title:"Remove",className:"array-item-remove",...e,iconType:"danger",icon:"remove"})}function Y(e){let{className:t,onClick:a,disabled:r}=e;return m.default.createElement("div",{className:"row"},m.default.createElement("p",{className:`col-xs-3 col-xs-offset-9 text-right ${t}`},m.default.createElement(K,{iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:"Add",onClick:a,disabled:r})))}function z(e){const{id:t,description:a}=e;return a?m.default.createElement("string"==typeof a?"p":"div",{id:t,className:"field-description"},a):null}function H(e){let{errors:t}=e;return m.default.createElement("div",{className:"panel panel-danger errors"},m.default.createElement("div",{className:"panel-heading"},m.default.createElement("h3",{className:"panel-title"},"Errors")),m.default.createElement("ul",{className:"list-group"},t.map(((e,t)=>m.default.createElement("li",{key:t,className:"list-group-item text-danger"},e.stack)))))}function J(e){const{label:t,required:a,id:r}=e;return t?m.default.createElement("label",{className:"control-label",htmlFor:r},t,a&&m.default.createElement("span",{className:"required"},"*")):null}function G(e){const{id:a,label:r,children:o,errors:i,help:n,description:l,hidden:s,required:d,displayLabel:c,registry:u,uiSchema:p}=e,h=t.getUiOptions(p),f=t.getTemplate("WrapIfAdditionalTemplate",u,h);return s?m.default.createElement("div",{className:"hidden"},o):m.default.createElement(f,{...e},c&&m.default.createElement(J,{label:r,required:d,id:a}),c&&l?l:null,o,i,n)}function Q(e){const{errors:t=[],idSchema:a}=e;return 0===t.length?null:m.default.createElement("div",null,m.default.createElement("ul",{id:`${a.$id}__error`,className:"error-detail bs-callout bs-callout-info"},t.filter((e=>!!e)).map(((e,t)=>m.default.createElement("li",{className:"text-danger",key:t},e)))))}function X(e){const{idSchema:t,help:a}=e;return a?m.default.createElement("string"==typeof a?"p":"div",{id:`${t.$id}__help`,className:"help-block"},a):null}function Z(e){const{description:a,disabled:r,formData:o,idSchema:i,onAddClick:n,properties:l,readonly:s,registry:d,required:c,schema:u,title:p,uiSchema:h}=e,f=t.getUiOptions(h),g=t.getTemplate("TitleFieldTemplate",d,f),y=t.getTemplate("DescriptionFieldTemplate",d,f),{ButtonTemplates:{AddButton:S}}=d.templates;return m.default.createElement("fieldset",{id:i.$id},(f.title||p)&&m.default.createElement(g,{id:`${i.$id}__title`,title:f.title||p,required:c,schema:u,uiSchema:h,registry:d}),(f.description||a)&&m.default.createElement(y,{id:`${i.$id}__description`,description:f.description||a,schema:u,uiSchema:h,registry:d}),l.map((e=>e.content)),t.canExpand(u,h,o)&&m.default.createElement(S,{className:"object-property-expand",onClick:n(u),disabled:r||s,uiSchema:h}))}function ee(e){const{id:t,title:a,required:r}=e;return m.default.createElement("legend",{id:t},a,r&&m.default.createElement("span",{className:"required"},"*"))}function te(e){const{schema:t,idSchema:a,reason:r}=e;return m.default.createElement("div",{className:"unsupported-field"},m.default.createElement("p",null,"Unsupported field schema",a&&a.$id&&m.default.createElement("span",null," for"," field ",m.default.createElement("code",null,a.$id)),r&&m.default.createElement("em",null,": ",r),"."),t&&m.default.createElement("pre",null,JSON.stringify(t,null,2)))}function ae(e){const{id:a,classNames:r,disabled:o,label:i,onKeyChange:n,onDropPropertyClick:l,readonly:s,required:d,schema:c,children:u,uiSchema:p,registry:h}=e,{RemoveButton:f}=h.templates.ButtonTemplates;return m.default.createElement("div",{className:r},t.ADDITIONAL_PROPERTY_FLAG in c?m.default.createElement("div",{className:"row"},m.default.createElement("div",{className:"col-xs-5 form-additional"},m.default.createElement("div",{className:"form-group"},m.default.createElement(J,{label:`${i} Key`,required:d,id:`${a}-key`}),m.default.createElement("input",{className:"form-control",type:"text",id:`${a}-key`,onBlur:e=>n(e.target.value),defaultValue:i}))),m.default.createElement("div",{className:"form-additional form-group col-xs-5"},u),m.default.createElement("div",{className:"col-xs-2"},m.default.createElement(f,{className:"array-item-remove btn-block",style:{border:"0"},disabled:o||s,onClick:l(i),uiSchema:p}))):u)}function re(e,a){const r=[];for(let o=e;o<=a;o++)r.push({value:o,label:t.pad(o,2)});return r}function oe(e){let{type:t,range:a,value:r,select:o,rootId:i,disabled:n,readonly:l,autofocus:s,registry:d,onBlur:c,onFocus:u}=e;const p=i+"_"+t,{SelectWidget:h}=d.widgets;return m.default.createElement(h,{schema:{type:"integer"},id:p,className:"form-control",options:{enumOptions:re(a[0],a[1])},placeholder:t,value:r,disabled:n,readonly:l,autofocus:s,onChange:e=>o(t,e),onBlur:c,onFocus:u,registry:d,label:""})}function ie(a){let{time:r=!1,disabled:o=!1,readonly:i=!1,autofocus:n=!1,options:l,id:s,registry:d,onBlur:c,onFocus:u,onChange:p,value:h}=a;const[f,g]=e.useReducer(((e,t)=>({...e,...t})),t.parseDateString(h,r));e.useEffect((()=>{h&&h!==t.toDateString(f,r)&&g(t.parseDateString(h,r))}),[h,f,r]),e.useEffect((()=>{(function(e){return Object.values(e).every((e=>-1!==e))})(f)&&p(t.toDateString(f,r))}),[f,r,p]);const y=e.useCallback(((e,t)=>{g({[e]:t})}),[]),S=e.useCallback((e=>{if(e.preventDefault(),o||i)return;const a=t.parseDateString((new Date).toJSON(),r);g(a)}),[o,i,r]),E=e.useCallback((e=>{e.preventDefault(),o||i||(g(t.parseDateString("",r)),p(void 0))}),[o,i,r,p]);return m.default.createElement("ul",{className:"list-inline"},function(e,t,a){void 0===a&&(a=[1900,(new Date).getFullYear()+2]);const{year:r,month:o,day:i,hour:n,minute:l,second:s}=e,d=[{type:"year",range:a,value:r},{type:"month",range:[1,12],value:o},{type:"day",range:[1,31],value:i}];return t&&d.push({type:"hour",range:[0,23],value:n},{type:"minute",range:[0,59],value:l},{type:"second",range:[0,59],value:s}),d}(f,r,l.yearsRange).map(((e,t)=>m.default.createElement("li",{key:t},m.default.createElement(oe,{rootId:s,select:y,...e,disabled:o,readonly:i,registry:d,onBlur:c,onFocus:u,autofocus:n&&0===t})))),("undefined"===l.hideNowButton||!l.hideNowButton)&&m.default.createElement("li",null,m.default.createElement("a",{href:"#",className:"btn btn-info btn-now",onClick:S},"Now")),("undefined"===l.hideClearButton||!l.hideClearButton)&&m.default.createElement("li",null,m.default.createElement("a",{href:"#",className:"btn btn-warning btn-clear",onClick:E},"Clear")))}function ne(e){let{time:t=!0,...a}=e;const{AltDateWidget:r}=a.registry.widgets;return m.default.createElement(r,{time:t,...a})}function le(a){let{schema:r,uiSchema:o,options:i,id:n,value:l,disabled:s,readonly:d,label:c,autofocus:u=!1,onBlur:p,onFocus:h,onChange:f,registry:g}=a;const y=t.getTemplate("DescriptionFieldTemplate",g,i),S=t.schemaRequiresTrueValue(r),E=e.useCallback((e=>f(e.target.checked)),[f]),b=e.useCallback((e=>p(n,e.target.checked)),[p,n]),v=e.useCallback((e=>h(n,e.target.checked)),[h,n]);return m.default.createElement("div",{className:"checkbox "+(s||d?"disabled":"")},r.description&&m.default.createElement(y,{id:n+"__description",description:r.description,schema:r,uiSchema:o,registry:g}),m.default.createElement("label",null,m.default.createElement("input",{type:"checkbox",id:n,name:n,checked:void 0!==l&&l,required:S,disabled:s||d,autoFocus:u,onChange:E,onBlur:b,onFocus:v}),m.default.createElement("span",null,c)))}function se(e){let{id:t,disabled:a,options:{inline:r=!1,enumOptions:o,enumDisabled:i},value:n,autofocus:l=!1,readonly:s,onChange:d}=e;return m.default.createElement("div",{className:"checkboxes",id:t},Array.isArray(o)&&o.map(((e,c)=>{const u=-1!==n.indexOf(e.value),p=Array.isArray(i)&&-1!=i.indexOf(e.value),h=a||p||s?"disabled":"",f=m.default.createElement("span",null,m.default.createElement("input",{type:"checkbox",id:`${t}-${e.value}`,name:t,checked:u,disabled:a||p||s,autoFocus:l&&0===c,onChange:t=>{const a=o.map((e=>{let{value:t}=e;return t}));d(t.target.checked?function(e,t,a){const r=a.indexOf(e);return t.slice(0,r).concat(e,t.slice(r)).sort(((e,t)=>Number(a.indexOf(e)>a.indexOf(t))))}(e.value,n,a):function(e,t){return t.filter((t=>t!==e))}(e.value,n))}}),m.default.createElement("span",null,e.label));return r?m.default.createElement("label",{key:e.value,className:`checkbox-inline ${h}`},f):m.default.createElement("div",{key:e.value,className:`checkbox ${h}`},m.default.createElement("label",null,f))})))}function de(e){const{disabled:a,readonly:r,options:o,registry:i}=e,n=t.getTemplate("BaseInputTemplate",i,o);return m.default.createElement(n,{type:"color",...e,disabled:a||r})}function ce(a){const{onChange:r,options:o,registry:i}=a,n=t.getTemplate("BaseInputTemplate",i,o),l=e.useCallback((e=>r(e||void 0)),[r]);return m.default.createElement(n,{type:"date",...a,onChange:l})}function ue(e){const{onChange:a,value:r,options:o,registry:i}=e,n=t.getTemplate("BaseInputTemplate",i,o);return m.default.createElement(n,{type:"datetime-local",...e,value:t.utcToLocal(r),onChange:e=>a(t.localToUTC(e))})}function me(e){const{options:a,registry:r}=e,o=t.getTemplate("BaseInputTemplate",r,a);return m.default.createElement(o,{type:"email",...e})}function pe(e,t){return null===e?null:e.replace(";base64",`;name=${encodeURIComponent(t)};base64`)}function he(e){const{name:t,size:a,type:r}=e;return new Promise(((o,i)=>{const n=new window.FileReader;n.onerror=i,n.onload=e=>{var i;"string"==typeof(null===(i=e.target)||void 0===i?void 0:i.result)?o({dataURL:pe(e.target.result,t),name:t,size:a,type:r}):o({dataURL:null,name:t,size:a,type:r})},n.readAsDataURL(e)}))}function fe(e){let{filesInfo:t}=e;return 0===t.length?null:m.default.createElement("ul",{className:"file-info"},t.map(((e,t)=>{const{name:a,size:r,type:o}=e;return m.default.createElement("li",{key:t},m.default.createElement("strong",null,a)," (",o,", ",r," bytes)")})))}function ge(e){return e.filter((e=>void 0!==e)).map((e=>{const{blob:a,name:r}=t.dataURItoBlob(e);return{name:r,size:a.size,type:a.type}}))}function ye(t){let{multiple:a,id:r,readonly:o,disabled:i,onChange:n,value:l,autofocus:s=!1,options:d}=t;const c=e.useMemo((()=>Array.isArray(l)?ge(l):ge([l])),[l]),[u,p]=e.useState(c),h=e.useCallback((e=>{var t;e.target.files&&(t=e.target.files,Promise.all(Array.from(t).map(he))).then((e=>{p(e);const t=e.map((e=>e.dataURL));n(a?t:t[0])}))}),[a,n]);return m.default.createElement("div",null,m.default.createElement("p",null,m.default.createElement("input",{id:r,name:r,type:"file",disabled:o||i,onChange:h,defaultValue:"",autoFocus:s,multiple:a,accept:d.accept?String(d.accept):void 0})),m.default.createElement(fe,{filesInfo:u}))}function Se(e){let{id:t,value:a}=e;return m.default.createElement("input",{type:"hidden",id:t,name:t,value:void 0===a?"":a})}function Ee(e){const{options:a,registry:r}=e,o=t.getTemplate("BaseInputTemplate",r,a);return m.default.createElement(o,{type:"password",...e})}function be(t){let{options:a,value:r,required:o,disabled:i,readonly:n,autofocus:l=!1,onBlur:s,onFocus:d,onChange:c,id:u}=t;const p=Math.random().toString(),{enumOptions:h,enumDisabled:f,inline:g}=a,y=e.useCallback((e=>s(u,e.target.value)),[s,u]),S=e.useCallback((e=>d(u,e.target.value)),[d,u]);return m.default.createElement("div",{className:"field-radio-group",id:u},Array.isArray(h)&&h.map(((e,t)=>{const a=e.value===r,s=Array.isArray(f)&&-1!=f.indexOf(e.value),d=i||s||n?"disabled":"",h=m.default.createElement("span",null,m.default.createElement("input",{type:"radio",id:`${u}-${e.value}`,checked:a,name:p,required:o,value:e.value,disabled:i||s||n,autoFocus:l&&0===t,onChange:()=>c(e.value),onBlur:y,onFocus:S}),m.default.createElement("span",null,e.label));return g?m.default.createElement("label",{key:e.value,className:`radio-inline ${d}`},h):m.default.createElement("div",{key:e.value,className:`radio ${d}`},m.default.createElement("label",null,h))})))}function ve(e){const{value:t,registry:{templates:{BaseInputTemplate:a}}}=e;return m.default.createElement("div",{className:"field-range-wrapper"},m.default.createElement(a,{type:"range",...e}),m.default.createElement("span",{className:"range-view"},t))}function Ce(e,t){return t?Array.from(e.target.options).slice().filter((e=>e.selected)).map((e=>e.value)):e.target.value}function Fe(a){let{schema:r,id:o,options:i,value:n,required:l,disabled:s,readonly:d,multiple:c=!1,autofocus:u=!1,onChange:p,onBlur:h,onFocus:f,placeholder:g}=a;const{enumOptions:y,enumDisabled:S}=i,E=c?[]:"",b=e.useCallback((e=>{const a=Ce(e,c);return f(o,t.processSelectValue(r,a,i))}),[f,o,r,c,i]),v=e.useCallback((e=>{const a=Ce(e,c);return h(o,t.processSelectValue(r,a,i))}),[h,o,r,c,i]),C=e.useCallback((e=>{const a=Ce(e,c);return p(t.processSelectValue(r,a,i))}),[p,r,c,i]);return m.default.createElement("select",{id:o,name:o,multiple:c,className:"form-control",value:void 0===n?E:n,required:l,disabled:s||d,autoFocus:u,onBlur:v,onFocus:b,onChange:C},!c&&void 0===r.default&&m.default.createElement("option",{value:""},g),Array.isArray(y)&&y.map(((e,t)=>{let{value:a,label:r}=e;const o=S&&-1!=S.indexOf(a);return m.default.createElement("option",{key:t,value:a,disabled:o},r)})))}function De(t){let{id:a,options:r={},placeholder:o,value:i,required:n,disabled:l,readonly:s,autofocus:d=!1,onChange:c,onBlur:u,onFocus:p}=t;const h=e.useCallback((e=>{let{target:{value:t}}=e;return c(""===t?r.emptyValue:t)}),[c,r.emptyValue]),f=e.useCallback((e=>{let{target:{value:t}}=e;return u(a,t)}),[u,a]),g=e.useCallback((e=>{let{target:{value:t}}=e;return p(a,t)}),[a,p]);return m.default.createElement("textarea",{id:a,name:a,className:"form-control",value:i||"",placeholder:o,required:n,disabled:l,readOnly:s,autoFocus:d,rows:r.rows,onBlur:f,onFocus:g,onChange:h})}function xe(e){const{options:a,registry:r}=e,o=t.getTemplate("BaseInputTemplate",r,a);return m.default.createElement(o,{...e})}function ke(e){const{options:a,registry:r}=e,o=t.getTemplate("BaseInputTemplate",r,a);return m.default.createElement(o,{type:"url",...e})}function Te(e){const{options:a,registry:r}=e,o=t.getTemplate("BaseInputTemplate",r,a);return m.default.createElement(o,{type:"number",...e})}function Ne(){return{fields:{AnyOfField:k,ArrayField:D,BooleanField:x,NumberField:A,ObjectField:w,OneOfField:k,SchemaField:I,StringField:U,NullField:$},templates:{ArrayFieldDescriptionTemplate:q,ArrayFieldItemTemplate:P,ArrayFieldTemplate:_,ArrayFieldTitleTemplate:R,ButtonTemplates:{SubmitButton:M,AddButton:Y,MoveDownButton:W,MoveUpButton:j,RemoveButton:L},BaseInputTemplate:V,DescriptionFieldTemplate:z,ErrorListTemplate:H,FieldTemplate:G,FieldErrorTemplate:Q,FieldHelpTemplate:X,ObjectFieldTemplate:Z,TitleFieldTemplate:ee,UnsupportedFieldTemplate:te,WrapIfAdditionalTemplate:ae},widgets:{PasswordWidget:Ee,RadioWidget:be,UpDownWidget:Te,RangeWidget:ve,SelectWidget:Fe,TextWidget:xe,DateWidget:ce,DateTimeWidget:ue,AltDateWidget:ie,AltDateTimeWidget:ne,EmailWidget:me,URLWidget:ke,TextareaWidget:De,HiddenWidget:Se,ColorWidget:de,FileWidget:ye,CheckboxWidget:le,CheckboxesWidget:se},rootSchema:{},formContext:{}}}De.defaultProps={autofocus:!1,options:{}};class Ae extends e.Component{constructor(e){if(super(e),this.formElement=void 0,this.getUsedFormData=(e,t)=>{if(0===t.length&&"object"!=typeof e)return e;const a=f.default(e,t);return Array.isArray(e)?Object.keys(a).map((e=>a[e])):a},this.getFieldNames=(e,a)=>{const r=function(e,o,i){return void 0===o&&(o=[]),void 0===i&&(i=[[]]),Object.keys(e).forEach((n=>{if("object"==typeof e[n]){const a=i.map((e=>[...e,n]));e[n][t.RJSF_ADDITONAL_PROPERTIES_FLAG]&&""!==e[n][t.NAME_KEY]?o.push(e[n][t.NAME_KEY]):r(e[n],o,a)}else n===t.NAME_KEY&&""!==e[n]&&i.forEach((e=>{const t=p.default(a,e);("object"!=typeof t||h.default(t))&&o.push(e)}))})),o};return r(e)},this.onChange=(e,a,r)=>{const{extraErrors:o,omitExtraData:i,liveOmit:n,noValidate:l,liveValidate:s,onChange:d}=this.props,{schemaUtils:c,schema:u}=this.state;(t.isObject(e)||Array.isArray(e))&&(e=this.getStateFromProps(this.props,e).formData);const m=!l&&s;let p={formData:e,schema:u},h=e;if(!0===i&&!0===n){const t=c.retrieveSchema(u,e),a=c.toPathSchema(t,"",e),r=this.getFieldNames(a,e);h=this.getUsedFormData(e,r),p={formData:h}}if(m){const e=this.validate(h);let t=e.errors,a=e.errorSchema;const r=t,i=a;if(o){const r=c.mergeValidationData(e,o);a=r.errorSchema,t=r.errors}p={formData:h,errors:t,errorSchema:a,schemaValidationErrors:r,schemaValidationErrorSchema:i}}else if(!l&&a){const e=o?t.mergeObjects(a,o,"preventDuplicates"):a;p={formData:h,errorSchema:e,errors:c.getValidator().toErrorList(e)}}this.setState(p,(()=>d&&d({...this.state,...p},r)))},this.onBlur=(e,t)=>{const{onBlur:a}=this.props;a&&a(e,t)},this.onFocus=(e,t)=>{const{onFocus:a}=this.props;a&&a(e,t)},this.onSubmit=e=>{if(e.preventDefault(),e.target!==e.currentTarget)return;e.persist();const{omitExtraData:t,extraErrors:a,noValidate:r,onSubmit:o}=this.props;let{formData:i}=this.state;const{schema:n,schemaUtils:l}=this.state;if(!0===t){const e=l.retrieveSchema(n,i),t=l.toPathSchema(e,"",i),a=this.getFieldNames(t,i);i=this.getUsedFormData(i,a)}if(r||this.validateForm()){const t=a||{},r=a?l.getValidator().toErrorList(a):[];this.setState({formData:i,errors:r,errorSchema:t,schemaValidationErrors:[],schemaValidationErrorSchema:{}},(()=>{o&&o({...this.state,formData:i,status:"submitted"},e)}))}},!e.validator)throw new Error("A validator is required for Form functionality to work");this.state=this.getStateFromProps(e,e.formData),this.props.onChange&&!t.deepEquals(this.state.formData,this.props.formData)&&this.props.onChange(this.state),this.formElement=m.default.createRef()}UNSAFE_componentWillReceiveProps(e){const a=this.getStateFromProps(e,e.formData);t.deepEquals(a.formData,e.formData)||t.deepEquals(a.formData,this.state.formData)||!e.onChange||e.onChange(a),this.setState(a)}getStateFromProps(e,a){const r=this.state||{},o="schema"in e?e.schema:this.props.schema,i=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},n=void 0!==a,l=n&&!e.noValidate&&("liveValidate"in e?e.liveValidate:this.props.liveValidate),s=o;let d=r.schemaUtils;d&&!d.doesSchemaUtilsDiffer(e.validator,s)||(d=t.createSchemaUtils(e.validator,s));const c=d.getDefaultFormState(o,a),u=d.retrieveSchema(o,c);let m,p,h=r.schemaValidationErrors,f=r.schemaValidationErrorSchema;if(l){const e=this.validate(c,o,d);m=e.errors,p=e.errorSchema,h=m,f=p}else{const t=e.noValidate?{errors:[],errorSchema:{}}:e.liveValidate?{errors:r.errors||[],errorSchema:r.errorSchema||{}}:{errors:r.schemaValidationErrors||[],errorSchema:r.schemaValidationErrorSchema||{}};m=t.errors,p=t.errorSchema}if(e.extraErrors){const t=d.mergeValidationData({errorSchema:p,errors:m},e.extraErrors);p=t.errorSchema,m=t.errors}const g=d.toIdSchema(u,i["ui:rootFieldId"],c,e.idPrefix,e.idSeparator);return{schemaUtils:d,schema:o,uiSchema:i,idSchema:g,formData:c,edit:n,errors:m,errorSchema:p,schemaValidationErrors:h,schemaValidationErrorSchema:f}}shouldComponentUpdate(e,a){return t.shouldRender(this,e,a)}validate(e,t,a){void 0===t&&(t=this.props.schema);const r=a||this.state.schemaUtils,{customValidate:o,transformErrors:i}=this.props,n=r.retrieveSchema(t,e);return r.getValidator().validateFormData(e,n,o,i)}renderErrors(e){const{errors:a,errorSchema:r,schema:o,uiSchema:i}=this.state,{formContext:n}=this.props,l=t.getUiOptions(i),s=t.getTemplate("ErrorListTemplate",e,l);return a&&a.length?m.default.createElement(s,{errors:a,errorSchema:r||{},schema:o,uiSchema:i,formContext:n}):null}getRegistry(){var e;const{schemaUtils:t}=this.state,{fields:a,templates:r,widgets:o,formContext:i}=Ne();return{fields:{...a,...this.props.fields},templates:{...r,...this.props.templates,ButtonTemplates:{...r.ButtonTemplates,...null===(e=this.props.templates)||void 0===e?void 0:e.ButtonTemplates}},widgets:{...o,...this.props.widgets},rootSchema:this.props.schema,formContext:this.props.formContext||i,schemaUtils:t}}submit(){this.formElement.current&&(this.formElement.current.dispatchEvent(new CustomEvent("submit",{cancelable:!0})),this.formElement.current.requestSubmit())}validateForm(){const{extraErrors:e,onError:t}=this.props,{formData:a}=this.state,{schemaUtils:r}=this.state,o=this.validate(a);let i=o.errors,n=o.errorSchema;const l=i,s=n;if(i.length>0){if(e){const t=r.mergeValidationData(o,e);n=t.errorSchema,i=t.errors}return this.setState({errors:i,errorSchema:n,schemaValidationErrors:l,schemaValidationErrorSchema:s},(()=>{t?t(i):console.error("Form validation failed",i)})),!1}return!0}render(){const{children:e,id:t,idPrefix:a,idSeparator:r,className:o="",tagName:i,name:n,method:l,target:s,action:d,autoComplete:c,enctype:u,acceptcharset:p,noHtml5Validate:h=!1,disabled:f=!1,readonly:g=!1,formContext:y,showErrorList:S="top",_internalFormWrapper:E}=this.props,{schema:b,uiSchema:v,formData:C,errorSchema:F,idSchema:D}=this.state,x=this.getRegistry(),{SchemaField:k}=x.fields,{SubmitButton:T}=x.templates.ButtonTemplates;return m.default.createElement(E||i||"form",{className:o||"rjsf",id:t,name:n,method:l,target:s,action:d,autoComplete:c,encType:u,acceptCharset:p,noValidate:h,onSubmit:this.onSubmit,as:E?i:void 0,ref:this.formElement},"top"===S&&this.renderErrors(x),m.default.createElement(k,{name:"",schema:b,uiSchema:v,errorSchema:F,idSchema:D,idPrefix:a,idSeparator:r,formContext:y,formData:C,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:x,disabled:f,readonly:g}),e||m.default.createElement(T,{uiSchema:v}),"bottom"===S&&this.renderErrors(x))}}exports.default=Ae,exports.getDefaultRegistry=Ne,exports.withTheme=function(t){return e.forwardRef(((e,a)=>{var r,o;let{fields:i,widgets:n,templates:l,...s}=e;return i={...t.fields,...i},n={...t.widgets,...n},l={...t.templates,...l,ButtonTemplates:{...null==t||null===(r=t.templates)||void 0===r?void 0:r.ButtonTemplates,...null===(o=l)||void 0===o?void 0:o.ButtonTemplates}},m.default.createElement(Ae,{...t,...s,fields:i,widgets:n,templates:l,ref:a})}))}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@rjsf/utils"),r=require("lodash/get"),a=require("lodash/isEmpty"),n=require("lodash/pick"),i=require("lodash/isObject"),o=require("lodash/set"),l=require("nanoid"),s=require("lodash/unset"),d=require("lodash/has"),u=require("lodash/omit");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=c(e),f=c(r),p=c(a),h=c(n),v=c(i),g=c(o),y=c(s),S=c(d),E=c(u);function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},b.apply(this,arguments)}function C(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,F(e,t)}function F(e,t){return F=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},F(e,t)}function D(e,t){if(null==e)return{};var r,a,n={},i=Object.keys(e);for(a=0;a<i.length;a++)t.indexOf(r=i[a])>=0||(n[r]=e[r]);return n}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}var k=["widget"],T=["widget"],w=["widget"];function O(){return l.nanoid()}function A(e){return Array.isArray(e)?e.map((function(e){return{key:O(),item:e}})):[]}function N(e){return Array.isArray(e)?e.map((function(e){return e.item})):[]}var B=function(e){function r(r){var a;(a=e.call(this,r)||this)._getNewFormDataRow=function(){var e=a.props,r=e.schema,n=e.registry.schemaUtils,i=r.items;return t.isFixedItems(r)&&t.allowAdditionalItems(r)&&(i=r.additionalItems),n.getDefaultFormState(i)},a.onAddClick=function(e){e&&e.preventDefault();var t=a.props.onChange,r=a.state.keyedFormData,n={key:O(),item:a._getNewFormDataRow()},i=[].concat(r,[n]);a.setState({keyedFormData:i,updatedKeyedFormData:!0},(function(){return t(N(i))}))},a.onAddIndexClick=function(e){return function(t){t&&t.preventDefault();var r=a.props.onChange,n=a.state.keyedFormData,i={key:O(),item:a._getNewFormDataRow()},o=[].concat(n);o.splice(e,0,i),a.setState({keyedFormData:o,updatedKeyedFormData:!0},(function(){return r(N(o))}))}},a.onDropIndexClick=function(e){return function(t){t&&t.preventDefault();var r,n=a.props,i=n.onChange,o=n.errorSchema,l=a.state.keyedFormData;if(o)for(var s in r={},o){var d=parseInt(s);d<e?g.default(r,[d],o[s]):d>e&&g.default(r,[d-1],o[s])}var u=l.filter((function(t,r){return r!==e}));a.setState({keyedFormData:u,updatedKeyedFormData:!0},(function(){return i(N(u),r)}))}},a.onReorderClick=function(e,t){return function(r){r&&(r.preventDefault(),r.currentTarget.blur());var n,i=a.props,o=i.onChange,l=i.errorSchema;if(a.props.errorSchema)for(var s in n={},l){var d=parseInt(s);d==e?g.default(n,[t],l[e]):d==t?g.default(n,[e],l[t]):g.default(n,[s],l[d])}var u,c=a.state.keyedFormData,m=((u=c.slice()).splice(e,1),u.splice(t,0,c[e]),u);a.setState({keyedFormData:m},(function(){return o(N(m),n)}))}},a.onChangeForIndex=function(e){return function(t,r,n){var i,o=a.props,l=o.formData,s=o.errorSchema;(0,o.onChange)((Array.isArray(l)?l:[]).map((function(r,a){return e===a?void 0===t?null:t:r})),s&&s&&b({},s,((i={})[e]=r,i)),n)}},a.onSelectChange=function(e){var t=a.props,r=t.idSchema;(0,t.onChange)(e,void 0,r&&r.$id)};var n=r.formData,i=A(void 0===n?[]:n);return a.state={keyedFormData:i,updatedKeyedFormData:!1},a}C(r,e),r.getDerivedStateFromProps=function(e,t){if(t.updatedKeyedFormData)return{updatedKeyedFormData:!1};var r=Array.isArray(e.formData)?e.formData:[],a=t.keyedFormData||[];return{keyedFormData:r.length===a.length?a.map((function(e,t){return{key:e.key,item:r[t]}})):A(r)}};var a,n,i=r.prototype;return i.isItemRequired=function(e){return Array.isArray(e.type)?!e.type.includes("null"):"null"!==e.type},i.canAddItem=function(e){var r=this.props,a=r.schema,n=t.getUiOptions(r.uiSchema).addable;return!1!==n&&(n=void 0===a.maxItems||e.length<a.maxItems),n},i.render=function(){var e=this.props,r=e.schema,a=e.uiSchema,n=e.idSchema,i=e.registry,o=i.schemaUtils;if(!(t.ITEMS_KEY in r)){var l=t.getUiOptions(a),s=t.getTemplate("UnsupportedFieldTemplate",i,l);return m.default.createElement(s,{schema:r,idSchema:n,reason:"Missing items definition",registry:i})}return o.isMultiSelect(r)?this.renderMultiSelect():t.isCustomWidget(a)?this.renderCustomWidget():t.isFixedItems(r)?this.renderFixedArray():o.isFilesArray(r,a)?this.renderFiles():this.renderNormalArray()},i.renderNormalArray=function(){var e=this,r=this.props,a=r.schema,n=r.uiSchema,i=void 0===n?{}:n,o=r.errorSchema,l=r.idSchema,s=r.name,d=r.disabled,u=void 0!==d&&d,c=r.readonly,f=void 0!==c&&c,p=r.autofocus,h=void 0!==p&&p,g=r.required,y=void 0!==g&&g,S=r.registry,E=r.onBlur,C=r.onFocus,F=r.idPrefix,D=r.idSeparator,x=void 0===D?"_":D,k=r.rawErrors,T=this.state.keyedFormData,w=void 0===a.title?s:a.title,O=S.schemaUtils,A=S.formContext,B=t.getUiOptions(i),I=v.default(a.items)?a.items:{},U=O.retrieveSchema(I),q=N(this.state.keyedFormData),P={canAdd:this.canAddItem(q),items:T.map((function(t,r){var a=t.key,n=t.item,d=O.retrieveSchema(I,n),u=o?o[r]:void 0,c=O.toIdSchema(d,l.$id+x+r,n,F,x);return e.renderArrayFieldItem({key:a,index:r,name:s&&s+"-"+r,canMoveUp:r>0,canMoveDown:r<q.length-1,itemSchema:d,itemIdSchema:c,itemErrorSchema:u,itemData:n,itemUiSchema:i.items,autofocus:h&&0===r,onBlur:E,onFocus:C,rawErrors:k})})),className:"field field-array field-array-of-"+U.type,disabled:u,idSchema:l,uiSchema:i,onAddClick:this.onAddClick,readonly:f,required:y,schema:a,title:w,formContext:A,formData:q,rawErrors:k,registry:S},_=t.getTemplate("ArrayFieldTemplate",S,B);return m.default.createElement(_,b({},P))},i.renderCustomWidget=function(){var e=this.props,r=e.schema,a=e.idSchema,n=e.uiSchema,i=e.disabled,o=void 0!==i&&i,l=e.readonly,s=void 0!==l&&l,d=e.autofocus,u=void 0!==d&&d,c=e.required,f=void 0!==c&&c,p=e.hideError,h=e.placeholder,v=e.onBlur,g=e.onFocus,y=e.formData,S=void 0===y?[]:y,E=e.registry,b=e.rawErrors,C=E.widgets,F=E.formContext,x=r.title||e.name,T=t.getUiOptions(n),w=T.widget,O=D(T,k),A=t.getWidget(r,w,C);return m.default.createElement(A,{id:a&&a.$id,multiple:!0,onChange:this.onSelectChange,onBlur:v,onFocus:g,options:O,schema:r,uiSchema:n,registry:E,value:S,disabled:o,readonly:s,hideError:p,required:f,label:x,placeholder:h,formContext:F,autofocus:u,rawErrors:b})},i.renderMultiSelect=function(){var e=this.props,r=e.schema,a=e.idSchema,n=e.uiSchema,i=e.formData,o=void 0===i?[]:i,l=e.disabled,s=void 0!==l&&l,d=e.readonly,u=void 0!==d&&d,c=e.autofocus,f=void 0!==c&&c,p=e.required,h=void 0!==p&&p,v=e.placeholder,g=e.onBlur,y=e.onFocus,S=e.registry,E=e.rawErrors,C=e.name,F=S.widgets,x=S.formContext,k=S.schemaUtils.retrieveSchema(r.items,o),w=r.title||C,O=t.optionsList(k),A=t.getUiOptions(n),N=A.widget,B=void 0===N?"select":N,I=D(A,T),U=t.getWidget(r,B,F);return m.default.createElement(U,{id:a&&a.$id,multiple:!0,onChange:this.onSelectChange,onBlur:g,onFocus:y,options:b({},I,{enumOptions:O}),schema:r,uiSchema:n,registry:S,value:o,disabled:s,readonly:u,required:h,label:w,placeholder:v,formContext:x,autofocus:f,rawErrors:E})},i.renderFiles=function(){var e=this.props,r=e.schema,a=e.uiSchema,n=e.idSchema,i=e.disabled,o=void 0!==i&&i,l=e.readonly,s=void 0!==l&&l,d=e.autofocus,u=void 0!==d&&d,c=e.required,f=void 0!==c&&c,p=e.onBlur,h=e.onFocus,v=e.registry,g=e.formData,y=void 0===g?[]:g,S=e.rawErrors,E=r.title||e.name,b=v.widgets,C=v.formContext,F=t.getUiOptions(a),x=F.widget,k=void 0===x?"files":x,T=D(F,w),O=t.getWidget(r,k,b);return m.default.createElement(O,{options:T,id:n&&n.$id,multiple:!0,onChange:this.onSelectChange,onBlur:p,onFocus:h,schema:r,uiSchema:a,title:E,value:y,disabled:o,readonly:s,required:f,registry:v,formContext:C,autofocus:u,rawErrors:S,label:""})},i.renderFixedArray=function(){var e=this,r=this.props,a=r.schema,n=r.uiSchema,i=void 0===n?{}:n,o=r.formData,l=void 0===o?[]:o,s=r.errorSchema,d=r.idPrefix,u=r.idSeparator,c=void 0===u?"_":u,f=r.idSchema,p=r.name,h=r.disabled,g=void 0!==h&&h,y=r.readonly,S=void 0!==y&&y,E=r.autofocus,C=void 0!==E&&E,F=r.required,D=void 0!==F&&F,x=r.registry,k=r.onBlur,T=r.onFocus,w=r.rawErrors,O=this.state.keyedFormData,A=this.props.formData,N=void 0===A?[]:A,B=a.title||p,I=t.getUiOptions(i),U=x.schemaUtils,q=x.formContext,P=(v.default(a.items)?a.items:[]).map((function(e,t){return U.retrieveSchema(e,l[t])})),_=v.default(a.additionalItems)?U.retrieveSchema(a.additionalItems,l):null;(!N||N.length<P.length)&&(N=(N=N||[]).concat(new Array(P.length-N.length)));var R={canAdd:this.canAddItem(N)&&!!_,className:"field field-array field-array-fixed-items",disabled:g,idSchema:f,formData:l,items:O.map((function(t,r){var n=t.key,o=t.item,l=r>=P.length,u=l&&v.default(a.additionalItems)?U.retrieveSchema(a.additionalItems,o):P[r],m=U.toIdSchema(u,f.$id+c+r,o,d,c),h=l?i.additionalItems||{}:Array.isArray(i.items)?i.items[r]:i.items||{};return e.renderArrayFieldItem({key:n,index:r,name:p&&p+"-"+r,canRemove:l,canMoveUp:r>=P.length+1,canMoveDown:l&&r<N.length-1,itemSchema:u,itemData:o,itemUiSchema:h,itemIdSchema:m,itemErrorSchema:s?s[r]:void 0,autofocus:C&&0===r,onBlur:k,onFocus:T,rawErrors:w})})),onAddClick:this.onAddClick,readonly:S,required:D,registry:x,schema:a,uiSchema:i,title:B,formContext:q,rawErrors:w},j=t.getTemplate("ArrayFieldTemplate",x,I);return m.default.createElement(j,b({},R))},i.renderArrayFieldItem=function(e){var r=e.key,a=e.index,n=e.name,i=e.canRemove,o=void 0===i||i,l=e.canMoveUp,s=void 0===l||l,d=e.canMoveDown,u=void 0===d||d,c=e.itemSchema,f=e.itemData,p=e.itemUiSchema,h=e.itemIdSchema,v=e.itemErrorSchema,g=e.autofocus,y=e.onBlur,S=e.onFocus,E=e.rawErrors,b=this.props,C=b.disabled,F=b.hideError,D=b.idPrefix,x=b.idSeparator,k=b.readonly,T=b.registry,w=b.formContext,O=T.fields,A=O.ArraySchemaField||O.SchemaField,N=t.getUiOptions(b.uiSchema),B=N.orderable,I=void 0===B||B,U=N.removable,q={moveUp:I&&s,moveDown:I&&u,remove:(void 0===U||U)&&o,toolbar:!1};return q.toolbar=Object.keys(q).some((function(e){return q[e]})),{children:m.default.createElement(A,{name:n,index:a,schema:c,uiSchema:p,formData:f,formContext:w,errorSchema:v,idPrefix:D,idSeparator:x,idSchema:h,required:this.isItemRequired(c),onChange:this.onChangeForIndex(a),onBlur:y,onFocus:S,registry:T,disabled:C,readonly:k,hideError:F,autofocus:g,rawErrors:E}),className:"array-item",disabled:C,hasToolbar:q.toolbar,hasMoveUp:q.moveUp,hasMoveDown:q.moveDown,hasRemove:q.remove,index:a,key:r,onAddIndexClick:this.onAddIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:k,registry:T,schema:c,uiSchema:p}},a=r,(n=[{key:"itemTitle",get:function(){var e=this.props.schema;return f.default(e,[t.ITEMS_KEY,"title"],f.default(e,[t.ITEMS_KEY,"description"],"Item"))}}])&&function(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}(a.prototype,n),Object.defineProperty(a,"prototype",{writable:!1}),r}(e.Component),I=["widget"];function U(e){var r,a=e.schema,n=e.name,i=e.uiSchema,o=e.idSchema,l=e.formData,s=e.registry,d=e.required,u=e.disabled,c=e.readonly,f=e.autofocus,p=e.onChange,h=e.onFocus,g=e.onBlur,y=e.rawErrors,S=a.title,E=s.widgets,C=s.formContext,F=t.getUiOptions(i),x=F.widget,k=void 0===x?"checkbox":x,T=D(F,I),w=t.getWidget(a,k,E);if(Array.isArray(a.oneOf))r=t.optionsList({oneOf:a.oneOf.map((function(e){if(v.default(e))return b({},e,{title:e.title||(!0===e.const?"Yes":"No")})})).filter((function(e){return e}))});else{var O,A=a,N=null!=(O=a.enum)?O:[!0,!1];r=!A.enumNames&&2===N.length&&N.every((function(e){return"boolean"==typeof e}))?[{value:N[0],label:N[0]?"Yes":"No"},{value:N[1],label:N[1]?"Yes":"No"}]:t.optionsList({enum:N,enumNames:A.enumNames})}return m.default.createElement(w,{options:b({},T,{enumOptions:r}),schema:a,uiSchema:i,id:o&&o.$id,onChange:p,onFocus:h,onBlur:g,label:void 0===S?n:S,value:l,required:d,disabled:u,readonly:c,registry:s,formContext:C,autofocus:f,rawErrors:y})}var q=["widget"],P=function(e){function r(r){var a;(a=e.call(this,r)||this).onOptionChange=function(e){var r=parseInt(e,10),n=a.props,i=n.formData,o=n.onChange,l=n.options,s=n.registry.schemaUtils,d=s.retrieveSchema(l[r],i),u=void 0;if("object"===t.guessType(i)&&("object"===d.type||d.properties)){u=Object.assign({},i);var c=l.slice();c.splice(r,1);for(var m,f=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return x(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(e,t):void 0}}(e))){r&&(e=r);var a=0;return function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(c);!(m=f()).done;){var p=m.value;if(p.properties)for(var h in p.properties)h in u&&y.default(u,h)}}o(s.getDefaultFormState(l[r],u,"excludeObjectChildren"),void 0,a.getFieldId()),a.setState({selectedOption:parseInt(e,10)})};var n=a.props;return a.state={selectedOption:a.getMatchingOption(0,n.formData,n.options)},a}C(r,e);var a=r.prototype;return a.componentDidUpdate=function(e,r){var a=this.props,n=a.formData,i=a.options,o=a.idSchema,l=this.state.selectedOption;if(!t.deepEquals(n,e.formData)&&o.$id===e.idSchema.$id){var s=this.getMatchingOption(l,n,i);if(!r||s===l)return;this.setState({selectedOption:s})}},a.getMatchingOption=function(e,t,r){var a=this.props.registry.schemaUtils.getMatchingOption(t,r);return 0!==a?a:e||0},a.getFieldId=function(){var e=this.props;return e.idSchema.$id+(e.schema.oneOf?"__oneof_select":"__anyof_select")},a.render=function(){var e,r=this.props,a=r.name,n=r.baseType,i=r.disabled,o=void 0!==i&&i,l=r.readonly,s=void 0!==l&&l,d=r.hideError,u=void 0!==d&&d,c=r.errorSchema,f=void 0===c?{}:c,p=r.formData,h=r.formContext,v=r.idPrefix,g=r.idSeparator,y=r.idSchema,S=r.onBlur,E=r.onChange,C=r.onFocus,F=r.options,x=r.registry,k=r.uiSchema,T=x.widgets,w=x.fields.SchemaField,O=this.state.selectedOption,A=t.getUiOptions(k),N=A.widget,B=void 0===N?"select":N,I=D(A,q),U=t.getWidget({type:"number"},B,T),P=F[O]||null;P&&(e=P.type?P:Object.assign({},P,{type:n}));var _=F.map((function(e,t){return{label:e.title||"Option "+(t+1),value:t}}));return m.default.createElement("div",{className:"panel panel-default panel-body"},m.default.createElement("div",{className:"form-group"},m.default.createElement(U,b({id:this.getFieldId(),schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:S,onFocus:C,value:O,options:{enumOptions:_},registry:x,formContext:h},I,{label:""}))),null!==P&&m.default.createElement(w,{name:a,schema:e,uiSchema:k,errorSchema:f,idSchema:y,idPrefix:v,idSeparator:g,formData:p,formContext:h,onChange:E,onBlur:S,onFocus:C,registry:x,disabled:o,readonly:s,hideError:u}))},r}(e.Component),_=/\.([0-9]*0)*$/,R=/[0.]0*$/;function j(r){var a=r.registry,n=r.onChange,i=r.formData,o=e.useState(r.value),l=o[0],s=o[1],d=a.fields.StringField,u=i,c=e.useCallback((function(e){s(e),"."===(""+e).charAt(0)&&(e="0"+e);var r="string"==typeof e&&e.match(_)?t.asNumber(e.replace(R,"")):t.asNumber(e);n(r)}),[n]);if("string"==typeof l&&"number"==typeof u){var f=new RegExp((""+u).replace(".","\\.")+"\\.?0*$");l.match(f)&&(u=l)}return m.default.createElement(d,b({},r,{formData:u,onChange:c}))}var V=function(e){function r(){for(var r,a=arguments.length,n=new Array(a),i=0;i<a;i++)n[i]=arguments[i];return(r=e.call.apply(e,[this].concat(n))||this).state={wasPropertyKeyModified:!1,additionalProperties:{}},r.onPropertyChange=function(e,t){return void 0===t&&(t=!1),function(a,n,i){var o,l,s=r.props,d=s.errorSchema;void 0===a&&t&&(a=""),(0,s.onChange)(b({},s.formData,((o={})[e]=a,o)),d&&d&&b({},d,((l={})[e]=n,l)),i)}},r.onDropPropertyClick=function(e){return function(t){t.preventDefault();var a=r.props,n=a.onChange,i=b({},a.formData);y.default(i,e),n(i)}},r.getAvailableKey=function(e,a){for(var n=t.getUiOptions(r.props.uiSchema).duplicateKeySuffixSeparator,i=void 0===n?"-":n,o=0,l=e;l in a;)l=""+e+i+ ++o;return l},r.onKeyChange=function(e){return function(t,a){var n,i;if(e!==t){var o=r.props,l=o.formData,s=o.onChange,d=o.errorSchema;t=r.getAvailableKey(t,l);var u=b({},l),c=((n={})[e]=t,n),m=Object.keys(u).map((function(e){var t;return(t={})[c[e]||e]=u[e],t})),f=Object.assign.apply(Object,[{}].concat(m));r.setState({wasPropertyKeyModified:!0}),s(f,d&&d&&b({},d,((i={})[t]=a,i)))}}},r.handleAddClick=function(e){return function(){if(e.additionalProperties){var a=r.props,n=a.formData,i=a.onChange,o=a.registry,l=b({},n),s=void 0;v.default(e.additionalProperties)&&(s=e.additionalProperties.type,t.REF_KEY in e.additionalProperties&&(s=o.schemaUtils.retrieveSchema({$ref:e.additionalProperties[t.REF_KEY]},n).type));var d=r.getAvailableKey("newKey",l);g.default(l,d,r.getDefaultValue(s)),i(l)}}},r}C(r,e);var a=r.prototype;return a.isRequired=function(e){var t=this.props.schema;return Array.isArray(t.required)&&-1!==t.required.indexOf(e)},a.getDefaultValue=function(e){switch(e){case"string":default:return"New Value";case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{}}},a.render=function(){var e,r=this,a=this.props,n=a.uiSchema,i=void 0===n?{}:n,o=a.formData,l=a.errorSchema,s=a.idSchema,d=a.name,u=a.required,c=void 0!==u&&u,p=a.disabled,h=void 0!==p&&p,v=a.readonly,g=void 0!==v&&v,y=a.hideError,E=a.idPrefix,C=a.idSeparator,F=a.onBlur,D=a.onFocus,x=a.registry,k=x.formContext,T=x.fields.SchemaField,w=x.schemaUtils.retrieveSchema(a.schema,o),O=t.getUiOptions(i),A=w.properties,N=void 0===A?{}:A,B=void 0===w.title?d:w.title,I=O.description||w.description;try{var U=Object.keys(N);e=t.orderProperties(U,O.order)}catch(e){return m.default.createElement("div",null,m.default.createElement("p",{className:"config-error",style:{color:"red"}},"Invalid ",d||"root"," object field configuration:",m.default.createElement("em",null,e.message),"."),m.default.createElement("pre",null,JSON.stringify(w)))}var q=t.getTemplate("ObjectFieldTemplate",x,O),P={title:O.title||B,description:I,properties:e.map((function(e){var a=S.default(w,[t.PROPERTIES_KEY,e,t.ADDITIONAL_PROPERTY_FLAG]),n=a?i.additionalProperties:i[e],d="hidden"===t.getUiOptions(n).widget,u=f.default(s,[e],{});return{content:m.default.createElement(T,{key:e,name:e,required:r.isRequired(e),schema:f.default(w,[t.PROPERTIES_KEY,e],{}),uiSchema:n,errorSchema:f.default(l,e),idSchema:u,idPrefix:E,idSeparator:C,formData:f.default(o,e),formContext:k,wasPropertyKeyModified:r.state.wasPropertyKeyModified,onKeyChange:r.onKeyChange(e),onChange:r.onPropertyChange(e,a),onBlur:F,onFocus:D,registry:x,disabled:h,readonly:g,hideError:y,onDropPropertyClick:r.onDropPropertyClick}),name:e,readonly:g,disabled:h,required:c,hidden:d}})),readonly:g,disabled:h,required:c,idSchema:s,uiSchema:i,schema:w,formData:o,formContext:k,registry:x};return m.default.createElement(q,b({},P,{onAddClick:this.handleAddClick}))},r}(e.Component),M=["__errors"],K={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function W(e){var r=e.schema,a=e.idSchema,n=e.uiSchema,i=e.formData,o=e.errorSchema,l=e.idPrefix,s=e.idSeparator,d=e.name,u=e.onChange,c=e.onKeyChange,f=e.onDropPropertyClick,p=e.required,h=e.registry,g=e.wasPropertyKeyModified,y=void 0!==g&&g,S=h.formContext,C=h.schemaUtils,F=t.getUiOptions(n),x=t.getTemplate("FieldTemplate",h,F),k=t.getTemplate("DescriptionFieldTemplate",h,F),T=t.getTemplate("FieldHelpTemplate",h,F),w=t.getTemplate("FieldErrorTemplate",h,F),O=C.retrieveSchema(r,i),A=a[t.ID_KEY],N=t.mergeObjects(C.toIdSchema(O,A,i,l,s),a),B=m.default.useCallback((function(e,t,r){return u(e,t,r||A)}),[A,u]),I=function(e,r,a,n){var i=r.field,o=n.fields;if("function"==typeof i)return i;if("string"==typeof i&&i in o)return o[i];var l=t.getSchemaType(e),s=Array.isArray(l)?l[0]:l||"",d=K[s];return d||!e.anyOf&&!e.oneOf?d in o?o[d]:function(){var i=t.getTemplate("UnsupportedFieldTemplate",n,r);return m.default.createElement(i,{schema:e,idSchema:a,reason:"Unknown field type "+e.type,registry:n})}:function(){return null}}(O,F,N,h),U=Boolean(e.disabled||F.disabled),q=Boolean(e.readonly||F.readonly||e.schema.readOnly||O.readOnly),P=F.hideError,_=void 0===P?e.hideError:Boolean(P),R=Boolean(e.autofocus||F.autofocus);if(0===Object.keys(O).length)return null;var j=C.getDisplayLabel(O,n),V=o||{},W=V.__errors,L=D(V,M),$=E.default(n,["ui:classNames","classNames"]);"ui:options"in $&&($["ui:options"]=E.default($["ui:options"],["classNames"]));var Y,z=m.default.createElement(I,b({},e,{onChange:B,idSchema:N,schema:O,uiSchema:$,disabled:U,readonly:q,hideError:_,autofocus:R,errorSchema:L,formContext:S,rawErrors:W})),H=N[t.ID_KEY];Y=y||t.ADDITIONAL_PROPERTY_FLAG in O?d:F.title||e.schema.title||O.title||d;var J=F.description||e.schema.description||O.description||"",G=F.help,Q="hidden"===F.widget,X=["form-group","field","field-"+O.type];!_&&W&&W.length>0&&X.push("field-error has-error has-danger"),null!=n&&n.classNames&&X.push(n.classNames),F.classNames&&X.push(F.classNames);var Z=m.default.createElement(T,{help:G,idSchema:N,schema:O,uiSchema:n,hasErrors:!_&&W&&W.length>0,registry:h}),ee=_?void 0:m.default.createElement(w,{errors:W,errorSchema:o,idSchema:N,schema:O,uiSchema:n,registry:h}),te={description:m.default.createElement(k,{id:H+"__description",description:J,schema:O,uiSchema:n,registry:h}),rawDescription:J,help:Z,rawHelp:"string"==typeof G?G:void 0,errors:ee,rawErrors:_?void 0:W,id:H,label:Y,hidden:Q,onChange:u,onKeyChange:c,onDropPropertyClick:f,required:p,disabled:U,readonly:q,hideError:_,displayLabel:j,classNames:X.join(" ").trim(),formContext:S,formData:i,schema:O,uiSchema:n,registry:h},re=h.fields.AnyOfField,ae=h.fields.OneOfField;return m.default.createElement(x,b({},te),m.default.createElement(m.default.Fragment,null,z,O.anyOf&&!(null!=n&&n["ui:field"])&&!C.isSelect(O)&&m.default.createElement(re,{name:d,disabled:U,readonly:q,hideError:_,errorSchema:o,formData:i,formContext:S,idPrefix:l,idSchema:N,idSeparator:s,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:O.anyOf.map((function(e){return C.retrieveSchema(v.default(e)?e:{},i)})),baseType:O.type,registry:h,schema:O,uiSchema:n}),O.oneOf&&!(null!=n&&n["ui:field"])&&!C.isSelect(O)&&m.default.createElement(ae,{name:d,disabled:U,readonly:q,hideError:_,errorSchema:o,formData:i,formContext:S,idPrefix:l,idSchema:N,idSeparator:s,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:O.oneOf.map((function(e){return C.retrieveSchema(v.default(e)?e:{},i)})),baseType:O.type,registry:h,schema:O,uiSchema:n})))}var L=function(e){function r(){return e.apply(this,arguments)||this}C(r,e);var a=r.prototype;return a.shouldComponentUpdate=function(e){return!t.deepEquals(this.props,e)},a.render=function(){return m.default.createElement(W,b({},this.props))},r}(m.default.Component),$=["widget","placeholder"];function Y(e){var r=e.schema,a=e.name,n=e.uiSchema,i=e.idSchema,o=e.formData,l=e.required,s=e.disabled,d=void 0!==s&&s,u=e.readonly,c=void 0!==u&&u,f=e.autofocus,p=void 0!==f&&f,h=e.onChange,v=e.onBlur,g=e.onFocus,y=e.registry,S=e.rawErrors,E=r.title,C=r.format,F=y.widgets,x=y.formContext,k=y.schemaUtils.isSelect(r)?t.optionsList(r):void 0,T=k?"select":"text";C&&t.hasWidget(r,C,F)&&(T=C);var w=t.getUiOptions(n),O=w.widget,A=void 0===O?T:O,N=w.placeholder,B=void 0===N?"":N,I=D(w,$),U=t.getWidget(r,A,F);return m.default.createElement(U,{options:b({},I,{enumOptions:k}),schema:r,uiSchema:n,id:i&&i.$id,label:void 0===E?a:E,value:o,onChange:h,onBlur:v,onFocus:g,required:l,disabled:d,readonly:c,formContext:x,autofocus:p,registry:y,placeholder:B,rawErrors:S})}function z(t){var r=t.formData,a=t.onChange;return e.useEffect((function(){void 0===r&&a(null)}),[r,a]),null}function H(e){var r=e.idSchema,a=e.description,n=e.registry,i=e.schema,o=e.uiSchema,l=t.getUiOptions(o),s=l.label;if(!a||void 0!==s&&!s)return null;var d=t.getTemplate("DescriptionFieldTemplate",n,l);return m.default.createElement(d,{id:r.$id+"__description",description:a,schema:i,uiSchema:o,registry:n})}function J(e){var t=e.disabled,r=e.hasToolbar,a=e.hasMoveDown,n=e.hasMoveUp,i=e.hasRemove,o=e.index,l=e.onDropIndexClick,s=e.onReorderClick,d=e.readonly,u=e.uiSchema,c=e.registry.templates.ButtonTemplates,f=c.MoveDownButton,p=c.MoveUpButton,h=c.RemoveButton,v={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return m.default.createElement("div",{className:e.className},m.default.createElement("div",{className:r?"col-xs-9":"col-xs-12"},e.children),r&&m.default.createElement("div",{className:"col-xs-3 array-item-toolbox"},m.default.createElement("div",{className:"btn-group",style:{display:"flex",justifyContent:"space-around"}},(n||a)&&m.default.createElement(p,{style:v,disabled:t||d||!n,onClick:s(o,o-1),uiSchema:u}),(n||a)&&m.default.createElement(f,{style:v,disabled:t||d||!a,onClick:s(o,o+1),uiSchema:u}),i&&m.default.createElement(h,{style:v,disabled:t||d,onClick:l(o),uiSchema:u}))))}var G=["key"];function Q(e){var r=e.canAdd,a=e.className,n=e.disabled,i=e.idSchema,o=e.uiSchema,l=e.items,s=e.onAddClick,d=e.readonly,u=e.registry,c=e.required,f=e.schema,p=e.title,h=t.getUiOptions(o),v=t.getTemplate("ArrayFieldDescriptionTemplate",u,h),g=t.getTemplate("ArrayFieldItemTemplate",u,h),y=t.getTemplate("ArrayFieldTitleTemplate",u,h),S=u.templates.ButtonTemplates.AddButton;return m.default.createElement("fieldset",{className:a,id:i.$id},m.default.createElement(y,{idSchema:i,title:h.title||p,required:c,schema:f,uiSchema:o,registry:u}),m.default.createElement(v,{idSchema:i,description:h.description||f.description,schema:f,uiSchema:o,registry:u}),m.default.createElement("div",{className:"row array-item-list"},l&&l.map((function(e){var t=e.key,r=D(e,G);return m.default.createElement(g,b({key:t},r))}))),r&&m.default.createElement(S,{className:"array-item-add",onClick:s,disabled:n||d,uiSchema:o}))}function X(e){var r=e.idSchema,a=e.title,n=e.schema,i=e.uiSchema,o=e.required,l=e.registry,s=t.getUiOptions(i),d=s.label;if(!a||void 0!==d&&!d)return null;var u=t.getTemplate("TitleFieldTemplate",l,s);return m.default.createElement(u,{id:r.$id+"__title",title:a,required:o,schema:n,uiSchema:i,registry:l})}var Z=["id","value","readonly","disabled","autofocus","onBlur","onFocus","onChange","options","schema","uiSchema","formContext","registry","rawErrors","type"];function ee(r){var a=r.id,n=r.value,i=r.readonly,o=r.disabled,l=r.autofocus,s=r.onBlur,d=r.onFocus,u=r.onChange,c=r.options,f=r.schema,p=r.type,h=D(r,Z);if(!a)throw console.log("No id for",r),new Error("no id for props "+JSON.stringify(r));var v,g=b({},h,t.getInputProps(f,p,c));v="number"===g.type||"integer"===g.type?n||0===n?n:"":null==n?"":n;var y=e.useCallback((function(e){var t=e.target.value;return u(""===t?c.emptyValue:t)}),[u,c]),S=e.useCallback((function(e){return s(a,e.target.value)}),[s,a]),E=e.useCallback((function(e){return d(a,e.target.value)}),[d,a]);return m.default.createElement(m.default.Fragment,null,m.default.createElement("input",b({id:a,name:a,className:"form-control",readOnly:i,disabled:o,autoFocus:l,value:v},g,{list:f.examples?"examples_"+a:void 0,onChange:y,onBlur:S,onFocus:E})),Array.isArray(f.examples)&&m.default.createElement("datalist",{key:"datalist_"+a,id:"examples_"+a},[].concat(new Set(f.examples.concat(f.default?[f.default]:[]))).map((function(e){return m.default.createElement("option",{key:e,value:e})}))))}function te(e){var r=t.getSubmitButtonOptions(e.uiSchema),a=r.submitText,n=r.props,i=void 0===n?{}:n;return r.norender?null:m.default.createElement("div",null,m.default.createElement("button",b({type:"submit"},i,{className:"btn btn-info "+i.className}),a))}var re=["iconType","icon","className","uiSchema"];function ae(e){var t=e.iconType,r=void 0===t?"default":t,a=e.icon,n=e.className,i=D(e,re);return m.default.createElement("button",b({type:"button",className:"btn btn-"+r+" "+n},i),m.default.createElement("i",{className:"glyphicon glyphicon-"+a}))}function ne(e){return m.default.createElement(ae,b({title:"Move down",className:"array-item-move-down"},e,{icon:"arrow-down"}))}function ie(e){return m.default.createElement(ae,b({title:"Move up",className:"array-item-move-up"},e,{icon:"arrow-up"}))}function oe(e){return m.default.createElement(ae,b({title:"Remove",className:"array-item-remove"},e,{iconType:"danger",icon:"remove"}))}function le(e){return m.default.createElement("div",{className:"row"},m.default.createElement("p",{className:"col-xs-3 col-xs-offset-9 text-right "+e.className},m.default.createElement(ae,{iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:"Add",onClick:e.onClick,disabled:e.disabled})))}function se(e){var t=e.description;return t?m.default.createElement("string"==typeof t?"p":"div",{id:e.id,className:"field-description"},t):null}function de(e){var t=e.errors;return m.default.createElement("div",{className:"panel panel-danger errors"},m.default.createElement("div",{className:"panel-heading"},m.default.createElement("h3",{className:"panel-title"},"Errors")),m.default.createElement("ul",{className:"list-group"},t.map((function(e,t){return m.default.createElement("li",{key:t,className:"list-group-item text-danger"},e.stack)}))))}function ue(e){var t=e.label;return t?m.default.createElement("label",{className:"control-label",htmlFor:e.id},t,e.required&&m.default.createElement("span",{className:"required"},"*")):null}function ce(e){var r=e.id,a=e.label,n=e.children,i=e.errors,o=e.help,l=e.description,s=e.hidden,d=e.required,u=e.displayLabel,c=e.registry,f=t.getUiOptions(e.uiSchema),p=t.getTemplate("WrapIfAdditionalTemplate",c,f);return s?m.default.createElement("div",{className:"hidden"},n):m.default.createElement(p,b({},e),u&&m.default.createElement(ue,{label:a,required:d,id:r}),u&&l?l:null,n,i,o)}function me(e){var t=e.errors,r=void 0===t?[]:t;return 0===r.length?null:m.default.createElement("div",null,m.default.createElement("ul",{id:e.idSchema.$id+"__error",className:"error-detail bs-callout bs-callout-info"},r.filter((function(e){return!!e})).map((function(e,t){return m.default.createElement("li",{className:"text-danger",key:t},e)}))))}function fe(e){var t=e.help;return t?m.default.createElement("string"==typeof t?"p":"div",{id:e.idSchema.$id+"__help",className:"help-block"},t):null}function pe(e){var r=e.description,a=e.disabled,n=e.formData,i=e.idSchema,o=e.onAddClick,l=e.properties,s=e.readonly,d=e.registry,u=e.required,c=e.schema,f=e.title,p=e.uiSchema,h=t.getUiOptions(p),v=t.getTemplate("TitleFieldTemplate",d,h),g=t.getTemplate("DescriptionFieldTemplate",d,h),y=d.templates.ButtonTemplates.AddButton;return m.default.createElement("fieldset",{id:i.$id},(h.title||f)&&m.default.createElement(v,{id:i.$id+"__title",title:h.title||f,required:u,schema:c,uiSchema:p,registry:d}),(h.description||r)&&m.default.createElement(g,{id:i.$id+"__description",description:h.description||r,schema:c,uiSchema:p,registry:d}),l.map((function(e){return e.content})),t.canExpand(c,p,n)&&m.default.createElement(y,{className:"object-property-expand",onClick:o(c),disabled:a||s,uiSchema:p}))}function he(e){return m.default.createElement("legend",{id:e.id},e.title,e.required&&m.default.createElement("span",{className:"required"},"*"))}function ve(e){var t=e.schema,r=e.idSchema,a=e.reason;return m.default.createElement("div",{className:"unsupported-field"},m.default.createElement("p",null,"Unsupported field schema",r&&r.$id&&m.default.createElement("span",null," for"," field ",m.default.createElement("code",null,r.$id)),a&&m.default.createElement("em",null,": ",a),"."),t&&m.default.createElement("pre",null,JSON.stringify(t,null,2)))}function ge(e){var r=e.id,a=e.disabled,n=e.label,i=e.onKeyChange,o=e.onDropPropertyClick,l=e.readonly,s=e.children,d=e.uiSchema,u=e.registry.templates.ButtonTemplates.RemoveButton;return m.default.createElement("div",{className:e.classNames},t.ADDITIONAL_PROPERTY_FLAG in e.schema?m.default.createElement("div",{className:"row"},m.default.createElement("div",{className:"col-xs-5 form-additional"},m.default.createElement("div",{className:"form-group"},m.default.createElement(ue,{label:n+" Key",required:e.required,id:r+"-key"}),m.default.createElement("input",{className:"form-control",type:"text",id:r+"-key",onBlur:function(e){return i(e.target.value)},defaultValue:n}))),m.default.createElement("div",{className:"form-additional form-group col-xs-5"},s),m.default.createElement("div",{className:"col-xs-2"},m.default.createElement(u,{className:"array-item-remove btn-block",style:{border:"0"},disabled:a||l,onClick:o(n),uiSchema:d}))):s)}function ye(e,r){for(var a=[],n=e;n<=r;n++)a.push({value:n,label:t.pad(n,2)});return a}function Se(e){var t=e.type,r=e.range,a=e.value,n=e.select,i=e.disabled,o=e.readonly,l=e.autofocus,s=e.registry,d=e.onBlur,u=e.onFocus;return m.default.createElement(s.widgets.SelectWidget,{schema:{type:"integer"},id:e.rootId+"_"+t,className:"form-control",options:{enumOptions:ye(r[0],r[1])},placeholder:t,value:a,disabled:i,readonly:o,autofocus:l,onChange:function(e){return n(t,e)},onBlur:d,onFocus:u,registry:s,label:""})}function Ee(r){var a=r.time,n=void 0!==a&&a,i=r.disabled,o=void 0!==i&&i,l=r.readonly,s=void 0!==l&&l,d=r.autofocus,u=void 0!==d&&d,c=r.options,f=r.id,p=r.registry,h=r.onBlur,v=r.onFocus,g=r.onChange,y=r.value,S=e.useReducer((function(e,t){return b({},e,t)}),t.parseDateString(y,n)),E=S[0],C=S[1];e.useEffect((function(){y&&y!==t.toDateString(E,n)&&C(t.parseDateString(y,n))}),[y,E,n]),e.useEffect((function(){(function(e){return Object.values(e).every((function(e){return-1!==e}))})(E)&&g(t.toDateString(E,n))}),[E,n,g]);var F=e.useCallback((function(e,t){var r;C(((r={})[e]=t,r))}),[]),D=e.useCallback((function(e){if(e.preventDefault(),!o&&!s){var r=t.parseDateString((new Date).toJSON(),n);C(r)}}),[o,s,n]),x=e.useCallback((function(e){e.preventDefault(),o||s||(C(t.parseDateString("",n)),g(void 0))}),[o,s,n,g]);return m.default.createElement("ul",{className:"list-inline"},function(e,t,r){void 0===r&&(r=[1900,(new Date).getFullYear()+2]);var a=[{type:"year",range:r,value:e.year},{type:"month",range:[1,12],value:e.month},{type:"day",range:[1,31],value:e.day}];return t&&a.push({type:"hour",range:[0,23],value:e.hour},{type:"minute",range:[0,59],value:e.minute},{type:"second",range:[0,59],value:e.second}),a}(E,n,c.yearsRange).map((function(e,t){return m.default.createElement("li",{key:t},m.default.createElement(Se,b({rootId:f,select:F},e,{disabled:o,readonly:s,registry:p,onBlur:h,onFocus:v,autofocus:u&&0===t})))})),("undefined"===c.hideNowButton||!c.hideNowButton)&&m.default.createElement("li",null,m.default.createElement("a",{href:"#",className:"btn btn-info btn-now",onClick:D},"Now")),("undefined"===c.hideClearButton||!c.hideClearButton)&&m.default.createElement("li",null,m.default.createElement("a",{href:"#",className:"btn btn-warning btn-clear",onClick:x},"Clear")))}var be=["time"];function Ce(e){var t=e.time,r=void 0===t||t,a=D(e,be);return m.default.createElement(a.registry.widgets.AltDateWidget,b({time:r},a))}function Fe(r){var a=r.schema,n=r.uiSchema,i=r.id,o=r.value,l=r.disabled,s=r.readonly,d=r.label,u=r.autofocus,c=void 0!==u&&u,f=r.onBlur,p=r.onFocus,h=r.onChange,v=r.registry,g=t.getTemplate("DescriptionFieldTemplate",v,r.options),y=t.schemaRequiresTrueValue(a),S=e.useCallback((function(e){return h(e.target.checked)}),[h]),E=e.useCallback((function(e){return f(i,e.target.checked)}),[f,i]),b=e.useCallback((function(e){return p(i,e.target.checked)}),[p,i]);return m.default.createElement("div",{className:"checkbox "+(l||s?"disabled":"")},a.description&&m.default.createElement(g,{id:i+"__description",description:a.description,schema:a,uiSchema:n,registry:v}),m.default.createElement("label",null,m.default.createElement("input",{type:"checkbox",id:i,name:i,checked:void 0!==o&&o,required:y,disabled:l||s,autoFocus:c,onChange:S,onBlur:E,onFocus:b}),m.default.createElement("span",null,d)))}function De(e){var t=e.id,r=e.disabled,a=e.options,n=a.inline,i=void 0!==n&&n,o=a.enumOptions,l=a.enumDisabled,s=e.value,d=e.autofocus,u=void 0!==d&&d,c=e.readonly,f=e.onChange;return m.default.createElement("div",{className:"checkboxes",id:t},Array.isArray(o)&&o.map((function(e,a){var n=-1!==s.indexOf(e.value),d=Array.isArray(l)&&-1!=l.indexOf(e.value),p=r||d||c?"disabled":"",h=m.default.createElement("span",null,m.default.createElement("input",{type:"checkbox",id:t+"-"+e.value,name:t,checked:n,disabled:r||d||c,autoFocus:u&&0===a,onChange:function(t){var r=o.map((function(e){return e.value}));f(t.target.checked?function(e,t,r){var a=r.indexOf(e);return t.slice(0,a).concat(e,t.slice(a)).sort((function(e,t){return Number(r.indexOf(e)>r.indexOf(t))}))}(e.value,s,r):function(e,t){return t.filter((function(t){return t!==e}))}(e.value,s))}}),m.default.createElement("span",null,e.label));return i?m.default.createElement("label",{key:e.value,className:"checkbox-inline "+p},h):m.default.createElement("div",{key:e.value,className:"checkbox "+p},m.default.createElement("label",null,h))})))}function xe(e){var r=e.disabled,a=e.readonly,n=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(n,b({type:"color"},e,{disabled:r||a}))}function ke(r){var a=r.onChange,n=t.getTemplate("BaseInputTemplate",r.registry,r.options),i=e.useCallback((function(e){return a(e||void 0)}),[a]);return m.default.createElement(n,b({type:"date"},r,{onChange:i}))}function Te(e){var r=e.onChange,a=e.value,n=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(n,b({type:"datetime-local"},e,{value:t.utcToLocal(a),onChange:function(e){return r(t.localToUTC(e))}}))}function we(e){var r=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(r,b({type:"email"},e))}function Oe(e,t){return null===e?null:e.replace(";base64",";name="+encodeURIComponent(t)+";base64")}function Ae(e){var t=e.name,r=e.size,a=e.type;return new Promise((function(n,i){var o=new window.FileReader;o.onerror=i,o.onload=function(e){var i;"string"==typeof(null===(i=e.target)||void 0===i?void 0:i.result)?n({dataURL:Oe(e.target.result,t),name:t,size:r,type:a}):n({dataURL:null,name:t,size:r,type:a})},o.readAsDataURL(e)}))}function Ne(e){var t=e.filesInfo;return 0===t.length?null:m.default.createElement("ul",{className:"file-info"},t.map((function(e,t){var r=e.size,a=e.type;return m.default.createElement("li",{key:t},m.default.createElement("strong",null,e.name)," (",a,", ",r," bytes)")})))}function Be(e){return e.filter((function(e){return void 0!==e})).map((function(e){var r=t.dataURItoBlob(e),a=r.blob;return{name:r.name,size:a.size,type:a.type}}))}function Ie(t){var r=t.multiple,a=t.id,n=t.readonly,i=t.disabled,o=t.onChange,l=t.value,s=t.autofocus,d=void 0!==s&&s,u=t.options,c=e.useMemo((function(){return Array.isArray(l)?Be(l):Be([l])}),[l]),f=e.useState(c),p=f[0],h=f[1],v=e.useCallback((function(e){var t;e.target.files&&(t=e.target.files,Promise.all(Array.from(t).map(Ae))).then((function(e){h(e);var t=e.map((function(e){return e.dataURL}));o(r?t:t[0])}))}),[r,o]);return m.default.createElement("div",null,m.default.createElement("p",null,m.default.createElement("input",{id:a,name:a,type:"file",disabled:n||i,onChange:v,defaultValue:"",autoFocus:d,multiple:r,accept:u.accept?String(u.accept):void 0})),m.default.createElement(Ne,{filesInfo:p}))}function Ue(e){var t=e.id,r=e.value;return m.default.createElement("input",{type:"hidden",id:t,name:t,value:void 0===r?"":r})}function qe(e){var r=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(r,b({type:"password"},e))}function Pe(t){var r=t.options,a=t.value,n=t.required,i=t.disabled,o=t.readonly,l=t.autofocus,s=void 0!==l&&l,d=t.onBlur,u=t.onFocus,c=t.onChange,f=t.id,p=Math.random().toString(),h=r.enumOptions,v=r.enumDisabled,g=r.inline,y=e.useCallback((function(e){return d(f,e.target.value)}),[d,f]),S=e.useCallback((function(e){return u(f,e.target.value)}),[u,f]);return m.default.createElement("div",{className:"field-radio-group",id:f},Array.isArray(h)&&h.map((function(e,t){var r=e.value===a,l=Array.isArray(v)&&-1!=v.indexOf(e.value),d=i||l||o?"disabled":"",u=m.default.createElement("span",null,m.default.createElement("input",{type:"radio",id:f+"-"+e.value,checked:r,name:p,required:n,value:e.value,disabled:i||l||o,autoFocus:s&&0===t,onChange:function(){return c(e.value)},onBlur:y,onFocus:S}),m.default.createElement("span",null,e.label));return g?m.default.createElement("label",{key:e.value,className:"radio-inline "+d},u):m.default.createElement("div",{key:e.value,className:"radio "+d},m.default.createElement("label",null,u))})))}function _e(e){var t=e.value;return m.default.createElement("div",{className:"field-range-wrapper"},m.default.createElement(e.registry.templates.BaseInputTemplate,b({type:"range"},e)),m.default.createElement("span",{className:"range-view"},t))}function Re(e,t){return t?Array.from(e.target.options).slice().filter((function(e){return e.selected})).map((function(e){return e.value})):e.target.value}function je(r){var a=r.schema,n=r.id,i=r.options,o=r.value,l=r.required,s=r.disabled,d=r.readonly,u=r.multiple,c=void 0!==u&&u,f=r.autofocus,p=void 0!==f&&f,h=r.onChange,v=r.onBlur,g=r.onFocus,y=r.placeholder,S=i.enumOptions,E=i.enumDisabled,b=c?[]:"",C=e.useCallback((function(e){var r=Re(e,c);return g(n,t.processSelectValue(a,r,i))}),[g,n,a,c,i]),F=e.useCallback((function(e){var r=Re(e,c);return v(n,t.processSelectValue(a,r,i))}),[v,n,a,c,i]),D=e.useCallback((function(e){var r=Re(e,c);return h(t.processSelectValue(a,r,i))}),[h,a,c,i]);return m.default.createElement("select",{id:n,name:n,multiple:c,className:"form-control",value:void 0===o?b:o,required:l,disabled:s||d,autoFocus:p,onBlur:F,onFocus:C,onChange:D},!c&&void 0===a.default&&m.default.createElement("option",{value:""},y),Array.isArray(S)&&S.map((function(e,t){var r=e.value,a=e.label,n=E&&-1!=E.indexOf(r);return m.default.createElement("option",{key:t,value:r,disabled:n},a)})))}function Ve(t){var r=t.id,a=t.options,n=void 0===a?{}:a,i=t.placeholder,o=t.value,l=t.required,s=t.disabled,d=t.readonly,u=t.autofocus,c=void 0!==u&&u,f=t.onChange,p=t.onBlur,h=t.onFocus,v=e.useCallback((function(e){var t=e.target.value;return f(""===t?n.emptyValue:t)}),[f,n.emptyValue]),g=e.useCallback((function(e){return p(r,e.target.value)}),[p,r]),y=e.useCallback((function(e){return h(r,e.target.value)}),[r,h]);return m.default.createElement("textarea",{id:r,name:r,className:"form-control",value:o||"",placeholder:i,required:l,disabled:s,readOnly:d,autoFocus:c,rows:n.rows,onBlur:g,onFocus:y,onChange:v})}function Me(e){var r=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(r,b({},e))}function Ke(e){var r=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(r,b({type:"url"},e))}function We(e){var r=t.getTemplate("BaseInputTemplate",e.registry,e.options);return m.default.createElement(r,b({type:"number"},e))}function Le(){return{fields:{AnyOfField:P,ArrayField:B,BooleanField:U,NumberField:j,ObjectField:V,OneOfField:P,SchemaField:L,StringField:Y,NullField:z},templates:{ArrayFieldDescriptionTemplate:H,ArrayFieldItemTemplate:J,ArrayFieldTemplate:Q,ArrayFieldTitleTemplate:X,ButtonTemplates:{SubmitButton:te,AddButton:le,MoveDownButton:ne,MoveUpButton:ie,RemoveButton:oe},BaseInputTemplate:ee,DescriptionFieldTemplate:se,ErrorListTemplate:de,FieldTemplate:ce,FieldErrorTemplate:me,FieldHelpTemplate:fe,ObjectFieldTemplate:pe,TitleFieldTemplate:he,UnsupportedFieldTemplate:ve,WrapIfAdditionalTemplate:ge},widgets:{PasswordWidget:qe,RadioWidget:Pe,UpDownWidget:We,RangeWidget:_e,SelectWidget:je,TextWidget:Me,DateWidget:ke,DateTimeWidget:Te,AltDateWidget:Ee,AltDateTimeWidget:Ce,EmailWidget:we,URLWidget:Ke,TextareaWidget:Ve,HiddenWidget:Ue,ColorWidget:xe,FileWidget:Ie,CheckboxWidget:Fe,CheckboxesWidget:De},rootSchema:{},formContext:{}}}Ve.defaultProps={autofocus:!1,options:{}};var $e=function(e){function r(r){var a;if((a=e.call(this,r)||this).formElement=void 0,a.getUsedFormData=function(e,t){if(0===t.length&&"object"!=typeof e)return e;var r=h.default(e,t);return Array.isArray(e)?Object.keys(r).map((function(e){return r[e]})):r},a.getFieldNames=function(e,r){return function e(a,n,i){return void 0===n&&(n=[]),void 0===i&&(i=[[]]),Object.keys(a).forEach((function(o){if("object"==typeof a[o]){var l=i.map((function(e){return[].concat(e,[o])}));a[o][t.RJSF_ADDITONAL_PROPERTIES_FLAG]&&""!==a[o][t.NAME_KEY]?n.push(a[o][t.NAME_KEY]):e(a[o],n,l)}else o===t.NAME_KEY&&""!==a[o]&&i.forEach((function(e){var t=f.default(r,e);("object"!=typeof t||p.default(t))&&n.push(e)}))})),n}(e)},a.onChange=function(e,r,n){var i=a.props,o=i.extraErrors,l=i.omitExtraData,s=i.liveOmit,d=i.noValidate,u=i.liveValidate,c=i.onChange,m=a.state,f=m.schemaUtils,p=m.schema;(t.isObject(e)||Array.isArray(e))&&(e=a.getStateFromProps(a.props,e).formData);var h=!d&&u,v={formData:e,schema:p},g=e;if(!0===l&&!0===s){var y=f.retrieveSchema(p,e),S=f.toPathSchema(y,"",e),E=a.getFieldNames(S,e);g=a.getUsedFormData(e,E),v={formData:g}}if(h){var C=a.validate(g),F=C.errors,D=C.errorSchema,x=F,k=D;if(o){var T=f.mergeValidationData(C,o);D=T.errorSchema,F=T.errors}v={formData:g,errors:F,errorSchema:D,schemaValidationErrors:x,schemaValidationErrorSchema:k}}else if(!d&&r){var w=o?t.mergeObjects(r,o,"preventDuplicates"):r;v={formData:g,errorSchema:w,errors:f.getValidator().toErrorList(w)}}a.setState(v,(function(){return c&&c(b({},a.state,v),n)}))},a.onBlur=function(e,t){var r=a.props.onBlur;r&&r(e,t)},a.onFocus=function(e,t){var r=a.props.onFocus;r&&r(e,t)},a.onSubmit=function(e){if(e.preventDefault(),e.target===e.currentTarget){e.persist();var t=a.props,r=t.extraErrors,n=t.noValidate,i=t.onSubmit,o=a.state.formData,l=a.state,s=l.schemaUtils;if(!0===t.omitExtraData){var d=s.retrieveSchema(l.schema,o),u=s.toPathSchema(d,"",o),c=a.getFieldNames(u,o);o=a.getUsedFormData(o,c)}if(n||a.validateForm()){var m=r||{},f=r?s.getValidator().toErrorList(r):[];a.setState({formData:o,errors:f,errorSchema:m,schemaValidationErrors:[],schemaValidationErrorSchema:{}},(function(){i&&i(b({},a.state,{formData:o,status:"submitted"}),e)}))}}},!r.validator)throw new Error("A validator is required for Form functionality to work");return a.state=a.getStateFromProps(r,r.formData),a.props.onChange&&!t.deepEquals(a.state.formData,a.props.formData)&&a.props.onChange(a.state),a.formElement=m.default.createRef(),a}C(r,e);var a=r.prototype;return a.UNSAFE_componentWillReceiveProps=function(e){var r=this.getStateFromProps(e,e.formData);t.deepEquals(r.formData,e.formData)||t.deepEquals(r.formData,this.state.formData)||!e.onChange||e.onChange(r),this.setState(r)},a.getStateFromProps=function(e,r){var a=this.state||{},n="schema"in e?e.schema:this.props.schema,i=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},o=void 0!==r,l=o&&!e.noValidate&&("liveValidate"in e?e.liveValidate:this.props.liveValidate),s=n,d=a.schemaUtils;d&&!d.doesSchemaUtilsDiffer(e.validator,s)||(d=t.createSchemaUtils(e.validator,s));var u,c,m=d.getDefaultFormState(n,r),f=d.retrieveSchema(n,m),p=a.schemaValidationErrors,h=a.schemaValidationErrorSchema;if(l){var v=this.validate(m,n,d);p=u=v.errors,h=c=v.errorSchema}else{var g=e.noValidate?{errors:[],errorSchema:{}}:e.liveValidate?{errors:a.errors||[],errorSchema:a.errorSchema||{}}:{errors:a.schemaValidationErrors||[],errorSchema:a.schemaValidationErrorSchema||{}};u=g.errors,c=g.errorSchema}if(e.extraErrors){var y=d.mergeValidationData({errorSchema:c,errors:u},e.extraErrors);c=y.errorSchema,u=y.errors}var S=d.toIdSchema(f,i["ui:rootFieldId"],m,e.idPrefix,e.idSeparator);return{schemaUtils:d,schema:n,uiSchema:i,idSchema:S,formData:m,edit:o,errors:u,errorSchema:c,schemaValidationErrors:p,schemaValidationErrorSchema:h}},a.shouldComponentUpdate=function(e,r){return t.shouldRender(this,e,r)},a.validate=function(e,t,r){void 0===t&&(t=this.props.schema);var a=r||this.state.schemaUtils,n=this.props,i=n.customValidate,o=n.transformErrors,l=a.retrieveSchema(t,e);return a.getValidator().validateFormData(e,l,i,o)},a.renderErrors=function(e){var r=this.state,a=r.errors,n=r.errorSchema,i=r.schema,o=r.uiSchema,l=this.props.formContext,s=t.getUiOptions(o),d=t.getTemplate("ErrorListTemplate",e,s);return a&&a.length?m.default.createElement(d,{errors:a,errorSchema:n||{},schema:i,uiSchema:o,formContext:l}):null},a.getRegistry=function(){var e,t=this.state.schemaUtils,r=Le(),a=r.templates,n=r.widgets,i=r.formContext;return{fields:b({},r.fields,this.props.fields),templates:b({},a,this.props.templates,{ButtonTemplates:b({},a.ButtonTemplates,null===(e=this.props.templates)||void 0===e?void 0:e.ButtonTemplates)}),widgets:b({},n,this.props.widgets),rootSchema:this.props.schema,formContext:this.props.formContext||i,schemaUtils:t}},a.submit=function(){this.formElement.current&&(this.formElement.current.dispatchEvent(new CustomEvent("submit",{cancelable:!0})),this.formElement.current.requestSubmit())},a.validateForm=function(){var e=this.props,t=e.extraErrors,r=e.onError,a=this.state.schemaUtils,n=this.validate(this.state.formData),i=n.errors,o=n.errorSchema,l=i,s=o;if(i.length>0){if(t){var d=a.mergeValidationData(n,t);o=d.errorSchema,i=d.errors}return this.setState({errors:i,errorSchema:o,schemaValidationErrors:l,schemaValidationErrorSchema:s},(function(){r?r(i):console.error("Form validation failed",i)})),!1}return!0},a.render=function(){var e=this.props,t=e.children,r=e.id,a=e.idPrefix,n=e.idSeparator,i=e.className,o=void 0===i?"":i,l=e.tagName,s=e.name,d=e.method,u=e.target,c=e.action,f=e.autoComplete,p=e.enctype,h=e.acceptcharset,v=e.noHtml5Validate,g=void 0!==v&&v,y=e.disabled,S=void 0!==y&&y,E=e.readonly,b=void 0!==E&&E,C=e.formContext,F=e.showErrorList,D=void 0===F?"top":F,x=e._internalFormWrapper,k=this.state,T=k.schema,w=k.uiSchema,O=k.formData,A=k.errorSchema,N=k.idSchema,B=this.getRegistry(),I=B.fields.SchemaField,U=B.templates.ButtonTemplates.SubmitButton;return m.default.createElement(x||l||"form",{className:o||"rjsf",id:r,name:s,method:d,target:u,action:c,autoComplete:f,encType:p,acceptCharset:h,noValidate:g,onSubmit:this.onSubmit,as:x?l:void 0,ref:this.formElement},"top"===D&&this.renderErrors(B),m.default.createElement(I,{name:"",schema:T,uiSchema:w,errorSchema:A,idSchema:N,idPrefix:a,idSeparator:n,formContext:C,formData:O,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:B,disabled:S,readonly:b}),t||m.default.createElement(U,{uiSchema:w}),"bottom"===D&&this.renderErrors(B))},r}(e.Component),Ye=["fields","widgets","templates"];exports.default=$e,exports.getDefaultRegistry=Le,exports.withTheme=function(t){return e.forwardRef((function(e,r){var a,n,i=e.fields,o=e.widgets,l=e.templates,s=D(e,Ye);return i=b({},t.fields,i),o=b({},t.widgets,o),l=b({},t.templates,l,{ButtonTemplates:b({},null==t||null===(a=t.templates)||void 0===a?void 0:a.ButtonTemplates,null===(n=l)||void 0===n?void 0:n.ButtonTemplates)}),m.default.createElement($e,b({},t,s,{fields:i,widgets:o,templates:l,ref:r}))}))}; | ||
//# sourceMappingURL=core.cjs.production.min.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@rjsf/utils"),require("lodash-es/get"),require("lodash-es/isEmpty"),require("lodash-es/pick"),require("lodash-es/isObject"),require("lodash-es/set"),require("nanoid"),require("lodash-es/unset"),require("lodash-es/has"),require("lodash-es/omit")):"function"==typeof define&&define.amd?define(["exports","react","@rjsf/utils","lodash-es/get","lodash-es/isEmpty","lodash-es/pick","lodash-es/isObject","lodash-es/set","nanoid","lodash-es/unset","lodash-es/has","lodash-es/omit"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@rjsf/core"]={},e.React,e.utils,e.get,e._isEmpty,e._pick,e.isObject,e.set,e.nanoid,e.unset,e.has,e.omit)}(this,(function(e,t,a,r,o,i,n,l,s,d,c,u){"use strict";function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=m(t),h=m(r),f=m(o),g=m(i),y=m(n),S=m(l),E=m(d),b=m(c),v=m(u);function C(){return s.nanoid()}function F(e){return Array.isArray(e)?e.map((e=>({key:C(),item:e}))):[]}function D(e){return Array.isArray(e)?e.map((e=>e.item)):[]}class x extends t.Component{constructor(e){super(e),this._getNewFormDataRow=()=>{const{schema:e,registry:t}=this.props,{schemaUtils:r}=t;let o=e.items;return a.isFixedItems(e)&&a.allowAdditionalItems(e)&&(o=e.additionalItems),r.getDefaultFormState(o)},this.onAddClick=e=>{e&&e.preventDefault();const{onChange:t}=this.props,{keyedFormData:a}=this.state,r=[...a,{key:C(),item:this._getNewFormDataRow()}];this.setState({keyedFormData:r,updatedKeyedFormData:!0},(()=>t(D(r))))},this.onAddIndexClick=e=>t=>{t&&t.preventDefault();const{onChange:a}=this.props,{keyedFormData:r}=this.state,o={key:C(),item:this._getNewFormDataRow()},i=[...r];i.splice(e,0,o),this.setState({keyedFormData:i,updatedKeyedFormData:!0},(()=>a(D(i))))},this.onDropIndexClick=e=>t=>{t&&t.preventDefault();const{onChange:a,errorSchema:r}=this.props,{keyedFormData:o}=this.state;let i;if(r){i={};for(const t in r){const a=parseInt(t);a<e?S.default(i,[a],r[t]):a>e&&S.default(i,[a-1],r[t])}}const n=o.filter(((t,a)=>a!==e));this.setState({keyedFormData:n,updatedKeyedFormData:!0},(()=>a(D(n),i)))},this.onReorderClick=(e,t)=>a=>{a&&(a.preventDefault(),a.currentTarget.blur());const{onChange:r,errorSchema:o}=this.props;let i;if(this.props.errorSchema){i={};for(const a in o){const r=parseInt(a);r==e?S.default(i,[t],o[e]):r==t?S.default(i,[e],o[t]):S.default(i,[a],o[r])}}const{keyedFormData:n}=this.state,l=function(){const a=n.slice();return a.splice(e,1),a.splice(t,0,n[e]),a}();this.setState({keyedFormData:l},(()=>r(D(l),i)))},this.onChangeForIndex=e=>(t,a,r)=>{const{formData:o,onChange:i,errorSchema:n}=this.props;i((Array.isArray(o)?o:[]).map(((a,r)=>e===r?void 0===t?null:t:a)),n&&n&&{...n,[e]:a},r)},this.onSelectChange=e=>{const{onChange:t,idSchema:a}=this.props;t(e,void 0,a&&a.$id)};const{formData:t=[]}=e,r=F(t);this.state={keyedFormData:r,updatedKeyedFormData:!1}}static getDerivedStateFromProps(e,t){if(t.updatedKeyedFormData)return{updatedKeyedFormData:!1};const a=Array.isArray(e.formData)?e.formData:[],r=t.keyedFormData||[];return{keyedFormData:a.length===r.length?r.map(((e,t)=>({key:e.key,item:a[t]}))):F(a)}}get itemTitle(){const{schema:e}=this.props;return h.default(e,[a.ITEMS_KEY,"title"],h.default(e,[a.ITEMS_KEY,"description"],"Item"))}isItemRequired(e){return Array.isArray(e.type)?!e.type.includes("null"):"null"!==e.type}canAddItem(e){const{schema:t,uiSchema:r}=this.props;let{addable:o}=a.getUiOptions(r);return!1!==o&&(o=void 0===t.maxItems||e.length<t.maxItems),o}render(){const{schema:e,uiSchema:t,idSchema:r,registry:o}=this.props,{schemaUtils:i}=o;if(!(a.ITEMS_KEY in e)){const i=a.getUiOptions(t),n=a.getTemplate("UnsupportedFieldTemplate",o,i);return p.default.createElement(n,{schema:e,idSchema:r,reason:"Missing items definition",registry:o})}return i.isMultiSelect(e)?this.renderMultiSelect():a.isCustomWidget(t)?this.renderCustomWidget():a.isFixedItems(e)?this.renderFixedArray():i.isFilesArray(e,t)?this.renderFiles():this.renderNormalArray()}renderNormalArray(){const{schema:e,uiSchema:t={},errorSchema:r,idSchema:o,name:i,disabled:n=!1,readonly:l=!1,autofocus:s=!1,required:d=!1,registry:c,onBlur:u,onFocus:m,idPrefix:h,idSeparator:f="_",rawErrors:g}=this.props,{keyedFormData:S}=this.state,E=void 0===e.title?i:e.title,{schemaUtils:b,formContext:v}=c,C=a.getUiOptions(t),F=y.default(e.items)?e.items:{},x=b.retrieveSchema(F),k=D(this.state.keyedFormData),T={canAdd:this.canAddItem(k),items:S.map(((e,a)=>{const{key:n,item:l}=e,d=l,c=b.retrieveSchema(F,d),p=r?r[a]:void 0,y=b.toIdSchema(c,o.$id+f+a,d,h,f);return this.renderArrayFieldItem({key:n,index:a,name:i&&`${i}-${a}`,canMoveUp:a>0,canMoveDown:a<k.length-1,itemSchema:c,itemIdSchema:y,itemErrorSchema:p,itemData:d,itemUiSchema:t.items,autofocus:s&&0===a,onBlur:u,onFocus:m,rawErrors:g})})),className:`field field-array field-array-of-${x.type}`,disabled:n,idSchema:o,uiSchema:t,onAddClick:this.onAddClick,readonly:l,required:d,schema:e,title:E,formContext:v,formData:k,rawErrors:g,registry:c},N=a.getTemplate("ArrayFieldTemplate",c,C);return p.default.createElement(N,{...T})}renderCustomWidget(){const{schema:e,idSchema:t,uiSchema:r,disabled:o=!1,readonly:i=!1,autofocus:n=!1,required:l=!1,hideError:s,placeholder:d,onBlur:c,onFocus:u,formData:m=[],registry:h,rawErrors:f,name:g}=this.props,{widgets:y,formContext:S}=h,E=e.title||g,{widget:b,...v}=a.getUiOptions(r),C=a.getWidget(e,b,y);return p.default.createElement(C,{id:t&&t.$id,multiple:!0,onChange:this.onSelectChange,onBlur:c,onFocus:u,options:v,schema:e,uiSchema:r,registry:h,value:m,disabled:o,readonly:i,hideError:s,required:l,label:E,placeholder:d,formContext:S,autofocus:n,rawErrors:f})}renderMultiSelect(){const{schema:e,idSchema:t,uiSchema:r,formData:o=[],disabled:i=!1,readonly:n=!1,autofocus:l=!1,required:s=!1,placeholder:d,onBlur:c,onFocus:u,registry:m,rawErrors:h,name:f}=this.props,{widgets:g,schemaUtils:y,formContext:S}=m,E=y.retrieveSchema(e.items,o),b=e.title||f,v=a.optionsList(E),{widget:C="select",...F}=a.getUiOptions(r),D=a.getWidget(e,C,g);return p.default.createElement(D,{id:t&&t.$id,multiple:!0,onChange:this.onSelectChange,onBlur:c,onFocus:u,options:{...F,enumOptions:v},schema:e,uiSchema:r,registry:m,value:o,disabled:i,readonly:n,required:s,label:b,placeholder:d,formContext:S,autofocus:l,rawErrors:h})}renderFiles(){const{schema:e,uiSchema:t,idSchema:r,name:o,disabled:i=!1,readonly:n=!1,autofocus:l=!1,required:s=!1,onBlur:d,onFocus:c,registry:u,formData:m=[],rawErrors:h}=this.props,f=e.title||o,{widgets:g,formContext:y}=u,{widget:S="files",...E}=a.getUiOptions(t),b=a.getWidget(e,S,g);return p.default.createElement(b,{options:E,id:r&&r.$id,multiple:!0,onChange:this.onSelectChange,onBlur:d,onFocus:c,schema:e,uiSchema:t,title:f,value:m,disabled:i,readonly:n,required:s,registry:u,formContext:y,autofocus:l,rawErrors:h,label:""})}renderFixedArray(){const{schema:e,uiSchema:t={},formData:r=[],errorSchema:o,idPrefix:i,idSeparator:n="_",idSchema:l,name:s,disabled:d=!1,readonly:c=!1,autofocus:u=!1,required:m=!1,registry:h,onBlur:f,onFocus:g,rawErrors:S}=this.props,{keyedFormData:E}=this.state;let{formData:b=[]}=this.props;const v=e.title||s,C=a.getUiOptions(t),{schemaUtils:F,formContext:D}=h,x=(y.default(e.items)?e.items:[]).map(((e,t)=>F.retrieveSchema(e,r[t]))),k=y.default(e.additionalItems)?F.retrieveSchema(e.additionalItems,r):null;(!b||b.length<x.length)&&(b=b||[],b=b.concat(new Array(x.length-b.length)));const T={canAdd:this.canAddItem(b)&&!!k,className:"field field-array field-array-fixed-items",disabled:d,idSchema:l,formData:r,items:E.map(((a,r)=>{const{key:d,item:c}=a,m=c,p=r>=x.length,h=p&&y.default(e.additionalItems)?F.retrieveSchema(e.additionalItems,m):x[r],E=F.toIdSchema(h,l.$id+n+r,m,i,n),v=p?t.additionalItems||{}:Array.isArray(t.items)?t.items[r]:t.items||{};return this.renderArrayFieldItem({key:d,index:r,name:s&&`${s}-${r}`,canRemove:p,canMoveUp:r>=x.length+1,canMoveDown:p&&r<b.length-1,itemSchema:h,itemData:m,itemUiSchema:v,itemIdSchema:E,itemErrorSchema:o?o[r]:void 0,autofocus:u&&0===r,onBlur:f,onFocus:g,rawErrors:S})})),onAddClick:this.onAddClick,readonly:c,required:m,registry:h,schema:e,uiSchema:t,title:v,formContext:D,rawErrors:S},N=a.getTemplate("ArrayFieldTemplate",h,C);return p.default.createElement(N,{...T})}renderArrayFieldItem(e){const{key:t,index:r,name:o,canRemove:i=!0,canMoveUp:n=!0,canMoveDown:l=!0,itemSchema:s,itemData:d,itemUiSchema:c,itemIdSchema:u,itemErrorSchema:m,autofocus:h,onBlur:f,onFocus:g,rawErrors:y}=e,{disabled:S,hideError:E,idPrefix:b,idSeparator:v,readonly:C,uiSchema:F,registry:D,formContext:x}=this.props,{fields:{ArraySchemaField:k,SchemaField:T}}=D,N=k||T,{orderable:A=!0,removable:w=!0}=a.getUiOptions(F),O={moveUp:A&&n,moveDown:A&&l,remove:w&&i,toolbar:!1};return O.toolbar=Object.keys(O).some((e=>O[e])),{children:p.default.createElement(N,{name:o,index:r,schema:s,uiSchema:c,formData:d,formContext:x,errorSchema:m,idPrefix:b,idSeparator:v,idSchema:u,required:this.isItemRequired(s),onChange:this.onChangeForIndex(r),onBlur:f,onFocus:g,registry:D,disabled:S,readonly:C,hideError:E,autofocus:h,rawErrors:y}),className:"array-item",disabled:S,hasToolbar:O.toolbar,hasMoveUp:O.moveUp,hasMoveDown:O.moveDown,hasRemove:O.remove,index:r,key:t,onAddIndexClick:this.onAddIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:C,registry:D,uiSchema:c}}}function k(e){const{schema:t,name:r,uiSchema:o,idSchema:i,formData:n,registry:l,required:s,disabled:d,readonly:c,autofocus:u,onChange:m,onFocus:h,onBlur:f,rawErrors:g}=e,{title:S}=t,{widgets:E,formContext:b}=l,{widget:v="checkbox",...C}=a.getUiOptions(o),F=a.getWidget(t,v,E);let D;if(Array.isArray(t.oneOf))D=a.optionsList({oneOf:t.oneOf.map((e=>{if(y.default(e))return{...e,title:e.title||(!0===e.const?"Yes":"No")}})).filter((e=>e))});else{const e=t,r=t.enum??[!0,!1];D=!e.enumNames&&2===r.length&&r.every((e=>"boolean"==typeof e))?[{value:r[0],label:r[0]?"Yes":"No"},{value:r[1],label:r[1]?"Yes":"No"}]:a.optionsList({enum:r,enumNames:e.enumNames})}return p.default.createElement(F,{options:{...C,enumOptions:D},schema:t,uiSchema:o,id:i&&i.$id,onChange:m,onFocus:h,onBlur:f,label:void 0===S?r:S,value:n,required:s,disabled:d,readonly:c,registry:l,formContext:b,autofocus:u,rawErrors:g})}class T extends t.Component{constructor(e){super(e),this.onOptionChange=e=>{const t=parseInt(e,10),{formData:r,onChange:o,options:i,registry:n}=this.props,{schemaUtils:l}=n,s=l.retrieveSchema(i[t],r);let d;if("object"===a.guessType(r)&&("object"===s.type||s.properties)){d=Object.assign({},r);const e=i.slice();e.splice(t,1);for(const t of e)if(t.properties)for(const e in t.properties)e in d&&E.default(d,e)}o(l.getDefaultFormState(i[t],d,"excludeObjectChildren"),void 0,this.getFieldId()),this.setState({selectedOption:parseInt(e,10)})};const{formData:t,options:r}=this.props;this.state={selectedOption:this.getMatchingOption(0,t,r)}}componentDidUpdate(e,t){const{formData:r,options:o,idSchema:i}=this.props,{selectedOption:n}=this.state;if(!a.deepEquals(r,e.formData)&&i.$id===e.idSchema.$id){const e=this.getMatchingOption(n,r,o);if(!t||e===n)return;this.setState({selectedOption:e})}}getMatchingOption(e,t,a){const{schemaUtils:r}=this.props.registry,o=r.getMatchingOption(t,a);return 0!==o?o:e||0}getFieldId(){const{idSchema:e,schema:t}=this.props;return`${e.$id}${t.oneOf?"__oneof_select":"__anyof_select"}`}render(){const{name:e,baseType:t,disabled:r=!1,readonly:o=!1,hideError:i=!1,errorSchema:n={},formData:l,formContext:s,idPrefix:d,idSeparator:c,idSchema:u,onBlur:m,onChange:h,onFocus:f,options:g,registry:y,uiSchema:S}=this.props,{widgets:E,fields:b}=y,{SchemaField:v}=b,{selectedOption:C}=this.state,{widget:F="select",...D}=a.getUiOptions(S),x=a.getWidget({type:"number"},F,E),k=g[C]||null;let T;k&&(T=k.type?k:Object.assign({},k,{type:t}));const N=g.map(((e,t)=>({label:e.title||`Option ${t+1}`,value:t})));return p.default.createElement("div",{className:"panel panel-default panel-body"},p.default.createElement("div",{className:"form-group"},p.default.createElement(x,{id:this.getFieldId(),schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:m,onFocus:f,value:C,options:{enumOptions:N},registry:y,formContext:s,...D,label:""})),null!==k&&p.default.createElement(v,{name:e,schema:T,uiSchema:S,errorSchema:n,idSchema:u,idPrefix:d,idSeparator:c,formData:l,formContext:s,onChange:h,onBlur:m,onFocus:f,registry:y,disabled:r,readonly:o,hideError:i}))}}const N=/\.([0-9]*0)*$/,A=/[0.]0*$/;function w(e){const{registry:r,onChange:o,formData:i,value:n}=e,[l,s]=t.useState(n),{StringField:d}=r.fields;let c=i;const u=t.useCallback((e=>{s(e),"."===`${e}`.charAt(0)&&(e=`0${e}`);const t="string"==typeof e&&e.match(N)?a.asNumber(e.replace(A,"")):a.asNumber(e);o(t)}),[o]);if("string"==typeof l&&"number"==typeof c){const e=new RegExp(`${c}`.replace(".","\\.")+"\\.?0*$");l.match(e)&&(c=l)}return p.default.createElement(d,{...e,formData:c,onChange:u})}class O extends t.Component{constructor(){var e;super(...arguments),e=this,this.state={wasPropertyKeyModified:!1,additionalProperties:{}},this.onPropertyChange=function(t,a){return void 0===a&&(a=!1),(r,o,i)=>{const{formData:n,onChange:l,errorSchema:s}=e.props;void 0===r&&a&&(r=""),l({...n,[t]:r},s&&s&&{...s,[t]:o},i)}},this.onDropPropertyClick=e=>t=>{t.preventDefault();const{onChange:a,formData:r}=this.props,o={...r};E.default(o,e),a(o)},this.getAvailableKey=(e,t)=>{const{uiSchema:r}=this.props,{duplicateKeySuffixSeparator:o="-"}=a.getUiOptions(r);let i=0,n=e;for(;n in t;)n=`${e}${o}${++i}`;return n},this.onKeyChange=e=>(t,a)=>{if(e===t)return;const{formData:r,onChange:o,errorSchema:i}=this.props;t=this.getAvailableKey(t,r);const n={...r},l={[e]:t},s=Object.keys(n).map((e=>({[l[e]||e]:n[e]}))),d=Object.assign({},...s);this.setState({wasPropertyKeyModified:!0}),o(d,i&&i&&{...i,[t]:a})},this.handleAddClick=e=>()=>{if(!e.additionalProperties)return;const{formData:t,onChange:r,registry:o}=this.props,i={...t};let n;if(y.default(e.additionalProperties)&&(n=e.additionalProperties.type,a.REF_KEY in e.additionalProperties)){const{schemaUtils:r}=o;n=r.retrieveSchema({$ref:e.additionalProperties[a.REF_KEY]},t).type}const l=this.getAvailableKey("newKey",i);S.default(i,l,this.getDefaultValue(n)),r(i)}}isRequired(e){const{schema:t}=this.props;return Array.isArray(t.required)&&-1!==t.required.indexOf(e)}getDefaultValue(e){switch(e){case"string":default:return"New Value";case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{}}}render(){const{schema:e,uiSchema:t={},formData:r,errorSchema:o,idSchema:i,name:n,required:l=!1,disabled:s=!1,readonly:d=!1,hideError:c,idPrefix:u,idSeparator:m,onBlur:f,onFocus:g,registry:y}=this.props,{fields:S,formContext:E,schemaUtils:v}=y,{SchemaField:C}=S,F=v.retrieveSchema(e,r),D=a.getUiOptions(t),{properties:x={}}=F,k=void 0===F.title?n:F.title,T=D.description||F.description;let N;try{const e=Object.keys(x);N=a.orderProperties(e,D.order)}catch(e){return p.default.createElement("div",null,p.default.createElement("p",{className:"config-error",style:{color:"red"}},"Invalid ",n||"root"," object field configuration:",p.default.createElement("em",null,e.message),"."),p.default.createElement("pre",null,JSON.stringify(F)))}const A=a.getTemplate("ObjectFieldTemplate",y,D),w={title:D.title||k,description:T,properties:N.map((e=>{const n=b.default(F,[a.PROPERTIES_KEY,e,a.ADDITIONAL_PROPERTY_FLAG]),S=n?t.additionalProperties:t[e],v="hidden"===a.getUiOptions(S).widget,D=h.default(i,[e],{});return{content:p.default.createElement(C,{key:e,name:e,required:this.isRequired(e),schema:h.default(F,[a.PROPERTIES_KEY,e],{}),uiSchema:S,errorSchema:h.default(o,e),idSchema:D,idPrefix:u,idSeparator:m,formData:h.default(r,e),formContext:E,wasPropertyKeyModified:this.state.wasPropertyKeyModified,onKeyChange:this.onKeyChange(e),onChange:this.onPropertyChange(e,n),onBlur:f,onFocus:g,registry:y,disabled:s,readonly:d,hideError:c,onDropPropertyClick:this.onDropPropertyClick}),name:e,readonly:d,disabled:s,required:l,hidden:v}})),readonly:d,disabled:s,required:l,idSchema:i,uiSchema:t,schema:F,formData:r,formContext:E,registry:y};return p.default.createElement(A,{...w,onAddClick:this.handleAddClick})}}const B={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function I(e){const{schema:t,idSchema:r,uiSchema:o,formData:i,errorSchema:n,idPrefix:l,idSeparator:s,name:d,onChange:c,onKeyChange:u,onDropPropertyClick:m,required:h,registry:f,wasPropertyKeyModified:g=!1}=e,{formContext:S,schemaUtils:E}=f,b=a.getUiOptions(o),C=a.getTemplate("FieldTemplate",f,b),F=a.getTemplate("DescriptionFieldTemplate",f,b),D=a.getTemplate("FieldHelpTemplate",f,b),x=a.getTemplate("FieldErrorTemplate",f,b),k=E.retrieveSchema(t,i),T=r[a.ID_KEY],N=a.mergeObjects(E.toIdSchema(k,T,i,l,s),r),A=p.default.useCallback(((e,t,a)=>c(e,t,a||T)),[T,c]),w=function(e,t,r,o){const i=t.field,{fields:n}=o;if("function"==typeof i)return i;if("string"==typeof i&&i in n)return n[i];const l=a.getSchemaType(e),s=Array.isArray(l)?l[0]:l||"",d=B[s];return d||!e.anyOf&&!e.oneOf?d in n?n[d]:()=>{const i=a.getTemplate("UnsupportedFieldTemplate",o,t);return p.default.createElement(i,{schema:e,idSchema:r,reason:`Unknown field type ${e.type}`,registry:o})}:()=>null}(k,b,N,f),O=Boolean(e.disabled||b.disabled),I=Boolean(e.readonly||b.readonly||e.schema.readOnly||k.readOnly),U=b.hideError,$=void 0===U?e.hideError:Boolean(U),q=Boolean(e.autofocus||b.autofocus);if(0===Object.keys(k).length)return null;const P=E.getDisplayLabel(k,o),{__errors:_,...R}=n||{},V=v.default(o,["ui:classNames","classNames"]);"ui:options"in V&&(V["ui:options"]=v.default(V["ui:options"],["classNames"]));const j=p.default.createElement(w,{...e,onChange:A,idSchema:N,schema:k,uiSchema:V,disabled:O,readonly:I,hideError:$,autofocus:q,errorSchema:R,formContext:S,rawErrors:_}),M=N[a.ID_KEY];let K;K=g||a.ADDITIONAL_PROPERTY_FLAG in k?d:b.title||e.schema.title||k.title||d;const W=b.description||e.schema.description||k.description||"",L=b.help,Y="hidden"===b.widget,z=["form-group","field",`field-${k.type}`];!$&&_&&_.length>0&&z.push("field-error has-error has-danger"),null!=o&&o.classNames&&z.push(o.classNames),b.classNames&&z.push(b.classNames);const H=p.default.createElement(D,{help:L,idSchema:N,schema:k,uiSchema:o,hasErrors:!$&&_&&_.length>0,registry:f}),J=$?void 0:p.default.createElement(x,{errors:_,errorSchema:n,idSchema:N,schema:k,uiSchema:o,registry:f}),G={description:p.default.createElement(F,{id:`${M}__description`,description:W,schema:k,uiSchema:o,registry:f}),rawDescription:W,help:H,rawHelp:"string"==typeof L?L:void 0,errors:J,rawErrors:$?void 0:_,id:M,label:K,hidden:Y,onChange:c,onKeyChange:u,onDropPropertyClick:m,required:h,disabled:O,readonly:I,hideError:$,displayLabel:P,classNames:z.join(" ").trim(),formContext:S,formData:i,schema:k,uiSchema:o,registry:f},Q=f.fields.AnyOfField,X=f.fields.OneOfField;return p.default.createElement(C,{...G},p.default.createElement(p.default.Fragment,null,j,k.anyOf&&!(null!=o&&o["ui:field"])&&!E.isSelect(k)&&p.default.createElement(Q,{name:d,disabled:O,readonly:I,hideError:$,errorSchema:n,formData:i,formContext:S,idPrefix:l,idSchema:N,idSeparator:s,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:k.anyOf.map((e=>E.retrieveSchema(y.default(e)?e:{},i))),baseType:k.type,registry:f,schema:k,uiSchema:o}),k.oneOf&&!(null!=o&&o["ui:field"])&&!E.isSelect(k)&&p.default.createElement(X,{name:d,disabled:O,readonly:I,hideError:$,errorSchema:n,formData:i,formContext:S,idPrefix:l,idSchema:N,idSeparator:s,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:k.oneOf.map((e=>E.retrieveSchema(y.default(e)?e:{},i))),baseType:k.type,registry:f,schema:k,uiSchema:o})))}class U extends p.default.Component{shouldComponentUpdate(e){return!a.deepEquals(this.props,e)}render(){return p.default.createElement(I,{...this.props})}}function $(e){const{schema:t,name:r,uiSchema:o,idSchema:i,formData:n,required:l,disabled:s=!1,readonly:d=!1,autofocus:c=!1,onChange:u,onBlur:m,onFocus:h,registry:f,rawErrors:g}=e,{title:y,format:S}=t,{widgets:E,formContext:b,schemaUtils:v}=f,C=v.isSelect(t)?a.optionsList(t):void 0;let F=C?"select":"text";S&&a.hasWidget(t,S,E)&&(F=S);const{widget:D=F,placeholder:x="",...k}=a.getUiOptions(o),T=a.getWidget(t,D,E);return p.default.createElement(T,{options:{...k,enumOptions:C},schema:t,uiSchema:o,id:i&&i.$id,label:void 0===y?r:y,value:n,onChange:u,onBlur:m,onFocus:h,required:l,disabled:s,readonly:d,formContext:b,autofocus:c,registry:f,placeholder:x,rawErrors:g})}function q(e){const{formData:a,onChange:r}=e;return t.useEffect((()=>{void 0===a&&r(null)}),[a,r]),null}function P(e){const{idSchema:t,description:r,registry:o,schema:i,uiSchema:n}=e,l=a.getUiOptions(n),{label:s=!0}=l;if(!r||!s)return null;const d=a.getTemplate("DescriptionFieldTemplate",o,l);return p.default.createElement(d,{id:`${t.$id}__description`,description:r,schema:i,uiSchema:n,registry:o})}function _(e){const{children:t,className:a,disabled:r,hasToolbar:o,hasMoveDown:i,hasMoveUp:n,hasRemove:l,index:s,onDropIndexClick:d,onReorderClick:c,readonly:u,registry:m,uiSchema:h}=e,{MoveDownButton:f,MoveUpButton:g,RemoveButton:y}=m.templates.ButtonTemplates,S={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return p.default.createElement("div",{className:a},p.default.createElement("div",{className:o?"col-xs-9":"col-xs-12"},t),o&&p.default.createElement("div",{className:"col-xs-3 array-item-toolbox"},p.default.createElement("div",{className:"btn-group",style:{display:"flex",justifyContent:"space-around"}},(n||i)&&p.default.createElement(g,{style:S,disabled:r||u||!n,onClick:c(s,s-1),uiSchema:h}),(n||i)&&p.default.createElement(f,{style:S,disabled:r||u||!i,onClick:c(s,s+1),uiSchema:h}),l&&p.default.createElement(y,{style:S,disabled:r||u,onClick:d(s),uiSchema:h}))))}function R(e){const{canAdd:t,className:r,disabled:o,idSchema:i,uiSchema:n,items:l,onAddClick:s,readonly:d,registry:c,required:u,schema:m,title:h}=e,f=a.getUiOptions(n),g=a.getTemplate("ArrayFieldDescriptionTemplate",c,f),y=a.getTemplate("ArrayFieldItemTemplate",c,f),S=a.getTemplate("ArrayFieldTitleTemplate",c,f),{ButtonTemplates:{AddButton:E}}=c.templates;return p.default.createElement("fieldset",{className:r,id:i.$id},p.default.createElement(S,{idSchema:i,title:f.title||h,required:u,schema:m,uiSchema:n,registry:c}),p.default.createElement(g,{idSchema:i,description:f.description||m.description,schema:m,uiSchema:n,registry:c}),p.default.createElement("div",{className:"row array-item-list"},l&&l.map((e=>{let{key:t,...a}=e;return p.default.createElement(y,{key:t,...a})}))),t&&p.default.createElement(E,{className:"array-item-add",onClick:s,disabled:o||d,uiSchema:n}))}function V(e){const{idSchema:t,title:r,schema:o,uiSchema:i,required:n,registry:l}=e,s=a.getUiOptions(i),{label:d=!0}=s;if(!r||!d)return null;const c=a.getTemplate("TitleFieldTemplate",l,s);return p.default.createElement(c,{id:`${t.$id}__title`,title:r,required:n,schema:o,uiSchema:i,registry:l})}function j(e){const{id:r,value:o,readonly:i,disabled:n,autofocus:l,onBlur:s,onFocus:d,onChange:c,options:u,schema:m,uiSchema:h,formContext:f,registry:g,rawErrors:y,type:S,...E}=e;if(!r)throw console.log("No id for",e),new Error(`no id for props ${JSON.stringify(e)}`);const b={...E,...a.getInputProps(m,S,u)};let v;v="number"===b.type||"integer"===b.type?o||0===o?o:"":null==o?"":o;const C=t.useCallback((e=>{let{target:{value:t}}=e;return c(""===t?u.emptyValue:t)}),[c,u]),F=t.useCallback((e=>{let{target:{value:t}}=e;return s(r,t)}),[s,r]),D=t.useCallback((e=>{let{target:{value:t}}=e;return d(r,t)}),[d,r]);return p.default.createElement(p.default.Fragment,null,p.default.createElement("input",{id:r,name:r,className:"form-control",readOnly:i,disabled:n,autoFocus:l,value:v,...b,list:m.examples?`examples_${r}`:void 0,onChange:C,onBlur:F,onFocus:D}),Array.isArray(m.examples)&&p.default.createElement("datalist",{key:`datalist_${r}`,id:`examples_${r}`},[...new Set(m.examples.concat(m.default?[m.default]:[]))].map((e=>p.default.createElement("option",{key:e,value:e})))))}function M(e){let{uiSchema:t}=e;const{submitText:r,norender:o,props:i={}}=a.getSubmitButtonOptions(t);return o?null:p.default.createElement("div",null,p.default.createElement("button",{type:"submit",...i,className:`btn btn-info ${i.className}`},r))}function K(e){const{iconType:t="default",icon:a,className:r,uiSchema:o,...i}=e;return p.default.createElement("button",{type:"button",className:`btn btn-${t} ${r}`,...i},p.default.createElement("i",{className:`glyphicon glyphicon-${a}`}))}function W(e){return p.default.createElement(K,{title:"Move down",className:"array-item-move-down",...e,icon:"arrow-down"})}function L(e){return p.default.createElement(K,{title:"Move up",className:"array-item-move-up",...e,icon:"arrow-up"})}function Y(e){return p.default.createElement(K,{title:"Remove",className:"array-item-remove",...e,iconType:"danger",icon:"remove"})}function z(e){let{className:t,onClick:a,disabled:r}=e;return p.default.createElement("div",{className:"row"},p.default.createElement("p",{className:`col-xs-3 col-xs-offset-9 text-right ${t}`},p.default.createElement(K,{iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:"Add",onClick:a,disabled:r})))}function H(e){const{id:t,description:a}=e;return a?p.default.createElement("string"==typeof a?"p":"div",{id:t,className:"field-description"},a):null}function J(e){let{errors:t}=e;return p.default.createElement("div",{className:"panel panel-danger errors"},p.default.createElement("div",{className:"panel-heading"},p.default.createElement("h3",{className:"panel-title"},"Errors")),p.default.createElement("ul",{className:"list-group"},t.map(((e,t)=>p.default.createElement("li",{key:t,className:"list-group-item text-danger"},e.stack)))))}function G(e){const{label:t,required:a,id:r}=e;return t?p.default.createElement("label",{className:"control-label",htmlFor:r},t,a&&p.default.createElement("span",{className:"required"},"*")):null}function Q(e){const{id:t,label:r,children:o,errors:i,help:n,description:l,hidden:s,required:d,displayLabel:c,registry:u,uiSchema:m}=e,h=a.getUiOptions(m),f=a.getTemplate("WrapIfAdditionalTemplate",u,h);return s?p.default.createElement("div",{className:"hidden"},o):p.default.createElement(f,{...e},c&&p.default.createElement(G,{label:r,required:d,id:t}),c&&l?l:null,o,i,n)}function X(e){const{errors:t=[],idSchema:a}=e;return 0===t.length?null:p.default.createElement("div",null,p.default.createElement("ul",{id:`${a.$id}__error`,className:"error-detail bs-callout bs-callout-info"},t.filter((e=>!!e)).map(((e,t)=>p.default.createElement("li",{className:"text-danger",key:t},e)))))}function Z(e){const{idSchema:t,help:a}=e;return a?p.default.createElement("string"==typeof a?"p":"div",{id:`${t.$id}__help`,className:"help-block"},a):null}function ee(e){const{description:t,disabled:r,formData:o,idSchema:i,onAddClick:n,properties:l,readonly:s,registry:d,required:c,schema:u,title:m,uiSchema:h}=e,f=a.getUiOptions(h),g=a.getTemplate("TitleFieldTemplate",d,f),y=a.getTemplate("DescriptionFieldTemplate",d,f),{ButtonTemplates:{AddButton:S}}=d.templates;return p.default.createElement("fieldset",{id:i.$id},(f.title||m)&&p.default.createElement(g,{id:`${i.$id}__title`,title:f.title||m,required:c,schema:u,uiSchema:h,registry:d}),(f.description||t)&&p.default.createElement(y,{id:`${i.$id}__description`,description:f.description||t,schema:u,uiSchema:h,registry:d}),l.map((e=>e.content)),a.canExpand(u,h,o)&&p.default.createElement(S,{className:"object-property-expand",onClick:n(u),disabled:r||s,uiSchema:h}))}function te(e){const{id:t,title:a,required:r}=e;return p.default.createElement("legend",{id:t},a,r&&p.default.createElement("span",{className:"required"},"*"))}function ae(e){const{schema:t,idSchema:a,reason:r}=e;return p.default.createElement("div",{className:"unsupported-field"},p.default.createElement("p",null,"Unsupported field schema",a&&a.$id&&p.default.createElement("span",null," for"," field ",p.default.createElement("code",null,a.$id)),r&&p.default.createElement("em",null,": ",r),"."),t&&p.default.createElement("pre",null,JSON.stringify(t,null,2)))}function re(e){const{id:t,classNames:r,disabled:o,label:i,onKeyChange:n,onDropPropertyClick:l,readonly:s,required:d,schema:c,children:u,uiSchema:m,registry:h}=e,{RemoveButton:f}=h.templates.ButtonTemplates;return p.default.createElement("div",{className:r},a.ADDITIONAL_PROPERTY_FLAG in c?p.default.createElement("div",{className:"row"},p.default.createElement("div",{className:"col-xs-5 form-additional"},p.default.createElement("div",{className:"form-group"},p.default.createElement(G,{label:`${i} Key`,required:d,id:`${t}-key`}),p.default.createElement("input",{className:"form-control",type:"text",id:`${t}-key`,onBlur:e=>n(e.target.value),defaultValue:i}))),p.default.createElement("div",{className:"form-additional form-group col-xs-5"},u),p.default.createElement("div",{className:"col-xs-2"},p.default.createElement(f,{className:"array-item-remove btn-block",style:{border:"0"},disabled:o||s,onClick:l(i),uiSchema:m}))):u)}function oe(e,t){const r=[];for(let o=e;o<=t;o++)r.push({value:o,label:a.pad(o,2)});return r}function ie(e){let{type:t,range:a,value:r,select:o,rootId:i,disabled:n,readonly:l,autofocus:s,registry:d,onBlur:c,onFocus:u}=e;const m=i+"_"+t,{SelectWidget:h}=d.widgets;return p.default.createElement(h,{schema:{type:"integer"},id:m,className:"form-control",options:{enumOptions:oe(a[0],a[1])},placeholder:t,value:r,disabled:n,readonly:l,autofocus:s,onChange:e=>o(t,e),onBlur:c,onFocus:u,registry:d,label:""})}function ne(e){let{time:r=!1,disabled:o=!1,readonly:i=!1,autofocus:n=!1,options:l,id:s,registry:d,onBlur:c,onFocus:u,onChange:m,value:h}=e;const[f,g]=t.useReducer(((e,t)=>({...e,...t})),a.parseDateString(h,r));t.useEffect((()=>{h&&h!==a.toDateString(f,r)&&g(a.parseDateString(h,r))}),[h,f,r]),t.useEffect((()=>{(function(e){return Object.values(e).every((e=>-1!==e))})(f)&&m(a.toDateString(f,r))}),[f,r,m]);const y=t.useCallback(((e,t)=>{g({[e]:t})}),[]),S=t.useCallback((e=>{if(e.preventDefault(),o||i)return;const t=a.parseDateString((new Date).toJSON(),r);g(t)}),[o,i,r]),E=t.useCallback((e=>{e.preventDefault(),o||i||(g(a.parseDateString("",r)),m(void 0))}),[o,i,r,m]);return p.default.createElement("ul",{className:"list-inline"},function(e,t,a){void 0===a&&(a=[1900,(new Date).getFullYear()+2]);const{year:r,month:o,day:i,hour:n,minute:l,second:s}=e,d=[{type:"year",range:a,value:r},{type:"month",range:[1,12],value:o},{type:"day",range:[1,31],value:i}];return t&&d.push({type:"hour",range:[0,23],value:n},{type:"minute",range:[0,59],value:l},{type:"second",range:[0,59],value:s}),d}(f,r,l.yearsRange).map(((e,t)=>p.default.createElement("li",{key:t},p.default.createElement(ie,{rootId:s,select:y,...e,disabled:o,readonly:i,registry:d,onBlur:c,onFocus:u,autofocus:n&&0===t})))),("undefined"===l.hideNowButton||!l.hideNowButton)&&p.default.createElement("li",null,p.default.createElement("a",{href:"#",className:"btn btn-info btn-now",onClick:S},"Now")),("undefined"===l.hideClearButton||!l.hideClearButton)&&p.default.createElement("li",null,p.default.createElement("a",{href:"#",className:"btn btn-warning btn-clear",onClick:E},"Clear")))}function le(e){let{time:t=!0,...a}=e;const{AltDateWidget:r}=a.registry.widgets;return p.default.createElement(r,{time:t,...a})}function se(e){let{schema:r,uiSchema:o,options:i,id:n,value:l,disabled:s,readonly:d,label:c,autofocus:u=!1,onBlur:m,onFocus:h,onChange:f,registry:g}=e;const y=a.getTemplate("DescriptionFieldTemplate",g,i),S=a.schemaRequiresTrueValue(r),E=t.useCallback((e=>f(e.target.checked)),[f]),b=t.useCallback((e=>m(n,e.target.checked)),[m,n]),v=t.useCallback((e=>h(n,e.target.checked)),[h,n]);return p.default.createElement("div",{className:"checkbox "+(s||d?"disabled":"")},r.description&&p.default.createElement(y,{id:n+"__description",description:r.description,schema:r,uiSchema:o,registry:g}),p.default.createElement("label",null,p.default.createElement("input",{type:"checkbox",id:n,name:n,checked:void 0!==l&&l,required:S,disabled:s||d,autoFocus:u,onChange:E,onBlur:b,onFocus:v}),p.default.createElement("span",null,c)))}function de(e){let{id:t,disabled:a,options:{inline:r=!1,enumOptions:o,enumDisabled:i},value:n,autofocus:l=!1,readonly:s,onChange:d}=e;return p.default.createElement("div",{className:"checkboxes",id:t},Array.isArray(o)&&o.map(((e,c)=>{const u=-1!==n.indexOf(e.value),m=Array.isArray(i)&&-1!=i.indexOf(e.value),h=a||m||s?"disabled":"",f=p.default.createElement("span",null,p.default.createElement("input",{type:"checkbox",id:`${t}-${e.value}`,name:t,checked:u,disabled:a||m||s,autoFocus:l&&0===c,onChange:t=>{const a=o.map((e=>{let{value:t}=e;return t}));d(t.target.checked?function(e,t,a){const r=a.indexOf(e);return t.slice(0,r).concat(e,t.slice(r)).sort(((e,t)=>Number(a.indexOf(e)>a.indexOf(t))))}(e.value,n,a):function(e,t){return t.filter((t=>t!==e))}(e.value,n))}}),p.default.createElement("span",null,e.label));return r?p.default.createElement("label",{key:e.value,className:`checkbox-inline ${h}`},f):p.default.createElement("div",{key:e.value,className:`checkbox ${h}`},p.default.createElement("label",null,f))})))}function ce(e){const{disabled:t,readonly:r,options:o,registry:i}=e,n=a.getTemplate("BaseInputTemplate",i,o);return p.default.createElement(n,{type:"color",...e,disabled:t||r})}function ue(e){const{onChange:r,options:o,registry:i}=e,n=a.getTemplate("BaseInputTemplate",i,o),l=t.useCallback((e=>r(e||void 0)),[r]);return p.default.createElement(n,{type:"date",...e,onChange:l})}function me(e){const{onChange:t,value:r,options:o,registry:i}=e,n=a.getTemplate("BaseInputTemplate",i,o);return p.default.createElement(n,{type:"datetime-local",...e,value:a.utcToLocal(r),onChange:e=>t(a.localToUTC(e))})}function pe(e){const{options:t,registry:r}=e,o=a.getTemplate("BaseInputTemplate",r,t);return p.default.createElement(o,{type:"email",...e})}function he(e,t){return null===e?null:e.replace(";base64",`;name=${encodeURIComponent(t)};base64`)}function fe(e){const{name:t,size:a,type:r}=e;return new Promise(((o,i)=>{const n=new window.FileReader;n.onerror=i,n.onload=e=>{var i;"string"==typeof(null===(i=e.target)||void 0===i?void 0:i.result)?o({dataURL:he(e.target.result,t),name:t,size:a,type:r}):o({dataURL:null,name:t,size:a,type:r})},n.readAsDataURL(e)}))}function ge(e){let{filesInfo:t}=e;return 0===t.length?null:p.default.createElement("ul",{className:"file-info"},t.map(((e,t)=>{const{name:a,size:r,type:o}=e;return p.default.createElement("li",{key:t},p.default.createElement("strong",null,a)," (",o,", ",r," bytes)")})))}function ye(e){return e.filter((e=>void 0!==e)).map((e=>{const{blob:t,name:r}=a.dataURItoBlob(e);return{name:r,size:t.size,type:t.type}}))}function Se(e){let{multiple:a,id:r,readonly:o,disabled:i,onChange:n,value:l,autofocus:s=!1,options:d}=e;const c=t.useMemo((()=>Array.isArray(l)?ye(l):ye([l])),[l]),[u,m]=t.useState(c),h=t.useCallback((e=>{var t;e.target.files&&(t=e.target.files,Promise.all(Array.from(t).map(fe))).then((e=>{m(e);const t=e.map((e=>e.dataURL));n(a?t:t[0])}))}),[a,n]);return p.default.createElement("div",null,p.default.createElement("p",null,p.default.createElement("input",{id:r,name:r,type:"file",disabled:o||i,onChange:h,defaultValue:"",autoFocus:s,multiple:a,accept:d.accept?String(d.accept):void 0})),p.default.createElement(ge,{filesInfo:u}))}function Ee(e){let{id:t,value:a}=e;return p.default.createElement("input",{type:"hidden",id:t,name:t,value:void 0===a?"":a})}function be(e){const{options:t,registry:r}=e,o=a.getTemplate("BaseInputTemplate",r,t);return p.default.createElement(o,{type:"password",...e})}function ve(e){let{options:a,value:r,required:o,disabled:i,readonly:n,autofocus:l=!1,onBlur:s,onFocus:d,onChange:c,id:u}=e;const m=Math.random().toString(),{enumOptions:h,enumDisabled:f,inline:g}=a,y=t.useCallback((e=>s(u,e.target.value)),[s,u]),S=t.useCallback((e=>d(u,e.target.value)),[d,u]);return p.default.createElement("div",{className:"field-radio-group",id:u},Array.isArray(h)&&h.map(((e,t)=>{const a=e.value===r,s=Array.isArray(f)&&-1!=f.indexOf(e.value),d=i||s||n?"disabled":"",h=p.default.createElement("span",null,p.default.createElement("input",{type:"radio",id:`${u}-${e.value}`,checked:a,name:m,required:o,value:e.value,disabled:i||s||n,autoFocus:l&&0===t,onChange:()=>c(e.value),onBlur:y,onFocus:S}),p.default.createElement("span",null,e.label));return g?p.default.createElement("label",{key:e.value,className:`radio-inline ${d}`},h):p.default.createElement("div",{key:e.value,className:`radio ${d}`},p.default.createElement("label",null,h))})))}function Ce(e){const{value:t,registry:{templates:{BaseInputTemplate:a}}}=e;return p.default.createElement("div",{className:"field-range-wrapper"},p.default.createElement(a,{type:"range",...e}),p.default.createElement("span",{className:"range-view"},t))}function Fe(e,t){return t?Array.from(e.target.options).slice().filter((e=>e.selected)).map((e=>e.value)):e.target.value}function De(e){let{schema:r,id:o,options:i,value:n,required:l,disabled:s,readonly:d,multiple:c=!1,autofocus:u=!1,onChange:m,onBlur:h,onFocus:f,placeholder:g}=e;const{enumOptions:y,enumDisabled:S}=i,E=c?[]:"",b=t.useCallback((e=>{const t=Fe(e,c);return f(o,a.processSelectValue(r,t,i))}),[f,o,r,c,i]),v=t.useCallback((e=>{const t=Fe(e,c);return h(o,a.processSelectValue(r,t,i))}),[h,o,r,c,i]),C=t.useCallback((e=>{const t=Fe(e,c);return m(a.processSelectValue(r,t,i))}),[m,r,c,i]);return p.default.createElement("select",{id:o,name:o,multiple:c,className:"form-control",value:void 0===n?E:n,required:l,disabled:s||d,autoFocus:u,onBlur:v,onFocus:b,onChange:C},!c&&void 0===r.default&&p.default.createElement("option",{value:""},g),Array.isArray(y)&&y.map(((e,t)=>{let{value:a,label:r}=e;const o=S&&-1!=S.indexOf(a);return p.default.createElement("option",{key:t,value:a,disabled:o},r)})))}function xe(e){let{id:a,options:r={},placeholder:o,value:i,required:n,disabled:l,readonly:s,autofocus:d=!1,onChange:c,onBlur:u,onFocus:m}=e;const h=t.useCallback((e=>{let{target:{value:t}}=e;return c(""===t?r.emptyValue:t)}),[c,r.emptyValue]),f=t.useCallback((e=>{let{target:{value:t}}=e;return u(a,t)}),[u,a]),g=t.useCallback((e=>{let{target:{value:t}}=e;return m(a,t)}),[a,m]);return p.default.createElement("textarea",{id:a,name:a,className:"form-control",value:i||"",placeholder:o,required:n,disabled:l,readOnly:s,autoFocus:d,rows:r.rows,onBlur:f,onFocus:g,onChange:h})}function ke(e){const{options:t,registry:r}=e,o=a.getTemplate("BaseInputTemplate",r,t);return p.default.createElement(o,{...e})}function Te(e){const{options:t,registry:r}=e,o=a.getTemplate("BaseInputTemplate",r,t);return p.default.createElement(o,{type:"url",...e})}function Ne(e){const{options:t,registry:r}=e,o=a.getTemplate("BaseInputTemplate",r,t);return p.default.createElement(o,{type:"number",...e})}function Ae(){return{fields:{AnyOfField:T,ArrayField:x,BooleanField:k,NumberField:w,ObjectField:O,OneOfField:T,SchemaField:U,StringField:$,NullField:q},templates:{ArrayFieldDescriptionTemplate:P,ArrayFieldItemTemplate:_,ArrayFieldTemplate:R,ArrayFieldTitleTemplate:V,ButtonTemplates:{SubmitButton:M,AddButton:z,MoveDownButton:W,MoveUpButton:L,RemoveButton:Y},BaseInputTemplate:j,DescriptionFieldTemplate:H,ErrorListTemplate:J,FieldTemplate:Q,FieldErrorTemplate:X,FieldHelpTemplate:Z,ObjectFieldTemplate:ee,TitleFieldTemplate:te,UnsupportedFieldTemplate:ae,WrapIfAdditionalTemplate:re},widgets:{PasswordWidget:be,RadioWidget:ve,UpDownWidget:Ne,RangeWidget:Ce,SelectWidget:De,TextWidget:ke,DateWidget:ue,DateTimeWidget:me,AltDateWidget:ne,AltDateTimeWidget:le,EmailWidget:pe,URLWidget:Te,TextareaWidget:xe,HiddenWidget:Ee,ColorWidget:ce,FileWidget:Se,CheckboxWidget:se,CheckboxesWidget:de},rootSchema:{},formContext:{}}}xe.defaultProps={autofocus:!1,options:{}};class we extends t.Component{constructor(e){if(super(e),this.formElement=void 0,this.getUsedFormData=(e,t)=>{if(0===t.length&&"object"!=typeof e)return e;const a=g.default(e,t);return Array.isArray(e)?Object.keys(a).map((e=>a[e])):a},this.getFieldNames=(e,t)=>{const r=function(e,o,i){return void 0===o&&(o=[]),void 0===i&&(i=[[]]),Object.keys(e).forEach((n=>{if("object"==typeof e[n]){const t=i.map((e=>[...e,n]));e[n][a.RJSF_ADDITONAL_PROPERTIES_FLAG]&&""!==e[n][a.NAME_KEY]?o.push(e[n][a.NAME_KEY]):r(e[n],o,t)}else n===a.NAME_KEY&&""!==e[n]&&i.forEach((e=>{const a=h.default(t,e);("object"!=typeof a||f.default(a))&&o.push(e)}))})),o};return r(e)},this.onChange=(e,t,r)=>{const{extraErrors:o,omitExtraData:i,liveOmit:n,noValidate:l,liveValidate:s,onChange:d}=this.props,{schemaUtils:c,schema:u}=this.state;(a.isObject(e)||Array.isArray(e))&&(e=this.getStateFromProps(this.props,e).formData);const m=!l&&s;let p={formData:e,schema:u},h=e;if(!0===i&&!0===n){const t=c.retrieveSchema(u,e),a=c.toPathSchema(t,"",e),r=this.getFieldNames(a,e);h=this.getUsedFormData(e,r),p={formData:h}}if(m){const e=this.validate(h);let t=e.errors,a=e.errorSchema;const r=t,i=a;if(o){const r=c.mergeValidationData(e,o);a=r.errorSchema,t=r.errors}p={formData:h,errors:t,errorSchema:a,schemaValidationErrors:r,schemaValidationErrorSchema:i}}else if(!l&&t){const e=o?a.mergeObjects(t,o,"preventDuplicates"):t;p={formData:h,errorSchema:e,errors:c.getValidator().toErrorList(e)}}this.setState(p,(()=>d&&d({...this.state,...p},r)))},this.onBlur=(e,t)=>{const{onBlur:a}=this.props;a&&a(e,t)},this.onFocus=(e,t)=>{const{onFocus:a}=this.props;a&&a(e,t)},this.onSubmit=e=>{if(e.preventDefault(),e.target!==e.currentTarget)return;e.persist();const{omitExtraData:t,extraErrors:a,noValidate:r,onSubmit:o}=this.props;let{formData:i}=this.state;const{schema:n,schemaUtils:l}=this.state;if(!0===t){const e=l.retrieveSchema(n,i),t=l.toPathSchema(e,"",i),a=this.getFieldNames(t,i);i=this.getUsedFormData(i,a)}if(r||this.validateForm()){const t=a||{},r=a?l.getValidator().toErrorList(a):[];this.setState({formData:i,errors:r,errorSchema:t,schemaValidationErrors:[],schemaValidationErrorSchema:{}},(()=>{o&&o({...this.state,formData:i,status:"submitted"},e)}))}},!e.validator)throw new Error("A validator is required for Form functionality to work");this.state=this.getStateFromProps(e,e.formData),this.props.onChange&&!a.deepEquals(this.state.formData,this.props.formData)&&this.props.onChange(this.state),this.formElement=p.default.createRef()}UNSAFE_componentWillReceiveProps(e){const t=this.getStateFromProps(e,e.formData);a.deepEquals(t.formData,e.formData)||a.deepEquals(t.formData,this.state.formData)||!e.onChange||e.onChange(t),this.setState(t)}getStateFromProps(e,t){const r=this.state||{},o="schema"in e?e.schema:this.props.schema,i=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},n=void 0!==t,l=n&&!e.noValidate&&("liveValidate"in e?e.liveValidate:this.props.liveValidate),s=o;let d=r.schemaUtils;d&&!d.doesSchemaUtilsDiffer(e.validator,s)||(d=a.createSchemaUtils(e.validator,s));const c=d.getDefaultFormState(o,t),u=d.retrieveSchema(o,c);let m,p,h=r.schemaValidationErrors,f=r.schemaValidationErrorSchema;if(l){const e=this.validate(c,o,d);m=e.errors,p=e.errorSchema,h=m,f=p}else{const t=e.noValidate?{errors:[],errorSchema:{}}:e.liveValidate?{errors:r.errors||[],errorSchema:r.errorSchema||{}}:{errors:r.schemaValidationErrors||[],errorSchema:r.schemaValidationErrorSchema||{}};m=t.errors,p=t.errorSchema}if(e.extraErrors){const t=d.mergeValidationData({errorSchema:p,errors:m},e.extraErrors);p=t.errorSchema,m=t.errors}const g=d.toIdSchema(u,i["ui:rootFieldId"],c,e.idPrefix,e.idSeparator);return{schemaUtils:d,schema:o,uiSchema:i,idSchema:g,formData:c,edit:n,errors:m,errorSchema:p,schemaValidationErrors:h,schemaValidationErrorSchema:f}}shouldComponentUpdate(e,t){return a.shouldRender(this,e,t)}validate(e,t,a){void 0===t&&(t=this.props.schema);const r=a||this.state.schemaUtils,{customValidate:o,transformErrors:i}=this.props,n=r.retrieveSchema(t,e);return r.getValidator().validateFormData(e,n,o,i)}renderErrors(e){const{errors:t,errorSchema:r,schema:o,uiSchema:i}=this.state,{formContext:n}=this.props,l=a.getUiOptions(i),s=a.getTemplate("ErrorListTemplate",e,l);return t&&t.length?p.default.createElement(s,{errors:t,errorSchema:r||{},schema:o,uiSchema:i,formContext:n}):null}getRegistry(){var e;const{schemaUtils:t}=this.state,{fields:a,templates:r,widgets:o,formContext:i}=Ae();return{fields:{...a,...this.props.fields},templates:{...r,...this.props.templates,ButtonTemplates:{...r.ButtonTemplates,...null===(e=this.props.templates)||void 0===e?void 0:e.ButtonTemplates}},widgets:{...o,...this.props.widgets},rootSchema:this.props.schema,formContext:this.props.formContext||i,schemaUtils:t}}submit(){this.formElement.current&&(this.formElement.current.dispatchEvent(new CustomEvent("submit",{cancelable:!0})),this.formElement.current.requestSubmit())}validateForm(){const{extraErrors:e,onError:t}=this.props,{formData:a}=this.state,{schemaUtils:r}=this.state,o=this.validate(a);let i=o.errors,n=o.errorSchema;const l=i,s=n;if(i.length>0){if(e){const t=r.mergeValidationData(o,e);n=t.errorSchema,i=t.errors}return this.setState({errors:i,errorSchema:n,schemaValidationErrors:l,schemaValidationErrorSchema:s},(()=>{t?t(i):console.error("Form validation failed",i)})),!1}return!0}render(){const{children:e,id:t,idPrefix:a,idSeparator:r,className:o="",tagName:i,name:n,method:l,target:s,action:d,autoComplete:c,enctype:u,acceptcharset:m,noHtml5Validate:h=!1,disabled:f=!1,readonly:g=!1,formContext:y,showErrorList:S="top",_internalFormWrapper:E}=this.props,{schema:b,uiSchema:v,formData:C,errorSchema:F,idSchema:D}=this.state,x=this.getRegistry(),{SchemaField:k}=x.fields,{SubmitButton:T}=x.templates.ButtonTemplates;return p.default.createElement(E||i||"form",{className:o||"rjsf",id:t,name:n,method:l,target:s,action:d,autoComplete:c,encType:u,acceptCharset:m,noValidate:h,onSubmit:this.onSubmit,as:E?i:void 0,ref:this.formElement},"top"===S&&this.renderErrors(x),p.default.createElement(k,{name:"",schema:b,uiSchema:v,errorSchema:F,idSchema:D,idPrefix:a,idSeparator:r,formContext:y,formData:C,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:x,disabled:f,readonly:g}),e||p.default.createElement(T,{uiSchema:v}),"bottom"===S&&this.renderErrors(x))}}e.default=we,e.getDefaultRegistry=Ae,e.withTheme=function(e){return t.forwardRef(((t,a)=>{var r,o;let{fields:i,widgets:n,templates:l,...s}=t;return i={...e.fields,...i},n={...e.widgets,...n},l={...e.templates,...l,ButtonTemplates:{...null==e||null===(r=e.templates)||void 0===r?void 0:r.ButtonTemplates,...null===(o=l)||void 0===o?void 0:o.ButtonTemplates}},p.default.createElement(we,{...e,...s,fields:i,widgets:n,templates:l,ref:a})}))},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@rjsf/utils"),require("lodash-es/get"),require("lodash-es/isEmpty"),require("lodash-es/pick"),require("lodash-es/isObject"),require("lodash-es/set"),require("nanoid"),require("lodash-es/unset"),require("lodash-es/has"),require("lodash-es/omit")):"function"==typeof define&&define.amd?define(["exports","react","@rjsf/utils","lodash-es/get","lodash-es/isEmpty","lodash-es/pick","lodash-es/isObject","lodash-es/set","nanoid","lodash-es/unset","lodash-es/has","lodash-es/omit"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@rjsf/core"]={},e.React,e.utils,e.get,e._isEmpty,e._pick,e.isObject,e.set,e.nanoid,e.unset,e.has,e.omit)}(this,(function(e,t,r,a,n,i,o,l,s,d,u,c){"use strict";function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=m(t),p=m(a),h=m(n),v=m(i),g=m(o),y=m(l),S=m(d),E=m(u),b=m(c);function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},C.apply(this,arguments)}function F(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,D(e,t)}function D(e,t){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},D(e,t)}function k(e,t){if(null==e)return{};var r,a,n={},i=Object.keys(e);for(a=0;a<i.length;a++)t.indexOf(r=i[a])>=0||(n[r]=e[r]);return n}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}var T=["widget"],w=["widget"],O=["widget"];function A(){return s.nanoid()}function N(e){return Array.isArray(e)?e.map((function(e){return{key:A(),item:e}})):[]}function B(e){return Array.isArray(e)?e.map((function(e){return e.item})):[]}var I=function(e){function t(t){var a;(a=e.call(this,t)||this)._getNewFormDataRow=function(){var e=a.props,t=e.schema,n=e.registry.schemaUtils,i=t.items;return r.isFixedItems(t)&&r.allowAdditionalItems(t)&&(i=t.additionalItems),n.getDefaultFormState(i)},a.onAddClick=function(e){e&&e.preventDefault();var t=a.props.onChange,r=a.state.keyedFormData,n={key:A(),item:a._getNewFormDataRow()},i=[].concat(r,[n]);a.setState({keyedFormData:i,updatedKeyedFormData:!0},(function(){return t(B(i))}))},a.onAddIndexClick=function(e){return function(t){t&&t.preventDefault();var r=a.props.onChange,n=a.state.keyedFormData,i={key:A(),item:a._getNewFormDataRow()},o=[].concat(n);o.splice(e,0,i),a.setState({keyedFormData:o,updatedKeyedFormData:!0},(function(){return r(B(o))}))}},a.onDropIndexClick=function(e){return function(t){t&&t.preventDefault();var r,n=a.props,i=n.onChange,o=n.errorSchema,l=a.state.keyedFormData;if(o)for(var s in r={},o){var d=parseInt(s);d<e?y.default(r,[d],o[s]):d>e&&y.default(r,[d-1],o[s])}var u=l.filter((function(t,r){return r!==e}));a.setState({keyedFormData:u,updatedKeyedFormData:!0},(function(){return i(B(u),r)}))}},a.onReorderClick=function(e,t){return function(r){r&&(r.preventDefault(),r.currentTarget.blur());var n,i=a.props,o=i.onChange,l=i.errorSchema;if(a.props.errorSchema)for(var s in n={},l){var d=parseInt(s);d==e?y.default(n,[t],l[e]):d==t?y.default(n,[e],l[t]):y.default(n,[s],l[d])}var u,c=a.state.keyedFormData,m=((u=c.slice()).splice(e,1),u.splice(t,0,c[e]),u);a.setState({keyedFormData:m},(function(){return o(B(m),n)}))}},a.onChangeForIndex=function(e){return function(t,r,n){var i,o=a.props,l=o.formData,s=o.errorSchema;(0,o.onChange)((Array.isArray(l)?l:[]).map((function(r,a){return e===a?void 0===t?null:t:r})),s&&s&&C({},s,((i={})[e]=r,i)),n)}},a.onSelectChange=function(e){var t=a.props,r=t.idSchema;(0,t.onChange)(e,void 0,r&&r.$id)};var n=t.formData,i=N(void 0===n?[]:n);return a.state={keyedFormData:i,updatedKeyedFormData:!1},a}F(t,e),t.getDerivedStateFromProps=function(e,t){if(t.updatedKeyedFormData)return{updatedKeyedFormData:!1};var r=Array.isArray(e.formData)?e.formData:[],a=t.keyedFormData||[];return{keyedFormData:r.length===a.length?a.map((function(e,t){return{key:e.key,item:r[t]}})):N(r)}};var a,n,i=t.prototype;return i.isItemRequired=function(e){return Array.isArray(e.type)?!e.type.includes("null"):"null"!==e.type},i.canAddItem=function(e){var t=this.props,a=t.schema,n=r.getUiOptions(t.uiSchema).addable;return!1!==n&&(n=void 0===a.maxItems||e.length<a.maxItems),n},i.render=function(){var e=this.props,t=e.schema,a=e.uiSchema,n=e.idSchema,i=e.registry,o=i.schemaUtils;if(!(r.ITEMS_KEY in t)){var l=r.getUiOptions(a),s=r.getTemplate("UnsupportedFieldTemplate",i,l);return f.default.createElement(s,{schema:t,idSchema:n,reason:"Missing items definition",registry:i})}return o.isMultiSelect(t)?this.renderMultiSelect():r.isCustomWidget(a)?this.renderCustomWidget():r.isFixedItems(t)?this.renderFixedArray():o.isFilesArray(t,a)?this.renderFiles():this.renderNormalArray()},i.renderNormalArray=function(){var e=this,t=this.props,a=t.schema,n=t.uiSchema,i=void 0===n?{}:n,o=t.errorSchema,l=t.idSchema,s=t.name,d=t.disabled,u=void 0!==d&&d,c=t.readonly,m=void 0!==c&&c,p=t.autofocus,h=void 0!==p&&p,v=t.required,y=void 0!==v&&v,S=t.registry,E=t.onBlur,b=t.onFocus,F=t.idPrefix,D=t.idSeparator,k=void 0===D?"_":D,x=t.rawErrors,T=this.state.keyedFormData,w=void 0===a.title?s:a.title,O=S.schemaUtils,A=S.formContext,N=r.getUiOptions(i),I=g.default(a.items)?a.items:{},U=O.retrieveSchema(I),q=B(this.state.keyedFormData),P={canAdd:this.canAddItem(q),items:T.map((function(t,r){var a=t.key,n=t.item,d=O.retrieveSchema(I,n),u=o?o[r]:void 0,c=O.toIdSchema(d,l.$id+k+r,n,F,k);return e.renderArrayFieldItem({key:a,index:r,name:s&&s+"-"+r,canMoveUp:r>0,canMoveDown:r<q.length-1,itemSchema:d,itemIdSchema:c,itemErrorSchema:u,itemData:n,itemUiSchema:i.items,autofocus:h&&0===r,onBlur:E,onFocus:b,rawErrors:x})})),className:"field field-array field-array-of-"+U.type,disabled:u,idSchema:l,uiSchema:i,onAddClick:this.onAddClick,readonly:m,required:y,schema:a,title:w,formContext:A,formData:q,rawErrors:x,registry:S},_=r.getTemplate("ArrayFieldTemplate",S,N);return f.default.createElement(_,C({},P))},i.renderCustomWidget=function(){var e=this.props,t=e.schema,a=e.idSchema,n=e.uiSchema,i=e.disabled,o=void 0!==i&&i,l=e.readonly,s=void 0!==l&&l,d=e.autofocus,u=void 0!==d&&d,c=e.required,m=void 0!==c&&c,p=e.hideError,h=e.placeholder,v=e.onBlur,g=e.onFocus,y=e.formData,S=void 0===y?[]:y,E=e.registry,b=e.rawErrors,C=E.widgets,F=E.formContext,D=t.title||e.name,x=r.getUiOptions(n),w=x.widget,O=k(x,T),A=r.getWidget(t,w,C);return f.default.createElement(A,{id:a&&a.$id,multiple:!0,onChange:this.onSelectChange,onBlur:v,onFocus:g,options:O,schema:t,uiSchema:n,registry:E,value:S,disabled:o,readonly:s,hideError:p,required:m,label:D,placeholder:h,formContext:F,autofocus:u,rawErrors:b})},i.renderMultiSelect=function(){var e=this.props,t=e.schema,a=e.idSchema,n=e.uiSchema,i=e.formData,o=void 0===i?[]:i,l=e.disabled,s=void 0!==l&&l,d=e.readonly,u=void 0!==d&&d,c=e.autofocus,m=void 0!==c&&c,p=e.required,h=void 0!==p&&p,v=e.placeholder,g=e.onBlur,y=e.onFocus,S=e.registry,E=e.rawErrors,b=e.name,F=S.widgets,D=S.formContext,x=S.schemaUtils.retrieveSchema(t.items,o),T=t.title||b,O=r.optionsList(x),A=r.getUiOptions(n),N=A.widget,B=void 0===N?"select":N,I=k(A,w),U=r.getWidget(t,B,F);return f.default.createElement(U,{id:a&&a.$id,multiple:!0,onChange:this.onSelectChange,onBlur:g,onFocus:y,options:C({},I,{enumOptions:O}),schema:t,uiSchema:n,registry:S,value:o,disabled:s,readonly:u,required:h,label:T,placeholder:v,formContext:D,autofocus:m,rawErrors:E})},i.renderFiles=function(){var e=this.props,t=e.schema,a=e.uiSchema,n=e.idSchema,i=e.disabled,o=void 0!==i&&i,l=e.readonly,s=void 0!==l&&l,d=e.autofocus,u=void 0!==d&&d,c=e.required,m=void 0!==c&&c,p=e.onBlur,h=e.onFocus,v=e.registry,g=e.formData,y=void 0===g?[]:g,S=e.rawErrors,E=t.title||e.name,b=v.widgets,C=v.formContext,F=r.getUiOptions(a),D=F.widget,x=void 0===D?"files":D,T=k(F,O),w=r.getWidget(t,x,b);return f.default.createElement(w,{options:T,id:n&&n.$id,multiple:!0,onChange:this.onSelectChange,onBlur:p,onFocus:h,schema:t,uiSchema:a,title:E,value:y,disabled:o,readonly:s,required:m,registry:v,formContext:C,autofocus:u,rawErrors:S,label:""})},i.renderFixedArray=function(){var e=this,t=this.props,a=t.schema,n=t.uiSchema,i=void 0===n?{}:n,o=t.formData,l=void 0===o?[]:o,s=t.errorSchema,d=t.idPrefix,u=t.idSeparator,c=void 0===u?"_":u,m=t.idSchema,p=t.name,h=t.disabled,v=void 0!==h&&h,y=t.readonly,S=void 0!==y&&y,E=t.autofocus,b=void 0!==E&&E,F=t.required,D=void 0!==F&&F,k=t.registry,x=t.onBlur,T=t.onFocus,w=t.rawErrors,O=this.state.keyedFormData,A=this.props.formData,N=void 0===A?[]:A,B=a.title||p,I=r.getUiOptions(i),U=k.schemaUtils,q=k.formContext,P=(g.default(a.items)?a.items:[]).map((function(e,t){return U.retrieveSchema(e,l[t])})),_=g.default(a.additionalItems)?U.retrieveSchema(a.additionalItems,l):null;(!N||N.length<P.length)&&(N=(N=N||[]).concat(new Array(P.length-N.length)));var R={canAdd:this.canAddItem(N)&&!!_,className:"field field-array field-array-fixed-items",disabled:v,idSchema:m,formData:l,items:O.map((function(t,r){var n=t.key,o=t.item,l=r>=P.length,u=l&&g.default(a.additionalItems)?U.retrieveSchema(a.additionalItems,o):P[r],f=U.toIdSchema(u,m.$id+c+r,o,d,c),h=l?i.additionalItems||{}:Array.isArray(i.items)?i.items[r]:i.items||{};return e.renderArrayFieldItem({key:n,index:r,name:p&&p+"-"+r,canRemove:l,canMoveUp:r>=P.length+1,canMoveDown:l&&r<N.length-1,itemSchema:u,itemData:o,itemUiSchema:h,itemIdSchema:f,itemErrorSchema:s?s[r]:void 0,autofocus:b&&0===r,onBlur:x,onFocus:T,rawErrors:w})})),onAddClick:this.onAddClick,readonly:S,required:D,registry:k,schema:a,uiSchema:i,title:B,formContext:q,rawErrors:w},j=r.getTemplate("ArrayFieldTemplate",k,I);return f.default.createElement(j,C({},R))},i.renderArrayFieldItem=function(e){var t=e.key,a=e.index,n=e.name,i=e.canRemove,o=void 0===i||i,l=e.canMoveUp,s=void 0===l||l,d=e.canMoveDown,u=void 0===d||d,c=e.itemSchema,m=e.itemData,p=e.itemUiSchema,h=e.itemIdSchema,v=e.itemErrorSchema,g=e.autofocus,y=e.onBlur,S=e.onFocus,E=e.rawErrors,b=this.props,C=b.disabled,F=b.hideError,D=b.idPrefix,k=b.idSeparator,x=b.readonly,T=b.registry,w=b.formContext,O=T.fields,A=O.ArraySchemaField||O.SchemaField,N=r.getUiOptions(b.uiSchema),B=N.orderable,I=void 0===B||B,U=N.removable,q={moveUp:I&&s,moveDown:I&&u,remove:(void 0===U||U)&&o,toolbar:!1};return q.toolbar=Object.keys(q).some((function(e){return q[e]})),{children:f.default.createElement(A,{name:n,index:a,schema:c,uiSchema:p,formData:m,formContext:w,errorSchema:v,idPrefix:D,idSeparator:k,idSchema:h,required:this.isItemRequired(c),onChange:this.onChangeForIndex(a),onBlur:y,onFocus:S,registry:T,disabled:C,readonly:x,hideError:F,autofocus:g,rawErrors:E}),className:"array-item",disabled:C,hasToolbar:q.toolbar,hasMoveUp:q.moveUp,hasMoveDown:q.moveDown,hasRemove:q.remove,index:a,key:t,onAddIndexClick:this.onAddIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:x,registry:T,schema:c,uiSchema:p}},a=t,(n=[{key:"itemTitle",get:function(){var e=this.props.schema;return p.default(e,[r.ITEMS_KEY,"title"],p.default(e,[r.ITEMS_KEY,"description"],"Item"))}}])&&function(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}(a.prototype,n),Object.defineProperty(a,"prototype",{writable:!1}),t}(t.Component),U=["widget"];function q(e){var t,a=e.schema,n=e.name,i=e.uiSchema,o=e.idSchema,l=e.formData,s=e.registry,d=e.required,u=e.disabled,c=e.readonly,m=e.autofocus,p=e.onChange,h=e.onFocus,v=e.onBlur,y=e.rawErrors,S=a.title,E=s.widgets,b=s.formContext,F=r.getUiOptions(i),D=F.widget,x=void 0===D?"checkbox":D,T=k(F,U),w=r.getWidget(a,x,E);if(Array.isArray(a.oneOf))t=r.optionsList({oneOf:a.oneOf.map((function(e){if(g.default(e))return C({},e,{title:e.title||(!0===e.const?"Yes":"No")})})).filter((function(e){return e}))});else{var O,A=a,N=null!=(O=a.enum)?O:[!0,!1];t=!A.enumNames&&2===N.length&&N.every((function(e){return"boolean"==typeof e}))?[{value:N[0],label:N[0]?"Yes":"No"},{value:N[1],label:N[1]?"Yes":"No"}]:r.optionsList({enum:N,enumNames:A.enumNames})}return f.default.createElement(w,{options:C({},T,{enumOptions:t}),schema:a,uiSchema:i,id:o&&o.$id,onChange:p,onFocus:h,onBlur:v,label:void 0===S?n:S,value:l,required:d,disabled:u,readonly:c,registry:s,formContext:b,autofocus:m,rawErrors:y})}var P=["widget"],_=function(e){function t(t){var a;(a=e.call(this,t)||this).onOptionChange=function(e){var t=parseInt(e,10),n=a.props,i=n.formData,o=n.onChange,l=n.options,s=n.registry.schemaUtils,d=s.retrieveSchema(l[t],i),u=void 0;if("object"===r.guessType(i)&&("object"===d.type||d.properties)){u=Object.assign({},i);var c=l.slice();c.splice(t,1);for(var m,f=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return x(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(e,t):void 0}}(e))){r&&(e=r);var a=0;return function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(c);!(m=f()).done;){var p=m.value;if(p.properties)for(var h in p.properties)h in u&&S.default(u,h)}}o(s.getDefaultFormState(l[t],u,"excludeObjectChildren"),void 0,a.getFieldId()),a.setState({selectedOption:parseInt(e,10)})};var n=a.props;return a.state={selectedOption:a.getMatchingOption(0,n.formData,n.options)},a}F(t,e);var a=t.prototype;return a.componentDidUpdate=function(e,t){var a=this.props,n=a.formData,i=a.options,o=a.idSchema,l=this.state.selectedOption;if(!r.deepEquals(n,e.formData)&&o.$id===e.idSchema.$id){var s=this.getMatchingOption(l,n,i);if(!t||s===l)return;this.setState({selectedOption:s})}},a.getMatchingOption=function(e,t,r){var a=this.props.registry.schemaUtils.getMatchingOption(t,r);return 0!==a?a:e||0},a.getFieldId=function(){var e=this.props;return e.idSchema.$id+(e.schema.oneOf?"__oneof_select":"__anyof_select")},a.render=function(){var e,t=this.props,a=t.name,n=t.baseType,i=t.disabled,o=void 0!==i&&i,l=t.readonly,s=void 0!==l&&l,d=t.hideError,u=void 0!==d&&d,c=t.errorSchema,m=void 0===c?{}:c,p=t.formData,h=t.formContext,v=t.idPrefix,g=t.idSeparator,y=t.idSchema,S=t.onBlur,E=t.onChange,b=t.onFocus,F=t.options,D=t.registry,x=t.uiSchema,T=D.widgets,w=D.fields.SchemaField,O=this.state.selectedOption,A=r.getUiOptions(x),N=A.widget,B=void 0===N?"select":N,I=k(A,P),U=r.getWidget({type:"number"},B,T),q=F[O]||null;q&&(e=q.type?q:Object.assign({},q,{type:n}));var _=F.map((function(e,t){return{label:e.title||"Option "+(t+1),value:t}}));return f.default.createElement("div",{className:"panel panel-default panel-body"},f.default.createElement("div",{className:"form-group"},f.default.createElement(U,C({id:this.getFieldId(),schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:S,onFocus:b,value:O,options:{enumOptions:_},registry:D,formContext:h},I,{label:""}))),null!==q&&f.default.createElement(w,{name:a,schema:e,uiSchema:x,errorSchema:m,idSchema:y,idPrefix:v,idSeparator:g,formData:p,formContext:h,onChange:E,onBlur:S,onFocus:b,registry:D,disabled:o,readonly:s,hideError:u}))},t}(t.Component),R=/\.([0-9]*0)*$/,j=/[0.]0*$/;function V(e){var a=e.registry,n=e.onChange,i=e.formData,o=t.useState(e.value),l=o[0],s=o[1],d=a.fields.StringField,u=i,c=t.useCallback((function(e){s(e),"."===(""+e).charAt(0)&&(e="0"+e);var t="string"==typeof e&&e.match(R)?r.asNumber(e.replace(j,"")):r.asNumber(e);n(t)}),[n]);if("string"==typeof l&&"number"==typeof u){var m=new RegExp((""+u).replace(".","\\.")+"\\.?0*$");l.match(m)&&(u=l)}return f.default.createElement(d,C({},e,{formData:u,onChange:c}))}var M=function(e){function t(){for(var t,a=arguments.length,n=new Array(a),i=0;i<a;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).state={wasPropertyKeyModified:!1,additionalProperties:{}},t.onPropertyChange=function(e,r){return void 0===r&&(r=!1),function(a,n,i){var o,l,s=t.props,d=s.errorSchema;void 0===a&&r&&(a=""),(0,s.onChange)(C({},s.formData,((o={})[e]=a,o)),d&&d&&C({},d,((l={})[e]=n,l)),i)}},t.onDropPropertyClick=function(e){return function(r){r.preventDefault();var a=t.props,n=a.onChange,i=C({},a.formData);S.default(i,e),n(i)}},t.getAvailableKey=function(e,a){for(var n=r.getUiOptions(t.props.uiSchema).duplicateKeySuffixSeparator,i=void 0===n?"-":n,o=0,l=e;l in a;)l=""+e+i+ ++o;return l},t.onKeyChange=function(e){return function(r,a){var n,i;if(e!==r){var o=t.props,l=o.formData,s=o.onChange,d=o.errorSchema;r=t.getAvailableKey(r,l);var u=C({},l),c=((n={})[e]=r,n),m=Object.keys(u).map((function(e){var t;return(t={})[c[e]||e]=u[e],t})),f=Object.assign.apply(Object,[{}].concat(m));t.setState({wasPropertyKeyModified:!0}),s(f,d&&d&&C({},d,((i={})[r]=a,i)))}}},t.handleAddClick=function(e){return function(){if(e.additionalProperties){var a=t.props,n=a.formData,i=a.onChange,o=a.registry,l=C({},n),s=void 0;g.default(e.additionalProperties)&&(s=e.additionalProperties.type,r.REF_KEY in e.additionalProperties&&(s=o.schemaUtils.retrieveSchema({$ref:e.additionalProperties[r.REF_KEY]},n).type));var d=t.getAvailableKey("newKey",l);y.default(l,d,t.getDefaultValue(s)),i(l)}}},t}F(t,e);var a=t.prototype;return a.isRequired=function(e){var t=this.props.schema;return Array.isArray(t.required)&&-1!==t.required.indexOf(e)},a.getDefaultValue=function(e){switch(e){case"string":default:return"New Value";case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{}}},a.render=function(){var e,t=this,a=this.props,n=a.uiSchema,i=void 0===n?{}:n,o=a.formData,l=a.errorSchema,s=a.idSchema,d=a.name,u=a.required,c=void 0!==u&&u,m=a.disabled,h=void 0!==m&&m,v=a.readonly,g=void 0!==v&&v,y=a.hideError,S=a.idPrefix,b=a.idSeparator,F=a.onBlur,D=a.onFocus,k=a.registry,x=k.formContext,T=k.fields.SchemaField,w=k.schemaUtils.retrieveSchema(a.schema,o),O=r.getUiOptions(i),A=w.properties,N=void 0===A?{}:A,B=void 0===w.title?d:w.title,I=O.description||w.description;try{var U=Object.keys(N);e=r.orderProperties(U,O.order)}catch(e){return f.default.createElement("div",null,f.default.createElement("p",{className:"config-error",style:{color:"red"}},"Invalid ",d||"root"," object field configuration:",f.default.createElement("em",null,e.message),"."),f.default.createElement("pre",null,JSON.stringify(w)))}var q=r.getTemplate("ObjectFieldTemplate",k,O),P={title:O.title||B,description:I,properties:e.map((function(e){var a=E.default(w,[r.PROPERTIES_KEY,e,r.ADDITIONAL_PROPERTY_FLAG]),n=a?i.additionalProperties:i[e],d="hidden"===r.getUiOptions(n).widget,u=p.default(s,[e],{});return{content:f.default.createElement(T,{key:e,name:e,required:t.isRequired(e),schema:p.default(w,[r.PROPERTIES_KEY,e],{}),uiSchema:n,errorSchema:p.default(l,e),idSchema:u,idPrefix:S,idSeparator:b,formData:p.default(o,e),formContext:x,wasPropertyKeyModified:t.state.wasPropertyKeyModified,onKeyChange:t.onKeyChange(e),onChange:t.onPropertyChange(e,a),onBlur:F,onFocus:D,registry:k,disabled:h,readonly:g,hideError:y,onDropPropertyClick:t.onDropPropertyClick}),name:e,readonly:g,disabled:h,required:c,hidden:d}})),readonly:g,disabled:h,required:c,idSchema:s,uiSchema:i,schema:w,formData:o,formContext:x,registry:k};return f.default.createElement(q,C({},P,{onAddClick:this.handleAddClick}))},t}(t.Component),K=["__errors"],W={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function L(e){var t=e.schema,a=e.idSchema,n=e.uiSchema,i=e.formData,o=e.errorSchema,l=e.idPrefix,s=e.idSeparator,d=e.name,u=e.onChange,c=e.onKeyChange,m=e.onDropPropertyClick,p=e.required,h=e.registry,v=e.wasPropertyKeyModified,y=void 0!==v&&v,S=h.formContext,E=h.schemaUtils,F=r.getUiOptions(n),D=r.getTemplate("FieldTemplate",h,F),x=r.getTemplate("DescriptionFieldTemplate",h,F),T=r.getTemplate("FieldHelpTemplate",h,F),w=r.getTemplate("FieldErrorTemplate",h,F),O=E.retrieveSchema(t,i),A=a[r.ID_KEY],N=r.mergeObjects(E.toIdSchema(O,A,i,l,s),a),B=f.default.useCallback((function(e,t,r){return u(e,t,r||A)}),[A,u]),I=function(e,t,a,n){var i=t.field,o=n.fields;if("function"==typeof i)return i;if("string"==typeof i&&i in o)return o[i];var l=r.getSchemaType(e),s=Array.isArray(l)?l[0]:l||"",d=W[s];return d||!e.anyOf&&!e.oneOf?d in o?o[d]:function(){var i=r.getTemplate("UnsupportedFieldTemplate",n,t);return f.default.createElement(i,{schema:e,idSchema:a,reason:"Unknown field type "+e.type,registry:n})}:function(){return null}}(O,F,N,h),U=Boolean(e.disabled||F.disabled),q=Boolean(e.readonly||F.readonly||e.schema.readOnly||O.readOnly),P=F.hideError,_=void 0===P?e.hideError:Boolean(P),R=Boolean(e.autofocus||F.autofocus);if(0===Object.keys(O).length)return null;var j=E.getDisplayLabel(O,n),V=o||{},M=V.__errors,L=k(V,K),$=b.default(n,["ui:classNames","classNames"]);"ui:options"in $&&($["ui:options"]=b.default($["ui:options"],["classNames"]));var Y,z=f.default.createElement(I,C({},e,{onChange:B,idSchema:N,schema:O,uiSchema:$,disabled:U,readonly:q,hideError:_,autofocus:R,errorSchema:L,formContext:S,rawErrors:M})),H=N[r.ID_KEY];Y=y||r.ADDITIONAL_PROPERTY_FLAG in O?d:F.title||e.schema.title||O.title||d;var J=F.description||e.schema.description||O.description||"",G=F.help,Q="hidden"===F.widget,X=["form-group","field","field-"+O.type];!_&&M&&M.length>0&&X.push("field-error has-error has-danger"),null!=n&&n.classNames&&X.push(n.classNames),F.classNames&&X.push(F.classNames);var Z=f.default.createElement(T,{help:G,idSchema:N,schema:O,uiSchema:n,hasErrors:!_&&M&&M.length>0,registry:h}),ee=_?void 0:f.default.createElement(w,{errors:M,errorSchema:o,idSchema:N,schema:O,uiSchema:n,registry:h}),te={description:f.default.createElement(x,{id:H+"__description",description:J,schema:O,uiSchema:n,registry:h}),rawDescription:J,help:Z,rawHelp:"string"==typeof G?G:void 0,errors:ee,rawErrors:_?void 0:M,id:H,label:Y,hidden:Q,onChange:u,onKeyChange:c,onDropPropertyClick:m,required:p,disabled:U,readonly:q,hideError:_,displayLabel:j,classNames:X.join(" ").trim(),formContext:S,formData:i,schema:O,uiSchema:n,registry:h},re=h.fields.AnyOfField,ae=h.fields.OneOfField;return f.default.createElement(D,C({},te),f.default.createElement(f.default.Fragment,null,z,O.anyOf&&!(null!=n&&n["ui:field"])&&!E.isSelect(O)&&f.default.createElement(re,{name:d,disabled:U,readonly:q,hideError:_,errorSchema:o,formData:i,formContext:S,idPrefix:l,idSchema:N,idSeparator:s,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:O.anyOf.map((function(e){return E.retrieveSchema(g.default(e)?e:{},i)})),baseType:O.type,registry:h,schema:O,uiSchema:n}),O.oneOf&&!(null!=n&&n["ui:field"])&&!E.isSelect(O)&&f.default.createElement(ae,{name:d,disabled:U,readonly:q,hideError:_,errorSchema:o,formData:i,formContext:S,idPrefix:l,idSchema:N,idSeparator:s,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:O.oneOf.map((function(e){return E.retrieveSchema(g.default(e)?e:{},i)})),baseType:O.type,registry:h,schema:O,uiSchema:n})))}var $=function(e){function t(){return e.apply(this,arguments)||this}F(t,e);var a=t.prototype;return a.shouldComponentUpdate=function(e){return!r.deepEquals(this.props,e)},a.render=function(){return f.default.createElement(L,C({},this.props))},t}(f.default.Component),Y=["widget","placeholder"];function z(e){var t=e.schema,a=e.name,n=e.uiSchema,i=e.idSchema,o=e.formData,l=e.required,s=e.disabled,d=void 0!==s&&s,u=e.readonly,c=void 0!==u&&u,m=e.autofocus,p=void 0!==m&&m,h=e.onChange,v=e.onBlur,g=e.onFocus,y=e.registry,S=e.rawErrors,E=t.title,b=t.format,F=y.widgets,D=y.formContext,x=y.schemaUtils.isSelect(t)?r.optionsList(t):void 0,T=x?"select":"text";b&&r.hasWidget(t,b,F)&&(T=b);var w=r.getUiOptions(n),O=w.widget,A=void 0===O?T:O,N=w.placeholder,B=void 0===N?"":N,I=k(w,Y),U=r.getWidget(t,A,F);return f.default.createElement(U,{options:C({},I,{enumOptions:x}),schema:t,uiSchema:n,id:i&&i.$id,label:void 0===E?a:E,value:o,onChange:h,onBlur:v,onFocus:g,required:l,disabled:d,readonly:c,formContext:D,autofocus:p,registry:y,placeholder:B,rawErrors:S})}function H(e){var r=e.formData,a=e.onChange;return t.useEffect((function(){void 0===r&&a(null)}),[r,a]),null}function J(e){var t=e.idSchema,a=e.description,n=e.registry,i=e.schema,o=e.uiSchema,l=r.getUiOptions(o),s=l.label;if(!a||void 0!==s&&!s)return null;var d=r.getTemplate("DescriptionFieldTemplate",n,l);return f.default.createElement(d,{id:t.$id+"__description",description:a,schema:i,uiSchema:o,registry:n})}function G(e){var t=e.disabled,r=e.hasToolbar,a=e.hasMoveDown,n=e.hasMoveUp,i=e.hasRemove,o=e.index,l=e.onDropIndexClick,s=e.onReorderClick,d=e.readonly,u=e.uiSchema,c=e.registry.templates.ButtonTemplates,m=c.MoveDownButton,p=c.MoveUpButton,h=c.RemoveButton,v={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return f.default.createElement("div",{className:e.className},f.default.createElement("div",{className:r?"col-xs-9":"col-xs-12"},e.children),r&&f.default.createElement("div",{className:"col-xs-3 array-item-toolbox"},f.default.createElement("div",{className:"btn-group",style:{display:"flex",justifyContent:"space-around"}},(n||a)&&f.default.createElement(p,{style:v,disabled:t||d||!n,onClick:s(o,o-1),uiSchema:u}),(n||a)&&f.default.createElement(m,{style:v,disabled:t||d||!a,onClick:s(o,o+1),uiSchema:u}),i&&f.default.createElement(h,{style:v,disabled:t||d,onClick:l(o),uiSchema:u}))))}var Q=["key"];function X(e){var t=e.canAdd,a=e.className,n=e.disabled,i=e.idSchema,o=e.uiSchema,l=e.items,s=e.onAddClick,d=e.readonly,u=e.registry,c=e.required,m=e.schema,p=e.title,h=r.getUiOptions(o),v=r.getTemplate("ArrayFieldDescriptionTemplate",u,h),g=r.getTemplate("ArrayFieldItemTemplate",u,h),y=r.getTemplate("ArrayFieldTitleTemplate",u,h),S=u.templates.ButtonTemplates.AddButton;return f.default.createElement("fieldset",{className:a,id:i.$id},f.default.createElement(y,{idSchema:i,title:h.title||p,required:c,schema:m,uiSchema:o,registry:u}),f.default.createElement(v,{idSchema:i,description:h.description||m.description,schema:m,uiSchema:o,registry:u}),f.default.createElement("div",{className:"row array-item-list"},l&&l.map((function(e){var t=e.key,r=k(e,Q);return f.default.createElement(g,C({key:t},r))}))),t&&f.default.createElement(S,{className:"array-item-add",onClick:s,disabled:n||d,uiSchema:o}))}function Z(e){var t=e.idSchema,a=e.title,n=e.schema,i=e.uiSchema,o=e.required,l=e.registry,s=r.getUiOptions(i),d=s.label;if(!a||void 0!==d&&!d)return null;var u=r.getTemplate("TitleFieldTemplate",l,s);return f.default.createElement(u,{id:t.$id+"__title",title:a,required:o,schema:n,uiSchema:i,registry:l})}var ee=["id","value","readonly","disabled","autofocus","onBlur","onFocus","onChange","options","schema","uiSchema","formContext","registry","rawErrors","type"];function te(e){var a=e.id,n=e.value,i=e.readonly,o=e.disabled,l=e.autofocus,s=e.onBlur,d=e.onFocus,u=e.onChange,c=e.options,m=e.schema,p=e.type,h=k(e,ee);if(!a)throw console.log("No id for",e),new Error("no id for props "+JSON.stringify(e));var v,g=C({},h,r.getInputProps(m,p,c));v="number"===g.type||"integer"===g.type?n||0===n?n:"":null==n?"":n;var y=t.useCallback((function(e){var t=e.target.value;return u(""===t?c.emptyValue:t)}),[u,c]),S=t.useCallback((function(e){return s(a,e.target.value)}),[s,a]),E=t.useCallback((function(e){return d(a,e.target.value)}),[d,a]);return f.default.createElement(f.default.Fragment,null,f.default.createElement("input",C({id:a,name:a,className:"form-control",readOnly:i,disabled:o,autoFocus:l,value:v},g,{list:m.examples?"examples_"+a:void 0,onChange:y,onBlur:S,onFocus:E})),Array.isArray(m.examples)&&f.default.createElement("datalist",{key:"datalist_"+a,id:"examples_"+a},[].concat(new Set(m.examples.concat(m.default?[m.default]:[]))).map((function(e){return f.default.createElement("option",{key:e,value:e})}))))}function re(e){var t=r.getSubmitButtonOptions(e.uiSchema),a=t.submitText,n=t.props,i=void 0===n?{}:n;return t.norender?null:f.default.createElement("div",null,f.default.createElement("button",C({type:"submit"},i,{className:"btn btn-info "+i.className}),a))}var ae=["iconType","icon","className","uiSchema"];function ne(e){var t=e.iconType,r=void 0===t?"default":t,a=e.icon,n=e.className,i=k(e,ae);return f.default.createElement("button",C({type:"button",className:"btn btn-"+r+" "+n},i),f.default.createElement("i",{className:"glyphicon glyphicon-"+a}))}function ie(e){return f.default.createElement(ne,C({title:"Move down",className:"array-item-move-down"},e,{icon:"arrow-down"}))}function oe(e){return f.default.createElement(ne,C({title:"Move up",className:"array-item-move-up"},e,{icon:"arrow-up"}))}function le(e){return f.default.createElement(ne,C({title:"Remove",className:"array-item-remove"},e,{iconType:"danger",icon:"remove"}))}function se(e){return f.default.createElement("div",{className:"row"},f.default.createElement("p",{className:"col-xs-3 col-xs-offset-9 text-right "+e.className},f.default.createElement(ne,{iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:"Add",onClick:e.onClick,disabled:e.disabled})))}function de(e){var t=e.description;return t?f.default.createElement("string"==typeof t?"p":"div",{id:e.id,className:"field-description"},t):null}function ue(e){var t=e.errors;return f.default.createElement("div",{className:"panel panel-danger errors"},f.default.createElement("div",{className:"panel-heading"},f.default.createElement("h3",{className:"panel-title"},"Errors")),f.default.createElement("ul",{className:"list-group"},t.map((function(e,t){return f.default.createElement("li",{key:t,className:"list-group-item text-danger"},e.stack)}))))}function ce(e){var t=e.label;return t?f.default.createElement("label",{className:"control-label",htmlFor:e.id},t,e.required&&f.default.createElement("span",{className:"required"},"*")):null}function me(e){var t=e.id,a=e.label,n=e.children,i=e.errors,o=e.help,l=e.description,s=e.hidden,d=e.required,u=e.displayLabel,c=e.registry,m=r.getUiOptions(e.uiSchema),p=r.getTemplate("WrapIfAdditionalTemplate",c,m);return s?f.default.createElement("div",{className:"hidden"},n):f.default.createElement(p,C({},e),u&&f.default.createElement(ce,{label:a,required:d,id:t}),u&&l?l:null,n,i,o)}function fe(e){var t=e.errors,r=void 0===t?[]:t;return 0===r.length?null:f.default.createElement("div",null,f.default.createElement("ul",{id:e.idSchema.$id+"__error",className:"error-detail bs-callout bs-callout-info"},r.filter((function(e){return!!e})).map((function(e,t){return f.default.createElement("li",{className:"text-danger",key:t},e)}))))}function pe(e){var t=e.help;return t?f.default.createElement("string"==typeof t?"p":"div",{id:e.idSchema.$id+"__help",className:"help-block"},t):null}function he(e){var t=e.description,a=e.disabled,n=e.formData,i=e.idSchema,o=e.onAddClick,l=e.properties,s=e.readonly,d=e.registry,u=e.required,c=e.schema,m=e.title,p=e.uiSchema,h=r.getUiOptions(p),v=r.getTemplate("TitleFieldTemplate",d,h),g=r.getTemplate("DescriptionFieldTemplate",d,h),y=d.templates.ButtonTemplates.AddButton;return f.default.createElement("fieldset",{id:i.$id},(h.title||m)&&f.default.createElement(v,{id:i.$id+"__title",title:h.title||m,required:u,schema:c,uiSchema:p,registry:d}),(h.description||t)&&f.default.createElement(g,{id:i.$id+"__description",description:h.description||t,schema:c,uiSchema:p,registry:d}),l.map((function(e){return e.content})),r.canExpand(c,p,n)&&f.default.createElement(y,{className:"object-property-expand",onClick:o(c),disabled:a||s,uiSchema:p}))}function ve(e){return f.default.createElement("legend",{id:e.id},e.title,e.required&&f.default.createElement("span",{className:"required"},"*"))}function ge(e){var t=e.schema,r=e.idSchema,a=e.reason;return f.default.createElement("div",{className:"unsupported-field"},f.default.createElement("p",null,"Unsupported field schema",r&&r.$id&&f.default.createElement("span",null," for"," field ",f.default.createElement("code",null,r.$id)),a&&f.default.createElement("em",null,": ",a),"."),t&&f.default.createElement("pre",null,JSON.stringify(t,null,2)))}function ye(e){var t=e.id,a=e.disabled,n=e.label,i=e.onKeyChange,o=e.onDropPropertyClick,l=e.readonly,s=e.children,d=e.uiSchema,u=e.registry.templates.ButtonTemplates.RemoveButton;return f.default.createElement("div",{className:e.classNames},r.ADDITIONAL_PROPERTY_FLAG in e.schema?f.default.createElement("div",{className:"row"},f.default.createElement("div",{className:"col-xs-5 form-additional"},f.default.createElement("div",{className:"form-group"},f.default.createElement(ce,{label:n+" Key",required:e.required,id:t+"-key"}),f.default.createElement("input",{className:"form-control",type:"text",id:t+"-key",onBlur:function(e){return i(e.target.value)},defaultValue:n}))),f.default.createElement("div",{className:"form-additional form-group col-xs-5"},s),f.default.createElement("div",{className:"col-xs-2"},f.default.createElement(u,{className:"array-item-remove btn-block",style:{border:"0"},disabled:a||l,onClick:o(n),uiSchema:d}))):s)}function Se(e,t){for(var a=[],n=e;n<=t;n++)a.push({value:n,label:r.pad(n,2)});return a}function Ee(e){var t=e.type,r=e.range,a=e.value,n=e.select,i=e.disabled,o=e.readonly,l=e.autofocus,s=e.registry,d=e.onBlur,u=e.onFocus;return f.default.createElement(s.widgets.SelectWidget,{schema:{type:"integer"},id:e.rootId+"_"+t,className:"form-control",options:{enumOptions:Se(r[0],r[1])},placeholder:t,value:a,disabled:i,readonly:o,autofocus:l,onChange:function(e){return n(t,e)},onBlur:d,onFocus:u,registry:s,label:""})}function be(e){var a=e.time,n=void 0!==a&&a,i=e.disabled,o=void 0!==i&&i,l=e.readonly,s=void 0!==l&&l,d=e.autofocus,u=void 0!==d&&d,c=e.options,m=e.id,p=e.registry,h=e.onBlur,v=e.onFocus,g=e.onChange,y=e.value,S=t.useReducer((function(e,t){return C({},e,t)}),r.parseDateString(y,n)),E=S[0],b=S[1];t.useEffect((function(){y&&y!==r.toDateString(E,n)&&b(r.parseDateString(y,n))}),[y,E,n]),t.useEffect((function(){(function(e){return Object.values(e).every((function(e){return-1!==e}))})(E)&&g(r.toDateString(E,n))}),[E,n,g]);var F=t.useCallback((function(e,t){var r;b(((r={})[e]=t,r))}),[]),D=t.useCallback((function(e){if(e.preventDefault(),!o&&!s){var t=r.parseDateString((new Date).toJSON(),n);b(t)}}),[o,s,n]),k=t.useCallback((function(e){e.preventDefault(),o||s||(b(r.parseDateString("",n)),g(void 0))}),[o,s,n,g]);return f.default.createElement("ul",{className:"list-inline"},function(e,t,r){void 0===r&&(r=[1900,(new Date).getFullYear()+2]);var a=[{type:"year",range:r,value:e.year},{type:"month",range:[1,12],value:e.month},{type:"day",range:[1,31],value:e.day}];return t&&a.push({type:"hour",range:[0,23],value:e.hour},{type:"minute",range:[0,59],value:e.minute},{type:"second",range:[0,59],value:e.second}),a}(E,n,c.yearsRange).map((function(e,t){return f.default.createElement("li",{key:t},f.default.createElement(Ee,C({rootId:m,select:F},e,{disabled:o,readonly:s,registry:p,onBlur:h,onFocus:v,autofocus:u&&0===t})))})),("undefined"===c.hideNowButton||!c.hideNowButton)&&f.default.createElement("li",null,f.default.createElement("a",{href:"#",className:"btn btn-info btn-now",onClick:D},"Now")),("undefined"===c.hideClearButton||!c.hideClearButton)&&f.default.createElement("li",null,f.default.createElement("a",{href:"#",className:"btn btn-warning btn-clear",onClick:k},"Clear")))}var Ce=["time"];function Fe(e){var t=e.time,r=void 0===t||t,a=k(e,Ce);return f.default.createElement(a.registry.widgets.AltDateWidget,C({time:r},a))}function De(e){var a=e.schema,n=e.uiSchema,i=e.id,o=e.value,l=e.disabled,s=e.readonly,d=e.label,u=e.autofocus,c=void 0!==u&&u,m=e.onBlur,p=e.onFocus,h=e.onChange,v=e.registry,g=r.getTemplate("DescriptionFieldTemplate",v,e.options),y=r.schemaRequiresTrueValue(a),S=t.useCallback((function(e){return h(e.target.checked)}),[h]),E=t.useCallback((function(e){return m(i,e.target.checked)}),[m,i]),b=t.useCallback((function(e){return p(i,e.target.checked)}),[p,i]);return f.default.createElement("div",{className:"checkbox "+(l||s?"disabled":"")},a.description&&f.default.createElement(g,{id:i+"__description",description:a.description,schema:a,uiSchema:n,registry:v}),f.default.createElement("label",null,f.default.createElement("input",{type:"checkbox",id:i,name:i,checked:void 0!==o&&o,required:y,disabled:l||s,autoFocus:c,onChange:S,onBlur:E,onFocus:b}),f.default.createElement("span",null,d)))}function ke(e){var t=e.id,r=e.disabled,a=e.options,n=a.inline,i=void 0!==n&&n,o=a.enumOptions,l=a.enumDisabled,s=e.value,d=e.autofocus,u=void 0!==d&&d,c=e.readonly,m=e.onChange;return f.default.createElement("div",{className:"checkboxes",id:t},Array.isArray(o)&&o.map((function(e,a){var n=-1!==s.indexOf(e.value),d=Array.isArray(l)&&-1!=l.indexOf(e.value),p=r||d||c?"disabled":"",h=f.default.createElement("span",null,f.default.createElement("input",{type:"checkbox",id:t+"-"+e.value,name:t,checked:n,disabled:r||d||c,autoFocus:u&&0===a,onChange:function(t){var r=o.map((function(e){return e.value}));m(t.target.checked?function(e,t,r){var a=r.indexOf(e);return t.slice(0,a).concat(e,t.slice(a)).sort((function(e,t){return Number(r.indexOf(e)>r.indexOf(t))}))}(e.value,s,r):function(e,t){return t.filter((function(t){return t!==e}))}(e.value,s))}}),f.default.createElement("span",null,e.label));return i?f.default.createElement("label",{key:e.value,className:"checkbox-inline "+p},h):f.default.createElement("div",{key:e.value,className:"checkbox "+p},f.default.createElement("label",null,h))})))}function xe(e){var t=e.disabled,a=e.readonly,n=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(n,C({type:"color"},e,{disabled:t||a}))}function Te(e){var a=e.onChange,n=r.getTemplate("BaseInputTemplate",e.registry,e.options),i=t.useCallback((function(e){return a(e||void 0)}),[a]);return f.default.createElement(n,C({type:"date"},e,{onChange:i}))}function we(e){var t=e.onChange,a=e.value,n=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(n,C({type:"datetime-local"},e,{value:r.utcToLocal(a),onChange:function(e){return t(r.localToUTC(e))}}))}function Oe(e){var t=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(t,C({type:"email"},e))}function Ae(e,t){return null===e?null:e.replace(";base64",";name="+encodeURIComponent(t)+";base64")}function Ne(e){var t=e.name,r=e.size,a=e.type;return new Promise((function(n,i){var o=new window.FileReader;o.onerror=i,o.onload=function(e){var i;"string"==typeof(null===(i=e.target)||void 0===i?void 0:i.result)?n({dataURL:Ae(e.target.result,t),name:t,size:r,type:a}):n({dataURL:null,name:t,size:r,type:a})},o.readAsDataURL(e)}))}function Be(e){var t=e.filesInfo;return 0===t.length?null:f.default.createElement("ul",{className:"file-info"},t.map((function(e,t){var r=e.size,a=e.type;return f.default.createElement("li",{key:t},f.default.createElement("strong",null,e.name)," (",a,", ",r," bytes)")})))}function Ie(e){return e.filter((function(e){return void 0!==e})).map((function(e){var t=r.dataURItoBlob(e),a=t.blob;return{name:t.name,size:a.size,type:a.type}}))}function Ue(e){var r=e.multiple,a=e.id,n=e.readonly,i=e.disabled,o=e.onChange,l=e.value,s=e.autofocus,d=void 0!==s&&s,u=e.options,c=t.useMemo((function(){return Array.isArray(l)?Ie(l):Ie([l])}),[l]),m=t.useState(c),p=m[0],h=m[1],v=t.useCallback((function(e){var t;e.target.files&&(t=e.target.files,Promise.all(Array.from(t).map(Ne))).then((function(e){h(e);var t=e.map((function(e){return e.dataURL}));o(r?t:t[0])}))}),[r,o]);return f.default.createElement("div",null,f.default.createElement("p",null,f.default.createElement("input",{id:a,name:a,type:"file",disabled:n||i,onChange:v,defaultValue:"",autoFocus:d,multiple:r,accept:u.accept?String(u.accept):void 0})),f.default.createElement(Be,{filesInfo:p}))}function qe(e){var t=e.id,r=e.value;return f.default.createElement("input",{type:"hidden",id:t,name:t,value:void 0===r?"":r})}function Pe(e){var t=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(t,C({type:"password"},e))}function _e(e){var r=e.options,a=e.value,n=e.required,i=e.disabled,o=e.readonly,l=e.autofocus,s=void 0!==l&&l,d=e.onBlur,u=e.onFocus,c=e.onChange,m=e.id,p=Math.random().toString(),h=r.enumOptions,v=r.enumDisabled,g=r.inline,y=t.useCallback((function(e){return d(m,e.target.value)}),[d,m]),S=t.useCallback((function(e){return u(m,e.target.value)}),[u,m]);return f.default.createElement("div",{className:"field-radio-group",id:m},Array.isArray(h)&&h.map((function(e,t){var r=e.value===a,l=Array.isArray(v)&&-1!=v.indexOf(e.value),d=i||l||o?"disabled":"",u=f.default.createElement("span",null,f.default.createElement("input",{type:"radio",id:m+"-"+e.value,checked:r,name:p,required:n,value:e.value,disabled:i||l||o,autoFocus:s&&0===t,onChange:function(){return c(e.value)},onBlur:y,onFocus:S}),f.default.createElement("span",null,e.label));return g?f.default.createElement("label",{key:e.value,className:"radio-inline "+d},u):f.default.createElement("div",{key:e.value,className:"radio "+d},f.default.createElement("label",null,u))})))}function Re(e){var t=e.value;return f.default.createElement("div",{className:"field-range-wrapper"},f.default.createElement(e.registry.templates.BaseInputTemplate,C({type:"range"},e)),f.default.createElement("span",{className:"range-view"},t))}function je(e,t){return t?Array.from(e.target.options).slice().filter((function(e){return e.selected})).map((function(e){return e.value})):e.target.value}function Ve(e){var a=e.schema,n=e.id,i=e.options,o=e.value,l=e.required,s=e.disabled,d=e.readonly,u=e.multiple,c=void 0!==u&&u,m=e.autofocus,p=void 0!==m&&m,h=e.onChange,v=e.onBlur,g=e.onFocus,y=e.placeholder,S=i.enumOptions,E=i.enumDisabled,b=c?[]:"",C=t.useCallback((function(e){var t=je(e,c);return g(n,r.processSelectValue(a,t,i))}),[g,n,a,c,i]),F=t.useCallback((function(e){var t=je(e,c);return v(n,r.processSelectValue(a,t,i))}),[v,n,a,c,i]),D=t.useCallback((function(e){var t=je(e,c);return h(r.processSelectValue(a,t,i))}),[h,a,c,i]);return f.default.createElement("select",{id:n,name:n,multiple:c,className:"form-control",value:void 0===o?b:o,required:l,disabled:s||d,autoFocus:p,onBlur:F,onFocus:C,onChange:D},!c&&void 0===a.default&&f.default.createElement("option",{value:""},y),Array.isArray(S)&&S.map((function(e,t){var r=e.value,a=e.label,n=E&&-1!=E.indexOf(r);return f.default.createElement("option",{key:t,value:r,disabled:n},a)})))}function Me(e){var r=e.id,a=e.options,n=void 0===a?{}:a,i=e.placeholder,o=e.value,l=e.required,s=e.disabled,d=e.readonly,u=e.autofocus,c=void 0!==u&&u,m=e.onChange,p=e.onBlur,h=e.onFocus,v=t.useCallback((function(e){var t=e.target.value;return m(""===t?n.emptyValue:t)}),[m,n.emptyValue]),g=t.useCallback((function(e){return p(r,e.target.value)}),[p,r]),y=t.useCallback((function(e){return h(r,e.target.value)}),[r,h]);return f.default.createElement("textarea",{id:r,name:r,className:"form-control",value:o||"",placeholder:i,required:l,disabled:s,readOnly:d,autoFocus:c,rows:n.rows,onBlur:g,onFocus:y,onChange:v})}function Ke(e){var t=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(t,C({},e))}function We(e){var t=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(t,C({type:"url"},e))}function Le(e){var t=r.getTemplate("BaseInputTemplate",e.registry,e.options);return f.default.createElement(t,C({type:"number"},e))}function $e(){return{fields:{AnyOfField:_,ArrayField:I,BooleanField:q,NumberField:V,ObjectField:M,OneOfField:_,SchemaField:$,StringField:z,NullField:H},templates:{ArrayFieldDescriptionTemplate:J,ArrayFieldItemTemplate:G,ArrayFieldTemplate:X,ArrayFieldTitleTemplate:Z,ButtonTemplates:{SubmitButton:re,AddButton:se,MoveDownButton:ie,MoveUpButton:oe,RemoveButton:le},BaseInputTemplate:te,DescriptionFieldTemplate:de,ErrorListTemplate:ue,FieldTemplate:me,FieldErrorTemplate:fe,FieldHelpTemplate:pe,ObjectFieldTemplate:he,TitleFieldTemplate:ve,UnsupportedFieldTemplate:ge,WrapIfAdditionalTemplate:ye},widgets:{PasswordWidget:Pe,RadioWidget:_e,UpDownWidget:Le,RangeWidget:Re,SelectWidget:Ve,TextWidget:Ke,DateWidget:Te,DateTimeWidget:we,AltDateWidget:be,AltDateTimeWidget:Fe,EmailWidget:Oe,URLWidget:We,TextareaWidget:Me,HiddenWidget:qe,ColorWidget:xe,FileWidget:Ue,CheckboxWidget:De,CheckboxesWidget:ke},rootSchema:{},formContext:{}}}Me.defaultProps={autofocus:!1,options:{}};var Ye=function(e){function t(t){var a;if((a=e.call(this,t)||this).formElement=void 0,a.getUsedFormData=function(e,t){if(0===t.length&&"object"!=typeof e)return e;var r=v.default(e,t);return Array.isArray(e)?Object.keys(r).map((function(e){return r[e]})):r},a.getFieldNames=function(e,t){return function e(a,n,i){return void 0===n&&(n=[]),void 0===i&&(i=[[]]),Object.keys(a).forEach((function(o){if("object"==typeof a[o]){var l=i.map((function(e){return[].concat(e,[o])}));a[o][r.RJSF_ADDITONAL_PROPERTIES_FLAG]&&""!==a[o][r.NAME_KEY]?n.push(a[o][r.NAME_KEY]):e(a[o],n,l)}else o===r.NAME_KEY&&""!==a[o]&&i.forEach((function(e){var r=p.default(t,e);("object"!=typeof r||h.default(r))&&n.push(e)}))})),n}(e)},a.onChange=function(e,t,n){var i=a.props,o=i.extraErrors,l=i.omitExtraData,s=i.liveOmit,d=i.noValidate,u=i.liveValidate,c=i.onChange,m=a.state,f=m.schemaUtils,p=m.schema;(r.isObject(e)||Array.isArray(e))&&(e=a.getStateFromProps(a.props,e).formData);var h=!d&&u,v={formData:e,schema:p},g=e;if(!0===l&&!0===s){var y=f.retrieveSchema(p,e),S=f.toPathSchema(y,"",e),E=a.getFieldNames(S,e);g=a.getUsedFormData(e,E),v={formData:g}}if(h){var b=a.validate(g),F=b.errors,D=b.errorSchema,k=F,x=D;if(o){var T=f.mergeValidationData(b,o);D=T.errorSchema,F=T.errors}v={formData:g,errors:F,errorSchema:D,schemaValidationErrors:k,schemaValidationErrorSchema:x}}else if(!d&&t){var w=o?r.mergeObjects(t,o,"preventDuplicates"):t;v={formData:g,errorSchema:w,errors:f.getValidator().toErrorList(w)}}a.setState(v,(function(){return c&&c(C({},a.state,v),n)}))},a.onBlur=function(e,t){var r=a.props.onBlur;r&&r(e,t)},a.onFocus=function(e,t){var r=a.props.onFocus;r&&r(e,t)},a.onSubmit=function(e){if(e.preventDefault(),e.target===e.currentTarget){e.persist();var t=a.props,r=t.extraErrors,n=t.noValidate,i=t.onSubmit,o=a.state.formData,l=a.state,s=l.schemaUtils;if(!0===t.omitExtraData){var d=s.retrieveSchema(l.schema,o),u=s.toPathSchema(d,"",o),c=a.getFieldNames(u,o);o=a.getUsedFormData(o,c)}if(n||a.validateForm()){var m=r||{},f=r?s.getValidator().toErrorList(r):[];a.setState({formData:o,errors:f,errorSchema:m,schemaValidationErrors:[],schemaValidationErrorSchema:{}},(function(){i&&i(C({},a.state,{formData:o,status:"submitted"}),e)}))}}},!t.validator)throw new Error("A validator is required for Form functionality to work");return a.state=a.getStateFromProps(t,t.formData),a.props.onChange&&!r.deepEquals(a.state.formData,a.props.formData)&&a.props.onChange(a.state),a.formElement=f.default.createRef(),a}F(t,e);var a=t.prototype;return a.UNSAFE_componentWillReceiveProps=function(e){var t=this.getStateFromProps(e,e.formData);r.deepEquals(t.formData,e.formData)||r.deepEquals(t.formData,this.state.formData)||!e.onChange||e.onChange(t),this.setState(t)},a.getStateFromProps=function(e,t){var a=this.state||{},n="schema"in e?e.schema:this.props.schema,i=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},o=void 0!==t,l=o&&!e.noValidate&&("liveValidate"in e?e.liveValidate:this.props.liveValidate),s=n,d=a.schemaUtils;d&&!d.doesSchemaUtilsDiffer(e.validator,s)||(d=r.createSchemaUtils(e.validator,s));var u,c,m=d.getDefaultFormState(n,t),f=d.retrieveSchema(n,m),p=a.schemaValidationErrors,h=a.schemaValidationErrorSchema;if(l){var v=this.validate(m,n,d);p=u=v.errors,h=c=v.errorSchema}else{var g=e.noValidate?{errors:[],errorSchema:{}}:e.liveValidate?{errors:a.errors||[],errorSchema:a.errorSchema||{}}:{errors:a.schemaValidationErrors||[],errorSchema:a.schemaValidationErrorSchema||{}};u=g.errors,c=g.errorSchema}if(e.extraErrors){var y=d.mergeValidationData({errorSchema:c,errors:u},e.extraErrors);c=y.errorSchema,u=y.errors}var S=d.toIdSchema(f,i["ui:rootFieldId"],m,e.idPrefix,e.idSeparator);return{schemaUtils:d,schema:n,uiSchema:i,idSchema:S,formData:m,edit:o,errors:u,errorSchema:c,schemaValidationErrors:p,schemaValidationErrorSchema:h}},a.shouldComponentUpdate=function(e,t){return r.shouldRender(this,e,t)},a.validate=function(e,t,r){void 0===t&&(t=this.props.schema);var a=r||this.state.schemaUtils,n=this.props,i=n.customValidate,o=n.transformErrors,l=a.retrieveSchema(t,e);return a.getValidator().validateFormData(e,l,i,o)},a.renderErrors=function(e){var t=this.state,a=t.errors,n=t.errorSchema,i=t.schema,o=t.uiSchema,l=this.props.formContext,s=r.getUiOptions(o),d=r.getTemplate("ErrorListTemplate",e,s);return a&&a.length?f.default.createElement(d,{errors:a,errorSchema:n||{},schema:i,uiSchema:o,formContext:l}):null},a.getRegistry=function(){var e,t=this.state.schemaUtils,r=$e(),a=r.templates,n=r.widgets,i=r.formContext;return{fields:C({},r.fields,this.props.fields),templates:C({},a,this.props.templates,{ButtonTemplates:C({},a.ButtonTemplates,null===(e=this.props.templates)||void 0===e?void 0:e.ButtonTemplates)}),widgets:C({},n,this.props.widgets),rootSchema:this.props.schema,formContext:this.props.formContext||i,schemaUtils:t}},a.submit=function(){this.formElement.current&&(this.formElement.current.dispatchEvent(new CustomEvent("submit",{cancelable:!0})),this.formElement.current.requestSubmit())},a.validateForm=function(){var e=this.props,t=e.extraErrors,r=e.onError,a=this.state.schemaUtils,n=this.validate(this.state.formData),i=n.errors,o=n.errorSchema,l=i,s=o;if(i.length>0){if(t){var d=a.mergeValidationData(n,t);o=d.errorSchema,i=d.errors}return this.setState({errors:i,errorSchema:o,schemaValidationErrors:l,schemaValidationErrorSchema:s},(function(){r?r(i):console.error("Form validation failed",i)})),!1}return!0},a.render=function(){var e=this.props,t=e.children,r=e.id,a=e.idPrefix,n=e.idSeparator,i=e.className,o=void 0===i?"":i,l=e.tagName,s=e.name,d=e.method,u=e.target,c=e.action,m=e.autoComplete,p=e.enctype,h=e.acceptcharset,v=e.noHtml5Validate,g=void 0!==v&&v,y=e.disabled,S=void 0!==y&&y,E=e.readonly,b=void 0!==E&&E,C=e.formContext,F=e.showErrorList,D=void 0===F?"top":F,k=e._internalFormWrapper,x=this.state,T=x.schema,w=x.uiSchema,O=x.formData,A=x.errorSchema,N=x.idSchema,B=this.getRegistry(),I=B.fields.SchemaField,U=B.templates.ButtonTemplates.SubmitButton;return f.default.createElement(k||l||"form",{className:o||"rjsf",id:r,name:s,method:d,target:u,action:c,autoComplete:m,encType:p,acceptCharset:h,noValidate:g,onSubmit:this.onSubmit,as:k?l:void 0,ref:this.formElement},"top"===D&&this.renderErrors(B),f.default.createElement(I,{name:"",schema:T,uiSchema:w,errorSchema:A,idSchema:N,idPrefix:a,idSeparator:n,formContext:C,formData:O,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:B,disabled:S,readonly:b}),t||f.default.createElement(U,{uiSchema:w}),"bottom"===D&&this.renderErrors(B))},t}(t.Component),ze=["fields","widgets","templates"];e.default=Ye,e.getDefaultRegistry=$e,e.withTheme=function(e){return t.forwardRef((function(t,r){var a,n,i=t.fields,o=t.widgets,l=t.templates,s=k(t,ze);return i=C({},e.fields,i),o=C({},e.widgets,o),l=C({},e.templates,l,{ButtonTemplates:C({},null==e||null===(a=e.templates)||void 0===a?void 0:a.ButtonTemplates,null===(n=l)||void 0===n?void 0:n.ButtonTemplates)}),f.default.createElement(Ye,C({},e,s,{fields:i,widgets:o,templates:l,ref:r}))}))},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=core.umd.production.min.js.map |
{ | ||
"name": "@rjsf/core", | ||
"version": "5.0.0-beta.14", | ||
"version": "5.0.0-beta.15", | ||
"description": "A simple React component capable of building HTML forms out of a JSON schema.", | ||
@@ -55,5 +55,5 @@ "scripts": { | ||
"@babel/register": "^7.18.9", | ||
"@rjsf/utils": "^5.0.0-beta.14", | ||
"@rjsf/validator-ajv6": "^5.0.0-beta.14", | ||
"@rjsf/validator-ajv8": "^5.0.0-beta.14", | ||
"@rjsf/utils": "^5.0.0-beta.15", | ||
"@rjsf/validator-ajv6": "^5.0.0-beta.15", | ||
"@rjsf/validator-ajv8": "^5.0.0-beta.15", | ||
"@types/lodash": "^4.14.186", | ||
@@ -97,3 +97,3 @@ "@types/react": "^17.0.39", | ||
}, | ||
"gitHead": "a0f9a938e4551a42d5c94f8673b13b937279cdc5" | ||
"gitHead": "965c0e41f1ab1261bbc1f9a1e9f64fc526426087" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1960574
11894