@valbuild/ui 0.96.2 → 0.97.0

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.
@@ -0,0 +1,4 @@
1
+ (function(){"use strict";function pe(t,n){(n==null||n>t.length)&&(n=t.length);for(var s=0,e=Array(n);s<n;s++)e[s]=t[s];return e}function fe(t,n){if(t){if(typeof t=="string")return pe(t,n);var s={}.toString.call(t).slice(8,-1);return s==="Object"&&t.constructor&&(s=t.constructor.name),s==="Map"||s==="Set"?Array.from(t):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?pe(t,n):void 0}}function ot(t,n){var s=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!s){if(Array.isArray(t)||(s=fe(t))||n){s&&(t=s);var e=0,i=function(){};return{s:i,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r,a=!0,o=!1;return{s:function(){s=s.call(t)},n:function(){var l=s.next();return a=l.done,l},e:function(l){o=!0,r=l},f:function(){try{a||s.return==null||s.return()}finally{if(o)throw r}}}}function Ci(t){if(Array.isArray(t))return pe(t)}function Ni(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Bi(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R(t){return Ci(t)||Ni(t)||fe(t)||Bi()}function k(t){"@babel/helpers - typeof";return k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},k(t)}function Wi(t,n){if(typeof t!="object"||!t)return t;var s=t[Symbol.toPrimitive];if(s!==void 0){var e=s.call(t,n);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function De(t){var n=Wi(t,"string");return typeof n=="symbol"?n:n+""}function p(t,n,s){return(n=De(n))in t?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,t}function Ge(t,n){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);n&&(e=e.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),s.push.apply(s,e)}return s}function H(t){for(var n=1;n<arguments.length;n++){var s=arguments[n]!=null?arguments[n]:{};n%2?Ge(Object(s),!0).forEach(function(e){p(t,e,s[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):Ge(Object(s)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(s,e))})}return t}function Li(t){if(Array.isArray(t))return t}function Ji(t,n){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var e,i,r,a,o=[],l=!0,u=!1;try{if(r=(s=s.call(t)).next,n!==0)for(;!(l=(e=r.call(s)).done)&&(o.push(e.value),o.length!==n);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&s.return!=null&&(a=s.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Di(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function at(t,n){return Li(t)||Ji(t,n)||fe(t,n)||Di()}function G(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Gi(t,n){for(var s=0;s<n.length;s++){var e=n[s];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,De(e.key),e)}}function U(t,n,s){return n&&Gi(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var X=(function(){function t(){G(this,t)}return U(t,[{key:"executeCustomValidateFunctions",value:function(s,e,i){var r=[],a=ot(e),o;try{for(a.s();!(o=a.n()).done;){var l=o.value;try{var u=l(s,i);u&&r.push({message:u,value:s})}catch(c){r.push({message:"Error in custom validate function: ".concat(c instanceof Error?c.message:String(c)),value:s,schemaError:!0})}}}catch(c){a.e(c)}finally{a.f()}return r}},{key:"appendValidationError",value:function(s,e,i,r,a){return s?(s[e]?s[e].push({message:i,value:r,schemaError:a}):s[e]=[{message:i,value:r,schemaError:a}],s):p({},e,[{message:i,value:r,schemaError:a}])}}])})();function Gt(t){return Gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Gt(t)}function Ue(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ue=function(){return!!t})()}function Ui(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ki(t,n){if(n&&(typeof n=="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ui(t)}function Z(t,n,s){return n=Gt(n),Ki(t,Ue()?Reflect.construct(n,[],Gt(t).constructor):n.apply(t,s))}function me(t,n){return me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,e){return s.__proto__=e,s},me(t,n)}function Q(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&me(t,n)}var Ke=Symbol("GetSchema"),Ye=Symbol("Path"),Yi=Symbol("GetSource");function Xe(t){return t[Ke]}var Y="_type",P="_ref";function Xi(t){return k(t)==="object"&&t!==null&&Y in t&&t[Y]==="file"&&P in t&&typeof t[P]=="string"}function Zi(t){return k(t)==="object"&&t!==null&&t!==void 0&&Ye in t&&"val"in t}function Ut(t){return t[Ye]}var Ze=(function(t){function n(s){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{},l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:!1,c=arguments.length>7?arguments[7]:void 0;return G(this,n),e=Z(this,n),e.options=s,e.opt=i,e.isRemote=r,e.customValidateFunctions=a,e.moduleMetadata=o,e.isReadonly=l,e.isHidden=u,e.description=c,e}return Q(n,t),U(n,[{key:"describe",value:function(e){return new n(this.options,this.opt,this.isRemote,this.customValidateFunctions,this.moduleMetadata,this.isReadonly,this.isHidden,e??void 0)}},{key:"remote",value:function(){return new n(this.options,this.opt,!0,this.customValidateFunctions,this.moduleMetadata,this.isReadonly,this.isHidden,this.description)}},{key:"validate",value:function(e){return new n(this.options,this.opt,this.isRemote,[].concat(R(this.customValidateFunctions),[e]),this.moduleMetadata,this.isReadonly,this.isHidden,this.description)}},{key:"executeValidate",value:function(e,i){var r=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});if(this.opt&&i==null)return r.length>0?p({},e,r):!1;if(i==null)return p({},e,[].concat(R(r),[{message:"Non-optional file was null or undefined.",value:i}]));if(typeof i[P]!="string")return p({},e,[].concat(R(r),[{message:"File did not have a file reference string. Got: ".concat(k(i[P])),value:i}]));if(this.isRemote&&i[Y]!=="remote")return p({},e,[].concat(R(r),[{message:"Expected a remote file, but got a local file.",value:i,fixes:["file:upload-remote"]}]));if(this.isRemote&&i[Y]==="remote")return p({},e,[].concat(R(r),[{message:"Remote file was not checked.",value:i,fixes:["file:check-remote"]}]));if(!this.isRemote&&i[Y]==="remote")return p({},e,[].concat(R(r),[{message:"Expected locale file, but found remote.",value:i,fixes:["file:download-remote"]}]));if(i[Y]!=="file")return p({},e,[].concat(R(r),[{message:"File did not have the valid file extension type. Got: ".concat(i[Y]),value:i}]));var a=this.options||{},o=a.accept,l=i.metadata||{},u=l.mimeType;if(o&&u&&!u.includes("/"))return p({},e,[].concat(R(r),[{message:"Invalid mime type format. Got: ".concat(u),value:i}]));if(o&&u&&u.includes("/")){var c=o.split(",").map(function(h){return h.trim()}),d=c.some(function(h){if(h==="*/*")return!0;if(h.endsWith("/*")){var v=h.slice(0,-2);return u.startsWith(v)}return h===u});if(!d)return p({},e,[].concat(R(r),[{message:"Mime type mismatch. Found '".concat(u,"' but schema accepts '").concat(o,"'"),value:i}]))}var g=et.filenameToMimeType(i[P]);return g?g!==u?p({},e,[].concat(R(r),[{message:"Mime type and file extension not matching. Mime type is '".concat(u,"' but file extension is '").concat(g,"'"),value:i}])):i.metadata?p({},e,[].concat(R(r),[{message:"Found metadata, but it could not be validated. File metadata must be an object with the mimeType.",value:i,fixes:["file:check-metadata"]}])):p({},e,[].concat(R(r),[{message:"Missing File metadata.",value:i,fixes:["file:add-metadata"]}])):p({},e,[].concat(R(r),[{message:"Could not determine mime type from file extension. Got: ".concat(i[P]),value:i}]))}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:i===null?{success:!1,errors:p({},e,[{message:"Expected 'object', got 'null'",typeError:!0}])}:k(i)!=="object"?{success:!1,errors:p({},e,[{message:"Expected object, got '".concat(k(i),"'"),typeError:!0}])}:P in i?Y in i&&i[Y]==="file"?{success:!0,data:i}:{success:!1,errors:p({},e,[{message:"Value of this schema must use: 'c.file' (error type: missing_file_extension)",typeError:!0}])}:{success:!1,errors:p({},e,[{message:"Value of this schema must use: 'c.file' (error type: missing_ref_prop)",typeError:!0}])}}},{key:"nullable",value:function(){return new n(this.options,!0,this.isRemote,this.customValidateFunctions,this.moduleMetadata,this.isReadonly,this.isHidden,this.description)}},{key:"readonly",value:function(){return new n(this.options,this.opt,this.isRemote,this.customValidateFunctions,this.moduleMetadata,!0,this.isHidden,this.description)}},{key:"hidden",value:function(){return new n(this.options,this.opt,this.isRemote,this.customValidateFunctions,this.moduleMetadata,this.isReadonly,!0,this.description)}},{key:"executeSerialize",value:function(){var e,i=this.moduleMetadata?Object.keys(this.moduleMetadata):[];return{type:"file",options:this.options,opt:this.opt,remote:this.isRemote,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0,referencedModule:i.length>0?i[0]:void 0,readonly:this.isReadonly,hidden:this.isHidden,description:this.description}}},{key:"executeRender",value:function(){return{}}}])})(X),Qi=function(n){var s=!!n&&!!et.getValPath(n);if(s){for(var e={},i=0,r=[n];i<r.length;i++){var a=r[i],o=Ut(a);if(o===void 0)throw new Error("Invalid argument passed to s.file(). Expected a ValModule constructed through c.define, but got an object without a valid module path.");e[o]=ve(a)}return new Ze({},!1,!1,[],e)}return new Ze(n)};function qi(t){return t[P].startsWith("/public")?t.patch_id?{url:"/api/val/files"+t[P]+"?patch_id=".concat(t.patch_id),metadata:t.metadata}:{url:t[P].slice(7),metadata:t.metadata}:{url:t[P]+(t.patch_id?"?patch_id=".concat(t.patch_id):""),metadata:t.metadata}}function pt(t,n){if(k(n)==="symbol")throw Error("Cannot create val path of array item with symbol prop: ".concat(n.toString()));if(t)return t.includes(et.ModuleFilePathSep)?"".concat(t,".").concat(JSON.stringify(n)):"".concat(t).concat(et.ModuleFilePathSep).concat(JSON.stringify(n))}function q(t,n){if(k(n)==="symbol")throw Error("Cannot create val path of array item with symbol prop: ".concat(n.toString()));if(!t)throw Error("Cannot create val path of array item of empty or missing path: ".concat(t,". Item: ").concat(n));return t.includes(et.ModuleFilePathSep)?"".concat(t,".").concat(JSON.stringify(n)):"".concat(t).concat(et.ModuleFilePathSep).concat(JSON.stringify(n))}var Tt=(function(t){function n(s){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:!1,c=arguments.length>7?arguments[7]:void 0;return G(this,n),e=Z(this,n),e.options=s,e.opt=i,e.isRaw=r,e.customValidateFunctions=a,e.renderInput=o,e.isReadonly=l,e.isHidden=u,e.description=c,e}return Q(n,t),U(n,[{key:"describe",value:function(e){return new n(this.options,this.opt,this.isRaw,this.customValidateFunctions,this.renderInput,this.isReadonly,this.isHidden,e??void 0)}},{key:"min",value:function(e){return this.minLength(e)}},{key:"minLength",value:function(e){return new n(H(H({},this.options),{},{minLength:e}),this.opt,this.isRaw,this.customValidateFunctions,this.renderInput,this.isReadonly,this.isHidden,this.description)}},{key:"max",value:function(e){return this.maxLength(e)}},{key:"maxLength",value:function(e){return new n(H(H({},this.options),{},{maxLength:e}),this.opt,this.isRaw,this.customValidateFunctions,this.renderInput,this.isReadonly,this.isHidden,this.description)}},{key:"regexp",value:function(e,i){return new n(H(H({},this.options),{},{regexp:e,regExpMessage:i}),this.opt,this.isRaw,this.customValidateFunctions,this.renderInput,this.isReadonly,this.isHidden,this.description)}},{key:"validate",value:function(e){return new n(this.options,this.opt,this.isRaw,this.customValidateFunctions.concat(e),this.renderInput,this.isReadonly,this.isHidden,this.description)}},{key:"executeValidate",value:function(e,i){var r,a,o,l=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});return this.opt&&i==null?l.length>0?p({},e,l):!1:!this.opt&&i==null?p({},e,[{message:"Expected 'string', got '".concat(i===null?"null":"undefined","'"),value:i}]):typeof i!="string"?p({},e,[{message:"Expected 'string', got '".concat(k(i),"'"),value:i}]):((r=this.options)!==null&&r!==void 0&&r.maxLength&&i.length>this.options.maxLength&&l.push({message:"Expected string to be at most ".concat(this.options.maxLength," characters long, got ").concat(i.length),value:i}),(a=this.options)!==null&&a!==void 0&&a.minLength&&i.length<this.options.minLength&&l.push({message:"Expected string to be at least ".concat(this.options.minLength," characters long, got ").concat(i.length),value:i}),(o=this.options)!==null&&o!==void 0&&o.regexp&&!this.options.regexp.test(i)&&l.push({message:this.options.regExpMessage||"Expected string to match reg exp: ".concat(this.options.regexp.toString(),", got '").concat(i,"'"),value:i}),l.length>0?p({},e,l):!1)}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:typeof i=="string"?{success:!0,data:i}:{success:!1,errors:p({},e,[{message:"Expected 'string', got '".concat(k(i),"'"),typeError:!0}])}}},{key:"nullable",value:function(){return new n(this.options,!0,this.isRaw,this.customValidateFunctions,this.renderInput,this.isReadonly,this.isHidden,this.description)}},{key:"readonly",value:function(){return new n(this.options,this.opt,this.isRaw,this.customValidateFunctions,this.renderInput,!0,this.isHidden,this.description)}},{key:"hidden",value:function(){return new n(this.options,this.opt,this.isRaw,this.customValidateFunctions,this.renderInput,this.isReadonly,!0,this.description)}},{key:"raw",value:function(){return new n(this.options,this.opt,!0,this.customValidateFunctions,this.renderInput,this.isReadonly,this.isHidden,this.description)}},{key:"executeSerialize",value:function(){var e,i,r,a,o;return{type:"string",options:{maxLength:(e=this.options)===null||e===void 0?void 0:e.maxLength,minLength:(i=this.options)===null||i===void 0?void 0:i.minLength,regexp:((r=this.options)===null||r===void 0?void 0:r.regexp)&&{message:this.options.regExpMessage,source:this.options.regexp.source,flags:this.options.regexp.flags},customValidate:this.customValidateFunctions&&((a=this.customValidateFunctions)===null||a===void 0?void 0:a.length)>0},opt:this.opt,raw:this.isRaw,customValidate:this.customValidateFunctions&&((o=this.customValidateFunctions)===null||o===void 0?void 0:o.length)>0,readonly:this.isReadonly,hidden:this.isHidden,description:this.description}}},{key:"render",value:function(e){return new n(this.options,this.opt,this.isRaw,this.customValidateFunctions,e,this.isReadonly,this.isHidden,this.description)}},{key:"executeRender",value:function(e,i){return this.renderInput?this.renderInput.as==="code"?p({},e,{status:"success",data:{layout:this.renderInput.as,language:this.renderInput.language}}):p({},e,{status:"success",data:{layout:this.renderInput.as}}):{}}}])})(X),Kt=function(n){return new Tt(n)},lt=(function(t){function n(s){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,l=arguments.length>5?arguments[5]:void 0;return G(this,n),e=Z(this,n),e.items=s,e.opt=i,e.customValidateFunctions=r,e.isReadonly=a,e.isHidden=o,e.description=l,e}return Q(n,t),U(n,[{key:"describe",value:function(e){return new n(this.items,this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,e??void 0)}},{key:"validate",value:function(e){return new n(this.items,this.opt,[].concat(R(this.customValidateFunctions),[e]),this.isReadonly,this.isHidden,this.description)}},{key:"executeValidate",value:function(e,i){var r=!1,a=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});if(this.opt&&i==null)return a.length>0?p({},e,a):!1;if(i===null)return p({},e,[{message:"Expected 'object', got 'null'"}]);if(k(i)!=="object")return p({},e,[{message:"Expected 'object', got '".concat(k(i),"'")}]);if(Array.isArray(i))return p({},e,[{message:"Expected 'object', got 'array'"}]);var o=ot(a),l;try{for(o.s();!(l=o.n()).done;){var u=l.value;r=this.appendValidationError(r,e,u.message,i,u.schemaError)}}catch(x){o.e(x)}finally{o.f()}for(var c=0,d=Object.entries(this.items);c<d.length;c++){var g=at(d[c],2),h=g[0],v=g[1],m=pt(e,h);if(!m)r=this.appendValidationError(r,e,"Internal error: could not create path at ".concat(!e&&typeof e=="string"?"<empty string>":e," at key ").concat(h),i);else{var f=v.executeValidate(m,i[h]);f&&r?r=H(H({},f),r):f&&(r=f)}}return r}},{key:"executeAssert",value:function(e,i){if(this.opt&&i===null)return{success:!0,data:i};if(i===null)return{success:!1,errors:p({},e,[{message:"Expected 'object', got 'null'",typeError:!0}])};if(k(i)!=="object")return{success:!1,errors:p({},e,[{message:"Expected 'object', got '".concat(k(i),"'"),typeError:!0}])};if(Array.isArray(i))return{success:!1,errors:p({},e,[{message:"Expected 'object', got 'array'",typeError:!0}])};for(var r=[],a=0,o=Object.keys(this.items);a<o.length;a++){var l=o[a],u=pt(e,l);u?l in i||r.push({message:"Expected key '".concat(l,"' not found in object"),typeError:!0}):r.push({message:"Internal error: could not create path at ".concat(!e&&typeof e=="string"?"<empty string>":e," at key ").concat(l),internalError:!0})}return r.length>0?{success:!1,errors:p({},e,r)}:{success:!0,data:i}}},{key:"nullable",value:function(){return new n(this.items,!0,[],this.isReadonly,this.isHidden,this.description)}},{key:"readonly",value:function(){return new n(this.items,this.opt,this.customValidateFunctions,!0,this.isHidden,this.description)}},{key:"hidden",value:function(){return new n(this.items,this.opt,this.customValidateFunctions,this.isReadonly,!0,this.description)}},{key:"executeSerialize",value:function(){var e;return{type:"object",items:Object.fromEntries(Object.entries(this.items).map(function(i){var r=at(i,2),a=r[0],o=r[1];return[a,o.executeSerialize()]})),opt:this.opt,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0,readonly:this.isReadonly,hidden:this.isHidden,description:this.description}}},{key:"executeRender",value:function(e,i){var r={};if(i===null)return r;for(var a in this.items){var o=i[a];if(o!=null){var l=q(e,a),u=this.items[a].executeRender(l,o);for(var c in u){var d=c;r[d]=u[d]}}}return r}}])})(X),Qe=function(n){return new lt(n)};Qe({get test(){return Kt()}});var Yt=(function(t){function n(s){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,l=arguments.length>5?arguments[5]:void 0;return G(this,n),e=Z(this,n),p(e,"renderInput",null),e.item=s,e.opt=i,e.customValidateFunctions=r,e.isReadonly=a,e.isHidden=o,e.description=l,e}return Q(n,t),U(n,[{key:"describe",value:function(e){return new n(this.item,this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,e??void 0)}},{key:"validate",value:function(e){return new n(this.item,this.opt,[].concat(R(this.customValidateFunctions),[e]),this.isReadonly,this.isHidden,this.description)}},{key:"executeValidate",value:function(e,i){var r=this.executeAssert(e,i);if(!r.success)return r.errors;if(r.data===null)return!1;for(var a={},o=0,l=Object.entries(r.data);o<l.length;o++){var u=at(l[o],2),c=u[0],d=u[1],g=q(e,Number(c)),h=this.item.executeValidate(g,d);h&&(a=H(H({},h),a))}return Object.keys(a).length===0?!1:a}},{key:"executeAssert",value:function(e,i){return i===null&&this.opt?{success:!0,data:i}:i===null?{success:!1,errors:p({},e,[{message:"Expected 'array', got 'null'",typeError:!0}])}:k(i)!=="object"?{success:!1,errors:p({},e,[{message:"Expected 'object', got '".concat(k(i),"'"),typeError:!0}])}:Array.isArray(i)?{success:!0,data:i}:{success:!1,errors:p({},e,[{message:"Expected object of type 'array'",typeError:!0}])}}},{key:"nullable",value:function(){return new n(this.item,!0,[],this.isReadonly,this.isHidden,this.description)}},{key:"readonly",value:function(){return new n(this.item,this.opt,this.customValidateFunctions,!0,this.isHidden,this.description)}},{key:"hidden",value:function(){return new n(this.item,this.opt,this.customValidateFunctions,this.isReadonly,!0,this.description)}},{key:"executeSerialize",value:function(){var e;return{type:"array",item:this.item.executeSerialize(),opt:this.opt,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0,readonly:this.isReadonly,hidden:this.isHidden,description:this.description}}},{key:"executeRender",value:function(e,i){var r={};if(i===null)return r;for(var a=0;a<i.length;a++){var o=a,l=i[o];if(l!=null){var u=q(e,o),c=this.item.executeRender(u,l);for(var d in c){var g=d;r[g]=c[g]}}}if(this.renderInput){var h=this.renderInput,v=h.select,m=h.as;m!=="list"&&(r[e]={status:"error",message:"Unknown layout type: "+m});try{r[e]={status:"success",data:{layout:"list",parent:"array",items:i.map(function(f){var x=v({val:f}),y=x.title,V=x.subtitle,b=x.image;return{title:y,subtitle:V,image:b}})}}}catch(f){r[e]={status:"error",message:f instanceof Error?f.message:"Unknown error"}}}return r}},{key:"render",value:function(e){return this.renderInput=e,this}}])})(X),$i=function(n){return new Yt(n)},xt=(function(t){function n(s){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,l=arguments.length>5?arguments[5]:void 0;return G(this,n),e=Z(this,n),e.value=s,e.opt=i,e.customValidateFunctions=r,e.isReadonly=a,e.isHidden=o,e.description=l,e}return Q(n,t),U(n,[{key:"describe",value:function(e){return new n(this.value,this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,e??void 0)}},{key:"validate",value:function(e){return new n(this.value,this.opt,[].concat(R(this.customValidateFunctions),[e]),this.isReadonly,this.isHidden,this.description)}},{key:"executeValidate",value:function(e,i){var r=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});return this.opt&&i==null?r.length>0?p({},e,r):!1:typeof i!="string"?p({},e,[].concat(R(r),[{message:"Expected 'string', got '".concat(k(i),"'"),value:i}])):i!==this.value?p({},e,[].concat(R(r),[{message:"Expected literal '".concat(this.value,"', got '").concat(i,"'"),value:i}])):r.length>0?p({},e,r):!1}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:i===null?{success:!1,errors:p({},e,[{message:"Expected 'string', got 'null'",typeError:!0}])}:typeof i=="string"&&i===this.value?{success:!0,data:i}:{success:!1,errors:p({},e,[{message:"Expected literal '".concat(this.value,"', got '").concat(i,"'"),typeError:!0}])}}},{key:"nullable",value:function(){return new n(this.value,!0,[],this.isReadonly,this.isHidden,this.description)}},{key:"readonly",value:function(){return new n(this.value,this.opt,this.customValidateFunctions,!0,this.isHidden,this.description)}},{key:"hidden",value:function(){return new n(this.value,this.opt,this.customValidateFunctions,this.isReadonly,!0,this.description)}},{key:"executeSerialize",value:function(){var e;return{type:"literal",value:this.value,opt:this.opt,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0,readonly:this.isReadonly,hidden:this.isHidden,description:this.description}}},{key:"executeRender",value:function(){return{}}}])})(X),tn=function(n){return new xt(n)},qe=(function(t){function n(s,e){var i,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,u=arguments.length>6?arguments[6]:void 0;return G(this,n),i=Z(this,n),i.key=s,i.items=e,i.opt=r,i.customValidateFunctions=a,i.isReadonly=o,i.isHidden=l,i.description=u,i}return Q(n,t),U(n,[{key:"describe",value:function(e){return new n(this.key,this.items,this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,e??void 0)}},{key:"validate",value:function(e){return new n(this.key,this.items,this.opt,this.customValidateFunctions.concat(e),this.isReadonly,this.isHidden,this.description)}},{key:"executeValidate",value:function(e,i){var r=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e}),a=i;if(this.opt&&a===null)return r.length>0?p({},e,r):!1;if(!this.key)return r.length>0?p({},e,r):p({},e,[].concat(R(r),[{message:"Missing required first argument in union",schemaError:!0}]));var o=this.key;if(!Array.isArray(this.items))return r.length>0?p({},e,r):p({},e,[].concat(R(r),[{message:"A union schema must take more than 1 schema arguments",schemaError:!0}]));if(typeof o=="string"){if(this.items.some(function(w){return!(w instanceof lt)}))return r.length>0?p({},e,r):p({},e,[].concat(R(r),[{message:"Key is a string, so all schema items must be objects",schemaError:!0}]));var l=this.items,u=l.map(function(w){return w.executeSerialize()}),c=u.filter(function(w){return w.type!=="object"||w.items[o].type!=="literal"});if(c.length>0)return r.length>0?p({},e,r):p({},e,[].concat(R(r),[{message:"All schema items must be objects with a key: ".concat(o," that is a literal schema. Found: ").concat(JSON.stringify(c,null,2)),schemaError:!0}]));var d=u,g=d.filter(function(w){return w.items[o].opt});if(g.length>1)return r.length>0?p({},e,r):p({},e,[].concat(R(r),[{message:"Schema cannot have an optional keys: ".concat(o),schemaError:!0}]));if(k(a)!=="object")return r.length>0?p({},e,r):p({},e,[].concat(R(r),[{message:"Expected an object",typeError:!0}]));var h=a;if(h[o]===void 0)return r.length>0?p({},e,r):p({},e,[].concat(R(r),[{message:"Missing required key: ".concat(o),typeError:!0}]));var v=[],m=ot(d),f;try{for(m.s();!(f=m.n()).done;){var x=f.value,y=x.items[o];if(y.type==="literal")if(!v.includes(y.value))v.push(y.value);else return r.length>0?p({},e,r):p({},e,[].concat(R(r),[{message:"Found duplicate key in schema: ".concat(y.value),schemaError:!0}]))}}catch(w){m.e(w)}finally{m.f()}var V=l.find(function(w){return!w.items[o].executeValidate(e,h[o])});if(!V){var b=pt(e,o);if(!b)throw new Error("Internal error: could not create path at ".concat(!e&&typeof e=="string"?"<empty string>":e," at key ").concat(o));return p({},b,[{message:'Invalid key: "'.concat(o,'". Value was: "').concat(h[o],'". Valid values: ').concat(d.map(function(w){var E=w.items[o];if(E.type==="literal"&&E.value)return'"'.concat(E.value,'"');throw new Error("Expected literal schema, got ".concat(JSON.stringify(E,null,2)))}).join(", "))}])}var j=V.executeValidate(e,h);if(j)return j}else if(o instanceof xt){if(this.items.some(function(w){return!(w instanceof xt)}))return p({},e,[{message:"Key is a literal schema, so all schema items must be literals",typeError:!0}]);var A=[o].concat(R(this.items));if(typeof a=="string"){var O=A.some(function(w){return!w.executeValidate(e,a)});if(!O)return r.length>0?p({},e,r):p({},e,[].concat(R(r),[{message:"Union must match one of the following: ".concat(A.map(function(w){return'"'.concat(w.value,'"')}).join(", "))}]))}}else return r.length>0?p({},e,r):p({},e,[].concat(R(r),[{message:"Expected a string or literal"}]));return r.length>0?p({},e,r):!1}},{key:"executeAssert",value:function(e,i){if(this.opt&&i===null)return{success:!0,data:i};if(i===null)return{success:!1,errors:p({},e,[{message:"Expected 'object', got 'null'",typeError:!0}])};if(!this.key)return{success:!1,errors:p({},e,[{message:"Missing required first argument in union schema",schemaError:!0}])};if(!Array.isArray(this.items))return{success:!1,errors:p({},e,[{message:"The schema of this value is wrong. Schema is neither a union of literals nor a tagged union (of objects)",schemaError:!0}])};if(this.key instanceof xt){var r,a=!1,o={},l=ot((r=[this.key]).concat.apply(r,R(this.items))),u;try{for(l.s();!(u=l.n()).done;){var c=u.value;if(!(c instanceof xt))return{success:!1,errors:p({},e,[{message:"Schema of value is a union of string, so all schema items must be literals",schemaError:!0}])};if(typeof i!="string"){o[e]=[{message:"Expected 'string', got '".concat(k(i),"'"),typeError:!0}];continue}var d=c.executeAssert(e,i);if(d.success){a=!0;break}else for(var g=0,h=Object.entries(d.errors);g<h.length;g++){var v,m=at(h[g],2),f=m[0],x=m[1];o[f]||(o[f]=[]),(v=o[f]).push.apply(v,R(x))}}}catch(D){l.e(D)}finally{l.f()}return a?{success:!0,data:i}:{success:!1,errors:o}}else if(typeof this.key=="string"){var y=!1,V={},b=ot(this.items),j;try{for(b.s();!(j=b.n()).done;){var A=j.value,O=A.executeAssert(e,i);if(O.success){y=!0;break}else for(var w=0,E=Object.entries(O.errors);w<E.length;w++){var T,z=at(E[w],2),N=z[0],J=z[1];V[N]||(V[N]=[]),(T=V[N]).push.apply(T,R(J))}}}catch(D){b.e(D)}finally{b.f()}return y?{success:!0,data:i}:{success:!1,errors:V}}else return{success:!1,errors:p({},e,[{message:"The schema of this value is wrong. Schema is neither a union of literals nor a tagged union (of objects)",schemaError:!0}])}}},{key:"nullable",value:function(){return new n(this.key,this.items,!0,[],this.isReadonly,this.isHidden,this.description)}},{key:"readonly",value:function(){return new n(this.key,this.items,this.opt,this.customValidateFunctions,!0,this.isHidden,this.description)}},{key:"hidden",value:function(){return new n(this.key,this.items,this.opt,this.customValidateFunctions,this.isReadonly,!0,this.description)}},{key:"executeSerialize",value:function(){var e;if(typeof this.key=="string"){var i;return{type:"union",key:this.key,items:this.items.map(function(r){return r.executeSerialize()}),opt:this.opt,customValidate:this.customValidateFunctions&&((i=this.customValidateFunctions)===null||i===void 0?void 0:i.length)>0,readonly:this.isReadonly,hidden:this.isHidden,description:this.description}}return{type:"union",key:this.key.executeSerialize(),items:this.items.map(function(r){return r.executeSerialize()}),opt:this.opt,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0,readonly:this.isReadonly,hidden:this.isHidden,description:this.description}}},{key:"executeRender",value:function(e,i){var r={};if(i===null||this.key instanceof xt)return r;var a=this.key;if(typeof a=="string"){var o=this.items.find(function(d){if(d instanceof lt){var g=d.items[a];if(g instanceof xt)return k(i)==="object"&&a in i&&g.value===i[a]}return!1});if(o){var l=o.executeRender(e,i);for(var u in l){var c=u;r[c]=l[c]}return r}r[e]={status:"error",message:"Could not find a matching (object) schema for the union key: ".concat(a)}}return r[e]={status:"error",message:"The schema of this value is wrong. Expected a object union schema, but union key is not a string. Got: '".concat(JSON.stringify(a,null,2),"'")},r}}])})(X),en=function(n){for(var s=arguments.length,e=new Array(s>1?s-1:0),i=1;i<s;i++)e[i-1]=arguments[i];return new qe(n,e)},Xt=(function(t){function n(s){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{},l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:!1,c=arguments.length>7?arguments[7]:void 0;return G(this,n),e=Z(this,n),e.options=s,e.opt=i,e.isRemote=r,e.customValidateFunctions=a,e.moduleMetadata=o,e.isReadonly=l,e.isHidden=u,e.description=c,e}return Q(n,t),U(n,[{key:"describe",value:function(e){return new n(this.options,this.opt,this.isRemote,this.customValidateFunctions,this.moduleMetadata,this.isReadonly,this.isHidden,e??void 0)}},{key:"remote",value:function(){return new n(this.options,this.opt,!0,this.customValidateFunctions,this.moduleMetadata,this.isReadonly,this.isHidden,this.description)}},{key:"validate",value:function(e){return new n(this.options,this.opt,this.isRemote,[].concat(R(this.customValidateFunctions),[e]),this.moduleMetadata,this.isReadonly,this.isHidden,this.description)}},{key:"executeValidate",value:function(e,i){var r,a,o=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});if(this.opt&&i==null)return o.length>0?p({},e,o):!1;if(i==null)return p({},e,[].concat(R(o),[{message:"Non-optional image was null or undefined.",value:i}]));if(this.isRemote&&i[Y]!=="remote")return p({},e,[].concat(R(o),[{message:"Expected a remote image, but got a local image.",value:i,fixes:["image:upload-remote"]}]));if(this.isRemote&&i[Y]==="remote")return p({},e,[].concat(R(o),[{message:"Remote image was not checked.",value:i,fixes:["image:check-remote"]}]));if(!this.isRemote&&i[Y]==="remote")return p({},e,[].concat(R(o),[{message:"Expected locale image, but found remote.",value:i,fixes:["image:download-remote"]}]));if(typeof i[P]!="string")return p({},e,[].concat(R(o),[{message:"Image did not have a file reference string. Got: ".concat(k(i[P])),value:i}]));if(i[Y]!=="file")return p({},e,[].concat(R(o),[{message:"Image did not have the valid file extension type. Got: ".concat(i[Y]),value:i}]));var l=this.options||{},u=l.accept,c=(r=(a=i.metadata)===null||a===void 0?void 0:a.mimeType)!==null&&r!==void 0?r:"";if(u&&c&&!c.includes("/"))return p({},e,[].concat(R(o),[{message:"Invalid mime type format. Got: '".concat(c,"'"),value:i,fixes:["image:check-metadata"]}]));if(u&&c&&c.includes("/")){var d=u.split(",").map(function(m){return m.trim()}),g=d.some(function(m){if(m==="*/*")return!0;if(m.endsWith("/*")){var f=m.slice(0,-2);return c.startsWith(f)}return m===c});if(!g)return p({},e,[].concat(R(o),[{message:"Mime type mismatch. Found '".concat(c,"' but schema accepts '").concat(u,"'"),value:i,fixes:["image:check-metadata"]}]))}var h=et.filenameToMimeType(i[P]);if(!h)return p({},e,[].concat(R(o),[{message:"Could not determine mime type from file extension. Got: ".concat(i[P]),value:i,fixes:["image:check-metadata"]}]));if(h&&c&&h!==c)return p({},e,[].concat(R(o),[{message:"Mime type and file extension not matching. Mime type is '".concat(c,"' but file extension is '").concat(h,"'"),value:i,fixes:["image:check-metadata"]}]));if(i.metadata)return i.metadata.hotspot&&(k(i.metadata.hotspot)!=="object"||typeof i.metadata.hotspot.x!="number"||typeof i.metadata.hotspot.y!="number")?p({},e,[].concat(R(o),[{message:"Hotspot must be an object with x and y as numbers.",value:i}])):p({},e,[].concat(R(o),[{message:"Found metadata, but it could not be validated. Image metadata must be an object with the required props: width (positive number), height (positive number) and the mime type.",value:i,fixes:["image:check-metadata"]}]));var v=Object.keys(this.moduleMetadata).length>0;return i.metadata===void 0&&v?o.length===0?!1:p({},e,R(o)):p({},e,[].concat(R(o),[{message:"Could not validate Image metadata.",value:i,fixes:["image:add-metadata"]}]))}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:i===null?{success:!1,errors:p({},e,[{message:"Expected 'object', got 'null'",typeError:!0}])}:k(i)!=="object"?{success:!1,errors:p({},e,[{message:"Expected 'object', got '".concat(k(i),"'"),typeError:!0}])}:P in i?Y in i&&i[Y]==="file"?{success:!0,data:i}:{success:!1,errors:p({},e,[{message:"Value of this schema must use: 'c.image' (error type: missing_file_extension)",typeError:!0}])}:{success:!1,errors:p({},e,[{message:"Value of this schema must use: 'c.image' (error type: missing_ref_prop)",typeError:!0}])}}},{key:"nullable",value:function(){return new n(this.options,!0,this.isRemote,this.customValidateFunctions,this.moduleMetadata,this.isReadonly,this.isHidden,this.description)}},{key:"readonly",value:function(){return new n(this.options,this.opt,this.isRemote,this.customValidateFunctions,this.moduleMetadata,!0,this.isHidden,this.description)}},{key:"hidden",value:function(){return new n(this.options,this.opt,this.isRemote,this.customValidateFunctions,this.moduleMetadata,this.isReadonly,!0,this.description)}},{key:"executeSerialize",value:function(){var e,i=this.moduleMetadata?Object.keys(this.moduleMetadata):[];return{type:"image",options:this.options,opt:this.opt,remote:this.isRemote,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0,referencedModule:i.length>0?i[0]:void 0,readonly:this.isReadonly,hidden:this.isHidden,description:this.description}}},{key:"executeRender",value:function(){return{}}}])})(X),nn=function(n){var s=!!n&&!!et.getValPath(n);if(s){for(var e={},i=0,r=[n];i<r.length;i++){var a=r[i],o=Ut(a);if(o===void 0)throw new Error("Invalid argument passed to s.image(). Expected a ValModule constructed through c.define, but got an object without a valid module path.");e[o]=ve(a)}return new Xt({},!1,!1,[],e)}return new Xt(n)},Zt=(function(t){function n(s){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,l=arguments.length>5?arguments[5]:void 0;return G(this,n),e=Z(this,n),e.options=s,e.opt=i,e.customValidateFunctions=r,e.isReadonly=a,e.isHidden=o,e.description=l,e}return Q(n,t),U(n,[{key:"describe",value:function(e){return new n(this.options,this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,e??void 0)}},{key:"include",value:function(e){return new n(H(H({},this.options),{},{include:e}),this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,this.description)}},{key:"exclude",value:function(e){return new n(H(H({},this.options),{},{exclude:e}),this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,this.description)}},{key:"validate",value:function(e){return new n(this.options,this.opt,this.customValidateFunctions.concat(e),this.isReadonly,this.isHidden,this.description)}},{key:"executeValidate",value:function(e,i){var r,a,o=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});return this.opt&&i==null?o.length>0?p({},e,o):!1:typeof i!="string"?p({},e,[{message:"Expected 'string', got '".concat(k(i),"'"),value:i}]):p({},e,[].concat(R(o),[{fixes:["router:check-route"],message:"Did not validate route (router). This error (router:check-route) should typically be processed by Val internally. Seeing this error most likely means you have a Val version mismatch.",value:{route:i,sourcePath:e,include:(r=this.options)===null||r===void 0?void 0:r.include,exclude:(a=this.options)===null||a===void 0?void 0:a.exclude}}]))}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:typeof i=="string"?{success:!0,data:i}:{success:!1,errors:p({},e,[{message:"Expected 'string', got '".concat(k(i),"'"),typeError:!0}])}}},{key:"nullable",value:function(){return new n(this.options,!0,this.customValidateFunctions,this.isReadonly,this.isHidden,this.description)}},{key:"readonly",value:function(){return new n(this.options,this.opt,this.customValidateFunctions,!0,this.isHidden,this.description)}},{key:"hidden",value:function(){return new n(this.options,this.opt,this.customValidateFunctions,this.isReadonly,!0,this.description)}},{key:"executeSerialize",value:function(){var e,i,r,a;return{type:"route",options:{include:((e=this.options)===null||e===void 0?void 0:e.include)&&{source:this.options.include.source,flags:this.options.include.flags},exclude:((i=this.options)===null||i===void 0?void 0:i.exclude)&&{source:this.options.exclude.source,flags:this.options.exclude.flags},customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0},opt:this.opt,customValidate:this.customValidateFunctions&&((a=this.customValidateFunctions)===null||a===void 0?void 0:a.length)>0,readonly:this.isReadonly,hidden:this.isHidden,description:this.description}}},{key:"executeRender",value:function(){return{}}}])})(X),sn=function(n){return new Zt(n)},Ft=(function(t){function n(s){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,l=arguments.length>5?arguments[5]:void 0;return G(this,n),e=Z(this,n),e.options=s,e.opt=i,e.customValidateFunctions=r,e.isReadonly=a,e.isHidden=o,e.description=l,e}return Q(n,t),U(n,[{key:"describe",value:function(e){return new n(this.options,this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,e??void 0)}},{key:"maxLength",value:function(e){return new n(H(H({},this.options),{},{maxLength:e}),this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,this.description)}},{key:"minLength",value:function(e){return new n(H(H({},this.options),{},{minLength:e}),this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,this.description)}},{key:"validate",value:function(e){return new n(this.options,this.opt,[].concat(R(this.customValidateFunctions),[e]),this.isReadonly,this.isHidden,this.description)}},{key:"executeValidate",value:function(e,i){var r=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e}),a=this.executeAssert(e,i);if(!a.success)return r.length>0?p({},e,r):a.errors;var o=a.data;if(o===null&&this.opt)return r.length>0?p({},e,r):!1;if(o===null)return p({},e,[].concat(R(r),[{message:"Expected 'array', got 'null'",typeError:!0}]));var l={},u=this.internalValidate(e,o,l);return u?r.length>0?H(p({},e,r),u):u:Object.keys(l).length>0?r.length>0?H(p({},e,r),l):l:r.length>0?p({},e,r):!1}},{key:"internalValidate",value:function(e,i,r){var a=this,o=0,l=function(v,m,f){var x=function(O,w,E){f[O]||(f[O]=[]),f[O].push({message:w,typeError:E})},y=ot(m),V;try{var b=function(){var O,w,E,T,z,N,J,D,B,$,M=V.value,I=q(v,m.indexOf(M));if(typeof M=="string")return o+=M.length,0;if(k(M)!=="object")return{v:p({},I,[{message:"Expected nodes of type 'object' or 'string', got '".concat(k(M),"'"),typeError:!0}])};if(M===null)return{v:p({},I,[{message:"Expected nodes of type 'object' or 'string', got 'null'",typeError:!0}])};if(!("tag"in M))return{v:p({},I,[{message:"Expected node to either have 'tag' or be of type 'string'",typeError:!0}])};if(typeof M.tag!="string")return{v:p({},I,[{message:"Expected 'string', got '".concat(k(M.tag),"'"),typeError:!0}])};var Jt=["p","span","h1","h2","h3","h4","h5","h6","ol","ul","li","a","img","br"];if(Jt.includes(M.tag)||x(I,"Tag '".concat(M.tag,"' is not supported. Supported tags: ").concat(Jt.join(", ")),!0),M.tag==="h1"&&!((O=a.options.block)!==null&&O!==void 0&&O.h1)&&x(I,"'h' block is not valid",!1),M.tag==="h2"&&!((w=a.options.block)!==null&&w!==void 0&&w.h2)&&x(I,"'h2' block is not valid",!1),M.tag==="h3"&&!((E=a.options.block)!==null&&E!==void 0&&E.h3)&&x(I,"'h3' block is not valid",!1),M.tag==="h4"&&!((T=a.options.block)!==null&&T!==void 0&&T.h4)&&x(I,"'h4' block is not valid",!1),M.tag==="h5"&&!((z=a.options.block)!==null&&z!==void 0&&z.h5)&&x(I,"'h5' block is not valid",!1),M.tag==="h6"&&!((N=a.options.block)!==null&&N!==void 0&&N.h6)&&x(I,"'h6' block is not valid",!1),M.tag==="ol"&&!((J=a.options.block)!==null&&J!==void 0&&J.ol)&&x(I,"'ol' block is not valid",!1),M.tag==="ul"&&!((D=a.options.block)!==null&&D!==void 0&&D.ul)&&x(I,"'ul' block is not valid",!1),M.tag==="li"&&!((B=a.options.block)!==null&&B!==void 0&&B.ul)&&!(($=a.options.block)!==null&&$!==void 0&&$.ol)&&x(I,"'li' tag is invalid since neither 'ul' nor 'ol' block is not valid",!1),M.tag==="a"){var dt,ht;if(!((dt=a.options.inline)!==null&&dt!==void 0&&dt.a))x(I,"'a' inline is not valid",!1);else if((ht=a.options.inline)!==null&&ht!==void 0&&ht.a){var yt;if(!("href"in M))return{v:p({},I,[{message:"Expected 'href' in 'a'",typeError:!0}])};var Rt=q(I,"href"),S=typeof((yt=a.options.inline)===null||yt===void 0?void 0:yt.a)=="boolean"?new Zt:a.options.inline.a,W=function(){if(S instanceof Zt)return S.executeValidate(Rt,M.href);if(S instanceof Tt)return S.executeValidate(Rt,M.href);var js=S;return console.error("Exhaustive check failed in RichText (anchor href validation)",js),!1},jt=W();if(jt)for(var ws in jt){var zi,ue=ws;f[ue]||(f[ue]=[]),(zi=f[ue]).push.apply(zi,R(jt[ue]))}}}if(M.tag==="img"){var Pe,Ce;if(!((Pe=a.options.inline)!==null&&Pe!==void 0&&Pe.img))x(I,"'img' inline is not valid",!1);else if((Ce=a.options.inline)!==null&&Ce!==void 0&&Ce.img){var Ne;if(!("src"in M))return{v:p({},I,[{message:"Expected 'src' in 'img'",typeError:!0}])};var Ii=q(I,"src"),Ti=(Ne=a.options.inline)===null||Ne===void 0?void 0:Ne.img,Be=k(Ti)==="object"?Ti.executeValidate(Ii,M.src):new Xt({},!1,!1).executeValidate(Ii,M.src);if(Be)for(var ks in Be){var _i,ce=ks;f[ce]||(f[ce]=[]),(_i=f[ce]).push.apply(_i,R(Be[ce]))}}}if("styles"in M&&M.tag!=="span")return{v:p({},I,[{message:"Cannot have styles on '".concat(M.tag,"'. This is only allowed on 'span'"),typeError:!0}])};if("styles"in M){if(!Array.isArray(M.styles))return{v:p({},I,[{message:"Expected 'array', got '".concat(k(M.styles),"'"),typeError:!0}])};for(var Vs=q(I,"styles"),de=0;de<M.styles.length;de++){var We,Le,Je,Dt=M.styles[de],he=q(Vs,de);if(typeof Dt!="string")return{v:p({},he,[{message:"Expected 'string', got '".concat(k(Dt),"'"),typeError:!0}])};Dt==="bold"&&!((We=a.options.style)!==null&&We!==void 0&&We.bold)&&x(he,"Style 'bold' is not valid",!1),Dt==="italic"&&!((Le=a.options.style)!==null&&Le!==void 0&&Le.italic)&&x(he,"Style 'italic' is not valid",!1),Dt==="lineThrough"&&!((Je=a.options.style)!==null&&Je!==void 0&&Je.lineThrough)&&x(he,"Style 'lineThrough' is not valid",!1)}}if("children"in M){if(!Array.isArray(M.children))return{v:p({},I,[{message:"Expected 'array', got '".concat(k(M.children),"'"),typeError:!0}])};var Rs=q(I,"children"),Pi=l(Rs,M.children,f);if(Pi)return{v:Pi}}},j;for(y.s();!(V=y.n()).done;)if(j=b(),j!==0&&j)return j.v}catch(A){y.e(A)}finally{y.f()}return!1},u=l(e,i,r),c=[];if(this.options.maxLength&&o>this.options.maxLength&&c.push({message:"Maximum length of ".concat(this.options.maxLength," exceeded (current length: ").concat(o,")"),typeError:!1}),this.options.minLength&&o<this.options.minLength&&c.push({message:"Minimum length of ".concat(this.options.minLength," not met (current length: ").concat(o,")"),typeError:!1}),u){if(c.length>0){var d;u[e]||(u[e]=[]),(d=u[e]).push.apply(d,c)}return u}if(Object.keys(r).length>0){if(c.length>0){var g;r[e]||(r[e]=[]),(g=r[e]).push.apply(g,c)}return r}return c.length>0?p({},e,c):!1}},{key:"executeAssert",value:function(e,i){if(this.opt&&i===null)return{success:!0,data:i};if(i===null&&!this.opt)return{success:!1,errors:p({},e,[{message:"Expected 'array', got 'null'",typeError:!0}])};if(!Array.isArray(i))return{success:!1,errors:p({},e,[{message:"Expected 'array', got '".concat(k(i),"'"),typeError:!0}])};for(var r={},a=0;a<i.length;a++)this.recursiveAssert(q(e,a),i[a],r);return Object.keys(r).length>0?{success:!1,errors:r}:{success:!0,data:i}}},{key:"recursiveAssert",value:function(e,i,r){if(k(i)!=="object"){r[e]||(r[e]=[]),r[e].push({message:"Expected 'object', got '".concat(k(i),"'"),typeError:!0});return}if(Array.isArray(i)){r[e]||(r[e]=[]),r[e].push({message:"Expected 'object', got 'array'",typeError:!0});return}if(i===null){r[e]||(r[e]=[]),r[e].push({message:"Expected 'object', got 'null'",typeError:!0});return}if("tag"in i&&typeof i.tag!="string"){r[e]||(r[e]=[]),r[e].push({message:"Expected 'string', got '".concat(k(i.tag),"'"),typeError:!0});return}if("children"in i)if(Array.isArray(i.children))for(var a=0;a<i.children.length;a++){var o=i.children[a],l=q(q(e,"children"),a);if(k(o)==="object")this.recursiveAssert(l,o,r);else{if(typeof o=="string")continue;r[l]||(r[l]=[]),r[l].push({message:"Expected 'object' or 'string', got '".concat(k(o),"'"),typeError:!0})}}else{r[e]||(r[e]=[]),r[e].push({message:"Expected 'array', got '".concat(k(i.children),"'"),typeError:!0});return}if("styles"in i)if(!Array.isArray(i.styles))r[e]||(r[e]=[]),r[e].push({message:"Expected 'array', got '".concat(k(i.styles),"'"),typeError:!0});else for(var u=0;u<i.styles.length;u++){var c=i.styles[u];if(typeof c!="string"){var d=q(e,u);r[d]||(r[d]=[]),r[d].push({message:"Expected 'string', got '".concat(k(c),"'"),typeError:!0})}}}},{key:"nullable",value:function(){return new n(this.options,!0,[],this.isReadonly,this.isHidden,this.description)}},{key:"readonly",value:function(){return new n(this.options,this.opt,this.customValidateFunctions,!0,this.isHidden,this.description)}},{key:"hidden",value:function(){return new n(this.options,this.opt,this.customValidateFunctions,this.isReadonly,!0,this.description)}},{key:"executeSerialize",value:function(){var e=this,i,r=function(){var l,u;if(((l=e.options.inline)===null||l===void 0?void 0:l.a)instanceof Zt){var c;return(c=e.options.inline)===null||c===void 0?void 0:c.a.executeSerialize()}else if(((u=e.options.inline)===null||u===void 0?void 0:u.a)instanceof Tt){var d;return(d=e.options.inline)===null||d===void 0?void 0:d.a.executeSerialize()}else{var g;return(g=e.options.inline)===null||g===void 0?void 0:g.a}},a={maxLength:this.options.maxLength,minLength:this.options.minLength,style:this.options.style,block:this.options.block,inline:this.options.inline&&{a:r(),img:this.options.inline.img&&k(this.options.inline.img)==="object"?this.options.inline.img.executeSerialize():this.options.inline.img}};return{type:"richtext",opt:this.opt,options:a,customValidate:this.customValidateFunctions&&((i=this.customValidateFunctions)===null||i===void 0?void 0:i.length)>0,readonly:this.isReadonly,hidden:this.isHidden,description:this.description}}},{key:"executeRender",value:function(){return{}}}])})(X),rn=function(n){return new Ft(n??{})},an=/^(https?:\/\/[^/]+)\/file\/p\/([^/]+)\/b\/([^/]+)\/v\/([^/]+)\/h\/([^/]+)\/f\/([^/]+)\/p\/(.+)$/;function ge(t){if(t[0]==="/")return{status:"error",error:"Not a remote ref: "+t};var n=t.match(an);return n?n[7].indexOf("public/val/")!==0?{status:"error",error:"Invalid remote ref: "+t}:{status:"success",remoteHost:n[1],projectId:n[2],bucket:n[3],version:n[4],validationHash:n[5],fileHash:n[6],filePath:n[7]}:{status:"error",error:"Invalid remote ref: "+t}}var ut=(function(t){function n(s){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,l=arguments.length>5?arguments[5]:void 0,u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:!1,c=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1,d=arguments.length>8?arguments[8]:void 0;return G(this,n),e=Z(this,n),p(e,"renderInput",null),e.item=s,e.opt=i,e.customValidateFunctions=r,e.currentRouter=a,e.keySchema=o,e.mediaOptions=l,e.isReadonly=u,e.isHidden=c,e.description=d,e}return Q(n,t),U(n,[{key:"describe",value:function(e){return new n(this.item,this.opt,this.customValidateFunctions,this.currentRouter,this.keySchema,this.mediaOptions,this.isReadonly,this.isHidden,e??void 0)}},{key:"validate",value:function(e){return new n(this.item,this.opt,[].concat(R(this.customValidateFunctions),[e]),this.currentRouter,this.keySchema,this.mediaOptions,this.isReadonly,this.isHidden,this.description)}},{key:"executeValidate",value:function(e,i){var r=this,a=!1,o=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});if(this.opt&&i==null)return o.length>0?p({},e,o):!1;if(i===null)return p({},e,[].concat(R(o),[{message:"Expected 'object', got 'null'"}]));if(k(i)!=="object")return p({},e,[].concat(R(o),[{message:"Expected 'object', got '".concat(k(i),"'")}]));if(Array.isArray(i))return p({},e,[].concat(R(o),[{message:"Expected 'object', got 'array'"}]));var l=this.getRouterValidations(e,i);if(l)return l;var u=ot(o),c;try{for(u.s();!(c=u.n()).done;){var d=c.value;a=this.appendValidationError(a,e,d.message,i,d.schemaError)}}catch(f){u.e(f)}finally{u.f()}if(this.mediaOptions){var g=this.mediaOptions.type==="images"?"images:check-unique-folder":"files:check-unique-folder",h={message:"Gallery directory '".concat(this.mediaOptions.directory,"' must be unique across all galleries"),value:{directory:this.mediaOptions.directory,type:this.mediaOptions.type},fixes:[g]};a?a[e]?a[e]=[].concat(R(a[e]),[h]):a=H(H({},a),{},p({},e,[h])):a=p({},e,[h]);var v=this.mediaOptions.type==="images"?"images:check-all-files":"files:check-all-files",m={message:"Directory '".concat(this.mediaOptions.directory,"' may have files not tracked by this gallery"),value:{directory:this.mediaOptions.directory,type:this.mediaOptions.type},fixes:[v]};a[e]?a[e]=[].concat(R(a[e]),[m]):a=H(H({},a),{},p({},e,[m]))}return Object.entries(i).forEach(function(f){var x=at(f,2),y=x[0],V=x[1];if(r.keySchema){var b=pt(e,y);if(!b)throw new Error("Internal error: could not create path at ".concat(!e&&typeof e=="string"?"<empty string>":e," for key validation"));var j=r.keySchema.executeValidate(b,y);j&&(j[b]=j[b].map(function(T){return H(H({},T),{},{keyError:!0})}),a?a[b]?a[b]=[].concat(R(a[b]),R(j[b])):a[b]=j[b]:a=j)}var A=pt(e,y);if(!A)a=r.appendValidationError(a,e,"Internal error: could not create path at ".concat(!e&&typeof e=="string"?"<empty string>":e," at key ").concat(V),i);else if(r.mediaOptions){var O=r.validateMediaKey(A,y);O&&(a=a?H(H({},a),O):O);var w=r.validateMediaEntry(A,V);w&&(a=a?H(H({},a),w):w)}else{var E=r.item.executeValidate(A,V);E&&a?a=H(H({},E),a):E&&(a=E)}}),a}},{key:"isRemoteUrl",value:function(e){return e.startsWith("https://")||e.startsWith("http://")}},{key:"validateMediaKey",value:function(e,i){if(!this.mediaOptions)return!1;var r=this.mediaOptions,a=r.directory,o=r.remote,l=r.type,u=l==="images"?"images":"files",c=l==="images"?"images:check-remote":"files:check-remote",d=this.isRemoteUrl(i),g=i===a||i.startsWith(a+"/");if(o){if(d){var h=ge(i);if(h.status==="error")return p({},e,[{message:"Invalid remote URL format. Use Val tooling (CLI, VS Code extension, or Val Studio) to upload ".concat(u,". Got: ").concat(i),value:i,fixes:[c]}]);var v="/"+h.filePath;return v!==a&&!v.startsWith(a+"/")?p({},e,[{message:"Remote file path '".concat(v,"' is not in expected directory '").concat(a,"'. Use Val tooling to upload ").concat(u," to the correct directory."),value:i,fixes:[c]}]):!1}if(!g)return p({},e,[{message:"Expected a remote URL (https://...) or a local path starting with ".concat(a,"/. Got: ").concat(i),value:i}])}else{if(d)return p({},e,[{message:"Remote URLs are not allowed. Use .remote() to enable remote ".concat(u,". Got: ").concat(i),value:i,fixes:[c]}]);if(!g)return p({},e,[{message:"File path must be within the ".concat(a,"/ directory. Got: ").concat(i),value:i}])}return!1}},{key:"validateMediaEntry",value:function(e,i){if(!this.mediaOptions)return!1;var r=this.mediaOptions,a=r.type,o=r.accept,l=r.altSchema;if(k(i)!=="object"||i===null)return p({},e,[{message:"Expected 'object', got '".concat(k(i),"'"),value:i}]);var u=i,c=[];if(a==="images"&&((typeof u.width!="number"||u.width<=0)&&c.push({message:"Expected 'width' to be a positive number, got '".concat(u.width,"'"),value:i}),(typeof u.height!="number"||u.height<=0)&&c.push({message:"Expected 'height' to be a positive number, got '".concat(u.height,"'"),value:i})),typeof u.mimeType!="string")c.push({message:"Expected 'mimeType' to be a string, got '".concat(k(u.mimeType),"'"),value:i});else{var d=this.validateMediaMimeType(u.mimeType,o);d&&c.push({message:d,value:i})}if(a==="images"){if(u.hotspot!==void 0){var g=u.hotspot;(k(u.hotspot)!=="object"||typeof g.x!="number"||typeof g.y!="number")&&c.push({message:"Hotspot must be an object with x and y as numbers.",value:i})}var h=pt(e,"alt");if(h&&l){var v=l.executeValidate(h,u.alt);if(v)return c.length>0?H(H({},v),{},p({},e,c)):v}}return c.length>0?p({},e,c):!1}},{key:"validateMediaMimeType",value:function(e,i){if(!e.includes("/"))return"Invalid mime type format. Got: '".concat(e,"'");var r=i.split(",").map(function(o){return o.trim()}),a=r.some(function(o){if(o==="*/*")return!0;if(o==="image/*")return e.startsWith("image/");if(o.endsWith("/*")){var l=o.slice(0,-2);return e.startsWith(l)}return o===e});return a?null:"Mime type mismatch. Found '".concat(e,"' but schema accepts '").concat(i,"'")}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:i===null?{success:!1,errors:p({},e,[{message:"Expected 'object', got 'null'",typeError:!0}])}:k(i)!=="object"?{success:!1,errors:p({},e,[{message:"Expected 'object', got '".concat(k(i),"'"),typeError:!0}])}:Array.isArray(i)?{success:!1,errors:p({},e,[{message:"Expected 'object', got 'array'",typeError:!0}])}:{success:!0,data:i}}},{key:"nullable",value:function(){return new n(this.item,!0,this.customValidateFunctions,this.currentRouter,this.keySchema,this.mediaOptions,this.isReadonly,this.isHidden,this.description)}},{key:"readonly",value:function(){return new n(this.item,this.opt,this.customValidateFunctions,this.currentRouter,this.keySchema,this.mediaOptions,!0,this.isHidden,this.description)}},{key:"hidden",value:function(){return new n(this.item,this.opt,this.customValidateFunctions,this.currentRouter,this.keySchema,this.mediaOptions,this.isReadonly,!0,this.description)}},{key:"router",value:function(e){return new n(this.item,this.opt,this.customValidateFunctions,e,this.keySchema,this.mediaOptions,this.isReadonly,this.isHidden,this.description)}},{key:"remote",value:function(){return new n(this.item,this.opt,this.customValidateFunctions,this.currentRouter,this.keySchema,this.mediaOptions?H(H({},this.mediaOptions),{},{remote:!0}):void 0,this.isReadonly,this.isHidden,this.description)}},{key:"getRouterValidations",value:function(e,i){if(!this.currentRouter||i===null)return!1;var r=ye(e),a=at(r,2),o=a[0],l=a[1];if(l)return p({},e,[{message:"This field was configured as a router, but it is not defined at the root of the module",schemaError:!0}]);var u=this.currentRouter.validate(o,Object.keys(i));return u.length>0?Object.fromEntries(u.map(function(c){if(!c.error.urlPath)return[e,[{message:"Router validation error: ".concat(c.error.message," has no url path"),schemaError:!0}]];var d=pt(e,c.error.urlPath);if(!d)throw new Error("Internal error: could not create path at ".concat(!e&&typeof e=="string"?"<empty string>":e," for router validation"));return[d,[{message:c.error.message,value:c.error.urlPath,keyError:!0}]]})):!1}},{key:"executeSerialize",value:function(){var e,i,r,a={type:"record",item:this.item.executeSerialize(),key:(e=this.keySchema)===null||e===void 0?void 0:e.executeSerialize(),opt:this.opt,router:(i=this.currentRouter)===null||i===void 0?void 0:i.getRouterId(),customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0,readonly:this.isReadonly,hidden:this.isHidden,description:this.description};return this.mediaOptions&&(a.mediaType=this.mediaOptions.type,a.accept=this.mediaOptions.accept,a.directory=this.mediaOptions.directory,a.remote=this.mediaOptions.remote,this.mediaOptions.altSchema&&(a.alt=this.mediaOptions.altSchema.executeSerialize())),a}},{key:"executeRender",value:function(e,i){var r={};if(i===null)return r;for(var a in i){var o=i[a];if(o!=null){var l=q(e,a),u=this.item.executeRender(l,o);for(var c in u){var d=c;r[d]=u[d]}}}if(this.renderInput){var g=this.renderInput,h=g.select,v=g.layout;v!=="list"&&(r[e]={status:"error",message:"Unknown layout type: "+v});try{r[e]={status:"success",data:{layout:"list",parent:"record",items:Object.entries(i).map(function(m){var f=at(m,2),x=f[0],y=f[1],V=h({key:x,val:y}),b=V.title,j=V.subtitle,A=V.image;return[x,{title:b,subtitle:j,image:A}]})}}}catch(m){r[e]={status:"error",message:m instanceof Error?m.message:"Unknown error"}}}return r}},{key:"render",value:function(e){return this.renderInput={layout:e.as,select:e.select},this}}])})(X);function on(t,n){return n?new ut(n,!1,[],null,t):new ut(t,!1,[],null,null)}function ve(t){return t[Yi]}function ye(t){var n=t.indexOf(Et);return n===-1?[t,""]:[t.slice(0,n),t.slice(n+Et.length)]}function $e(t,n){return n===""?t:"".concat(t).concat(Et).concat(n)}function ti(t){return t instanceof lt||k(t)==="object"&&"type"in t&&t.type==="object"}function ei(t){return t instanceof ut||k(t)==="object"&&"type"in t&&t.type==="record"}function ii(t){return t instanceof Yt||k(t)==="object"&&"type"in t&&t.type==="array"}function ni(t){return t instanceof qe||k(t)==="object"&&"type"in t&&t.type==="union"}function si(t){return t instanceof Ft||k(t)==="object"&&"type"in t&&t.type==="richtext"}function ri(t){return t instanceof Xt||k(t)==="object"&&"type"in t&&t.type==="image"}function ln(t,n,s){for(var e=_t(t),i=R(e),r=s,a=n,o=function(){var c=e.shift();if(c===void 0)throw Error("Unexpected undefined part");if(ii(r)){var d;if(Number.isNaN(Number(c)))throw Error("Invalid path: array schema ".concat(JSON.stringify(r)," must have a number as path, but got ").concat(c,". Path: ").concat(t));if(k(a)!=="object"&&!Array.isArray(a))throw Error("Schema type error: expected source to be type of array, but got ".concat(k(a)));a=a[c],r=r instanceof Yt?(d=r)===null||d===void 0?void 0:d.item:r.item}else if(ei(r)){var g;if(typeof c!="string")throw Error("Invalid path: record schema ".concat(r," must have path: ").concat(c," as string"));if(k(a)!=="object"&&!Array.isArray(a))throw Error("Schema type error: expected source to be type of record, but got ".concat(k(a)));if(!a[c])throw Error("Invalid path: record source did not have key ".concat(c," from path: ").concat(t));a=a[c],r=r instanceof ut?(g=r)===null||g===void 0?void 0:g.item:r.item}else if(ti(r)){if(k(a)!=="object")throw Error("Schema type error: expected source to be type of object, but got ".concat(k(a)));if(a!==null&&a[c]===void 0)throw Error("Invalid path: object source did not have key ".concat(c," from path: ").concat(t));a=a===null?a:a[c],r=(r instanceof lt,r.items[c])}else{if(ri(r))return{v:{path:i.slice(0,i.length-e.length-1).map(function(b){return JSON.stringify(b)}).join("."),schema:r,source:a}};if(ni(r)){var h=r.key;if(typeof h!="string")return{v:{path:i.map(function(b){return Number.isNaN(Number(b))?JSON.stringify(b):b}).join("."),schema:r,source:a}};var v=a[h];if(!v)throw Error("Invalid path: union source ".concat(r," did not have required key ").concat(h," in path: ").concat(t));var m=r.items.find(function(b){var j;return(b==null||(j=b.items)===null||j===void 0||(j=j[h])===null||j===void 0?void 0:j.value)===v});if(!m)throw Error("Invalid path: union schema ".concat(r," did not have a child object with ").concat(h," of value ").concat(v," in path: ").concat(t));r=m.items[c],a=a[c]}else if(si(r)){if("src"in a&&"tag"in a&&a.tag==="img"&&e.length===0){var f,x;r=r instanceof Ft&&(f=r.options)!==null&&f!==void 0&&(f=f.inline)!==null&&f!==void 0&&f.img&&typeof((x=r.options)===null||x===void 0||(x=x.inline)===null||x===void 0?void 0:x.img)!="boolean"?r.options.inline.img:r}if("href"in a&&"tag"in a&&a.tag==="a"&&e.length===0){var y,V;r=r instanceof Ft&&(y=r.options)!==null&&y!==void 0&&(y=y.inline)!==null&&y!==void 0&&y.a&&typeof((V=r.options)===null||V===void 0||(V=V.inline)===null||V===void 0?void 0:V.a)!="boolean"?r.options.inline.a:r}a=a[c]}else throw Error("Invalid path: ".concat(c," resolved to an unexpected schema ").concat(JSON.stringify(r)))}},l;e.length>0;)if(l=o(),l)return l.v;if(e.length>0)throw Error("Invalid path: ".concat(e.join(".")," is not a valid path"));return{path:i.map(function(u){return Number.isNaN(Number(u))?JSON.stringify(u):u}).join("."),schema:r,source:a}}function un(t,n,s){for(var e=_t(t),i=R(e),r=s,a=n,o=function(){var c=e.shift();if(c===void 0)return{v:{status:"error",message:"Unexpected undefined part"}};if(ii(r)){var d;if(Number.isNaN(Number(c)))return{v:{status:"error",message:"Invalid path: array schema ".concat(JSON.stringify(r)," must have a number as path, but got ").concat(c,". Path: ").concat(t)}};if(a===void 0)return{v:{status:"source-undefined",path:i.slice(0,i.length-e.length-1).map(function(b){return JSON.stringify(b)}).join(".")}};if(k(a)!=="object"&&!Array.isArray(a))return{v:{status:"error",message:"Schema type error: expected source to be type of array, but got ".concat(k(a))}};if(a[c]===void 0)return{v:{status:"source-undefined",path:i.slice(0,i.length-e.length-1).map(function(b){return JSON.stringify(b)}).join(".")}};a=a[c],r=r instanceof Yt?(d=r)===null||d===void 0?void 0:d.item:r.item}else if(ei(r)){var g;if(typeof c!="string")return{v:{status:"error",message:"Invalid path: record schema ".concat(r," must have path: ").concat(c," as string")}};if(a===void 0)return{v:{status:"source-undefined",path:i.slice(0,i.length-e.length-1).map(function(b){return JSON.stringify(b)}).join(".")}};if(k(a)!=="object"&&!Array.isArray(a))return{v:{status:"error",message:"Schema type error: expected source to be type of record, but got ".concat(k(a))}};if(a[c]===void 0)return{v:{status:"source-undefined",path:i.slice(0,i.length-e.length-1).map(function(b){return JSON.stringify(b)}).join(".")}};a=a[c],r=r instanceof ut?(g=r)===null||g===void 0?void 0:g.item:r.item}else if(ti(r)){if(a===void 0)return{v:{status:"source-undefined",path:i.slice(0,i.length-e.length-1).map(function(b){return JSON.stringify(b)}).join(".")}};if(k(a)!=="object")return{v:{status:"error",message:"Schema type error: expected source to be type of object, but got ".concat(k(a))}};if(a!==null&&a[c]===void 0)return{v:{status:"error",message:"Invalid path: object source did not have key ".concat(c," from path: ").concat(t)}};a=a===null?a:a[c],r=(r instanceof lt,r.items[c])}else{if(ri(r))return{v:{status:"ok",path:i.slice(0,i.length-e.length-1).map(function(b){return JSON.stringify(b)}).join("."),schema:r,source:a}};if(ni(r)){var h=r.key;if(typeof h!="string")return{v:{status:"ok",path:i.map(function(b){return Number.isNaN(Number(b))?JSON.stringify(b):b}).join("."),schema:r,source:a}};var v=a[h];if(!v)return{v:{status:"error",message:"Invalid path: union source ".concat(r," did not have required key ").concat(h," in path: ").concat(t)}};var m=r.items.find(function(b){var j;return(b==null||(j=b.items)===null||j===void 0||(j=j[h])===null||j===void 0?void 0:j.value)===v});if(!m)return{v:{status:"error",message:"Invalid path: union schema ".concat(r," did not have a child object with ").concat(h," of value ").concat(v," in path: ").concat(t)}};r=m.items[c],a=a[c]}else if(si(r)){if("src"in a&&"tag"in a&&a.tag==="img"&&e.length===0){var f,x;r=r instanceof Ft&&(f=r.options)!==null&&f!==void 0&&(f=f.inline)!==null&&f!==void 0&&f.img&&typeof((x=r.options)===null||x===void 0||(x=x.inline)===null||x===void 0?void 0:x.img)!="boolean"?r.options.inline.img:r}if("href"in a&&"tag"in a&&a.tag==="a"&&e.length===0){var y,V;r=r instanceof Ft&&(y=r.options)!==null&&y!==void 0&&(y=y.inline)!==null&&y!==void 0&&y.a&&typeof((V=r.options)===null||V===void 0||(V=V.inline)===null||V===void 0?void 0:V.a)!="boolean"?r.options.inline.a:r}a=a[c]}else return{v:{status:"error",message:"Invalid path: ".concat(c," resolved to an unexpected schema ").concat(JSON.stringify(r))}}}},l;e.length>0;)if(l=o(),l)return l.v;return e.length>0?{status:"error",message:"Invalid path: ".concat(e.join(".")," is not a valid path")}:{status:"ok",path:i.map(function(u){return Number.isNaN(Number(u))?JSON.stringify(u):u}).join("."),schema:r,source:a}}function cn(t){var n=t.split("/").slice(1);return n}function _t(t){for(var n=[],s=0;s<t.length;){var e="";if(t[s]==='"'){for(s++;s<t.length&&t[s]!=='"';)t[s]==="\\"&&t[s+1]==='"'?(e+='"',s++):e+=t[s],s++;if(t[s]!=='"'){var i;throw new Error("Invalid input (".concat(JSON.stringify(t),"): Missing closing double quote: ").concat((i=t[s])!==null&&i!==void 0?i:"at end of string"," (char: ").concat(s,"; length: ").concat(t.length,")"))}}else for(;s<t.length&&t[s]!==".";)e+=t[s],s++;e!==""&&n.push(e),s++}return n}function dn(t){return t.split(",")}function hn(t){var n=ye(t),s=at(n,2),e=s[0],i=s[1],r=_t(i).slice(0,-1);return r.length>0?$e(e,ai(r)):e}function ai(t){return t.map(function(n){return Number.isInteger(Number(n))?n:JSON.stringify(n)}).join(".")}var xe=(function(t){function n(s){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,l=arguments.length>5?arguments[5]:void 0;return G(this,n),e=Z(this,n),e.options=s,e.opt=i,e.customValidateFunctions=r,e.isReadonly=a,e.isHidden=o,e.description=l,e}return Q(n,t),U(n,[{key:"describe",value:function(e){return new n(this.options,this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,e??void 0)}},{key:"validate",value:function(e){return new n(this.options,this.opt,[].concat(R(this.customValidateFunctions),[e]),this.isReadonly,this.isHidden,this.description)}},{key:"executeValidate",value:function(e,i){var r,a,o=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});return this.opt&&i==null?o.length>0?p({},e,o):!1:typeof i!="number"?p({},e,[].concat(R(o),[{message:"Expected 'number', got '".concat(k(i),"'"),value:i}])):(r=this.options)!==null&&r!==void 0&&r.max&&i>this.options.max?p({},e,[].concat(R(o),[{message:"Expected 'number' less than ".concat(this.options.max),value:i}])):(a=this.options)!==null&&a!==void 0&&a.min&&i<this.options.min?p({},e,[].concat(R(o),[{message:"Expected 'number' greater than ".concat(this.options.min),value:i}])):o.length>0?p({},e,o):!1}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:i===null?{success:!1,errors:p({},e,[{message:"Expected 'number', got 'null'",typeError:!0}])}:typeof i=="number"?{success:!0,data:i}:{success:!1,errors:p({},e,[{message:"Expected 'number', got '".concat(k(i),"'"),typeError:!0}])}}},{key:"nullable",value:function(){return new n(this.options,!0,[],this.isReadonly,this.isHidden,this.description)}},{key:"readonly",value:function(){return new n(this.options,this.opt,this.customValidateFunctions,!0,this.isHidden,this.description)}},{key:"hidden",value:function(){return new n(this.options,this.opt,this.customValidateFunctions,this.isReadonly,!0,this.description)}},{key:"max",value:function(e){return new n(H(H({},this.options),{},{max:e}),this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,this.description)}},{key:"min",value:function(e){return new n(H(H({},this.options),{},{min:e}),this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,this.description)}},{key:"executeSerialize",value:function(){var e;return{type:"number",options:this.options,opt:this.opt,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0,readonly:this.isReadonly,hidden:this.isHidden,description:this.description}}},{key:"executeRender",value:function(){return{}}}])})(X),pn=function(n){return new xe(n)},fn=(function(t){function n(){var s,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=arguments.length>4?arguments[4]:void 0;return G(this,n),s=Z(this,n),s.opt=e,s.customValidateFunctions=i,s.isReadonly=r,s.isHidden=a,s.description=o,s}return Q(n,t),U(n,[{key:"describe",value:function(e){return new n(this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,e??void 0)}},{key:"validate",value:function(e){return new n(this.opt,[].concat(R(this.customValidateFunctions),[e]),this.isReadonly,this.isHidden,this.description)}},{key:"executeValidate",value:function(e,i){return this.opt&&i==null?!1:typeof i!="boolean"?p({},e,[{message:"Expected 'boolean', got '".concat(k(i),"'"),value:i}]):!1}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:i===null?{success:!1,errors:p({},e,[{message:"Expected 'boolean', got 'null'",typeError:!0}])}:typeof i!="boolean"?{success:!1,errors:p({},e,[{message:"Expected 'boolean', got '".concat(k(i),"'"),typeError:!0}])}:{success:!0,data:i}}},{key:"nullable",value:function(){return new n(!0,[],this.isReadonly,this.isHidden,this.description)}},{key:"readonly",value:function(){return new n(this.opt,this.customValidateFunctions,!0,this.isHidden,this.description)}},{key:"hidden",value:function(){return new n(this.opt,this.customValidateFunctions,this.isReadonly,!0,this.description)}},{key:"executeSerialize",value:function(){var e;return{type:"boolean",opt:this.opt,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0,readonly:this.isReadonly,hidden:this.isHidden,description:this.description}}},{key:"executeRender",value:function(){return{}}}])})(X),mn=function(){return new fn},gn=(function(t){function n(s,e){var i,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,u=arguments.length>6?arguments[6]:void 0;return G(this,n),i=Z(this,n),i.schema=s,i.sourcePath=e,i.opt=r,i.customValidateFunctions=a,i.isReadonly=o,i.isHidden=l,i.description=u,i}return Q(n,t),U(n,[{key:"describe",value:function(e){return new n(this.schema,this.sourcePath,this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,e??void 0)}},{key:"validate",value:function(e){return new n(this.schema,this.sourcePath,this.opt,[].concat(R(this.customValidateFunctions),[e]),this.isReadonly,this.isHidden,this.description)}},{key:"executeValidate",value:function(e,i){var r=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});if(this.opt&&i==null)return r.length>0?p({},e,r):!1;if(!this.schema)return p({},e,[].concat(R(r),[{message:"Schema not found for module. keyOf must be used with a Val Module"}]));var a=this.schema;if(!(a.type==="object"||a.type==="record"))return p({},e,[].concat(R(r),[{message:"Schema in keyOf must be an 'object' or 'record'. Found '".concat(a.type||"unknown","'")}]));if(a.opt&&i==null)return!1;if(a.type==="record"&&typeof i!="string")return p({},e,[].concat(R(r),[{message:"Type of value in keyof (record) must be 'string'"}]));if(a.type==="object"){var o=a.keys;if(!o.includes(i))return p({},e,[].concat(R(r),[{message:"Value of keyOf (object) must be: ".concat(o.join(", "),". Found: ").concat(i)}]))}return a.type==="record"?typeof i!="string"?p({},e,[].concat(R(r),[{message:"Value of keyOf (record) must be 'string'. Found: ".concat(k(i))}])):p({},e,[].concat(R(r),[{fixes:["keyof:check-keys"],message:"Did not validate keyOf (record). This error (keyof:check-keys) should typically be processed by Val internally. Seeing this error most likely means you have a Val version mismatch.",value:{key:i,sourcePath:this.sourcePath}}])):r.length>0?p({},e,r):!1}},{key:"executeAssert",value:function(e,i){if(this.opt&&i===null)return{success:!0,data:i};if(i===null)return{success:!1,errors:p({},e,[{message:"Expected 'string', got 'null'",typeError:!0}])};var r=this.schema;if(!r)return{success:!1,errors:p({},e,[{message:"Neither key nor schema was found. keyOf is missing an argument.",typeError:!0}])};var a=r;if(!(a.type==="object"||a.type==="record"))return{success:!1,errors:p({},e,[{message:"Schema of first argument must be either: 'array', 'object' or 'record'. Found '".concat(a.type||"unknown","'"),typeError:!0}])};if(a.type==="record"&&typeof i!="string")return{success:!1,errors:p({},e,[{message:"Value of keyOf (record) must be 'string', got '".concat(k(i),"'"),typeError:!0}])};if(a.type==="object"){var o=a.keys;if(!o.includes(i))return{success:!1,errors:p({},e,[{message:"Value of keyOf (object) must be: ".concat(o.join(", "),". Found: ").concat(i),typeError:!0}])}}return{success:!0,data:i}}},{key:"nullable",value:function(){return new n(this.schema,this.sourcePath,!0,[],this.isReadonly,this.isHidden,this.description)}},{key:"readonly",value:function(){return new n(this.schema,this.sourcePath,this.opt,this.customValidateFunctions,!0,this.isHidden,this.description)}},{key:"hidden",value:function(){return new n(this.schema,this.sourcePath,this.opt,this.customValidateFunctions,this.isReadonly,!0,this.description)}},{key:"executeSerialize",value:function(){var e,i=this.sourcePath;if(!i)throw new Error("Cannot serialize keyOf schema with empty selector. TIP: keyOf must be used with a Val Module of record schema.");var r=this.schema;if(!r)throw new Error("Cannot serialize keyOf schema with empty selector.");var a;switch(r.type){case"record":a="string";break;case"object":a=r.keys;break;default:throw new Error("Cannot serialize keyOf schema with selector of type '".concat(r.type||"unknown","'"))}return{type:"keyOf",path:i,schema:r,opt:this.opt,values:a,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0,readonly:this.isReadonly,hidden:this.isHidden,description:this.description}}},{key:"executeRender",value:function(){return{}}}])})(X),vn=function(n){var s=n?.[Ke],e=void 0;if(s instanceof lt){var i=[];try{i=Object.keys(s?.items||{})}catch{}e={type:"object",keys:i,opt:s?.opt}}else s instanceof ut&&(e={type:"record",opt:s?.opt});return new gn(e,Ut(n))},yn=function(n){var s,e,i=(s=n.directory)!==null&&s!==void 0?s:"/public/val",r=new lt({mimeType:new Tt({},!1)},!1);return new ut(r,!1,[],null,null,{type:"files",accept:n.accept,directory:i,remote:(e=n.remote)!==null&&e!==void 0?e:!1})},xn=(function(t){function n(s){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,l=arguments.length>5?arguments[5]:void 0;return G(this,n),e=Z(this,n),e.options=s,e.opt=i,e.customValidateFunctions=r,e.isReadonly=a,e.isHidden=o,e.description=l,e}return Q(n,t),U(n,[{key:"describe",value:function(e){return new n(this.options,this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,e??void 0)}},{key:"validate",value:function(e){return new n(this.options,this.opt,[].concat(R(this.customValidateFunctions),[e]),this.isReadonly,this.isHidden,this.description)}},{key:"executeValidate",value:function(e,i){var r,a,o,l,u=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});return this.opt&&i==null?u.length>0?p({},e,u):!1:typeof i!="string"?(u.push({message:"Expected 'string', got '".concat(k(i),"'"),value:i}),p({},e,u)):((r=this.options)!==null&&r!==void 0&&r.from&&(a=this.options)!==null&&a!==void 0&&a.to?this.options.from>this.options.to?u.push({message:"From date ".concat(this.options.from," is after to date ").concat(this.options.to),value:i,typeError:!0}):(i<this.options.from||i>this.options.to)&&u.push({message:"Date is not between ".concat(this.options.from," and ").concat(this.options.to),value:i}):(o=this.options)!==null&&o!==void 0&&o.from?i<this.options.from&&u.push({message:"Date is before the minimum date ".concat(this.options.from),value:i}):(l=this.options)!==null&&l!==void 0&&l.to&&i>this.options.to&&u.push({message:"Date is after the maximum date ".concat(this.options.to),value:i}),u.length>0?p({},e,u):!1)}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:i===null?{success:!1,errors:p({},e,[{message:"Expected 'string', got 'null'",typeError:!0}])}:typeof i!="string"?{success:!1,errors:p({},e,[{message:"Expected 'string', got '".concat(k(i),"'"),typeError:!0}])}:{success:!0,data:i}}},{key:"from",value:function(e){return new n(H(H({},this.options),{},{from:e}),this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,this.description)}},{key:"to",value:function(e){return new n(H(H({},this.options),{},{to:e}),this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,this.description)}},{key:"nullable",value:function(){return new n(this.options,!0,[],this.isReadonly,this.isHidden,this.description)}},{key:"readonly",value:function(){return new n(this.options,this.opt,this.customValidateFunctions,!0,this.isHidden,this.description)}},{key:"hidden",value:function(){return new n(this.options,this.opt,this.customValidateFunctions,this.isReadonly,!0,this.description)}},{key:"executeSerialize",value:function(){var e;return{type:"date",opt:this.opt,options:this.options,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0,readonly:this.isReadonly,hidden:this.isHidden,description:this.description}}},{key:"executeRender",value:function(){return{}}}])})(X),bn=function(n){return new xn(n)},wn=(function(t){function n(s){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,l=arguments.length>5?arguments[5]:void 0;return G(this,n),e=Z(this,n),e.options=s,e.opt=i,e.customValidateFunctions=r,e.isReadonly=a,e.isHidden=o,e.description=l,e}return Q(n,t),U(n,[{key:"describe",value:function(e){return new n(this.options,this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,e??void 0)}},{key:"validate",value:function(e){return new n(this.options,this.opt,[].concat(R(this.customValidateFunctions),[e]),this.isReadonly,this.isHidden,this.description)}},{key:"executeValidate",value:function(e,i){var r,a,o=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});if(this.opt&&i==null)return o.length>0?p({},e,o):!1;if(typeof i!="string")return o.push({message:"Expected 'string', got '".concat(k(i),"'"),value:i}),p({},e,o);var l=Date.parse(i);if(Number.isNaN(l))return o.push({message:"Value '".concat(i,"' is not a valid ISO 8601 datetime"),value:i}),p({},e,o);var u=((r=this.options)===null||r===void 0?void 0:r.from)!==void 0?Date.parse(this.options.from):void 0,c=((a=this.options)===null||a===void 0?void 0:a.to)!==void 0?Date.parse(this.options.to):void 0;if(u!==void 0&&Number.isNaN(u)){var d;return o.push({message:"From datetime '".concat((d=this.options)===null||d===void 0?void 0:d.from,"' is not a valid ISO 8601 datetime"),value:i,typeError:!0}),p({},e,o)}if(c!==void 0&&Number.isNaN(c)){var g;return o.push({message:"To datetime '".concat((g=this.options)===null||g===void 0?void 0:g.to,"' is not a valid ISO 8601 datetime"),value:i,typeError:!0}),p({},e,o)}if(u!==void 0&&c!==void 0){if(u>c){var h,v;o.push({message:"From datetime ".concat((h=this.options)===null||h===void 0?void 0:h.from," is after to datetime ").concat((v=this.options)===null||v===void 0?void 0:v.to),value:i,typeError:!0})}else if(l<u||l>c){var m,f;o.push({message:"Datetime is not between ".concat((m=this.options)===null||m===void 0?void 0:m.from," and ").concat((f=this.options)===null||f===void 0?void 0:f.to),value:i})}}else if(u!==void 0){if(l<u){var x;o.push({message:"Datetime is before the minimum datetime ".concat((x=this.options)===null||x===void 0?void 0:x.from),value:i})}}else if(c!==void 0&&l>c){var y;o.push({message:"Datetime is after the maximum datetime ".concat((y=this.options)===null||y===void 0?void 0:y.to),value:i})}return o.length>0?p({},e,o):!1}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:i===null?{success:!1,errors:p({},e,[{message:"Expected 'string', got 'null'",typeError:!0}])}:typeof i!="string"?{success:!1,errors:p({},e,[{message:"Expected 'string', got '".concat(k(i),"'"),typeError:!0}])}:{success:!0,data:i}}},{key:"from",value:function(e){return new n(H(H({},this.options),{},{from:e}),this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,this.description)}},{key:"to",value:function(e){return new n(H(H({},this.options),{},{to:e}),this.opt,this.customValidateFunctions,this.isReadonly,this.isHidden,this.description)}},{key:"nullable",value:function(){return new n(this.options,!0,[],this.isReadonly,this.isHidden,this.description)}},{key:"readonly",value:function(){return new n(this.options,this.opt,this.customValidateFunctions,!0,this.isHidden,this.description)}},{key:"hidden",value:function(){return new n(this.options,this.opt,this.customValidateFunctions,this.isReadonly,!0,this.description)}},{key:"executeSerialize",value:function(){var e;return{type:"dateTime",opt:this.opt,options:this.options,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0,readonly:this.isReadonly,hidden:this.isHidden,description:this.description}}},{key:"executeRender",value:function(){return{}}}])})(X),kn=function(n){return new wn(n)};function Vn(t,n){var s=Kt(),e=new ut(n,!1,[],t,s);return e}var Rn=function(n){var s,e,i,r=(s=n.directory)!==null&&s!==void 0?s:"/public/val",a=(e=n.alt)!==null&&e!==void 0?e:Kt().nullable(),o=new lt({width:new xe(void 0,!1),height:new xe(void 0,!1),mimeType:new Tt({},!1),alt:a},!1);return new ut(o,!1,[],null,null,{type:"images",accept:n.accept,directory:r,remote:(i=n.remote)!==null&&i!==void 0?i:!1,altSchema:a})};function jn(){return{string:Kt,boolean:mn,array:$i,object:Qe,number:pn,union:en,richtext:rn,image:nn,literal:tn,keyOf:vn,record:on,file:Qi,files:yn,date:bn,datetime:kn,route:sn,router:Vn,images:Rn}}function Fn(t,n){var s=n.publicProjectId,e=n.coreVersion,i=n.validationHash,r=n.fileHash,a=n.filePath,o=n.bucket;return"".concat(t,"/file/p/").concat(s,"/b/").concat(o,"/v/").concat(e,"/h/").concat(i,"/f/").concat(r,"/p/").concat(a)}function En(t){if(t!=null&&t.patch_id){var n=ge(t[P]);if(n.status==="success")return{url:"/api/val/files/"+n.filePath+"?patch_id=".concat(t.patch_id,"&remote=true&ref=").concat(encodeURIComponent(t[P])),metadata:t.metadata};console.warn("Internal Val error: failed to split remote ref: ".concat(t[P],". The data format is different than what is expected. Check Val versions for mismatches."),n.error)}return{url:t[P],metadata:t.metadata}}var Sn=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],_=(function(t){return t[t.inputBytes=64]="inputBytes",t[t.inputWords=16]="inputWords",t[t.highIndex=14]="highIndex",t[t.lowIndex=15]="lowIndex",t[t.workWords=64]="workWords",t[t.allocBytes=80]="allocBytes",t[t.allocWords=20]="allocWords",t[t.allocTotal=8e3]="allocTotal",t})(_||{});function On(t){return new An}var An=(function(){function t(){G(this,t),p(this,"A",1779033703),p(this,"B",-1150833019),p(this,"C",1013904242),p(this,"D",-1521486534),p(this,"E",1359893119),p(this,"F",-1694144372),p(this,"G",528734635),p(this,"H",1541459225),p(this,"_size",0),p(this,"_sp",0),(!Qt||Pt>=_.allocTotal)&&(Qt=new ArrayBuffer(_.allocTotal),Pt=0),this._byte=new Uint8Array(Qt,Pt,_.allocBytes),this._word=new Int32Array(Qt,Pt,_.allocWords),Pt+=_.allocBytes}return U(t,[{key:"update",value:function(s){if(typeof s=="string")return this._utf8(s);if(s==null)throw new TypeError("Invalid type: "+k(s));var e=s.byteOffset,i=s.byteLength,r=i/_.inputBytes|0,a=0;if(r&&!(e&3)&&!(this._size%_.inputBytes)){for(var o=new Int32Array(s.buffer,e,r*_.inputWords);r--;)this._int32(o,a>>2),a+=_.inputBytes;this._size+=a}var l=s.BYTES_PER_ELEMENT;if(l!==1&&s.buffer){var u=new Uint8Array(s.buffer,e+a,i-a);return this._uint8(u)}return a===i?this:this._uint8(s,a)}},{key:"_uint8",value:function(s,e){var i=this._byte,r=this._word,a=s.length;for(e=e|0;e<a;){for(var o=this._size%_.inputBytes,l=o;e<a&&l<_.inputBytes;)i[l++]=s[e++];l>=_.inputBytes&&this._int32(r),this._size+=l-o}return this}},{key:"_utf8",value:function(s){for(var e=this._byte,i=this._word,r=s.length,a=this._sp,o=0;o<r;){for(var l=this._size%_.inputBytes,u=l;o<r&&u<_.inputBytes;){var c=s.charCodeAt(o++)|0;c<128?e[u++]=c:c<2048?(e[u++]=192|c>>>6,e[u++]=128|c&63):c<55296||c>57343?(e[u++]=224|c>>>12,e[u++]=128|c>>>6&63,e[u++]=128|c&63):a?(c=((a&1023)<<10)+(c&1023)+65536,e[u++]=240|c>>>18,e[u++]=128|c>>>12&63,e[u++]=128|c>>>6&63,e[u++]=128|c&63,a=0):a=c}u>=_.inputBytes&&(this._int32(i),i[0]=i[_.inputWords]),this._size+=u-l}return this._sp=a,this}},{key:"_int32",value:function(s,e){var i=this.A,r=this.B,a=this.C,o=this.D,l=this.E,u=this.F,c=this.G,d=this.H,g=0;for(e=e|0;g<_.inputWords;)bt[g++]=tt(s[e++]);for(g=_.inputWords;g<_.workWords;g++)bt[g]=Cn(bt[g-2])+bt[g-7]+Pn(bt[g-15])+bt[g-16]|0;for(g=0;g<_.workWords;g++){var h=d+_n(l)+zn(l,u,c)+Sn[g]+bt[g]|0,v=Tn(i)+In(i,r,a)|0;d=c,c=u,u=l,l=o+h|0,o=a,a=r,r=i,i=h+v|0}this.A=i+this.A|0,this.B=r+this.B|0,this.C=a+this.C|0,this.D=o+this.D|0,this.E=l+this.E|0,this.F=u+this.F|0,this.G=c+this.G|0,this.H=d+this.H|0}},{key:"digest",value:function(s){var e=this._byte,i=this._word,r=this._size%_.inputBytes|0;for(e[r++]=128;r&3;)e[r++]=0;if(r>>=2,r>_.highIndex){for(;r<_.inputWords;)i[r++]=0;r=0,this._int32(i)}for(;r<_.inputWords;)i[r++]=0;var a=this._size*8,o=(a&4294967295)>>>0,l=(a-o)/4294967296;return l&&(i[_.highIndex]=tt(l)),o&&(i[_.lowIndex]=tt(o)),this._int32(i),s==="hex"?this._hex():this._bin()}},{key:"_hex",value:function(){var s=this.A,e=this.B,i=this.C,r=this.D,a=this.E,o=this.F,l=this.G,u=this.H;return ft(s)+ft(e)+ft(i)+ft(r)+ft(a)+ft(o)+ft(l)+ft(u)}},{key:"_bin",value:function(){var s=this.A,e=this.B,i=this.C,r=this.D,a=this.E,o=this.F,l=this.G,u=this.H,c=this._byte,d=this._word;return d[0]=tt(s),d[1]=tt(e),d[2]=tt(i),d[3]=tt(r),d[4]=tt(a),d[5]=tt(o),d[6]=tt(l),d[7]=tt(u),c.slice(0,32)}}])})(),bt=new Int32Array(_.workWords),Qt,Pt=0,ft=function(n){return(n+4294967296).toString(16).substr(-8)},Hn=function(n){return n<<24&4278190080|n<<8&16711680|n>>8&65280|n>>24&255},Mn=function(n){return n},tt=Nn()?Mn:Hn,zn=function(n,s,e){return e^n&(s^e)},In=function(n,s,e){return n&s|e&(n|s)},Tn=function(n){return(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10)},_n=function(n){return(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7)},Pn=function(n){return(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3},Cn=function(n){return(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10};function Nn(){var t=new Uint8Array(new Uint16Array([65279]).buffer);return t[0]===254}var be=function(n){return On().update(n).digest("hex")},we={x3d:"application/vnd.hzn-3d-crossword","3gp":"video/3gpp","3g2":"video/3gpp2",mseq:"application/vnd.mseq",pwn:"application/vnd.3m.post-it-notes",plb:"application/vnd.3gpp.pic-bw-large",psb:"application/vnd.3gpp.pic-bw-small",pvb:"application/vnd.3gpp.pic-bw-var",tcap:"application/vnd.3gpp2.tcap","7z":"application/x-7z-compressed",abw:"application/x-abiword",ace:"application/x-ace-compressed",acc:"application/vnd.americandynamics.acc",acu:"application/vnd.acucobol",atc:"application/vnd.acucorp",adp:"audio/adpcm",aab:"application/x-authorware-bin",aam:"application/x-authorware-map",aas:"application/x-authorware-seg",air:"application/vnd.adobe.air-application-installer-package+zip",avif:"image/avif",swf:"application/x-shockwave-flash",fxp:"application/vnd.adobe.fxp",pdf:"application/pdf",ppd:"application/vnd.cups-ppd",dir:"application/x-director",xdp:"application/vnd.adobe.xdp+xml",xfdf:"application/vnd.adobe.xfdf",aac:"audio/x-aac",ahead:"application/vnd.ahead.space",azf:"application/vnd.airzip.filesecure.azf",azs:"application/vnd.airzip.filesecure.azs",azw:"application/vnd.amazon.ebook",ami:"application/vnd.amiga.ami","N/A":"application/andrew-inset",apk:"application/vnd.android.package-archive",cii:"application/vnd.anser-web-certificate-issue-initiation",fti:"application/vnd.anser-web-funds-transfer-initiation",atx:"application/vnd.antix.game-component",dmg:"application/x-apple-diskimage",mpkg:"application/vnd.apple.installer+xml",aw:"application/applixware",mp3:"audio/mpeg",les:"application/vnd.hhe.lesson-player",swi:"application/vnd.aristanetworks.swi",s:"text/x-asm",atomcat:"application/atomcat+xml",atomsvc:"application/atomsvc+xml",atom:"application/atom+xml",ac:"application/pkix-attr-cert",aif:"audio/x-aiff",avi:"video/x-msvideo",aep:"application/vnd.audiograph",dxf:"image/vnd.dxf",dwf:"model/vnd.dwf",par:"text/plain-bas",bcpio:"application/x-bcpio",bin:"application/octet-stream",bmp:"image/bmp",torrent:"application/x-bittorrent",cod:"application/vnd.rim.cod",mpm:"application/vnd.blueice.multipass",bmi:"application/vnd.bmi",sh:"application/x-sh",btif:"image/prs.btif",rep:"application/vnd.businessobjects",bz:"application/x-bzip",bz2:"application/x-bzip2",csh:"application/x-csh",c:"text/x-c",cdxml:"application/vnd.chemdraw+xml",css:"text/css",cdx:"chemical/x-cdx",cml:"chemical/x-cml",csml:"chemical/x-csml",cdbcmsg:"application/vnd.contact.cmsg",cla:"application/vnd.claymore",c4g:"application/vnd.clonk.c4group",sub:"image/vnd.dvb.subtitle",cdmia:"application/cdmi-capability",cdmic:"application/cdmi-container",cdmid:"application/cdmi-domain",cdmio:"application/cdmi-object",cdmiq:"application/cdmi-queue",c11amc:"application/vnd.cluetrust.cartomobile-config",c11amz:"application/vnd.cluetrust.cartomobile-config-pkg",ras:"image/x-cmu-raster",dae:"model/vnd.collada+xml",csv:"text/csv",cpt:"application/mac-compactpro",wmlc:"application/vnd.wap.wmlc",cgm:"image/cgm",ice:"x-conference/x-cooltalk",cmx:"image/x-cmx",xar:"application/vnd.xara",cmc:"application/vnd.cosmocaller",cpio:"application/x-cpio",clkx:"application/vnd.crick.clicker",clkk:"application/vnd.crick.clicker.keyboard",clkp:"application/vnd.crick.clicker.palette",clkt:"application/vnd.crick.clicker.template",clkw:"application/vnd.crick.clicker.wordbank",wbs:"application/vnd.criticaltools.wbs+xml",cryptonote:"application/vnd.rig.cryptonote",cif:"chemical/x-cif",cmdf:"chemical/x-cmdf",cu:"application/cu-seeme",cww:"application/prs.cww",curl:"text/vnd.curl",dcurl:"text/vnd.curl.dcurl",mcurl:"text/vnd.curl.mcurl",scurl:"text/vnd.curl.scurl",car:"application/vnd.curl.car",pcurl:"application/vnd.curl.pcurl",cmp:"application/vnd.yellowriver-custom-menu",dssc:"application/dssc+der",xdssc:"application/dssc+xml",deb:"application/x-debian-package",uva:"audio/vnd.dece.audio",uvi:"image/vnd.dece.graphic",uvh:"video/vnd.dece.hd",uvm:"video/vnd.dece.mobile",uvu:"video/vnd.uvvu.mp4",uvp:"video/vnd.dece.pd",uvs:"video/vnd.dece.sd",uvv:"video/vnd.dece.video",dvi:"application/x-dvi",seed:"application/vnd.fdsn.seed",dtb:"application/x-dtbook+xml",res:"application/x-dtbresource+xml",ait:"application/vnd.dvb.ait",svc:"application/vnd.dvb.service",eol:"audio/vnd.digital-winds",djvu:"image/vnd.djvu",dtd:"application/xml-dtd",mlp:"application/vnd.dolby.mlp",wad:"application/x-doom",dpg:"application/vnd.dpgraph",dra:"audio/vnd.dra",dfac:"application/vnd.dreamfactory",dts:"audio/vnd.dts",dtshd:"audio/vnd.dts.hd",dwg:"image/vnd.dwg",geo:"application/vnd.dynageo",es:"application/ecmascript",mag:"application/vnd.ecowin.chart",mmr:"image/vnd.fujixerox.edmics-mmr",rlc:"image/vnd.fujixerox.edmics-rlc",exi:"application/exi",mgz:"application/vnd.proteus.magazine",epub:"application/epub+zip",eml:"message/rfc822",nml:"application/vnd.enliven",xpr:"application/vnd.is-xpr",xif:"image/vnd.xiff",xfdl:"application/vnd.xfdl",emma:"application/emma+xml",ez2:"application/vnd.ezpix-album",ez3:"application/vnd.ezpix-package",fst:"image/vnd.fst",fvt:"video/vnd.fvt",fbs:"image/vnd.fastbidsheet",fe_launch:"application/vnd.denovo.fcselayout-link",f4v:"video/x-f4v",flv:"video/x-flv",fpx:"image/vnd.fpx",npx:"image/vnd.net-fpx",flx:"text/vnd.fmi.flexstor",fli:"video/x-fli",ftc:"application/vnd.fluxtime.clip",fdf:"application/vnd.fdf",f:"text/x-fortran",mif:"application/vnd.mif",fm:"application/vnd.framemaker",fh:"image/x-freehand",fsc:"application/vnd.fsc.weblaunch",fnc:"application/vnd.frogans.fnc",ltf:"application/vnd.frogans.ltf",ddd:"application/vnd.fujixerox.ddd",xdw:"application/vnd.fujixerox.docuworks",xbd:"application/vnd.fujixerox.docuworks.binder",oas:"application/vnd.fujitsu.oasys",oa2:"application/vnd.fujitsu.oasys2",oa3:"application/vnd.fujitsu.oasys3",fg5:"application/vnd.fujitsu.oasysgp",bh2:"application/vnd.fujitsu.oasysprs",spl:"application/x-futuresplash",fzs:"application/vnd.fuzzysheet",g3:"image/g3fax",gmx:"application/vnd.gmx",gtw:"model/vnd.gtw",txd:"application/vnd.genomatix.tuxedo",ggb:"application/vnd.geogebra.file",ggt:"application/vnd.geogebra.tool",gdl:"model/vnd.gdl",gex:"application/vnd.geometry-explorer",gxt:"application/vnd.geonext",g2w:"application/vnd.geoplan",g3w:"application/vnd.geospace",gsf:"application/x-font-ghostscript",bdf:"application/x-font-bdf",gtar:"application/x-gtar",texinfo:"application/x-texinfo",gnumeric:"application/x-gnumeric",kml:"application/vnd.google-earth.kml+xml",kmz:"application/vnd.google-earth.kmz",gqf:"application/vnd.grafeq",gif:"image/gif",gv:"text/vnd.graphviz",gac:"application/vnd.groove-account",ghf:"application/vnd.groove-help",gim:"application/vnd.groove-identity-message",grv:"application/vnd.groove-injector",gtm:"application/vnd.groove-tool-message",tpl:"application/vnd.groove-tool-template",vcg:"application/vnd.groove-vcard",h261:"video/h261",h263:"video/h263",h264:"video/h264",hpid:"application/vnd.hp-hpid",hps:"application/vnd.hp-hps",hdf:"application/x-hdf",rip:"audio/vnd.rip",hbci:"application/vnd.hbci",jlt:"application/vnd.hp-jlyt",pcl:"application/vnd.hp-pcl",hpgl:"application/vnd.hp-hpgl",hvs:"application/vnd.yamaha.hv-script",hvd:"application/vnd.yamaha.hv-dic",hvp:"application/vnd.yamaha.hv-voice","sfd-hdstx":"application/vnd.hydrostatix.sof-data",stk:"application/hyperstudio",hal:"application/vnd.hal+xml",html:"text/html",irm:"application/vnd.ibm.rights-management",sc:"application/vnd.ibm.secure-container",ics:"text/calendar",icc:"application/vnd.iccprofile",ico:"image/x-icon",igl:"application/vnd.igloader",ief:"image/ief",ivp:"application/vnd.immervision-ivp",ivu:"application/vnd.immervision-ivu",rif:"application/reginfo+xml","3dml":"text/vnd.in3d.3dml",spot:"text/vnd.in3d.spot",igs:"model/iges",i2g:"application/vnd.intergeo",cdy:"application/vnd.cinderella",xpw:"application/vnd.intercon.formnet",fcs:"application/vnd.isac.fcs",ipfix:"application/ipfix",cer:"application/pkix-cert",pki:"application/pkixcmp",crl:"application/pkix-crl",pkipath:"application/pkix-pkipath",igm:"application/vnd.insors.igm",rcprofile:"application/vnd.ipunplugged.rcprofile",irp:"application/vnd.irepository.package+xml",jad:"text/vnd.sun.j2me.app-descriptor",jar:"application/java-archive",class:"application/java-vm",jnlp:"application/x-java-jnlp-file",ser:"application/java-serialized-object",java:"text/x-java-source,java",js:"application/javascript",json:"application/json",joda:"application/vnd.joost.joda-archive",jpm:"video/jpm",jpeg:"image/jpeg",jpg:"image/jpeg",pjpeg:"image/pjpeg",jpgv:"video/jpeg",ktz:"application/vnd.kahootz",mmd:"application/vnd.chipnuts.karaoke-mmd",karbon:"application/vnd.kde.karbon",chrt:"application/vnd.kde.kchart",kfo:"application/vnd.kde.kformula",flw:"application/vnd.kde.kivio",kon:"application/vnd.kde.kontour",kpr:"application/vnd.kde.kpresenter",ksp:"application/vnd.kde.kspread",kwd:"application/vnd.kde.kword",htke:"application/vnd.kenameaapp",kia:"application/vnd.kidspiration",kne:"application/vnd.kinar",sse:"application/vnd.kodak-descriptor",lasxml:"application/vnd.las.las+xml",latex:"application/x-latex",lbd:"application/vnd.llamagraphics.life-balance.desktop",lbe:"application/vnd.llamagraphics.life-balance.exchange+xml",jam:"application/vnd.jam",123:"application/vnd.lotus-1-2-3",apr:"application/vnd.lotus-approach",pre:"application/vnd.lotus-freelance",nsf:"application/vnd.lotus-notes",org:"application/vnd.lotus-organizer",scm:"application/vnd.lotus-screencam",lwp:"application/vnd.lotus-wordpro",lvp:"audio/vnd.lucent.voice",m3u:"audio/x-mpegurl",m4v:"video/x-m4v",hqx:"application/mac-binhex40",portpkg:"application/vnd.macports.portpkg",mgp:"application/vnd.osgeo.mapguide.package",mrc:"application/marc",mrcx:"application/marcxml+xml",mxf:"application/mxf",nbp:"application/vnd.wolfram.player",ma:"application/mathematica",mathml:"application/mathml+xml",mbox:"application/mbox",mc1:"application/vnd.medcalcdata",mscml:"application/mediaservercontrol+xml",cdkey:"application/vnd.mediastation.cdkey",mwf:"application/vnd.mfer",mfm:"application/vnd.mfmp",msh:"model/mesh",mads:"application/mads+xml",mets:"application/mets+xml",mods:"application/mods+xml",meta4:"application/metalink4+xml",mcd:"application/vnd.mcd",flo:"application/vnd.micrografx.flo",igx:"application/vnd.micrografx.igx",es3:"application/vnd.eszigno3+xml",mdb:"application/x-msaccess",asf:"video/x-ms-asf",exe:"application/x-msdownload",cil:"application/vnd.ms-artgalry",cab:"application/vnd.ms-cab-compressed",ims:"application/vnd.ms-ims",application:"application/x-ms-application",clp:"application/x-msclip",mdi:"image/vnd.ms-modi",eot:"application/vnd.ms-fontobject",xls:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xltm:"application/vnd.ms-excel.template.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",chm:"application/vnd.ms-htmlhelp",crd:"application/x-mscardfile",lrm:"application/vnd.ms-lrm",mvb:"application/x-msmediaview",mny:"application/x-msmoney",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",sldx:"application/vnd.openxmlformats-officedocument.presentationml.slide",ppsx:"application/vnd.openxmlformats-officedocument.presentationml.slideshow",potx:"application/vnd.openxmlformats-officedocument.presentationml.template",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",obd:"application/x-msbinder",thmx:"application/vnd.ms-officetheme",onetoc:"application/onenote",pya:"audio/vnd.ms-playready.media.pya",pyv:"video/vnd.ms-playready.media.pyv",ppt:"application/vnd.ms-powerpoint",ppam:"application/vnd.ms-powerpoint.addin.macroenabled.12",sldm:"application/vnd.ms-powerpoint.slide.macroenabled.12",pptm:"application/vnd.ms-powerpoint.presentation.macroenabled.12",ppsm:"application/vnd.ms-powerpoint.slideshow.macroenabled.12",potm:"application/vnd.ms-powerpoint.template.macroenabled.12",mpp:"application/vnd.ms-project",pub:"application/x-mspublisher",scd:"application/x-msschedule",xap:"application/x-silverlight-app",stl:"application/vnd.ms-pki.stl",cat:"application/vnd.ms-pki.seccat",vsd:"application/vnd.visio",vsdx:"application/vnd.visio2013",wm:"video/x-ms-wm",wma:"audio/x-ms-wma",wax:"audio/x-ms-wax",wmx:"video/x-ms-wmx",wmd:"application/x-ms-wmd",wpl:"application/vnd.ms-wpl",wmz:"application/x-ms-wmz",wmv:"video/x-ms-wmv",wvx:"video/x-ms-wvx",wmf:"application/x-msmetafile",trm:"application/x-msterminal",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",dotm:"application/vnd.ms-word.template.macroenabled.12",wri:"application/x-mswrite",wps:"application/vnd.ms-works",xbap:"application/x-ms-xbap",xps:"application/vnd.ms-xpsdocument",mid:"audio/midi",mpy:"application/vnd.ibm.minipay",afp:"application/vnd.ibm.modcap",rms:"application/vnd.jcp.javame.midlet-rms",tmo:"application/vnd.tmobile-livetv",prc:"application/x-mobipocket-ebook",mbk:"application/vnd.mobius.mbk",dis:"application/vnd.mobius.dis",plc:"application/vnd.mobius.plc",mqy:"application/vnd.mobius.mqy",msl:"application/vnd.mobius.msl",txf:"application/vnd.mobius.txf",daf:"application/vnd.mobius.daf",fly:"text/vnd.fly",mpc:"application/vnd.mophun.certificate",mpn:"application/vnd.mophun.application",mj2:"video/mj2",mpga:"audio/mpeg",mxu:"video/vnd.mpegurl",mpeg:"video/mpeg",m21:"application/mp21",mp4a:"audio/mp4",mp4:"video/mp4",m3u8:"application/vnd.apple.mpegurl",mus:"application/vnd.musician",msty:"application/vnd.muvee.style",mxml:"application/xv+xml",ngdat:"application/vnd.nokia.n-gage.data","n-gage":"application/vnd.nokia.n-gage.symbian.install",ncx:"application/x-dtbncx+xml",nc:"application/x-netcdf",nlu:"application/vnd.neurolanguage.nlu",dna:"application/vnd.dna",nnd:"application/vnd.noblenet-directory",nns:"application/vnd.noblenet-sealer",nnw:"application/vnd.noblenet-web",rpst:"application/vnd.nokia.radio-preset",rpss:"application/vnd.nokia.radio-presets",n3:"text/n3",edm:"application/vnd.novadigm.edm",edx:"application/vnd.novadigm.edx",ext:"application/vnd.novadigm.ext",gph:"application/vnd.flographit",ecelp4800:"audio/vnd.nuera.ecelp4800",ecelp7470:"audio/vnd.nuera.ecelp7470",ecelp9600:"audio/vnd.nuera.ecelp9600",oda:"application/oda",ogx:"application/ogg",oga:"audio/ogg",ogv:"video/ogg",dd2:"application/vnd.oma.dd2+xml",oth:"application/vnd.oasis.opendocument.text-web",opf:"application/oebps-package+xml",qbo:"application/vnd.intu.qbo",oxt:"application/vnd.openofficeorg.extension",osf:"application/vnd.yamaha.openscoreformat",weba:"audio/webm",webm:"video/webm",odc:"application/vnd.oasis.opendocument.chart",otc:"application/vnd.oasis.opendocument.chart-template",odb:"application/vnd.oasis.opendocument.database",odf:"application/vnd.oasis.opendocument.formula",odft:"application/vnd.oasis.opendocument.formula-template",odg:"application/vnd.oasis.opendocument.graphics",otg:"application/vnd.oasis.opendocument.graphics-template",odi:"application/vnd.oasis.opendocument.image",oti:"application/vnd.oasis.opendocument.image-template",odp:"application/vnd.oasis.opendocument.presentation",otp:"application/vnd.oasis.opendocument.presentation-template",ods:"application/vnd.oasis.opendocument.spreadsheet",ots:"application/vnd.oasis.opendocument.spreadsheet-template",odt:"application/vnd.oasis.opendocument.text",odm:"application/vnd.oasis.opendocument.text-master",ott:"application/vnd.oasis.opendocument.text-template",ktx:"image/ktx",sxc:"application/vnd.sun.xml.calc",stc:"application/vnd.sun.xml.calc.template",sxd:"application/vnd.sun.xml.draw",std:"application/vnd.sun.xml.draw.template",sxi:"application/vnd.sun.xml.impress",sti:"application/vnd.sun.xml.impress.template",sxm:"application/vnd.sun.xml.math",sxw:"application/vnd.sun.xml.writer",sxg:"application/vnd.sun.xml.writer.global",stw:"application/vnd.sun.xml.writer.template",otf:"application/x-font-otf",osfpvg:"application/vnd.yamaha.openscoreformat.osfpvg+xml",dp:"application/vnd.osgi.dp",pdb:"application/vnd.palm",p:"text/x-pascal",paw:"application/vnd.pawaafile",pclxl:"application/vnd.hp-pclxl",efif:"application/vnd.picsel",pcx:"image/x-pcx",psd:"image/vnd.adobe.photoshop",prf:"application/pics-rules",pic:"image/x-pict",chat:"application/x-chat",p10:"application/pkcs10",p12:"application/x-pkcs12",p7m:"application/pkcs7-mime",p7s:"application/pkcs7-signature",p7r:"application/x-pkcs7-certreqresp",p7b:"application/x-pkcs7-certificates",p8:"application/pkcs8",plf:"application/vnd.pocketlearn",pnm:"image/x-portable-anymap",pbm:"image/x-portable-bitmap",pcf:"application/x-font-pcf",pfr:"application/font-tdpfr",pgn:"application/x-chess-pgn",pgm:"image/x-portable-graymap",png:"image/png",ppm:"image/x-portable-pixmap",pskcxml:"application/pskc+xml",pml:"application/vnd.ctc-posml",ai:"application/postscript",pfa:"application/x-font-type1",pbd:"application/vnd.powerbuilder6",pgp:"application/pgp-signature",box:"application/vnd.previewsystems.box",ptid:"application/vnd.pvi.ptid1",pls:"application/pls+xml",str:"application/vnd.pg.format",ei6:"application/vnd.pg.osasli",dsc:"text/prs.lines.tag",psf:"application/x-font-linux-psf",qps:"application/vnd.publishare-delta-tree",wg:"application/vnd.pmi.widget",qxd:"application/vnd.quark.quarkxpress",esf:"application/vnd.epson.esf",msf:"application/vnd.epson.msf",ssf:"application/vnd.epson.ssf",qam:"application/vnd.epson.quickanime",qfx:"application/vnd.intu.qfx",mov:"video/quicktime",rar:"application/x-rar-compressed",ram:"audio/x-pn-realaudio",rmp:"audio/x-pn-realaudio-plugin",rsd:"application/rsd+xml",rm:"application/vnd.rn-realmedia",bed:"application/vnd.realvnc.bed",mxl:"application/vnd.recordare.musicxml",musicxml:"application/vnd.recordare.musicxml+xml",rnc:"application/relax-ng-compact-syntax",rdz:"application/vnd.data-vision.rdz",rdf:"application/rdf+xml",rp9:"application/vnd.cloanto.rp9",jisp:"application/vnd.jisp",rtf:"application/rtf",rtx:"text/richtext",link66:"application/vnd.route66.link66+xml",rss:"application/rss+xml",shf:"application/shf+xml",st:"application/vnd.sailingtracker.track",svg:"image/svg+xml",sus:"application/vnd.sus-calendar",sru:"application/sru+xml",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",sema:"application/vnd.sema",semd:"application/vnd.semd",semf:"application/vnd.semf",see:"application/vnd.seemail",snf:"application/x-font-snf",spq:"application/scvp-vp-request",spp:"application/scvp-vp-response",scq:"application/scvp-cv-request",scs:"application/scvp-cv-response",sdp:"application/sdp",etx:"text/x-setext",movie:"video/x-sgi-movie",ifm:"application/vnd.shana.informed.formdata",itp:"application/vnd.shana.informed.formtemplate",iif:"application/vnd.shana.informed.interchange",ipk:"application/vnd.shana.informed.package",tfi:"application/thraud+xml",shar:"application/x-shar",rgb:"image/x-rgb",slt:"application/vnd.epson.salt",aso:"application/vnd.accpac.simply.aso",imp:"application/vnd.accpac.simply.imp",twd:"application/vnd.simtech-mindmapper",csp:"application/vnd.commonspace",saf:"application/vnd.yamaha.smaf-audio",mmf:"application/vnd.smaf",spf:"application/vnd.yamaha.smaf-phrase",teacher:"application/vnd.smart.teacher",svd:"application/vnd.svd",rq:"application/sparql-query",srx:"application/sparql-results+xml",gram:"application/srgs",grxml:"application/srgs+xml",ssml:"application/ssml+xml",skp:"application/vnd.koan",sgml:"text/sgml",sdc:"application/vnd.stardivision.calc",sda:"application/vnd.stardivision.draw",sdd:"application/vnd.stardivision.impress",smf:"application/vnd.stardivision.math",sdw:"application/vnd.stardivision.writer",sgl:"application/vnd.stardivision.writer-global",sm:"application/vnd.stepmania.stepchart",sit:"application/x-stuffit",sitx:"application/x-stuffitx",sdkm:"application/vnd.solent.sdkm+xml",xo:"application/vnd.olpc-sugar",au:"audio/basic",wqd:"application/vnd.wqd",sis:"application/vnd.symbian.install",smi:"application/smil+xml",xsm:"application/vnd.syncml+xml",bdm:"application/vnd.syncml.dm+wbxml",xdm:"application/vnd.syncml.dm+xml",sv4cpio:"application/x-sv4cpio",sv4crc:"application/x-sv4crc",sbml:"application/sbml+xml",tsv:"text/tab-separated-values",tiff:"image/tiff",tao:"application/vnd.tao.intent-module-archive",tar:"application/x-tar",tcl:"application/x-tcl",tex:"application/x-tex",tfm:"application/x-tex-tfm",tei:"application/tei+xml",txt:"text/plain",dxp:"application/vnd.spotfire.dxp",sfs:"application/vnd.spotfire.sfs",tsd:"application/timestamped-data",tpt:"application/vnd.trid.tpt",mxs:"application/vnd.triscape.mxs",t:"text/troff",tra:"application/vnd.trueapp",ttf:"application/x-font-ttf",ttl:"text/turtle",umj:"application/vnd.umajin",uoml:"application/vnd.uoml+xml",unityweb:"application/vnd.unity",ufd:"application/vnd.ufdl",uri:"text/uri-list",utz:"application/vnd.uiq.theme",ustar:"application/x-ustar",uu:"text/x-uuencode",vcs:"text/x-vcalendar",vcf:"text/x-vcard",vcd:"application/x-cdlink",vsf:"application/vnd.vsf",wrl:"model/vrml",vcx:"application/vnd.vcx",mts:"model/vnd.mts",vtu:"model/vnd.vtu",vis:"application/vnd.visionary",viv:"video/vnd.vivo",ccxml:"application/ccxml+xml,",vxml:"application/voicexml+xml",src:"application/x-wais-source",wbxml:"application/vnd.wap.wbxml",wbmp:"image/vnd.wap.wbmp",wav:"audio/x-wav",davmount:"application/davmount+xml",woff:"application/x-font-woff",wspolicy:"application/wspolicy+xml",webp:"image/webp",wtb:"application/vnd.webturbo",wgt:"application/widget",hlp:"application/winhlp",wml:"text/vnd.wap.wml",wmls:"text/vnd.wap.wmlscript",wmlsc:"application/vnd.wap.wmlscriptc",wpd:"application/vnd.wordperfect",stf:"application/vnd.wt.stf",wsdl:"application/wsdl+xml",xbm:"image/x-xbitmap",xpm:"image/x-xpixmap",xwd:"image/x-xwindowdump",der:"application/x-x509-ca-cert",fig:"application/x-xfig",xhtml:"application/xhtml+xml",xml:"application/xml",xdf:"application/xcap-diff+xml",xenc:"application/xenc+xml",xer:"application/patch-ops-error+xml",rl:"application/resource-lists+xml",rs:"application/rls-services+xml",rld:"application/resource-lists-diff+xml",xslt:"application/xslt+xml",xop:"application/xop+xml",xpi:"application/x-xpinstall",xspf:"application/xspf+xml",xul:"application/vnd.mozilla.xul+xml",xyz:"chemical/x-xyz",yaml:"text/yaml",yang:"application/yang",yin:"application/yin+xml",zir:"application/vnd.zul",zip:"application/zip",zmm:"application/vnd.handheld-entertainment+xml",zaz:"application/vnd.zzazz.deck+xml"},oi=Object.fromEntries(Object.entries(we).map(function(t){var n=at(t,2),s=n[0],e=n[1];return[e,s]})),Bn=/^data:(.*?);base64,/;function Wn(t){var n=Bn.exec(t);if(n&&n[1])return n[1]}function Ln(t){var n=oi[t];return n||t.split("/")[1]}function Jn(t){var n=t.split(".").pop(),s=n&&we[n];if(s)return s}function li(t,n,s,e,i){var r="".concat(e?.width||"").concat(e?.height||"").concat(e?.mimeType),a={type:n.type,opt:n.opt,options:H({},n.options)};return t+JSON.stringify(a)+s+r+i}function Dn(t,n,s,e,i,r){return be(r.encode(li(t,n,s,e,i))).slice(0,4)}function ui(t){return t.slice(0,12)}function Gn(t){return ui(be(new Uint8Array(t)))}var Un={getRouterId:function(){return"external-url-router"},validate:function(n,s){var e=[],i=ot(s),r;try{for(i.s();!(r=i.n()).done;){var a=r.value;a.startsWith("https://")||a.startsWith("http://")||e.push({error:{message:'URL path "'.concat(a,'" does not start with "https://" or "http://"'),expectedPath:null,urlPath:a}})}}catch(o){i.e(o)}finally{i.f()}return[]}};function Kn(t,n){var s=t.startsWith("/")?t.slice(1).split("/"):t.split("/");if(n.length===0)return{isValid:s.length===0||s.length===1&&s[0]==="",expectedPath:"/"};for(var e=0,i=0,r=!1,a=-1,o=0;o<n.length;o++){var l=n[o];l.startsWith("[[")&&l.endsWith("]]")?(r=!0,a=o,i=1/0):l.startsWith("[...")&&l.endsWith("]")?(r=!0,a=o,e++,i=1/0):l.startsWith("[[")&&l.endsWith("]")?i++:(l.startsWith("[")&&l.endsWith("]"),e++,i++)}if(s.length<e||!r&&s.length>i){var u=n.map(function(v){return v.startsWith("[[")&&v.endsWith("]]")?"[optional:".concat(v.slice(2,-2),"]"):v.startsWith("[...")&&v.endsWith("]")?"[...".concat(v.slice(4,-1),"]"):v.startsWith("[[")&&v.endsWith("]")?"[optional:".concat(v.slice(2,-1),"]"):v.startsWith("[")&&v.endsWith("]")?"[".concat(v.slice(1,-1),"]"):v}).join("/");return{isValid:!1,expectedPath:"/".concat(u)}}for(var c=r?a:n.length,d=0;d<c;d++){var g=n[d],h=s[d];if(g.startsWith("[[")&&g.endsWith("]]")){if(h!==""&&h!==void 0&&h==="")return{isValid:!1,expectedPath:"/".concat(n.join("/"))}}else if(g.startsWith("[")&&g.endsWith("]")){if(h===""||h===void 0)return{isValid:!1,expectedPath:"/".concat(n.join("/"))}}else if(g!==h)return{isValid:!1,expectedPath:"/".concat(n.join("/"))}}return{isValid:!0}}var Yn={getRouterId:function(){return"next-app-router"},validate:function(n,s){var e=Xn(n),i=[],r=ot(s),a;try{for(r.s();!(a=r.n()).done;){var o=a.value,l=Kn(o,e);l.isValid||i.push({error:{message:'URL path "'.concat(o,'" does not match the route pattern for "').concat(n,'"'),urlPath:o,expectedPath:l.expectedPath||null}})}}catch(u){r.e(u)}finally{r.f()}return i}};function Xn(t){if(!t||typeof t!="string")return[];for(var n=[/\/app\/(.+)\/page\.val\.ts$/,/\/src\/app\/(.+)\/page\.val\.ts$/,/\/app\/(.+)\/page\.tsx?$/,/\/src\/app\/(.+)\/page\.tsx?$/],s=0,e=n;s<e.length;s++){var i=e[s],r=t.match(i);if(r){var a=r[1];return a.split("/").flatMap(function(o){if(o.startsWith("(")&&o.endsWith(")")&&!o.includes("."))return[];var l=o.match(/^(\([.]+\)(\(.+\))?)(.*)$/);if(l){var u=l[3]||l[4];return u?[u]:[]}return[o]})}}return[]}var Et="?p=",et={VERSION:{core:(function(){try{return require("../package.json").version}catch{return null}})()},convertFileSource:qi,convertRemoteSource:En,getSchema:Xe,getValPath:Ut,getSource:ve,resolvePath:ln,safeResolvePath:un,splitModuleFilePathAndModulePath:ye,joinModuleFilePathAndModulePath:$e,nextAppRouter:Yn,externalPageRouter:Un,remote:{createRemoteRef:Fn,getValidationBasis:li,getValidationHash:Dn,getFileHash:Gn,hashToRemoteFileHash:ui,splitRemoteRef:ge},validate:function(n,s,e){var i;return n&&((i=Xe(n))===null||i===void 0?void 0:i.executeValidate(s,e))},isVal:Zi,isFile:Xi,createValPathOfItem:pt,getSHA256Hash:be,initSchema:jn,getMimeType:Wn,mimeTypeToFileExt:Ln,filenameToMimeType:Jn,EXT_TO_MIME_TYPES:we,MIME_TYPES_TO_EXT:oi,ModuleFilePathSep:Et,notFileOp:function(n){return n.op!=="file"},isFileOp:function(n){return n.op==="file"&&typeof n.filePath=="string"},createPatchJSONPath:function(n){return"/".concat(n.split(".").map(function(s){return s&&Zn(s)}).join("/"))},createPatchPath:function(n){return _t(n)},splitModulePath:_t,splitModuleFilePath:cn,splitJoinedSourcePaths:dn,parentOfSourcePath:hn,patchPathToModulePath:ai,VAL_ENABLE_COOKIE_NAME:"val_enable",VAL_STATE_COOKIE:"val_state",VAL_SESSION_COOKIE:"val_session",createFilename:function(n,s,e,i){var r,a;if(!e||!n)return s;var o=i.slice(0,5),l=(r=et.getMimeType(n))!==null&&r!==void 0?r:"unknown",u=(a=et.mimeTypeToFileExt(l))!==null&&a!==void 0?a:"unknown";if(s){var c=s.split(".").slice(0,-1).join(".")||s,d=c.lastIndexOf("_"),g=c.slice(d+1,c.length);g===o&&(c=c.slice(0,d));var h=encodeURIComponent(c).replace(/%[0-9A-Fa-f]{2}/g,"").toLowerCase();return"".concat(h,"_").concat(o,".").concat(u)}return"".concat(i,".").concat(u)}};function Zn(t){try{return JSON.parse(t)}catch{return t}}var F;function K(t,n,s){const e=typeof s,i=typeof t;if(e!=="undefined"){if(i!=="undefined"){if(s){if(i==="function"&&e===i)return function(o){return t(s(o))};if(n=t.constructor,n===s.constructor){if(n===Array)return s.concat(t);if(n===Map){var r=new Map(s);for(var a of t)r.set(a[0],a[1]);return r}if(n===Set){a=new Set(s);for(r of t.values())a.add(r);return a}}}return t}return s}return i==="undefined"?n:t}function St(t,n){return typeof t>"u"?n:t}function L(){return Object.create(null)}function it(t){return typeof t=="string"}function Ct(t){return typeof t=="object"}function Nt(t,n){if(it(n))t=t[n];else for(let s=0;t&&s<n.length;s++)t=t[n[s]];return t}const Qn=/[^\p{L}\p{N}]+/u,qn=/(\d{3})/g,$n=/(\D)(\d{3})/g,ts=/(\d{3})(\D)/g,ci=/[\u0300-\u036f]/g;function Bt(t={}){if(!this||this.constructor!==Bt)return new Bt(...arguments);if(arguments.length)for(t=0;t<arguments.length;t++)this.assign(arguments[t]);else this.assign(t)}F=Bt.prototype,F.assign=function(t){this.normalize=K(t.normalize,!0,this.normalize);let n=t.include,s=n||t.exclude||t.split,e;if(s||s===""){if(typeof s=="object"&&s.constructor!==RegExp){let i="";e=!n,n||(i+="\\p{Z}"),s.letter&&(i+="\\p{L}"),s.number&&(i+="\\p{N}",e=!!n),s.symbol&&(i+="\\p{S}"),s.punctuation&&(i+="\\p{P}"),s.control&&(i+="\\p{C}"),(s=s.char)&&(i+=typeof s=="object"?s.join(""):s);try{this.split=new RegExp("["+(n?"^":"")+i+"]+","u")}catch{this.split=/\s+/}}else this.split=s,e=s===!1||"a1a".split(s).length<2;this.numeric=K(t.numeric,e)}else{try{this.split=K(this.split,Qn)}catch{this.split=/\s+/}this.numeric=K(t.numeric,K(this.numeric,!0))}if(this.prepare=K(t.prepare,null,this.prepare),this.finalize=K(t.finalize,null,this.finalize),s=t.filter,this.filter=typeof s=="function"?s:K(s&&new Set(s),null,this.filter),this.dedupe=K(t.dedupe,!0,this.dedupe),this.matcher=K((s=t.matcher)&&new Map(s),null,this.matcher),this.mapper=K((s=t.mapper)&&new Map(s),null,this.mapper),this.stemmer=K((s=t.stemmer)&&new Map(s),null,this.stemmer),this.replacer=K(t.replacer,null,this.replacer),this.minlength=K(t.minlength,1,this.minlength),this.maxlength=K(t.maxlength,1024,this.maxlength),this.rtl=K(t.rtl,!1,this.rtl),(this.cache=s=K(t.cache,!0,this.cache))&&(this.F=null,this.L=typeof s=="number"?s:2e5,this.B=new Map,this.D=new Map,this.I=this.H=128),this.h="",this.J=null,this.A="",this.K=null,this.matcher)for(const i of this.matcher.keys())this.h+=(this.h?"|":"")+i;if(this.stemmer)for(const i of this.stemmer.keys())this.A+=(this.A?"|":"")+i;return this},F.addStemmer=function(t,n){return this.stemmer||(this.stemmer=new Map),this.stemmer.set(t,n),this.A+=(this.A?"|":"")+t,this.K=null,this.cache&&wt(this),this},F.addFilter=function(t){return typeof t=="function"?this.filter=t:(this.filter||(this.filter=new Set),this.filter.add(t)),this.cache&&wt(this),this},F.addMapper=function(t,n){return typeof t=="object"?this.addReplacer(t,n):t.length>1?this.addMatcher(t,n):(this.mapper||(this.mapper=new Map),this.mapper.set(t,n),this.cache&&wt(this),this)},F.addMatcher=function(t,n){return typeof t=="object"?this.addReplacer(t,n):t.length<2&&(this.dedupe||this.mapper)?this.addMapper(t,n):(this.matcher||(this.matcher=new Map),this.matcher.set(t,n),this.h+=(this.h?"|":"")+t,this.J=null,this.cache&&wt(this),this)},F.addReplacer=function(t,n){return typeof t=="string"?this.addMatcher(t,n):(this.replacer||(this.replacer=[]),this.replacer.push(t,n),this.cache&&wt(this),this)},F.encode=function(t,n){if(this.cache&&t.length<=this.H)if(this.F){if(this.B.has(t))return this.B.get(t)}else this.F=setTimeout(wt,50,this);this.normalize&&(typeof this.normalize=="function"?t=this.normalize(t):t=ci?t.normalize("NFKD").replace(ci,"").toLowerCase():t.toLowerCase()),this.prepare&&(t=this.prepare(t)),this.numeric&&t.length>3&&(t=t.replace($n,"$1 $2").replace(ts,"$1 $2").replace(qn,"$1 "));const s=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let e=[],i=L(),r,a,o=this.split||this.split===""?t.split(this.split):[t];for(let u=0,c,d;u<o.length;u++)if((c=d=o[u])&&!(c.length<this.minlength||c.length>this.maxlength)){if(n){if(i[c])continue;i[c]=1}else{if(r===c)continue;r=c}if(s)e.push(c);else if(!this.filter||(typeof this.filter=="function"?this.filter(c):!this.filter.has(c))){if(this.cache&&c.length<=this.I)if(this.F){var l=this.D.get(c);if(l||l===""){l&&e.push(l);continue}}else this.F=setTimeout(wt,50,this);if(this.stemmer){this.K||(this.K=new RegExp("(?!^)("+this.A+")$"));let g;for(;g!==c&&c.length>2;)g=c,c=c.replace(this.K,h=>this.stemmer.get(h))}if(c&&(this.mapper||this.dedupe&&c.length>1)){l="";for(let g=0,h="",v,m;g<c.length;g++)v=c.charAt(g),v===h&&this.dedupe||((m=this.mapper&&this.mapper.get(v))||m===""?m===h&&this.dedupe||!(h=m)||(l+=m):l+=h=v);c=l}if(this.matcher&&c.length>1&&(this.J||(this.J=new RegExp("("+this.h+")","g")),c=c.replace(this.J,g=>this.matcher.get(g))),c&&this.replacer)for(l=0;c&&l<this.replacer.length;l+=2)c=c.replace(this.replacer[l],this.replacer[l+1]);if(this.cache&&d.length<=this.I&&(this.D.set(d,c),this.D.size>this.L&&(this.D.clear(),this.I=this.I/1.1|0)),c){if(c!==d)if(n){if(i[c])continue;i[c]=1}else{if(a===c)continue;a=c}e.push(c)}}}return this.finalize&&(e=this.finalize(e)||e),this.cache&&t.length<=this.H&&(this.B.set(t,e),this.B.size>this.L&&(this.B.clear(),this.H=this.H/1.1|0)),e};function wt(t){t.F=null,t.B.clear(),t.D.clear()}function ke(t,n,s){s||(n||typeof t!="object"?typeof n=="object"&&(s=n,n=0):s=t),s&&(t=s.query||t,n=s.limit||n);let e=""+(n||0);s&&(e+=(s.offset||0)+!!s.context+!!s.suggest+(s.resolve!==!1)+(s.resolution||this.resolution)+(s.boost||0)),t=(""+t).toLowerCase(),this.cache||(this.cache=new kt);let i=this.cache.get(t+e);if(!i){const r=s&&s.cache;r&&(s.cache=!1),i=this.search(t,n,s),r&&(s.cache=r),this.cache.set(t+e,i)}return i}function kt(t){this.limit=t&&t!==!0?t:1e3,this.cache=new Map,this.h=""}kt.prototype.set=function(t,n){this.cache.set(this.h=t,n),this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)},kt.prototype.get=function(t){const n=this.cache.get(t);return n&&this.h!==t&&(this.cache.delete(t),this.cache.set(this.h=t,n)),n},kt.prototype.remove=function(t){for(const n of this.cache){const s=n[0];n[1].includes(t)&&this.cache.delete(s)}},kt.prototype.clear=function(){this.cache.clear(),this.h=""};const di={normalize:!1,numeric:!1,dedupe:!1},qt={},Ve=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]),hi=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["ph","f"],["pf","f"]]),pi=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/(.)\1+/g,"$1"],fi={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,ß:2,d:3,t:3,l:4,m:5,n:5,r:6};var mi={Exact:di,Default:qt,Normalize:qt,LatinBalance:{mapper:Ve},LatinAdvanced:{mapper:Ve,matcher:hi,replacer:pi},LatinExtra:{mapper:Ve,replacer:pi.concat([/(?!^)[aeo]/g,""]),matcher:hi},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(t){for(let s=0;s<t.length;s++){var n=t[s];let e=n.charAt(0),i=fi[e];for(let r=1,a;r<n.length&&(a=n.charAt(r),a==="h"||a==="w"||!(a=fi[a])||a===i||(e+=a,i=a,e.length!==4));r++);t[s]=e}}},CJK:{split:""},LatinExact:di,LatinDefault:qt,LatinSimple:qt};function gi(t,n,s,e){let i=[];for(let r=0,a;r<t.index.length;r++)if(a=t.index[r],n>=a.length)n-=a.length;else{n=a[e?"splice":"slice"](n,s);const o=n.length;if(o&&(i=i.length?i.concat(n):n,s-=o,e&&(t.length-=o),!s))break;n=0}return i}function Ot(t){if(!this||this.constructor!==Ot)return new Ot(t);this.index=t?[t]:[],this.length=t?t.length:0;const n=this;return new Proxy([],{get(s,e){if(e==="length")return n.length;if(e==="push")return function(i){n.index[n.index.length-1].push(i),n.length++};if(e==="pop")return function(){if(n.length)return n.length--,n.index[n.index.length-1].pop()};if(e==="indexOf")return function(i){let r=0;for(let a=0,o,l;a<n.index.length;a++){if(o=n.index[a],l=o.indexOf(i),l>=0)return r+l;r+=o.length}return-1};if(e==="includes")return function(i){for(let r=0;r<n.index.length;r++)if(n.index[r].includes(i))return!0;return!1};if(e==="slice")return function(i,r){return gi(n,i||0,r||n.length,!1)};if(e==="splice")return function(i,r){return gi(n,i||0,r||n.length,!0)};if(e==="constructor")return Array;if(typeof e!="symbol")return(s=n.index[e/2**31|0])&&s[e]},set(s,e,i){return s=e/2**31|0,(n.index[s]||(n.index[s]=[]))[e]=i,n.length++,!0}})}Ot.prototype.clear=function(){this.index.length=0},Ot.prototype.push=function(){};function nt(t=8){if(!this||this.constructor!==nt)return new nt(t);this.index=L(),this.h=[],this.size=0,t>32?(this.B=yi,this.A=BigInt(t)):(this.B=vi,this.A=t)}nt.prototype.get=function(t){const n=this.index[this.B(t)];return n&&n.get(t)},nt.prototype.set=function(t,n){var s=this.B(t);let e=this.index[s];e?(s=e.size,e.set(t,n),(s-=e.size)&&this.size++):(this.index[s]=e=new Map([[t,n]]),this.h.push(e),this.size++)};function st(t=8){if(!this||this.constructor!==st)return new st(t);this.index=L(),this.h=[],this.size=0,t>32?(this.B=yi,this.A=BigInt(t)):(this.B=vi,this.A=t)}st.prototype.add=function(t){var n=this.B(t);let s=this.index[n];s?(n=s.size,s.add(t),(n-=s.size)&&this.size++):(this.index[n]=s=new Set([t]),this.h.push(s),this.size++)},F=nt.prototype,F.has=st.prototype.has=function(t){const n=this.index[this.B(t)];return n&&n.has(t)},F.delete=st.prototype.delete=function(t){const n=this.index[this.B(t)];n&&n.delete(t)&&this.size--},F.clear=st.prototype.clear=function(){this.index=L(),this.h=[],this.size=0},F.values=st.prototype.values=function*(){for(let t=0;t<this.h.length;t++)for(let n of this.h[t].values())yield n},F.keys=st.prototype.keys=function*(){for(let t=0;t<this.h.length;t++)for(let n of this.h[t].keys())yield n},F.entries=st.prototype.entries=function*(){for(let t=0;t<this.h.length;t++)for(let n of this.h[t].entries())yield n};function vi(t){let n=2**this.A-1;if(typeof t=="number")return t&n;let s=0,e=this.A+1;for(let i=0;i<t.length;i++)s=(s*e^t.charCodeAt(i))&n;return this.A===32?s+2**31:s}function yi(t){let n=BigInt(2)**this.A-BigInt(1);var s=typeof t;if(s==="bigint")return t&n;if(s==="number")return BigInt(t)&n;s=BigInt(0);let e=this.A+BigInt(1);for(let i=0;i<t.length;i++)s=(s*e^BigInt(t.charCodeAt(i)))&n;return s}let At,Wt;async function es(t){t=t.data;var n=t.task;const s=t.id;let e=t.args;if(n==="init")Wt=t.options||{},(n=t.factory)?(Function("return "+n)()(self),At=new self.FlexSearch.Index(Wt),delete self.FlexSearch):At=new rt(Wt),postMessage({id:s});else{let i;n==="export"&&(e[1]?(e[0]=Wt.export,e[2]=0,e[3]=1):e=null),n==="import"?e[0]&&(t=await Wt.import.call(At,e[0]),At.import(e[0],t)):((i=e&&At[n].apply(At,e))&&i.then&&(i=await i),i&&i.await&&(i=await i.await),n==="search"&&i.result&&(i=i.result)),postMessage(n==="search"?{id:s,msg:i}:{id:s})}}function Re(t){Ht.call(t,"add"),Ht.call(t,"append"),Ht.call(t,"search"),Ht.call(t,"update"),Ht.call(t,"remove"),Ht.call(t,"searchCache")}let je,xi,$t;function is(){je=$t=0}function Ht(t){this[t+"Async"]=function(){const n=arguments;var s=n[n.length-1];let e;if(typeof s=="function"&&(e=s,delete n[n.length-1]),je?$t||($t=Date.now()-xi>=this.priority*this.priority*3):(je=setTimeout(is,0),xi=Date.now()),$t){const r=this;return new Promise(a=>{setTimeout(function(){a(r[t+"Async"].apply(r,n))},0)})}const i=this[t].apply(this,n);return s=i.then?i:new Promise(r=>r(i)),e&&s.then(e),s}}let mt=0;function Mt(t={},n){function s(o){function l(u){u=u.data||u;const c=u.id,d=c&&r.h[c];d&&(d(u.msg),delete r.h[c])}if(this.worker=o,this.h=L(),this.worker)return i?this.worker.on("message",l):this.worker.onmessage=l,t.config?new Promise(function(u){mt>1e9&&(mt=0),r.h[++mt]=function(){u(r)},r.worker.postMessage({id:mt,task:"init",factory:e,options:t})}):(this.priority=t.priority||4,this.encoder=n||null,this.worker.postMessage({task:"init",factory:e,options:t}),this)}if(!this||this.constructor!==Mt)return new Mt(t);let e=typeof self<"u"?self._factory:typeof window<"u"?window._factory:null;e&&(e=e.toString());const i=typeof window>"u",r=this,a=ns(e,i,t.worker);return a.then?a.then(function(o){return s.call(r,o)}):s.call(this,a)}gt("add"),gt("append"),gt("search"),gt("update"),gt("remove"),gt("clear"),gt("export"),gt("import"),Mt.prototype.searchCache=ke,Re(Mt.prototype);function gt(t){Mt.prototype[t]=function(){const n=this,s=[].slice.call(arguments);var e=s[s.length-1];let i;return typeof e=="function"&&(i=e,s.pop()),e=new Promise(function(r){t==="export"&&typeof s[0]=="function"&&(s[0]=null),mt>1e9&&(mt=0),n.h[++mt]=r,n.worker.postMessage({task:t,id:mt,args:s})}),i?(e.then(i),this):e}}function ns(t,n,s){return n?typeof module<"u"?new(require("worker_threads")).Worker(__dirname+"/worker/node.js"):Promise.resolve().then(function(){return bs}).then(function(e){return new e.Worker("undefined/node/node.mjs")}):t?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+es.toString()],{type:"text/javascript"}))):new window.Worker(typeof s=="string"?s:self.location.href.replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js","module/worker/worker.js").replace("flexsearch.bundle.module.min.mjs","module/worker/worker.js"),{type:"module"})}It.prototype.add=function(t,n,s){if(Ct(t)&&(n=t,t=Nt(n,this.key)),n&&(t||t===0)){if(!s&&this.reg.has(t))return this.update(t,n);for(let o=0,l;o<this.field.length;o++){l=this.B[o];var e=this.index.get(this.field[o]);if(typeof l=="function"){var i=l(n);i&&e.add(t,i,s,!0)}else i=l.G,(!i||i(n))&&(l.constructor===String?l=[""+l]:it(l)&&(l=[l]),Ee(n,l,this.D,0,e,t,l[0],s))}if(this.tag)for(e=0;e<this.A.length;e++){var r=this.A[e];i=this.tag.get(this.F[e]);let o=L();if(typeof r=="function"){if(r=r(n),!r)continue}else{var a=r.G;if(a&&!a(n))continue;r.constructor===String&&(r=""+r),r=Nt(n,r)}if(i&&r){it(r)&&(r=[r]);for(let l=0,u,c;l<r.length;l++)if(u=r[l],!o[u]&&(o[u]=1,(a=i.get(u))?c=a:i.set(u,c=[]),!s||!c.includes(t))){if(c.length===2**31-1){if(a=new Ot(c),this.fastupdate)for(let d of this.reg.values())d.includes(c)&&(d[d.indexOf(c)]=a);i.set(u,c=a)}c.push(t),this.fastupdate&&((a=this.reg.get(t))?a.push(c):this.reg.set(t,[c]))}}}if(this.store&&(!s||!this.store.has(t))){let o;if(this.h){o=L();for(let l=0,u;l<this.h.length;l++){if(u=this.h[l],(s=u.G)&&!s(n))continue;let c;if(typeof u=="function"){if(c=u(n),!c)continue;u=[u.O]}else if(it(u)||u.constructor===String){o[u]=n[u];continue}Fe(n,o,u,0,u[0],c)}}this.store.set(t,o||n)}this.worker&&(this.fastupdate||this.reg.add(t))}return this};function Fe(t,n,s,e,i,r){if(t=t[i],e===s.length-1)n[i]=r||t;else if(t)if(t.constructor===Array)for(n=n[i]=Array(t.length),i=0;i<t.length;i++)Fe(t,n,s,e,i);else n=n[i]||(n[i]=L()),i=s[++e],Fe(t,n,s,e,i)}function Ee(t,n,s,e,i,r,a,o){if(t=t[a])if(e===n.length-1){if(t.constructor===Array){if(s[e]){for(n=0;n<t.length;n++)i.add(r,t[n],!0,!0);return}t=t.join(" ")}i.add(r,t,o,!0)}else if(t.constructor===Array)for(a=0;a<t.length;a++)Ee(t,n,s,e,i,r,a,o);else a=n[++e],Ee(t,n,s,e,i,r,a,o)}function Se(t,n,s,e){if(!t.length)return t;if(t.length===1)return t=t[0],t=s||t.length>n?t.slice(s,s+n):t,e?zt.call(this,t):t;let i=[];for(let r=0,a,o;r<t.length;r++)if((a=t[r])&&(o=a.length)){if(s){if(s>=o){s-=o;continue}a=a.slice(s,s+n),o=a.length,s=0}if(o>n&&(a=a.slice(0,n),o=n),!i.length&&o>=n)return e?zt.call(this,a):a;if(i.push(a),n-=o,!n)break}return i=i.length>1?[].concat.apply([],i):i[0],e?zt.call(this,i):i}function te(t,n,s,e){var i=e[0];if(i[0]&&i[0].query)return t[n].apply(t,i);if(!(n!=="and"&&n!=="not"||t.result.length||t.await||i.suggest))return e.length>1&&(i=e[e.length-1]),(e=i.resolve)?t.await||t.result:t;let r=[],a=0,o=0,l,u,c,d,g;for(n=0;n<e.length;n++)if(i=e[n]){var h=void 0;if(i.constructor===C)h=i.await||i.result;else if(i.then||i.constructor===Array)h=i;else{a=i.limit||0,o=i.offset||0,c=i.suggest,u=i.resolve,l=((d=i.highlight||t.highlight)||i.enrich)&&u,h=i.queue;let v=i.async||h,m=i.index,f=i.query;if(m?t.index||(t.index=m):m=t.index,f||i.tag){const x=i.field||i.pluck;if(x&&(!f||t.query&&!d||(t.query=f,t.field=x,t.highlight=d),m=m.index.get(x)),h&&(g||t.await)){g=1;let y;const V=t.C.length,b=new Promise(function(j){y=j});(function(j,A){b.h=function(){A.index=null,A.resolve=!1;let O=v?j.searchAsync(A):j.search(A);return O.then?O.then(function(w){return t.C[V]=w=w.result||w,y(w),w}):(O=O.result||O,y(O),O)}})(m,Object.assign({},i)),t.C.push(b),r[n]=b;continue}else i.resolve=!1,i.index=null,h=v?m.searchAsync(i):m.search(i),i.resolve=u,i.index=m}else if(i.and)h=ee(i,"and",m);else if(i.or)h=ee(i,"or",m);else if(i.not)h=ee(i,"not",m);else if(i.xor)h=ee(i,"xor",m);else continue}h.await?(g=1,h=h.await):h.then?(g=1,h=h.then(function(v){return v.result||v})):h=h.result||h,r[n]=h}if(g&&!t.await&&(t.await=new Promise(function(v){t.return=v})),g){const v=Promise.all(r).then(function(m){for(let f=0;f<t.C.length;f++)if(t.C[f]===v){t.C[f]=function(){return s.call(t,m,a,o,l,u,c,d)};break}Oe(t)});t.C.push(v)}else if(t.await)t.C.push(function(){return s.call(t,r,a,o,l,u,c,d)});else return s.call(t,r,a,o,l,u,c,d);return u?t.await||t.result:t}function ee(t,n,s){t=t[n];const e=t[0]||t;return e.index||(e.index=s),s=new C(e),t.length>1&&(s=s[n].apply(s,t.slice(1))),s}C.prototype.or=function(){return te(this,"or",ss,arguments)};function ss(t,n,s,e,i,r,a){return t.length&&(this.result.length&&t.push(this.result),t.length<2?this.result=t[0]:(this.result=bi(t,n,s,!1,this.h),s=0)),i&&(this.await=null),i?this.resolve(n,s,e,a):this}C.prototype.and=function(){return te(this,"and",rs,arguments)};function rs(t,n,s,e,i,r,a){if(!r&&!this.result.length)return i?this.result:this;let o;if(t.length)if(this.result.length&&t.unshift(this.result),t.length<2)this.result=t[0];else{let l=0;for(let u=0,c,d;u<t.length;u++)if((c=t[u])&&(d=c.length))l<d&&(l=d);else if(!r){l=0;break}l?(this.result=ne(t,l,n,s,r,this.h,i),o=!0):this.result=[]}else r||(this.result=t);return i&&(this.await=null),i?this.resolve(n,s,e,a,o):this}C.prototype.xor=function(){return te(this,"xor",as,arguments)};function as(t,n,s,e,i,r,a){if(t.length)if(this.result.length&&t.unshift(this.result),t.length<2)this.result=t[0];else{t:{r=s;var o=this.h;const l=[],u=L();let c=0;for(let d=0,g;d<t.length;d++)if(g=t[d]){c<g.length&&(c=g.length);for(let h=0,v;h<g.length;h++)if(v=g[h])for(let m=0,f;m<v.length;m++)f=v[m],u[f]=u[f]?2:1}for(let d=0,g,h=0;d<c;d++)for(let v=0,m;v<t.length;v++)if((m=t[v])&&(g=m[d])){for(let f=0,x;f<g.length;f++)if(x=g[f],u[x]===1)if(r)r--;else if(i){if(l.push(x),l.length===n){t=l;break t}}else{const y=d+(v?o:0);if(l[y]||(l[y]=[]),l[y].push(x),++h===n){t=l;break t}}}t=l}this.result=t,o=!0}else r||(this.result=t);return i&&(this.await=null),i?this.resolve(n,s,e,a,o):this}C.prototype.not=function(){return te(this,"not",os,arguments)};function os(t,n,s,e,i,r,a){if(!r&&!this.result.length)return i?this.result:this;if(t.length&&this.result.length){t:{r=s;var o=[];t=new Set(t.flat().flat());for(let l=0,u,c=0;l<this.result.length;l++)if(u=this.result[l]){for(let d=0,g;d<u.length;d++)if(g=u[d],!t.has(g)){if(r)r--;else if(i){if(o.push(g),o.length===n){t=o;break t}}else if(o[l]||(o[l]=[]),o[l].push(g),++c===n){t=o;break t}}}t=o}this.result=t,o=!0}return i&&(this.await=null),i?this.resolve(n,s,e,a,o):this}function ie(t,n,s,e,i){let r,a,o;typeof i=="string"?(r=i,i=""):r=i.template,a=r.indexOf("$1"),o=r.substring(a+2),a=r.substring(0,a);let l=i&&i.boundary,u=!i||i.clip!==!1,c=i&&i.merge&&o&&a&&new RegExp(o+" "+a,"g");i=i&&i.ellipsis;var d=0;if(typeof i=="object"){var g=i.template;d=g.length-2,i=i.pattern}typeof i!="string"&&(i=i===!1?"":"..."),d&&(i=g.replace("$1",i)),g=i.length-d;let h,v;typeof l=="object"&&(h=l.before,h===0&&(h=-1),v=l.after,v===0&&(v=-1),l=l.total||9e5),d=new Map;for(let M=0,I,Jt,dt;M<n.length;M++){let ht;if(e)ht=n,dt=e;else{var m=n[M];if(dt=m.field,!dt)continue;ht=m.result}Jt=s.get(dt),I=Jt.encoder,m=d.get(I),typeof m!="string"&&(m=I.encode(t),d.set(I,m));for(let yt=0;yt<ht.length;yt++){var f=ht[yt].doc;if(!f||(f=Nt(f,dt),!f))continue;var x=f.trim().split(/\s+/);if(!x.length)continue;f="";var y=[];let Rt=[];for(var V=-1,b=-1,j=0,A=0;A<x.length;A++){var O=x[A],w=I.encode(O);w=w.length>1?w.join(" "):w[0];let S;if(w&&O){for(var E=O.length,T=(I.split?O.replace(I.split,""):O).length-w.length,z="",N=0,J=0;J<m.length;J++){var D=m[J];if(D){var B=D.length;B+=T<0?0:T,N&&B<=N||(D=w.indexOf(D),D>-1&&(z=(D?O.substring(0,D):"")+a+O.substring(D,D+B)+o+(D+B<E?O.substring(D+B):""),N=B,S=!0))}}z&&(l&&(V<0&&(V=f.length+(f?1:0)),b=f.length+(f?1:0)+z.length,j+=E,Rt.push(y.length),y.push({match:z})),f+=(f?" ":"")+z)}if(!S)O=x[A],f+=(f?" ":"")+O,l&&y.push({text:O});else if(l&&j>=l)break}if(j=Rt.length*(r.length-2),h||v||l&&f.length-j>l)if(j=l+j-g*2,A=b-V,h>0&&(A+=h),v>0&&(A+=v),A<=j)x=h?V-(h>0?h:0):V-((j-A)/2|0),y=v?b+(v>0?v:0):x+j,u||(x>0&&f.charAt(x)!==" "&&f.charAt(x-1)!==" "&&(x=f.indexOf(" ",x),x<0&&(x=0)),y<f.length&&f.charAt(y-1)!==" "&&f.charAt(y)!==" "&&(y=f.lastIndexOf(" ",y),y<b?y=b:++y)),f=(x?i:"")+f.substring(x,y)+(y<f.length?i:"");else{for(b=[],V={},j={},A={},O={},w={},z=T=E=0,J=N=1;;){var $=void 0;for(let S=0,W;S<Rt.length;S++){if(W=Rt[S],z)if(T!==z){if(A[S+1])continue;if(W+=z,V[W]){E-=g,j[S+1]=1,A[S+1]=1;continue}if(W>=y.length-1){if(W>=y.length){A[S+1]=1,W>=x.length&&(j[S+1]=1);continue}E-=g}if(f=y[W].text,B=v&&w[S])if(B>0){if(f.length>B)if(A[S+1]=1,u)f=f.substring(0,B);else continue;(B-=f.length)||(B=-1),w[S]=B}else{A[S+1]=1;continue}if(E+f.length+1<=l)f=" "+f,b[S]+=f;else if(u)$=l-E-1,$>0&&(f=" "+f.substring(0,$),b[S]+=f),A[S+1]=1;else{A[S+1]=1;continue}}else{if(A[S])continue;if(W-=T,V[W]){E-=g,A[S]=1,j[S]=1;continue}if(W<=0){if(W<0){A[S]=1,j[S]=1;continue}E-=g}if(f=y[W].text,B=h&&O[S])if(B>0){if(f.length>B)if(A[S]=1,u)f=f.substring(f.length-B);else continue;(B-=f.length)||(B=-1),O[S]=B}else{A[S]=1;continue}if(E+f.length+1<=l)f+=" ",b[S]=f+b[S];else if(u)$=f.length+1-(l-E),$>=0&&$<f.length&&(f=f.substring($)+" ",b[S]=f+b[S]),A[S]=1;else{A[S]=1;continue}}else{f=y[W].match,h&&(O[S]=h),v&&(w[S]=v),S&&E++;let jt;if(W?!S&&g&&(E+=g):(j[S]=1,A[S]=1),W>=x.length-1||W<y.length-1&&y[W+1].match?jt=1:g&&(E+=g),E-=r.length-2,!S||E+f.length<=l)b[S]=f;else{$=N=J=j[S]=0;break}jt&&(j[S+1]=1,A[S+1]=1)}E+=f.length,$=V[W]=1}if($)T===z?z++:T++;else{if(T===z?N=0:J=0,!N&&!J)break;N?(T++,z=T):z++}}f="";for(let S=0,W;S<b.length;S++)W=(j[S]?S?" ":"":(S&&!i?" ":"")+i)+b[S],f+=W;i&&!j[b.length]&&(f+=i)}c&&(f=f.replace(c," ")),ht[yt].highlight=f}if(e)break}return n}function C(t,n){if(!this||this.constructor!==C)return new C(t,n);let s=0,e,i,r,a,o,l;if(t&&t.index){const u=t;if(n=u.index,s=u.boost||0,i=u.query){r=u.field||u.pluck,a=u.highlight;const c=u.resolve;t=u.async||u.queue,u.resolve=!1,u.index=null,t=t?n.searchAsync(u):n.search(u),u.resolve=c,u.index=n,t=t.result||t}else t=[]}if(t&&t.then){const u=this;t=t.then(function(c){u.C[0]=u.result=c.result||c,Oe(u)}),e=[t],t=[],o=new Promise(function(c){l=c})}this.index=n||null,this.result=t||[],this.h=s,this.C=e||[],this.await=o||null,this.return=l||null,this.highlight=a||null,this.query=i||"",this.field=r||""}F=C.prototype,F.limit=function(t){if(this.await){const n=this;this.C.push(function(){return n.limit(t).result})}else if(this.result.length){const n=[];for(let s=0,e;s<this.result.length;s++)if(e=this.result[s])if(e.length<=t){if(n[s]=e,t-=e.length,!t)break}else{n[s]=e.slice(0,t);break}this.result=n}return this},F.offset=function(t){if(this.await){const n=this;this.C.push(function(){return n.offset(t).result})}else if(this.result.length){const n=[];for(let s=0,e;s<this.result.length;s++)(e=this.result[s])&&(e.length<=t?t-=e.length:(n[s]=e.slice(t),t=0));this.result=n}return this},F.boost=function(t){if(this.await){const n=this;this.C.push(function(){return n.boost(t).result})}else this.h+=t;return this};function Oe(t,n){let s=t.result;var e=t.await;t.await=null;for(let i=0,r;i<t.C.length;i++)if(r=t.C[i]){if(typeof r=="function")s=r(),t.C[i]=s=s.result||s,i--;else if(r.h)s=r.h(),t.C[i]=s=s.result||s,i--;else if(r.then)return t.await=e}return e=t.return,t.C=[],t.return=null,n||e(s),s}F.resolve=function(t,n,s,e,i){let r=this.await?Oe(this,!0):this.result;if(r.then){const a=this;return r.then(function(){return a.resolve(t,n,s,e,i)})}return r.length&&(typeof t=="object"?(e=t.highlight||this.highlight,s=!!e||t.enrich,n=t.offset,t=t.limit):(e=e||this.highlight,s=!!e||s),r=i?s?zt.call(this.index,r):r:Se.call(this.index,r,t||100,n,s)),this.finalize(r,e)},F.finalize=function(t,n){if(t.then){const e=this;return t.then(function(i){return e.finalize(i,n)})}n&&t.length&&this.query&&(t=ie(this.query,t,this.index.index,this.field,n));const s=this.return;return this.highlight=this.index=this.result=this.C=this.await=this.return=null,this.query=this.field="",s&&s(t),t};function ne(t,n,s,e,i,r,a){const o=t.length;let l=[],u,c;u=L();for(let d=0,g,h,v,m;d<n;d++)for(let f=0;f<o;f++)if(v=t[f],d<v.length&&(g=v[d]))for(let x=0;x<g.length;x++){if(h=g[x],(c=u[h])?u[h]++:(c=0,u[h]=1),m=l[c]||(l[c]=[]),!a){let y=d+(f||!i?0:r||0);m=m[y]||(m[y]=[])}if(m.push(h),a&&s&&c===o-1&&m.length-e===s)return e?m.slice(e):m}if(t=l.length)if(i)l=l.length>1?bi(l,s,e,a,r):(l=l[0])&&s&&l.length>s||e?l.slice(e,s+e):l;else{if(t<o)return[];if(l=l[t-1],s||e)if(a)(l.length>s||e)&&(l=l.slice(e,s+e));else{i=[];for(let d=0,g;d<l.length;d++)if(g=l[d]){if(e&&g.length>e)e-=g.length;else if((s&&g.length>s||e)&&(g=g.slice(e,s+e),s-=g.length,e&&(e-=g.length)),i.push(g),!s)break}l=i}}return l}function bi(t,n,s,e,i){const r=[],a=L();let o;var l=t.length;let u;if(e){for(i=l-1;i>=0;i--)if(u=(e=t[i])&&e.length){for(l=0;l<u;l++)if(o=e[l],!a[o]){if(a[o]=1,s)s--;else if(r.push(o),r.length===n)return r}}}else for(let c=l-1,d,g=0;c>=0;c--){d=t[c];for(let h=0;h<d.length;h++)if(u=(e=d[h])&&e.length){for(let v=0;v<u;v++)if(o=e[v],!a[o])if(a[o]=1,s)s--;else{let m=(h+(c<l-1&&i||0))/(c+1)|0;if((r[m]||(r[m]=[])).push(o),++g===n)return r}}}return r}function ls(t,n,s,e,i){const r=L(),a=[];for(let o=0,l;o<n.length;o++){l=n[o];for(let u=0;u<l.length;u++)r[l[u]]=1}if(i){for(let o=0,l;o<t.length;o++)if(l=t[o],r[l]){if(e)e--;else if(a.push(l),r[l]=0,s&&--s===0)break}}else for(let o=0,l,u;o<t.result.length;o++)for(l=t.result[o],n=0;n<l.length;n++)u=l[n],r[u]&&((a[o]||(a[o]=[])).push(u),r[u]=0);return a}It.prototype.search=function(t,n,s,e){s||(!n&&Ct(t)?(s=t,t=""):Ct(n)&&(s=n,n=0));let i=[];var r=[];let a,o,l,u,c,d,g=0,h=!0,v;if(s){s.constructor===Array&&(s={index:s}),t=s.query||t,a=s.pluck,o=s.merge,u=s.boost,d=a||s.field||(d=s.index)&&(d.index?null:d);var m=this.tag&&s.tag;l=s.suggest,h=s.resolve!==!1,c=s.cache,v=h&&this.store&&s.highlight;var f=!!v||h&&this.store&&s.enrich;n=s.limit||n;var x=s.offset||0;if(n||(n=h?100:0),m&&(!this.db||!e)){m.constructor!==Array&&(m=[m]);var y=[];for(let O=0,w;O<m.length;O++)if(w=m[O],w.field&&w.tag){var V=w.tag;if(V.constructor===Array)for(var b=0;b<V.length;b++)y.push(w.field,V[b]);else y.push(w.field,V)}else{V=Object.keys(w);for(let E=0,T,z;E<V.length;E++)if(T=V[E],z=w[T],z.constructor===Array)for(b=0;b<z.length;b++)y.push(T,z[b]);else y.push(T,z)}if(m=y,!t){if(r=[],y.length)for(m=0;m<y.length;m+=2){if(this.db){if(e=this.index.get(y[m]),!e)continue;r.push(e=e.db.tag(y[m+1],n,x,f))}else e=us.call(this,y[m],y[m+1],n,x,f);i.push(h?{field:y[m],tag:y[m+1],result:e}:[e])}if(r.length){const O=this;return Promise.all(r).then(function(w){for(let E=0;E<w.length;E++)h?i[E].result=w[E]:i[E]=w[E];return h?i:new C(i.length>1?ne(i,1,0,0,l,u):i[0],O)})}return h?i:new C(i.length>1?ne(i,1,0,0,l,u):i[0],this)}}h||a||!(d=d||this.field)||(it(d)?a=d:(d.constructor===Array&&d.length===1&&(d=d[0]),a=d.field||d.index)),d&&d.constructor!==Array&&(d=[d])}d||(d=this.field);let j;y=(this.worker||this.db)&&!e&&[];for(let O=0,w,E,T;O<d.length;O++){if(E=d[O],this.db&&this.tag&&!this.B[O])continue;let z;if(it(E)||(z=E,E=z.field,t=z.query||t,n=St(z.limit,n),x=St(z.offset,x),l=St(z.suggest,l),v=h&&this.store&&St(z.highlight,v),f=!!v||h&&this.store&&St(z.enrich,f),c=St(z.cache,c)),e)w=e[O];else{V=z||s||{},b=V.enrich;var A=this.index.get(E);if(m&&(this.db&&(V.tag=m,V.field=d,j=A.db.support_tag_search),!j&&b&&(V.enrich=!1),j||(V.limit=0,V.offset=0)),w=c?A.searchCache(t,m&&!j?0:n,V):A.search(t,m&&!j?0:n,V),m&&!j&&(V.limit=n,V.offset=x),b&&(V.enrich=b),y){y[O]=w;continue}}if(T=(w=w.result||w)&&w.length,m&&T){if(V=[],b=0,this.db&&e){if(!j)for(A=d.length;A<e.length;A++){let N=e[A];if(N&&N.length)b++,V.push(N);else if(!l)return h?i:new C(i,this)}}else for(let N=0,J,D;N<m.length;N+=2){if(J=this.tag.get(m[N]),!J){if(l)continue;return h?i:new C(i,this)}if(D=(J=J&&J.get(m[N+1]))&&J.length)b++,V.push(J);else if(!l)return h?i:new C(i,this)}if(b){if(w=ls(w,V,n,x,h),T=w.length,!T&&!l)return h?w:new C(w,this);b--}}if(T)r[g]=E,i.push(w),g++;else if(d.length===1)return h?i:new C(i,this)}if(y){if(this.db&&m&&m.length&&!j)for(f=0;f<m.length;f+=2){if(r=this.index.get(m[f]),!r){if(l)continue;return h?i:new C(i,this)}y.push(r.db.tag(m[f+1],n,x,!1))}const O=this;return Promise.all(y).then(function(w){return s&&(s.resolve=h),w.length&&(w=O.search(t,n,s,w)),w})}if(!g)return h?i:new C(i,this);if(a&&(!f||!this.store))return i=i[0],h?i:new C(i,this);for(y=[],x=0;x<r.length;x++){if(m=i[x],f&&m.length&&typeof m[0].doc>"u"&&(this.db?y.push(m=this.index.get(this.field[0]).db.enrich(m)):m=zt.call(this,m)),a)return h?v?ie(t,m,this.index,a,v):m:new C(m,this);i[x]={field:r[x],result:m}}if(f&&this.db&&y.length){const O=this;return Promise.all(y).then(function(w){for(let E=0;E<w.length;E++)i[E].result=w[E];return v&&(i=ie(t,i,O.index,a,v)),o?wi(i):i})}return v&&(i=ie(t,i,this.index,a,v)),o?wi(i):i};function wi(t){const n=[],s=L(),e=L();for(let i=0,r,a,o,l,u,c,d;i<t.length;i++){r=t[i],a=r.field,o=r.result;for(let g=0;g<o.length;g++)u=o[g],typeof u!="object"?u={id:l=u}:l=u.id,(c=s[l])?c.push(a):(u.field=s[l]=[a],n.push(u)),(d=u.highlight)&&(c=e[l],c||(e[l]=c={},u.highlight=c),c[a]=d)}return n}function us(t,n,s,e,i){return t=this.tag.get(t),t?(t=t.get(n),t?(n=t.length-e,n>0&&((s&&n>s||e)&&(t=t.slice(e,e+s)),i&&(t=zt.call(this,t))),t):[]):[]}function zt(t){if(!this||!this.store)return t;if(this.db)return this.index.get(this.field[0]).db.enrich(t);const n=Array(t.length);for(let s=0,e;s<t.length;s++)e=t[s],n[s]={id:e,doc:this.store.get(e)};return n}function It(t){if(!this||this.constructor!==It)return new It(t);const n=t.document||t.doc||t;let s,e;if(this.B=[],this.field=[],this.D=[],this.key=(s=n.key||n.id)&&se(s,this.D)||"id",(e=t.keystore||0)&&(this.keystore=e),this.fastupdate=!!t.fastupdate,this.reg=!this.fastupdate||t.worker||t.db?e?new st(e):new Set:e?new nt(e):new Map,this.h=(s=n.store||null)&&s&&s!==!0&&[],this.store=s?e?new nt(e):new Map:null,this.cache=(s=t.cache||null)&&new kt(s),t.cache=!1,this.worker=t.worker||!1,this.priority=t.priority||4,this.index=cs.call(this,t,n),this.tag=null,(s=n.tag)&&(typeof s=="string"&&(s=[s]),s.length)){this.tag=new Map,this.A=[],this.F=[];for(let i=0,r,a;i<s.length;i++){if(r=s[i],a=r.field||r,!a)throw Error("The tag field from the document descriptor is undefined.");r.custom?this.A[i]=r.custom:(this.A[i]=se(a,this.D),r.filter&&(typeof this.A[i]=="string"&&(this.A[i]=new String(this.A[i])),this.A[i].G=r.filter)),this.F[i]=a,this.tag.set(a,new Map)}}if(this.worker){this.fastupdate=!1,t=[];for(const i of this.index.values())i.then&&t.push(i);if(t.length){const i=this;return Promise.all(t).then(function(r){let a=0;for(const o of i.index.entries()){const l=o[0];let u=o[1];u.then&&(u=r[a],i.index.set(l,u),a++)}return i})}}else t.db&&(this.fastupdate=!1,this.mount(t.db))}F=It.prototype,F.mount=function(t){let n=this.field;if(this.tag)for(let r=0,a;r<this.F.length;r++){a=this.F[r];var s=void 0;this.index.set(a,s=new rt({},this.reg)),n===this.field&&(n=n.slice(0)),n.push(a),s.tag=this.tag.get(a)}s=[];const e={db:t.db,type:t.type,fastupdate:t.fastupdate};for(let r=0,a,o;r<n.length;r++){e.field=o=n[r],a=this.index.get(o);const l=new t.constructor(t.id,e);l.id=t.id,s[r]=l.mount(a),a.document=!0,r?a.bypass=!0:a.store=this.store}const i=this;return this.db=Promise.all(s).then(function(){i.db=!0})},F.commit=async function(){const t=[];for(const n of this.index.values())t.push(n.commit());await Promise.all(t),this.reg.clear()},F.destroy=function(){const t=[];for(const n of this.index.values())t.push(n.destroy());return Promise.all(t)};function cs(t,n){const s=new Map;let e=n.index||n.field||n;it(e)&&(e=[e]);for(let r=0,a,o;r<e.length;r++){if(a=e[r],it(a)||(o=a,a=a.field),o=Ct(o)?Object.assign({},t,o):t,this.worker){var i=void 0;i=(i=o.encoder)&&i.encode?i:new Bt(typeof i=="string"?mi[i]:i||{}),i=new Mt(o,i),s.set(a,i)}this.worker||s.set(a,new rt(o,this.reg)),o.custom?this.B[r]=o.custom:(this.B[r]=se(a,this.D),o.filter&&(typeof this.B[r]=="string"&&(this.B[r]=new String(this.B[r])),this.B[r].G=o.filter)),this.field[r]=a}if(this.h){t=n.store,it(t)&&(t=[t]);for(let r=0,a,o;r<t.length;r++)a=t[r],o=a.field||a,a.custom?(this.h[r]=a.custom,a.custom.O=o):(this.h[r]=se(o,this.D),a.filter&&(typeof this.h[r]=="string"&&(this.h[r]=new String(this.h[r])),this.h[r].G=a.filter))}return s}function se(t,n){const s=t.split(":");let e=0;for(let i=0;i<s.length;i++)t=s[i],t[t.length-1]==="]"&&(t=t.substring(0,t.length-2))&&(n[e]=!0),t&&(s[e++]=t);return e<s.length&&(s.length=e),e>1?s:s[0]}F.append=function(t,n){return this.add(t,n,!0)},F.update=function(t,n){return this.remove(t).add(t,n)},F.remove=function(t){Ct(t)&&(t=Nt(t,this.key));for(var n of this.index.values())n.remove(t,!0);if(this.reg.has(t)){if(this.tag&&!this.fastupdate)for(let s of this.tag.values())for(let e of s){n=e[0];const i=e[1],r=i.indexOf(t);r>-1&&(i.length>1?i.splice(r,1):s.delete(n))}this.store&&this.store.delete(t),this.reg.delete(t)}return this.cache&&this.cache.remove(t),this},F.clear=function(){const t=[];for(const n of this.index.values()){const s=n.clear();s.then&&t.push(s)}if(this.tag)for(const n of this.tag.values())n.clear();return this.store&&this.store.clear(),this.cache&&this.cache.clear(),t.length?Promise.all(t):this},F.contain=function(t){return this.db?this.index.get(this.field[0]).db.has(t):this.reg.has(t)},F.cleanup=function(){for(const t of this.index.values())t.cleanup();return this},F.get=function(t){return this.db?this.index.get(this.field[0]).db.enrich(t).then(function(n){return n[0]&&n[0].doc||null}):this.store.get(t)||null},F.set=function(t,n){return typeof t=="object"&&(n=t,t=Nt(n,this.key)),this.store.set(t,n),this},F.searchCache=ke,F.export=ds,F.import=hs,Re(It.prototype);function Ae(t,n=0){let s=[],e=[];n&&(n=25e4/n*5e3|0);for(const i of t.entries())e.push(i),e.length===n&&(s.push(e),e=[]);return e.length&&s.push(e),s}function He(t,n){n||(n=new Map);for(let s=0,e;s<t.length;s++)e=t[s],n.set(e[0],e[1]);return n}function ki(t,n=0){let s=[],e=[];n&&(n=25e4/n*1e3|0);for(const i of t.entries())e.push([i[0],Ae(i[1])[0]||[]]),e.length===n&&(s.push(e),e=[]);return e.length&&s.push(e),s}function Vi(t,n){n||(n=new Map);for(let s=0,e,i;s<t.length;s++)e=t[s],i=n.get(e[0]),n.set(e[0],He(e[1],i));return n}function Ri(t){let n=[],s=[];for(const e of t.keys())s.push(e),s.length===25e4&&(n.push(s),s=[]);return s.length&&n.push(s),n}function ji(t,n){n||(n=new Set);for(let s=0;s<t.length;s++)n.add(t[s]);return n}function re(t,n,s,e,i,r,a=0){const o=e&&e.constructor===Array;var l=o?e.shift():e;if(!l)return this.export(t,n,i,r+1);if((l=t((n?n+".":"")+(a+1)+"."+s,JSON.stringify(l)))&&l.then){const u=this;return l.then(function(){return re.call(u,t,n,s,o?e:null,i,r,a+1)})}return re.call(this,t,n,s,o?e:null,i,r,a+1)}function ds(t,n,s=0,e=0){if(s<this.field.length){const a=this.field[s];if((n=this.index.get(a).export(t,a,s,e=1))&&n.then){const o=this;return n.then(function(){return o.export(t,a,s+1)})}return this.export(t,a,s+1)}let i,r;switch(e){case 0:i="reg",r=Ri(this.reg),n=null;break;case 1:i="tag",r=this.tag&&ki(this.tag,this.reg.size),n=null;break;case 2:i="doc",r=this.store&&Ae(this.store),n=null;break;default:return}return re.call(this,t,n,i,r||null,s,e)}function hs(t,n){var s=t.split(".");s[s.length-1]==="json"&&s.pop();const e=s.length>2?s[0]:"";if(s=s.length>2?s[2]:s[1],this.worker&&e)return this.index.get(e).import(t);if(n){if(typeof n=="string"&&(n=JSON.parse(n)),e)return this.index.get(e).import(s,n);switch(s){case"reg":this.fastupdate=!1,this.reg=ji(n,this.reg);for(let i=0,r;i<this.field.length;i++)r=this.index.get(this.field[i]),r.fastupdate=!1,r.reg=this.reg;if(this.worker){n=[];for(const i of this.index.values())n.push(i.import(t));return Promise.all(n)}break;case"tag":this.tag=Vi(n,this.tag);break;case"doc":this.store=He(n,this.store)}}}function Fi(t,n){let s="";for(const e of t.entries()){t=e[0];const i=e[1];let r="";for(let a=0,o;a<i.length;a++){o=i[a]||[""];let l="";for(let u=0;u<o.length;u++)l+=(l?",":"")+(n==="string"?'"'+o[u]+'"':o[u]);l="["+l+"]",r+=(r?",":"")+l}r='["'+t+'",['+r+"]]",s+=(s?",":"")+r}return s}rt.prototype.remove=function(t,n){const s=this.reg.size&&(this.fastupdate?this.reg.get(t):this.reg.has(t));if(s){if(this.fastupdate){for(let e=0,i,r;e<s.length;e++)if((i=s[e])&&(r=i.length))if(i[r-1]===t)i.pop();else{const a=i.indexOf(t);a>=0&&i.splice(a,1)}}else Lt(this.map,t),this.depth&&Lt(this.ctx,t);n||this.reg.delete(t)}return this.db&&(this.commit_task.push({del:t}),this.M&&Ai(this)),this.cache&&this.cache.remove(t),this};function Lt(t,n){let s=0;var e=typeof n>"u";if(t.constructor===Array){for(let i=0,r,a,o;i<t.length;i++)if((r=t[i])&&r.length){if(e)return 1;if(a=r.indexOf(n),a>=0){if(r.length>1)return r.splice(a,1),1;if(delete t[i],s)return 1;o=1}else{if(o)return 1;s++}}}else for(let i of t.entries())e=i[0],Lt(i[1],n)?s++:t.delete(e);return s}const ps={memory:{resolution:1},performance:{resolution:3,fastupdate:!0,context:{depth:1,resolution:1}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:3}}};rt.prototype.add=function(t,n,s,e){if(n&&(t||t===0)){if(!e&&!s&&this.reg.has(t))return this.update(t,n);e=this.depth,n=this.encoder.encode(n,!e);const u=n.length;if(u){const c=L(),d=L(),g=this.resolution;for(let h=0;h<u;h++){let v=n[this.rtl?u-1-h:h];var i=v.length;if(i&&(e||!d[v])){var r=this.score?this.score(n,v,h,null,0):ae(g,u,h),a="";switch(this.tokenize){case"tolerant":if(ct(this,d,v,r,t,s),i>2){for(let m=1,f,x,y,V;m<i-1;m++)f=v.charAt(m),x=v.charAt(m+1),y=v.substring(0,m)+x,V=v.substring(m+2),a=y+f+V,ct(this,d,a,r,t,s),a=y+V,ct(this,d,a,r,t,s);ct(this,d,v.substring(0,v.length-1),r,t,s)}break;case"full":if(i>2){for(let m=0,f;m<i;m++)for(r=i;r>m;r--){a=v.substring(m,r),f=this.rtl?i-1-m:m;var o=this.score?this.score(n,v,h,a,f):ae(g,u,h,i,f);ct(this,d,a,o,t,s)}break}case"bidirectional":case"reverse":if(i>1){for(o=i-1;o>0;o--){a=v[this.rtl?i-1-o:o]+a;var l=this.score?this.score(n,v,h,a,o):ae(g,u,h,i,o);ct(this,d,a,l,t,s)}a=""}case"forward":if(i>1){for(o=0;o<i;o++)a+=v[this.rtl?i-1-o:o],ct(this,d,a,r,t,s);break}default:if(ct(this,d,v,r,t,s),e&&u>1&&h<u-1)for(i=this.N,a=v,r=Math.min(e+1,this.rtl?h+1:u-h),o=1;o<r;o++){v=n[this.rtl?u-1-h-o:h+o],l=this.bidirectional&&v>a;const m=this.score?this.score(n,a,h,v,o-1):ae(i+(u/2>i?0:1),u,h,r-1,o-1);ct(this,c,l?a:v,m,t,s,l?v:a)}}}}this.fastupdate||this.reg.add(t)}}return this.db&&(this.commit_task.push(s?{ins:t}:{del:t}),this.M&&Ai(this)),this};function ct(t,n,s,e,i,r,a){let o,l;if(!(o=n[s])||a&&!o[a]){if(a?(n=o||(n[s]=L()),n[a]=1,l=t.ctx,(o=l.get(a))?l=o:l.set(a,l=t.keystore?new nt(t.keystore):new Map)):(l=t.map,n[s]=1),(o=l.get(s))?l=o:l.set(s,l=o=[]),r){for(let u=0,c;u<o.length;u++)if((c=o[u])&&c.includes(i)){if(u<=e)return;c.splice(c.indexOf(i),1),t.fastupdate&&(n=t.reg.get(i))&&n.splice(n.indexOf(c),1);break}}if(l=l[e]||(l[e]=[]),l.push(i),l.length===2**31-1){if(n=new Ot(l),t.fastupdate)for(let u of t.reg.values())u.includes(l)&&(u[u.indexOf(l)]=n);o[e]=l=n}t.fastupdate&&((e=t.reg.get(i))?e.push(l):t.reg.set(i,[l]))}}function ae(t,n,s,e,i){return s&&t>1?n+(e||0)<=t?s+(i||0):(t-1)/(n+(e||0))*(s+(i||0))+1|0:0}rt.prototype.search=function(t,n,s){if(s||(n||typeof t!="object"?typeof n=="object"&&(s=n,n=0):(s=t,t="")),s&&s.cache)return s.cache=!1,t=this.searchCache(t,n,s),s.cache=!0,t;let e=[],i,r,a,o=0,l,u,c,d,g;s&&(t=s.query||t,n=s.limit||n,o=s.offset||0,r=s.context,a=s.suggest,g=(l=s.resolve)&&s.enrich,c=s.boost,d=s.resolution,u=this.db&&s.tag),typeof l>"u"&&(l=this.resolve),r=this.depth&&r!==!1;let h=this.encoder.encode(t,!r);if(i=h.length,n=n||(l?100:0),i===1)return Si.call(this,h[0],"",n,o,l,g,u);if(i===2&&r&&!a)return Si.call(this,h[1],h[0],n,o,l,g,u);let v=L(),m=0,f;if(r&&(f=h[0],m=1),d||d===0||(d=f?this.N:this.resolution),this.db){if(this.db.search&&(s=this.db.search(this,h,n,o,a,l,g,u),s!==!1))return s;const x=this;return(async function(){for(let y,V;m<i;m++){if((V=h[m])&&!v[V]){if(v[V]=1,y=await Me(x,V,f,0,0,!1,!1),y=Oi(y,e,a,d)){e=y;break}f&&(a&&y&&e.length||(f=V))}a&&f&&m===i-1&&!e.length&&(d=x.resolution,f="",m=-1,v=L())}return Ei(e,d,n,o,a,c,l)})()}for(let x,y;m<i;m++){if((y=h[m])&&!v[y]){if(v[y]=1,x=Me(this,y,f,0,0,!1,!1),x=Oi(x,e,a,d)){e=x;break}f&&(a&&x&&e.length||(f=y))}a&&f&&m===i-1&&!e.length&&(d=this.resolution,f="",m=-1,v=L())}return Ei(e,d,n,o,a,c,l)};function Ei(t,n,s,e,i,r,a){let o=t.length,l=t;if(o>1)l=ne(t,n,s,e,i,r,a);else if(o===1)return a?Se.call(null,t[0],s,e):new C(t[0],this);return a?l:new C(l,this)}function Si(t,n,s,e,i,r,a){return t=Me(this,t,n,s,e,i,r,a),this.db?t.then(function(o){return i?o||[]:new C(o,this)}):t&&t.length?i?Se.call(this,t,s,e):new C(t,this):i?[]:new C([],this)}function Oi(t,n,s,e){let i=[];if(t&&t.length){if(t.length<=e){n.push(t);return}for(let r=0,a;r<e;r++)(a=t[r])&&(i[r]=a);if(i.length){n.push(i);return}}if(!s)return i}function Me(t,n,s,e,i,r,a,o){let l;return s&&(l=t.bidirectional&&n>s)&&(l=s,s=n,n=l),t.db?t.db.get(n,s,e,i,r,a,o):(t=s?(t=t.ctx.get(s))&&t.get(n):t.map.get(n),t)}function rt(t,n){if(!this||this.constructor!==rt)return new rt(t);if(t){var s=it(t)?t:t.preset;s&&(t=Object.assign({},ps[s],t))}else t={};s=t.context;const e=s===!0?{depth:1}:s||{},i=it(t.encoder)?mi[t.encoder]:t.encode||t.encoder||{};this.encoder=i.encode?i:typeof i=="object"?new Bt(i):{encode:i},this.resolution=t.resolution||9,this.tokenize=s=(s=t.tokenize)&&s!=="default"&&s!=="exact"&&s||"strict",this.depth=s==="strict"&&e.depth||0,this.bidirectional=e.bidirectional!==!1,this.fastupdate=!!t.fastupdate,this.score=t.score||null,(s=t.keystore||0)&&(this.keystore=s),this.map=s?new nt(s):new Map,this.ctx=s?new nt(s):new Map,this.reg=n||(this.fastupdate?s?new nt(s):new Map:s?new st(s):new Set),this.N=e.resolution||3,this.rtl=i.rtl||t.rtl||!1,this.cache=(s=t.cache||null)&&new kt(s),this.resolve=t.resolve!==!1,(s=t.db)&&(this.db=this.mount(s)),this.M=t.commit!==!1,this.commit_task=[],this.commit_timer=null,this.priority=t.priority||4}F=rt.prototype,F.mount=function(t){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),t.mount(this)},F.commit=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.commit(this)},F.destroy=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.destroy()};function Ai(t){t.commit_timer||(t.commit_timer=setTimeout(function(){t.commit_timer=null,t.db.commit(t)},1))}F.clear=function(){return this.map.clear(),this.ctx.clear(),this.reg.clear(),this.cache&&this.cache.clear(),this.db?(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[],this.db.clear()):this},F.append=function(t,n){return this.add(t,n,!0)},F.contain=function(t){return this.db?this.db.has(t):this.reg.has(t)},F.update=function(t,n){const s=this,e=this.remove(t);return e&&e.then?e.then(()=>s.add(t,n)):this.add(t,n)},F.cleanup=function(){return this.fastupdate?(Lt(this.map),this.depth&&Lt(this.ctx),this):this},F.searchCache=ke,F.export=function(t,n,s=0,e=0){let i,r;switch(e){case 0:i="reg",r=Ri(this.reg);break;case 1:i="cfg",r=null;break;case 2:i="map",r=Ae(this.map,this.reg.size);break;case 3:i="ctx",r=ki(this.ctx,this.reg.size);break;default:return}return re.call(this,t,n,i,r,s,e)},F.import=function(t,n){if(n)switch(typeof n=="string"&&(n=JSON.parse(n)),t=t.split("."),t[t.length-1]==="json"&&t.pop(),t.length===3&&t.shift(),t=t.length>1?t[1]:t[0],t){case"reg":this.fastupdate=!1,this.reg=ji(n,this.reg);break;case"map":this.map=He(n,this.map);break;case"ctx":this.ctx=Vi(n,this.ctx)}},F.serialize=function(t=!0){let n="",s="",e="";if(this.reg.size){let r;for(var i of this.reg.keys())r||(r=typeof i),n+=(n?",":"")+(r==="string"?'"'+i+'"':i);n="index.reg=new Set(["+n+"]);",s=Fi(this.map,r),s="index.map=new Map(["+s+"]);";for(const a of this.ctx.entries()){i=a[0];let o=Fi(a[1],r);o="new Map(["+o+"])",o='["'+i+'",'+o+"]",e+=(e?",":"")+o}e="index.ctx=new Map(["+e+"]);"}return t?"function inject(index){"+n+s+e+"}":n+s+e},Re(rt.prototype);const Hi=typeof window<"u"&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),oe=["map","ctx","tag","reg","cfg"],Vt=L();function ze(t,n={}){if(!this||this.constructor!==ze)return new ze(t,n);typeof t=="object"&&(n=t,t=t.name),t||console.info("Default storage space was used, because a name was not passed."),this.id="flexsearch"+(t?":"+t.toLowerCase().replace(/[^a-z0-9_\-]/g,""):""),this.field=n.field?n.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"",this.type=n.type,this.fastupdate=this.support_tag_search=!1,this.db=null,this.h={}}F=ze.prototype,F.mount=function(t){return t.index?t.mount(this):(t.db=this,this.open())},F.open=function(){if(this.db)return this.db;let t=this;navigator.storage&&navigator.storage.persist&&navigator.storage.persist(),Vt[t.id]||(Vt[t.id]=[]),Vt[t.id].push(t.field);const n=Hi.open(t.id,1);return n.onupgradeneeded=function(){const s=t.db=this.result;for(let e=0,i;e<oe.length;e++){i=oe[e];for(let r=0,a;r<Vt[t.id].length;r++)a=Vt[t.id][r],s.objectStoreNames.contains(i+(i!=="reg"&&a?":"+a:""))||s.createObjectStore(i+(i!=="reg"&&a?":"+a:""))}},t.db=vt(n,function(s){t.db=s,t.db.onversionchange=function(){t.close()}})},F.close=function(){this.db&&this.db.close(),this.db=null},F.destroy=function(){const t=Hi.deleteDatabase(this.id);return vt(t)},F.clear=function(){const t=[];for(let s=0,e;s<oe.length;s++){e=oe[s];for(let i=0,r;i<Vt[this.id].length;i++)r=Vt[this.id][i],t.push(e+(e!=="reg"&&r?":"+r:""))}const n=this.db.transaction(t,"readwrite");for(let s=0;s<t.length;s++)n.objectStore(t[s]).clear();return vt(n)},F.get=function(t,n,s=0,e=0,i=!0,r=!1){t=this.db.transaction((n?"ctx":"map")+(this.field?":"+this.field:""),"readonly").objectStore((n?"ctx":"map")+(this.field?":"+this.field:"")).get(n?n+":"+t:t);const a=this;return vt(t).then(function(o){let l=[];if(!o||!o.length)return l;if(i){if(!s&&!e&&o.length===1)return o[0];for(let u=0,c;u<o.length;u++)if((c=o[u])&&c.length){if(e>=c.length){e-=c.length;continue}const d=s?e+Math.min(c.length-e,s):c.length;for(let g=e;g<d;g++)l.push(c[g]);if(e=0,l.length===s)break}return r?a.enrich(l):l}return o})},F.tag=function(t,n=0,s=0,e=!1){t=this.db.transaction("tag"+(this.field?":"+this.field:""),"readonly").objectStore("tag"+(this.field?":"+this.field:"")).get(t);const i=this;return vt(t).then(function(r){return!r||!r.length||s>=r.length?[]:!n&&!s?r:(r=r.slice(s,s+n),e?i.enrich(r):r)})},F.enrich=function(t){typeof t!="object"&&(t=[t]);const n=this.db.transaction("reg","readonly").objectStore("reg"),s=[];for(let e=0;e<t.length;e++)s[e]=vt(n.get(t[e]));return Promise.all(s).then(function(e){for(let i=0;i<e.length;i++)e[i]={id:t[i],doc:e[i]?JSON.parse(e[i]):null};return e})},F.has=function(t){return t=this.db.transaction("reg","readonly").objectStore("reg").getKey(t),vt(t).then(function(n){return!!n})},F.search=null,F.info=function(){},F.transaction=function(t,n,s){t+=t!=="reg"&&this.field?":"+this.field:"";let e=this.h[t+":"+n];if(e)return s.call(this,e);let i=this.db.transaction(t,n);this.h[t+":"+n]=e=i.objectStore(t);const r=s.call(this,e);return this.h[t+":"+n]=null,vt(i).finally(function(){return r})},F.commit=async function(t){let n=t.commit_task,s=[];t.commit_task=[];for(let e=0,i;e<n.length;e++)i=n[e],i.del&&s.push(i.del);s.length&&await this.remove(s),t.reg.size&&(await this.transaction("map","readwrite",function(e){for(const i of t.map){const r=i[0],a=i[1];a.length&&(e.get(r).onsuccess=function(){let o=this.result;var l;if(o&&o.length){const u=Math.max(o.length,a.length);for(let c=0,d,g;c<u;c++)if((g=a[c])&&g.length){if((d=o[c])&&d.length)for(l=0;l<g.length;l++)d.push(g[l]);else o[c]=g;l=1}}else o=a,l=1;l&&e.put(o,r)})}}),await this.transaction("ctx","readwrite",function(e){for(const i of t.ctx){const r=i[0],a=i[1];for(const o of a){const l=o[0],u=o[1];u.length&&(e.get(r+":"+l).onsuccess=function(){let c=this.result;var d;if(c&&c.length){const g=Math.max(c.length,u.length);for(let h=0,v,m;h<g;h++)if((m=u[h])&&m.length){if((v=c[h])&&v.length)for(d=0;d<m.length;d++)v.push(m[d]);else c[h]=m;d=1}}else c=u,d=1;d&&e.put(c,r+":"+l)})}}}),t.store?await this.transaction("reg","readwrite",function(e){for(const i of t.store){const r=i[0],a=i[1];e.put(typeof a=="object"?JSON.stringify(a):1,r)}}):t.bypass||await this.transaction("reg","readwrite",function(e){for(const i of t.reg.keys())e.put(1,i)}),t.tag&&await this.transaction("tag","readwrite",function(e){for(const i of t.tag){const r=i[0],a=i[1];a.length&&(e.get(r).onsuccess=function(){let o=this.result;o=o&&o.length?o.concat(a):a,e.put(o,r)})}}),t.map.clear(),t.ctx.clear(),t.tag&&t.tag.clear(),t.store&&t.store.clear(),t.document||t.reg.clear())};function Ie(t,n,s){const e=t.value;let i,r=0;for(let a=0,o;a<e.length;a++){if(o=s?e:e[a]){for(let l=0,u,c;l<n.length;l++)if(c=n[l],u=o.indexOf(c),u>=0)if(i=1,o.length>1)o.splice(u,1);else{e[a]=[];break}r+=o.length}if(s)break}r?i&&t.update(e):t.delete(),t.continue()}F.remove=function(t){return typeof t!="object"&&(t=[t]),Promise.all([this.transaction("map","readwrite",function(n){n.openCursor().onsuccess=function(){const s=this.result;s&&Ie(s,t)}}),this.transaction("ctx","readwrite",function(n){n.openCursor().onsuccess=function(){const s=this.result;s&&Ie(s,t)}}),this.transaction("tag","readwrite",function(n){n.openCursor().onsuccess=function(){const s=this.result;s&&Ie(s,t,!0)}}),this.transaction("reg","readwrite",function(n){for(let s=0;s<t.length;s++)n.delete(t[s])})])};function vt(t,n){return new Promise((s,e)=>{t.onsuccess=t.oncomplete=function(){n&&n(this.result),n=null,s(this.result)},t.onerror=t.onblocked=e,t=null})}var fs={Index:rt};function le(t,n,s,e){if(!n?.type)throw new Error("Schema not found for "+s);if(t===null)return;if(n.type==="string"){typeof t=="string"&&e({source:t,schema:n,path:s});return}if(n.type==="number"){typeof t=="number"&&e({source:t,schema:n,path:s});return}if(n.type==="boolean"){typeof t=="boolean"&&e({source:t,schema:n,path:s});return}if(n.type==="richtext"){e({source:t,schema:n,path:s});return}if(n.type==="file"||n.type==="image"){t&&typeof t=="object"&&P in t&&typeof t[P]=="string"&&e({source:t,schema:n,path:s});return}if(n.type==="date"){typeof t=="string"&&e({source:t,schema:n,path:s});return}if(n.type==="dateTime"){typeof t=="string"&&e({source:t,schema:n,path:s});return}if(n.type==="keyOf"){(typeof t=="string"||typeof t=="number")&&e({source:t,schema:n,path:s});return}if(n.type==="literal"){e({source:t,schema:n,path:s});return}if(n.type==="route"){typeof t=="string"&&e({source:t,schema:n,path:s});return}if(n.type==="array"){if(!Array.isArray(t))return;if(!n.item)throw new Error("Schema ("+n.type+") item not found for "+s);for(let r=0;r<t.length;r++){const a=Mi(s,r);le(t[r],n.item,a,e)}return}if(n.type==="object"||n.type==="record"){if(typeof t!="object"||t===null||Array.isArray(t))return;for(const r in t){const a=n.type==="object"?n.items?.[r]:n.item;if(!a)continue;const o=Mi(s,r);le(t[r],a,o,e)}return}if(n.type==="union"){const r=n.key;if(typeof r=="string"){if(t&&typeof t=="object"&&!Array.isArray(t)&&r in t){const a=t[r];if(typeof a=="string"){const o=n.items.filter(l=>l.type==="object").find(l=>{const u=l.items[r];return u?.type==="literal"?u.value===a:!1});o&&le(t,o,s,e)}}}else typeof t=="string"&&e({source:t,schema:n,path:s});return}const i=n;throw new Error("Unsupported schema type: "+JSON.stringify(i))}function Mi(t,n){const s=t.endsWith("?p=");return t.includes(Et)?`${t}${s?"":"."}${JSON.stringify(n)}`:`${t}${Et}${JSON.stringify(n)}`}function ms(t){let n="";function s(e){if(typeof e=="string")n+=e;else if(e&&typeof e=="object"&&"children"in e&&Array.isArray(e.children))for(const i of e.children)s(i)}return s({children:t}),n}let Te=null,_e=new Map;function gs(t){const n=new fs.Index({tokenize:"forward"}),s=new Map;for(const e in t){const i=e,{source:r,schema:a}=t[i],o=i+"?p=";le(r,a,o,({source:l,schema:u,path:c})=>{if(l===null)return;let d="",g="";if(u.type==="string"||u.type==="number"||u.type==="boolean"||u.type==="date"||u.type==="dateTime"||u.type==="keyOf"||u.type==="route")d=l?.toString()??"",g=l?.toString()??"";else if(u.type==="literal")d=u.value.toString(),g=u.value.toString();else if(u.type==="richtext")d=ms(l),g=d.substring(0,50)||"richtext";else if((u.type==="file"||u.type==="image")&&l!==null&&typeof l=="object"&&P in l&&typeof l[P]=="string"){const v=l[P].replace("/public/val/",""),m=l?.metadata,f=m&&typeof m=="object"&&"alt"in m?m.alt:"";d=v+" "+f,g=v}if(d){const[,h]=et.splitModuleFilePathAndModulePath(c),v=ys(h)+" ";n.add(c,v+" "+c+" "+d),s.set(c,g)}})}return{index:n,pathToLabel:s}}const vs=new Set(["/","-","_",".",":","?","&","=","@",'"',"'"]);function ys(t){let n="";for(let s=0;s<t.length;s++){const e=t[s];vs.has(e)?n+=" ":n+=e}return console.log("Original path:",t,"Cleaned path:",n),n}function xs(t,n=50,s=0){if(!Te||!t.trim())return{results:[],total:0};const e=Te.search(t,{limit:s+n}),i=e.length;return{results:e.slice(s,s+n).map(a=>({path:a,label:_e.get(a)||a})),total:i}}self.onmessage=t=>{const n=t.data;try{if(n.type==="build-index"){const s=gs(n.modules);Te=s.index,_e=s.pathToLabel;const e={type:"index-ready",id:n.id,pathToLabel:Array.from(_e.entries())};self.postMessage(e)}else if(n.type==="search"){const{results:s,total:e}=xs(n.query,n.limit,n.offset),i={type:"search-results",id:n.id,results:s,total:e};self.postMessage(i)}}catch(s){const e={type:"error",id:n.id,error:s instanceof Error?s.message:String(s)};self.postMessage(e)}};var bs=Object.freeze({__proto__:null})})();
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Val</title>
7
- <script type="module" crossorigin src="/api/val/static/assets/index-BKqzxajW.js"></script>
8
- <link rel="stylesheet" crossorigin href="/api/val/static/assets/index-CSMCTXvr.css">
7
+ <script type="module" crossorigin src="/api/val/static/assets/index-Dj_CIXkO.js"></script>
8
+ <link rel="stylesheet" crossorigin href="/api/val/static/assets/index-C4NVNJV7.css">
9
9
  </head>
10
10
  <body>
11
11
  <div id="val-app-static"></div>