@remoteoss/json-schema-form 1.0.0-dev.20260807093222 → 1.0.0-dev.20260911145618

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- var ha=Object.create;var jr=Object.defineProperty;var ga=Object.getOwnPropertyDescriptor;var ya=Object.getOwnPropertyNames;var ba=Object.getPrototypeOf,Oa=Object.prototype.hasOwnProperty;var u=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var Sa=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of ya(r))!Oa.call(e,i)&&i!==t&&jr(e,i,{get:()=>r[i],enumerable:!(n=ga(r,i))||n.enumerable});return e};var I=(e,r,t)=>(t=e!=null?ha(ba(e)):{},Sa(r||!e||!e.__esModule?jr(t,"default",{value:e,enumerable:!0}):t,e));var Y=u((Xh,_r)=>{"use strict";_r.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}});var Be=u(A=>{"use strict";var g=Y(),$e=()=>[{type:g.RANGE,from:48,to:57}],Rr=()=>[{type:g.CHAR,value:95},{type:g.RANGE,from:97,to:122},{type:g.RANGE,from:65,to:90}].concat($e()),Vr=()=>[{type:g.CHAR,value:9},{type:g.CHAR,value:10},{type:g.CHAR,value:11},{type:g.CHAR,value:12},{type:g.CHAR,value:13},{type:g.CHAR,value:32},{type:g.CHAR,value:160},{type:g.CHAR,value:5760},{type:g.RANGE,from:8192,to:8202},{type:g.CHAR,value:8232},{type:g.CHAR,value:8233},{type:g.CHAR,value:8239},{type:g.CHAR,value:8287},{type:g.CHAR,value:12288},{type:g.CHAR,value:65279}],xa=()=>[{type:g.CHAR,value:10},{type:g.CHAR,value:13},{type:g.CHAR,value:8232},{type:g.CHAR,value:8233}];A.words=()=>({type:g.SET,set:Rr(),not:!1});A.notWords=()=>({type:g.SET,set:Rr(),not:!0});A.ints=()=>({type:g.SET,set:$e(),not:!1});A.notInts=()=>({type:g.SET,set:$e(),not:!0});A.whitespace=()=>({type:g.SET,set:Vr(),not:!1});A.notWhitespace=()=>({type:g.SET,set:Vr(),not:!0});A.anyChar=()=>({type:g.SET,set:xa(),not:!0})});var Fr=u(X=>{"use strict";var Jr=Y(),J=Be(),va="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",Ea={0:0,t:9,n:10,v:11,f:12,r:13};X.strToChars=function(e){var r=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return e=e.replace(r,function(t,n,i,o,s,a,f,l){if(i)return t;var c=n?8:o?parseInt(o,16):s?parseInt(s,16):a?parseInt(a,8):f?va.indexOf(f):Ea[l],p=String.fromCharCode(c);return/[[\]{}^$.|?*+()]/.test(p)&&(p="\\"+p),p}),e};X.tokenizeClass=(e,r)=>{for(var t=[],n=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,i,o;(i=n.exec(e))!=null;)if(i[1])t.push(J.words());else if(i[2])t.push(J.ints());else if(i[3])t.push(J.whitespace());else if(i[4])t.push(J.notWords());else if(i[5])t.push(J.notInts());else if(i[6])t.push(J.notWhitespace());else if(i[7])t.push({type:Jr.RANGE,from:(i[8]||i[9]).charCodeAt(0),to:i[10].charCodeAt(0)});else if(o=i[12])t.push({type:Jr.CHAR,value:o.charCodeAt(0)});else return[t,n.lastIndex];X.error(r,"Unterminated character class")};X.error=(e,r)=>{throw new SyntaxError("Invalid regular expression: /"+e+"/: "+r)}});var Pr=u(Z=>{"use strict";var be=Y();Z.wordBoundary=()=>({type:be.POSITION,value:"b"});Z.nonWordBoundary=()=>({type:be.POSITION,value:"B"});Z.begin=()=>({type:be.POSITION,value:"^"});Z.end=()=>({type:be.POSITION,value:"$"})});var Nr=u((rg,He)=>{"use strict";var F=Fr(),v=Y(),q=Be(),Oe=Pr();He.exports=e=>{var r=0,t,n,i={type:v.ROOT,stack:[]},o=i,s=i.stack,a=[],f=De=>{F.error(e,`Nothing to repeat at column ${De-1}`)},l=F.strToChars(e);for(t=l.length;r<t;)switch(n=l[r++],n){case"\\":switch(n=l[r++],n){case"b":s.push(Oe.wordBoundary());break;case"B":s.push(Oe.nonWordBoundary());break;case"w":s.push(q.words());break;case"W":s.push(q.notWords());break;case"d":s.push(q.ints());break;case"D":s.push(q.notInts());break;case"s":s.push(q.whitespace());break;case"S":s.push(q.notWhitespace());break;default:/\d/.test(n)?s.push({type:v.REFERENCE,value:parseInt(n,10)}):s.push({type:v.CHAR,value:n.charCodeAt(0)})}break;case"^":s.push(Oe.begin());break;case"$":s.push(Oe.end());break;case"[":var c;l[r]==="^"?(c=!0,r++):c=!1;var p=F.tokenizeClass(l.slice(r),e);r+=p[1],s.push({type:v.SET,set:p[0],not:c});break;case".":s.push(q.anyChar());break;case"(":var d={type:v.GROUP,stack:[],remember:!0};n=l[r],n==="?"&&(n=l[r+1],r+=2,n==="="?d.followedBy=!0:n==="!"?d.notFollowedBy=!0:n!==":"&&F.error(e,`Invalid group, character '${n}' after '?' at column ${r-1}`),d.remember=!1),s.push(d),a.push(o),o=d,s=d.stack;break;case")":a.length===0&&F.error(e,`Unmatched ) at column ${r-1}`),o=a.pop(),s=o.options?o.options[o.options.length-1]:o.stack;break;case"|":o.options||(o.options=[o.stack],delete o.stack);var m=[];o.options.push(m),s=m;break;case"{":var h=/^(\d+)(,(\d+)?)?\}/.exec(l.slice(r)),w,ye;h!==null?(s.length===0&&f(r),w=parseInt(h[1],10),ye=h[2]?h[3]?parseInt(h[3],10):1/0:w,r+=h[0].length,s.push({type:v.REPETITION,min:w,max:ye,value:s.pop()})):s.push({type:v.CHAR,value:123});break;case"?":s.length===0&&f(r),s.push({type:v.REPETITION,min:0,max:1,value:s.pop()});break;case"+":s.length===0&&f(r),s.push({type:v.REPETITION,min:1,max:1/0,value:s.pop()});break;case"*":s.length===0&&f(r),s.push({type:v.REPETITION,min:0,max:1/0,value:s.pop()});break;default:s.push({type:v.CHAR,value:n.charCodeAt(0)})}return a.length!==0&&F.error(e,"Unterminated group"),i};He.exports.types=v});var Lr=u((tg,Mr)=>{"use strict";var P=class e{constructor(r,t){this.low=r,this.high=t,this.length=1+t-r}overlaps(r){return!(this.high<r.low||this.low>r.high)}touches(r){return!(this.high+1<r.low||this.low-1>r.high)}add(r){return new e(Math.min(this.low,r.low),Math.max(this.high,r.high))}subtract(r){return r.low<=this.low&&r.high>=this.high?[]:r.low>this.low&&r.high<this.high?[new e(this.low,r.low-1),new e(r.high+1,this.high)]:r.low<=this.low?[new e(r.high+1,this.high)]:[new e(this.low,r.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}},Ue=class e{constructor(r,t){this.ranges=[],this.length=0,r!=null&&this.add(r,t)}_update_length(){this.length=this.ranges.reduce((r,t)=>r+t.length,0)}add(r,t){var n=i=>{for(var o=0;o<this.ranges.length&&!i.touches(this.ranges[o]);)o++;for(var s=this.ranges.slice(0,o);o<this.ranges.length&&i.touches(this.ranges[o]);)i=i.add(this.ranges[o]),o++;s.push(i),this.ranges=s.concat(this.ranges.slice(o)),this._update_length()};return r instanceof e?r.ranges.forEach(n):(t==null&&(t=r),n(new P(r,t))),this}subtract(r,t){var n=i=>{for(var o=0;o<this.ranges.length&&!i.overlaps(this.ranges[o]);)o++;for(var s=this.ranges.slice(0,o);o<this.ranges.length&&i.overlaps(this.ranges[o]);)s=s.concat(this.ranges[o].subtract(i)),o++;this.ranges=s.concat(this.ranges.slice(o)),this._update_length()};return r instanceof e?r.ranges.forEach(n):(t==null&&(t=r),n(new P(r,t))),this}intersect(r,t){var n=[],i=o=>{for(var s=0;s<this.ranges.length&&!o.overlaps(this.ranges[s]);)s++;for(;s<this.ranges.length&&o.overlaps(this.ranges[s]);){var a=Math.max(this.ranges[s].low,o.low),f=Math.min(this.ranges[s].high,o.high);n.push(new P(a,f)),s++}};return r instanceof e?r.ranges.forEach(i):(t==null&&(t=r),i(new P(r,t))),this.ranges=n,this._update_length(),this}index(r){for(var t=0;t<this.ranges.length&&this.ranges[t].length<=r;)r-=this.ranges[t].length,t++;return this.ranges[t].low+r}toString(){return"[ "+this.ranges.join(", ")+" ]"}clone(){return new e(this)}numbers(){return this.ranges.reduce((r,t)=>{for(var n=t.low;n<=t.high;)r.push(n),n++;return r},[])}subranges(){return this.ranges.map(r=>({low:r.low,high:r.high,length:1+r.high-r.low}))}};Mr.exports=Ue});var $r=u((ng,Dr)=>{"use strict";var Se=Nr(),Q=Lr(),C=Se.types;Dr.exports=class ee{constructor(r,t){if(this._setDefaults(r),r instanceof RegExp)this.ignoreCase=r.ignoreCase,this.multiline=r.multiline,r=r.source;else if(typeof r=="string")this.ignoreCase=t&&t.indexOf("i")!==-1,this.multiline=t&&t.indexOf("m")!==-1;else throw new Error("Expected a regexp or string");this.tokens=Se(r)}_setDefaults(r){this.max=r.max!=null?r.max:ee.prototype.max!=null?ee.prototype.max:100,this.defaultRange=r.defaultRange?r.defaultRange:this.defaultRange.clone(),r.randInt&&(this.randInt=r.randInt)}gen(){return this._gen(this.tokens,[])}_gen(r,t){var n,i,o,s,a;switch(r.type){case C.ROOT:case C.GROUP:if(r.followedBy||r.notFollowedBy)return"";for(r.remember&&r.groupNumber===void 0&&(r.groupNumber=t.push(null)-1),n=r.options?this._randSelect(r.options):r.stack,i="",s=0,a=n.length;s<a;s++)i+=this._gen(n[s],t);return r.remember&&(t[r.groupNumber]=i),i;case C.POSITION:return"";case C.SET:var f=this._expand(r);return f.length?String.fromCharCode(this._randSelect(f)):"";case C.REPETITION:for(o=this.randInt(r.min,r.max===1/0?r.min+this.max:r.max),i="",s=0;s<o;s++)i+=this._gen(r.value,t);return i;case C.REFERENCE:return t[r.value-1]||"";case C.CHAR:var l=this.ignoreCase&&this._randBool()?this._toOtherCase(r.value):r.value;return String.fromCharCode(l)}}_toOtherCase(r){return r+(97<=r&&r<=122?-32:65<=r&&r<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(r){return r instanceof Q?r.index(this.randInt(0,r.length-1)):r[this.randInt(0,r.length-1)]}_expand(r){if(r.type===Se.types.CHAR)return new Q(r.value);if(r.type===Se.types.RANGE)return new Q(r.from,r.to);{let t=new Q;for(let n=0;n<r.set.length;n++){let i=this._expand(r.set[n]);if(t.add(i),this.ignoreCase)for(let o=0;o<i.length;o++){let s=i.index(o),a=this._toOtherCase(s);s!==a&&t.add(a)}}return r.not?this.defaultRange.clone().subtract(t):this.defaultRange.clone().intersect(t)}}randInt(r,t){return r+Math.floor(Math.random()*(1+t-r))}get defaultRange(){return this._range=this._range||new Q(32,126)}set defaultRange(r){this._range=r}static randexp(r,t){var n;return typeof r=="string"&&(r=new RegExp(r,t)),r._randexp===void 0?(n=new ee(r,t),r._randexp=n):(n=r._randexp,n._setDefaults(r)),n.gen()}static sugar(){RegExp.prototype.gen=function(){return ee.randexp(this)}}}});var et=u((fg,Qr)=>{"use strict";var ja=function(r){return _a(r)&&!Ra(r)};function _a(e){return!!e&&typeof e=="object"}function Ra(e){var r=Object.prototype.toString.call(e);return r==="[object RegExp]"||r==="[object Date]"||Fa(e)}var Va=typeof Symbol=="function"&&Symbol.for,Ja=Va?Symbol.for("react.element"):60103;function Fa(e){return e.$$typeof===Ja}function Pa(e){return Array.isArray(e)?[]:{}}function re(e,r){return r.clone!==!1&&r.isMergeableObject(e)?M(Pa(e),e,r):e}function Na(e,r,t){return e.concat(r).map(function(n){return re(n,t)})}function Ma(e,r){if(!r.customMerge)return M;var t=r.customMerge(e);return typeof t=="function"?t:M}function La(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(r){return Object.propertyIsEnumerable.call(e,r)}):[]}function Xr(e){return Object.keys(e).concat(La(e))}function Zr(e,r){try{return r in e}catch{return!1}}function Da(e,r){return Zr(e,r)&&!(Object.hasOwnProperty.call(e,r)&&Object.propertyIsEnumerable.call(e,r))}function $a(e,r,t){var n={};return t.isMergeableObject(e)&&Xr(e).forEach(function(i){n[i]=re(e[i],t)}),Xr(r).forEach(function(i){Da(e,i)||(Zr(e,i)&&t.isMergeableObject(r[i])?n[i]=Ma(i,t)(e[i],r[i],t):n[i]=re(r[i],t))}),n}function M(e,r,t){t=t||{},t.arrayMerge=t.arrayMerge||Na,t.isMergeableObject=t.isMergeableObject||ja,t.cloneUnlessOtherwiseSpecified=re;var n=Array.isArray(r),i=Array.isArray(e),o=n===i;return o?n?t.arrayMerge(e,r,t):$a(e,r,t):re(r,t)}M.all=function(r,t){if(!Array.isArray(r))throw new Error("first argument should be an array");return r.reduce(function(n,i){return M(n,i,t)},{})};var Ba=M;Qr.exports=Ba});var rr=u((gy,At)=>{"use strict";var Ou=typeof global=="object"&&global&&global.Object===Object&&global;At.exports=Ou});var _=u((yy,qt)=>{"use strict";var Su=rr(),xu=typeof self=="object"&&self&&self.Object===Object&&self,vu=Su||xu||Function("return this")();qt.exports=vu});var oe=u((by,Ct)=>{"use strict";var Eu=_(),Tu=Eu.Symbol;Ct.exports=Tu});var Vt=u((Oy,Rt)=>{"use strict";var jt=oe(),_t=Object.prototype,wu=_t.hasOwnProperty,Iu=_t.toString,se=jt?jt.toStringTag:void 0;function Au(e){var r=wu.call(e,se),t=e[se];try{e[se]=void 0;var n=!0}catch{}var i=Iu.call(e);return n&&(r?e[se]=t:delete e[se]),i}Rt.exports=Au});var Ft=u((Sy,Jt)=>{"use strict";var qu=Object.prototype,Cu=qu.toString;function ju(e){return Cu.call(e)}Jt.exports=ju});var D=u((xy,Mt)=>{"use strict";var Pt=oe(),_u=Vt(),Ru=Ft(),Vu="[object Null]",Ju="[object Undefined]",Nt=Pt?Pt.toStringTag:void 0;function Fu(e){return e==null?e===void 0?Ju:Vu:Nt&&Nt in Object(e)?_u(e):Ru(e)}Mt.exports=Fu});var T=u((vy,Lt)=>{"use strict";function Pu(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}Lt.exports=Pu});var Ie=u((Ey,Dt)=>{"use strict";var Nu=D(),Mu=T(),Lu="[object AsyncFunction]",Du="[object Function]",$u="[object GeneratorFunction]",Bu="[object Proxy]";function Hu(e){if(!Mu(e))return!1;var r=Nu(e);return r==Du||r==$u||r==Lu||r==Bu}Dt.exports=Hu});var Bt=u((Ty,$t)=>{"use strict";var Uu=_(),Gu=Uu["__core-js_shared__"];$t.exports=Gu});var Gt=u((wy,Ut)=>{"use strict";var tr=Bt(),Ht=function(){var e=/[^.]+$/.exec(tr&&tr.keys&&tr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function zu(e){return!!Ht&&Ht in e}Ut.exports=zu});var kt=u((Iy,zt)=>{"use strict";var ku=Function.prototype,Wu=ku.toString;function Ku(e){if(e!=null){try{return Wu.call(e)}catch{}try{return e+""}catch{}}return""}zt.exports=Ku});var Kt=u((Ay,Wt)=>{"use strict";var Yu=Ie(),Xu=Gt(),Zu=T(),Qu=kt(),ef=/[\\^$.*+?()[\]{}|]/g,rf=/^\[object .+?Constructor\]$/,tf=Function.prototype,nf=Object.prototype,of=tf.toString,sf=nf.hasOwnProperty,af=RegExp("^"+of.call(sf).replace(ef,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function uf(e){if(!Zu(e)||Xu(e))return!1;var r=Yu(e)?af:rf;return r.test(Qu(e))}Wt.exports=uf});var Xt=u((qy,Yt)=>{"use strict";function ff(e,r){return e?.[r]}Yt.exports=ff});var Ae=u((Cy,Zt)=>{"use strict";var lf=Kt(),cf=Xt();function pf(e,r){var t=cf(e,r);return lf(t)?t:void 0}Zt.exports=pf});var ae=u((jy,Qt)=>{"use strict";var df=Ae(),mf=df(Object,"create");Qt.exports=mf});var tn=u((_y,rn)=>{"use strict";var en=ae();function hf(){this.__data__=en?en(null):{},this.size=0}rn.exports=hf});var on=u((Ry,nn)=>{"use strict";function gf(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}nn.exports=gf});var an=u((Vy,sn)=>{"use strict";var yf=ae(),bf="__lodash_hash_undefined__",Of=Object.prototype,Sf=Of.hasOwnProperty;function xf(e){var r=this.__data__;if(yf){var t=r[e];return t===bf?void 0:t}return Sf.call(r,e)?r[e]:void 0}sn.exports=xf});var fn=u((Jy,un)=>{"use strict";var vf=ae(),Ef=Object.prototype,Tf=Ef.hasOwnProperty;function wf(e){var r=this.__data__;return vf?r[e]!==void 0:Tf.call(r,e)}un.exports=wf});var cn=u((Fy,ln)=>{"use strict";var If=ae(),Af="__lodash_hash_undefined__";function qf(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=If&&r===void 0?Af:r,this}ln.exports=qf});var dn=u((Py,pn)=>{"use strict";var Cf=tn(),jf=on(),_f=an(),Rf=fn(),Vf=cn();function $(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}$.prototype.clear=Cf;$.prototype.delete=jf;$.prototype.get=_f;$.prototype.has=Rf;$.prototype.set=Vf;pn.exports=$});var hn=u((Ny,mn)=>{"use strict";function Jf(){this.__data__=[],this.size=0}mn.exports=Jf});var ue=u((My,gn)=>{"use strict";function Ff(e,r){return e===r||e!==e&&r!==r}gn.exports=Ff});var fe=u((Ly,yn)=>{"use strict";var Pf=ue();function Nf(e,r){for(var t=e.length;t--;)if(Pf(e[t][0],r))return t;return-1}yn.exports=Nf});var On=u((Dy,bn)=>{"use strict";var Mf=fe(),Lf=Array.prototype,Df=Lf.splice;function $f(e){var r=this.__data__,t=Mf(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Df.call(r,t,1),--this.size,!0}bn.exports=$f});var xn=u(($y,Sn)=>{"use strict";var Bf=fe();function Hf(e){var r=this.__data__,t=Bf(r,e);return t<0?void 0:r[t][1]}Sn.exports=Hf});var En=u((By,vn)=>{"use strict";var Uf=fe();function Gf(e){return Uf(this.__data__,e)>-1}vn.exports=Gf});var wn=u((Hy,Tn)=>{"use strict";var zf=fe();function kf(e,r){var t=this.__data__,n=zf(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}Tn.exports=kf});var le=u((Uy,In)=>{"use strict";var Wf=hn(),Kf=On(),Yf=xn(),Xf=En(),Zf=wn();function B(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}B.prototype.clear=Wf;B.prototype.delete=Kf;B.prototype.get=Yf;B.prototype.has=Xf;B.prototype.set=Zf;In.exports=B});var nr=u((Gy,An)=>{"use strict";var Qf=Ae(),el=_(),rl=Qf(el,"Map");An.exports=rl});var jn=u((zy,Cn)=>{"use strict";var qn=dn(),tl=le(),nl=nr();function il(){this.size=0,this.__data__={hash:new qn,map:new(nl||tl),string:new qn}}Cn.exports=il});var Rn=u((ky,_n)=>{"use strict";function ol(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}_n.exports=ol});var ce=u((Wy,Vn)=>{"use strict";var sl=Rn();function al(e,r){var t=e.__data__;return sl(r)?t[typeof r=="string"?"string":"hash"]:t.map}Vn.exports=al});var Fn=u((Ky,Jn)=>{"use strict";var ul=ce();function fl(e){var r=ul(this,e).delete(e);return this.size-=r?1:0,r}Jn.exports=fl});var Nn=u((Yy,Pn)=>{"use strict";var ll=ce();function cl(e){return ll(this,e).get(e)}Pn.exports=cl});var Ln=u((Xy,Mn)=>{"use strict";var pl=ce();function dl(e){return pl(this,e).has(e)}Mn.exports=dl});var $n=u((Zy,Dn)=>{"use strict";var ml=ce();function hl(e,r){var t=ml(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}Dn.exports=hl});var qe=u((Qy,Bn)=>{"use strict";var gl=jn(),yl=Fn(),bl=Nn(),Ol=Ln(),Sl=$n();function H(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}H.prototype.clear=gl;H.prototype.delete=yl;H.prototype.get=bl;H.prototype.has=Ol;H.prototype.set=Sl;Bn.exports=H});var Un=u((eb,Hn)=>{"use strict";var xl="__lodash_hash_undefined__";function vl(e){return this.__data__.set(e,xl),this}Hn.exports=vl});var zn=u((rb,Gn)=>{"use strict";function El(e){return this.__data__.has(e)}Gn.exports=El});var ir=u((tb,kn)=>{"use strict";var Tl=qe(),wl=Un(),Il=zn();function Ce(e){var r=-1,t=e==null?0:e.length;for(this.__data__=new Tl;++r<t;)this.add(e[r])}Ce.prototype.add=Ce.prototype.push=wl;Ce.prototype.has=Il;kn.exports=Ce});var Kn=u((nb,Wn)=>{"use strict";function Al(e,r,t,n){for(var i=e.length,o=t+(n?1:-1);n?o--:++o<i;)if(r(e[o],o,e))return o;return-1}Wn.exports=Al});var Xn=u((ib,Yn)=>{"use strict";function ql(e){return e!==e}Yn.exports=ql});var Qn=u((ob,Zn)=>{"use strict";function Cl(e,r,t){for(var n=t-1,i=e.length;++n<i;)if(e[n]===r)return n;return-1}Zn.exports=Cl});var ri=u((sb,ei)=>{"use strict";var jl=Kn(),_l=Xn(),Rl=Qn();function Vl(e,r,t){return r===r?Rl(e,r,t):jl(e,_l,t)}ei.exports=Vl});var or=u((ab,ti)=>{"use strict";var Jl=ri();function Fl(e,r){var t=e==null?0:e.length;return!!t&&Jl(e,r,0)>-1}ti.exports=Fl});var sr=u((ub,ni)=>{"use strict";function Pl(e,r,t){for(var n=-1,i=e==null?0:e.length;++n<i;)if(t(r,e[n]))return!0;return!1}ni.exports=Pl});var pe=u((fb,ii)=>{"use strict";function Nl(e,r){for(var t=-1,n=e==null?0:e.length,i=Array(n);++t<n;)i[t]=r(e[t],t,e);return i}ii.exports=Nl});var je=u((lb,oi)=>{"use strict";function Ml(e){return function(r){return e(r)}}oi.exports=Ml});var ar=u((cb,si)=>{"use strict";function Ll(e,r){return e.has(r)}si.exports=Ll});var ui=u((pb,ai)=>{"use strict";var Dl=ir(),$l=or(),Bl=sr(),Hl=pe(),Ul=je(),Gl=ar(),zl=200;function kl(e,r,t,n){var i=-1,o=$l,s=!0,a=e.length,f=[],l=r.length;if(!a)return f;t&&(r=Hl(r,Ul(t))),n?(o=Bl,s=!1):r.length>=zl&&(o=Gl,s=!1,r=new Dl(r));e:for(;++i<a;){var c=e[i],p=t==null?c:t(c);if(c=n||c!==0?c:0,s&&p===p){for(var d=l;d--;)if(r[d]===p)continue e;f.push(c)}else o(r,p,n)||f.push(c)}return f}ai.exports=kl});var li=u((db,fi)=>{"use strict";function Wl(e,r){for(var t=-1,n=r.length,i=e.length;++t<n;)e[i+t]=r[t];return e}fi.exports=Wl});var R=u((mb,ci)=>{"use strict";function Kl(e){return e!=null&&typeof e=="object"}ci.exports=Kl});var di=u((hb,pi)=>{"use strict";var Yl=D(),Xl=R(),Zl="[object Arguments]";function Ql(e){return Xl(e)&&Yl(e)==Zl}pi.exports=Ql});var _e=u((gb,gi)=>{"use strict";var mi=di(),ec=R(),hi=Object.prototype,rc=hi.hasOwnProperty,tc=hi.propertyIsEnumerable,nc=mi(function(){return arguments}())?mi:function(e){return ec(e)&&rc.call(e,"callee")&&!tc.call(e,"callee")};gi.exports=nc});var V=u((yb,yi)=>{"use strict";var ic=Array.isArray;yi.exports=ic});var xi=u((bb,Si)=>{"use strict";var bi=oe(),oc=_e(),sc=V(),Oi=bi?bi.isConcatSpreadable:void 0;function ac(e){return sc(e)||oc(e)||!!(Oi&&e&&e[Oi])}Si.exports=ac});var Ti=u((Ob,Ei)=>{"use strict";var uc=li(),fc=xi();function vi(e,r,t,n,i){var o=-1,s=e.length;for(t||(t=fc),i||(i=[]);++o<s;){var a=e[o];r>0&&t(a)?r>1?vi(a,r-1,t,n,i):uc(i,a):n||(i[i.length]=a)}return i}Ei.exports=vi});var ur=u((Sb,wi)=>{"use strict";function lc(e){return e}wi.exports=lc});var Ai=u((xb,Ii)=>{"use strict";function cc(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)}Ii.exports=cc});var ji=u((vb,Ci)=>{"use strict";var pc=Ai(),qi=Math.max;function dc(e,r,t){return r=qi(r===void 0?e.length-1:r,0),function(){for(var n=arguments,i=-1,o=qi(n.length-r,0),s=Array(o);++i<o;)s[i]=n[r+i];i=-1;for(var a=Array(r+1);++i<r;)a[i]=n[i];return a[r]=t(s),pc(e,this,a)}}Ci.exports=dc});var Ri=u((Eb,_i)=>{"use strict";function mc(e){return function(){return e}}_i.exports=mc});var fr=u((Tb,Vi)=>{"use strict";var hc=Ae(),gc=function(){try{var e=hc(Object,"defineProperty");return e({},"",{}),e}catch{}}();Vi.exports=gc});var Pi=u((wb,Fi)=>{"use strict";var yc=Ri(),Ji=fr(),bc=ur(),Oc=Ji?function(e,r){return Ji(e,"toString",{configurable:!0,enumerable:!1,value:yc(r),writable:!0})}:bc;Fi.exports=Oc});var Mi=u((Ib,Ni)=>{"use strict";var Sc=800,xc=16,vc=Date.now;function Ec(e){var r=0,t=0;return function(){var n=vc(),i=xc-(n-t);if(t=n,i>0){if(++r>=Sc)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}Ni.exports=Ec});var Di=u((Ab,Li)=>{"use strict";var Tc=Pi(),wc=Mi(),Ic=wc(Tc);Li.exports=Ic});var Re=u((qb,$i)=>{"use strict";var Ac=ur(),qc=ji(),Cc=Di();function jc(e,r){return Cc(qc(e,r,Ac),e+"")}$i.exports=jc});var lr=u((Cb,Bi)=>{"use strict";var _c=9007199254740991;function Rc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=_c}Bi.exports=Rc});var Ve=u((jb,Hi)=>{"use strict";var Vc=Ie(),Jc=lr();function Fc(e){return e!=null&&Jc(e.length)&&!Vc(e)}Hi.exports=Fc});var Je=u((_b,Ui)=>{"use strict";var Pc=Ve(),Nc=R();function Mc(e){return Nc(e)&&Pc(e)}Ui.exports=Mc});var ki=u((Rb,zi)=>{"use strict";var Lc=ui(),Dc=Ti(),$c=Re(),Gi=Je(),Bc=$c(function(e,r){return Gi(e)?Lc(e,Dc(r,1,Gi,!0)):[]});zi.exports=Bc});var Fe=u((Vb,Wi)=>{"use strict";var Hc=D(),Uc=R(),Gc="[object Symbol]";function zc(e){return typeof e=="symbol"||Uc(e)&&Hc(e)==Gc}Wi.exports=zc});var Yi=u((Jb,Ki)=>{"use strict";var kc=V(),Wc=Fe(),Kc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Yc=/^\w*$/;function Xc(e,r){if(kc(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||Wc(e)?!0:Yc.test(e)||!Kc.test(e)||r!=null&&e in Object(r)}Ki.exports=Xc});var Qi=u((Fb,Zi)=>{"use strict";var Xi=qe(),Zc="Expected a function";function cr(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError(Zc);var t=function(){var n=arguments,i=r?r.apply(this,n):n[0],o=t.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return t.cache=o.set(i,s)||o,s};return t.cache=new(cr.Cache||Xi),t}cr.Cache=Xi;Zi.exports=cr});var ro=u((Pb,eo)=>{"use strict";var Qc=Qi(),ep=500;function rp(e){var r=Qc(e,function(n){return t.size===ep&&t.clear(),n}),t=r.cache;return r}eo.exports=rp});var no=u((Nb,to)=>{"use strict";var tp=ro(),np=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ip=/\\(\\)?/g,op=tp(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(np,function(t,n,i,o){r.push(i?o.replace(ip,"$1"):n||t)}),r});to.exports=op});var fo=u((Mb,uo)=>{"use strict";var io=oe(),sp=pe(),ap=V(),up=Fe(),fp=1/0,oo=io?io.prototype:void 0,so=oo?oo.toString:void 0;function ao(e){if(typeof e=="string")return e;if(ap(e))return sp(e,ao)+"";if(up(e))return so?so.call(e):"";var r=e+"";return r=="0"&&1/e==-fp?"-0":r}uo.exports=ao});var co=u((Lb,lo)=>{"use strict";var lp=fo();function cp(e){return e==null?"":lp(e)}lo.exports=cp});var pr=u((Db,po)=>{"use strict";var pp=V(),dp=Yi(),mp=no(),hp=co();function gp(e,r){return pp(e)?e:dp(e,r)?[e]:mp(hp(e))}po.exports=gp});var dr=u(($b,mo)=>{"use strict";var yp=Fe(),bp=1/0;function Op(e){if(typeof e=="string"||yp(e))return e;var r=e+"";return r=="0"&&1/e==-bp?"-0":r}mo.exports=Op});var go=u((Bb,ho)=>{"use strict";var Sp=pr(),xp=dr();function vp(e,r){r=Sp(r,e);for(var t=0,n=r.length;e!=null&&t<n;)e=e[xp(r[t++])];return t&&t==n?e:void 0}ho.exports=vp});var bo=u((Hb,yo)=>{"use strict";var Ep=go();function Tp(e,r,t){var n=e==null?void 0:Ep(e,r);return n===void 0?t:n}yo.exports=Tp});var xo=u((Ub,So)=>{"use strict";var wp=ir(),Ip=or(),Ap=sr(),qp=pe(),Cp=je(),Oo=ar(),jp=Math.min;function _p(e,r,t){for(var n=t?Ap:Ip,i=e[0].length,o=e.length,s=o,a=Array(o),f=1/0,l=[];s--;){var c=e[s];s&&r&&(c=qp(c,Cp(r))),f=jp(c.length,f),a[s]=!t&&(r||i>=120&&c.length>=120)?new wp(s&&c):void 0}c=e[0];var p=-1,d=a[0];e:for(;++p<i&&l.length<f;){var m=c[p],h=r?r(m):m;if(m=t||m!==0?m:0,!(d?Oo(d,h):n(l,h,t))){for(s=o;--s;){var w=a[s];if(!(w?Oo(w,h):n(e[s],h,t)))continue e}d&&d.push(h),l.push(m)}}return l}So.exports=_p});var Eo=u((Gb,vo)=>{"use strict";var Rp=Je();function Vp(e){return Rp(e)?e:[]}vo.exports=Vp});var wo=u((zb,To)=>{"use strict";var Jp=pe(),Fp=xo(),Pp=Re(),Np=Eo(),Mp=Pp(function(e){var r=Jp(e,Np);return r.length&&r[0]===e[0]?Fp(r):[]});To.exports=Mp});var Ao=u((kb,Io)=>{"use strict";var Lp=le();function Dp(){this.__data__=new Lp,this.size=0}Io.exports=Dp});var Co=u((Wb,qo)=>{"use strict";function $p(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}qo.exports=$p});var _o=u((Kb,jo)=>{"use strict";function Bp(e){return this.__data__.get(e)}jo.exports=Bp});var Vo=u((Yb,Ro)=>{"use strict";function Hp(e){return this.__data__.has(e)}Ro.exports=Hp});var Fo=u((Xb,Jo)=>{"use strict";var Up=le(),Gp=nr(),zp=qe(),kp=200;function Wp(e,r){var t=this.__data__;if(t instanceof Up){var n=t.__data__;if(!Gp||n.length<kp-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new zp(n)}return t.set(e,r),this.size=t.size,this}Jo.exports=Wp});var No=u((Zb,Po)=>{"use strict";var Kp=le(),Yp=Ao(),Xp=Co(),Zp=_o(),Qp=Vo(),ed=Fo();function U(e){var r=this.__data__=new Kp(e);this.size=r.size}U.prototype.clear=Yp;U.prototype.delete=Xp;U.prototype.get=Zp;U.prototype.has=Qp;U.prototype.set=ed;Po.exports=U});var Pe=u((Qb,Lo)=>{"use strict";var Mo=fr();function rd(e,r,t){r=="__proto__"&&Mo?Mo(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}Lo.exports=rd});var mr=u((eO,Do)=>{"use strict";var td=Pe(),nd=ue();function id(e,r,t){(t!==void 0&&!nd(e[r],t)||t===void 0&&!(r in e))&&td(e,r,t)}Do.exports=id});var Bo=u((rO,$o)=>{"use strict";function od(e){return function(r,t,n){for(var i=-1,o=Object(r),s=n(r),a=s.length;a--;){var f=s[e?a:++i];if(t(o[f],f,o)===!1)break}return r}}$o.exports=od});var Uo=u((tO,Ho)=>{"use strict";var sd=Bo(),ad=sd();Ho.exports=ad});var Ko=u((de,G)=>{"use strict";var ud=_(),Wo=typeof de=="object"&&de&&!de.nodeType&&de,Go=Wo&&typeof G=="object"&&G&&!G.nodeType&&G,fd=Go&&Go.exports===Wo,zo=fd?ud.Buffer:void 0,ko=zo?zo.allocUnsafe:void 0;function ld(e,r){if(r)return e.slice();var t=e.length,n=ko?ko(t):new e.constructor(t);return e.copy(n),n}G.exports=ld});var Xo=u((nO,Yo)=>{"use strict";var cd=_(),pd=cd.Uint8Array;Yo.exports=pd});var es=u((iO,Qo)=>{"use strict";var Zo=Xo();function dd(e){var r=new e.constructor(e.byteLength);return new Zo(r).set(new Zo(e)),r}Qo.exports=dd});var ts=u((oO,rs)=>{"use strict";var md=es();function hd(e,r){var t=r?md(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}rs.exports=hd});var is=u((sO,ns)=>{"use strict";function gd(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}ns.exports=gd});var as=u((aO,ss)=>{"use strict";var yd=T(),os=Object.create,bd=function(){function e(){}return function(r){if(!yd(r))return{};if(os)return os(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();ss.exports=bd});var fs=u((uO,us)=>{"use strict";function Od(e,r){return function(t){return e(r(t))}}us.exports=Od});var hr=u((fO,ls)=>{"use strict";var Sd=fs(),xd=Sd(Object.getPrototypeOf,Object);ls.exports=xd});var gr=u((lO,cs)=>{"use strict";var vd=Object.prototype;function Ed(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||vd;return e===t}cs.exports=Ed});var ds=u((cO,ps)=>{"use strict";var Td=as(),wd=hr(),Id=gr();function Ad(e){return typeof e.constructor=="function"&&!Id(e)?Td(wd(e)):{}}ps.exports=Ad});var hs=u((pO,ms)=>{"use strict";function qd(){return!1}ms.exports=qd});var yr=u((me,z)=>{"use strict";var Cd=_(),jd=hs(),bs=typeof me=="object"&&me&&!me.nodeType&&me,gs=bs&&typeof z=="object"&&z&&!z.nodeType&&z,_d=gs&&gs.exports===bs,ys=_d?Cd.Buffer:void 0,Rd=ys?ys.isBuffer:void 0,Vd=Rd||jd;z.exports=Vd});var xs=u((dO,Ss)=>{"use strict";var Jd=D(),Fd=hr(),Pd=R(),Nd="[object Object]",Md=Function.prototype,Ld=Object.prototype,Os=Md.toString,Dd=Ld.hasOwnProperty,$d=Os.call(Object);function Bd(e){if(!Pd(e)||Jd(e)!=Nd)return!1;var r=Fd(e);if(r===null)return!0;var t=Dd.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&Os.call(t)==$d}Ss.exports=Bd});var Es=u((mO,vs)=>{"use strict";var Hd=D(),Ud=lr(),Gd=R(),zd="[object Arguments]",kd="[object Array]",Wd="[object Boolean]",Kd="[object Date]",Yd="[object Error]",Xd="[object Function]",Zd="[object Map]",Qd="[object Number]",em="[object Object]",rm="[object RegExp]",tm="[object Set]",nm="[object String]",im="[object WeakMap]",om="[object ArrayBuffer]",sm="[object DataView]",am="[object Float32Array]",um="[object Float64Array]",fm="[object Int8Array]",lm="[object Int16Array]",cm="[object Int32Array]",pm="[object Uint8Array]",dm="[object Uint8ClampedArray]",mm="[object Uint16Array]",hm="[object Uint32Array]",y={};y[am]=y[um]=y[fm]=y[lm]=y[cm]=y[pm]=y[dm]=y[mm]=y[hm]=!0;y[zd]=y[kd]=y[om]=y[Wd]=y[sm]=y[Kd]=y[Yd]=y[Xd]=y[Zd]=y[Qd]=y[em]=y[rm]=y[tm]=y[nm]=y[im]=!1;function gm(e){return Gd(e)&&Ud(e.length)&&!!y[Hd(e)]}vs.exports=gm});var ws=u((he,k)=>{"use strict";var ym=rr(),Ts=typeof he=="object"&&he&&!he.nodeType&&he,ge=Ts&&typeof k=="object"&&k&&!k.nodeType&&k,bm=ge&&ge.exports===Ts,br=bm&&ym.process,Om=function(){try{var e=ge&&ge.require&&ge.require("util").types;return e||br&&br.binding&&br.binding("util")}catch{}}();k.exports=Om});var Or=u((hO,qs)=>{"use strict";var Sm=Es(),xm=je(),Is=ws(),As=Is&&Is.isTypedArray,vm=As?xm(As):Sm;qs.exports=vm});var Sr=u((gO,Cs)=>{"use strict";function Em(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}Cs.exports=Em});var xr=u((yO,js)=>{"use strict";var Tm=Pe(),wm=ue(),Im=Object.prototype,Am=Im.hasOwnProperty;function qm(e,r,t){var n=e[r];(!(Am.call(e,r)&&wm(n,t))||t===void 0&&!(r in e))&&Tm(e,r,t)}js.exports=qm});var Rs=u((bO,_s)=>{"use strict";var Cm=xr(),jm=Pe();function _m(e,r,t,n){var i=!t;t||(t={});for(var o=-1,s=r.length;++o<s;){var a=r[o],f=n?n(t[a],e[a],a,t,e):void 0;f===void 0&&(f=e[a]),i?jm(t,a,f):Cm(t,a,f)}return t}_s.exports=_m});var Js=u((OO,Vs)=>{"use strict";function Rm(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}Vs.exports=Rm});var Ne=u((SO,Fs)=>{"use strict";var Vm=9007199254740991,Jm=/^(?:0|[1-9]\d*)$/;function Fm(e,r){var t=typeof e;return r=r??Vm,!!r&&(t=="number"||t!="symbol"&&Jm.test(e))&&e>-1&&e%1==0&&e<r}Fs.exports=Fm});var Ns=u((xO,Ps)=>{"use strict";var Pm=Js(),Nm=_e(),Mm=V(),Lm=yr(),Dm=Ne(),$m=Or(),Bm=Object.prototype,Hm=Bm.hasOwnProperty;function Um(e,r){var t=Mm(e),n=!t&&Nm(e),i=!t&&!n&&Lm(e),o=!t&&!n&&!i&&$m(e),s=t||n||i||o,a=s?Pm(e.length,String):[],f=a.length;for(var l in e)(r||Hm.call(e,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Dm(l,f)))&&a.push(l);return a}Ps.exports=Um});var Ls=u((vO,Ms)=>{"use strict";function Gm(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}Ms.exports=Gm});var $s=u((EO,Ds)=>{"use strict";var zm=T(),km=gr(),Wm=Ls(),Km=Object.prototype,Ym=Km.hasOwnProperty;function Xm(e){if(!zm(e))return Wm(e);var r=km(e),t=[];for(var n in e)n=="constructor"&&(r||!Ym.call(e,n))||t.push(n);return t}Ds.exports=Xm});var vr=u((TO,Bs)=>{"use strict";var Zm=Ns(),Qm=$s(),eh=Ve();function rh(e){return eh(e)?Zm(e,!0):Qm(e)}Bs.exports=rh});var Us=u((wO,Hs)=>{"use strict";var th=Rs(),nh=vr();function ih(e){return th(e,nh(e))}Hs.exports=ih});var Ys=u((IO,Ks)=>{"use strict";var Gs=mr(),oh=Ko(),sh=ts(),ah=is(),uh=ds(),zs=_e(),ks=V(),fh=Je(),lh=yr(),ch=Ie(),ph=T(),dh=xs(),mh=Or(),Ws=Sr(),hh=Us();function gh(e,r,t,n,i,o,s){var a=Ws(e,t),f=Ws(r,t),l=s.get(f);if(l){Gs(e,t,l);return}var c=o?o(a,f,t+"",e,r,s):void 0,p=c===void 0;if(p){var d=ks(f),m=!d&&lh(f),h=!d&&!m&&mh(f);c=f,d||m||h?ks(a)?c=a:fh(a)?c=ah(a):m?(p=!1,c=oh(f,!0)):h?(p=!1,c=sh(f,!0)):c=[]:dh(f)||zs(f)?(c=a,zs(a)?c=hh(a):(!ph(a)||ch(a))&&(c=uh(f))):p=!1}p&&(s.set(f,c),i(c,f,n,o,s),s.delete(f)),Gs(e,t,c)}Ks.exports=gh});var Er=u((AO,Zs)=>{"use strict";var yh=No(),bh=mr(),Oh=Uo(),Sh=Ys(),xh=T(),vh=vr(),Eh=Sr();function Xs(e,r,t,n,i){e!==r&&Oh(r,function(o,s){if(i||(i=new yh),xh(o))Sh(e,r,s,t,Xs,n,i);else{var a=n?n(Eh(e,s),o,s+"",e,r,i):void 0;a===void 0&&(a=o),bh(e,s,a)}},vh)}Zs.exports=Xs});var ea=u((qO,Qs)=>{"use strict";var Th=ue(),wh=Ve(),Ih=Ne(),Ah=T();function qh(e,r,t){if(!Ah(t))return!1;var n=typeof r;return(n=="number"?wh(t)&&Ih(r,t.length):n=="string"&&r in t)?Th(t[r],e):!1}Qs.exports=qh});var Tr=u((CO,ra)=>{"use strict";var Ch=Re(),jh=ea();function _h(e){return Ch(function(r,t){var n=-1,i=t.length,o=i>1?t[i-1]:void 0,s=i>2?t[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,s&&jh(t[0],t[1],s)&&(o=i<3?void 0:o,i=1),r=Object(r);++n<i;){var a=t[n];a&&e(r,a,n,o)}return r})}ra.exports=_h});var na=u((jO,ta)=>{"use strict";var Rh=Er(),Vh=Tr(),Jh=Vh(function(e,r,t){Rh(e,r,t)});ta.exports=Jh});var oa=u((_O,ia)=>{"use strict";var Fh=Er(),Ph=Tr(),Nh=Ph(function(e,r,t,n){Fh(e,r,t,n)});ia.exports=Nh});var ua=u((RO,aa)=>{"use strict";var Mh=xr(),Lh=pr(),Dh=Ne(),sa=T(),$h=dr();function Bh(e,r,t,n){if(!sa(e))return e;r=Lh(r,e);for(var i=-1,o=r.length,s=o-1,a=e;a!=null&&++i<o;){var f=$h(r[i]),l=t;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(i!=s){var c=a[f];l=n?n(c,f,a):void 0,l===void 0&&(l=sa(c)?c:Dh(r[i+1])?[]:{})}Mh(a,f,l),a=a[f]}return e}aa.exports=Bh});var la=u((VO,fa)=>{"use strict";var Hh=ua();function Uh(e,r,t){return e==null?e:Hh(e,r,t)}fa.exports=Uh});var Kr=I($r(),1);function Hr(e){if(e===0)return 0;let r=e/1024;return Number.parseFloat(r.toFixed(2))}var Ta=["if","then","else"];function N(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function wa(e,r){switch(e){case"options":case"enum":return!0;case"oneOf":case"anyOf":return r.length>0&&r.every(t=>N(t)&&"const"in t);default:return!1}}function xe(e){if(N(e)){let r=e;if("const"in r)return r.const;if("value"in r)return r.value}return e}var Br=!1;function Ia(e){Br||(Br=!0,console.warn(`[json-schema-form] A conditional branch introduces option(s) not present on the base field: ${JSON.stringify(e)}. This currently works but is deprecated and will be disallowed in a future major version. Set \`disallowNewConditionalOptions: true\` to opt into the new behavior now. (see PR #265)`))}function Ge(e,r,t){if(!e||!r||typeof e!="object"||typeof r!="object")return;let{disallowNewConditionalOptions:n=!1}=t??{};for(let[i,o]of Object.entries(r)){if(Ta.includes(i))continue;let s=e[i];if(wa(i,o)){if(n){if(!Array.isArray(s)){e[i]=o;continue}let a=new Set(s.map(f=>xe(f)));e[i]=o.filter(f=>a.has(xe(f)));continue}else if(Array.isArray(s)){let a=new Set(s.map(l=>xe(l))),f=o.map(l=>xe(l)).filter(l=>!a.has(l));f.length>0&&Ia(f)}}if(N(o))N(s)?Ge(s,o,t):s!==o&&(e[i]=o);else if(s&&Array.isArray(o))if(i==="required")for(let a of o)s.includes(a)||s.push(a);else e[i]=o;else e[i]!==o&&(e[i]=o)}}function ze(e,r){for(let[t,n]of Object.entries(r)){let i=e[t];N(n)&&N(i)?ze(i,n):i!==n&&(e[t]=n)}}var Ur="yyyy-MM-dd";function Gr(e,r){let t=new Date(e).getTime(),n=new Date(r).getTime();return t<n?"LESSER":t>n?"GREATER":"EQUAL"}function Aa(e,r){let t=Gr(e,r);return t==="GREATER"||t==="EQUAL"}function qa(e,r){let t=Gr(e,r);return t==="LESSER"||t==="EQUAL"}function zr(e,r,t,n=[]){let i=typeof e=="string",o=e==="",s=e===void 0||e===null&&t.treatNullAsUndefined,a=o||s,f=[];if(!i||a||r["x-jsf-presentation"]===void 0)return f;let{minDate:l,maxDate:c}=r["x-jsf-presentation"];return l&&!Aa(e,l)&&f.push({path:n,validation:"minDate",schema:r,value:e}),c&&!qa(e,c)&&f.push({path:n,validation:"maxDate",schema:r,value:e}),f}function kr(e){return e["x-jsf-presentation"]?.inputType==="checkbox"}var Wr="Please acknowledge this field";function Yr(e,r,t,n){let i=e["x-jsf-presentation"];switch(t){case"type":return Ca(e.type);case"required":return kr(e)?Wr:"Required field";case"forbidden":return"Not allowed";case"const":return kr(e)&&r===!1?Wr:`The only accepted value is ${JSON.stringify(e.const)}.`;case"enum":return`The option "${ke(r)}" is not valid.`;case"oneOf":return`The option "${ke(r)}" is not valid.`;case"anyOf":return`The option "${ke(r)}" is not valid.`;case"not":return"The value must not satisfy the provided schema";case"minLength":return`Please insert at least ${e.minLength} characters`;case"maxLength":return`Please insert up to ${e.maxLength} characters`;case"pattern":return`Must have a valid format. E.g. ${(0,Kr.randexp)(e.pattern||"")}`;case"format":if(e.format==="email")return"Please enter a valid email address";if(e.format==="date"){let o=new Date().toISOString().split("T")[0];return`Must be a valid date in ${Ur.toLowerCase()} format. e.g. ${o}`}return`Must be a valid ${e.format} format`;case"multipleOf":return`Must be a multiple of ${e.multipleOf}`;case"maximum":return`Must be smaller or equal to ${e.maximum}`;case"exclusiveMaximum":return`Must be smaller than ${e.exclusiveMaximum}`;case"minimum":return`Must be greater or equal to ${e.minimum}`;case"exclusiveMinimum":return`Must be greater than ${e.exclusiveMinimum}`;case"minDate":return`The date must be ${i?.minDate} or after.`;case"maxDate":return`The date must be ${i?.maxDate} or before.`;case"fileStructure":return"Not a valid file.";case"maxFileSize":{let o=i?.maxFileSize,s=typeof o=="number"?Hr(o):void 0;return`File size too large.${s?` The limit is ${s} MB.`:""}`}case"accept":{let o=i?.accept;return`Unsupported file format.${o?` The acceptable formats are ${o}.`:""}`}case"minItems":{let o=e.minItems===1?"item":"items";return`Must have at least ${e.minItems} ${o}`}case"maxItems":{let o=e.maxItems===1?"item":"items";return`Must have at most ${e.maxItems} ${o}`}case"uniqueItems":return"Items must be unique";case"contains":throw new Error('"contains" is not implemented yet');case"minContains":throw new Error('"minContains" is not implemented yet');case"maxContains":throw new Error('"maxContains" is not implemented yet');case"additionalProperties":return"Additional property is not allowed";case"json-logic":return n||"The value is not valid"}}function Ca(e){if(Array.isArray(e))return`The value must be a ${e.map(t=>t==="integer"?"number":t).join(" or ")}`;switch(e){case"number":case"integer":return"The value must be a number";case"boolean":return"The value must be a boolean";case"null":return"The value must be null";case"string":return"The value must be a string";case"object":return"The value must be an object";case"array":return"The value must be an array";default:return e?`The value must be ${e}`:"Invalid value"}}function ke(e){return typeof e=="string"?e:JSON.stringify(e)}var it=I(et(),1);function Ha(e,r){let t={};return r.forEach((i,o)=>{t[i]=o}),e.sort((i,o)=>{let s=t[i.name]??1/0,a=t[o.name]??1/0;return s!==a?s-a:e.indexOf(i)-e.indexOf(o)})}function We(e,r){if(typeof e=="boolean")throw new TypeError("Schema must be an object");return e["x-jsf-order"]!==void 0?Ha(r,e["x-jsf-order"]):r}function Ua(e,r,t){r.checkboxValue=t.const,(Array.isArray(t.type)?t.type.includes("boolean"):t.type==="boolean")&&(r.checkboxValue=!0)}function Ga(e,r){if(e.options===void 0){let t=Wa(r);t&&(e.options=t,r.type==="array"&&(e.multiple=!0))}}function rt(e,r,t,n){if(e.options===void 0){let i=Xa(r,t,n);i&&(e.fields=i)}}function za(e,r){if(!e)return"text";switch(e){case"string":{let{oneOf:t,format:n}=r;return n==="email"?"email":n==="date"?"date":n==="data-url"?"file":t?"radio":"text"}case"number":case"integer":return"number";case"object":return"fieldset";case"array":{let{items:t}=r;return t?.properties?"group-array":"select"}case"boolean":return"checkbox";default:return"text"}}function tt(e,r,t,n){let i=t["x-jsf-presentation"];if(i?.inputType)return i.inputType;if(n&&r!=="root")throw new Error(`Strict error: Missing inputType to field "${t.title}".
2
- You can fix the json schema or skip this error by calling createHeadlessForm(schema, { strictInputType: false })`);if(!t.type){if(t.items?.properties)return"group-array";if(t.properties)return"select"}return za(e||t.type||"string",t)}var nt=new Map;function ka(e){return e.length?JSON.stringify(e):"0"}function ve(e){let r=ka(e),t=nt.get(r);if(t)return t;let n=e.filter(i=>i!==null&&typeof i=="object"&&i.const!==null).map(i=>{let o=i.title,s=i.const,a=typeof i["x-jsf-presentation"]=="object"?i["x-jsf-presentation"]:{},f={label:o||"",value:s},{title:l,const:c,"x-jsf-presentation":p,...d}=i;return{...f,...a,...d}});return nt.set(r,n),n}function Wa(e){if(e.oneOf)return ve(e.oneOf||[]);if(e.items?.anyOf)return ve(e.items.anyOf);if(e.anyOf)return ve(e.anyOf);if(e.enum){let r=e.enum?.map(t=>({title:typeof t=="string"?t:JSON.stringify(t),const:t}))||[];return ve(r)}return null}function Ka(e,r,t){let n=[];for(let o in e.properties){let s=e.required?.includes(o)||!1,a=j({schema:e.properties[o],name:o,required:s,originalSchema:r.properties?.[o]||e.properties[o],strictInputType:t});a&&n.push(a)}return We(e,n)}function Ya(e,r,t){let n=[];if(typeof e.items!="object"||e.items===null)return[];if(e.items?.type==="object"){let o=e.items,s=r.items;for(let a in o.properties){let f=o.required?.includes(a)||!1,l=j({schema:o.properties[a],name:a,required:f,originalSchema:s?.properties?.[a]||o.properties[a],strictInputType:t});l&&(l.nameKey=a,n.push(l))}}else{let o=j({schema:e.items,name:"item",required:!1,originalSchema:r.items||e.items,strictInputType:t});o&&n.push(o)}return We(e.items,n)}function Xa(e,r,t){return typeof e.properties=="object"&&e.properties!==null?Ka(e,r,t):typeof e.items=="object"&&e.items!==null?Ya(e,r,t):null}var Za=["title","type","x-jsf-errorMessage","x-jsf-presentation","oneOf","anyOf","properties"];function j({schema:e,name:r,required:t=!1,originalSchema:n,strictInputType:i=!1,type:o=void 0}){if(e===!1){let d=tt(o,r,n,i),m={type:d,name:r,inputType:d,jsonType:o||n.type,required:t,isVisible:!1};return n.default!==void 0&&(m.default=n.default),rt(m,n,n),m}if(typeof e=="boolean")return null;let s=n["x-jsf-presentation"]||{},a=e["x-jsf-presentation"]||{},f=(0,it.default)(s,a,{arrayMerge:(d,m,h)=>m}),l=e["x-jsf-errorMessage"],c=tt(o,r,e,i),p={...Object.entries(e).filter(([d])=>!Za.includes(d)).reduce((d,[m,h])=>({...d,[m]:h}),{}),name:r,inputType:c,type:c,jsonType:o||e.type,required:t,isVisible:!0,...l&&{errorMessage:l}};return p.default===void 0&&n.default!==void 0&&(p.default=n.default),c==="checkbox"&&Ua(c,p,e),e.title&&(p.label=e.title),Object.keys(f).length>0&&Object.entries(f).forEach(([d,m])=>{d!=="inputType"&&(p[d]=m)}),r!=="root"&&Ga(p,e),rt(p,e,n),p}import L from"json-logic-js";function Te(e,r){let{validations:t,computedValues:n}=e;return{schema:{validations:t,computedValues:n},value:r}}function ot(e){return/\{\{.*?\}\}/.test(e)}function Ee(e={}){return Object.entries(e).reduce((r,[t,n])=>({...r,[t]:n??Number.NaN}),{})}function st(e,r,t=[]){let n=e["x-jsf-logic-validations"];return!n||n.length===0?[]:n.map(i=>{let o=r?.schema?.validations?.[i],s=r?.value;if(!o)throw new Error(`[json-schema-form] json-logic error: "${e.title}" required validation "${i}" doesn't exist.`);if(L.apply(o.rule,Ee(s))===!1){let f=o.errorMessage;return f&&ot(f)&&(f=f.replace(/\{\{(.*?)\}\}/g,(l,c)=>{let p=c.trim(),d=r.schema.computedValues?.[p];return d?L.apply(d.rule,Ee(s)):L.apply({var:p},Ee(s))})),[{path:t,validation:"json-logic",customErrorMessage:f,schema:e,value:s}]}return[]}).flat()}function we(e,r,t){if(!r)throw new Error(`[json-schema-form] json-logic error: Computed value "${e}" doesn't exist`);return L.apply(r,Ee(t))}function at(e,r,t){if(r){let n={};Object.entries(r).forEach(([i,o])=>{let s=we(i,o.rule,t);n[i]=s}),te(e,n)}return e}function te(e,r){function t(n){if(typeof n!="object")return;let i=n["x-jsf-logic-computedAttrs"];if(i&&Qa(n,r,i),typeof n.properties=="object")for(let o in n.properties)t(n.properties[o]);if(typeof n.if=="object"&&te(n.if,r),n.allOf&&n.allOf.length>0)for(let o of n.allOf)te(o,r);if(n.anyOf&&n.anyOf.length>0)for(let o of n.anyOf)te(o,r);if(n.oneOf&&n.oneOf.length>0)for(let o of n.oneOf)te(o,r);delete n["x-jsf-logic-computedAttrs"]}t(e)}function Qa(e,r,t){if(typeof e!="object")return;function n(o){return ot(o)?o.replace(/\{\{(.*?)\}\}/g,(s,a)=>{let f=a.trim();return r[f]??`{{${f}}}`}):r[o]}function i(o,s,a,f){if(typeof o!="object")return;let l=s;o[l]||(o[l]={}),Object.entries(a).forEach(([c,p])=>{typeof p=="string"?o[l][c]=n(p):i(o[l],c,p,f)})}for(let o in t){let s=o,a=t[o];typeof a=="string"?e[s]=n(a):typeof e=="object"&&i(e,s,a,r)}}function Ke(e){if(e)for(let[r,t]of Object.entries(e))L.add_operation(r,t)}function Ye(e){if(e)for(let r of Object.keys(e))L.rm_operation(r)}function x(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function E(e,r){if(typeof e!=typeof r)return!1;if(e===r)return!0;if(e===null||r===null)return!1;if(Array.isArray(e)&&Array.isArray(r))return e.length!==r.length?!1:e.every((t,n)=>E(t,r[n]));if(x(e)&&x(r)){let t=Object.keys(e).sort(),n=Object.keys(r).sort();return t.length!==n.length||!E(t,n)?!1:t.every(i=>E(e[i],r[i]))}return!1}function ut(e){if(typeof structuredClone=="function")try{return structuredClone(e)}catch{}try{return JSON.parse(JSON.stringify(e))}catch{throw new Error("Deep clone failed: Object may contain circular references or non-serializable values")}}function ft(e,r,t,n,i){return Array.isArray(e)?[...eu(r,e,i),...iu(r,e,i),...nu(e,r,t,n,i),...tu(r,e,t,n,i),...ru(r,e,t,n,i)]:[]}function eu(e,r,t){let n=[],i=r.length;return e.maxItems!==void 0&&i>e.maxItems&&n.push({path:t,validation:"maxItems",schema:e,value:r}),e.minItems!==void 0&&i<e.minItems&&n.push({path:t,validation:"minItems",schema:e,value:r}),n}function ru(e,r,t,n,i){if(e.items===void 0)return[];let o=[],s=Array.isArray(e.prefixItems)?e.prefixItems.length:0;for(let[a,f]of r.slice(s).entries())o.push(...O(f,e.items,t,[...i,"items",a+s],n));return o}function tu(e,r,t,n,i){if(!Array.isArray(e.prefixItems))return[];let o=[];for(let[s,a]of r.entries())s<e.prefixItems.length&&o.push(...O(a,e.prefixItems[s],t,[...i,"prefixItems",s],n));return o}function nu(e,r,t,n,i){if(!("contains"in r))return[];let o=[],s=e.filter(a=>O(a,r.contains,t,[...i,"contains"],n).length===0).length;return r.minContains===void 0&&r.maxContains===void 0?s<1&&o.push({path:i,validation:"contains",schema:r,value:e}):(r.minContains!==void 0&&s<r.minContains&&o.push({path:i,validation:"minContains",schema:r,value:e}),r.maxContains!==void 0&&s>r.maxContains&&o.push({path:i,validation:"maxContains",schema:r,value:e})),o}function iu(e,r,t){if(e.uniqueItems!==!0)return[];let n=new Map;for(let i=0;i<r.length;i++){for(let o of n.values())if(E(r[i],o))return[{path:t,validation:"uniqueItems",schema:e,value:r[i]}];n.set(i,r[i])}return[]}function lt(e,r,t,n,i=[]){if(!r.allOf)return[];for(let o=0;o<r.allOf.length;o++){let s=r.allOf[o],a=O(e,s,t,[...i,"allOf",o],n);if(a.length>0)return a}return[]}function ct(e,r,t,n,i=[]){if(!r.anyOf)return[];if(i.length!==0){for(let a of r.anyOf)if(O(e,a,t,i,n).length===0)return[];return[{path:i,validation:"anyOf",schema:r,value:e}]}let o=[];for(let a of r.anyOf){let f=O(e,a,t,i,n);f.length!==0&&o.push(f)}return o.length<r.anyOf.length?[]:o.flat().reverse()}function pt(e,r,t,n,i=[]){if(!r.oneOf)return[];if(r.oneOf.length===0)return[];let o=0;for(let s=0;s<r.oneOf.length&&!(O(e,r.oneOf[s],t,i,n).length===0&&(o++,o>1));s++);return o===1?[]:[{path:i,validation:"oneOf",schema:r,value:e}]}function dt(e,r,t,n,i=[]){return r.not===void 0?[]:typeof r.not=="boolean"?r.not?[{path:i,validation:"not",schema:r,value:e}]:[]:O(e,r.not,t,i,n).length===0?[{path:i,validation:"not",schema:r,value:e}]:[]}function mt(e,r,t=[]){let n=typeof r.const<"u"?r.const:r.value;return n===void 0?[]:E(n,e)?[]:[{path:t,validation:"const",schema:r,value:e}]}function ht(e,r,t=[]){return r.enum===void 0?[]:r.enum.some(n=>E(n,e))?[]:[{path:t,validation:"enum",schema:r,value:e}]}function gt(e,r,t=[]){let n=r["x-jsf-presentation"],i=n?.inputType==="file",o=typeof n?.maxFileSize=="number"||typeof n?.accept=="string";if(!(i||o))return[];if(!Array.isArray(e))return[];if(e.length===0)return[];if(!e.every(l=>x(l)&&(typeof l.name=="string"||l instanceof File)))return[{path:t,validation:"fileStructure",schema:r,value:e}];let f=e;if(typeof n?.maxFileSize=="number"){let l=n.maxFileSize*1024;if(f.some(p=>(p.size??0)>l))return[{path:t,validation:"maxFileSize",schema:r,value:e}]}if(typeof n?.accept=="string"&&n.accept.trim()!==""){let l=n.accept.toLowerCase().split(",").map(c=>c.trim()).filter(c=>c).map(c=>c.startsWith(".")?c:`.${c}`);if(l.length>0&&!f.some(p=>{let d=p.name.toLowerCase(),m=d.includes(".")?`.${d.split(".").pop()}`:"";return m!==""&&l.includes(m)}))return[{path:t,validation:"accept",schema:r,value:e}]}return[]}function yt(e,r,t=[]){let n=[],i=ne(r);return typeof e!="number"?[]:i!==void 0&&!["number","integer"].includes(i)?[]:(r.multipleOf!==void 0&&e%r.multipleOf!==0&&n.push({path:t,validation:"multipleOf",schema:r,value:e}),r.maximum!==void 0&&e>r.maximum&&n.push({path:t,validation:"maximum",schema:r,value:e}),r.exclusiveMaximum!==void 0&&e>=r.exclusiveMaximum&&n.push({path:t,validation:"exclusiveMaximum",schema:r,value:e}),r.minimum!==void 0&&e<r.minimum&&n.push({path:t,validation:"minimum",schema:r,value:e}),r.exclusiveMinimum!==void 0&&e<=r.exclusiveMinimum&&n.push({path:t,validation:"exclusiveMinimum",schema:r,value:e}),n)}function bt(e,r,t,n,i=[]){if(typeof r=="object"&&r.properties&&x(e)){let o=[];for(let[s,a]of Object.entries(r.properties))o.push(...O(e[s],a,t,[...i,s],n));return o}return[]}var Ot;(function(e){e["7bit"]="7bit",e["8bit"]="8bit",e.Base64="base64",e.Binary="binary",e.IETFToken="ietf-token",e.QuotedPrintable="quoted-printable",e.XToken="x-token"})(Ot||(Ot={}));var b;(function(e){e.Date="date",e.DateTime="date-time",e.Duration="duration",e.Email="email",e.Hostname="hostname",e.IDNEmail="idn-email",e.IDNHostname="idn-hostname",e.IPv4="ipv4",e.IPv6="ipv6",e.IRI="iri",e.IRIReference="iri-reference",e.JSONPointer="json-pointer",e.JSONPointerURIFragment="json-pointer-uri-fragment",e.RegEx="regex",e.RelativeJSONPointer="relative-json-pointer",e.Time="time",e.URI="uri",e.URIReference="uri-reference",e.URITemplate="uri-template",e.UUID="uuid"})(b||(b={}));var St;(function(e){e.Array="array",e.Boolean="boolean",e.Integer="integer",e.Null="null",e.Number="number",e.Object="object",e.String="string"})(St||(St={}));var S={DATE_TIME:/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,DATE:/^\d{4}-\d{2}-\d{2}$/,TIME:/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/,DURATION:/^P(?!$)(?:\d+Y)?(?:\d+M)?(?:\d+D)?(?:T(?=\d)(?:\d+H)?(?:\d+M)?(?:\d+S)?)?$/,EMAIL:/^[\w.!#$%&'*+/=?^`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,IDN_EMAIL:/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/,HOSTNAME:/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i,IDN_HOSTNAME:/^[^\s._-].*[^\s._-]$/,IPV6_PART:/^[0-9a-f]{1,4}$/i,PROTOCOL:/^[a-z]+:/,URI_REFERENCE:/^\S*$/,UUID:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,JSON_POINTER:/^(?:\/(?:[^~/]|~0|~1)*)*$/,JSON_POINTER_URI_FRAGMENT:/^#(?:\/(?:[\w\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,RELATIVE_JSON_POINTER:/^(?:0|[1-9]\d*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,URI_TEMPLATE:/^(?:[!#$&'()*+,/:;=?@\w\-.~]|%[0-9a-f]{2}|\{[+#./;?&=,!@|]?(?:\w|%[0-9a-f]{2})+(?::[1-9]\d{0,3}|\*)?(?:,(?:\w|%[0-9a-f]{2})+(?::[1-9]\d{0,3}|\*)?)*\})*$/i},ou={[b.DateTime]:e=>S.DATE_TIME.test(e),[b.Date]:e=>S.DATE.test(e),[b.Time]:e=>S.TIME.test(e),[b.Duration]:e=>S.DURATION.test(e),[b.Email]:e=>e.length<=254&&S.EMAIL.test(e),[b.IDNEmail]:e=>e.length<=254&&S.IDN_EMAIL.test(e),[b.Hostname]:e=>e.length>255?!1:e.split(".").every(t=>S.HOSTNAME.test(t)),[b.IDNHostname]:e=>e.length>255?!1:e.split(".").every(t=>t.length<=63&&S.IDN_HOSTNAME.test(t)),[b.IPv4]:e=>{let r=e.split(".");return r.length!==4?!1:r.every(t=>{let n=Number.parseInt(t,10);return n>=0&&n<=255&&t===n.toString()})},[b.IPv6]:e=>{let r=e.split(":");if(r.length>8)return!1;let t=!1;return r.every(n=>n===""?t?!1:(t=!0,!0):S.IPV6_PART.test(n))},[b.URI]:e=>{try{let r=new URL(e);return r.protocol!==""&&S.PROTOCOL.test(r.protocol)}catch{return!1}},[b.URIReference]:e=>{try{return e.startsWith("//")?S.URI_REFERENCE.test(e.slice(2)):(new URL(e,"http://example.com"),!0)}catch{return!1}},[b.IRI]:e=>{try{let r=new URL(e);return r.protocol!==""&&S.PROTOCOL.test(r.protocol)}catch{return!1}},[b.IRIReference]:e=>{try{return e.startsWith("//")?S.URI_REFERENCE.test(e.slice(2)):(new URL(e,"http://example.com"),!0)}catch{return!1}},[b.RegEx]:e=>{try{return new RegExp(e,"u"),!0}catch{return!1}},[b.UUID]:e=>S.UUID.test(e),[b.JSONPointer]:e=>S.JSON_POINTER.test(e),[b.JSONPointerURIFragment]:e=>S.JSON_POINTER_URI_FRAGMENT.test(e),[b.RelativeJSONPointer]:e=>S.RELATIVE_JSON_POINTER.test(e),[b.URITemplate]:e=>S.URI_TEMPLATE.test(e)};function xt(e,r,t=[]){let n=[];if(typeof e!="string")return n;let i=ou[r.format];return i&&!i(e)&&n.push({path:t,validation:"format",schema:r,value:e}),n}function vt(e,r,t=[]){let n=[],i=ne(r);if(typeof e!="string")return[];if(i!==void 0&&i!=="string")return[];let o=[...new Intl.Segmenter().segment(e)].length;if(r.minLength!==void 0&&o<r.minLength&&n.push({path:t,validation:"minLength",schema:r,value:e}),r.maxLength!==void 0&&o>r.maxLength&&n.push({path:t,validation:"maxLength",schema:r,value:e}),r.pattern!==void 0&&(new RegExp(r.pattern).test(e)||n.push({path:t,validation:"pattern",schema:r,value:e})),r.format!==void 0){let s=xt(e,r,t);n.push(...s)}return n}function ne(e){if(typeof e=="boolean")return"boolean";if(e.type!==void 0)return e.type}function su(e,r,t=[]){let n=ne(r);if(n===void 0)return[];if(n==="null"&&e===null)return[];let i=e===null?"null":Array.isArray(e)?"array":typeof e;if(Array.isArray(n)){if(e===null&&n.includes("null"))return[];for(let o of n){if(o==="array"&&Array.isArray(e))return[];if(i==="number"&&o==="integer"&&Number.isInteger(e))return[];if(i===o||o==="null"&&e===null)return[]}}else{if(n==="array"&&Array.isArray(e))return[];if(i==="number"&&n==="integer"&&Number.isInteger(e))return[];if(i===n)return[]}return[{path:t,validation:"type",schema:r,value:e}]}function au(e,r,t={},n=[],i){return r?O(e,r,t,n,i):[]}function uu(e={}){return Object.keys(e).map(r=>({regex:new RegExp(r)}))}function O(e,r,t={},n=[],i){let o=i,s;if(!i&&r["x-jsf-logic"]){o=Te(r["x-jsf-logic"],e);let{validations:d,computedValues:m,...h}=r["x-jsf-logic"];s=h}let a=e===void 0||e===null&&t.treatNullAsUndefined,f=[];if(a)return[];if(typeof r=="boolean")return!r&&!t.allowForbiddenValues?[{path:n,validation:"forbidden",schema:r,value:e}]:[];let c=r["x-jsf-presentation"]?.inputType==="file",p=[];if(!c&&(p=su(e,r,n),p.length>0))return p;if(r.required&&x(e)){let d=r.required.filter(m=>{let h=e[m];return Array.isArray(h)?h.length===0:x(h)?Object.keys(h).length===0:h===void 0||h===null&&t.treatNullAsUndefined});for(let m of d)f.push({path:[...n,m],validation:"required",schema:r?.properties?.[m]||r,value:e})}if(r.additionalProperties===!1&&x(e)){let d=new Set(Object.keys(r.properties||{})),m=uu(r.patternProperties);for(let h of Object.keys(e)){let w=d.has(h),ye=m.some(({regex:De})=>De.test(h));!w&&!ye&&f.push({path:[...n,h],validation:"additionalProperties",schema:r,value:e[h]})}}return[...f,...mt(e,r,n),...ht(e,r,n),...bt(e,r,t,o,n),...ft(e,r,t,o,n),...vt(e,r,n),...yt(e,r,n),...gt(e,r,n),...dt(e,r,t,o,n),...lt(e,r,t,o,n),...ct(e,r,t,o,n),...pt(e,r,t,o,n),...Et(e,r,t,o,n),...zr(e,r,t,n),...au(e,s,t,n,o),...st(r,o,n)]}function Xe(e,r,t,n,i=[]){let o=typeof r=="boolean",s=O(e,r,{...t,...o?{allowForbiddenValues:!1}:{}},i,n).length===0,a=!o&&"validations"in r?fu(e,r.validations,n):!0,f=!o&&"computedValues"in r?lu(e,r.computedValues,n):!0;return s&&a&&f}function fu(e,r,t){if(!t)throw new Error("`if` node with `validations` property but no `jsonLogicContext` present");return Object.entries(r??{}).every(([i,o])=>{let s=t?.schema?.validations?.[i]?.rule;if(!s)throw new Error(`\`if\` node with \`validations\` property but no validation rule present for ${i}`);let a=we(i,s,e);return Object.hasOwn(o,"const")&&a===o.const})}function lu(e,r,t){if(!t)throw new Error("`if` node with `computedValues` property but no `jsonLogicContext` present");return Object.entries(r??{}).every(([i,o])=>{let s=t?.schema?.computedValues?.[i]?.rule;if(!s)throw new Error(`\`if\` node with \`computedValues\` property but no computed value rule present for ${i}`);let a=we(i,s,e);return Object.hasOwn(o,"const")&&a===o.const})}function Et(e,r,t,n,i=[]){if(r.if===void 0)return[];let o=Xe(e,r.if,t,n,i);return o&&r.then!==void 0?O(e,r.then,t,[...i,"then"],n):!o&&r.else!==void 0?O(e,r.else,t,[...i,"else"],n):[]}function Ze({schema:e,values:r,options:t={}}){let n=e["x-jsf-logic"]?Te(e["x-jsf-logic"],r):void 0,i=ut(e);return ie(i,r,t,n),n?.schema.computedValues&&(at(i,n.schema.computedValues,r),ie(i,r,t,n)),i}function Tt(e,r,t,n={},i){let o=Xe(e,t.if,n.legacyOptions??{},i),s=!1;return o&&t.if?.required&&(s=t.if.required.some(f=>{if(!r.properties||!r.properties[f])return!1;let l=r.properties[f],c=e[f];return O(c,l,n.legacyOptions??{}).some(d=>d.validation==="type")})),{rule:t,matches:o&&!s}}function ie(e,r={},t={},n){if(!x(r))return;let i=[];typeof e.if<"u"&&i.push(Tt(r,e,e,t,n));let o=e.allOf??[],s=e["x-jsf-logic"]?.allOf??[];[...o,...s].filter(a=>typeof a.if<"u").forEach(a=>{let f=Tt(r,e,a,t,n);i.push(f)});for(let{rule:a,matches:f}of i)f&&a.then?(wt(e,r,a.then,t,n),delete a.then):!f&&a.else&&(wt(e,r,a.else,t,n),delete a.else);if(e.properties){for(let[a,f]of Object.entries(e.properties))if(typeof f=="object"){let l=f;l.type==="object"&&ie(l,r[a],t,n),l.items&&ie(l.items,{},t,n)}}}function wt(e,r,t,n={},i){let o=t;ie(o,r,n,i),Ge(e,o,n)}function Qe(e,r,t){let n=j({schema:r,name:"root",required:!0,originalSchema:t,strictInputType:!1})?.fields||[];for(let i of e){let o=n.find(s=>s.name===i.name);if(o){It(i,o),ze(i,o);let s=r.properties?.[i.name],a=t.properties?.[i.name];s&&typeof s=="object"&&i.fields&&s.type==="object"&&Qe(i.fields,s,a)}}}function It(e,r){for(let[t]of Object.entries(e))r[t]?e[t]&&typeof e[t]=="object"&&!Array.isArray(e[t])&&r[t]&&typeof r[t]=="object"&&!Array.isArray(r[t])&&It(e[t],r[t]):delete e[t]}function cu(e){let r=[];for(let t=0;t<e.length;t++){let n=e[t];if(["allOf","anyOf","oneOf"].includes(n)){t+1<e.length&&typeof e[t+1]=="number"&&t++;continue}n==="then"||n==="else"||(n==="items"&&typeof e[t+1]=="number"?(t++,r.push(e[t])):r.push(n))}return r}function pu(e){if(e.length===0)return null;let r={};for(let t of e){let{path:n}=t;if(n.length===0){r[""]=t.message;continue}let i=cu(n),o=r;for(let s=0;s<i.length-1;s++){let a=i[s];if(typeof a=="number"){if(!Array.isArray(o))throw new TypeError(`Expected an array at path: ${i.slice(0,s).join(".")}`);o[a]||(o[a]={}),o=o[a]}else typeof i[s+1]=="number"?a in o||(o[a]=[]):(!(a in o)||typeof o[a]=="string")&&(o[a]={}),o=o[a]}if(i.length>0){let s=i[i.length-1];o[s]=t.message}}return r}function du(e){return e.map(r=>{let{schema:t,value:n,validation:i,customErrorMessage:o}=r;return{...r,message:Yr(t,n,i,o)}})}function mu(e,r){return typeof r!="object"||!r||!e.length?e:e.map(t=>{let n=t.schema,i=n["x-jsf-errorMessage"]?.[t.validation];return n&&i?{...t,message:i}:t})}function hu(e,r,t={}){let n={},i=O(e,r,t),o=du(i),s=mu(o,r),a=pu(s);return a&&(n.formErrors=a),n}function gu(e){let{schema:r,originalSchema:t,strictInputType:n}=e;return j({schema:r,name:"root",required:!0,originalSchema:t,strictInputType:n})?.fields||[]}function yu(e){if(Object.prototype.hasOwnProperty.call(e,"customProperties")&&console.error("[json-schema-form] `customProperties` is a deprecated option and it's not supported on json-schema-form v1"),e.customJsonLogicOps){if(typeof e.customJsonLogicOps!="object"||e.customJsonLogicOps===null)throw new TypeError("validationOptions.customJsonLogicOps must be an object.");for(let[r,t]of Object.entries(e.customJsonLogicOps))if(typeof t!="function")throw new TypeError(`Custom JSON Logic operator '${r}' must be a function, but received type '${typeof t}'.`)}}function er(e,r){if(typeof e=="boolean")return r;if(e.properties){let t=x(r)?{...r}:{};for(let[n,i]of Object.entries(e.properties)){let o=er(i,t[n]);o!==void 0&&(t[n]=o)}return t}if(e.items&&typeof e.items!="boolean"&&Array.isArray(r)){let t=e.items;return r.map(n=>er(t,n))}return r===void 0&&e.default!==void 0?e.default:r}function bu(e,r={}){yu(r);let t=r.strictInputType||!1,n=r?.customJsonLogicOps;Ke(n);let i=er(e,r.initialValues||{}),o=Ze({schema:e,values:i,options:r}),s=gu({schema:o,originalSchema:e,strictInputType:t}),a=!1,f=l=>{try{Ke(n);let c=Ze({schema:e,values:l,options:r}),p=hu(l,c,r.legacyOptions);return Qe(s,c,e),p}finally{Ye(n)}};return Ye(n),{fields:s,isError:a,error:null,handleValidation:f}}var ca=I(ki(),1),K=I(bo(),1),W=I(wo(),1),pa=I(na(),1),Me=I(oa(),1),Le=I(la(),1),Gh=new Set(["items"]);function da(e){return e.split(".").reduce((t,n,i)=>i===0?n:Gh.has(n)?`${t}.${n}`:`${t}.properties.${n}`,"")}function Ir(e){let{errorMessage:r,presentation:t,properties:n,...i}=e;return{...i,...t?{"x-jsf-presentation":t}:{},...r?{"x-jsf-errorMessage":r}:{}}}function Ar(e,r){return Array.isArray(r)?r:void 0}function zh(e,r){let{if:t,then:n,else:i}=e;return(0,W.default)(t?.required||[],r).length>0||((0,W.default)(n?.required||[],r)||(0,W.default)(Object.keys(n?.properties||{}),r)).length>0||((0,W.default)(i?.required||[],r)||(0,W.default)(Object.keys(i?.properties||{}),r)).length>0}function qr(e,r){if(!r)return{warnings:null};let t=[];return Object.entries(r).forEach(([i,o])=>{let s=da(i),a=(0,K.default)(e.properties,s);if(!a){t.push({type:"FIELD_TO_CHANGE_NOT_FOUND",message:`Changing field "${i}" was ignored because it does not exist.`});return}let f=typeof o=="function"?o(a):o,l=Ir(f);if(delete l.items,(0,Me.default)(a,l,Ar),f.properties){let c=qr((0,K.default)(e.properties,s),f.properties);c.warnings&&t.push(...c.warnings)}if(f.items){let c=a.items;if(typeof c=="object"&&c!==null){let{properties:d,...m}=f.items;if((0,Me.default)(c,Ir(m),Ar),d&&typeof d=="object"){let h=qr(c,d);h.warnings&&t.push(...h.warnings)}}}}),{warnings:t.flat()}}function Cr(e,r,t){if(!r||typeof e!="object"||e===null)return{warnings:null};let n=t?.parent;return typeof e=="object"&&e.properties&&Object.entries(e.properties).forEach(([i,o])=>{let s=n?`${n}.${i}`:i,a=r(s,o),f=Ir(a);(0,Me.default)((0,K.default)(e.properties,i),{...o,...f},Ar),o.properties&&Cr(o,r,{parent:i}),o.items&&Cr(o.items,r,{parent:i})}),{warnings:null}}function kh(e,r){if(!r)return{warnings:null};let t=[],n=e["x-jsf-order"]||[],i=typeof r=="function"?r(n):r,o=(0,ca.default)(n,i);return o.length>0&&t.push({type:"ORDER_MISSING_FIELDS",message:`Some fields got forgotten in the new order. They were automatically appended: ${o.join(", ")}`}),e["x-jsf-order"]=[...i,...o],{warnings:t}}function ma(e,r){if(!r)return{warnings:null};let t=[];return Object.entries(r).forEach(([i,o])=>{let s=da(i);if(!o)return{warnings:null};if(o.properties){let l=(0,K.default)(e.properties,s);if(!l)return{warnings:null};let c=ma(l,o.properties);c.warnings&&t.push(...c.warnings)}if((0,K.default)(e.properties,s)){t.push({type:"FIELD_TO_CREATE_EXISTS",message:`Creating field "${i}" was ignored because it already exists.`});return}let f=(0,Le.default)({},s,o);(0,pa.default)(e.properties,f)}),{warnings:t.flat()}}function Wh(e,r){if(!r)return{schema:e,warnings:null};let t={properties:{}};Object.entries(e).forEach(([o,s])=>{switch(o){case"properties":r.forEach(a=>{(0,Le.default)(t.properties,a,s[a])});break;case"x-jsf-order":case"required":t[o]=s.filter(a=>r.includes(a));break;case"allOf":{let a=e[o]?.filter(f=>zh(f,r));t[o]=a;break}default:t[o]=s}});let n={};t.allOf?.length&&t.allOf.forEach(o=>{let{if:s,then:a,else:f}=o,l=e.allOf?.indexOf(o);n={...n,...wr(s,{fields:r,path:`allOf[${l}].if`}),...wr(a,{fields:r,path:`allOf[${l}].then`}),...wr(f,{fields:r,path:`allOf[${l}].else`})}});let i=[];return Object.keys(n).length>0&&(Object.entries(n).forEach(([o])=>{(0,Le.default)(t.properties,o,e.properties?.[o])}),i.push({type:"PICK_MISSED_FIELD",message:`The picked fields are in conditionals that refeer other fields. They added automatically: ${Object.keys(n).map(o=>`"${o}"`).join(", ")}. Check "meta" for more details.`,meta:n})),{schema:t,warnings:i}}function wr(e,{fields:r,path:t}){if(!e)return null;let n={};return e.required?.forEach(i=>{r.includes(i)||(n[i]={path:t})}),Object.entries(e.properties||[]).forEach(([i])=>{r.includes(i)||(n[i]={path:t})}),n}function Kh(e,r){let t=JSON.parse(JSON.stringify(e)),n=qr(t,r.fields),i=Cr(t,r.allFields),o=ma(t,r.create),s=Wh(t,r.pick),a=s.schema,f=kh(a,r.orderRoot);r.muteLogging||console.warn("json-schema-form modify(): We highly recommend you to handle/report the returned `warnings` as they highlight possible bugs in your modifications. To mute this log, pass `muteLogging: true` to the config.");let l=[n.warnings,i.warnings,o.warnings,s.warnings,f.warnings].flat().filter(Boolean);return{schema:a,warnings:l}}export{bu as createHeadlessForm,Kh as modify};
1
+ var ya=Object.create;var jr=Object.defineProperty;var ba=Object.getOwnPropertyDescriptor;var Oa=Object.getOwnPropertyNames;var Sa=Object.getPrototypeOf,xa=Object.prototype.hasOwnProperty;var u=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var Ea=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Oa(r))!xa.call(e,i)&&i!==t&&jr(e,i,{get:()=>r[i],enumerable:!(n=ba(r,i))||n.enumerable});return e};var I=(e,r,t)=>(t=e!=null?ya(Sa(e)):{},Ea(r||!e||!e.__esModule?jr(t,"default",{value:e,enumerable:!0}):t,e));var Y=u((eg,_r)=>{"use strict";_r.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}});var Be=u(A=>{"use strict";var g=Y(),$e=()=>[{type:g.RANGE,from:48,to:57}],Rr=()=>[{type:g.CHAR,value:95},{type:g.RANGE,from:97,to:122},{type:g.RANGE,from:65,to:90}].concat($e()),Vr=()=>[{type:g.CHAR,value:9},{type:g.CHAR,value:10},{type:g.CHAR,value:11},{type:g.CHAR,value:12},{type:g.CHAR,value:13},{type:g.CHAR,value:32},{type:g.CHAR,value:160},{type:g.CHAR,value:5760},{type:g.RANGE,from:8192,to:8202},{type:g.CHAR,value:8232},{type:g.CHAR,value:8233},{type:g.CHAR,value:8239},{type:g.CHAR,value:8287},{type:g.CHAR,value:12288},{type:g.CHAR,value:65279}],va=()=>[{type:g.CHAR,value:10},{type:g.CHAR,value:13},{type:g.CHAR,value:8232},{type:g.CHAR,value:8233}];A.words=()=>({type:g.SET,set:Rr(),not:!1});A.notWords=()=>({type:g.SET,set:Rr(),not:!0});A.ints=()=>({type:g.SET,set:$e(),not:!1});A.notInts=()=>({type:g.SET,set:$e(),not:!0});A.whitespace=()=>({type:g.SET,set:Vr(),not:!1});A.notWhitespace=()=>({type:g.SET,set:Vr(),not:!0});A.anyChar=()=>({type:g.SET,set:va(),not:!0})});var Fr=u(X=>{"use strict";var Jr=Y(),J=Be(),Ta="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",wa={0:0,t:9,n:10,v:11,f:12,r:13};X.strToChars=function(e){var r=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return e=e.replace(r,function(t,n,i,o,s,a,f,l){if(i)return t;var c=n?8:o?parseInt(o,16):s?parseInt(s,16):a?parseInt(a,8):f?Ta.indexOf(f):wa[l],p=String.fromCharCode(c);return/[[\]{}^$.|?*+()]/.test(p)&&(p="\\"+p),p}),e};X.tokenizeClass=(e,r)=>{for(var t=[],n=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,i,o;(i=n.exec(e))!=null;)if(i[1])t.push(J.words());else if(i[2])t.push(J.ints());else if(i[3])t.push(J.whitespace());else if(i[4])t.push(J.notWords());else if(i[5])t.push(J.notInts());else if(i[6])t.push(J.notWhitespace());else if(i[7])t.push({type:Jr.RANGE,from:(i[8]||i[9]).charCodeAt(0),to:i[10].charCodeAt(0)});else if(o=i[12])t.push({type:Jr.CHAR,value:o.charCodeAt(0)});else return[t,n.lastIndex];X.error(r,"Unterminated character class")};X.error=(e,r)=>{throw new SyntaxError("Invalid regular expression: /"+e+"/: "+r)}});var Pr=u(Z=>{"use strict";var be=Y();Z.wordBoundary=()=>({type:be.POSITION,value:"b"});Z.nonWordBoundary=()=>({type:be.POSITION,value:"B"});Z.begin=()=>({type:be.POSITION,value:"^"});Z.end=()=>({type:be.POSITION,value:"$"})});var Nr=u((ig,He)=>{"use strict";var F=Fr(),E=Y(),q=Be(),Oe=Pr();He.exports=e=>{var r=0,t,n,i={type:E.ROOT,stack:[]},o=i,s=i.stack,a=[],f=De=>{F.error(e,`Nothing to repeat at column ${De-1}`)},l=F.strToChars(e);for(t=l.length;r<t;)switch(n=l[r++],n){case"\\":switch(n=l[r++],n){case"b":s.push(Oe.wordBoundary());break;case"B":s.push(Oe.nonWordBoundary());break;case"w":s.push(q.words());break;case"W":s.push(q.notWords());break;case"d":s.push(q.ints());break;case"D":s.push(q.notInts());break;case"s":s.push(q.whitespace());break;case"S":s.push(q.notWhitespace());break;default:/\d/.test(n)?s.push({type:E.REFERENCE,value:parseInt(n,10)}):s.push({type:E.CHAR,value:n.charCodeAt(0)})}break;case"^":s.push(Oe.begin());break;case"$":s.push(Oe.end());break;case"[":var c;l[r]==="^"?(c=!0,r++):c=!1;var p=F.tokenizeClass(l.slice(r),e);r+=p[1],s.push({type:E.SET,set:p[0],not:c});break;case".":s.push(q.anyChar());break;case"(":var d={type:E.GROUP,stack:[],remember:!0};n=l[r],n==="?"&&(n=l[r+1],r+=2,n==="="?d.followedBy=!0:n==="!"?d.notFollowedBy=!0:n!==":"&&F.error(e,`Invalid group, character '${n}' after '?' at column ${r-1}`),d.remember=!1),s.push(d),a.push(o),o=d,s=d.stack;break;case")":a.length===0&&F.error(e,`Unmatched ) at column ${r-1}`),o=a.pop(),s=o.options?o.options[o.options.length-1]:o.stack;break;case"|":o.options||(o.options=[o.stack],delete o.stack);var m=[];o.options.push(m),s=m;break;case"{":var h=/^(\d+)(,(\d+)?)?\}/.exec(l.slice(r)),w,ye;h!==null?(s.length===0&&f(r),w=parseInt(h[1],10),ye=h[2]?h[3]?parseInt(h[3],10):1/0:w,r+=h[0].length,s.push({type:E.REPETITION,min:w,max:ye,value:s.pop()})):s.push({type:E.CHAR,value:123});break;case"?":s.length===0&&f(r),s.push({type:E.REPETITION,min:0,max:1,value:s.pop()});break;case"+":s.length===0&&f(r),s.push({type:E.REPETITION,min:1,max:1/0,value:s.pop()});break;case"*":s.length===0&&f(r),s.push({type:E.REPETITION,min:0,max:1/0,value:s.pop()});break;default:s.push({type:E.CHAR,value:n.charCodeAt(0)})}return a.length!==0&&F.error(e,"Unterminated group"),i};He.exports.types=E});var Lr=u((og,Mr)=>{"use strict";var P=class e{constructor(r,t){this.low=r,this.high=t,this.length=1+t-r}overlaps(r){return!(this.high<r.low||this.low>r.high)}touches(r){return!(this.high+1<r.low||this.low-1>r.high)}add(r){return new e(Math.min(this.low,r.low),Math.max(this.high,r.high))}subtract(r){return r.low<=this.low&&r.high>=this.high?[]:r.low>this.low&&r.high<this.high?[new e(this.low,r.low-1),new e(r.high+1,this.high)]:r.low<=this.low?[new e(r.high+1,this.high)]:[new e(this.low,r.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}},Ue=class e{constructor(r,t){this.ranges=[],this.length=0,r!=null&&this.add(r,t)}_update_length(){this.length=this.ranges.reduce((r,t)=>r+t.length,0)}add(r,t){var n=i=>{for(var o=0;o<this.ranges.length&&!i.touches(this.ranges[o]);)o++;for(var s=this.ranges.slice(0,o);o<this.ranges.length&&i.touches(this.ranges[o]);)i=i.add(this.ranges[o]),o++;s.push(i),this.ranges=s.concat(this.ranges.slice(o)),this._update_length()};return r instanceof e?r.ranges.forEach(n):(t==null&&(t=r),n(new P(r,t))),this}subtract(r,t){var n=i=>{for(var o=0;o<this.ranges.length&&!i.overlaps(this.ranges[o]);)o++;for(var s=this.ranges.slice(0,o);o<this.ranges.length&&i.overlaps(this.ranges[o]);)s=s.concat(this.ranges[o].subtract(i)),o++;this.ranges=s.concat(this.ranges.slice(o)),this._update_length()};return r instanceof e?r.ranges.forEach(n):(t==null&&(t=r),n(new P(r,t))),this}intersect(r,t){var n=[],i=o=>{for(var s=0;s<this.ranges.length&&!o.overlaps(this.ranges[s]);)s++;for(;s<this.ranges.length&&o.overlaps(this.ranges[s]);){var a=Math.max(this.ranges[s].low,o.low),f=Math.min(this.ranges[s].high,o.high);n.push(new P(a,f)),s++}};return r instanceof e?r.ranges.forEach(i):(t==null&&(t=r),i(new P(r,t))),this.ranges=n,this._update_length(),this}index(r){for(var t=0;t<this.ranges.length&&this.ranges[t].length<=r;)r-=this.ranges[t].length,t++;return this.ranges[t].low+r}toString(){return"[ "+this.ranges.join(", ")+" ]"}clone(){return new e(this)}numbers(){return this.ranges.reduce((r,t)=>{for(var n=t.low;n<=t.high;)r.push(n),n++;return r},[])}subranges(){return this.ranges.map(r=>({low:r.low,high:r.high,length:1+r.high-r.low}))}};Mr.exports=Ue});var $r=u((sg,Dr)=>{"use strict";var Se=Nr(),Q=Lr(),C=Se.types;Dr.exports=class ee{constructor(r,t){if(this._setDefaults(r),r instanceof RegExp)this.ignoreCase=r.ignoreCase,this.multiline=r.multiline,r=r.source;else if(typeof r=="string")this.ignoreCase=t&&t.indexOf("i")!==-1,this.multiline=t&&t.indexOf("m")!==-1;else throw new Error("Expected a regexp or string");this.tokens=Se(r)}_setDefaults(r){this.max=r.max!=null?r.max:ee.prototype.max!=null?ee.prototype.max:100,this.defaultRange=r.defaultRange?r.defaultRange:this.defaultRange.clone(),r.randInt&&(this.randInt=r.randInt)}gen(){return this._gen(this.tokens,[])}_gen(r,t){var n,i,o,s,a;switch(r.type){case C.ROOT:case C.GROUP:if(r.followedBy||r.notFollowedBy)return"";for(r.remember&&r.groupNumber===void 0&&(r.groupNumber=t.push(null)-1),n=r.options?this._randSelect(r.options):r.stack,i="",s=0,a=n.length;s<a;s++)i+=this._gen(n[s],t);return r.remember&&(t[r.groupNumber]=i),i;case C.POSITION:return"";case C.SET:var f=this._expand(r);return f.length?String.fromCharCode(this._randSelect(f)):"";case C.REPETITION:for(o=this.randInt(r.min,r.max===1/0?r.min+this.max:r.max),i="",s=0;s<o;s++)i+=this._gen(r.value,t);return i;case C.REFERENCE:return t[r.value-1]||"";case C.CHAR:var l=this.ignoreCase&&this._randBool()?this._toOtherCase(r.value):r.value;return String.fromCharCode(l)}}_toOtherCase(r){return r+(97<=r&&r<=122?-32:65<=r&&r<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(r){return r instanceof Q?r.index(this.randInt(0,r.length-1)):r[this.randInt(0,r.length-1)]}_expand(r){if(r.type===Se.types.CHAR)return new Q(r.value);if(r.type===Se.types.RANGE)return new Q(r.from,r.to);{let t=new Q;for(let n=0;n<r.set.length;n++){let i=this._expand(r.set[n]);if(t.add(i),this.ignoreCase)for(let o=0;o<i.length;o++){let s=i.index(o),a=this._toOtherCase(s);s!==a&&t.add(a)}}return r.not?this.defaultRange.clone().subtract(t):this.defaultRange.clone().intersect(t)}}randInt(r,t){return r+Math.floor(Math.random()*(1+t-r))}get defaultRange(){return this._range=this._range||new Q(32,126)}set defaultRange(r){this._range=r}static randexp(r,t){var n;return typeof r=="string"&&(r=new RegExp(r,t)),r._randexp===void 0?(n=new ee(r,t),r._randexp=n):(n=r._randexp,n._setDefaults(r)),n.gen()}static sugar(){RegExp.prototype.gen=function(){return ee.randexp(this)}}}});var et=u((pg,Qr)=>{"use strict";var Ra=function(r){return Va(r)&&!Ja(r)};function Va(e){return!!e&&typeof e=="object"}function Ja(e){var r=Object.prototype.toString.call(e);return r==="[object RegExp]"||r==="[object Date]"||Na(e)}var Fa=typeof Symbol=="function"&&Symbol.for,Pa=Fa?Symbol.for("react.element"):60103;function Na(e){return e.$$typeof===Pa}function Ma(e){return Array.isArray(e)?[]:{}}function re(e,r){return r.clone!==!1&&r.isMergeableObject(e)?M(Ma(e),e,r):e}function La(e,r,t){return e.concat(r).map(function(n){return re(n,t)})}function Da(e,r){if(!r.customMerge)return M;var t=r.customMerge(e);return typeof t=="function"?t:M}function $a(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(r){return Object.propertyIsEnumerable.call(e,r)}):[]}function Xr(e){return Object.keys(e).concat($a(e))}function Zr(e,r){try{return r in e}catch{return!1}}function Ba(e,r){return Zr(e,r)&&!(Object.hasOwnProperty.call(e,r)&&Object.propertyIsEnumerable.call(e,r))}function Ha(e,r,t){var n={};return t.isMergeableObject(e)&&Xr(e).forEach(function(i){n[i]=re(e[i],t)}),Xr(r).forEach(function(i){Ba(e,i)||(Zr(e,i)&&t.isMergeableObject(r[i])?n[i]=Da(i,t)(e[i],r[i],t):n[i]=re(r[i],t))}),n}function M(e,r,t){t=t||{},t.arrayMerge=t.arrayMerge||La,t.isMergeableObject=t.isMergeableObject||Ra,t.cloneUnlessOtherwiseSpecified=re;var n=Array.isArray(r),i=Array.isArray(e),o=n===i;return o?n?t.arrayMerge(e,r,t):Ha(e,r,t):re(r,t)}M.all=function(r,t){if(!Array.isArray(r))throw new Error("first argument should be an array");return r.reduce(function(n,i){return M(n,i,t)},{})};var Ua=M;Qr.exports=Ua});var rr=u((Oy,Ct)=>{"use strict";var Eu=typeof global=="object"&&global&&global.Object===Object&&global;Ct.exports=Eu});var _=u((Sy,jt)=>{"use strict";var vu=rr(),Tu=typeof self=="object"&&self&&self.Object===Object&&self,wu=vu||Tu||Function("return this")();jt.exports=wu});var oe=u((xy,_t)=>{"use strict";var Iu=_(),Au=Iu.Symbol;_t.exports=Au});var Ft=u((Ey,Jt)=>{"use strict";var Rt=oe(),Vt=Object.prototype,qu=Vt.hasOwnProperty,Cu=Vt.toString,se=Rt?Rt.toStringTag:void 0;function ju(e){var r=qu.call(e,se),t=e[se];try{e[se]=void 0;var n=!0}catch{}var i=Cu.call(e);return n&&(r?e[se]=t:delete e[se]),i}Jt.exports=ju});var Nt=u((vy,Pt)=>{"use strict";var _u=Object.prototype,Ru=_u.toString;function Vu(e){return Ru.call(e)}Pt.exports=Vu});var D=u((Ty,Dt)=>{"use strict";var Mt=oe(),Ju=Ft(),Fu=Nt(),Pu="[object Null]",Nu="[object Undefined]",Lt=Mt?Mt.toStringTag:void 0;function Mu(e){return e==null?e===void 0?Nu:Pu:Lt&&Lt in Object(e)?Ju(e):Fu(e)}Dt.exports=Mu});var T=u((wy,$t)=>{"use strict";function Lu(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}$t.exports=Lu});var Ie=u((Iy,Bt)=>{"use strict";var Du=D(),$u=T(),Bu="[object AsyncFunction]",Hu="[object Function]",Uu="[object GeneratorFunction]",Gu="[object Proxy]";function zu(e){if(!$u(e))return!1;var r=Du(e);return r==Hu||r==Uu||r==Bu||r==Gu}Bt.exports=zu});var Ut=u((Ay,Ht)=>{"use strict";var ku=_(),Wu=ku["__core-js_shared__"];Ht.exports=Wu});var kt=u((qy,zt)=>{"use strict";var tr=Ut(),Gt=function(){var e=/[^.]+$/.exec(tr&&tr.keys&&tr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Ku(e){return!!Gt&&Gt in e}zt.exports=Ku});var Kt=u((Cy,Wt)=>{"use strict";var Yu=Function.prototype,Xu=Yu.toString;function Zu(e){if(e!=null){try{return Xu.call(e)}catch{}try{return e+""}catch{}}return""}Wt.exports=Zu});var Xt=u((jy,Yt)=>{"use strict";var Qu=Ie(),ef=kt(),rf=T(),tf=Kt(),nf=/[\\^$.*+?()[\]{}|]/g,of=/^\[object .+?Constructor\]$/,sf=Function.prototype,af=Object.prototype,uf=sf.toString,ff=af.hasOwnProperty,lf=RegExp("^"+uf.call(ff).replace(nf,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function cf(e){if(!rf(e)||ef(e))return!1;var r=Qu(e)?lf:of;return r.test(tf(e))}Yt.exports=cf});var Qt=u((_y,Zt)=>{"use strict";function pf(e,r){return e?.[r]}Zt.exports=pf});var Ae=u((Ry,en)=>{"use strict";var df=Xt(),mf=Qt();function hf(e,r){var t=mf(e,r);return df(t)?t:void 0}en.exports=hf});var ae=u((Vy,rn)=>{"use strict";var gf=Ae(),yf=gf(Object,"create");rn.exports=yf});var on=u((Jy,nn)=>{"use strict";var tn=ae();function bf(){this.__data__=tn?tn(null):{},this.size=0}nn.exports=bf});var an=u((Fy,sn)=>{"use strict";function Of(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}sn.exports=Of});var fn=u((Py,un)=>{"use strict";var Sf=ae(),xf="__lodash_hash_undefined__",Ef=Object.prototype,vf=Ef.hasOwnProperty;function Tf(e){var r=this.__data__;if(Sf){var t=r[e];return t===xf?void 0:t}return vf.call(r,e)?r[e]:void 0}un.exports=Tf});var cn=u((Ny,ln)=>{"use strict";var wf=ae(),If=Object.prototype,Af=If.hasOwnProperty;function qf(e){var r=this.__data__;return wf?r[e]!==void 0:Af.call(r,e)}ln.exports=qf});var dn=u((My,pn)=>{"use strict";var Cf=ae(),jf="__lodash_hash_undefined__";function _f(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Cf&&r===void 0?jf:r,this}pn.exports=_f});var hn=u((Ly,mn)=>{"use strict";var Rf=on(),Vf=an(),Jf=fn(),Ff=cn(),Pf=dn();function $(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}$.prototype.clear=Rf;$.prototype.delete=Vf;$.prototype.get=Jf;$.prototype.has=Ff;$.prototype.set=Pf;mn.exports=$});var yn=u((Dy,gn)=>{"use strict";function Nf(){this.__data__=[],this.size=0}gn.exports=Nf});var ue=u(($y,bn)=>{"use strict";function Mf(e,r){return e===r||e!==e&&r!==r}bn.exports=Mf});var fe=u((By,On)=>{"use strict";var Lf=ue();function Df(e,r){for(var t=e.length;t--;)if(Lf(e[t][0],r))return t;return-1}On.exports=Df});var xn=u((Hy,Sn)=>{"use strict";var $f=fe(),Bf=Array.prototype,Hf=Bf.splice;function Uf(e){var r=this.__data__,t=$f(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Hf.call(r,t,1),--this.size,!0}Sn.exports=Uf});var vn=u((Uy,En)=>{"use strict";var Gf=fe();function zf(e){var r=this.__data__,t=Gf(r,e);return t<0?void 0:r[t][1]}En.exports=zf});var wn=u((Gy,Tn)=>{"use strict";var kf=fe();function Wf(e){return kf(this.__data__,e)>-1}Tn.exports=Wf});var An=u((zy,In)=>{"use strict";var Kf=fe();function Yf(e,r){var t=this.__data__,n=Kf(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}In.exports=Yf});var le=u((ky,qn)=>{"use strict";var Xf=yn(),Zf=xn(),Qf=vn(),el=wn(),rl=An();function B(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}B.prototype.clear=Xf;B.prototype.delete=Zf;B.prototype.get=Qf;B.prototype.has=el;B.prototype.set=rl;qn.exports=B});var nr=u((Wy,Cn)=>{"use strict";var tl=Ae(),nl=_(),il=tl(nl,"Map");Cn.exports=il});var Rn=u((Ky,_n)=>{"use strict";var jn=hn(),ol=le(),sl=nr();function al(){this.size=0,this.__data__={hash:new jn,map:new(sl||ol),string:new jn}}_n.exports=al});var Jn=u((Yy,Vn)=>{"use strict";function ul(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}Vn.exports=ul});var ce=u((Xy,Fn)=>{"use strict";var fl=Jn();function ll(e,r){var t=e.__data__;return fl(r)?t[typeof r=="string"?"string":"hash"]:t.map}Fn.exports=ll});var Nn=u((Zy,Pn)=>{"use strict";var cl=ce();function pl(e){var r=cl(this,e).delete(e);return this.size-=r?1:0,r}Pn.exports=pl});var Ln=u((Qy,Mn)=>{"use strict";var dl=ce();function ml(e){return dl(this,e).get(e)}Mn.exports=ml});var $n=u((eb,Dn)=>{"use strict";var hl=ce();function gl(e){return hl(this,e).has(e)}Dn.exports=gl});var Hn=u((rb,Bn)=>{"use strict";var yl=ce();function bl(e,r){var t=yl(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}Bn.exports=bl});var qe=u((tb,Un)=>{"use strict";var Ol=Rn(),Sl=Nn(),xl=Ln(),El=$n(),vl=Hn();function H(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}H.prototype.clear=Ol;H.prototype.delete=Sl;H.prototype.get=xl;H.prototype.has=El;H.prototype.set=vl;Un.exports=H});var zn=u((nb,Gn)=>{"use strict";var Tl="__lodash_hash_undefined__";function wl(e){return this.__data__.set(e,Tl),this}Gn.exports=wl});var Wn=u((ib,kn)=>{"use strict";function Il(e){return this.__data__.has(e)}kn.exports=Il});var ir=u((ob,Kn)=>{"use strict";var Al=qe(),ql=zn(),Cl=Wn();function Ce(e){var r=-1,t=e==null?0:e.length;for(this.__data__=new Al;++r<t;)this.add(e[r])}Ce.prototype.add=Ce.prototype.push=ql;Ce.prototype.has=Cl;Kn.exports=Ce});var Xn=u((sb,Yn)=>{"use strict";function jl(e,r,t,n){for(var i=e.length,o=t+(n?1:-1);n?o--:++o<i;)if(r(e[o],o,e))return o;return-1}Yn.exports=jl});var Qn=u((ab,Zn)=>{"use strict";function _l(e){return e!==e}Zn.exports=_l});var ri=u((ub,ei)=>{"use strict";function Rl(e,r,t){for(var n=t-1,i=e.length;++n<i;)if(e[n]===r)return n;return-1}ei.exports=Rl});var ni=u((fb,ti)=>{"use strict";var Vl=Xn(),Jl=Qn(),Fl=ri();function Pl(e,r,t){return r===r?Fl(e,r,t):Vl(e,Jl,t)}ti.exports=Pl});var or=u((lb,ii)=>{"use strict";var Nl=ni();function Ml(e,r){var t=e==null?0:e.length;return!!t&&Nl(e,r,0)>-1}ii.exports=Ml});var sr=u((cb,oi)=>{"use strict";function Ll(e,r,t){for(var n=-1,i=e==null?0:e.length;++n<i;)if(t(r,e[n]))return!0;return!1}oi.exports=Ll});var pe=u((pb,si)=>{"use strict";function Dl(e,r){for(var t=-1,n=e==null?0:e.length,i=Array(n);++t<n;)i[t]=r(e[t],t,e);return i}si.exports=Dl});var je=u((db,ai)=>{"use strict";function $l(e){return function(r){return e(r)}}ai.exports=$l});var ar=u((mb,ui)=>{"use strict";function Bl(e,r){return e.has(r)}ui.exports=Bl});var li=u((hb,fi)=>{"use strict";var Hl=ir(),Ul=or(),Gl=sr(),zl=pe(),kl=je(),Wl=ar(),Kl=200;function Yl(e,r,t,n){var i=-1,o=Ul,s=!0,a=e.length,f=[],l=r.length;if(!a)return f;t&&(r=zl(r,kl(t))),n?(o=Gl,s=!1):r.length>=Kl&&(o=Wl,s=!1,r=new Hl(r));e:for(;++i<a;){var c=e[i],p=t==null?c:t(c);if(c=n||c!==0?c:0,s&&p===p){for(var d=l;d--;)if(r[d]===p)continue e;f.push(c)}else o(r,p,n)||f.push(c)}return f}fi.exports=Yl});var pi=u((gb,ci)=>{"use strict";function Xl(e,r){for(var t=-1,n=r.length,i=e.length;++t<n;)e[i+t]=r[t];return e}ci.exports=Xl});var R=u((yb,di)=>{"use strict";function Zl(e){return e!=null&&typeof e=="object"}di.exports=Zl});var hi=u((bb,mi)=>{"use strict";var Ql=D(),ec=R(),rc="[object Arguments]";function tc(e){return ec(e)&&Ql(e)==rc}mi.exports=tc});var _e=u((Ob,bi)=>{"use strict";var gi=hi(),nc=R(),yi=Object.prototype,ic=yi.hasOwnProperty,oc=yi.propertyIsEnumerable,sc=gi(function(){return arguments}())?gi:function(e){return nc(e)&&ic.call(e,"callee")&&!oc.call(e,"callee")};bi.exports=sc});var V=u((Sb,Oi)=>{"use strict";var ac=Array.isArray;Oi.exports=ac});var vi=u((xb,Ei)=>{"use strict";var Si=oe(),uc=_e(),fc=V(),xi=Si?Si.isConcatSpreadable:void 0;function lc(e){return fc(e)||uc(e)||!!(xi&&e&&e[xi])}Ei.exports=lc});var Ii=u((Eb,wi)=>{"use strict";var cc=pi(),pc=vi();function Ti(e,r,t,n,i){var o=-1,s=e.length;for(t||(t=pc),i||(i=[]);++o<s;){var a=e[o];r>0&&t(a)?r>1?Ti(a,r-1,t,n,i):cc(i,a):n||(i[i.length]=a)}return i}wi.exports=Ti});var ur=u((vb,Ai)=>{"use strict";function dc(e){return e}Ai.exports=dc});var Ci=u((Tb,qi)=>{"use strict";function mc(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)}qi.exports=mc});var Ri=u((wb,_i)=>{"use strict";var hc=Ci(),ji=Math.max;function gc(e,r,t){return r=ji(r===void 0?e.length-1:r,0),function(){for(var n=arguments,i=-1,o=ji(n.length-r,0),s=Array(o);++i<o;)s[i]=n[r+i];i=-1;for(var a=Array(r+1);++i<r;)a[i]=n[i];return a[r]=t(s),hc(e,this,a)}}_i.exports=gc});var Ji=u((Ib,Vi)=>{"use strict";function yc(e){return function(){return e}}Vi.exports=yc});var fr=u((Ab,Fi)=>{"use strict";var bc=Ae(),Oc=function(){try{var e=bc(Object,"defineProperty");return e({},"",{}),e}catch{}}();Fi.exports=Oc});var Mi=u((qb,Ni)=>{"use strict";var Sc=Ji(),Pi=fr(),xc=ur(),Ec=Pi?function(e,r){return Pi(e,"toString",{configurable:!0,enumerable:!1,value:Sc(r),writable:!0})}:xc;Ni.exports=Ec});var Di=u((Cb,Li)=>{"use strict";var vc=800,Tc=16,wc=Date.now;function Ic(e){var r=0,t=0;return function(){var n=wc(),i=Tc-(n-t);if(t=n,i>0){if(++r>=vc)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}Li.exports=Ic});var Bi=u((jb,$i)=>{"use strict";var Ac=Mi(),qc=Di(),Cc=qc(Ac);$i.exports=Cc});var Re=u((_b,Hi)=>{"use strict";var jc=ur(),_c=Ri(),Rc=Bi();function Vc(e,r){return Rc(_c(e,r,jc),e+"")}Hi.exports=Vc});var lr=u((Rb,Ui)=>{"use strict";var Jc=9007199254740991;function Fc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Jc}Ui.exports=Fc});var Ve=u((Vb,Gi)=>{"use strict";var Pc=Ie(),Nc=lr();function Mc(e){return e!=null&&Nc(e.length)&&!Pc(e)}Gi.exports=Mc});var Je=u((Jb,zi)=>{"use strict";var Lc=Ve(),Dc=R();function $c(e){return Dc(e)&&Lc(e)}zi.exports=$c});var Ki=u((Fb,Wi)=>{"use strict";var Bc=li(),Hc=Ii(),Uc=Re(),ki=Je(),Gc=Uc(function(e,r){return ki(e)?Bc(e,Hc(r,1,ki,!0)):[]});Wi.exports=Gc});var Fe=u((Pb,Yi)=>{"use strict";var zc=D(),kc=R(),Wc="[object Symbol]";function Kc(e){return typeof e=="symbol"||kc(e)&&zc(e)==Wc}Yi.exports=Kc});var Zi=u((Nb,Xi)=>{"use strict";var Yc=V(),Xc=Fe(),Zc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qc=/^\w*$/;function ep(e,r){if(Yc(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||Xc(e)?!0:Qc.test(e)||!Zc.test(e)||r!=null&&e in Object(r)}Xi.exports=ep});var ro=u((Mb,eo)=>{"use strict";var Qi=qe(),rp="Expected a function";function cr(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError(rp);var t=function(){var n=arguments,i=r?r.apply(this,n):n[0],o=t.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return t.cache=o.set(i,s)||o,s};return t.cache=new(cr.Cache||Qi),t}cr.Cache=Qi;eo.exports=cr});var no=u((Lb,to)=>{"use strict";var tp=ro(),np=500;function ip(e){var r=tp(e,function(n){return t.size===np&&t.clear(),n}),t=r.cache;return r}to.exports=ip});var oo=u((Db,io)=>{"use strict";var op=no(),sp=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ap=/\\(\\)?/g,up=op(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(sp,function(t,n,i,o){r.push(i?o.replace(ap,"$1"):n||t)}),r});io.exports=up});var co=u(($b,lo)=>{"use strict";var so=oe(),fp=pe(),lp=V(),cp=Fe(),pp=1/0,ao=so?so.prototype:void 0,uo=ao?ao.toString:void 0;function fo(e){if(typeof e=="string")return e;if(lp(e))return fp(e,fo)+"";if(cp(e))return uo?uo.call(e):"";var r=e+"";return r=="0"&&1/e==-pp?"-0":r}lo.exports=fo});var mo=u((Bb,po)=>{"use strict";var dp=co();function mp(e){return e==null?"":dp(e)}po.exports=mp});var pr=u((Hb,ho)=>{"use strict";var hp=V(),gp=Zi(),yp=oo(),bp=mo();function Op(e,r){return hp(e)?e:gp(e,r)?[e]:yp(bp(e))}ho.exports=Op});var dr=u((Ub,go)=>{"use strict";var Sp=Fe(),xp=1/0;function Ep(e){if(typeof e=="string"||Sp(e))return e;var r=e+"";return r=="0"&&1/e==-xp?"-0":r}go.exports=Ep});var bo=u((Gb,yo)=>{"use strict";var vp=pr(),Tp=dr();function wp(e,r){r=vp(r,e);for(var t=0,n=r.length;e!=null&&t<n;)e=e[Tp(r[t++])];return t&&t==n?e:void 0}yo.exports=wp});var So=u((zb,Oo)=>{"use strict";var Ip=bo();function Ap(e,r,t){var n=e==null?void 0:Ip(e,r);return n===void 0?t:n}Oo.exports=Ap});var vo=u((kb,Eo)=>{"use strict";var qp=ir(),Cp=or(),jp=sr(),_p=pe(),Rp=je(),xo=ar(),Vp=Math.min;function Jp(e,r,t){for(var n=t?jp:Cp,i=e[0].length,o=e.length,s=o,a=Array(o),f=1/0,l=[];s--;){var c=e[s];s&&r&&(c=_p(c,Rp(r))),f=Vp(c.length,f),a[s]=!t&&(r||i>=120&&c.length>=120)?new qp(s&&c):void 0}c=e[0];var p=-1,d=a[0];e:for(;++p<i&&l.length<f;){var m=c[p],h=r?r(m):m;if(m=t||m!==0?m:0,!(d?xo(d,h):n(l,h,t))){for(s=o;--s;){var w=a[s];if(!(w?xo(w,h):n(e[s],h,t)))continue e}d&&d.push(h),l.push(m)}}return l}Eo.exports=Jp});var wo=u((Wb,To)=>{"use strict";var Fp=Je();function Pp(e){return Fp(e)?e:[]}To.exports=Pp});var Ao=u((Kb,Io)=>{"use strict";var Np=pe(),Mp=vo(),Lp=Re(),Dp=wo(),$p=Lp(function(e){var r=Np(e,Dp);return r.length&&r[0]===e[0]?Mp(r):[]});Io.exports=$p});var Co=u((Yb,qo)=>{"use strict";var Bp=le();function Hp(){this.__data__=new Bp,this.size=0}qo.exports=Hp});var _o=u((Xb,jo)=>{"use strict";function Up(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}jo.exports=Up});var Vo=u((Zb,Ro)=>{"use strict";function Gp(e){return this.__data__.get(e)}Ro.exports=Gp});var Fo=u((Qb,Jo)=>{"use strict";function zp(e){return this.__data__.has(e)}Jo.exports=zp});var No=u((eO,Po)=>{"use strict";var kp=le(),Wp=nr(),Kp=qe(),Yp=200;function Xp(e,r){var t=this.__data__;if(t instanceof kp){var n=t.__data__;if(!Wp||n.length<Yp-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new Kp(n)}return t.set(e,r),this.size=t.size,this}Po.exports=Xp});var Lo=u((rO,Mo)=>{"use strict";var Zp=le(),Qp=Co(),ed=_o(),rd=Vo(),td=Fo(),nd=No();function U(e){var r=this.__data__=new Zp(e);this.size=r.size}U.prototype.clear=Qp;U.prototype.delete=ed;U.prototype.get=rd;U.prototype.has=td;U.prototype.set=nd;Mo.exports=U});var Pe=u((tO,$o)=>{"use strict";var Do=fr();function id(e,r,t){r=="__proto__"&&Do?Do(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}$o.exports=id});var mr=u((nO,Bo)=>{"use strict";var od=Pe(),sd=ue();function ad(e,r,t){(t!==void 0&&!sd(e[r],t)||t===void 0&&!(r in e))&&od(e,r,t)}Bo.exports=ad});var Uo=u((iO,Ho)=>{"use strict";function ud(e){return function(r,t,n){for(var i=-1,o=Object(r),s=n(r),a=s.length;a--;){var f=s[e?a:++i];if(t(o[f],f,o)===!1)break}return r}}Ho.exports=ud});var zo=u((oO,Go)=>{"use strict";var fd=Uo(),ld=fd();Go.exports=ld});var Xo=u((de,G)=>{"use strict";var cd=_(),Yo=typeof de=="object"&&de&&!de.nodeType&&de,ko=Yo&&typeof G=="object"&&G&&!G.nodeType&&G,pd=ko&&ko.exports===Yo,Wo=pd?cd.Buffer:void 0,Ko=Wo?Wo.allocUnsafe:void 0;function dd(e,r){if(r)return e.slice();var t=e.length,n=Ko?Ko(t):new e.constructor(t);return e.copy(n),n}G.exports=dd});var Qo=u((sO,Zo)=>{"use strict";var md=_(),hd=md.Uint8Array;Zo.exports=hd});var ts=u((aO,rs)=>{"use strict";var es=Qo();function gd(e){var r=new e.constructor(e.byteLength);return new es(r).set(new es(e)),r}rs.exports=gd});var is=u((uO,ns)=>{"use strict";var yd=ts();function bd(e,r){var t=r?yd(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}ns.exports=bd});var ss=u((fO,os)=>{"use strict";function Od(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}os.exports=Od});var fs=u((lO,us)=>{"use strict";var Sd=T(),as=Object.create,xd=function(){function e(){}return function(r){if(!Sd(r))return{};if(as)return as(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();us.exports=xd});var cs=u((cO,ls)=>{"use strict";function Ed(e,r){return function(t){return e(r(t))}}ls.exports=Ed});var hr=u((pO,ps)=>{"use strict";var vd=cs(),Td=vd(Object.getPrototypeOf,Object);ps.exports=Td});var gr=u((dO,ds)=>{"use strict";var wd=Object.prototype;function Id(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||wd;return e===t}ds.exports=Id});var hs=u((mO,ms)=>{"use strict";var Ad=fs(),qd=hr(),Cd=gr();function jd(e){return typeof e.constructor=="function"&&!Cd(e)?Ad(qd(e)):{}}ms.exports=jd});var ys=u((hO,gs)=>{"use strict";function _d(){return!1}gs.exports=_d});var yr=u((me,z)=>{"use strict";var Rd=_(),Vd=ys(),Ss=typeof me=="object"&&me&&!me.nodeType&&me,bs=Ss&&typeof z=="object"&&z&&!z.nodeType&&z,Jd=bs&&bs.exports===Ss,Os=Jd?Rd.Buffer:void 0,Fd=Os?Os.isBuffer:void 0,Pd=Fd||Vd;z.exports=Pd});var vs=u((gO,Es)=>{"use strict";var Nd=D(),Md=hr(),Ld=R(),Dd="[object Object]",$d=Function.prototype,Bd=Object.prototype,xs=$d.toString,Hd=Bd.hasOwnProperty,Ud=xs.call(Object);function Gd(e){if(!Ld(e)||Nd(e)!=Dd)return!1;var r=Md(e);if(r===null)return!0;var t=Hd.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&xs.call(t)==Ud}Es.exports=Gd});var ws=u((yO,Ts)=>{"use strict";var zd=D(),kd=lr(),Wd=R(),Kd="[object Arguments]",Yd="[object Array]",Xd="[object Boolean]",Zd="[object Date]",Qd="[object Error]",em="[object Function]",rm="[object Map]",tm="[object Number]",nm="[object Object]",im="[object RegExp]",om="[object Set]",sm="[object String]",am="[object WeakMap]",um="[object ArrayBuffer]",fm="[object DataView]",lm="[object Float32Array]",cm="[object Float64Array]",pm="[object Int8Array]",dm="[object Int16Array]",mm="[object Int32Array]",hm="[object Uint8Array]",gm="[object Uint8ClampedArray]",ym="[object Uint16Array]",bm="[object Uint32Array]",y={};y[lm]=y[cm]=y[pm]=y[dm]=y[mm]=y[hm]=y[gm]=y[ym]=y[bm]=!0;y[Kd]=y[Yd]=y[um]=y[Xd]=y[fm]=y[Zd]=y[Qd]=y[em]=y[rm]=y[tm]=y[nm]=y[im]=y[om]=y[sm]=y[am]=!1;function Om(e){return Wd(e)&&kd(e.length)&&!!y[zd(e)]}Ts.exports=Om});var As=u((he,k)=>{"use strict";var Sm=rr(),Is=typeof he=="object"&&he&&!he.nodeType&&he,ge=Is&&typeof k=="object"&&k&&!k.nodeType&&k,xm=ge&&ge.exports===Is,br=xm&&Sm.process,Em=function(){try{var e=ge&&ge.require&&ge.require("util").types;return e||br&&br.binding&&br.binding("util")}catch{}}();k.exports=Em});var Or=u((bO,js)=>{"use strict";var vm=ws(),Tm=je(),qs=As(),Cs=qs&&qs.isTypedArray,wm=Cs?Tm(Cs):vm;js.exports=wm});var Sr=u((OO,_s)=>{"use strict";function Im(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}_s.exports=Im});var xr=u((SO,Rs)=>{"use strict";var Am=Pe(),qm=ue(),Cm=Object.prototype,jm=Cm.hasOwnProperty;function _m(e,r,t){var n=e[r];(!(jm.call(e,r)&&qm(n,t))||t===void 0&&!(r in e))&&Am(e,r,t)}Rs.exports=_m});var Js=u((xO,Vs)=>{"use strict";var Rm=xr(),Vm=Pe();function Jm(e,r,t,n){var i=!t;t||(t={});for(var o=-1,s=r.length;++o<s;){var a=r[o],f=n?n(t[a],e[a],a,t,e):void 0;f===void 0&&(f=e[a]),i?Vm(t,a,f):Rm(t,a,f)}return t}Vs.exports=Jm});var Ps=u((EO,Fs)=>{"use strict";function Fm(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}Fs.exports=Fm});var Ne=u((vO,Ns)=>{"use strict";var Pm=9007199254740991,Nm=/^(?:0|[1-9]\d*)$/;function Mm(e,r){var t=typeof e;return r=r??Pm,!!r&&(t=="number"||t!="symbol"&&Nm.test(e))&&e>-1&&e%1==0&&e<r}Ns.exports=Mm});var Ls=u((TO,Ms)=>{"use strict";var Lm=Ps(),Dm=_e(),$m=V(),Bm=yr(),Hm=Ne(),Um=Or(),Gm=Object.prototype,zm=Gm.hasOwnProperty;function km(e,r){var t=$m(e),n=!t&&Dm(e),i=!t&&!n&&Bm(e),o=!t&&!n&&!i&&Um(e),s=t||n||i||o,a=s?Lm(e.length,String):[],f=a.length;for(var l in e)(r||zm.call(e,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Hm(l,f)))&&a.push(l);return a}Ms.exports=km});var $s=u((wO,Ds)=>{"use strict";function Wm(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}Ds.exports=Wm});var Hs=u((IO,Bs)=>{"use strict";var Km=T(),Ym=gr(),Xm=$s(),Zm=Object.prototype,Qm=Zm.hasOwnProperty;function eh(e){if(!Km(e))return Xm(e);var r=Ym(e),t=[];for(var n in e)n=="constructor"&&(r||!Qm.call(e,n))||t.push(n);return t}Bs.exports=eh});var Er=u((AO,Us)=>{"use strict";var rh=Ls(),th=Hs(),nh=Ve();function ih(e){return nh(e)?rh(e,!0):th(e)}Us.exports=ih});var zs=u((qO,Gs)=>{"use strict";var oh=Js(),sh=Er();function ah(e){return oh(e,sh(e))}Gs.exports=ah});var Zs=u((CO,Xs)=>{"use strict";var ks=mr(),uh=Xo(),fh=is(),lh=ss(),ch=hs(),Ws=_e(),Ks=V(),ph=Je(),dh=yr(),mh=Ie(),hh=T(),gh=vs(),yh=Or(),Ys=Sr(),bh=zs();function Oh(e,r,t,n,i,o,s){var a=Ys(e,t),f=Ys(r,t),l=s.get(f);if(l){ks(e,t,l);return}var c=o?o(a,f,t+"",e,r,s):void 0,p=c===void 0;if(p){var d=Ks(f),m=!d&&dh(f),h=!d&&!m&&yh(f);c=f,d||m||h?Ks(a)?c=a:ph(a)?c=lh(a):m?(p=!1,c=uh(f,!0)):h?(p=!1,c=fh(f,!0)):c=[]:gh(f)||Ws(f)?(c=a,Ws(a)?c=bh(a):(!hh(a)||mh(a))&&(c=ch(f))):p=!1}p&&(s.set(f,c),i(c,f,n,o,s),s.delete(f)),ks(e,t,c)}Xs.exports=Oh});var vr=u((jO,ea)=>{"use strict";var Sh=Lo(),xh=mr(),Eh=zo(),vh=Zs(),Th=T(),wh=Er(),Ih=Sr();function Qs(e,r,t,n,i){e!==r&&Eh(r,function(o,s){if(i||(i=new Sh),Th(o))vh(e,r,s,t,Qs,n,i);else{var a=n?n(Ih(e,s),o,s+"",e,r,i):void 0;a===void 0&&(a=o),xh(e,s,a)}},wh)}ea.exports=Qs});var ta=u((_O,ra)=>{"use strict";var Ah=ue(),qh=Ve(),Ch=Ne(),jh=T();function _h(e,r,t){if(!jh(t))return!1;var n=typeof r;return(n=="number"?qh(t)&&Ch(r,t.length):n=="string"&&r in t)?Ah(t[r],e):!1}ra.exports=_h});var Tr=u((RO,na)=>{"use strict";var Rh=Re(),Vh=ta();function Jh(e){return Rh(function(r,t){var n=-1,i=t.length,o=i>1?t[i-1]:void 0,s=i>2?t[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,s&&Vh(t[0],t[1],s)&&(o=i<3?void 0:o,i=1),r=Object(r);++n<i;){var a=t[n];a&&e(r,a,n,o)}return r})}na.exports=Jh});var oa=u((VO,ia)=>{"use strict";var Fh=vr(),Ph=Tr(),Nh=Ph(function(e,r,t){Fh(e,r,t)});ia.exports=Nh});var aa=u((JO,sa)=>{"use strict";var Mh=vr(),Lh=Tr(),Dh=Lh(function(e,r,t,n){Mh(e,r,t,n)});sa.exports=Dh});var la=u((FO,fa)=>{"use strict";var $h=xr(),Bh=pr(),Hh=Ne(),ua=T(),Uh=dr();function Gh(e,r,t,n){if(!ua(e))return e;r=Bh(r,e);for(var i=-1,o=r.length,s=o-1,a=e;a!=null&&++i<o;){var f=Uh(r[i]),l=t;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(i!=s){var c=a[f];l=n?n(c,f,a):void 0,l===void 0&&(l=ua(c)?c:Hh(r[i+1])?[]:{})}$h(a,f,l),a=a[f]}return e}fa.exports=Gh});var pa=u((PO,ca)=>{"use strict";var zh=la();function kh(e,r,t){return e==null?e:zh(e,r,t)}ca.exports=kh});var Kr=I($r(),1);function Hr(e){if(e===0)return 0;let r=e/1024;return Number.parseFloat(r.toFixed(2))}var Ia=["if","then","else"];function N(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Aa(e,r){switch(e){case"options":case"enum":return!0;case"oneOf":case"anyOf":return r.length>0&&r.every(t=>N(t)&&"const"in t);default:return!1}}function xe(e){if(N(e)){let r=e;if("const"in r)return r.const;if("value"in r)return r.value}return e}var Br=!1;function qa(e){Br||(Br=!0,console.warn(`[json-schema-form] A conditional branch introduces option(s) not present on the base field: ${JSON.stringify(e)}. This currently works but is deprecated and will be disallowed in a future major version. Set \`disallowNewConditionalOptions: true\` to opt into the new behavior now. (see PR #265)`))}function Ge(e,r,t){if(!e||!r||typeof e!="object"||typeof r!="object")return;let{disallowNewConditionalOptions:n=!1}=t??{};for(let[i,o]of Object.entries(r)){if(Ia.includes(i))continue;let s=e[i];if(Aa(i,o)){if(n){if(!Array.isArray(s)){e[i]=o;continue}let a=new Set(s.map(f=>xe(f)));e[i]=o.filter(f=>a.has(xe(f)));continue}else if(Array.isArray(s)){let a=new Set(s.map(l=>xe(l))),f=o.map(l=>xe(l)).filter(l=>!a.has(l));f.length>0&&qa(f)}}if(N(o))N(s)?Ge(s,o,t):s!==o&&(e[i]=o);else if(s&&Array.isArray(o))if(i==="required")for(let a of o)s.includes(a)||s.push(a);else e[i]=o;else e[i]!==o&&(e[i]=o)}}function ze(e,r){for(let[t,n]of Object.entries(r)){let i=e[t];N(n)&&N(i)?ze(i,n):i!==n&&(e[t]=n)}}var Ur="yyyy-MM-dd";function Gr(e,r){let t=new Date(e).getTime(),n=new Date(r).getTime();return t<n?"LESSER":t>n?"GREATER":"EQUAL"}function Ca(e,r){let t=Gr(e,r);return t==="GREATER"||t==="EQUAL"}function ja(e,r){let t=Gr(e,r);return t==="LESSER"||t==="EQUAL"}function zr(e,r,t,n=[]){let i=typeof e=="string",o=e==="",s=e===void 0||e===null&&t.treatNullAsUndefined,a=o||s,f=[];if(!i||a||r["x-jsf-presentation"]===void 0)return f;let{minDate:l,maxDate:c}=r["x-jsf-presentation"];return l&&!Ca(e,l)&&f.push({path:n,validation:"minDate",schema:r,value:e}),c&&!ja(e,c)&&f.push({path:n,validation:"maxDate",schema:r,value:e}),f}function kr(e){return e["x-jsf-presentation"]?.inputType==="checkbox"}var Wr="Please acknowledge this field";function Yr(e,r,t,n){let i=e["x-jsf-presentation"];switch(t){case"type":return _a(e.type);case"required":return kr(e)?Wr:"Required field";case"forbidden":return"Not allowed";case"const":return kr(e)&&r===!1?Wr:`The only accepted value is ${JSON.stringify(e.const)}.`;case"enum":return`The option "${ke(r)}" is not valid.`;case"oneOf":return`The option "${ke(r)}" is not valid.`;case"anyOf":return`The option "${ke(r)}" is not valid.`;case"not":return"The value must not satisfy the provided schema";case"minLength":return`Please insert at least ${e.minLength} characters`;case"maxLength":return`Please insert up to ${e.maxLength} characters`;case"pattern":return`Must have a valid format. E.g. ${(0,Kr.randexp)(e.pattern||"")}`;case"format":if(e.format==="email")return"Please enter a valid email address";if(e.format==="date"){let o=new Date().toISOString().split("T")[0];return`Must be a valid date in ${Ur.toLowerCase()} format. e.g. ${o}`}return`Must be a valid ${e.format} format`;case"multipleOf":return`Must be a multiple of ${e.multipleOf}`;case"maximum":return`Must be smaller or equal to ${e.maximum}`;case"exclusiveMaximum":return`Must be smaller than ${e.exclusiveMaximum}`;case"minimum":return`Must be greater or equal to ${e.minimum}`;case"exclusiveMinimum":return`Must be greater than ${e.exclusiveMinimum}`;case"minDate":return`The date must be ${i?.minDate} or after.`;case"maxDate":return`The date must be ${i?.maxDate} or before.`;case"fileStructure":return"Not a valid file.";case"maxFileSize":{let o=i?.maxFileSize,s=typeof o=="number"?Hr(o):void 0;return`File size too large.${s?` The limit is ${s} MB.`:""}`}case"accept":{let o=i?.accept;return`Unsupported file format.${o?` The acceptable formats are ${o}.`:""}`}case"minItems":{let o=e.minItems===1?"item":"items";return`Must have at least ${e.minItems} ${o}`}case"maxItems":{let o=e.maxItems===1?"item":"items";return`Must have at most ${e.maxItems} ${o}`}case"uniqueItems":return"Items must be unique";case"contains":throw new Error('"contains" is not implemented yet');case"minContains":throw new Error('"minContains" is not implemented yet');case"maxContains":throw new Error('"maxContains" is not implemented yet');case"additionalProperties":return"Additional property is not allowed";case"json-logic":return n||"The value is not valid"}}function _a(e){if(Array.isArray(e))return`The value must be a ${e.map(t=>t==="integer"?"number":t).join(" or ")}`;switch(e){case"number":case"integer":return"The value must be a number";case"boolean":return"The value must be a boolean";case"null":return"The value must be null";case"string":return"The value must be a string";case"object":return"The value must be an object";case"array":return"The value must be an array";default:return e?`The value must be ${e}`:"Invalid value"}}function ke(e){return typeof e=="string"?e:JSON.stringify(e)}var it=I(et(),1);function Ga(e,r){let t={};return r.forEach((i,o)=>{t[i]=o}),e.sort((i,o)=>{let s=t[i.name]??1/0,a=t[o.name]??1/0;return s!==a?s-a:e.indexOf(i)-e.indexOf(o)})}function We(e,r){if(typeof e=="boolean")throw new TypeError("Schema must be an object");return e["x-jsf-order"]!==void 0?Ga(r,e["x-jsf-order"]):r}function za(e,r,t){r.checkboxValue=t.const,(Array.isArray(t.type)?t.type.includes("boolean"):t.type==="boolean")&&(r.checkboxValue=!0)}function ka(e,r){if(e.options===void 0){let t=Ya(r);t&&(e.options=t,r.type==="array"&&(e.multiple=!0))}}function rt(e,r,t,n){if(e.options===void 0){let i=Qa(r,t,n);i&&(e.fields=i)}}function Wa(e,r){if(!e)return"text";switch(e){case"string":{let{oneOf:t,format:n}=r;return n==="email"?"email":n==="date"?"date":n==="data-url"?"file":t?"radio":"text"}case"number":case"integer":return"number";case"object":return"fieldset";case"array":{let{items:t}=r;return t?.properties?"group-array":"select"}case"boolean":return"checkbox";default:return"text"}}function tt(e,r,t,n){let i=t["x-jsf-presentation"];if(i?.inputType)return i.inputType;if(n&&r!=="root")throw new Error(`Strict error: Missing inputType to field "${t.title}".
2
+ You can fix the json schema or skip this error by calling createHeadlessForm(schema, { strictInputType: false })`);if(!t.type){if(t.items?.properties)return"group-array";if(t.properties)return"select"}return Wa(e||t.type||"string",t)}var nt=new Map;function Ka(e){return e.length?JSON.stringify(e):"0"}function Ee(e){let r=Ka(e),t=nt.get(r);if(t)return t;let n=e.filter(i=>i!==null&&typeof i=="object"&&i.const!==null).map(i=>{let o=i.title,s=i.const,a=typeof i["x-jsf-presentation"]=="object"?i["x-jsf-presentation"]:{},f={label:o||"",value:s},{title:l,const:c,"x-jsf-presentation":p,...d}=i;return{...f,...a,...d}});return nt.set(r,n),n}function Ya(e){if(e.oneOf)return Ee(e.oneOf||[]);if(e.items?.anyOf)return Ee(e.items.anyOf);if(e.anyOf)return Ee(e.anyOf);if(e.enum){let r=e.enum?.map(t=>({title:typeof t=="string"?t:JSON.stringify(t),const:t}))||[];return Ee(r)}return null}function Xa(e,r,t){let n=[];for(let o in e.properties){let s=e.required?.includes(o)||!1,a=j({schema:e.properties[o],name:o,required:s,originalSchema:r.properties?.[o]||e.properties[o],strictInputType:t});a&&n.push(a)}return We(e,n)}function Za(e,r,t){let n=[];if(typeof e.items!="object"||e.items===null)return[];if(e.items?.type==="object"){let o=e.items,s=r.items;for(let a in o.properties){let f=o.required?.includes(a)||!1,l=j({schema:o.properties[a],name:a,required:f,originalSchema:s?.properties?.[a]||o.properties[a],strictInputType:t});l&&(l.nameKey=a,n.push(l))}}else{let o=j({schema:e.items,name:"item",required:!1,originalSchema:r.items||e.items,strictInputType:t});o&&n.push(o)}return We(e.items,n)}function Qa(e,r,t){return typeof e.properties=="object"&&e.properties!==null?Xa(e,r,t):typeof e.items=="object"&&e.items!==null?Za(e,r,t):null}var eu=["title","type","x-jsf-errorMessage","x-jsf-presentation","oneOf","anyOf","properties"];function j({schema:e,name:r,required:t=!1,originalSchema:n,strictInputType:i=!1,type:o=void 0}){if(e===!1){let d=tt(o,r,n,i),m={type:d,name:r,inputType:d,jsonType:o||n.type,required:t,isVisible:!1};return n.default!==void 0&&(m.default=n.default),rt(m,n,n),m}if(typeof e=="boolean")return null;let s=n["x-jsf-presentation"]||{},a=e["x-jsf-presentation"]||{},f=(0,it.default)(s,a,{arrayMerge:(d,m,h)=>m}),l=e["x-jsf-errorMessage"],c=tt(o,r,e,i),p={...Object.entries(e).filter(([d])=>!eu.includes(d)).reduce((d,[m,h])=>({...d,[m]:h}),{}),name:r,inputType:c,type:c,jsonType:o||e.type,required:t,isVisible:!0,...l&&{errorMessage:l}};return p.default===void 0&&n.default!==void 0&&(p.default=n.default),c==="checkbox"&&za(c,p,e),e.title&&(p.label=e.title),Object.keys(f).length>0&&Object.entries(f).forEach(([d,m])=>{d!=="inputType"&&(p[d]=m)}),r!=="root"&&ka(p,e),rt(p,e,n),p}import L from"json-logic-js";function Te(e,r){let{validations:t,computedValues:n}=e;return{schema:{validations:t,computedValues:n},value:r}}function ot(e){return/\{\{.*?\}\}/.test(e)}function ve(e={}){return Object.entries(e).reduce((r,[t,n])=>({...r,[t]:n??Number.NaN}),{})}function st(e,r,t=[]){let n=e["x-jsf-logic-validations"];return!n||n.length===0?[]:n.map(i=>{let o=r?.schema?.validations?.[i],s=r?.value;if(!o)throw new Error(`[json-schema-form] json-logic error: "${e.title}" required validation "${i}" doesn't exist.`);if(L.apply(o.rule,ve(s))===!1){let f=o.errorMessage;return f&&ot(f)&&(f=f.replace(/\{\{(.*?)\}\}/g,(l,c)=>{let p=c.trim(),d=r.schema.computedValues?.[p];return d?L.apply(d.rule,ve(s)):L.apply({var:p},ve(s))})),[{path:t,validation:"json-logic",customErrorMessage:f,schema:e,value:s}]}return[]}).flat()}function we(e,r,t){if(!r)throw new Error(`[json-schema-form] json-logic error: Computed value "${e}" doesn't exist`);return L.apply(r,ve(t))}function at(e,r,t){if(r){let n={};Object.entries(r).forEach(([i,o])=>{let s=we(i,o.rule,t);n[i]=s}),te(e,n)}return e}function te(e,r){function t(n){if(typeof n!="object")return;let i=n["x-jsf-logic-computedAttrs"];if(i&&ru(n,r,i),typeof n.properties=="object")for(let o in n.properties)t(n.properties[o]);if(typeof n.if=="object"&&te(n.if,r),n.allOf&&n.allOf.length>0)for(let o of n.allOf)te(o,r);if(n.anyOf&&n.anyOf.length>0)for(let o of n.anyOf)te(o,r);if(n.oneOf&&n.oneOf.length>0)for(let o of n.oneOf)te(o,r);delete n["x-jsf-logic-computedAttrs"]}t(e)}function ru(e,r,t){if(typeof e!="object")return;function n(o){return ot(o)?o.replace(/\{\{(.*?)\}\}/g,(s,a)=>{let f=a.trim();return r[f]??`{{${f}}}`}):r[o]}function i(o,s,a,f){if(typeof o!="object")return;let l=s;o[l]||(o[l]={}),Object.entries(a).forEach(([c,p])=>{typeof p=="string"?o[l][c]=n(p):i(o[l],c,p,f)})}for(let o in t){let s=o,a=t[o];typeof a=="string"?e[s]=n(a):typeof e=="object"&&i(e,s,a,r)}}function Ke(e){if(e)for(let[r,t]of Object.entries(e))L.add_operation(r,t)}function Ye(e){if(e)for(let r of Object.keys(e))L.rm_operation(r)}function x(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function v(e,r){if(typeof e!=typeof r)return!1;if(e===r)return!0;if(e===null||r===null)return!1;if(Array.isArray(e)&&Array.isArray(r))return e.length!==r.length?!1:e.every((t,n)=>v(t,r[n]));if(x(e)&&x(r)){let t=Object.keys(e).sort(),n=Object.keys(r).sort();return t.length!==n.length||!v(t,n)?!1:t.every(i=>v(e[i],r[i]))}return!1}function ut(e){if(typeof structuredClone=="function")try{return structuredClone(e)}catch{}try{return JSON.parse(JSON.stringify(e))}catch{throw new Error("Deep clone failed: Object may contain circular references or non-serializable values")}}function ft(e,r,t,n,i){return Array.isArray(e)?[...tu(r,e,i),...su(r,e,i),...ou(e,r,t,n,i),...iu(r,e,t,n,i),...nu(r,e,t,n,i)]:[]}function tu(e,r,t){let n=[],i=r.length;return e.maxItems!==void 0&&i>e.maxItems&&n.push({path:t,validation:"maxItems",schema:e,value:r}),e.minItems!==void 0&&i<e.minItems&&n.push({path:t,validation:"minItems",schema:e,value:r}),n}function nu(e,r,t,n,i){if(e.items===void 0)return[];let o=[],s=Array.isArray(e.prefixItems)?e.prefixItems.length:0;for(let[a,f]of r.slice(s).entries())o.push(...O(f,e.items,t,[...i,"items",a+s],n));return o}function iu(e,r,t,n,i){if(!Array.isArray(e.prefixItems))return[];let o=[];for(let[s,a]of r.entries())s<e.prefixItems.length&&o.push(...O(a,e.prefixItems[s],t,[...i,"prefixItems",s],n));return o}function ou(e,r,t,n,i){if(!("contains"in r))return[];let o=[],s=e.filter(a=>O(a,r.contains,t,[...i,"contains"],n).length===0).length;return r.minContains===void 0&&r.maxContains===void 0?s<1&&o.push({path:i,validation:"contains",schema:r,value:e}):(r.minContains!==void 0&&s<r.minContains&&o.push({path:i,validation:"minContains",schema:r,value:e}),r.maxContains!==void 0&&s>r.maxContains&&o.push({path:i,validation:"maxContains",schema:r,value:e})),o}function su(e,r,t){if(e.uniqueItems!==!0)return[];let n=new Map;for(let i=0;i<r.length;i++){for(let o of n.values())if(v(r[i],o))return[{path:t,validation:"uniqueItems",schema:e,value:r[i]}];n.set(i,r[i])}return[]}function lt(e,r,t,n,i=[]){if(!r.allOf)return[];for(let o=0;o<r.allOf.length;o++){let s=r.allOf[o],a=O(e,s,t,[...i,"allOf",o],n);if(a.length>0)return a}return[]}function ct(e,r,t,n,i=[]){if(!r.anyOf)return[];if(i.length!==0){for(let a of r.anyOf)if(O(e,a,t,i,n).length===0)return[];return[{path:i,validation:"anyOf",schema:r,value:e}]}let o=[];for(let a of r.anyOf){let f=O(e,a,t,i,n);f.length!==0&&o.push(f)}return o.length<r.anyOf.length?[]:o.flat().reverse()}function pt(e,r,t,n,i=[]){if(!r.oneOf)return[];if(r.oneOf.length===0)return[];let o=0;for(let s=0;s<r.oneOf.length&&!(O(e,r.oneOf[s],t,i,n).length===0&&(o++,o>1));s++);return o===1?[]:[{path:i,validation:"oneOf",schema:r,value:e}]}function dt(e,r,t,n,i=[]){return r.not===void 0?[]:typeof r.not=="boolean"?r.not?[{path:i,validation:"not",schema:r,value:e}]:[]:O(e,r.not,t,i,n).length===0?[{path:i,validation:"not",schema:r,value:e}]:[]}function mt(e,r,t=[]){let n=typeof r.const<"u"?r.const:r.value;return n===void 0?[]:v(n,e)?[]:[{path:t,validation:"const",schema:r,value:e}]}function ht(e,r,t=[]){return r.enum===void 0?[]:r.enum.some(n=>v(n,e))?[]:[{path:t,validation:"enum",schema:r,value:e}]}function gt(e,r,t=[]){let n=r["x-jsf-presentation"],i=n?.inputType==="file",o=typeof n?.maxFileSize=="number"||typeof n?.accept=="string";if(!(i||o))return[];if(!Array.isArray(e))return[];if(e.length===0)return[];if(!e.every(l=>x(l)&&(typeof l.name=="string"||l instanceof File)))return[{path:t,validation:"fileStructure",schema:r,value:e}];let f=e;if(typeof n?.maxFileSize=="number"){let l=n.maxFileSize*1024;if(f.some(p=>(p.size??0)>l))return[{path:t,validation:"maxFileSize",schema:r,value:e}]}if(typeof n?.accept=="string"&&n.accept.trim()!==""){let l=n.accept.toLowerCase().split(",").map(c=>c.trim()).filter(c=>c).map(c=>c.startsWith(".")?c:`.${c}`);if(l.length>0&&!f.some(p=>{let d=p.name.toLowerCase(),m=d.includes(".")?`.${d.split(".").pop()}`:"";return m!==""&&l.includes(m)}))return[{path:t,validation:"accept",schema:r,value:e}]}return[]}function yt(e){let[r,t]=e.toString().split("e"),[n,i=""]=r.split(".");return{digits:BigInt(n+i),exponent:(t===void 0?0:Number(t))-i.length}}function au(e,r){if(Number.isInteger(e)&&Number.isInteger(r))return e%r===0;if(!Number.isFinite(e)||!Number.isFinite(r)||r===0)return!1;let t=yt(e),n=yt(r),i=Math.min(t.exponent,n.exponent),o=t.digits*10n**BigInt(t.exponent-i),s=n.digits*10n**BigInt(n.exponent-i);return o%s===0n}function bt(e,r,t=[]){let n=[],i=ne(r);return typeof e!="number"?[]:i!==void 0&&!["number","integer"].includes(i)?[]:(r.multipleOf!==void 0&&!au(e,r.multipleOf)&&n.push({path:t,validation:"multipleOf",schema:r,value:e}),r.maximum!==void 0&&e>r.maximum&&n.push({path:t,validation:"maximum",schema:r,value:e}),r.exclusiveMaximum!==void 0&&e>=r.exclusiveMaximum&&n.push({path:t,validation:"exclusiveMaximum",schema:r,value:e}),r.minimum!==void 0&&e<r.minimum&&n.push({path:t,validation:"minimum",schema:r,value:e}),r.exclusiveMinimum!==void 0&&e<=r.exclusiveMinimum&&n.push({path:t,validation:"exclusiveMinimum",schema:r,value:e}),n)}function Ot(e,r,t,n,i=[]){if(typeof r=="object"&&r.properties&&x(e)){let o=[];for(let[s,a]of Object.entries(r.properties))o.push(...O(e[s],a,t,[...i,s],n));return o}return[]}var St;(function(e){e["7bit"]="7bit",e["8bit"]="8bit",e.Base64="base64",e.Binary="binary",e.IETFToken="ietf-token",e.QuotedPrintable="quoted-printable",e.XToken="x-token"})(St||(St={}));var b;(function(e){e.Date="date",e.DateTime="date-time",e.Duration="duration",e.Email="email",e.Hostname="hostname",e.IDNEmail="idn-email",e.IDNHostname="idn-hostname",e.IPv4="ipv4",e.IPv6="ipv6",e.IRI="iri",e.IRIReference="iri-reference",e.JSONPointer="json-pointer",e.JSONPointerURIFragment="json-pointer-uri-fragment",e.RegEx="regex",e.RelativeJSONPointer="relative-json-pointer",e.Time="time",e.URI="uri",e.URIReference="uri-reference",e.URITemplate="uri-template",e.UUID="uuid"})(b||(b={}));var xt;(function(e){e.Array="array",e.Boolean="boolean",e.Integer="integer",e.Null="null",e.Number="number",e.Object="object",e.String="string"})(xt||(xt={}));var S={DATE_TIME:/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,DATE:/^\d{4}-\d{2}-\d{2}$/,TIME:/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/,DURATION:/^P(?!$)(?:\d+Y)?(?:\d+M)?(?:\d+D)?(?:T(?=\d)(?:\d+H)?(?:\d+M)?(?:\d+S)?)?$/,EMAIL:/^[\w.!#$%&'*+/=?^`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,IDN_EMAIL:/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/,HOSTNAME:/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i,IDN_HOSTNAME:/^[^\s._-].*[^\s._-]$/,IPV6_PART:/^[0-9a-f]{1,4}$/i,PROTOCOL:/^[a-z]+:/,URI_REFERENCE:/^\S*$/,UUID:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,JSON_POINTER:/^(?:\/(?:[^~/]|~0|~1)*)*$/,JSON_POINTER_URI_FRAGMENT:/^#(?:\/(?:[\w\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,RELATIVE_JSON_POINTER:/^(?:0|[1-9]\d*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,URI_TEMPLATE:/^(?:[!#$&'()*+,/:;=?@\w\-.~]|%[0-9a-f]{2}|\{[+#./;?&=,!@|]?(?:\w|%[0-9a-f]{2})+(?::[1-9]\d{0,3}|\*)?(?:,(?:\w|%[0-9a-f]{2})+(?::[1-9]\d{0,3}|\*)?)*\})*$/i},uu={[b.DateTime]:e=>S.DATE_TIME.test(e),[b.Date]:e=>S.DATE.test(e),[b.Time]:e=>S.TIME.test(e),[b.Duration]:e=>S.DURATION.test(e),[b.Email]:e=>e.length<=254&&S.EMAIL.test(e),[b.IDNEmail]:e=>e.length<=254&&S.IDN_EMAIL.test(e),[b.Hostname]:e=>e.length>255?!1:e.split(".").every(t=>S.HOSTNAME.test(t)),[b.IDNHostname]:e=>e.length>255?!1:e.split(".").every(t=>t.length<=63&&S.IDN_HOSTNAME.test(t)),[b.IPv4]:e=>{let r=e.split(".");return r.length!==4?!1:r.every(t=>{let n=Number.parseInt(t,10);return n>=0&&n<=255&&t===n.toString()})},[b.IPv6]:e=>{let r=e.split(":");if(r.length>8)return!1;let t=!1;return r.every(n=>n===""?t?!1:(t=!0,!0):S.IPV6_PART.test(n))},[b.URI]:e=>{try{let r=new URL(e);return r.protocol!==""&&S.PROTOCOL.test(r.protocol)}catch{return!1}},[b.URIReference]:e=>{try{return e.startsWith("//")?S.URI_REFERENCE.test(e.slice(2)):(new URL(e,"http://example.com"),!0)}catch{return!1}},[b.IRI]:e=>{try{let r=new URL(e);return r.protocol!==""&&S.PROTOCOL.test(r.protocol)}catch{return!1}},[b.IRIReference]:e=>{try{return e.startsWith("//")?S.URI_REFERENCE.test(e.slice(2)):(new URL(e,"http://example.com"),!0)}catch{return!1}},[b.RegEx]:e=>{try{return new RegExp(e,"u"),!0}catch{return!1}},[b.UUID]:e=>S.UUID.test(e),[b.JSONPointer]:e=>S.JSON_POINTER.test(e),[b.JSONPointerURIFragment]:e=>S.JSON_POINTER_URI_FRAGMENT.test(e),[b.RelativeJSONPointer]:e=>S.RELATIVE_JSON_POINTER.test(e),[b.URITemplate]:e=>S.URI_TEMPLATE.test(e)};function Et(e,r,t=[]){let n=[];if(typeof e!="string")return n;let i=uu[r.format];return i&&!i(e)&&n.push({path:t,validation:"format",schema:r,value:e}),n}function vt(e,r,t=[]){let n=[],i=ne(r);if(typeof e!="string")return[];if(i!==void 0&&i!=="string")return[];let o=[...new Intl.Segmenter().segment(e)].length;if(r.minLength!==void 0&&o<r.minLength&&n.push({path:t,validation:"minLength",schema:r,value:e}),r.maxLength!==void 0&&o>r.maxLength&&n.push({path:t,validation:"maxLength",schema:r,value:e}),r.pattern!==void 0&&(new RegExp(r.pattern).test(e)||n.push({path:t,validation:"pattern",schema:r,value:e})),r.format!==void 0){let s=Et(e,r,t);n.push(...s)}return n}function ne(e){if(typeof e=="boolean")return"boolean";if(e.type!==void 0)return e.type}function fu(e,r,t=[]){let n=ne(r);if(n===void 0)return[];if(n==="null"&&e===null)return[];let i=e===null?"null":Array.isArray(e)?"array":typeof e;if(Array.isArray(n)){if(e===null&&n.includes("null"))return[];for(let o of n){if(o==="array"&&Array.isArray(e))return[];if(i==="number"&&o==="integer"&&Number.isInteger(e))return[];if(i===o||o==="null"&&e===null)return[]}}else{if(n==="array"&&Array.isArray(e))return[];if(i==="number"&&n==="integer"&&Number.isInteger(e))return[];if(i===n)return[]}return[{path:t,validation:"type",schema:r,value:e}]}function lu(e,r,t={},n=[],i){return r?O(e,r,t,n,i):[]}function cu(e={}){return Object.keys(e).map(r=>({regex:new RegExp(r)}))}function O(e,r,t={},n=[],i){let o=i,s;if(!i&&r["x-jsf-logic"]){o=Te(r["x-jsf-logic"],e);let{validations:d,computedValues:m,...h}=r["x-jsf-logic"];s=h}let a=e===void 0||e===null&&t.treatNullAsUndefined,f=[];if(a)return[];if(typeof r=="boolean")return!r&&!t.allowForbiddenValues?[{path:n,validation:"forbidden",schema:r,value:e}]:[];let c=r["x-jsf-presentation"]?.inputType==="file",p=[];if(!c&&(p=fu(e,r,n),p.length>0))return p;if(r.required&&x(e)){let d=r.required.filter(m=>{let h=e[m];return Array.isArray(h)?h.length===0:x(h)?Object.keys(h).length===0:h===void 0||h===null&&t.treatNullAsUndefined});for(let m of d)f.push({path:[...n,m],validation:"required",schema:r?.properties?.[m]||r,value:e})}if(r.additionalProperties===!1&&x(e)){let d=new Set(Object.keys(r.properties||{})),m=cu(r.patternProperties);for(let h of Object.keys(e)){let w=d.has(h),ye=m.some(({regex:De})=>De.test(h));!w&&!ye&&f.push({path:[...n,h],validation:"additionalProperties",schema:r,value:e[h]})}}return[...f,...mt(e,r,n),...ht(e,r,n),...Ot(e,r,t,o,n),...ft(e,r,t,o,n),...vt(e,r,n),...bt(e,r,n),...gt(e,r,n),...dt(e,r,t,o,n),...lt(e,r,t,o,n),...ct(e,r,t,o,n),...pt(e,r,t,o,n),...Tt(e,r,t,o,n),...zr(e,r,t,n),...lu(e,s,t,n,o),...st(r,o,n)]}function Xe(e,r,t,n,i=[]){let o=typeof r=="boolean",s=O(e,r,{...t,...o?{allowForbiddenValues:!1}:{}},i,n).length===0,a=!o&&"validations"in r?pu(e,r.validations,n):!0,f=!o&&"computedValues"in r?du(e,r.computedValues,n):!0;return s&&a&&f}function pu(e,r,t){if(!t)throw new Error("`if` node with `validations` property but no `jsonLogicContext` present");return Object.entries(r??{}).every(([i,o])=>{let s=t?.schema?.validations?.[i]?.rule;if(!s)throw new Error(`\`if\` node with \`validations\` property but no validation rule present for ${i}`);let a=we(i,s,e);return Object.hasOwn(o,"const")&&a===o.const})}function du(e,r,t){if(!t)throw new Error("`if` node with `computedValues` property but no `jsonLogicContext` present");return Object.entries(r??{}).every(([i,o])=>{let s=t?.schema?.computedValues?.[i]?.rule;if(!s)throw new Error(`\`if\` node with \`computedValues\` property but no computed value rule present for ${i}`);let a=we(i,s,e);return Object.hasOwn(o,"const")&&a===o.const})}function Tt(e,r,t,n,i=[]){if(r.if===void 0)return[];let o=Xe(e,r.if,t,n,i);return o&&r.then!==void 0?O(e,r.then,t,[...i,"then"],n):!o&&r.else!==void 0?O(e,r.else,t,[...i,"else"],n):[]}function Ze({schema:e,values:r,options:t={}}){let n=e["x-jsf-logic"]?Te(e["x-jsf-logic"],r):void 0,i=ut(e);return ie(i,r,t,n),n?.schema.computedValues&&(at(i,n.schema.computedValues,r),ie(i,r,t,n)),i}function wt(e,r,t,n={},i){let o=Xe(e,t.if,n.legacyOptions??{},i),s=!1;return o&&t.if?.required&&(s=t.if.required.some(f=>{if(!r.properties||!r.properties[f])return!1;let l=r.properties[f],c=e[f];return O(c,l,n.legacyOptions??{}).some(d=>d.validation==="type")})),{rule:t,matches:o&&!s}}function It(e,r){return typeof e<"u"&&(!r||typeof e=="boolean")}function ie(e,r={},t={},n,i=!1){if(!x(r))return;let o=[];It(e.if,i)&&o.push(wt(r,e,e,t,n));let s=e.allOf??[],a=e["x-jsf-logic"]?.allOf??[];[...s,...a].filter(f=>It(f.if,i)).forEach(f=>{let l=wt(r,e,f,t,n);o.push(l)});for(let{rule:f,matches:l}of o)l&&f.then?(At(e,r,f.then,t,n,i),delete f.then):!l&&f.else&&(At(e,r,f.else,t,n,i),delete f.else);if(e.properties){for(let[f,l]of Object.entries(e.properties))if(typeof l=="object"){let c=l;c.type==="object"&&ie(c,r[f],t,n,i),c.items&&ie(c.items,{},t,n,!0)}}}function At(e,r,t,n={},i,o=!1){let s=t;ie(s,r,n,i,o),Ge(e,s,n)}function Qe(e,r,t){let n=j({schema:r,name:"root",required:!0,originalSchema:t,strictInputType:!1})?.fields||[];for(let i of e){let o=n.find(s=>s.name===i.name);if(o){qt(i,o),ze(i,o);let s=r.properties?.[i.name],a=t.properties?.[i.name];s&&typeof s=="object"&&i.fields&&s.type==="object"&&Qe(i.fields,s,a)}}}function qt(e,r){for(let[t]of Object.entries(e))r[t]?e[t]&&typeof e[t]=="object"&&!Array.isArray(e[t])&&r[t]&&typeof r[t]=="object"&&!Array.isArray(r[t])&&qt(e[t],r[t]):delete e[t]}function mu(e){let r=[];for(let t=0;t<e.length;t++){let n=e[t];if(["allOf","anyOf","oneOf"].includes(n)){t+1<e.length&&typeof e[t+1]=="number"&&t++;continue}n==="then"||n==="else"||(n==="items"&&typeof e[t+1]=="number"?(t++,r.push(e[t])):r.push(n))}return r}function hu(e){if(e.length===0)return null;let r={};for(let t of e){let{path:n}=t;if(n.length===0){r[""]=t.message;continue}let i=mu(n),o=r;for(let s=0;s<i.length-1;s++){let a=i[s];if(typeof a=="number"){if(!Array.isArray(o))throw new TypeError(`Expected an array at path: ${i.slice(0,s).join(".")}`);o[a]||(o[a]={}),o=o[a]}else typeof i[s+1]=="number"?a in o||(o[a]=[]):(!(a in o)||typeof o[a]=="string")&&(o[a]={}),o=o[a]}if(i.length>0){let s=i[i.length-1];o[s]=t.message}}return r}function gu(e){return e.map(r=>{let{schema:t,value:n,validation:i,customErrorMessage:o}=r;return{...r,message:Yr(t,n,i,o)}})}function yu(e,r){return typeof r!="object"||!r||!e.length?e:e.map(t=>{let n=t.schema,i=n["x-jsf-errorMessage"]?.[t.validation];return n&&i?{...t,message:i}:t})}function bu(e,r,t={}){let n={},i=O(e,r,t),o=gu(i),s=yu(o,r),a=hu(s);return a&&(n.formErrors=a),n}function Ou(e){let{schema:r,originalSchema:t,strictInputType:n}=e;return j({schema:r,name:"root",required:!0,originalSchema:t,strictInputType:n})?.fields||[]}function Su(e){if(Object.prototype.hasOwnProperty.call(e,"customProperties")&&console.error("[json-schema-form] `customProperties` is a deprecated option and it's not supported on json-schema-form v1"),e.customJsonLogicOps){if(typeof e.customJsonLogicOps!="object"||e.customJsonLogicOps===null)throw new TypeError("validationOptions.customJsonLogicOps must be an object.");for(let[r,t]of Object.entries(e.customJsonLogicOps))if(typeof t!="function")throw new TypeError(`Custom JSON Logic operator '${r}' must be a function, but received type '${typeof t}'.`)}}function er(e,r){if(typeof e=="boolean")return r;if(e.properties){let t=x(r)?{...r}:{};for(let[n,i]of Object.entries(e.properties)){let o=er(i,t[n]);o!==void 0&&(t[n]=o)}return t}if(e.items&&typeof e.items!="boolean"&&Array.isArray(r)){let t=e.items;return r.map(n=>er(t,n))}return r===void 0&&e.default!==void 0?e.default:r}function xu(e,r={}){Su(r);let t=r.strictInputType||!1,n=r?.customJsonLogicOps;Ke(n);let i=er(e,r.initialValues||{}),o=Ze({schema:e,values:i,options:r}),s=Ou({schema:o,originalSchema:e,strictInputType:t}),a=!1,f=l=>{try{Ke(n);let c=Ze({schema:e,values:l,options:r}),p=bu(l,c,r.legacyOptions);return Qe(s,c,e),p}finally{Ye(n)}};return Ye(n),{fields:s,isError:a,error:null,handleValidation:f}}var da=I(Ki(),1),K=I(So(),1),W=I(Ao(),1),ma=I(oa(),1),Me=I(aa(),1),Le=I(pa(),1),Wh=new Set(["items"]);function ha(e){return e.split(".").reduce((t,n,i)=>i===0?n:Wh.has(n)?`${t}.${n}`:`${t}.properties.${n}`,"")}function Ir(e){let{errorMessage:r,presentation:t,properties:n,...i}=e;return{...i,...t?{"x-jsf-presentation":t}:{},...r?{"x-jsf-errorMessage":r}:{}}}function Ar(e,r){return Array.isArray(r)?r:void 0}function Kh(e,r){let{if:t,then:n,else:i}=e;return(0,W.default)(t?.required||[],r).length>0||((0,W.default)(n?.required||[],r)||(0,W.default)(Object.keys(n?.properties||{}),r)).length>0||((0,W.default)(i?.required||[],r)||(0,W.default)(Object.keys(i?.properties||{}),r)).length>0}function qr(e,r){if(!r)return{warnings:null};let t=[];return Object.entries(r).forEach(([i,o])=>{let s=ha(i),a=(0,K.default)(e.properties,s);if(!a){t.push({type:"FIELD_TO_CHANGE_NOT_FOUND",message:`Changing field "${i}" was ignored because it does not exist.`});return}let f=typeof o=="function"?o(a):o,l=Ir(f);if(delete l.items,(0,Me.default)(a,l,Ar),f.properties){let c=qr((0,K.default)(e.properties,s),f.properties);c.warnings&&t.push(...c.warnings)}if(f.items){let c=a.items;if(typeof c=="object"&&c!==null){let{properties:d,...m}=f.items;if((0,Me.default)(c,Ir(m),Ar),d&&typeof d=="object"){let h=qr(c,d);h.warnings&&t.push(...h.warnings)}}}}),{warnings:t.flat()}}function Cr(e,r,t){if(!r||typeof e!="object"||e===null)return{warnings:null};let n=t?.parent;return typeof e=="object"&&e.properties&&Object.entries(e.properties).forEach(([i,o])=>{let s=n?`${n}.${i}`:i,a=r(s,o),f=Ir(a);(0,Me.default)((0,K.default)(e.properties,i),{...o,...f},Ar),o.properties&&Cr(o,r,{parent:i}),o.items&&Cr(o.items,r,{parent:i})}),{warnings:null}}function Yh(e,r){if(!r)return{warnings:null};let t=[],n=e["x-jsf-order"]||[],i=typeof r=="function"?r(n):r,o=(0,da.default)(n,i);return o.length>0&&t.push({type:"ORDER_MISSING_FIELDS",message:`Some fields got forgotten in the new order. They were automatically appended: ${o.join(", ")}`}),e["x-jsf-order"]=[...i,...o],{warnings:t}}function ga(e,r){if(!r)return{warnings:null};let t=[];return Object.entries(r).forEach(([i,o])=>{let s=ha(i);if(!o)return{warnings:null};if(o.properties){let l=(0,K.default)(e.properties,s);if(!l)return{warnings:null};let c=ga(l,o.properties);c.warnings&&t.push(...c.warnings)}if((0,K.default)(e.properties,s)){t.push({type:"FIELD_TO_CREATE_EXISTS",message:`Creating field "${i}" was ignored because it already exists.`});return}let f=(0,Le.default)({},s,o);(0,ma.default)(e.properties,f)}),{warnings:t.flat()}}function Xh(e,r){if(!r)return{schema:e,warnings:null};let t={properties:{}};Object.entries(e).forEach(([o,s])=>{switch(o){case"properties":r.forEach(a=>{(0,Le.default)(t.properties,a,s[a])});break;case"x-jsf-order":case"required":t[o]=s.filter(a=>r.includes(a));break;case"allOf":{let a=e[o]?.filter(f=>Kh(f,r));t[o]=a;break}default:t[o]=s}});let n={};t.allOf?.length&&t.allOf.forEach(o=>{let{if:s,then:a,else:f}=o,l=e.allOf?.indexOf(o);n={...n,...wr(s,{fields:r,path:`allOf[${l}].if`}),...wr(a,{fields:r,path:`allOf[${l}].then`}),...wr(f,{fields:r,path:`allOf[${l}].else`})}});let i=[];return Object.keys(n).length>0&&(Object.entries(n).forEach(([o])=>{(0,Le.default)(t.properties,o,e.properties?.[o])}),i.push({type:"PICK_MISSED_FIELD",message:`The picked fields are in conditionals that refeer other fields. They added automatically: ${Object.keys(n).map(o=>`"${o}"`).join(", ")}. Check "meta" for more details.`,meta:n})),{schema:t,warnings:i}}function wr(e,{fields:r,path:t}){if(!e)return null;let n={};return e.required?.forEach(i=>{r.includes(i)||(n[i]={path:t})}),Object.entries(e.properties||[]).forEach(([i])=>{r.includes(i)||(n[i]={path:t})}),n}function Zh(e,r){let t=JSON.parse(JSON.stringify(e)),n=qr(t,r.fields),i=Cr(t,r.allFields),o=ga(t,r.create),s=Xh(t,r.pick),a=s.schema,f=Yh(a,r.orderRoot);r.muteLogging||console.warn("json-schema-form modify(): We highly recommend you to handle/report the returned `warnings` as they highlight possible bugs in your modifications. To mute this log, pass `muteLogging: true` to the config.");let l=[n.warnings,i.warnings,o.warnings,s.warnings,f.warnings].flat().filter(Boolean);return{schema:a,warnings:l}}export{xu as createHeadlessForm,Zh as modify};
3
3
  //# sourceMappingURL=index.mjs.map