@valbuild/ui 0.85.1 → 0.86.1

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.
@@ -40,7 +40,7 @@ Error generating stack: `+i.message+`
40
40
  */var s$=g,a$=Symbol.for("react.element"),l$=Symbol.for("react.fragment"),c$=Object.prototype.hasOwnProperty,u$=s$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d$={key:!0,ref:!0,__self:!0,__source:!0};function PO(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)c$.call(t,r)&&!d$.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:a$,type:e,key:i,ref:s,props:o,_owner:u$.current}}Uv.Fragment=l$;Uv.jsx=PO;Uv.jsxs=PO;NO.exports=Uv;var d=NO.exports;function Cb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Y1(e,t){if(e){if(typeof e=="string")return Cb(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cb(e,t):void 0}}function vi(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Y1(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
41
41
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return s=l.done,l},e:function(l){a=!0,i=l},f:function(){try{s||n.return==null||n.return()}finally{if(a)throw i}}}}function J1(e){return e.length>0}var Yh=Object.freeze({kind:"ok",value:void 0});function _n(e){return e===void 0?Yh:{kind:"ok",value:e}}function Hn(e){return{kind:"err",error:e}}function Vu(e){return e===Yh||e.kind==="ok"}function Wv(e){return e!==Yh&&e.kind==="err"}function _O(e){var t=[],n=[],r=vi(e),o;try{for(r.s();!(o=r.n()).done;){var i=o.value;Vu(i)?t.push(i.value):n.push(i.error)}}catch(s){r.e(s)}finally{r.f()}return J1(n)?Hn(n):_n(t)}function f$(e){return _O(e)}function h$(e){var t=[],n=vi(e),r;try{for(n.s();!(r=n.n()).done;){var o=r.value;Wv(o)&&t.push(o.error)}}catch(i){n.e(i)}finally{n.f()}return J1(t)?Hn(t):Yh}function X1(e,t){return function(n){for(var r=_n(t),o=0;o<n.length&&Vu(r);++o)r=e(r.value,n[o],o);return r}}function co(e){return function(t){return Vu(t)?_n(e(t.value)):t}}function _l(e){return function(t){return Vu(t)?e(t.value):t}}function p$(e){return function(t){return Wv(t)?Hn(e(t.error)):t}}function m$(e,t){return function(n){return e(n)?_n(n):Hn(t(n))}}var Hv=function(t,n){return function(r){return Vu(r)?t(r.value)?r:Hn(n(r.value)):r}},g$=Object.freeze({__proto__:null,voidOk:Yh,ok:_n,err:Hn,isOk:Vu,isErr:Wv,allT:_O,all:f$,allV:h$,flatMapReduce:X1,map:co,flatMap:_l,mapErr:p$,fromPredicate:m$,filterOrElse:Hv});function v$(e){if(Array.isArray(e))return e}function y$(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}function x$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
42
42
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jn(e,t){return v$(e)||y$(e,t)||Y1(e,t)||x$()}function b$(e){if(Array.isArray(e))return Cb(e)}function w$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function S$(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
43
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ge(e){return b$(e)||w$(e)||Y1(e)||S$()}function ie(e){"@babel/helpers - typeof";return ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ie(e)}function k$(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jO(e){var t=k$(e,"string");return typeof t=="symbol"?t:t+""}function B(e,t,n){return(t=jO(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function xt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HC(Object(n),!0).forEach(function(r){B(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E$(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,jO(r.key),r)}}function An(e,t,n){return t&&E$(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xg(e){return xg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xg(e)}function TO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(TO=function(){return!!e})()}function C$(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N$(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return C$(e)}function Zr(e,t,n){return t=xg(t),N$(e,TO()?Reflect.construct(t,[],xg(e).constructor):t.apply(e,n))}function Nb(e,t){return Nb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Nb(e,t)}function Qr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nb(e,t)}var eo=function(){function e(){Rn(this,e)}return An(e,[{key:"executeCustomValidateFunctions",value:function(n,r,o){var i=[],s=vi(r),a;try{for(s.s();!(a=s.n()).done;){var l=a.value;try{var c=l(n,o);c&&i.push({message:c,value:n})}catch(u){i.push({message:"Error in custom validate function: ".concat(u instanceof Error?u.message:String(u)),value:n,schemaError:!0})}}}catch(u){s.e(u)}finally{s.f()}return i}},{key:"appendValidationError",value:function(n,r,o,i,s){return n?(n[r]?n[r].push({message:o,value:i,schemaError:s}):n[r]=[{message:o,value:i,schemaError:s}],n):B({},r,[{message:o,value:i,schemaError:s}])}}])}(),OO=Symbol("GetSchema"),MO=Symbol("Path"),P$=Symbol("GetSource");function KC(e){return e[OO]}var Le="_type",bt="_ref",Pb="_tag";function _$(e){return ie(e)==="object"&&e!==null&&Le in e&&e[Le]==="file"&&bt in e&&typeof e[bt]=="string"}var j$=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];return Rn(this,t),r=Zr(this,t),r.options=n,r.opt=o,r.isRemote=i,r.customValidateFunctions=s,r}return Qr(t,e),An(t,[{key:"remote",value:function(){return new t(this.options,this.opt,!0)}},{key:"validate",value:function(r){return new t(this.options,this.opt,this.isRemote,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r});if(this.opt&&o==null)return i.length>0?B({},r,i):!1;if(o==null)return B({},r,[].concat(ge(i),[{message:"Non-optional file was null or undefined.",value:o}]));if(typeof o[bt]!="string")return B({},r,[].concat(ge(i),[{message:"File did not have a file reference string. Got: ".concat(ie(o[bt])),value:o}]));if(this.isRemote&&o[Le]!=="remote")return B({},r,[].concat(ge(i),[{message:"Expected a remote file, but got a local file.",value:o,fixes:["file:upload-remote"]}]));if(this.isRemote&&o[Le]==="remote")return B({},r,[].concat(ge(i),[{message:"Remote file was not checked.",value:o,fixes:["file:check-remote"]}]));if(!this.isRemote&&o[Le]==="remote")return B({},r,[].concat(ge(i),[{message:"Expected locale file, but found remote.",value:o,fixes:["file:download-remote"]}]));if(o[Le]!=="file")return B({},r,[].concat(ge(i),[{message:"File did not have the valid file extension type. Got: ".concat(o[Le]),value:o,fixes:["file:change-extension","file:check-metadata"]}]));var s=this.options||{},a=s.accept,l=o.metadata||{},c=l.mimeType;if(a&&c&&!c.includes("/"))return B({},r,[].concat(ge(i),[{message:"Invalid mime type format. Got: ".concat(c),value:o,fixes:["file:change-extension","file:check-metadata"]}]));if(a&&c&&c.includes("/")){var u=a.split(",").map(function(p){return p.trim()}),f=u.some(function(p){if(p==="*/*")return!0;if(p.endsWith("/*")){var m=p.slice(0,-2);return c.startsWith(m)}return p===c});if(!f)return B({},r,[].concat(ge(i),[{message:"Mime type mismatch. Found '".concat(c,"' but schema accepts '").concat(a,"'"),value:o,fixes:["file:change-extension","file:check-metadata"]}]))}var h=Y.filenameToMimeType(o[bt]);return h?h!==c?B({},r,[].concat(ge(i),[{message:"Mime type and file extension not matching. Mime type is '".concat(c,"' but file extension is '").concat(h,"'"),value:o,fixes:["file:change-extension","file:check-metadata"]}])):o.metadata?B({},r,[].concat(ge(i),[{message:"Found metadata, but it could not be validated. File metadata must be an object with the mimeType.",value:o,fixes:["file:check-metadata"]}])):B({},r,[].concat(ge(i),[{message:"Missing File metadata.",value:o,fixes:["file:add-metadata"]}])):B({},r,[].concat(ge(i),[{message:"Could not determine mime type from file extension. Got: ".concat(o[bt]),value:o,fixes:["file:change-extension","file:check-metadata"]}]))}},{key:"executeAssert",value:function(r,o){return this.opt&&o===null?{success:!0,data:o}:o===null?{success:!1,errors:B({},r,[{message:"Expected 'object', got 'null'",typeError:!0}])}:ie(o)!=="object"?{success:!1,errors:B({},r,[{message:"Expected object, got '".concat(ie(o),"'"),typeError:!0}])}:bt in o?Le in o&&o[Le]==="file"?{success:!0,data:o}:{success:!1,errors:B({},r,[{message:"Value of this schema must use: 'c.file' (error type: missing_file_extension)",typeError:!0}])}:{success:!1,errors:B({},r,[{message:"Value of this schema must use: 'c.file' (error type: missing_ref_prop)",typeError:!0}])}}},{key:"nullable",value:function(){return new t(this.options,!0)}},{key:"executeSerialize",value:function(){var r;return{type:"file",options:this.options,opt:this.opt,remote:this.isRemote,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(){return{}}}])}(eo),T$=function(t){return new j$(t)};function O$(e){return e[bt].startsWith("/public")?e.patch_id?{url:"/api/val/files"+e[bt]+"?patch_id=".concat(e.patch_id),metadata:e.metadata}:{url:e[bt].slice(7),metadata:e.metadata}:{url:e[bt]+(e.patch_id?"?patch_id=".concat(e.patch_id):""),metadata:e.metadata}}function M$(e){return ie(e)==="object"&&e!==null&&e!==void 0&&MO in e&&"val"in e}function RO(e){return e[MO]}function hu(e,t){if(ie(t)==="symbol")throw Error("Cannot create val path of array item with symbol prop: ".concat(t.toString()));if(e)return e.includes(Y.ModuleFilePathSep)?"".concat(e,".").concat(JSON.stringify(t)):"".concat(e).concat(Y.ModuleFilePathSep).concat(JSON.stringify(t))}function Mr(e,t){if(ie(t)==="symbol")throw Error("Cannot create val path of array item with symbol prop: ".concat(t.toString()));if(!e)throw Error("Cannot create val path of array item of empty or missing path: ".concat(e,". Item: ").concat(t));return e.includes(Y.ModuleFilePathSep)?"".concat(e,".").concat(JSON.stringify(t)):"".concat(e).concat(Y.ModuleFilePathSep).concat(JSON.stringify(t))}var R$=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];return Rn(this,t),r=Zr(this,t),r.options=n,r.opt=o,r.isRaw=i,r.customValidateFunctions=s,r}return Qr(t,e),An(t,[{key:"min",value:function(r){return this.minLength(r)}},{key:"minLength",value:function(r){return new t(xt(xt({},this.options),{},{minLength:r}),this.opt,this.isRaw)}},{key:"max",value:function(r){return this.maxLength(r)}},{key:"maxLength",value:function(r){return new t(xt(xt({},this.options),{},{maxLength:r}),this.opt,this.isRaw)}},{key:"regexp",value:function(r,o){return new t(xt(xt({},this.options),{},{regexp:r,regExpMessage:o}),this.opt,this.isRaw)}},{key:"validate",value:function(r){return new t(this.options,this.opt,this.isRaw,this.customValidateFunctions.concat(r))}},{key:"executeValidate",value:function(r,o){var i,s,a,l=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r});return this.opt&&o==null?l.length>0?B({},r,l):!1:typeof o!="string"?B({},r,[{message:"Expected 'string', got '".concat(ie(o),"'"),value:o}]):((i=this.options)!==null&&i!==void 0&&i.maxLength&&o.length>this.options.maxLength&&l.push({message:"Expected string to be at most ".concat(this.options.maxLength," characters long, got ").concat(o.length),value:o}),(s=this.options)!==null&&s!==void 0&&s.minLength&&o.length<this.options.minLength&&l.push({message:"Expected string to be at least ".concat(this.options.minLength," characters long, got ").concat(o.length),value:o}),(a=this.options)!==null&&a!==void 0&&a.regexp&&!this.options.regexp.test(o)&&l.push({message:this.options.regExpMessage||"Expected string to match reg exp: ".concat(this.options.regexp.toString(),", got '").concat(o,"'"),value:o}),l.length>0?B({},r,l):!1)}},{key:"executeAssert",value:function(r,o){return this.opt&&o===null?{success:!0,data:o}:typeof o=="string"?{success:!0,data:o}:{success:!1,errors:B({},r,[{message:"Expected 'string', got '".concat(ie(o),"'"),typeError:!0}])}}},{key:"nullable",value:function(){return new t(this.options,!0,this.isRaw)}},{key:"raw",value:function(){return new t(this.options,this.opt,!0)}},{key:"executeSerialize",value:function(){var r,o,i,s,a;return{type:"string",options:{maxLength:(r=this.options)===null||r===void 0?void 0:r.maxLength,minLength:(o=this.options)===null||o===void 0?void 0:o.minLength,regexp:((i=this.options)===null||i===void 0?void 0:i.regexp)&&{message:this.options.regExpMessage,source:this.options.regexp.source,flags:this.options.regexp.flags},customValidate:this.customValidateFunctions&&((s=this.customValidateFunctions)===null||s===void 0?void 0:s.length)>0},opt:this.opt,raw:this.isRaw,customValidate:this.customValidateFunctions&&((a=this.customValidateFunctions)===null||a===void 0?void 0:a.length)>0}}},{key:"executeRender",value:function(){return{}}}])}(eo),AO=function(t){return new R$(t)},jl=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return Rn(this,t),r=Zr(this,t),r.items=n,r.opt=o,r.customValidateFunctions=i,r}return Qr(t,e),An(t,[{key:"validate",value:function(r){return new t(this.items,this.opt,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i=!1,s=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r});if(this.opt&&o==null)return s.length>0?B({},r,s):!1;if(o===null)return B({},r,[{message:"Expected 'object', got 'null'"}]);if(ie(o)!=="object")return B({},r,[{message:"Expected 'object', got '".concat(ie(o),"'")}]);if(Array.isArray(o))return B({},r,[{message:"Expected 'object', got 'array'"}]);var a=vi(s),l;try{for(a.s();!(l=a.n()).done;){var c=l.value;i=this.appendValidationError(i,r,c.message,o,c.schemaError)}}catch(b){a.e(b)}finally{a.f()}for(var u=0,f=Object.entries(this.items);u<f.length;u++){var h=jn(f[u],2),p=h[0],m=h[1],v=hu(r,p);if(!v)i=this.appendValidationError(i,r,"Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(p),o);else{var x=m.executeValidate(v,o[p]);x&&i?i=xt(xt({},x),i):x&&(i=x)}}return i}},{key:"executeAssert",value:function(r,o){if(this.opt&&o===null)return{success:!0,data:o};if(o===null)return{success:!1,errors:B({},r,[{message:"Expected 'object', got 'null'",typeError:!0}])};if(ie(o)!=="object")return{success:!1,errors:B({},r,[{message:"Expected 'object', got '".concat(ie(o),"'"),typeError:!0}])};if(Array.isArray(o))return{success:!1,errors:B({},r,[{message:"Expected 'object', got 'array'",typeError:!0}])};for(var i=[],s=0,a=Object.keys(this.items);s<a.length;s++){var l=a[s],c=hu(r,l);c?l in o||i.push({message:"Expected key '".concat(l,"' not found in object"),typeError:!0}):i.push({message:"Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(l),internalError:!0})}return i.length>0?{success:!1,errors:B({},r,i)}:{success:!0,data:o}}},{key:"nullable",value:function(){return new t(this.items,!0)}},{key:"executeSerialize",value:function(){var r;return{type:"object",items:Object.fromEntries(Object.entries(this.items).map(function(o){var i=jn(o,2),s=i[0],a=i[1];return[s,a.executeSerialize()]})),opt:this.opt,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(r,o){var i={};if(o===null)return i;for(var s in this.items){var a=o[s];if(a!=null){var l=Mr(r,s),c=this.items[s].executeRender(l,a);for(var u in c){var f=u;i[f]=c[f]}}}return i}}])}(eo),IO=function(t){return new jl(t)};IO({get test(){return AO()}});var Kv=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return Rn(this,t),r=Zr(this,t),B(r,"renderInput",null),r.item=n,r.opt=o,r.customValidateFunctions=i,r}return Qr(t,e),An(t,[{key:"validate",value:function(r){return new t(this.item,this.opt,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i=this.executeAssert(r,o);if(!i.success)return i.errors;if(i.data===null)return!1;for(var s={},a=0,l=Object.entries(i.data);a<l.length;a++){var c=jn(l[a],2),u=c[0],f=c[1],h=Mr(r,Number(u)),p=this.item.executeValidate(h,f);p&&(s=xt(xt({},p),s))}return Object.keys(s).length===0?!1:s}},{key:"executeAssert",value:function(r,o){return o===null&&this.opt?{success:!0,data:o}:o===null?{success:!1,errors:B({},r,[{message:"Expected 'array', got 'null'",typeError:!0}])}:ie(o)!=="object"?{success:!1,errors:B({},r,[{message:"Expected 'object', got '".concat(ie(o),"'"),typeError:!0}])}:Array.isArray(o)?{success:!0,data:o}:{success:!1,errors:B({},r,[{message:"Expected object of type 'array'",typeError:!0}])}}},{key:"nullable",value:function(){return new t(this.item,!0)}},{key:"executeSerialize",value:function(){var r;return{type:"array",item:this.item.executeSerialize(),opt:this.opt,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(r,o){var i={};if(o===null)return i;for(var s=0;s<o.length;s++){var a=s,l=o[a];if(l!=null){var c=Mr(r,a),u=this.item.executeRender(c,l);for(var f in u){var h=f;i[h]=u[h]}}}if(this.renderInput){var p=this.renderInput,m=p.select,v=p.layout;v!=="list"&&(i[r]={status:"error",message:"Unknown layout type: "+v});try{i[r]={status:"success",data:{layout:"list",parent:"array",items:o.map(function(x){var b=m({val:x}),w=b.title,S=b.subtitle,C=b.image;return{title:w,subtitle:S,image:C}})}}}catch(x){i[r]={status:"error",message:x instanceof Error?x.message:"Unknown error"}}}return i}},{key:"render",value:function(r){return this.renderInput=r,this}}])}(eo),A$=function(t){return new Kv(t)},Za=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return Rn(this,t),r=Zr(this,t),r.value=n,r.opt=o,r.customValidateFunctions=i,r}return Qr(t,e),An(t,[{key:"validate",value:function(r){return new t(this.value,this.opt,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r});return this.opt&&o==null?i.length>0?B({},r,i):!1:typeof o!="string"?B({},r,[].concat(ge(i),[{message:"Expected 'string', got '".concat(ie(o),"'"),value:o}])):o!==this.value?B({},r,[].concat(ge(i),[{message:"Expected literal '".concat(this.value,"', got '").concat(o,"'"),value:o}])):i.length>0?B({},r,i):!1}},{key:"executeAssert",value:function(r,o){return this.opt&&o===null?{success:!0,data:o}:o===null?{success:!1,errors:B({},r,[{message:"Expected 'string', got 'null'",typeError:!0}])}:typeof o=="string"&&o===this.value?{success:!0,data:o}:{success:!1,errors:B({},r,[{message:"Expected literal '".concat(this.value,"', got '").concat(o,"'"),typeError:!0}])}}},{key:"nullable",value:function(){return new t(this.value,!0)}},{key:"executeSerialize",value:function(){var r;return{type:"literal",value:this.value,opt:this.opt,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(){return{}}}])}(eo),I$=function(t){return new Za(t)},DO=function(e){function t(n,r){var o,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];return Rn(this,t),o=Zr(this,t),o.key=n,o.items=r,o.opt=i,o.customValidateFunctions=s,o}return Qr(t,e),An(t,[{key:"validate",value:function(r){return new t(this.key,this.items,this.opt,this.customValidateFunctions.concat(r))}},{key:"executeValidate",value:function(r,o){var i=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r}),s=o;if(this.opt&&s===null)return i.length>0?B({},r,i):!1;if(!this.key)return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"Missing required first argument in union",schemaError:!0}]));var a=this.key;if(!Array.isArray(this.items))return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"A union schema must take more than 1 schema arguments",schemaError:!0}]));if(typeof a=="string"){if(this.items.some(function(O){return!(O instanceof jl)}))return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"Key is a string, so all schema items must be objects",schemaError:!0}]));var l=this.items,c=l.map(function(O){return O.executeSerialize()}),u=c.filter(function(O){return O.type!=="object"||O.items[a].type!=="literal"});if(u.length>0)return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"All schema items must be objects with a key: ".concat(a," that is a literal schema. Found: ").concat(JSON.stringify(u,null,2)),schemaError:!0}]));var f=c,h=f.filter(function(O){return O.items[a].opt});if(h.length>1)return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"Schema cannot have an optional keys: ".concat(a),schemaError:!0}]));if(ie(s)!=="object")return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"Expected an object",typeError:!0}]));var p=s;if(p[a]===void 0)return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"Missing required key: ".concat(a),typeError:!0}]));var m=[],v=vi(f),x;try{for(v.s();!(x=v.n()).done;){var b=x.value,w=b.items[a];if(w.type==="literal")if(!m.includes(w.value))m.push(w.value);else return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"Found duplicate key in schema: ".concat(w.value),schemaError:!0}]))}}catch(O){v.e(O)}finally{v.f()}var S=l.find(function(O){return!O.items[a].executeValidate(r,p[a])});if(!S){var C=hu(r,a);if(!C)throw new Error("Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(a));return B({},C,[{message:'Invalid key: "'.concat(a,'". Value was: "').concat(p[a],'". Valid values: ').concat(f.map(function(O){var M=O.items[a];if(M.type==="literal"&&M.value)return'"'.concat(M.value,'"');throw new Error("Expected literal schema, got ".concat(JSON.stringify(M,null,2)))}).join(", "))}])}var N=S.executeValidate(r,p);if(N)return N}else if(a instanceof Za){if(this.items.some(function(O){return!(O instanceof Za)}))return B({},r,[{message:"Key is a literal schema, so all schema items must be literals",typeError:!0}]);var P=[a].concat(ge(this.items));if(typeof s=="string"){var _=P.some(function(O){return!O.executeValidate(r,s)});if(!_)return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"Union must match one of the following: ".concat(P.map(function(O){return'"'.concat(O.value,'"')}).join(", "))}]))}}else return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"Expected a string or literal"}]));return i.length>0?B({},r,i):!1}},{key:"executeAssert",value:function(r,o){if(this.opt&&o===null)return{success:!0,data:o};if(o===null)return{success:!1,errors:B({},r,[{message:"Expected 'object', got 'null'",typeError:!0}])};if(!this.key)return{success:!1,errors:B({},r,[{message:"Missing required first argument in union schema",schemaError:!0}])};if(!Array.isArray(this.items))return{success:!1,errors:B({},r,[{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 Za){var i,s=!1,a={},l=vi((i=[this.key]).concat.apply(i,ge(this.items))),c;try{for(l.s();!(c=l.n()).done;){var u=c.value;if(!(u instanceof Za))return{success:!1,errors:B({},r,[{message:"Schema of value is a union of string, so all schema items must be literals",schemaError:!0}])};if(typeof o!="string"){a[r]=[{message:"Expected 'string', got '".concat(ie(o),"'"),typeError:!0}];continue}var f=u.executeAssert(r,o);if(f.success){s=!0;break}else for(var h=0,p=Object.entries(f.errors);h<p.length;h++){var m,v=jn(p[h],2),x=v[0],b=v[1];a[x]||(a[x]=[]),(m=a[x]).push.apply(m,ge(b))}}}catch(H){l.e(H)}finally{l.f()}return s?{success:!0,data:o}:{success:!1,errors:a}}else if(typeof this.key=="string"){var w=!1,S={},C=vi(this.items),N;try{for(C.s();!(N=C.n()).done;){var P=N.value,_=P.executeAssert(r,o);if(_.success){w=!0;break}else for(var O=0,M=Object.entries(_.errors);O<M.length;O++){var D,U=jn(M[O],2),z=U[0],K=U[1];S[z]||(S[z]=[]),(D=S[z]).push.apply(D,ge(K))}}}catch(H){C.e(H)}finally{C.f()}return w?{success:!0,data:o}:{success:!1,errors:S}}else return{success:!1,errors:B({},r,[{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 t(this.key,this.items,!0)}},{key:"executeSerialize",value:function(){var r;if(typeof this.key=="string"){var o;return{type:"union",key:this.key,items:this.items.map(function(i){return i.executeSerialize()}),opt:this.opt,customValidate:this.customValidateFunctions&&((o=this.customValidateFunctions)===null||o===void 0?void 0:o.length)>0}}return{type:"union",key:this.key.executeSerialize(),items:this.items.map(function(i){return i.executeSerialize()}),opt:this.opt,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(r,o){var i={};if(o===null||this.key instanceof Za)return i;var s=this.key;if(typeof s=="string"){var a=this.items.find(function(f){if(f instanceof jl){var h=f.items[s];if(h instanceof Za)return ie(o)==="object"&&s in o&&h.value===o[s]}return!1});if(a){var l=a.executeRender(r,o);for(var c in l){var u=c;i[u]=l[u]}return i}i[r]={status:"error",message:"Could not find a matching (object) schema for the union key: ".concat(s)}}return i[r]={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(s,null,2),"'")},i}}])}(eo),D$=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return new DO(t,r)},Z1=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];return Rn(this,t),r=Zr(this,t),r.options=n,r.opt=o,r.isRemote=i,r.customValidateFunctions=s,r}return Qr(t,e),An(t,[{key:"remote",value:function(){return new t(this.options,this.opt,!0)}},{key:"validate",value:function(r){return new t(this.options,this.opt,this.isRemote,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r});if(this.opt&&o==null)return i.length>0?B({},r,i):!1;if(o==null)return B({},r,[].concat(ge(i),[{message:"Non-optional image was null or undefined.",value:o}]));if(this.isRemote&&o[Le]!=="remote")return B({},r,[].concat(ge(i),[{message:"Expected a remote image, but got a local image.",value:o,fixes:["image:upload-remote"]}]));if(this.isRemote&&o[Le]==="remote")return B({},r,[].concat(ge(i),[{message:"Remote image was not checked.",value:o,fixes:["image:check-remote"]}]));if(!this.isRemote&&o[Le]==="remote")return B({},r,[].concat(ge(i),[{message:"Expected locale image, but found remote.",value:o,fixes:["image:download-remote"]}]));if(typeof o[bt]!="string")return B({},r,[].concat(ge(i),[{message:"Image did not have a file reference string. Got: ".concat(ie(o[bt])),value:o}]));if(o[Le]!=="file")return B({},r,[].concat(ge(i),[{message:"Image did not have the valid file extension type. Got: ".concat(o[Le]),value:o,fixes:["image:change-extension","image:check-metadata"]}]));var s=this.options||{},a=s.accept,l=o.metadata||{},c=l.mimeType;if(a&&c&&!c.includes("/"))return B({},r,[].concat(ge(i),[{message:"Invalid mime type format. Got: '".concat(c,"'"),value:o,fixes:["image:check-metadata"]}]));if(a&&c&&c.includes("/")){var u=a.split(",").map(function(p){return p.trim()}),f=u.some(function(p){if(p==="*/*")return!0;if(p.endsWith("/*")){var m=p.slice(0,-2);return c.startsWith(m)}return p===c});if(!f)return B({},r,[].concat(ge(i),[{message:"Mime type mismatch. Found '".concat(c,"' but schema accepts '").concat(a,"'"),value:o,fixes:["image:check-metadata"]}]))}var h=Y.filenameToMimeType(o[bt]);return h?h&&c&&h!==c?B({},r,[].concat(ge(i),[{message:"Mime type and file extension not matching. Mime type is '".concat(c,"' but file extension is '").concat(h,"'"),value:o,fixes:["image:check-metadata"]}])):o.metadata?o.metadata.hotspot&&(ie(o.metadata.hotspot)!=="object"||typeof o.metadata.hotspot.x!="number"||typeof o.metadata.hotspot.y!="number")?B({},r,[].concat(ge(i),[{message:"Hotspot must be an object with x and y as numbers.",value:o}])):B({},r,[].concat(ge(i),[{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:o,fixes:["image:check-metadata"]}])):B({},r,[].concat(ge(i),[{message:"Could not validate Image metadata.",value:o,fixes:["image:add-metadata"]}])):B({},r,[].concat(ge(i),[{message:"Could not determine mime type from file extension. Got: ".concat(o[bt]),value:o,fixes:["image:check-metadata"]}]))}},{key:"executeAssert",value:function(r,o){return this.opt&&o===null?{success:!0,data:o}:o===null?{success:!1,errors:B({},r,[{message:"Expected 'object', got 'null'",typeError:!0}])}:ie(o)!=="object"?{success:!1,errors:B({},r,[{message:"Expected 'object', got '".concat(ie(o),"'"),typeError:!0}])}:bt in o?Le in o&&o[Le]==="file"?{success:!0,data:o}:{success:!1,errors:B({},r,[{message:"Value of this schema must use: 'c.image' (error type: missing_file_extension)",typeError:!0}])}:{success:!1,errors:B({},r,[{message:"Value of this schema must use: 'c.image' (error type: missing_ref_prop)",typeError:!0}])}}},{key:"nullable",value:function(){return new t(this.options,!0,this.isRemote)}},{key:"executeSerialize",value:function(){var r;return{type:"image",options:this.options,opt:this.opt,remote:this.isRemote,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(){return{}}}])}(eo),L$=function(t){return new Z1(t)},Gv=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return Rn(this,t),r=Zr(this,t),r.options=n,r.opt=o,r.customValidateFunctions=i,r}return Qr(t,e),An(t,[{key:"maxLength",value:function(r){return new t(xt(xt({},this.options),{},{maxLength:r}),this.opt)}},{key:"minLength",value:function(r){return new t(xt(xt({},this.options),{},{minLength:r}),this.opt)}},{key:"validate",value:function(r){return new t(this.options,this.opt,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r}),s=this.executeAssert(r,o);if(!s.success)return i.length>0?B({},r,i):s.errors;var a=s.data;if(a===null&&this.opt)return i.length>0?B({},r,i):!1;if(a===null)return B({},r,[].concat(ge(i),[{message:"Expected 'array', got 'null'",typeError:!0}]));var l={},c=this.internalValidate(r,a,l);return c?i.length>0?xt(B({},r,i),c):c:Object.keys(l).length>0?i.length>0?xt(B({},r,i),l):l:i.length>0?B({},r,i):!1}},{key:"internalValidate",value:function(r,o,i){var s=this,a=0,l=function(m,v,x){var b=function(R,F,J){x[R]||(x[R]=[]),x[R].push({message:F,typeError:J})},w=vi(v),S;try{for(w.s();!(S=w.n()).done;){var C,N,P,_,O,M,D,U,z,K,H,V=S.value,I=Mr(m,v.indexOf(V));if(typeof V=="string"){a+=V.length;continue}if(ie(V)!=="object")return B({},I,[{message:"Expected nodes of type 'object' or 'string', got '".concat(ie(V),"'"),typeError:!0}]);if(V===null)return B({},I,[{message:"Expected nodes of type 'object' or 'string', got 'null'",typeError:!0}]);if(!("tag"in V))return B({},I,[{message:"Expected node to either have 'tag' or be of type 'string'",typeError:!0}]);if(typeof V.tag!="string")return B({},I,[{message:"Expected 'string', got '".concat(ie(V.tag),"'"),typeError:!0}]);if(V.tag==="h1"&&!((C=s.options.block)!==null&&C!==void 0&&C.h1)&&b(I,"'h' block is not valid",!1),V.tag==="h2"&&!((N=s.options.block)!==null&&N!==void 0&&N.h2)&&b(I,"'h2' block is not valid",!1),V.tag==="h3"&&!((P=s.options.block)!==null&&P!==void 0&&P.h3)&&b(I,"'h3' block is not valid",!1),V.tag==="h4"&&!((_=s.options.block)!==null&&_!==void 0&&_.h4)&&b(I,"'h4' block is not valid",!1),V.tag==="h5"&&!((O=s.options.block)!==null&&O!==void 0&&O.h5)&&b(I,"'h5' block is not valid",!1),V.tag==="h6"&&!((M=s.options.block)!==null&&M!==void 0&&M.h6)&&b(I,"'h6' block is not valid",!1),V.tag==="ol"&&!((D=s.options.block)!==null&&D!==void 0&&D.ol)&&b(I,"'ol' block is not valid",!1),V.tag==="ul"&&!((U=s.options.block)!==null&&U!==void 0&&U.ul)&&b(I,"'ul' block is not valid",!1),V.tag==="li"&&!((z=s.options.block)!==null&&z!==void 0&&z.ul)&&!((K=s.options.block)!==null&&K!==void 0&&K.ol)&&b(I,"'li' tag is invalid since neither 'ul' nor 'ol' block is not valid",!1),V.tag==="a"&&!((H=s.options.inline)!==null&&H!==void 0&&H.a)&&b(I,"'a' inline is not valid",!1),V.tag==="img"){var A,j;if(!((A=s.options.inline)!==null&&A!==void 0&&A.img))b(I,"'img' inline is not valid",!1);else if((j=s.options.inline)!==null&&j!==void 0&&j.img){var L,$;if(!("src"in V))return B({},I,[{message:"Expected 'src' in 'img'",typeError:!0}]);var W=Mr(I,"src"),G=ie((L=s.options.inline)===null||L===void 0?void 0:L.img)==="object"?($=s.options.inline)===null||$===void 0?void 0:$.img.executeValidate(W,V.src):new Z1({},!1,!1).executeValidate(W,V.src);if(G)for(var Pe in G){var ke,oe=Pe;x[oe]||(x[oe]=[]),(ke=x[oe]).push.apply(ke,ge(G[oe]))}}}if("styles"in V&&V.tag!=="span")return B({},I,[{message:"Cannot have styles on '".concat(V.tag,"'. This is only allowed on 'span'"),typeError:!0}]);if("styles"in V){if(!Array.isArray(V.styles))return B({},I,[{message:"Expected 'array', got '".concat(ie(V.styles),"'"),typeError:!0}]);for(var ae=Mr(I,"styles"),X=0;X<V.styles.length;X++){var Ee,De,he,Fe=V.styles[X],_e=Mr(ae,X);if(typeof Fe!="string")return B({},_e,[{message:"Expected 'string', got '".concat(ie(Fe),"'"),typeError:!0}]);Fe==="bold"&&!((Ee=s.options.style)!==null&&Ee!==void 0&&Ee.bold)&&b(_e,"Style 'bold' is not valid",!1),Fe==="italic"&&!((De=s.options.style)!==null&&De!==void 0&&De.italic)&&b(_e,"Style 'italic' is not valid",!1),Fe==="lineThrough"&&!((he=s.options.style)!==null&&he!==void 0&&he.lineThrough)&&b(_e,"Style 'lineThrough' is not valid",!1)}}if("children"in V){if(!Array.isArray(V.children))return B({},I,[{message:"Expected 'array', got '".concat(ie(V.children),"'"),typeError:!0}]);for(var tt=V.children,gt=0;gt<tt.length;gt++){var Kt=tt[gt];if(ie(Kt)==="object"){var T=Mr(I,"children"),k=l(T,[Kt],x);if(k)return k}else if(typeof Kt=="string"){a+=Kt.length;continue}else return B({},I,[{message:"Expected 'object' or 'string', got '".concat(ie(Kt),"'"),typeError:!0}])}}}}catch(E){w.e(E)}finally{w.f()}return!1},c=l(r,o,i),u=[];if(this.options.maxLength&&a>this.options.maxLength&&u.push({message:"Maximum length of ".concat(this.options.maxLength," exceeded (current length: ").concat(a,")"),typeError:!1}),this.options.minLength&&a<this.options.minLength&&u.push({message:"Minimum length of ".concat(this.options.minLength," not met (current length: ").concat(a,")"),typeError:!1}),c){if(u.length>0){var f;c[r]||(c[r]=[]),(f=c[r]).push.apply(f,u)}return c}if(Object.keys(i).length>0){if(u.length>0){var h;i[r]||(i[r]=[]),(h=i[r]).push.apply(h,u)}return i}return u.length>0?B({},r,u):!1}},{key:"executeAssert",value:function(r,o){if(this.opt&&o===null)return{success:!0,data:o};if(o===null&&!this.opt)return{success:!1,errors:B({},r,[{message:"Expected 'array', got 'null'",typeError:!0}])};if(!Array.isArray(o))return{success:!1,errors:B({},r,[{message:"Expected 'array', got '".concat(ie(o),"'"),typeError:!0}])};for(var i={},s=0;s<o.length;s++)this.recursiveAssert(Mr(r,s),o[s],i);return Object.keys(i).length>0?{success:!1,errors:i}:{success:!0,data:o}}},{key:"recursiveAssert",value:function(r,o,i){if(ie(o)!=="object"){i[r]||(i[r]=[]),i[r].push({message:"Expected 'object', got '".concat(ie(o),"'"),typeError:!0});return}if(Array.isArray(o)){i[r]||(i[r]=[]),i[r].push({message:"Expected 'object', got 'array'",typeError:!0});return}if(o===null){i[r]||(i[r]=[]),i[r].push({message:"Expected 'object', got 'null'",typeError:!0});return}if("tag"in o&&typeof o.tag!="string"){i[r]||(i[r]=[]),i[r].push({message:"Expected 'string', got '".concat(ie(o.tag),"'"),typeError:!0});return}if("children"in o)if(Array.isArray(o.children))for(var s=0;s<o.children.length;s++){var a=o.children[s],l=Mr(Mr(r,"children"),s);if(ie(a)==="object")this.recursiveAssert(l,a,i);else{if(typeof a=="string")continue;i[l]||(i[l]=[]),i[l].push({message:"Expected 'object' or 'string', got '".concat(ie(a),"'"),typeError:!0})}}else{i[r]||(i[r]=[]),i[r].push({message:"Expected 'array', got '".concat(ie(o.children),"'"),typeError:!0});return}if("styles"in o)if(!Array.isArray(o.styles))i[r]||(i[r]=[]),i[r].push({message:"Expected 'array', got '".concat(ie(o.styles),"'"),typeError:!0});else for(var c=0;c<o.styles.length;c++){var u=o.styles[c];if(typeof u!="string"){var f=Mr(r,c);i[f]||(i[f]=[]),i[f].push({message:"Expected 'string', got '".concat(ie(u),"'"),typeError:!0})}}}},{key:"nullable",value:function(){return new t(this.options,!0)}},{key:"executeSerialize",value:function(){var r,o={maxLength:this.options.maxLength,minLength:this.options.minLength,style:this.options.style,block:this.options.block,inline:this.options.inline&&{a:this.options.inline.a,img:this.options.inline.img&&ie(this.options.inline.img)==="object"?this.options.inline.img.executeSerialize():this.options.inline.img}};return{type:"richtext",opt:this.opt,options:o,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(){return{}}}])}(eo),F$=function(t){return new Gv(t??{})},Jh=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;return Rn(this,t),r=Zr(this,t),B(r,"renderInput",null),r.item=n,r.opt=o,r.customValidateFunctions=i,r.currentRouter=s,r}return Qr(t,e),An(t,[{key:"validate",value:function(r){return new t(this.item,this.opt,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i=this,s=!1,a=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r});if(this.opt&&o==null)return a.length>0?B({},r,a):!1;if(o===null)return B({},r,[].concat(ge(a),[{message:"Expected 'object', got 'null'"}]));if(ie(o)!=="object")return B({},r,[].concat(ge(a),[{message:"Expected 'object', got '".concat(ie(o),"'")}]));if(Array.isArray(o))return B({},r,[].concat(ge(a),[{message:"Expected 'object', got 'array'"}]));var l=this.getRouterValidations(r,o);if(l)return l;var c=vi(a),u;try{for(c.s();!(u=c.n()).done;){var f=u.value;s=this.appendValidationError(s,r,f.message,o,f.schemaError)}}catch(h){c.e(h)}finally{c.f()}return Object.entries(o).forEach(function(h){var p=jn(h,2),m=p[0],v=p[1],x=hu(r,m);if(!x)s=i.appendValidationError(s,r,"Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(v),o);else{var b=i.item.executeValidate(x,v);b&&s?s=xt(xt({},b),s):b&&(s=b)}}),s}},{key:"executeAssert",value:function(r,o){return this.opt&&o===null?{success:!0,data:o}:ie(o)!=="object"?{success:!1,errors:B({},r,[{message:"Expected 'object', got '".concat(ie(o),"'"),typeError:!0}])}:Array.isArray(o)?{success:!1,errors:B({},r,[{message:"Expected 'object', got 'array'",typeError:!0}])}:{success:!0,data:o}}},{key:"nullable",value:function(){return new t(this.item,!0)}},{key:"router",value:function(r){return new t(this.item,this.opt,this.customValidateFunctions,r)}},{key:"getRouterValidations",value:function(r,o){if(!this.currentRouter||o===null)return!1;var i=Q1(r),s=jn(i,2),a=s[0],l=s[1];if(l)return B({},r,[{message:"This field was configured as a router, but it is not defined at the root of the module",schemaError:!0}]);var c=this.currentRouter.validate(a,Object.keys(o));return c.length>0?Object.fromEntries(c.map(function(u){if(!u.error.urlPath)return[r,[{message:"Router validation error: ".concat(u.error.message," has no url path"),schemaError:!0}]];var f=hu(r,u.error.urlPath);return f?[f,[{message:u.error.message}]]:[r,[{message:"Could not create path for router validation error",schemaError:!0}]]})):!1}},{key:"executeSerialize",value:function(){var r,o;return{type:"record",item:this.item.executeSerialize(),opt:this.opt,router:(r=this.currentRouter)===null||r===void 0?void 0:r.getRouterId(),customValidate:this.customValidateFunctions&&((o=this.customValidateFunctions)===null||o===void 0?void 0:o.length)>0}}},{key:"executeRender",value:function(r,o){var i={};if(o===null)return i;for(var s in o){var a=o[s];if(a!=null){var l=Mr(r,s),c=this.item.executeRender(l,a);for(var u in c){var f=u;i[f]=c[f]}}}if(this.renderInput){var h=this.renderInput,p=h.select,m=h.layout;m!=="list"&&(i[r]={status:"error",message:"Unknown layout type: "+m});try{i[r]={status:"success",data:{layout:"list",parent:"record",items:Object.entries(o).map(function(v){var x=jn(v,2),b=x[0],w=x[1],S=p({key:b,val:w}),C=S.title,N=S.subtitle,P=S.image;return[b,{title:C,subtitle:N,image:P}]})}}}catch(v){i[r]={status:"error",message:v instanceof Error?v.message:"Unknown error"}}}return i}},{key:"render",value:function(r){return this.renderInput=r,this}}])}(eo),z$=function(t){return new Jh(t)};function $$(e){var t=e[P$],n=t;return n}function Q1(e){var t=e.indexOf(wa);return t===-1?[e,""]:[e.slice(0,t),e.slice(t+wa.length)]}function LO(e,t){return t===""?e:"".concat(e).concat(wa).concat(t)}function FO(e){return e instanceof jl||ie(e)==="object"&&"type"in e&&e.type==="object"}function zO(e){return e instanceof Jh||ie(e)==="object"&&"type"in e&&e.type==="record"}function $O(e){return e instanceof Kv||ie(e)==="object"&&"type"in e&&e.type==="array"}function BO(e){return e instanceof DO||ie(e)==="object"&&"type"in e&&e.type==="union"}function VO(e){return e instanceof Gv||ie(e)==="object"&&"type"in e&&e.type==="richtext"}function UO(e){return e instanceof Z1||ie(e)==="object"&&"type"in e&&e.type==="image"}function B$(e,t,n){for(var r=Zf(e),o=ge(r),i=n,s=t,a=function(){var u=r.shift();if(u===void 0)throw Error("Unexpected undefined part");if($O(i)){var f;if(Number.isNaN(Number(u)))throw Error("Invalid path: array schema ".concat(JSON.stringify(i)," must have a number as path, but got ").concat(u,". Path: ").concat(e));if(ie(s)!=="object"&&!Array.isArray(s))throw Error("Schema type error: expected source to be type of array, but got ".concat(ie(s)));s=s[u],i=i instanceof Kv?(f=i)===null||f===void 0?void 0:f.item:i.item}else if(zO(i)){var h;if(typeof u!="string")throw Error("Invalid path: record schema ".concat(i," must have path: ").concat(u," as string"));if(ie(s)!=="object"&&!Array.isArray(s))throw Error("Schema type error: expected source to be type of record, but got ".concat(ie(s)));if(!s[u])throw Error("Invalid path: record source did not have key ".concat(u," from path: ").concat(e));s=s[u],i=i instanceof Jh?(h=i)===null||h===void 0?void 0:h.item:i.item}else if(FO(i)){if(ie(s)!=="object")throw Error("Schema type error: expected source to be type of object, but got ".concat(ie(s)));if(s!==null&&s[u]===void 0)throw Error("Invalid path: object source did not have key ".concat(u," from path: ").concat(e));s=s===null?s:s[u],i=(i instanceof jl,i.items[u])}else{if(UO(i))return{v:{path:o.slice(0,o.length-r.length-1).map(function(w){return JSON.stringify(w)}).join("."),schema:i,source:s}};if(BO(i)){var p=i.key;if(typeof p!="string")return{v:{path:o.map(function(w){return Number.isNaN(Number(w))?JSON.stringify(w):w}).join("."),schema:i,source:s}};var m=s[p];if(!m)throw Error("Invalid path: union source ".concat(i," did not have required key ").concat(p," in path: ").concat(e));var v=i.items.find(function(w){var S;return(w==null||(S=w.items)===null||S===void 0||(S=S[p])===null||S===void 0?void 0:S.value)===m});if(!v)throw Error("Invalid path: union schema ".concat(i," did not have a child object with ").concat(p," of value ").concat(m," in path: ").concat(e));i=v.items[u],s=s[u]}else if(VO(i)){if("src"in s&&"tag"in s&&s.tag==="img"&&r.length===0){var x,b;i=i instanceof Gv&&(x=i.options)!==null&&x!==void 0&&(x=x.inline)!==null&&x!==void 0&&x.img&&typeof((b=i.options)===null||b===void 0||(b=b.inline)===null||b===void 0?void 0:b.img)!="boolean"?i.options.inline.img:i}s=s[u]}else throw Error("Invalid path: ".concat(u," resolved to an unexpected schema ").concat(JSON.stringify(i)))}},l;r.length>0;)if(l=a(),l)return l.v;if(r.length>0)throw Error("Invalid path: ".concat(r.join(".")," is not a valid path"));return{path:o.map(function(c){return Number.isNaN(Number(c))?JSON.stringify(c):c}).join("."),schema:i,source:s}}function V$(e,t,n){for(var r=Zf(e),o=ge(r),i=n,s=t,a=function(){var u=r.shift();if(u===void 0)return{v:{status:"error",message:"Unexpected undefined part"}};if($O(i)){var f;if(Number.isNaN(Number(u)))return{v:{status:"error",message:"Invalid path: array schema ".concat(JSON.stringify(i)," must have a number as path, but got ").concat(u,". Path: ").concat(e)}};if(s===void 0)return{v:{status:"source-undefined",path:o.slice(0,o.length-r.length-1).map(function(w){return JSON.stringify(w)}).join(".")}};if(ie(s)!=="object"&&!Array.isArray(s))return{v:{status:"error",message:"Schema type error: expected source to be type of array, but got ".concat(ie(s))}};s=s[u],i=i instanceof Kv?(f=i)===null||f===void 0?void 0:f.item:i.item}else if(zO(i)){var h;if(typeof u!="string")return{v:{status:"error",message:"Invalid path: record schema ".concat(i," must have path: ").concat(u," as string")}};if(s===void 0)return{v:{status:"source-undefined",path:o.slice(0,o.length-r.length-1).map(function(w){return JSON.stringify(w)}).join(".")}};if(ie(s)!=="object"&&!Array.isArray(s))return{v:{status:"error",message:"Schema type error: expected source to be type of record, but got ".concat(ie(s))}};if(!s[u])return{v:{status:"error",message:"Invalid path: record source did not have key ".concat(u," from path: ").concat(e)}};s=s[u],i=i instanceof Jh?(h=i)===null||h===void 0?void 0:h.item:i.item}else if(FO(i)){if(s===void 0)return{v:{status:"source-undefined",path:o.slice(0,o.length-r.length-1).map(function(w){return JSON.stringify(w)}).join(".")}};if(ie(s)!=="object")return{v:{status:"error",message:"Schema type error: expected source to be type of object, but got ".concat(ie(s))}};if(s!==null&&s[u]===void 0)return{v:{status:"error",message:"Invalid path: object source did not have key ".concat(u," from path: ").concat(e)}};s=s===null?s:s[u],i=(i instanceof jl,i.items[u])}else{if(UO(i))return{v:{status:"ok",path:o.slice(0,o.length-r.length-1).map(function(w){return JSON.stringify(w)}).join("."),schema:i,source:s}};if(BO(i)){var p=i.key;if(typeof p!="string")return{v:{status:"ok",path:o.map(function(w){return Number.isNaN(Number(w))?JSON.stringify(w):w}).join("."),schema:i,source:s}};var m=s[p];if(!m)return{v:{status:"error",message:"Invalid path: union source ".concat(i," did not have required key ").concat(p," in path: ").concat(e)}};var v=i.items.find(function(w){var S;return(w==null||(S=w.items)===null||S===void 0||(S=S[p])===null||S===void 0?void 0:S.value)===m});if(!v)return{v:{status:"error",message:"Invalid path: union schema ".concat(i," did not have a child object with ").concat(p," of value ").concat(m," in path: ").concat(e)}};i=v.items[u],s=s[u]}else if(VO(i)){if("src"in s&&"tag"in s&&s.tag==="img"&&r.length===0){var x,b;i=i instanceof Gv&&(x=i.options)!==null&&x!==void 0&&(x=x.inline)!==null&&x!==void 0&&x.img&&typeof((b=i.options)===null||b===void 0||(b=b.inline)===null||b===void 0?void 0:b.img)!="boolean"?i.options.inline.img:i}s=s[u]}else return{v:{status:"error",message:"Invalid path: ".concat(u," resolved to an unexpected schema ").concat(JSON.stringify(i))}}}},l;r.length>0;)if(l=a(),l)return l.v;return r.length>0?{status:"error",message:"Invalid path: ".concat(r.join(".")," is not a valid path")}:{status:"ok",path:o.map(function(c){return Number.isNaN(Number(c))?JSON.stringify(c):c}).join("."),schema:i,source:s}}function U$(e){var t=e.split("/").slice(1);return t}function Zf(e){for(var t=[],n=0;n<e.length;){var r="";if(e[n]==='"'){for(n++;n<e.length&&e[n]!=='"';)e[n]==="\\"&&e[n+1]==='"'?(r+='"',n++):r+=e[n],n++;if(e[n]!=='"'){var o;throw new Error("Invalid input (".concat(JSON.stringify(e),"): Missing closing double quote: ").concat((o=e[n])!==null&&o!==void 0?o:"at end of string"," (char: ").concat(n,"; length: ").concat(e.length,")"))}}else for(;n<e.length&&e[n]!==".";)r+=e[n],n++;r!==""&&t.push(r),n++}return t}function W$(e){return e.split(",")}function H$(e){var t=Q1(e),n=jn(t,2),r=n[0],o=n[1],i=Zf(o).slice(0,-1);return i.length>0?LO(r,WO(i)):r}function WO(e){return e.map(function(t){return Number.isInteger(Number(t))?t:JSON.stringify(t)}).join(".")}var K$=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return Rn(this,t),r=Zr(this,t),r.options=n,r.opt=o,r.customValidateFunctions=i,r}return Qr(t,e),An(t,[{key:"validate",value:function(r){return new t(this.options,this.opt,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i,s,a=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r});return this.opt&&o==null?a.length>0?B({},r,a):!1:typeof o!="number"?B({},r,[].concat(ge(a),[{message:"Expected 'number', got '".concat(ie(o),"'"),value:o}])):(i=this.options)!==null&&i!==void 0&&i.max&&o>this.options.max?B({},r,[].concat(ge(a),[{message:"Expected 'number' less than ".concat(this.options.max),value:o}])):(s=this.options)!==null&&s!==void 0&&s.min&&o<this.options.min?B({},r,[].concat(ge(a),[{message:"Expected 'number' greater than ".concat(this.options.min),value:o}])):a.length>0?B({},r,a):!1}},{key:"executeAssert",value:function(r,o){return this.opt&&o===null?{success:!0,data:o}:o===null?{success:!1,errors:B({},r,[{message:"Expected 'number', got 'null'",typeError:!0}])}:typeof o=="number"?{success:!0,data:o}:{success:!1,errors:B({},r,[{message:"Expected 'number', got '".concat(ie(o),"'"),typeError:!0}])}}},{key:"nullable",value:function(){return new t(this.options,!0)}},{key:"max",value:function(r){return new t(xt(xt({},this.options),{},{max:r}),this.opt)}},{key:"min",value:function(r){return new t(xt(xt({},this.options),{},{min:r}),this.opt)}},{key:"executeSerialize",value:function(){var r;return{type:"number",options:this.options,opt:this.opt,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(){return{}}}])}(eo),G$=function(t){return new K$(t)},q$=function(e){function t(){var n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return Rn(this,t),n=Zr(this,t),n.opt=r,n.customValidateFunctions=o,n}return Qr(t,e),An(t,[{key:"validate",value:function(r){return new t(this.opt,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){return this.opt&&o==null?!1:typeof o!="boolean"?B({},r,[{message:"Expected 'boolean', got '".concat(ie(o),"'"),value:o}]):!1}},{key:"executeAssert",value:function(r,o){return this.opt&&o===null?{success:!0,data:o}:o===null?{success:!1,errors:B({},r,[{message:"Expected 'boolean', got 'null'",typeError:!0}])}:typeof o!="boolean"?{success:!1,errors:B({},r,[{message:"Expected 'boolean', got '".concat(ie(o),"'"),typeError:!0}])}:{success:!0,data:o}}},{key:"nullable",value:function(){return new t(!0)}},{key:"executeSerialize",value:function(){var r;return{type:"boolean",opt:this.opt,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(){return{}}}])}(eo),Y$=function(){return new q$},J$=function(e){function t(n,r){var o,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];return Rn(this,t),o=Zr(this,t),o.schema=n,o.sourcePath=r,o.opt=i,o.customValidateFunctions=s,o}return Qr(t,e),An(t,[{key:"validate",value:function(r){return new t(this.schema,this.sourcePath,this.opt,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r});if(this.opt&&o==null)return i.length>0?B({},r,i):!1;if(!this.schema)return B({},r,[].concat(ge(i),[{message:"Schema not found for module. keyOf must be used with a Val Module"}]));var s=this.schema;if(!(s.type==="object"||s.type==="record"))return B({},r,[].concat(ge(i),[{message:"Schema in keyOf must be an 'object' or 'record'. Found '".concat(s.type||"unknown","'")}]));if(s.opt&&o==null)return!1;if(s.type==="record"&&typeof o!="string")return B({},r,[].concat(ge(i),[{message:"Type of value in keyof (record) must be 'string'"}]));if(s.type==="object"){var a=s.keys;if(!a.includes(o))return B({},r,[].concat(ge(i),[{message:"Value of keyOf (object) must be: ".concat(a.join(", "),". Found: ").concat(o)}]))}return s.type==="record"?typeof o!="string"?B({},r,[].concat(ge(i),[{message:"Value of keyOf (record) must be 'string'. Found: ".concat(ie(o))}])):B({},r,[].concat(ge(i),[{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:o,sourcePath:this.sourcePath}}])):i.length>0?B({},r,i):!1}},{key:"executeAssert",value:function(r,o){if(this.opt&&o===null)return{success:!0,data:o};if(o===null)return{success:!1,errors:B({},r,[{message:"Expected 'string', got 'null'",typeError:!0}])};var i=this.schema;if(!i)return{success:!1,errors:B({},r,[{message:"Neither key nor schema was found. keyOf is missing an argument.",typeError:!0}])};var s=i;if(!(s.type==="object"||s.type==="record"))return{success:!1,errors:B({},r,[{message:"Schema of first argument must be either: 'array', 'object' or 'record'. Found '".concat(s.type||"unknown","'"),typeError:!0}])};if(s.type==="record"&&typeof o!="string")return{success:!1,errors:B({},r,[{message:"Value of keyOf (record) must be 'string', got '".concat(ie(o),"'"),typeError:!0}])};if(s.type==="object"){var a=s.keys;if(!a.includes(o))return{success:!1,errors:B({},r,[{message:"Value of keyOf (object) must be: ".concat(a.join(", "),". Found: ").concat(o),typeError:!0}])}}return{success:!0,data:o}}},{key:"nullable",value:function(){return new t(this.schema,this.sourcePath,!0)}},{key:"executeSerialize",value:function(){var r,o=this.sourcePath;if(!o)throw new Error("Cannot serialize keyOf schema with empty selector. TIP: keyOf must be used with a Val Module of record schema.");var i=this.schema;if(!i)throw new Error("Cannot serialize keyOf schema with empty selector.");var s;switch(i.type){case"record":s="string";break;case"object":s=i.keys;break;default:throw new Error("Cannot serialize keyOf schema with selector of type '".concat(i.type||"unknown","'"))}return{type:"keyOf",path:o,schema:i,opt:this.opt,values:s,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(){return{}}}])}(eo),X$=function(t){var n=t==null?void 0:t[OO],r=void 0;if(n instanceof jl){var o=[];try{o=Object.keys((n==null?void 0:n.items)||{})}catch{}r={type:"object",keys:o,opt:n==null?void 0:n.opt}}else n instanceof Jh&&(r={type:"record",opt:n==null?void 0:n.opt});return new J$(r,RO(t))},Z$=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return Rn(this,t),r=Zr(this,t),r.options=n,r.opt=o,r.customValidateFunctions=i,r}return Qr(t,e),An(t,[{key:"validate",value:function(r){return new t(this.options,this.opt,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i,s,a,l;if(this.opt&&o==null)return!1;if(typeof o!="string")return B({},r,[{message:"Expected 'string', got '".concat(ie(o),"'"),value:o}]);if((i=this.options)!==null&&i!==void 0&&i.from&&(s=this.options)!==null&&s!==void 0&&s.to){if(this.options.from>this.options.to)return B({},r,[{message:"From date ".concat(this.options.from," is after to date ").concat(this.options.to),value:o,typeError:!0}]);if(o<this.options.from||o>this.options.to)return B({},r,[{message:"Date is not between ".concat(this.options.from," and ").concat(this.options.to),value:o}])}else if((a=this.options)!==null&&a!==void 0&&a.from){if(o<this.options.from)return B({},r,[{message:"Date is before the minimum date ".concat(this.options.from),value:o}])}else if((l=this.options)!==null&&l!==void 0&&l.to&&o>this.options.to)return B({},r,[{message:"Date is after the maximum date ".concat(this.options.to),value:o}]);return!1}},{key:"executeAssert",value:function(r,o){return this.opt&&o===null?{success:!0,data:o}:o===null?{success:!1,errors:B({},r,[{message:"Expected 'string', got 'null'",typeError:!0}])}:typeof o!="string"?{success:!1,errors:B({},r,[{message:"Expected 'string', got '".concat(ie(o),"'"),typeError:!0}])}:{success:!0,data:o}}},{key:"from",value:function(r){return new t(xt(xt({},this.options),{},{from:r}),this.opt)}},{key:"to",value:function(r){return new t(xt(xt({},this.options),{},{to:r}),this.opt)}},{key:"nullable",value:function(){return new t(this.options,!0)}},{key:"executeSerialize",value:function(){var r;return{type:"date",opt:this.opt,options:this.options,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(){return{}}}])}(eo),Q$=function(t){return new Z$(t)};function e6(){return{string:AO,boolean:Y$,array:A$,object:IO,number:G$,union:D$,richtext:F$,image:L$,literal:I$,keyOf:X$,record:z$,file:T$,date:Q$}}function t6(e,t){var n=t.publicProjectId,r=t.coreVersion,o=t.validationHash,i=t.fileHash,s=t.filePath,a=t.bucket;return"".concat(e,"/file/p/").concat(n,"/b/").concat(a,"/v/").concat(r,"/h/").concat(o,"/f/").concat(i,"/p/").concat(s)}var n6=/^(https?:\/\/[^/]+)\/file\/p\/([^/]+)\/b\/([^/]+)\/v\/([^/]+)\/h\/([^/]+)\/f\/([^/]+)\/p\/(.+)$/;function HO(e){var t=e.match(n6);return t?t[7].indexOf("public/val/")!==0?{status:"error",error:"Invalid remote ref: "+e}:{status:"success",remoteHost:t[1],projectId:t[2],bucket:t[3],version:t[4],validationHash:t[5],fileHash:t[6],filePath:t[7]}:{status:"error",error:"Invalid remote ref: "+e}}var GC="https://remote.val.build";function r6(e){if(e!=null&&e.patch_id){var t=HO(e[bt]);if(t.status==="success")return{url:"/api/val/files/"+t.filePath+"?patch_id=".concat(e.patch_id,"&remote=true&ref=").concat(encodeURIComponent(e[bt])),metadata:e.metadata};console.warn("Internal Val error: failed to split remote ref: ".concat(e[bt],". The data format is different than what is expected. Check Val versions for mismatches."),t.error)}return{url:e[bt],metadata:e.metadata}}var Hr=An(function e(t){Rn(this,e),this.message=t}),o6=[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],vt=function(e){return e[e.inputBytes=64]="inputBytes",e[e.inputWords=16]="inputWords",e[e.highIndex=14]="highIndex",e[e.lowIndex=15]="lowIndex",e[e.workWords=64]="workWords",e[e.allocBytes=80]="allocBytes",e[e.allocWords=20]="allocWords",e[e.allocTotal=8e3]="allocTotal",e}(vt||{});function i6(e){return new s6}var s6=function(){function e(){Rn(this,e),B(this,"A",1779033703),B(this,"B",-1150833019),B(this,"C",1013904242),B(this,"D",-1521486534),B(this,"E",1359893119),B(this,"F",-1694144372),B(this,"G",528734635),B(this,"H",1541459225),B(this,"_size",0),B(this,"_sp",0),(!Yp||Sd>=vt.allocTotal)&&(Yp=new ArrayBuffer(vt.allocTotal),Sd=0),this._byte=new Uint8Array(Yp,Sd,vt.allocBytes),this._word=new Int32Array(Yp,Sd,vt.allocWords),Sd+=vt.allocBytes}return An(e,[{key:"update",value:function(n){if(typeof n=="string")return this._utf8(n);if(n==null)throw new TypeError("Invalid type: "+ie(n));var r=n.byteOffset,o=n.byteLength,i=o/vt.inputBytes|0,s=0;if(i&&!(r&3)&&!(this._size%vt.inputBytes)){for(var a=new Int32Array(n.buffer,r,i*vt.inputWords);i--;)this._int32(a,s>>2),s+=vt.inputBytes;this._size+=s}var l=n.BYTES_PER_ELEMENT;if(l!==1&&n.buffer){var c=new Uint8Array(n.buffer,r+s,o-s);return this._uint8(c)}return s===o?this:this._uint8(n,s)}},{key:"_uint8",value:function(n,r){var o=this._byte,i=this._word,s=n.length;for(r=r|0;r<s;){for(var a=this._size%vt.inputBytes,l=a;r<s&&l<vt.inputBytes;)o[l++]=n[r++];l>=vt.inputBytes&&this._int32(i),this._size+=l-a}return this}},{key:"_utf8",value:function(n){for(var r=this._byte,o=this._word,i=n.length,s=this._sp,a=0;a<i;){for(var l=this._size%vt.inputBytes,c=l;a<i&&c<vt.inputBytes;){var u=n.charCodeAt(a++)|0;u<128?r[c++]=u:u<2048?(r[c++]=192|u>>>6,r[c++]=128|u&63):u<55296||u>57343?(r[c++]=224|u>>>12,r[c++]=128|u>>>6&63,r[c++]=128|u&63):s?(u=((s&1023)<<10)+(u&1023)+65536,r[c++]=240|u>>>18,r[c++]=128|u>>>12&63,r[c++]=128|u>>>6&63,r[c++]=128|u&63,s=0):s=u}c>=vt.inputBytes&&(this._int32(o),o[0]=o[vt.inputWords]),this._size+=c-l}return this._sp=s,this}},{key:"_int32",value:function(n,r){var o=this.A,i=this.B,s=this.C,a=this.D,l=this.E,c=this.F,u=this.G,f=this.H,h=0;for(r=r|0;h<vt.inputWords;)Ya[h++]=jo(n[r++]);for(h=vt.inputWords;h<vt.workWords;h++)Ya[h]=p6(Ya[h-2])+Ya[h-7]+h6(Ya[h-15])+Ya[h-16]|0;for(h=0;h<vt.workWords;h++){var p=f+f6(l)+c6(l,c,u)+o6[h]+Ya[h]|0,m=d6(o)+u6(o,i,s)|0;f=u,u=c,c=l,l=a+p|0,a=s,s=i,i=o,o=p+m|0}this.A=o+this.A|0,this.B=i+this.B|0,this.C=s+this.C|0,this.D=a+this.D|0,this.E=l+this.E|0,this.F=c+this.F|0,this.G=u+this.G|0,this.H=f+this.H|0}},{key:"digest",value:function(n){var r=this._byte,o=this._word,i=this._size%vt.inputBytes|0;for(r[i++]=128;i&3;)r[i++]=0;if(i>>=2,i>vt.highIndex){for(;i<vt.inputWords;)o[i++]=0;i=0,this._int32(o)}for(;i<vt.inputWords;)o[i++]=0;var s=this._size*8,a=(s&4294967295)>>>0,l=(s-a)/4294967296;return l&&(o[vt.highIndex]=jo(l)),a&&(o[vt.lowIndex]=jo(a)),this._int32(o),n==="hex"?this._hex():this._bin()}},{key:"_hex",value:function(){var n=this.A,r=this.B,o=this.C,i=this.D,s=this.E,a=this.F,l=this.G,c=this.H;return Cs(n)+Cs(r)+Cs(o)+Cs(i)+Cs(s)+Cs(a)+Cs(l)+Cs(c)}},{key:"_bin",value:function(){var n=this.A,r=this.B,o=this.C,i=this.D,s=this.E,a=this.F,l=this.G,c=this.H,u=this._byte,f=this._word;return f[0]=jo(n),f[1]=jo(r),f[2]=jo(o),f[3]=jo(i),f[4]=jo(s),f[5]=jo(a),f[6]=jo(l),f[7]=jo(c),u.slice(0,32)}}])}(),Ya=new Int32Array(vt.workWords),Yp,Sd=0,Cs=function(t){return(t+4294967296).toString(16).substr(-8)},a6=function(t){return t<<24&4278190080|t<<8&16711680|t>>8&65280|t>>24&255},l6=function(t){return t},jo=m6()?l6:a6,c6=function(t,n,r){return r^t&(n^r)},u6=function(t,n,r){return t&n|r&(t|n)},d6=function(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)},f6=function(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)},h6=function(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3},p6=function(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10};function m6(){var e=new Uint8Array(new Uint16Array([65279]).buffer);return e[0]===254}var eS=function(t){return i6().update(t).digest("hex")},tS={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"},KO=Object.fromEntries(Object.entries(tS).map(function(e){var t=jn(e,2),n=t[0],r=t[1];return[r,n]})),g6=/^data:(.*?);base64,/;function v6(e){var t=g6.exec(e);if(t&&t[1])return t[1]}function y6(e){var t=KO[e];return t||e.split("/")[1]}function x6(e){var t=e.split(".").pop(),n=t&&tS[t];if(n)return n}function GO(e,t,n,r,o){var i="".concat((r==null?void 0:r.width)||"").concat((r==null?void 0:r.height)||"").concat(r==null?void 0:r.mimeType),s={type:t.type,opt:t.opt,options:xt({},t.options)};return e+JSON.stringify(s)+n+i+o}function b6(e,t,n,r,o,i){return eS(i.encode(GO(e,t,n,r,o))).slice(0,4)}function qO(e){return e.slice(0,12)}function w6(e){return qO(eS(new Uint8Array(e)))}function S6(e,t){var n=e.startsWith("/")?e.slice(1).split("/"):e.split("/");if(t.length===0)return{isValid:n.length===0||n.length===1&&n[0]==="",expectedPath:"/"};for(var r=0,o=0,i=!1,s=-1,a=0;a<t.length;a++){var l=t[a];l.startsWith("[[")&&l.endsWith("]]")?(i=!0,s=a,o=1/0):l.startsWith("[...")&&l.endsWith("]")?(i=!0,s=a,r++,o=1/0):l.startsWith("[[")&&l.endsWith("]")?o++:(l.startsWith("[")&&l.endsWith("]"),r++,o++)}if(n.length<r||!i&&n.length>o){var c=t.map(function(m){return m.startsWith("[[")&&m.endsWith("]]")?"[optional:".concat(m.slice(2,-2),"]"):m.startsWith("[...")&&m.endsWith("]")?"[...".concat(m.slice(4,-1),"]"):m.startsWith("[[")&&m.endsWith("]")?"[optional:".concat(m.slice(2,-1),"]"):m.startsWith("[")&&m.endsWith("]")?"[".concat(m.slice(1,-1),"]"):m}).join("/");return{isValid:!1,expectedPath:"/".concat(c)}}for(var u=i?s:t.length,f=0;f<u;f++){var h=t[f],p=n[f];if(h.startsWith("[[")&&h.endsWith("]]")){if(p!==""&&p!==void 0&&p==="")return{isValid:!1,expectedPath:"/".concat(t.join("/"))}}else if(h.startsWith("[")&&h.endsWith("]")){if(p===""||p===void 0)return{isValid:!1,expectedPath:"/".concat(t.join("/"))}}else if(h!==p)return{isValid:!1,expectedPath:"/".concat(t.join("/"))}}return{isValid:!0}}var k6={getRouterId:function(){return"next-app-router"},validate:function(t,n){var r=E6(t),o=[],i=vi(n),s;try{for(i.s();!(s=i.n()).done;){var a=s.value,l=S6(a,r);l.isValid||o.push({error:{message:'URL path "'.concat(a,'" does not match the route pattern for "').concat(t,'"'),urlPath:a,expectedPath:l.expectedPath||null}})}}catch(c){i.e(c)}finally{i.f()}return o}};function E6(e){if(!e||typeof e!="string")return[];for(var t=[/\/app\/(.+)\/page\.val\.ts$/,/\/src\/app\/(.+)\/page\.val\.ts$/,/\/app\/(.+)\/page\.tsx?$/,/\/src\/app\/(.+)\/page\.tsx?$/],n=0,r=t;n<r.length;n++){var o=r[n],i=e.match(o);if(i){var s=i[1];return s.split("/").flatMap(function(a){if(a.startsWith("(")&&a.endsWith(")")&&!a.includes("."))return[];var l=a.match(/^(\([.]+\)(\(.+\))?)(.*)$/);if(l){var c=l[3]||l[4];return c?[c]:[]}return[a]})}}return[]}var wa="?p=",YO="https://content.val.build",_b="https://app.val.build",Y={VERSION:{core:function(){try{return require("../package.json").version}catch{return null}}()},convertFileSource:O$,convertRemoteSource:r6,getSchema:KC,getValPath:RO,getSource:$$,resolvePath:B$,safeResolvePath:V$,splitModuleFilePathAndModulePath:Q1,joinModuleFilePathAndModulePath:LO,nextAppRouter:k6,remote:{createRemoteRef:t6,getValidationBasis:GO,getValidationHash:b6,getFileHash:w6,hashToRemoteFileHash:qO,splitRemoteRef:HO},validate:function(t,n,r){var o;return t&&((o=KC(t))===null||o===void 0?void 0:o.executeValidate(n,r))},isVal:M$,isFile:_$,createValPathOfItem:hu,getSHA256Hash:eS,initSchema:e6,getMimeType:v6,mimeTypeToFileExt:y6,filenameToMimeType:x6,EXT_TO_MIME_TYPES:tS,MIME_TYPES_TO_EXT:KO,ModuleFilePathSep:wa,notFileOp:function(t){return t.op!=="file"},isFileOp:function(t){return t.op==="file"&&typeof t.filePath=="string"},createPatchJSONPath:function(t){return"/".concat(t.split(".").map(function(n){return n&&C6(n)}).join("/"))},createPatchPath:function(t){return Zf(t)},splitModulePath:Zf,splitModuleFilePath:U$,splitJoinedSourcePaths:W$,parentOfSourcePath:H$,patchPathToModulePath:WO,VAL_ENABLE_COOKIE_NAME:"val_enable",VAL_STATE_COOKIE:"val_state",VAL_SESSION_COOKIE:"val_session",createFilename:function(t,n,r,o){var i,s;if(!r||!t)return n;var a=o.slice(0,5),l=(i=Y.getMimeType(t))!==null&&i!==void 0?i:"unknown",c=(s=Y.mimeTypeToFileExt(l))!==null&&s!==void 0?s:"unknown";if(n){var u=n.split(".").slice(0,-1).join(".")||n,f=u.lastIndexOf("_"),h=u.slice(f+1,u.length);h===a&&(u=u.slice(0,f));var p=encodeURIComponent(u).replace(/%[0-9A-Fa-f]{2}/g,"").toLowerCase();return"".concat(p,"_").concat(a,".").concat(c)}return"".concat(o,".").concat(c)}};function C6(e){try{return JSON.parse(e)}catch{return e}}var qv={},Yv={};Yv.byteLength=_6;Yv.toByteArray=T6;Yv.fromByteArray=R6;var hi=[],ro=[],N6=typeof Uint8Array<"u"?Uint8Array:Array,Px="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var lc=0,P6=Px.length;lc<P6;++lc)hi[lc]=Px[lc],ro[Px.charCodeAt(lc)]=lc;ro[45]=62;ro[95]=63;function JO(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function _6(e){var t=JO(e),n=t[0],r=t[1];return(n+r)*3/4-r}function j6(e,t,n){return(t+n)*3/4-n}function T6(e){var t,n=JO(e),r=n[0],o=n[1],i=new N6(j6(e,r,o)),s=0,a=o>0?r-4:r,l;for(l=0;l<a;l+=4)t=ro[e.charCodeAt(l)]<<18|ro[e.charCodeAt(l+1)]<<12|ro[e.charCodeAt(l+2)]<<6|ro[e.charCodeAt(l+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return o===2&&(t=ro[e.charCodeAt(l)]<<2|ro[e.charCodeAt(l+1)]>>4,i[s++]=t&255),o===1&&(t=ro[e.charCodeAt(l)]<<10|ro[e.charCodeAt(l+1)]<<4|ro[e.charCodeAt(l+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}function O6(e){return hi[e>>18&63]+hi[e>>12&63]+hi[e>>6&63]+hi[e&63]}function M6(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),o.push(O6(r));return o.join("")}function R6(e){for(var t,n=e.length,r=n%3,o=[],i=16383,s=0,a=n-r;s<a;s+=i)o.push(M6(e,s,s+i>a?a:s+i));return r===1?(t=e[n-1],o.push(hi[t>>2]+hi[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(hi[t>>10]+hi[t>>4&63]+hi[t<<2&63]+"=")),o.join("")}var nS={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */nS.read=function(e,t,n,r,o){var i,s,a=o*8-r-1,l=(1<<a)-1,c=l>>1,u=-7,f=n?o-1:0,h=n?-1:1,p=e[t+f];for(f+=h,i=p&(1<<-u)-1,p>>=-u,u+=a;u>0;i=i*256+e[t+f],f+=h,u-=8);for(s=i&(1<<-u)-1,i>>=-u,u+=r;u>0;s=s*256+e[t+f],f+=h,u-=8);if(i===0)i=1-c;else{if(i===l)return s?NaN:(p?-1:1)*(1/0);s=s+Math.pow(2,r),i=i-c}return(p?-1:1)*s*Math.pow(2,i-r)};nS.write=function(e,t,n,r,o,i){var s,a,l,c=i*8-o-1,u=(1<<c)-1,f=u>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,m=r?1:-1,v=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+f>=1?t+=h/l:t+=h*Math.pow(2,1-f),t*l>=2&&(s++,l/=2),s+f>=u?(a=0,s=u):s+f>=1?(a=(t*l-1)*Math.pow(2,o),s=s+f):(a=t*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;e[n+p]=a&255,p+=m,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;e[n+p]=s&255,p+=m,s/=256,c-=8);e[n+p-m]|=v*128};/*!
43
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ge(e){return b$(e)||w$(e)||Y1(e)||S$()}function ie(e){"@babel/helpers - typeof";return ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ie(e)}function k$(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jO(e){var t=k$(e,"string");return typeof t=="symbol"?t:t+""}function B(e,t,n){return(t=jO(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function xt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HC(Object(n),!0).forEach(function(r){B(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E$(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,jO(r.key),r)}}function An(e,t,n){return t&&E$(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xg(e){return xg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xg(e)}function TO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(TO=function(){return!!e})()}function C$(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N$(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return C$(e)}function Zr(e,t,n){return t=xg(t),N$(e,TO()?Reflect.construct(t,[],xg(e).constructor):t.apply(e,n))}function Nb(e,t){return Nb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Nb(e,t)}function Qr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nb(e,t)}var eo=function(){function e(){Rn(this,e)}return An(e,[{key:"executeCustomValidateFunctions",value:function(n,r,o){var i=[],s=vi(r),a;try{for(s.s();!(a=s.n()).done;){var l=a.value;try{var c=l(n,o);c&&i.push({message:c,value:n})}catch(u){i.push({message:"Error in custom validate function: ".concat(u instanceof Error?u.message:String(u)),value:n,schemaError:!0})}}}catch(u){s.e(u)}finally{s.f()}return i}},{key:"appendValidationError",value:function(n,r,o,i,s){return n?(n[r]?n[r].push({message:o,value:i,schemaError:s}):n[r]=[{message:o,value:i,schemaError:s}],n):B({},r,[{message:o,value:i,schemaError:s}])}}])}(),OO=Symbol("GetSchema"),MO=Symbol("Path"),P$=Symbol("GetSource");function KC(e){return e[OO]}var Le="_type",bt="_ref",Pb="_tag";function _$(e){return ie(e)==="object"&&e!==null&&Le in e&&e[Le]==="file"&&bt in e&&typeof e[bt]=="string"}var j$=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];return Rn(this,t),r=Zr(this,t),r.options=n,r.opt=o,r.isRemote=i,r.customValidateFunctions=s,r}return Qr(t,e),An(t,[{key:"remote",value:function(){return new t(this.options,this.opt,!0)}},{key:"validate",value:function(r){return new t(this.options,this.opt,this.isRemote,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r});if(this.opt&&o==null)return i.length>0?B({},r,i):!1;if(o==null)return B({},r,[].concat(ge(i),[{message:"Non-optional file was null or undefined.",value:o}]));if(typeof o[bt]!="string")return B({},r,[].concat(ge(i),[{message:"File did not have a file reference string. Got: ".concat(ie(o[bt])),value:o}]));if(this.isRemote&&o[Le]!=="remote")return B({},r,[].concat(ge(i),[{message:"Expected a remote file, but got a local file.",value:o,fixes:["file:upload-remote"]}]));if(this.isRemote&&o[Le]==="remote")return B({},r,[].concat(ge(i),[{message:"Remote file was not checked.",value:o,fixes:["file:check-remote"]}]));if(!this.isRemote&&o[Le]==="remote")return B({},r,[].concat(ge(i),[{message:"Expected locale file, but found remote.",value:o,fixes:["file:download-remote"]}]));if(o[Le]!=="file")return B({},r,[].concat(ge(i),[{message:"File did not have the valid file extension type. Got: ".concat(o[Le]),value:o,fixes:["file:change-extension","file:check-metadata"]}]));var s=this.options||{},a=s.accept,l=o.metadata||{},c=l.mimeType;if(a&&c&&!c.includes("/"))return B({},r,[].concat(ge(i),[{message:"Invalid mime type format. Got: ".concat(c),value:o,fixes:["file:change-extension","file:check-metadata"]}]));if(a&&c&&c.includes("/")){var u=a.split(",").map(function(p){return p.trim()}),f=u.some(function(p){if(p==="*/*")return!0;if(p.endsWith("/*")){var m=p.slice(0,-2);return c.startsWith(m)}return p===c});if(!f)return B({},r,[].concat(ge(i),[{message:"Mime type mismatch. Found '".concat(c,"' but schema accepts '").concat(a,"'"),value:o,fixes:["file:change-extension","file:check-metadata"]}]))}var h=Y.filenameToMimeType(o[bt]);return h?h!==c?B({},r,[].concat(ge(i),[{message:"Mime type and file extension not matching. Mime type is '".concat(c,"' but file extension is '").concat(h,"'"),value:o,fixes:["file:change-extension","file:check-metadata"]}])):o.metadata?B({},r,[].concat(ge(i),[{message:"Found metadata, but it could not be validated. File metadata must be an object with the mimeType.",value:o,fixes:["file:check-metadata"]}])):B({},r,[].concat(ge(i),[{message:"Missing File metadata.",value:o,fixes:["file:add-metadata"]}])):B({},r,[].concat(ge(i),[{message:"Could not determine mime type from file extension. Got: ".concat(o[bt]),value:o,fixes:["file:change-extension","file:check-metadata"]}]))}},{key:"executeAssert",value:function(r,o){return this.opt&&o===null?{success:!0,data:o}:o===null?{success:!1,errors:B({},r,[{message:"Expected 'object', got 'null'",typeError:!0}])}:ie(o)!=="object"?{success:!1,errors:B({},r,[{message:"Expected object, got '".concat(ie(o),"'"),typeError:!0}])}:bt in o?Le in o&&o[Le]==="file"?{success:!0,data:o}:{success:!1,errors:B({},r,[{message:"Value of this schema must use: 'c.file' (error type: missing_file_extension)",typeError:!0}])}:{success:!1,errors:B({},r,[{message:"Value of this schema must use: 'c.file' (error type: missing_ref_prop)",typeError:!0}])}}},{key:"nullable",value:function(){return new t(this.options,!0)}},{key:"executeSerialize",value:function(){var r;return{type:"file",options:this.options,opt:this.opt,remote:this.isRemote,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(){return{}}}])}(eo),T$=function(t){return new j$(t)};function O$(e){return e[bt].startsWith("/public")?e.patch_id?{url:"/api/val/files"+e[bt]+"?patch_id=".concat(e.patch_id),metadata:e.metadata}:{url:e[bt].slice(7),metadata:e.metadata}:{url:e[bt]+(e.patch_id?"?patch_id=".concat(e.patch_id):""),metadata:e.metadata}}function M$(e){return ie(e)==="object"&&e!==null&&e!==void 0&&MO in e&&"val"in e}function RO(e){return e[MO]}function hu(e,t){if(ie(t)==="symbol")throw Error("Cannot create val path of array item with symbol prop: ".concat(t.toString()));if(e)return e.includes(Y.ModuleFilePathSep)?"".concat(e,".").concat(JSON.stringify(t)):"".concat(e).concat(Y.ModuleFilePathSep).concat(JSON.stringify(t))}function Mr(e,t){if(ie(t)==="symbol")throw Error("Cannot create val path of array item with symbol prop: ".concat(t.toString()));if(!e)throw Error("Cannot create val path of array item of empty or missing path: ".concat(e,". Item: ").concat(t));return e.includes(Y.ModuleFilePathSep)?"".concat(e,".").concat(JSON.stringify(t)):"".concat(e).concat(Y.ModuleFilePathSep).concat(JSON.stringify(t))}var R$=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];return Rn(this,t),r=Zr(this,t),r.options=n,r.opt=o,r.isRaw=i,r.customValidateFunctions=s,r}return Qr(t,e),An(t,[{key:"min",value:function(r){return this.minLength(r)}},{key:"minLength",value:function(r){return new t(xt(xt({},this.options),{},{minLength:r}),this.opt,this.isRaw)}},{key:"max",value:function(r){return this.maxLength(r)}},{key:"maxLength",value:function(r){return new t(xt(xt({},this.options),{},{maxLength:r}),this.opt,this.isRaw)}},{key:"regexp",value:function(r,o){return new t(xt(xt({},this.options),{},{regexp:r,regExpMessage:o}),this.opt,this.isRaw)}},{key:"validate",value:function(r){return new t(this.options,this.opt,this.isRaw,this.customValidateFunctions.concat(r))}},{key:"executeValidate",value:function(r,o){var i,s,a,l=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r});return this.opt&&o==null?l.length>0?B({},r,l):!1:typeof o!="string"?B({},r,[{message:"Expected 'string', got '".concat(ie(o),"'"),value:o}]):((i=this.options)!==null&&i!==void 0&&i.maxLength&&o.length>this.options.maxLength&&l.push({message:"Expected string to be at most ".concat(this.options.maxLength," characters long, got ").concat(o.length),value:o}),(s=this.options)!==null&&s!==void 0&&s.minLength&&o.length<this.options.minLength&&l.push({message:"Expected string to be at least ".concat(this.options.minLength," characters long, got ").concat(o.length),value:o}),(a=this.options)!==null&&a!==void 0&&a.regexp&&!this.options.regexp.test(o)&&l.push({message:this.options.regExpMessage||"Expected string to match reg exp: ".concat(this.options.regexp.toString(),", got '").concat(o,"'"),value:o}),l.length>0?B({},r,l):!1)}},{key:"executeAssert",value:function(r,o){return this.opt&&o===null?{success:!0,data:o}:typeof o=="string"?{success:!0,data:o}:{success:!1,errors:B({},r,[{message:"Expected 'string', got '".concat(ie(o),"'"),typeError:!0}])}}},{key:"nullable",value:function(){return new t(this.options,!0,this.isRaw)}},{key:"raw",value:function(){return new t(this.options,this.opt,!0)}},{key:"executeSerialize",value:function(){var r,o,i,s,a;return{type:"string",options:{maxLength:(r=this.options)===null||r===void 0?void 0:r.maxLength,minLength:(o=this.options)===null||o===void 0?void 0:o.minLength,regexp:((i=this.options)===null||i===void 0?void 0:i.regexp)&&{message:this.options.regExpMessage,source:this.options.regexp.source,flags:this.options.regexp.flags},customValidate:this.customValidateFunctions&&((s=this.customValidateFunctions)===null||s===void 0?void 0:s.length)>0},opt:this.opt,raw:this.isRaw,customValidate:this.customValidateFunctions&&((a=this.customValidateFunctions)===null||a===void 0?void 0:a.length)>0}}},{key:"executeRender",value:function(){return{}}}])}(eo),AO=function(t){return new R$(t)},jl=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return Rn(this,t),r=Zr(this,t),r.items=n,r.opt=o,r.customValidateFunctions=i,r}return Qr(t,e),An(t,[{key:"validate",value:function(r){return new t(this.items,this.opt,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i=!1,s=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r});if(this.opt&&o==null)return s.length>0?B({},r,s):!1;if(o===null)return B({},r,[{message:"Expected 'object', got 'null'"}]);if(ie(o)!=="object")return B({},r,[{message:"Expected 'object', got '".concat(ie(o),"'")}]);if(Array.isArray(o))return B({},r,[{message:"Expected 'object', got 'array'"}]);var a=vi(s),l;try{for(a.s();!(l=a.n()).done;){var c=l.value;i=this.appendValidationError(i,r,c.message,o,c.schemaError)}}catch(b){a.e(b)}finally{a.f()}for(var u=0,f=Object.entries(this.items);u<f.length;u++){var h=jn(f[u],2),p=h[0],m=h[1],v=hu(r,p);if(!v)i=this.appendValidationError(i,r,"Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(p),o);else{var x=m.executeValidate(v,o[p]);x&&i?i=xt(xt({},x),i):x&&(i=x)}}return i}},{key:"executeAssert",value:function(r,o){if(this.opt&&o===null)return{success:!0,data:o};if(o===null)return{success:!1,errors:B({},r,[{message:"Expected 'object', got 'null'",typeError:!0}])};if(ie(o)!=="object")return{success:!1,errors:B({},r,[{message:"Expected 'object', got '".concat(ie(o),"'"),typeError:!0}])};if(Array.isArray(o))return{success:!1,errors:B({},r,[{message:"Expected 'object', got 'array'",typeError:!0}])};for(var i=[],s=0,a=Object.keys(this.items);s<a.length;s++){var l=a[s],c=hu(r,l);c?l in o||i.push({message:"Expected key '".concat(l,"' not found in object"),typeError:!0}):i.push({message:"Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(l),internalError:!0})}return i.length>0?{success:!1,errors:B({},r,i)}:{success:!0,data:o}}},{key:"nullable",value:function(){return new t(this.items,!0)}},{key:"executeSerialize",value:function(){var r;return{type:"object",items:Object.fromEntries(Object.entries(this.items).map(function(o){var i=jn(o,2),s=i[0],a=i[1];return[s,a.executeSerialize()]})),opt:this.opt,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(r,o){var i={};if(o===null)return i;for(var s in this.items){var a=o[s];if(a!=null){var l=Mr(r,s),c=this.items[s].executeRender(l,a);for(var u in c){var f=u;i[f]=c[f]}}}return i}}])}(eo),IO=function(t){return new jl(t)};IO({get test(){return AO()}});var Kv=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return Rn(this,t),r=Zr(this,t),B(r,"renderInput",null),r.item=n,r.opt=o,r.customValidateFunctions=i,r}return Qr(t,e),An(t,[{key:"validate",value:function(r){return new t(this.item,this.opt,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i=this.executeAssert(r,o);if(!i.success)return i.errors;if(i.data===null)return!1;for(var s={},a=0,l=Object.entries(i.data);a<l.length;a++){var c=jn(l[a],2),u=c[0],f=c[1],h=Mr(r,Number(u)),p=this.item.executeValidate(h,f);p&&(s=xt(xt({},p),s))}return Object.keys(s).length===0?!1:s}},{key:"executeAssert",value:function(r,o){return o===null&&this.opt?{success:!0,data:o}:o===null?{success:!1,errors:B({},r,[{message:"Expected 'array', got 'null'",typeError:!0}])}:ie(o)!=="object"?{success:!1,errors:B({},r,[{message:"Expected 'object', got '".concat(ie(o),"'"),typeError:!0}])}:Array.isArray(o)?{success:!0,data:o}:{success:!1,errors:B({},r,[{message:"Expected object of type 'array'",typeError:!0}])}}},{key:"nullable",value:function(){return new t(this.item,!0)}},{key:"executeSerialize",value:function(){var r;return{type:"array",item:this.item.executeSerialize(),opt:this.opt,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(r,o){var i={};if(o===null)return i;for(var s=0;s<o.length;s++){var a=s,l=o[a];if(l!=null){var c=Mr(r,a),u=this.item.executeRender(c,l);for(var f in u){var h=f;i[h]=u[h]}}}if(this.renderInput){var p=this.renderInput,m=p.select,v=p.layout;v!=="list"&&(i[r]={status:"error",message:"Unknown layout type: "+v});try{i[r]={status:"success",data:{layout:"list",parent:"array",items:o.map(function(x){var b=m({val:x}),w=b.title,S=b.subtitle,C=b.image;return{title:w,subtitle:S,image:C}})}}}catch(x){i[r]={status:"error",message:x instanceof Error?x.message:"Unknown error"}}}return i}},{key:"render",value:function(r){return this.renderInput=r,this}}])}(eo),A$=function(t){return new Kv(t)},Za=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return Rn(this,t),r=Zr(this,t),r.value=n,r.opt=o,r.customValidateFunctions=i,r}return Qr(t,e),An(t,[{key:"validate",value:function(r){return new t(this.value,this.opt,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r});return this.opt&&o==null?i.length>0?B({},r,i):!1:typeof o!="string"?B({},r,[].concat(ge(i),[{message:"Expected 'string', got '".concat(ie(o),"'"),value:o}])):o!==this.value?B({},r,[].concat(ge(i),[{message:"Expected literal '".concat(this.value,"', got '").concat(o,"'"),value:o}])):i.length>0?B({},r,i):!1}},{key:"executeAssert",value:function(r,o){return this.opt&&o===null?{success:!0,data:o}:o===null?{success:!1,errors:B({},r,[{message:"Expected 'string', got 'null'",typeError:!0}])}:typeof o=="string"&&o===this.value?{success:!0,data:o}:{success:!1,errors:B({},r,[{message:"Expected literal '".concat(this.value,"', got '").concat(o,"'"),typeError:!0}])}}},{key:"nullable",value:function(){return new t(this.value,!0)}},{key:"executeSerialize",value:function(){var r;return{type:"literal",value:this.value,opt:this.opt,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(){return{}}}])}(eo),I$=function(t){return new Za(t)},DO=function(e){function t(n,r){var o,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];return Rn(this,t),o=Zr(this,t),o.key=n,o.items=r,o.opt=i,o.customValidateFunctions=s,o}return Qr(t,e),An(t,[{key:"validate",value:function(r){return new t(this.key,this.items,this.opt,this.customValidateFunctions.concat(r))}},{key:"executeValidate",value:function(r,o){var i=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r}),s=o;if(this.opt&&s===null)return i.length>0?B({},r,i):!1;if(!this.key)return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"Missing required first argument in union",schemaError:!0}]));var a=this.key;if(!Array.isArray(this.items))return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"A union schema must take more than 1 schema arguments",schemaError:!0}]));if(typeof a=="string"){if(this.items.some(function(O){return!(O instanceof jl)}))return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"Key is a string, so all schema items must be objects",schemaError:!0}]));var l=this.items,c=l.map(function(O){return O.executeSerialize()}),u=c.filter(function(O){return O.type!=="object"||O.items[a].type!=="literal"});if(u.length>0)return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"All schema items must be objects with a key: ".concat(a," that is a literal schema. Found: ").concat(JSON.stringify(u,null,2)),schemaError:!0}]));var f=c,h=f.filter(function(O){return O.items[a].opt});if(h.length>1)return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"Schema cannot have an optional keys: ".concat(a),schemaError:!0}]));if(ie(s)!=="object")return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"Expected an object",typeError:!0}]));var p=s;if(p[a]===void 0)return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"Missing required key: ".concat(a),typeError:!0}]));var m=[],v=vi(f),x;try{for(v.s();!(x=v.n()).done;){var b=x.value,w=b.items[a];if(w.type==="literal")if(!m.includes(w.value))m.push(w.value);else return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"Found duplicate key in schema: ".concat(w.value),schemaError:!0}]))}}catch(O){v.e(O)}finally{v.f()}var S=l.find(function(O){return!O.items[a].executeValidate(r,p[a])});if(!S){var C=hu(r,a);if(!C)throw new Error("Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(a));return B({},C,[{message:'Invalid key: "'.concat(a,'". Value was: "').concat(p[a],'". Valid values: ').concat(f.map(function(O){var M=O.items[a];if(M.type==="literal"&&M.value)return'"'.concat(M.value,'"');throw new Error("Expected literal schema, got ".concat(JSON.stringify(M,null,2)))}).join(", "))}])}var N=S.executeValidate(r,p);if(N)return N}else if(a instanceof Za){if(this.items.some(function(O){return!(O instanceof Za)}))return B({},r,[{message:"Key is a literal schema, so all schema items must be literals",typeError:!0}]);var P=[a].concat(ge(this.items));if(typeof s=="string"){var _=P.some(function(O){return!O.executeValidate(r,s)});if(!_)return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"Union must match one of the following: ".concat(P.map(function(O){return'"'.concat(O.value,'"')}).join(", "))}]))}}else return i.length>0?B({},r,i):B({},r,[].concat(ge(i),[{message:"Expected a string or literal"}]));return i.length>0?B({},r,i):!1}},{key:"executeAssert",value:function(r,o){if(this.opt&&o===null)return{success:!0,data:o};if(o===null)return{success:!1,errors:B({},r,[{message:"Expected 'object', got 'null'",typeError:!0}])};if(!this.key)return{success:!1,errors:B({},r,[{message:"Missing required first argument in union schema",schemaError:!0}])};if(!Array.isArray(this.items))return{success:!1,errors:B({},r,[{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 Za){var i,s=!1,a={},l=vi((i=[this.key]).concat.apply(i,ge(this.items))),c;try{for(l.s();!(c=l.n()).done;){var u=c.value;if(!(u instanceof Za))return{success:!1,errors:B({},r,[{message:"Schema of value is a union of string, so all schema items must be literals",schemaError:!0}])};if(typeof o!="string"){a[r]=[{message:"Expected 'string', got '".concat(ie(o),"'"),typeError:!0}];continue}var f=u.executeAssert(r,o);if(f.success){s=!0;break}else for(var h=0,p=Object.entries(f.errors);h<p.length;h++){var m,v=jn(p[h],2),x=v[0],b=v[1];a[x]||(a[x]=[]),(m=a[x]).push.apply(m,ge(b))}}}catch(H){l.e(H)}finally{l.f()}return s?{success:!0,data:o}:{success:!1,errors:a}}else if(typeof this.key=="string"){var w=!1,S={},C=vi(this.items),N;try{for(C.s();!(N=C.n()).done;){var P=N.value,_=P.executeAssert(r,o);if(_.success){w=!0;break}else for(var O=0,M=Object.entries(_.errors);O<M.length;O++){var D,U=jn(M[O],2),z=U[0],K=U[1];S[z]||(S[z]=[]),(D=S[z]).push.apply(D,ge(K))}}}catch(H){C.e(H)}finally{C.f()}return w?{success:!0,data:o}:{success:!1,errors:S}}else return{success:!1,errors:B({},r,[{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 t(this.key,this.items,!0)}},{key:"executeSerialize",value:function(){var r;if(typeof this.key=="string"){var o;return{type:"union",key:this.key,items:this.items.map(function(i){return i.executeSerialize()}),opt:this.opt,customValidate:this.customValidateFunctions&&((o=this.customValidateFunctions)===null||o===void 0?void 0:o.length)>0}}return{type:"union",key:this.key.executeSerialize(),items:this.items.map(function(i){return i.executeSerialize()}),opt:this.opt,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(r,o){var i={};if(o===null||this.key instanceof Za)return i;var s=this.key;if(typeof s=="string"){var a=this.items.find(function(f){if(f instanceof jl){var h=f.items[s];if(h instanceof Za)return ie(o)==="object"&&s in o&&h.value===o[s]}return!1});if(a){var l=a.executeRender(r,o);for(var c in l){var u=c;i[u]=l[u]}return i}i[r]={status:"error",message:"Could not find a matching (object) schema for the union key: ".concat(s)}}return i[r]={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(s,null,2),"'")},i}}])}(eo),D$=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return new DO(t,r)},Z1=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];return Rn(this,t),r=Zr(this,t),r.options=n,r.opt=o,r.isRemote=i,r.customValidateFunctions=s,r}return Qr(t,e),An(t,[{key:"remote",value:function(){return new t(this.options,this.opt,!0)}},{key:"validate",value:function(r){return new t(this.options,this.opt,this.isRemote,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r});if(this.opt&&o==null)return i.length>0?B({},r,i):!1;if(o==null)return B({},r,[].concat(ge(i),[{message:"Non-optional image was null or undefined.",value:o}]));if(this.isRemote&&o[Le]!=="remote")return B({},r,[].concat(ge(i),[{message:"Expected a remote image, but got a local image.",value:o,fixes:["image:upload-remote"]}]));if(this.isRemote&&o[Le]==="remote")return B({},r,[].concat(ge(i),[{message:"Remote image was not checked.",value:o,fixes:["image:check-remote"]}]));if(!this.isRemote&&o[Le]==="remote")return B({},r,[].concat(ge(i),[{message:"Expected locale image, but found remote.",value:o,fixes:["image:download-remote"]}]));if(typeof o[bt]!="string")return B({},r,[].concat(ge(i),[{message:"Image did not have a file reference string. Got: ".concat(ie(o[bt])),value:o}]));if(o[Le]!=="file")return B({},r,[].concat(ge(i),[{message:"Image did not have the valid file extension type. Got: ".concat(o[Le]),value:o,fixes:["image:change-extension","image:check-metadata"]}]));var s=this.options||{},a=s.accept,l=o.metadata||{},c=l.mimeType;if(a&&c&&!c.includes("/"))return B({},r,[].concat(ge(i),[{message:"Invalid mime type format. Got: '".concat(c,"'"),value:o,fixes:["image:check-metadata"]}]));if(a&&c&&c.includes("/")){var u=a.split(",").map(function(p){return p.trim()}),f=u.some(function(p){if(p==="*/*")return!0;if(p.endsWith("/*")){var m=p.slice(0,-2);return c.startsWith(m)}return p===c});if(!f)return B({},r,[].concat(ge(i),[{message:"Mime type mismatch. Found '".concat(c,"' but schema accepts '").concat(a,"'"),value:o,fixes:["image:check-metadata"]}]))}var h=Y.filenameToMimeType(o[bt]);return h?h&&c&&h!==c?B({},r,[].concat(ge(i),[{message:"Mime type and file extension not matching. Mime type is '".concat(c,"' but file extension is '").concat(h,"'"),value:o,fixes:["image:check-metadata"]}])):o.metadata?o.metadata.hotspot&&(ie(o.metadata.hotspot)!=="object"||typeof o.metadata.hotspot.x!="number"||typeof o.metadata.hotspot.y!="number")?B({},r,[].concat(ge(i),[{message:"Hotspot must be an object with x and y as numbers.",value:o}])):B({},r,[].concat(ge(i),[{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:o,fixes:["image:check-metadata"]}])):B({},r,[].concat(ge(i),[{message:"Could not validate Image metadata.",value:o,fixes:["image:add-metadata"]}])):B({},r,[].concat(ge(i),[{message:"Could not determine mime type from file extension. Got: ".concat(o[bt]),value:o,fixes:["image:check-metadata"]}]))}},{key:"executeAssert",value:function(r,o){return this.opt&&o===null?{success:!0,data:o}:o===null?{success:!1,errors:B({},r,[{message:"Expected 'object', got 'null'",typeError:!0}])}:ie(o)!=="object"?{success:!1,errors:B({},r,[{message:"Expected 'object', got '".concat(ie(o),"'"),typeError:!0}])}:bt in o?Le in o&&o[Le]==="file"?{success:!0,data:o}:{success:!1,errors:B({},r,[{message:"Value of this schema must use: 'c.image' (error type: missing_file_extension)",typeError:!0}])}:{success:!1,errors:B({},r,[{message:"Value of this schema must use: 'c.image' (error type: missing_ref_prop)",typeError:!0}])}}},{key:"nullable",value:function(){return new t(this.options,!0,this.isRemote)}},{key:"executeSerialize",value:function(){var r;return{type:"image",options:this.options,opt:this.opt,remote:this.isRemote,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(){return{}}}])}(eo),L$=function(t){return new Z1(t)},Gv=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return Rn(this,t),r=Zr(this,t),r.options=n,r.opt=o,r.customValidateFunctions=i,r}return Qr(t,e),An(t,[{key:"maxLength",value:function(r){return new t(xt(xt({},this.options),{},{maxLength:r}),this.opt)}},{key:"minLength",value:function(r){return new t(xt(xt({},this.options),{},{minLength:r}),this.opt)}},{key:"validate",value:function(r){return new t(this.options,this.opt,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r}),s=this.executeAssert(r,o);if(!s.success)return i.length>0?B({},r,i):s.errors;var a=s.data;if(a===null&&this.opt)return i.length>0?B({},r,i):!1;if(a===null)return B({},r,[].concat(ge(i),[{message:"Expected 'array', got 'null'",typeError:!0}]));var l={},c=this.internalValidate(r,a,l);return c?i.length>0?xt(B({},r,i),c):c:Object.keys(l).length>0?i.length>0?xt(B({},r,i),l):l:i.length>0?B({},r,i):!1}},{key:"internalValidate",value:function(r,o,i){var s=this,a=0,l=function(m,v,x){var b=function(R,F,J){x[R]||(x[R]=[]),x[R].push({message:F,typeError:J})},w=vi(v),S;try{for(w.s();!(S=w.n()).done;){var C,N,P,_,O,M,D,U,z,K,H,V=S.value,I=Mr(m,v.indexOf(V));if(typeof V=="string"){a+=V.length;continue}if(ie(V)!=="object")return B({},I,[{message:"Expected nodes of type 'object' or 'string', got '".concat(ie(V),"'"),typeError:!0}]);if(V===null)return B({},I,[{message:"Expected nodes of type 'object' or 'string', got 'null'",typeError:!0}]);if(!("tag"in V))return B({},I,[{message:"Expected node to either have 'tag' or be of type 'string'",typeError:!0}]);if(typeof V.tag!="string")return B({},I,[{message:"Expected 'string', got '".concat(ie(V.tag),"'"),typeError:!0}]);if(V.tag==="h1"&&!((C=s.options.block)!==null&&C!==void 0&&C.h1)&&b(I,"'h' block is not valid",!1),V.tag==="h2"&&!((N=s.options.block)!==null&&N!==void 0&&N.h2)&&b(I,"'h2' block is not valid",!1),V.tag==="h3"&&!((P=s.options.block)!==null&&P!==void 0&&P.h3)&&b(I,"'h3' block is not valid",!1),V.tag==="h4"&&!((_=s.options.block)!==null&&_!==void 0&&_.h4)&&b(I,"'h4' block is not valid",!1),V.tag==="h5"&&!((O=s.options.block)!==null&&O!==void 0&&O.h5)&&b(I,"'h5' block is not valid",!1),V.tag==="h6"&&!((M=s.options.block)!==null&&M!==void 0&&M.h6)&&b(I,"'h6' block is not valid",!1),V.tag==="ol"&&!((D=s.options.block)!==null&&D!==void 0&&D.ol)&&b(I,"'ol' block is not valid",!1),V.tag==="ul"&&!((U=s.options.block)!==null&&U!==void 0&&U.ul)&&b(I,"'ul' block is not valid",!1),V.tag==="li"&&!((z=s.options.block)!==null&&z!==void 0&&z.ul)&&!((K=s.options.block)!==null&&K!==void 0&&K.ol)&&b(I,"'li' tag is invalid since neither 'ul' nor 'ol' block is not valid",!1),V.tag==="a"&&!((H=s.options.inline)!==null&&H!==void 0&&H.a)&&b(I,"'a' inline is not valid",!1),V.tag==="img"){var A,j;if(!((A=s.options.inline)!==null&&A!==void 0&&A.img))b(I,"'img' inline is not valid",!1);else if((j=s.options.inline)!==null&&j!==void 0&&j.img){var L,$;if(!("src"in V))return B({},I,[{message:"Expected 'src' in 'img'",typeError:!0}]);var W=Mr(I,"src"),G=ie((L=s.options.inline)===null||L===void 0?void 0:L.img)==="object"?($=s.options.inline)===null||$===void 0?void 0:$.img.executeValidate(W,V.src):new Z1({},!1,!1).executeValidate(W,V.src);if(G)for(var Pe in G){var ke,oe=Pe;x[oe]||(x[oe]=[]),(ke=x[oe]).push.apply(ke,ge(G[oe]))}}}if("styles"in V&&V.tag!=="span")return B({},I,[{message:"Cannot have styles on '".concat(V.tag,"'. This is only allowed on 'span'"),typeError:!0}]);if("styles"in V){if(!Array.isArray(V.styles))return B({},I,[{message:"Expected 'array', got '".concat(ie(V.styles),"'"),typeError:!0}]);for(var ae=Mr(I,"styles"),X=0;X<V.styles.length;X++){var Ee,De,he,Fe=V.styles[X],_e=Mr(ae,X);if(typeof Fe!="string")return B({},_e,[{message:"Expected 'string', got '".concat(ie(Fe),"'"),typeError:!0}]);Fe==="bold"&&!((Ee=s.options.style)!==null&&Ee!==void 0&&Ee.bold)&&b(_e,"Style 'bold' is not valid",!1),Fe==="italic"&&!((De=s.options.style)!==null&&De!==void 0&&De.italic)&&b(_e,"Style 'italic' is not valid",!1),Fe==="lineThrough"&&!((he=s.options.style)!==null&&he!==void 0&&he.lineThrough)&&b(_e,"Style 'lineThrough' is not valid",!1)}}if("children"in V){if(!Array.isArray(V.children))return B({},I,[{message:"Expected 'array', got '".concat(ie(V.children),"'"),typeError:!0}]);for(var tt=V.children,gt=0;gt<tt.length;gt++){var Kt=tt[gt];if(ie(Kt)==="object"){var T=Mr(I,"children"),k=l(T,[Kt],x);if(k)return k}else if(typeof Kt=="string"){a+=Kt.length;continue}else return B({},I,[{message:"Expected 'object' or 'string', got '".concat(ie(Kt),"'"),typeError:!0}])}}}}catch(E){w.e(E)}finally{w.f()}return!1},c=l(r,o,i),u=[];if(this.options.maxLength&&a>this.options.maxLength&&u.push({message:"Maximum length of ".concat(this.options.maxLength," exceeded (current length: ").concat(a,")"),typeError:!1}),this.options.minLength&&a<this.options.minLength&&u.push({message:"Minimum length of ".concat(this.options.minLength," not met (current length: ").concat(a,")"),typeError:!1}),c){if(u.length>0){var f;c[r]||(c[r]=[]),(f=c[r]).push.apply(f,u)}return c}if(Object.keys(i).length>0){if(u.length>0){var h;i[r]||(i[r]=[]),(h=i[r]).push.apply(h,u)}return i}return u.length>0?B({},r,u):!1}},{key:"executeAssert",value:function(r,o){if(this.opt&&o===null)return{success:!0,data:o};if(o===null&&!this.opt)return{success:!1,errors:B({},r,[{message:"Expected 'array', got 'null'",typeError:!0}])};if(!Array.isArray(o))return{success:!1,errors:B({},r,[{message:"Expected 'array', got '".concat(ie(o),"'"),typeError:!0}])};for(var i={},s=0;s<o.length;s++)this.recursiveAssert(Mr(r,s),o[s],i);return Object.keys(i).length>0?{success:!1,errors:i}:{success:!0,data:o}}},{key:"recursiveAssert",value:function(r,o,i){if(ie(o)!=="object"){i[r]||(i[r]=[]),i[r].push({message:"Expected 'object', got '".concat(ie(o),"'"),typeError:!0});return}if(Array.isArray(o)){i[r]||(i[r]=[]),i[r].push({message:"Expected 'object', got 'array'",typeError:!0});return}if(o===null){i[r]||(i[r]=[]),i[r].push({message:"Expected 'object', got 'null'",typeError:!0});return}if("tag"in o&&typeof o.tag!="string"){i[r]||(i[r]=[]),i[r].push({message:"Expected 'string', got '".concat(ie(o.tag),"'"),typeError:!0});return}if("children"in o)if(Array.isArray(o.children))for(var s=0;s<o.children.length;s++){var a=o.children[s],l=Mr(Mr(r,"children"),s);if(ie(a)==="object")this.recursiveAssert(l,a,i);else{if(typeof a=="string")continue;i[l]||(i[l]=[]),i[l].push({message:"Expected 'object' or 'string', got '".concat(ie(a),"'"),typeError:!0})}}else{i[r]||(i[r]=[]),i[r].push({message:"Expected 'array', got '".concat(ie(o.children),"'"),typeError:!0});return}if("styles"in o)if(!Array.isArray(o.styles))i[r]||(i[r]=[]),i[r].push({message:"Expected 'array', got '".concat(ie(o.styles),"'"),typeError:!0});else for(var c=0;c<o.styles.length;c++){var u=o.styles[c];if(typeof u!="string"){var f=Mr(r,c);i[f]||(i[f]=[]),i[f].push({message:"Expected 'string', got '".concat(ie(u),"'"),typeError:!0})}}}},{key:"nullable",value:function(){return new t(this.options,!0)}},{key:"executeSerialize",value:function(){var r,o={maxLength:this.options.maxLength,minLength:this.options.minLength,style:this.options.style,block:this.options.block,inline:this.options.inline&&{a:this.options.inline.a,img:this.options.inline.img&&ie(this.options.inline.img)==="object"?this.options.inline.img.executeSerialize():this.options.inline.img}};return{type:"richtext",opt:this.opt,options:o,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(){return{}}}])}(eo),F$=function(t){return new Gv(t??{})},Jh=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;return Rn(this,t),r=Zr(this,t),B(r,"renderInput",null),r.item=n,r.opt=o,r.customValidateFunctions=i,r.currentRouter=s,r}return Qr(t,e),An(t,[{key:"validate",value:function(r){return new t(this.item,this.opt,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i=this,s=!1,a=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r});if(this.opt&&o==null)return a.length>0?B({},r,a):!1;if(o===null)return B({},r,[].concat(ge(a),[{message:"Expected 'object', got 'null'"}]));if(ie(o)!=="object")return B({},r,[].concat(ge(a),[{message:"Expected 'object', got '".concat(ie(o),"'")}]));if(Array.isArray(o))return B({},r,[].concat(ge(a),[{message:"Expected 'object', got 'array'"}]));var l=this.getRouterValidations(r,o);if(l)return l;var c=vi(a),u;try{for(c.s();!(u=c.n()).done;){var f=u.value;s=this.appendValidationError(s,r,f.message,o,f.schemaError)}}catch(h){c.e(h)}finally{c.f()}return Object.entries(o).forEach(function(h){var p=jn(h,2),m=p[0],v=p[1],x=hu(r,m);if(!x)s=i.appendValidationError(s,r,"Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(v),o);else{var b=i.item.executeValidate(x,v);b&&s?s=xt(xt({},b),s):b&&(s=b)}}),s}},{key:"executeAssert",value:function(r,o){return this.opt&&o===null?{success:!0,data:o}:ie(o)!=="object"?{success:!1,errors:B({},r,[{message:"Expected 'object', got '".concat(ie(o),"'"),typeError:!0}])}:Array.isArray(o)?{success:!1,errors:B({},r,[{message:"Expected 'object', got 'array'",typeError:!0}])}:{success:!0,data:o}}},{key:"nullable",value:function(){return new t(this.item,!0)}},{key:"router",value:function(r){return new t(this.item,this.opt,this.customValidateFunctions,r)}},{key:"getRouterValidations",value:function(r,o){if(!this.currentRouter||o===null)return!1;var i=Q1(r),s=jn(i,2),a=s[0],l=s[1];if(l)return B({},r,[{message:"This field was configured as a router, but it is not defined at the root of the module",schemaError:!0}]);var c=this.currentRouter.validate(a,Object.keys(o));return c.length>0?Object.fromEntries(c.map(function(u){if(!u.error.urlPath)return[r,[{message:"Router validation error: ".concat(u.error.message," has no url path"),schemaError:!0}]];var f=hu(r,u.error.urlPath);return f?[f,[{message:u.error.message}]]:[r,[{message:"Could not create path for router validation error",schemaError:!0}]]})):!1}},{key:"executeSerialize",value:function(){var r,o;return{type:"record",item:this.item.executeSerialize(),opt:this.opt,router:(r=this.currentRouter)===null||r===void 0?void 0:r.getRouterId(),customValidate:this.customValidateFunctions&&((o=this.customValidateFunctions)===null||o===void 0?void 0:o.length)>0}}},{key:"executeRender",value:function(r,o){var i={};if(o===null)return i;for(var s in o){var a=o[s];if(a!=null){var l=Mr(r,s),c=this.item.executeRender(l,a);for(var u in c){var f=u;i[f]=c[f]}}}if(this.renderInput){var h=this.renderInput,p=h.select,m=h.layout;m!=="list"&&(i[r]={status:"error",message:"Unknown layout type: "+m});try{i[r]={status:"success",data:{layout:"list",parent:"record",items:Object.entries(o).map(function(v){var x=jn(v,2),b=x[0],w=x[1],S=p({key:b,val:w}),C=S.title,N=S.subtitle,P=S.image;return[b,{title:C,subtitle:N,image:P}]})}}}catch(v){i[r]={status:"error",message:v instanceof Error?v.message:"Unknown error"}}}return i}},{key:"render",value:function(r){return this.renderInput=r,this}}])}(eo),z$=function(t){return new Jh(t)};function $$(e){var t=e[P$],n=t;return n}function Q1(e){var t=e.indexOf(wa);return t===-1?[e,""]:[e.slice(0,t),e.slice(t+wa.length)]}function LO(e,t){return t===""?e:"".concat(e).concat(wa).concat(t)}function FO(e){return e instanceof jl||ie(e)==="object"&&"type"in e&&e.type==="object"}function zO(e){return e instanceof Jh||ie(e)==="object"&&"type"in e&&e.type==="record"}function $O(e){return e instanceof Kv||ie(e)==="object"&&"type"in e&&e.type==="array"}function BO(e){return e instanceof DO||ie(e)==="object"&&"type"in e&&e.type==="union"}function VO(e){return e instanceof Gv||ie(e)==="object"&&"type"in e&&e.type==="richtext"}function UO(e){return e instanceof Z1||ie(e)==="object"&&"type"in e&&e.type==="image"}function B$(e,t,n){for(var r=Zf(e),o=ge(r),i=n,s=t,a=function(){var u=r.shift();if(u===void 0)throw Error("Unexpected undefined part");if($O(i)){var f;if(Number.isNaN(Number(u)))throw Error("Invalid path: array schema ".concat(JSON.stringify(i)," must have a number as path, but got ").concat(u,". Path: ").concat(e));if(ie(s)!=="object"&&!Array.isArray(s))throw Error("Schema type error: expected source to be type of array, but got ".concat(ie(s)));s=s[u],i=i instanceof Kv?(f=i)===null||f===void 0?void 0:f.item:i.item}else if(zO(i)){var h;if(typeof u!="string")throw Error("Invalid path: record schema ".concat(i," must have path: ").concat(u," as string"));if(ie(s)!=="object"&&!Array.isArray(s))throw Error("Schema type error: expected source to be type of record, but got ".concat(ie(s)));if(!s[u])throw Error("Invalid path: record source did not have key ".concat(u," from path: ").concat(e));s=s[u],i=i instanceof Jh?(h=i)===null||h===void 0?void 0:h.item:i.item}else if(FO(i)){if(ie(s)!=="object")throw Error("Schema type error: expected source to be type of object, but got ".concat(ie(s)));if(s!==null&&s[u]===void 0)throw Error("Invalid path: object source did not have key ".concat(u," from path: ").concat(e));s=s===null?s:s[u],i=(i instanceof jl,i.items[u])}else{if(UO(i))return{v:{path:o.slice(0,o.length-r.length-1).map(function(w){return JSON.stringify(w)}).join("."),schema:i,source:s}};if(BO(i)){var p=i.key;if(typeof p!="string")return{v:{path:o.map(function(w){return Number.isNaN(Number(w))?JSON.stringify(w):w}).join("."),schema:i,source:s}};var m=s[p];if(!m)throw Error("Invalid path: union source ".concat(i," did not have required key ").concat(p," in path: ").concat(e));var v=i.items.find(function(w){var S;return(w==null||(S=w.items)===null||S===void 0||(S=S[p])===null||S===void 0?void 0:S.value)===m});if(!v)throw Error("Invalid path: union schema ".concat(i," did not have a child object with ").concat(p," of value ").concat(m," in path: ").concat(e));i=v.items[u],s=s[u]}else if(VO(i)){if("src"in s&&"tag"in s&&s.tag==="img"&&r.length===0){var x,b;i=i instanceof Gv&&(x=i.options)!==null&&x!==void 0&&(x=x.inline)!==null&&x!==void 0&&x.img&&typeof((b=i.options)===null||b===void 0||(b=b.inline)===null||b===void 0?void 0:b.img)!="boolean"?i.options.inline.img:i}s=s[u]}else throw Error("Invalid path: ".concat(u," resolved to an unexpected schema ").concat(JSON.stringify(i)))}},l;r.length>0;)if(l=a(),l)return l.v;if(r.length>0)throw Error("Invalid path: ".concat(r.join(".")," is not a valid path"));return{path:o.map(function(c){return Number.isNaN(Number(c))?JSON.stringify(c):c}).join("."),schema:i,source:s}}function V$(e,t,n){for(var r=Zf(e),o=ge(r),i=n,s=t,a=function(){var u=r.shift();if(u===void 0)return{v:{status:"error",message:"Unexpected undefined part"}};if($O(i)){var f;if(Number.isNaN(Number(u)))return{v:{status:"error",message:"Invalid path: array schema ".concat(JSON.stringify(i)," must have a number as path, but got ").concat(u,". Path: ").concat(e)}};if(s===void 0)return{v:{status:"source-undefined",path:o.slice(0,o.length-r.length-1).map(function(w){return JSON.stringify(w)}).join(".")}};if(ie(s)!=="object"&&!Array.isArray(s))return{v:{status:"error",message:"Schema type error: expected source to be type of array, but got ".concat(ie(s))}};s=s[u],i=i instanceof Kv?(f=i)===null||f===void 0?void 0:f.item:i.item}else if(zO(i)){var h;if(typeof u!="string")return{v:{status:"error",message:"Invalid path: record schema ".concat(i," must have path: ").concat(u," as string")}};if(s===void 0)return{v:{status:"source-undefined",path:o.slice(0,o.length-r.length-1).map(function(w){return JSON.stringify(w)}).join(".")}};if(ie(s)!=="object"&&!Array.isArray(s))return{v:{status:"error",message:"Schema type error: expected source to be type of record, but got ".concat(ie(s))}};if(!s[u])return{v:{status:"error",message:"Invalid path: record source did not have key ".concat(u," from path: ").concat(e)}};s=s[u],i=i instanceof Jh?(h=i)===null||h===void 0?void 0:h.item:i.item}else if(FO(i)){if(s===void 0)return{v:{status:"source-undefined",path:o.slice(0,o.length-r.length-1).map(function(w){return JSON.stringify(w)}).join(".")}};if(ie(s)!=="object")return{v:{status:"error",message:"Schema type error: expected source to be type of object, but got ".concat(ie(s))}};if(s!==null&&s[u]===void 0)return{v:{status:"error",message:"Invalid path: object source did not have key ".concat(u," from path: ").concat(e)}};s=s===null?s:s[u],i=(i instanceof jl,i.items[u])}else{if(UO(i))return{v:{status:"ok",path:o.slice(0,o.length-r.length-1).map(function(w){return JSON.stringify(w)}).join("."),schema:i,source:s}};if(BO(i)){var p=i.key;if(typeof p!="string")return{v:{status:"ok",path:o.map(function(w){return Number.isNaN(Number(w))?JSON.stringify(w):w}).join("."),schema:i,source:s}};var m=s[p];if(!m)return{v:{status:"error",message:"Invalid path: union source ".concat(i," did not have required key ").concat(p," in path: ").concat(e)}};var v=i.items.find(function(w){var S;return(w==null||(S=w.items)===null||S===void 0||(S=S[p])===null||S===void 0?void 0:S.value)===m});if(!v)return{v:{status:"error",message:"Invalid path: union schema ".concat(i," did not have a child object with ").concat(p," of value ").concat(m," in path: ").concat(e)}};i=v.items[u],s=s[u]}else if(VO(i)){if("src"in s&&"tag"in s&&s.tag==="img"&&r.length===0){var x,b;i=i instanceof Gv&&(x=i.options)!==null&&x!==void 0&&(x=x.inline)!==null&&x!==void 0&&x.img&&typeof((b=i.options)===null||b===void 0||(b=b.inline)===null||b===void 0?void 0:b.img)!="boolean"?i.options.inline.img:i}s=s[u]}else return{v:{status:"error",message:"Invalid path: ".concat(u," resolved to an unexpected schema ").concat(JSON.stringify(i))}}}},l;r.length>0;)if(l=a(),l)return l.v;return r.length>0?{status:"error",message:"Invalid path: ".concat(r.join(".")," is not a valid path")}:{status:"ok",path:o.map(function(c){return Number.isNaN(Number(c))?JSON.stringify(c):c}).join("."),schema:i,source:s}}function U$(e){var t=e.split("/").slice(1);return t}function Zf(e){for(var t=[],n=0;n<e.length;){var r="";if(e[n]==='"'){for(n++;n<e.length&&e[n]!=='"';)e[n]==="\\"&&e[n+1]==='"'?(r+='"',n++):r+=e[n],n++;if(e[n]!=='"'){var o;throw new Error("Invalid input (".concat(JSON.stringify(e),"): Missing closing double quote: ").concat((o=e[n])!==null&&o!==void 0?o:"at end of string"," (char: ").concat(n,"; length: ").concat(e.length,")"))}}else for(;n<e.length&&e[n]!==".";)r+=e[n],n++;r!==""&&t.push(r),n++}return t}function W$(e){return e.split(",")}function H$(e){var t=Q1(e),n=jn(t,2),r=n[0],o=n[1],i=Zf(o).slice(0,-1);return i.length>0?LO(r,WO(i)):r}function WO(e){return e.map(function(t){return Number.isInteger(Number(t))?t:JSON.stringify(t)}).join(".")}var K$=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return Rn(this,t),r=Zr(this,t),r.options=n,r.opt=o,r.customValidateFunctions=i,r}return Qr(t,e),An(t,[{key:"validate",value:function(r){return new t(this.options,this.opt,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i,s,a=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r});return this.opt&&o==null?a.length>0?B({},r,a):!1:typeof o!="number"?B({},r,[].concat(ge(a),[{message:"Expected 'number', got '".concat(ie(o),"'"),value:o}])):(i=this.options)!==null&&i!==void 0&&i.max&&o>this.options.max?B({},r,[].concat(ge(a),[{message:"Expected 'number' less than ".concat(this.options.max),value:o}])):(s=this.options)!==null&&s!==void 0&&s.min&&o<this.options.min?B({},r,[].concat(ge(a),[{message:"Expected 'number' greater than ".concat(this.options.min),value:o}])):a.length>0?B({},r,a):!1}},{key:"executeAssert",value:function(r,o){return this.opt&&o===null?{success:!0,data:o}:o===null?{success:!1,errors:B({},r,[{message:"Expected 'number', got 'null'",typeError:!0}])}:typeof o=="number"?{success:!0,data:o}:{success:!1,errors:B({},r,[{message:"Expected 'number', got '".concat(ie(o),"'"),typeError:!0}])}}},{key:"nullable",value:function(){return new t(this.options,!0)}},{key:"max",value:function(r){return new t(xt(xt({},this.options),{},{max:r}),this.opt)}},{key:"min",value:function(r){return new t(xt(xt({},this.options),{},{min:r}),this.opt)}},{key:"executeSerialize",value:function(){var r;return{type:"number",options:this.options,opt:this.opt,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(){return{}}}])}(eo),G$=function(t){return new K$(t)},q$=function(e){function t(){var n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return Rn(this,t),n=Zr(this,t),n.opt=r,n.customValidateFunctions=o,n}return Qr(t,e),An(t,[{key:"validate",value:function(r){return new t(this.opt,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){return this.opt&&o==null?!1:typeof o!="boolean"?B({},r,[{message:"Expected 'boolean', got '".concat(ie(o),"'"),value:o}]):!1}},{key:"executeAssert",value:function(r,o){return this.opt&&o===null?{success:!0,data:o}:o===null?{success:!1,errors:B({},r,[{message:"Expected 'boolean', got 'null'",typeError:!0}])}:typeof o!="boolean"?{success:!1,errors:B({},r,[{message:"Expected 'boolean', got '".concat(ie(o),"'"),typeError:!0}])}:{success:!0,data:o}}},{key:"nullable",value:function(){return new t(!0)}},{key:"executeSerialize",value:function(){var r;return{type:"boolean",opt:this.opt,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(){return{}}}])}(eo),Y$=function(){return new q$},J$=function(e){function t(n,r){var o,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];return Rn(this,t),o=Zr(this,t),o.schema=n,o.sourcePath=r,o.opt=i,o.customValidateFunctions=s,o}return Qr(t,e),An(t,[{key:"validate",value:function(r){return new t(this.schema,this.sourcePath,this.opt,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i=this.executeCustomValidateFunctions(o,this.customValidateFunctions,{path:r});if(this.opt&&o==null)return i.length>0?B({},r,i):!1;if(!this.schema)return B({},r,[].concat(ge(i),[{message:"Schema not found for module. keyOf must be used with a Val Module"}]));var s=this.schema;if(!(s.type==="object"||s.type==="record"))return B({},r,[].concat(ge(i),[{message:"Schema in keyOf must be an 'object' or 'record'. Found '".concat(s.type||"unknown","'")}]));if(s.opt&&o==null)return!1;if(s.type==="record"&&typeof o!="string")return B({},r,[].concat(ge(i),[{message:"Type of value in keyof (record) must be 'string'"}]));if(s.type==="object"){var a=s.keys;if(!a.includes(o))return B({},r,[].concat(ge(i),[{message:"Value of keyOf (object) must be: ".concat(a.join(", "),". Found: ").concat(o)}]))}return s.type==="record"?typeof o!="string"?B({},r,[].concat(ge(i),[{message:"Value of keyOf (record) must be 'string'. Found: ".concat(ie(o))}])):B({},r,[].concat(ge(i),[{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:o,sourcePath:this.sourcePath}}])):i.length>0?B({},r,i):!1}},{key:"executeAssert",value:function(r,o){if(this.opt&&o===null)return{success:!0,data:o};if(o===null)return{success:!1,errors:B({},r,[{message:"Expected 'string', got 'null'",typeError:!0}])};var i=this.schema;if(!i)return{success:!1,errors:B({},r,[{message:"Neither key nor schema was found. keyOf is missing an argument.",typeError:!0}])};var s=i;if(!(s.type==="object"||s.type==="record"))return{success:!1,errors:B({},r,[{message:"Schema of first argument must be either: 'array', 'object' or 'record'. Found '".concat(s.type||"unknown","'"),typeError:!0}])};if(s.type==="record"&&typeof o!="string")return{success:!1,errors:B({},r,[{message:"Value of keyOf (record) must be 'string', got '".concat(ie(o),"'"),typeError:!0}])};if(s.type==="object"){var a=s.keys;if(!a.includes(o))return{success:!1,errors:B({},r,[{message:"Value of keyOf (object) must be: ".concat(a.join(", "),". Found: ").concat(o),typeError:!0}])}}return{success:!0,data:o}}},{key:"nullable",value:function(){return new t(this.schema,this.sourcePath,!0)}},{key:"executeSerialize",value:function(){var r,o=this.sourcePath;if(!o)throw new Error("Cannot serialize keyOf schema with empty selector. TIP: keyOf must be used with a Val Module of record schema.");var i=this.schema;if(!i)throw new Error("Cannot serialize keyOf schema with empty selector.");var s;switch(i.type){case"record":s="string";break;case"object":s=i.keys;break;default:throw new Error("Cannot serialize keyOf schema with selector of type '".concat(i.type||"unknown","'"))}return{type:"keyOf",path:o,schema:i,opt:this.opt,values:s,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(){return{}}}])}(eo),X$=function(t){var n=t==null?void 0:t[OO],r=void 0;if(n instanceof jl){var o=[];try{o=Object.keys((n==null?void 0:n.items)||{})}catch{}r={type:"object",keys:o,opt:n==null?void 0:n.opt}}else n instanceof Jh&&(r={type:"record",opt:n==null?void 0:n.opt});return new J$(r,RO(t))},Z$=function(e){function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return Rn(this,t),r=Zr(this,t),r.options=n,r.opt=o,r.customValidateFunctions=i,r}return Qr(t,e),An(t,[{key:"validate",value:function(r){return new t(this.options,this.opt,[].concat(ge(this.customValidateFunctions),[r]))}},{key:"executeValidate",value:function(r,o){var i,s,a,l;if(this.opt&&o==null)return!1;if(typeof o!="string")return B({},r,[{message:"Expected 'string', got '".concat(ie(o),"'"),value:o}]);if((i=this.options)!==null&&i!==void 0&&i.from&&(s=this.options)!==null&&s!==void 0&&s.to){if(this.options.from>this.options.to)return B({},r,[{message:"From date ".concat(this.options.from," is after to date ").concat(this.options.to),value:o,typeError:!0}]);if(o<this.options.from||o>this.options.to)return B({},r,[{message:"Date is not between ".concat(this.options.from," and ").concat(this.options.to),value:o}])}else if((a=this.options)!==null&&a!==void 0&&a.from){if(o<this.options.from)return B({},r,[{message:"Date is before the minimum date ".concat(this.options.from),value:o}])}else if((l=this.options)!==null&&l!==void 0&&l.to&&o>this.options.to)return B({},r,[{message:"Date is after the maximum date ".concat(this.options.to),value:o}]);return!1}},{key:"executeAssert",value:function(r,o){return this.opt&&o===null?{success:!0,data:o}:o===null?{success:!1,errors:B({},r,[{message:"Expected 'string', got 'null'",typeError:!0}])}:typeof o!="string"?{success:!1,errors:B({},r,[{message:"Expected 'string', got '".concat(ie(o),"'"),typeError:!0}])}:{success:!0,data:o}}},{key:"from",value:function(r){return new t(xt(xt({},this.options),{},{from:r}),this.opt)}},{key:"to",value:function(r){return new t(xt(xt({},this.options),{},{to:r}),this.opt)}},{key:"nullable",value:function(){return new t(this.options,!0)}},{key:"executeSerialize",value:function(){var r;return{type:"date",opt:this.opt,options:this.options,customValidate:this.customValidateFunctions&&((r=this.customValidateFunctions)===null||r===void 0?void 0:r.length)>0}}},{key:"executeRender",value:function(){return{}}}])}(eo),Q$=function(t){return new Z$(t)};function e6(){return{string:AO,boolean:Y$,array:A$,object:IO,number:G$,union:D$,richtext:F$,image:L$,literal:I$,keyOf:X$,record:z$,file:T$,date:Q$}}function t6(e,t){var n=t.publicProjectId,r=t.coreVersion,o=t.validationHash,i=t.fileHash,s=t.filePath,a=t.bucket;return"".concat(e,"/file/p/").concat(n,"/b/").concat(a,"/v/").concat(r,"/h/").concat(o,"/f/").concat(i,"/p/").concat(s)}var n6=/^(https?:\/\/[^/]+)\/file\/p\/([^/]+)\/b\/([^/]+)\/v\/([^/]+)\/h\/([^/]+)\/f\/([^/]+)\/p\/(.+)$/;function HO(e){var t=e.match(n6);return t?t[7].indexOf("public/val/")!==0?{status:"error",error:"Invalid remote ref: "+e}:{status:"success",remoteHost:t[1],projectId:t[2],bucket:t[3],version:t[4],validationHash:t[5],fileHash:t[6],filePath:t[7]}:{status:"error",error:"Invalid remote ref: "+e}}var GC="https://remote.val.build";function r6(e){if(e!=null&&e.patch_id){var t=HO(e[bt]);if(t.status==="success")return{url:"/api/val/files/"+t.filePath+"?patch_id=".concat(e.patch_id,"&remote=true&ref=").concat(encodeURIComponent(e[bt])),metadata:e.metadata};console.warn("Internal Val error: failed to split remote ref: ".concat(e[bt],". The data format is different than what is expected. Check Val versions for mismatches."),t.error)}return{url:e[bt],metadata:e.metadata}}var Hr=An(function e(t){Rn(this,e),this.message=t}),o6=[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],vt=function(e){return e[e.inputBytes=64]="inputBytes",e[e.inputWords=16]="inputWords",e[e.highIndex=14]="highIndex",e[e.lowIndex=15]="lowIndex",e[e.workWords=64]="workWords",e[e.allocBytes=80]="allocBytes",e[e.allocWords=20]="allocWords",e[e.allocTotal=8e3]="allocTotal",e}(vt||{});function i6(e){return new s6}var s6=function(){function e(){Rn(this,e),B(this,"A",1779033703),B(this,"B",-1150833019),B(this,"C",1013904242),B(this,"D",-1521486534),B(this,"E",1359893119),B(this,"F",-1694144372),B(this,"G",528734635),B(this,"H",1541459225),B(this,"_size",0),B(this,"_sp",0),(!Yp||Sd>=vt.allocTotal)&&(Yp=new ArrayBuffer(vt.allocTotal),Sd=0),this._byte=new Uint8Array(Yp,Sd,vt.allocBytes),this._word=new Int32Array(Yp,Sd,vt.allocWords),Sd+=vt.allocBytes}return An(e,[{key:"update",value:function(n){if(typeof n=="string")return this._utf8(n);if(n==null)throw new TypeError("Invalid type: "+ie(n));var r=n.byteOffset,o=n.byteLength,i=o/vt.inputBytes|0,s=0;if(i&&!(r&3)&&!(this._size%vt.inputBytes)){for(var a=new Int32Array(n.buffer,r,i*vt.inputWords);i--;)this._int32(a,s>>2),s+=vt.inputBytes;this._size+=s}var l=n.BYTES_PER_ELEMENT;if(l!==1&&n.buffer){var c=new Uint8Array(n.buffer,r+s,o-s);return this._uint8(c)}return s===o?this:this._uint8(n,s)}},{key:"_uint8",value:function(n,r){var o=this._byte,i=this._word,s=n.length;for(r=r|0;r<s;){for(var a=this._size%vt.inputBytes,l=a;r<s&&l<vt.inputBytes;)o[l++]=n[r++];l>=vt.inputBytes&&this._int32(i),this._size+=l-a}return this}},{key:"_utf8",value:function(n){for(var r=this._byte,o=this._word,i=n.length,s=this._sp,a=0;a<i;){for(var l=this._size%vt.inputBytes,c=l;a<i&&c<vt.inputBytes;){var u=n.charCodeAt(a++)|0;u<128?r[c++]=u:u<2048?(r[c++]=192|u>>>6,r[c++]=128|u&63):u<55296||u>57343?(r[c++]=224|u>>>12,r[c++]=128|u>>>6&63,r[c++]=128|u&63):s?(u=((s&1023)<<10)+(u&1023)+65536,r[c++]=240|u>>>18,r[c++]=128|u>>>12&63,r[c++]=128|u>>>6&63,r[c++]=128|u&63,s=0):s=u}c>=vt.inputBytes&&(this._int32(o),o[0]=o[vt.inputWords]),this._size+=c-l}return this._sp=s,this}},{key:"_int32",value:function(n,r){var o=this.A,i=this.B,s=this.C,a=this.D,l=this.E,c=this.F,u=this.G,f=this.H,h=0;for(r=r|0;h<vt.inputWords;)Ya[h++]=jo(n[r++]);for(h=vt.inputWords;h<vt.workWords;h++)Ya[h]=p6(Ya[h-2])+Ya[h-7]+h6(Ya[h-15])+Ya[h-16]|0;for(h=0;h<vt.workWords;h++){var p=f+f6(l)+c6(l,c,u)+o6[h]+Ya[h]|0,m=d6(o)+u6(o,i,s)|0;f=u,u=c,c=l,l=a+p|0,a=s,s=i,i=o,o=p+m|0}this.A=o+this.A|0,this.B=i+this.B|0,this.C=s+this.C|0,this.D=a+this.D|0,this.E=l+this.E|0,this.F=c+this.F|0,this.G=u+this.G|0,this.H=f+this.H|0}},{key:"digest",value:function(n){var r=this._byte,o=this._word,i=this._size%vt.inputBytes|0;for(r[i++]=128;i&3;)r[i++]=0;if(i>>=2,i>vt.highIndex){for(;i<vt.inputWords;)o[i++]=0;i=0,this._int32(o)}for(;i<vt.inputWords;)o[i++]=0;var s=this._size*8,a=(s&4294967295)>>>0,l=(s-a)/4294967296;return l&&(o[vt.highIndex]=jo(l)),a&&(o[vt.lowIndex]=jo(a)),this._int32(o),n==="hex"?this._hex():this._bin()}},{key:"_hex",value:function(){var n=this.A,r=this.B,o=this.C,i=this.D,s=this.E,a=this.F,l=this.G,c=this.H;return Cs(n)+Cs(r)+Cs(o)+Cs(i)+Cs(s)+Cs(a)+Cs(l)+Cs(c)}},{key:"_bin",value:function(){var n=this.A,r=this.B,o=this.C,i=this.D,s=this.E,a=this.F,l=this.G,c=this.H,u=this._byte,f=this._word;return f[0]=jo(n),f[1]=jo(r),f[2]=jo(o),f[3]=jo(i),f[4]=jo(s),f[5]=jo(a),f[6]=jo(l),f[7]=jo(c),u.slice(0,32)}}])}(),Ya=new Int32Array(vt.workWords),Yp,Sd=0,Cs=function(t){return(t+4294967296).toString(16).substr(-8)},a6=function(t){return t<<24&4278190080|t<<8&16711680|t>>8&65280|t>>24&255},l6=function(t){return t},jo=m6()?l6:a6,c6=function(t,n,r){return r^t&(n^r)},u6=function(t,n,r){return t&n|r&(t|n)},d6=function(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)},f6=function(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)},h6=function(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3},p6=function(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10};function m6(){var e=new Uint8Array(new Uint16Array([65279]).buffer);return e[0]===254}var eS=function(t){return i6().update(t).digest("hex")},tS={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"},KO=Object.fromEntries(Object.entries(tS).map(function(e){var t=jn(e,2),n=t[0],r=t[1];return[r,n]})),g6=/^data:(.*?);base64,/;function v6(e){var t=g6.exec(e);if(t&&t[1])return t[1]}function y6(e){var t=KO[e];return t||e.split("/")[1]}function x6(e){var t=e.split(".").pop(),n=t&&tS[t];if(n)return n}function GO(e,t,n,r,o){var i="".concat((r==null?void 0:r.width)||"").concat((r==null?void 0:r.height)||"").concat(r==null?void 0:r.mimeType),s={type:t.type,opt:t.opt,options:xt({},t.options)};return e+JSON.stringify(s)+n+i+o}function b6(e,t,n,r,o,i){return eS(i.encode(GO(e,t,n,r,o))).slice(0,4)}function qO(e){return e.slice(0,12)}function w6(e){return qO(eS(new Uint8Array(e)))}function S6(e,t){var n=e.startsWith("/")?e.slice(1).split("/"):e.split("/");if(t.length===0)return{isValid:n.length===0||n.length===1&&n[0]==="",expectedPath:"/"};for(var r=0,o=0,i=!1,s=-1,a=0;a<t.length;a++){var l=t[a];l.startsWith("[[")&&l.endsWith("]]")?(i=!0,s=a,o=1/0):l.startsWith("[...")&&l.endsWith("]")?(i=!0,s=a,r++,o=1/0):l.startsWith("[[")&&l.endsWith("]")?o++:(l.startsWith("[")&&l.endsWith("]"),r++,o++)}if(n.length<r||!i&&n.length>o){var c=t.map(function(m){return m.startsWith("[[")&&m.endsWith("]]")?"[optional:".concat(m.slice(2,-2),"]"):m.startsWith("[...")&&m.endsWith("]")?"[...".concat(m.slice(4,-1),"]"):m.startsWith("[[")&&m.endsWith("]")?"[optional:".concat(m.slice(2,-1),"]"):m.startsWith("[")&&m.endsWith("]")?"[".concat(m.slice(1,-1),"]"):m}).join("/");return{isValid:!1,expectedPath:"/".concat(c)}}for(var u=i?s:t.length,f=0;f<u;f++){var h=t[f],p=n[f];if(h.startsWith("[[")&&h.endsWith("]]")){if(p!==""&&p!==void 0&&p==="")return{isValid:!1,expectedPath:"/".concat(t.join("/"))}}else if(h.startsWith("[")&&h.endsWith("]")){if(p===""||p===void 0)return{isValid:!1,expectedPath:"/".concat(t.join("/"))}}else if(h!==p)return{isValid:!1,expectedPath:"/".concat(t.join("/"))}}return{isValid:!0}}var k6={getRouterId:function(){return"next-app-router"},validate:function(t,n){var r=E6(t),o=[],i=vi(n),s;try{for(i.s();!(s=i.n()).done;){var a=s.value,l=S6(a,r);l.isValid||o.push({error:{message:'URL path "'.concat(a,'" does not match the route pattern for "').concat(t,'"'),urlPath:a,expectedPath:l.expectedPath||null}})}}catch(c){i.e(c)}finally{i.f()}return o}};function E6(e){if(!e||typeof e!="string")return[];for(var t=[/\/app\/(.+)\/page\.val\.ts$/,/\/src\/app\/(.+)\/page\.val\.ts$/,/\/app\/(.+)\/page\.tsx?$/,/\/src\/app\/(.+)\/page\.tsx?$/],n=0,r=t;n<r.length;n++){var o=r[n],i=e.match(o);if(i){var s=i[1];return s.split("/").flatMap(function(a){if(a.startsWith("(")&&a.endsWith(")")&&!a.includes("."))return[];var l=a.match(/^(\([.]+\)(\(.+\))?)(.*)$/);if(l){var c=l[3]||l[4];return c?[c]:[]}return[a]})}}return[]}var wa="?p=",YO="https://content.val.build",_b="https://admin.val.build",Y={VERSION:{core:function(){try{return require("../package.json").version}catch{return null}}()},convertFileSource:O$,convertRemoteSource:r6,getSchema:KC,getValPath:RO,getSource:$$,resolvePath:B$,safeResolvePath:V$,splitModuleFilePathAndModulePath:Q1,joinModuleFilePathAndModulePath:LO,nextAppRouter:k6,remote:{createRemoteRef:t6,getValidationBasis:GO,getValidationHash:b6,getFileHash:w6,hashToRemoteFileHash:qO,splitRemoteRef:HO},validate:function(t,n,r){var o;return t&&((o=KC(t))===null||o===void 0?void 0:o.executeValidate(n,r))},isVal:M$,isFile:_$,createValPathOfItem:hu,getSHA256Hash:eS,initSchema:e6,getMimeType:v6,mimeTypeToFileExt:y6,filenameToMimeType:x6,EXT_TO_MIME_TYPES:tS,MIME_TYPES_TO_EXT:KO,ModuleFilePathSep:wa,notFileOp:function(t){return t.op!=="file"},isFileOp:function(t){return t.op==="file"&&typeof t.filePath=="string"},createPatchJSONPath:function(t){return"/".concat(t.split(".").map(function(n){return n&&C6(n)}).join("/"))},createPatchPath:function(t){return Zf(t)},splitModulePath:Zf,splitModuleFilePath:U$,splitJoinedSourcePaths:W$,parentOfSourcePath:H$,patchPathToModulePath:WO,VAL_ENABLE_COOKIE_NAME:"val_enable",VAL_STATE_COOKIE:"val_state",VAL_SESSION_COOKIE:"val_session",createFilename:function(t,n,r,o){var i,s;if(!r||!t)return n;var a=o.slice(0,5),l=(i=Y.getMimeType(t))!==null&&i!==void 0?i:"unknown",c=(s=Y.mimeTypeToFileExt(l))!==null&&s!==void 0?s:"unknown";if(n){var u=n.split(".").slice(0,-1).join(".")||n,f=u.lastIndexOf("_"),h=u.slice(f+1,u.length);h===a&&(u=u.slice(0,f));var p=encodeURIComponent(u).replace(/%[0-9A-Fa-f]{2}/g,"").toLowerCase();return"".concat(p,"_").concat(a,".").concat(c)}return"".concat(o,".").concat(c)}};function C6(e){try{return JSON.parse(e)}catch{return e}}var qv={},Yv={};Yv.byteLength=_6;Yv.toByteArray=T6;Yv.fromByteArray=R6;var hi=[],ro=[],N6=typeof Uint8Array<"u"?Uint8Array:Array,Px="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var lc=0,P6=Px.length;lc<P6;++lc)hi[lc]=Px[lc],ro[Px.charCodeAt(lc)]=lc;ro[45]=62;ro[95]=63;function JO(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function _6(e){var t=JO(e),n=t[0],r=t[1];return(n+r)*3/4-r}function j6(e,t,n){return(t+n)*3/4-n}function T6(e){var t,n=JO(e),r=n[0],o=n[1],i=new N6(j6(e,r,o)),s=0,a=o>0?r-4:r,l;for(l=0;l<a;l+=4)t=ro[e.charCodeAt(l)]<<18|ro[e.charCodeAt(l+1)]<<12|ro[e.charCodeAt(l+2)]<<6|ro[e.charCodeAt(l+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return o===2&&(t=ro[e.charCodeAt(l)]<<2|ro[e.charCodeAt(l+1)]>>4,i[s++]=t&255),o===1&&(t=ro[e.charCodeAt(l)]<<10|ro[e.charCodeAt(l+1)]<<4|ro[e.charCodeAt(l+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}function O6(e){return hi[e>>18&63]+hi[e>>12&63]+hi[e>>6&63]+hi[e&63]}function M6(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),o.push(O6(r));return o.join("")}function R6(e){for(var t,n=e.length,r=n%3,o=[],i=16383,s=0,a=n-r;s<a;s+=i)o.push(M6(e,s,s+i>a?a:s+i));return r===1?(t=e[n-1],o.push(hi[t>>2]+hi[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(hi[t>>10]+hi[t>>4&63]+hi[t<<2&63]+"=")),o.join("")}var nS={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */nS.read=function(e,t,n,r,o){var i,s,a=o*8-r-1,l=(1<<a)-1,c=l>>1,u=-7,f=n?o-1:0,h=n?-1:1,p=e[t+f];for(f+=h,i=p&(1<<-u)-1,p>>=-u,u+=a;u>0;i=i*256+e[t+f],f+=h,u-=8);for(s=i&(1<<-u)-1,i>>=-u,u+=r;u>0;s=s*256+e[t+f],f+=h,u-=8);if(i===0)i=1-c;else{if(i===l)return s?NaN:(p?-1:1)*(1/0);s=s+Math.pow(2,r),i=i-c}return(p?-1:1)*s*Math.pow(2,i-r)};nS.write=function(e,t,n,r,o,i){var s,a,l,c=i*8-o-1,u=(1<<c)-1,f=u>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,m=r?1:-1,v=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+f>=1?t+=h/l:t+=h*Math.pow(2,1-f),t*l>=2&&(s++,l/=2),s+f>=u?(a=0,s=u):s+f>=1?(a=(t*l-1)*Math.pow(2,o),s=s+f):(a=t*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;e[n+p]=a&255,p+=m,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;e[n+p]=s&255,p+=m,s/=256,c-=8);e[n+p-m]|=v*128};/*!
44
44
  * The buffer module from node.js, for the browser.
45
45
  *
46
46
  * @author Feross Aboukhadijeh <https://feross.org>
@@ -461,7 +461,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
461
461
  To pick up a draggable item, press the space bar.
462
462
  While dragging, use the arrow keys to move the item.
463
463
  Press space again to drop the item in its new position, or press escape to cancel.
464
- `},uY={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function dY(e){let{announcements:t=uY,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=cY}=e;const{announce:i,announcement:s}=sY(),a=mp("DndLiveRegion"),[l,c]=g.useState(!1);if(g.useEffect(()=>{c(!0)},[]),aY(g.useMemo(()=>({onDragStart(f){let{active:h}=f;i(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:p}=f;t.onDragMove&&i(t.onDragMove({active:h,over:p}))},onDragOver(f){let{active:h,over:p}=f;i(t.onDragOver({active:h,over:p}))},onDragEnd(f){let{active:h,over:p}=f;i(t.onDragEnd({active:h,over:p}))},onDragCancel(f){let{active:h,over:p}=f;i(t.onDragCancel({active:h,over:p}))}}),[i,t])),!l)return null;const u=Ce.createElement(Ce.Fragment,null,Ce.createElement(oY,{id:r,value:o.draggable}),Ce.createElement(iY,{id:a,announcement:s}));return n?Fr.createPortal(u,n):u}var tn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(tn||(tn={}));function Ug(){}function i0(e,t){return g.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function fY(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const ti=Object.freeze({x:0,y:0});function RA(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function AA(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function hY(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function ZN(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function IA(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function QN(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const pY=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=QN(t,t.left,t.top),i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=RA(QN(l),o);i.push({id:a,data:{droppableContainer:s,value:c}})}}return i.sort(AA)},mY=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=ZN(t),i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=ZN(l),u=o.reduce((h,p,m)=>h+RA(c[m],p),0),f=Number((u/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:f}})}}return i.sort(AA)};function gY(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-r,a=i-n;if(r<o&&n<i){const l=t.width*t.height,c=e.width*e.height,u=s*a,f=u/(l+c-u);return Number(f.toFixed(4))}return 0}const vY=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:s}=i,a=n.get(s);if(a){const l=gY(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(hY)};function yY(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function DA(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ti}function xY(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const bY=xY(1);function wY(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function SY(e,t,n){const r=wY(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:a}=r,l=e.left-s-(1-o)*parseFloat(n),c=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,f=i?e.height/i:e.height;return{width:u,height:f,top:c,right:l+u,bottom:c+f,left:l}}const kY={ignoreTransform:!1};function rd(e,t){t===void 0&&(t=kY);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=Er(e).getComputedStyle(e);c&&(n=SY(n,c,u))}const{top:r,left:o,width:i,height:s,bottom:a,right:l}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:l}}function eP(e){return rd(e,{ignoreTransform:!0})}function EY(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function CY(e,t){return t===void 0&&(t=Er(e).getComputedStyle(e)),t.position==="fixed"}function NY(e,t){t===void 0&&(t=Er(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function xy(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(fk(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!hp(o)||TA(o)||n.includes(o))return n;const i=Er(e).getComputedStyle(o);return o!==e&&NY(o,i)&&n.push(o),CY(o,i)?n:r(o.parentNode)}return e?r(e):n}function LA(e){const[t]=xy(e,1);return t??null}function s0(e){return!yy||!e?null:td(e)?e:dk(e)?fk(e)||e===nd(e).scrollingElement?window:hp(e)?e:null:null}function FA(e){return td(e)?e.scrollX:e.scrollLeft}function zA(e){return td(e)?e.scrollY:e.scrollTop}function nw(e){return{x:FA(e),y:zA(e)}}var fn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(fn||(fn={}));function $A(e){return!yy||!e?!1:e===document.scrollingElement}function BA(e){const t={x:0,y:0},n=$A(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const PY={x:.2,y:.2};function _Y(e,t,n,r,o){let{top:i,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),o===void 0&&(o=PY);const{isTop:c,isBottom:u,isLeft:f,isRight:h}=BA(e),p={x:0,y:0},m={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!c&&i<=t.top+v.height?(p.y=fn.Backward,m.y=r*Math.abs((t.top+v.height-i)/v.height)):!u&&l>=t.bottom-v.height&&(p.y=fn.Forward,m.y=r*Math.abs((t.bottom-v.height-l)/v.height)),!h&&a>=t.right-v.width?(p.x=fn.Forward,m.x=r*Math.abs((t.right-v.width-a)/v.width)):!f&&s<=t.left+v.width&&(p.x=fn.Backward,m.x=r*Math.abs((t.left+v.width-s)/v.width)),{direction:p,speed:m}}function jY(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function VA(e){return e.reduce((t,n)=>Zc(t,nw(n)),ti)}function TY(e){return e.reduce((t,n)=>t+FA(n),0)}function OY(e){return e.reduce((t,n)=>t+zA(n),0)}function MY(e,t){if(t===void 0&&(t=rd),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);LA(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const RY=[["x",["left","right"],TY],["y",["top","bottom"],OY]];class mk{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=xy(n),o=VA(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of RY)for(const l of s)Object.defineProperty(this,l,{get:()=>{const c=a(r),u=o[i]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class kf{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function AY(e){const{EventTarget:t}=Er(e);return e instanceof t?e:nd(e)}function a0(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var io;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(io||(io={}));function tP(e){e.preventDefault()}function IY(e){e.stopPropagation()}var Qe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Qe||(Qe={}));const UA={start:[Qe.Space,Qe.Enter],cancel:[Qe.Esc],end:[Qe.Space,Qe.Enter,Qe.Tab]},DY=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Qe.Right:return{...n,x:n.x+25};case Qe.Left:return{...n,x:n.x-25};case Qe.Down:return{...n,y:n.y+25};case Qe.Up:return{...n,y:n.y-25}}};class gk{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new kf(nd(n)),this.windowListeners=new kf(Er(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(io.Resize,this.handleCancel),this.windowListeners.add(io.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(io.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&MY(r),n(ti)}handleKeyDown(t){if(pk(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=UA,coordinateGetter:s=DY,scrollBehavior:a="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,u=c?{x:c.left,y:c.top}:ti;this.referenceCoordinates||(this.referenceCoordinates=u);const f=s(t,{active:n,context:r.current,currentCoordinates:u});if(f){const h=yh(f,u),p={x:0,y:0},{scrollableAncestors:m}=r.current;for(const v of m){const x=t.code,{isTop:b,isRight:w,isLeft:S,isBottom:C,maxScroll:N,minScroll:P}=BA(v),_=jY(v),O={x:Math.min(x===Qe.Right?_.right-_.width/2:_.right,Math.max(x===Qe.Right?_.left:_.left+_.width/2,f.x)),y:Math.min(x===Qe.Down?_.bottom-_.height/2:_.bottom,Math.max(x===Qe.Down?_.top:_.top+_.height/2,f.y))},M=x===Qe.Right&&!w||x===Qe.Left&&!S,D=x===Qe.Down&&!C||x===Qe.Up&&!b;if(M&&O.x!==f.x){const U=v.scrollLeft+h.x,z=x===Qe.Right&&U<=N.x||x===Qe.Left&&U>=P.x;if(z&&!h.y){v.scrollTo({left:U,behavior:a});return}z?p.x=v.scrollLeft-U:p.x=x===Qe.Right?v.scrollLeft-N.x:v.scrollLeft-P.x,p.x&&v.scrollBy({left:-p.x,behavior:a});break}else if(D&&O.y!==f.y){const U=v.scrollTop+h.y,z=x===Qe.Down&&U<=N.y||x===Qe.Up&&U>=P.y;if(z&&!h.x){v.scrollTo({top:U,behavior:a});return}z?p.y=v.scrollTop-U:p.y=x===Qe.Down?v.scrollTop-N.y:v.scrollTop-P.y,p.y&&v.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,Zc(yh(f,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}gk.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=UA,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function nP(e){return!!(e&&"distance"in e)}function rP(e){return!!(e&&"delay"in e)}class vk{constructor(t,n,r){var o;r===void 0&&(r=AY(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:s}=i;this.props=t,this.events=n,this.document=nd(s),this.documentListeners=new kf(this.document),this.listeners=new kf(r),this.windowListeners=new kf(Er(s)),this.initialCoordinates=(o=tw(i))!=null?o:ti,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(io.Resize,this.handleCancel),this.windowListeners.add(io.DragStart,tP),this.windowListeners.add(io.VisibilityChange,this.handleCancel),this.windowListeners.add(io.ContextMenu,tP),this.documentListeners.add(io.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(rP(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(nP(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(io.Click,IY,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(io.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const l=(n=tw(t))!=null?n:ti,c=yh(o,l);if(!r&&a){if(nP(a)){if(a.tolerance!=null&&a0(c,a.tolerance))return this.handleCancel();if(a0(c,a.distance))return this.handleStart()}if(rP(a)&&a0(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Qe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const LY={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class WA extends vk{constructor(t){const{event:n}=t,r=nd(n.target);super(t,LY,r)}}WA.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const FY={move:{name:"mousemove"},end:{name:"mouseup"}};var rw;(function(e){e[e.RightClick=2]="RightClick"})(rw||(rw={}));class HA extends vk{constructor(t){super(t,FY,nd(t.event.target))}}HA.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===rw.RightClick?!1:(r==null||r({event:n}),!0)}}];const l0={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class KA extends vk{constructor(t){super(t,l0)}static setup(){return window.addEventListener(l0.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(l0.move.name,t)};function t(){}}}KA.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var Ef;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ef||(Ef={}));var Wg;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Wg||(Wg={}));function zY(e){let{acceleration:t,activator:n=Ef.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=Wg.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:f,threshold:h}=e;const p=BY({delta:f,disabled:!i}),[m,v]=Qq(),x=g.useRef({x:0,y:0}),b=g.useRef({x:0,y:0}),w=g.useMemo(()=>{switch(n){case Ef.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Ef.DraggableRect:return o}},[n,o,l]),S=g.useRef(null),C=g.useCallback(()=>{const P=S.current;if(!P)return;const _=x.current.x*b.current.x,O=x.current.y*b.current.y;P.scrollBy(_,O)},[]),N=g.useMemo(()=>a===Wg.TreeOrder?[...c].reverse():c,[a,c]);g.useEffect(()=>{if(!i||!c.length||!w){v();return}for(const P of N){if((r==null?void 0:r(P))===!1)continue;const _=c.indexOf(P),O=u[_];if(!O)continue;const{direction:M,speed:D}=_Y(P,O,w,t,h);for(const U of["x","y"])p[U][M[U]]||(D[U]=0,M[U]=0);if(D.x>0||D.y>0){v(),S.current=P,m(C,s),x.current=D,b.current=M;return}}x.current={x:0,y:0},b.current={x:0,y:0},v()},[t,C,r,v,i,s,JSON.stringify(w),JSON.stringify(p),m,c,N,u,JSON.stringify(h)])}const $Y={x:{[fn.Backward]:!1,[fn.Forward]:!1},y:{[fn.Backward]:!1,[fn.Forward]:!1}};function BY(e){let{delta:t,disabled:n}=e;const r=ew(t);return pp(o=>{if(n||!r||!o)return $Y;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[fn.Backward]:o.x[fn.Backward]||i.x===-1,[fn.Forward]:o.x[fn.Forward]||i.x===1},y:{[fn.Backward]:o.y[fn.Backward]||i.y===-1,[fn.Forward]:o.y[fn.Forward]||i.y===1}}},[n,t,r])}function VY(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return pp(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function UY(e,t){return g.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...i]},[]),[e,t])}var bh;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(bh||(bh={}));var ow;(function(e){e.Optimized="optimized"})(ow||(ow={}));const oP=new Map;function WY(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=g.useState(null),{frequency:a,measure:l,strategy:c}=o,u=g.useRef(e),f=x(),h=vh(f),p=g.useCallback(function(b){b===void 0&&(b=[]),!h.current&&s(w=>w===null?b:w.concat(b.filter(S=>!w.includes(S))))},[h]),m=g.useRef(null),v=pp(b=>{if(f&&!n)return oP;if(!b||b===oP||u.current!==e||i!=null){const w=new Map;for(let S of e){if(!S)continue;if(i&&i.length>0&&!i.includes(S.id)&&S.rect.current){w.set(S.id,S.rect.current);continue}const C=S.node.current,N=C?new mk(l(C),C):null;S.rect.current=N,N&&w.set(S.id,N)}return w}return b},[e,i,n,f,l]);return g.useEffect(()=>{u.current=e},[e]),g.useEffect(()=>{f||p()},[n,f]),g.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),g.useEffect(()=>{f||typeof a!="number"||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},a))},[a,f,p,...r]),{droppableRects:v,measureDroppableContainers:p,measuringScheduled:i!=null};function x(){switch(c){case bh.Always:return!1;case bh.BeforeDragging:return n;default:return!n}}}function GA(e,t){return pp(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function HY(e,t){return GA(e,t)}function KY(e){let{callback:t,disabled:n}=e;const r=hk(t),o=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return g.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function by(e){let{callback:t,disabled:n}=e;const r=hk(t),o=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return g.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function GY(e){return new mk(rd(e),e)}function iP(e,t,n){t===void 0&&(t=GY);const[r,o]=g.useState(null);function i(){o(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const s=KY({callback(l){if(e)for(const c of l){const{type:u,target:f}=c;if(u==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),a=by({callback:i});return Ei(()=>{i(),e?(a==null||a.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),s==null||s.disconnect())},[e]),r}function qY(e){const t=GA(e);return DA(e,t)}const sP=[];function YY(e){const t=g.useRef(e),n=pp(r=>e?r&&r!==sP&&e&&t.current&&e.parentNode===t.current.parentNode?r:xy(e):sP,[e]);return g.useEffect(()=>{t.current=e},[e]),n}function JY(e){const[t,n]=g.useState(null),r=g.useRef(e),o=g.useCallback(i=>{const s=s0(i.target);s&&n(a=>a?(a.set(s,nw(s)),new Map(a)):null)},[]);return g.useEffect(()=>{const i=r.current;if(e!==i){s(i);const a=e.map(l=>{const c=s0(l);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,nw(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(l=>{const c=s0(l);c==null||c.removeEventListener("scroll",o)})}},[o,e]),g.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>Zc(i,s),ti):VA(e):ti,[e,t])}function aP(e,t){t===void 0&&(t=[]);const n=g.useRef(null);return g.useEffect(()=>{n.current=null},t),g.useEffect(()=>{const r=e!==ti;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?yh(e,n.current):ti}function XY(e){g.useEffect(()=>{if(!yy)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function ZY(e,t){return g.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=s=>{i(s,t)},n},{}),[e,t])}function qA(e){return g.useMemo(()=>e?EY(e):null,[e])}const lP=[];function QY(e,t){t===void 0&&(t=rd);const[n]=e,r=qA(n?Er(n):null),[o,i]=g.useState(lP);function s(){i(()=>e.length?e.map(l=>$A(l)?r:new mk(t(l),l)):lP)}const a=by({callback:s});return Ei(()=>{a==null||a.disconnect(),s(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function eJ(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return hp(t)?t:e}function tJ(e){let{measure:t}=e;const[n,r]=g.useState(null),o=g.useCallback(c=>{for(const{target:u}of c)if(hp(u)){r(f=>{const h=t(u);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),i=by({callback:o}),s=g.useCallback(c=>{const u=eJ(c);i==null||i.disconnect(),u&&(i==null||i.observe(u)),r(u?t(u):null)},[t,i]),[a,l]=Vg(s);return g.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const nJ=[{sensor:WA,options:{}},{sensor:gk,options:{}}],rJ={current:{}},Om={draggable:{measure:eP},droppable:{measure:eP,strategy:bh.WhileDragging,frequency:ow.Optimized},dragOverlay:{measure:rd}};class Cf extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const oJ={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Cf,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ug},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Om,measureDroppableContainers:Ug,windowRect:null,measuringScheduled:!1},iJ={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ug,draggableNodes:new Map,over:null,measureDroppableContainers:Ug},wy=g.createContext(iJ),YA=g.createContext(oJ);function sJ(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Cf}}}function aJ(e,t){switch(t.type){case tn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case tn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case tn.DragEnd:case tn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case tn.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Cf(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case tn.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new Cf(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case tn.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Cf(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function lJ(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=g.useContext(wy),i=ew(r),s=ew(n==null?void 0:n.id);return g.useEffect(()=>{if(!t&&!r&&i&&s!=null){if(!pk(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const u of[l.current,c.current]){if(!u)continue;const f=nY(u);if(f){f.focus();break}}})}},[r,t,o,s,i]),null}function cJ(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function uJ(e){return g.useMemo(()=>({draggable:{...Om.draggable,...e==null?void 0:e.draggable},droppable:{...Om.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Om.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function dJ(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=g.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;Ei(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!r)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const u=n(c),f=DA(u,r);if(s||(f.x=0),a||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=LA(c);h&&h.scrollBy({top:f.y,left:f.x})}},[t,s,a,r,n])}const JA=g.createContext({...ti,scaleX:1,scaleY:1});var Bs;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Bs||(Bs={}));const fJ=g.memo(function(t){var n,r,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:u=nJ,collisionDetection:f=vY,measuring:h,modifiers:p,...m}=t;const v=g.useReducer(aJ,void 0,sJ),[x,b]=v,[w,S]=lY(),[C,N]=g.useState(Bs.Uninitialized),P=C===Bs.Initialized,{draggable:{active:_,nodes:O,translate:M},droppable:{containers:D}}=x,U=_!=null?O.get(_):null,z=g.useRef({initial:null,translated:null}),K=g.useMemo(()=>{var Dn;return _!=null?{id:_,data:(Dn=U==null?void 0:U.data)!=null?Dn:rJ,rect:z}:null},[_,U]),H=g.useRef(null),[V,I]=g.useState(null),[A,j]=g.useState(null),L=vh(m,Object.values(m)),$=mp("DndDescribedBy",s),W=g.useMemo(()=>D.getEnabled(),[D]),G=uJ(h),{droppableRects:Pe,measureDroppableContainers:ke,measuringScheduled:oe}=WY(W,{dragging:P,dependencies:[M.x,M.y],config:G.droppable}),ae=VY(O,_),X=g.useMemo(()=>A?tw(A):null,[A]),Ee=AF(),De=HY(ae,G.draggable.measure);dJ({activeNode:_!=null?O.get(_):null,config:Ee.layoutShiftCompensation,initialRect:De,measure:G.draggable.measure});const he=iP(ae,G.draggable.measure,De),Fe=iP(ae?ae.parentElement:null),_e=g.useRef({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:Pe,draggableNodes:O,draggingNode:null,draggingNodeRect:null,droppableContainers:D,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),tt=D.getNodeFor((n=_e.current.over)==null?void 0:n.id),gt=tJ({measure:G.dragOverlay.measure}),Kt=(r=gt.nodeRef.current)!=null?r:ae,T=P?(o=gt.rect)!=null?o:he:null,k=!!(gt.nodeRef.current&&gt.rect),E=qY(k?null:he),R=qA(Kt?Er(Kt):null),F=YY(P?tt??ae:null),J=QY(F),Q=cJ(p,{transform:{x:M.x-E.x,y:M.y-E.y,scaleX:1,scaleY:1},activatorEvent:A,active:K,activeNodeRect:he,containerNodeRect:Fe,draggingNodeRect:T,over:_e.current.over,overlayNodeRect:gt.rect,scrollableAncestors:F,scrollableAncestorRects:J,windowRect:R}),Xe=X?Zc(X,M):null,ct=JY(F),wt=aP(ct),cn=aP(ct,[he]),dt=Zc(Q,wt),Po=T?bY(T,Q):null,xs=K&&Po?f({active:K,collisionRect:Po,droppableRects:Pe,droppableContainers:W,pointerCoordinates:Xe}):null,ud=IA(xs,"id"),[bs,OE]=g.useState(null),jF=k?Q:Zc(Q,cn),TF=yY(jF,(i=bs==null?void 0:bs.rect)!=null?i:null,he),Qy=g.useRef(null),ME=g.useCallback((Dn,Nr)=>{let{sensor:Pr,options:ws}=Nr;if(H.current==null)return;const no=O.get(H.current);if(!no)return;const _r=Dn.nativeEvent,si=new Pr({active:H.current,activeNode:no,event:_r,options:ws,context:_e,onAbort(wn){if(!O.get(wn))return;const{onDragAbort:ai}=L.current,Mi={id:wn};ai==null||ai(Mi),w({type:"onDragAbort",event:Mi})},onPending(wn,Ss,ai,Mi){if(!O.get(wn))return;const{onDragPending:fd}=L.current,ks={id:wn,constraint:Ss,initialCoordinates:ai,offset:Mi};fd==null||fd(ks),w({type:"onDragPending",event:ks})},onStart(wn){const Ss=H.current;if(Ss==null)return;const ai=O.get(Ss);if(!ai)return;const{onDragStart:Mi}=L.current,dd={activatorEvent:_r,active:{id:Ss,data:ai.data,rect:z}};Fr.unstable_batchedUpdates(()=>{Mi==null||Mi(dd),N(Bs.Initializing),b({type:tn.DragStart,initialCoordinates:wn,active:Ss}),w({type:"onDragStart",event:dd}),I(Qy.current),j(_r)})},onMove(wn){b({type:tn.DragMove,coordinates:wn})},onEnd:sc(tn.DragEnd),onCancel:sc(tn.DragCancel)});Qy.current=si;function sc(wn){return async function(){const{active:ai,collisions:Mi,over:dd,scrollAdjustedTranslate:fd}=_e.current;let ks=null;if(ai&&fd){const{cancelDrop:hd}=L.current;ks={activatorEvent:_r,active:ai,collisions:Mi,delta:fd,over:dd},wn===tn.DragEnd&&typeof hd=="function"&&await Promise.resolve(hd(ks))&&(wn=tn.DragCancel)}H.current=null,Fr.unstable_batchedUpdates(()=>{b({type:wn}),N(Bs.Uninitialized),OE(null),I(null),j(null),Qy.current=null;const hd=wn===tn.DragEnd?"onDragEnd":"onDragCancel";if(ks){const ex=L.current[hd];ex==null||ex(ks),w({type:hd,event:ks})}})}}},[O]),OF=g.useCallback((Dn,Nr)=>(Pr,ws)=>{const no=Pr.nativeEvent,_r=O.get(ws);if(H.current!==null||!_r||no.dndKit||no.defaultPrevented)return;const si={active:_r};Dn(Pr,Nr.options,si)===!0&&(no.dndKit={capturedBy:Nr.sensor},H.current=ws,ME(Pr,Nr))},[O,ME]),RE=UY(u,OF);XY(u),Ei(()=>{he&&C===Bs.Initializing&&N(Bs.Initialized)},[he,C]),g.useEffect(()=>{const{onDragMove:Dn}=L.current,{active:Nr,activatorEvent:Pr,collisions:ws,over:no}=_e.current;if(!Nr||!Pr)return;const _r={active:Nr,activatorEvent:Pr,collisions:ws,delta:{x:dt.x,y:dt.y},over:no};Fr.unstable_batchedUpdates(()=>{Dn==null||Dn(_r),w({type:"onDragMove",event:_r})})},[dt.x,dt.y]),g.useEffect(()=>{const{active:Dn,activatorEvent:Nr,collisions:Pr,droppableContainers:ws,scrollAdjustedTranslate:no}=_e.current;if(!Dn||H.current==null||!Nr||!no)return;const{onDragOver:_r}=L.current,si=ws.get(ud),sc=si&&si.rect.current?{id:si.id,rect:si.rect.current,data:si.data,disabled:si.disabled}:null,wn={active:Dn,activatorEvent:Nr,collisions:Pr,delta:{x:no.x,y:no.y},over:sc};Fr.unstable_batchedUpdates(()=>{OE(sc),_r==null||_r(wn),w({type:"onDragOver",event:wn})})},[ud]),Ei(()=>{_e.current={activatorEvent:A,active:K,activeNode:ae,collisionRect:Po,collisions:xs,droppableRects:Pe,draggableNodes:O,draggingNode:Kt,draggingNodeRect:T,droppableContainers:D,over:bs,scrollableAncestors:F,scrollAdjustedTranslate:dt},z.current={initial:T,translated:Po}},[K,ae,xs,Po,O,Kt,T,Pe,D,bs,F,dt]),zY({...Ee,delta:M,draggingRect:Po,pointerCoordinates:Xe,scrollableAncestors:F,scrollableAncestorRects:J});const MF=g.useMemo(()=>({active:K,activeNode:ae,activeNodeRect:he,activatorEvent:A,collisions:xs,containerNodeRect:Fe,dragOverlay:gt,draggableNodes:O,droppableContainers:D,droppableRects:Pe,over:bs,measureDroppableContainers:ke,scrollableAncestors:F,scrollableAncestorRects:J,measuringConfiguration:G,measuringScheduled:oe,windowRect:R}),[K,ae,he,A,xs,Fe,gt,O,D,Pe,bs,ke,F,J,G,oe,R]),RF=g.useMemo(()=>({activatorEvent:A,activators:RE,active:K,activeNodeRect:he,ariaDescribedById:{draggable:$},dispatch:b,draggableNodes:O,over:bs,measureDroppableContainers:ke}),[A,RE,K,he,b,$,O,bs,ke]);return Ce.createElement(MA.Provider,{value:S},Ce.createElement(wy.Provider,{value:RF},Ce.createElement(YA.Provider,{value:MF},Ce.createElement(JA.Provider,{value:TF},c)),Ce.createElement(lJ,{disabled:(a==null?void 0:a.restoreFocus)===!1})),Ce.createElement(dY,{...a,hiddenTextDescribedById:$}));function AF(){const Dn=(V==null?void 0:V.autoScrollEnabled)===!1,Nr=typeof l=="object"?l.enabled===!1:l===!1,Pr=P&&!Dn&&!Nr;return typeof l=="object"?{...l,enabled:Pr}:{enabled:Pr}}}),hJ=g.createContext(null),cP="button",pJ="Draggable";function mJ(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=mp(pJ),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:f,over:h}=g.useContext(wy),{role:p=cP,roleDescription:m="draggable",tabIndex:v=0}=o??{},x=(l==null?void 0:l.id)===t,b=g.useContext(x?JA:hJ),[w,S]=Vg(),[C,N]=Vg(),P=ZY(s,t),_=vh(n);Ei(()=>(f.set(t,{id:t,key:i,node:w,activatorNode:C,data:_}),()=>{const M=f.get(t);M&&M.key===i&&f.delete(t)}),[f,t]);const O=g.useMemo(()=>({role:p,tabIndex:v,"aria-disabled":r,"aria-pressed":x&&p===cP?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,v,x,m,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:O,isDragging:x,listeners:r?void 0:P,node:w,over:h,setNodeRef:S,setActivatorNodeRef:N,transform:b}}function gJ(){return g.useContext(YA)}const vJ="Droppable",yJ={timeout:25};function xJ(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=mp(vJ),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=g.useContext(wy),u=g.useRef({disabled:n}),f=g.useRef(!1),h=g.useRef(null),p=g.useRef(null),{disabled:m,updateMeasurementsFor:v,timeout:x}={...yJ,...o},b=vh(v??r),w=g.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{c(Array.isArray(b.current)?b.current:[b.current]),p.current=null},x)},[x]),S=by({callback:w,disabled:m||!s}),C=g.useCallback((O,M)=>{S&&(M&&(S.unobserve(M),f.current=!1),O&&S.observe(O))},[S]),[N,P]=Vg(C),_=vh(t);return g.useEffect(()=>{!S||!N.current||(S.disconnect(),f.current=!1,S.observe(N.current))},[N,S]),g.useEffect(()=>(a({type:tn.RegisterDroppable,element:{id:r,key:i,disabled:n,node:N,rect:h,data:_}}),()=>a({type:tn.UnregisterDroppable,key:i,id:r})),[r]),g.useEffect(()=>{n!==u.current.disabled&&(a({type:tn.SetDroppableDisabled,id:r,key:i,disabled:n}),u.current.disabled=n)},[r,i,n,a]),{active:s,rect:h,isOver:(l==null?void 0:l.id)===r,node:N,over:l,setNodeRef:P}}function yk(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function bJ(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function sm(e){return e!==null&&e>=0}function wJ(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function SJ(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const XA=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=yk(t,r,n),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},am={scaleX:1,scaleY:1},kJ=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:s}=e;const a=(t=i[n])!=null?t:r;if(!a)return null;if(o===n){const c=i[s];return c?{x:0,y:n<s?c.top+c.height-(a.top+a.height):c.top-a.top,...am}:null}const l=EJ(i,o,n);return o>n&&o<=s?{x:0,y:-a.height-l,...am}:o<n&&o>=s?{x:0,y:a.height+l,...am}:{x:0,y:0,...am}};function EJ(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const ZA="Sortable",QA=Ce.createContext({activeIndex:-1,containerId:ZA,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:XA,disabled:{draggable:!1,droppable:!1}});function CJ(e){let{children:t,id:n,items:r,strategy:o=XA,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:u}=gJ(),f=mp(ZA,n),h=a.rect!==null,p=g.useMemo(()=>r.map(P=>typeof P=="object"&&"id"in P?P.id:P),[r]),m=s!=null,v=s?p.indexOf(s.id):-1,x=c?p.indexOf(c.id):-1,b=g.useRef(p),w=!wJ(p,b.current),S=x!==-1&&v===-1||w,C=SJ(i);Ei(()=>{w&&m&&u(p)},[w,p,m,u]),g.useEffect(()=>{b.current=p},[p]);const N=g.useMemo(()=>({activeIndex:v,containerId:f,disabled:C,disableTransforms:S,items:p,overIndex:x,useDragOverlay:h,sortedRects:bJ(p,l),strategy:o}),[v,f,C.draggable,C.droppable,S,p,x,l,h,o]);return Ce.createElement(QA.Provider,{value:N},t)}const NJ=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return yk(n,r,o).indexOf(t)},PJ=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:l,transition:c}=e;return!c||!r||a!==i&&o===s?!1:n?!0:s!==o&&t===l},_J={duration:200,easing:"ease"},eI="transform",jJ=xh.Transition.toString({property:eI,duration:0,easing:"linear"}),TJ={roleDescription:"sortable"};function OJ(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,s]=g.useState(null),a=g.useRef(n);return Ei(()=>{if(!t&&n!==a.current&&r.current){const l=o.current;if(l){const c=rd(r.current,{ignoreTransform:!0}),u={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(u.x||u.y)&&s(u)}}n!==a.current&&(a.current=n)},[t,n,r,o]),g.useEffect(()=>{i&&s(null)},[i]),i}function MJ(e){let{animateLayoutChanges:t=PJ,attributes:n,disabled:r,data:o,getNewIndex:i=NJ,id:s,strategy:a,resizeObserverConfig:l,transition:c=_J}=e;const{items:u,containerId:f,activeIndex:h,disabled:p,disableTransforms:m,sortedRects:v,overIndex:x,useDragOverlay:b,strategy:w}=g.useContext(QA),S=RJ(r,p),C=u.indexOf(s),N=g.useMemo(()=>({sortable:{containerId:f,index:C,items:u},...o}),[f,o,C,u]),P=g.useMemo(()=>u.slice(u.indexOf(s)),[u,s]),{rect:_,node:O,isOver:M,setNodeRef:D}=xJ({id:s,data:N,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:P,...l}}),{active:U,activatorEvent:z,activeNodeRect:K,attributes:H,setNodeRef:V,listeners:I,isDragging:A,over:j,setActivatorNodeRef:L,transform:$}=mJ({id:s,data:N,attributes:{...TJ,...n},disabled:S.draggable}),W=Zq(D,V),G=!!U,Pe=G&&!m&&sm(h)&&sm(x),ke=!b&&A,oe=ke&&Pe?$:null,X=Pe?oe??(a??w)({rects:v,activeNodeRect:K,activeIndex:h,overIndex:x,index:C}):null,Ee=sm(h)&&sm(x)?i({id:s,items:u,activeIndex:h,overIndex:x}):C,De=U==null?void 0:U.id,he=g.useRef({activeId:De,items:u,newIndex:Ee,containerId:f}),Fe=u!==he.current.items,_e=t({active:U,containerId:f,isDragging:A,isSorting:G,id:s,index:C,items:u,newIndex:he.current.newIndex,previousItems:he.current.items,previousContainerId:he.current.containerId,transition:c,wasDragging:he.current.activeId!=null}),tt=OJ({disabled:!_e,index:C,node:O,rect:_});return g.useEffect(()=>{G&&he.current.newIndex!==Ee&&(he.current.newIndex=Ee),f!==he.current.containerId&&(he.current.containerId=f),u!==he.current.items&&(he.current.items=u)},[G,Ee,f,u]),g.useEffect(()=>{if(De===he.current.activeId)return;if(De&&!he.current.activeId){he.current.activeId=De;return}const Kt=setTimeout(()=>{he.current.activeId=De},50);return()=>clearTimeout(Kt)},[De]),{active:U,activeIndex:h,attributes:H,data:N,rect:_,index:C,newIndex:Ee,items:u,isOver:M,isSorting:G,isDragging:A,listeners:I,node:O,overIndex:x,over:j,setNodeRef:W,setActivatorNodeRef:L,setDroppableNodeRef:D,setDraggableNodeRef:V,transform:tt??X,transition:gt()};function gt(){if(tt||Fe&&he.current.newIndex===C)return jJ;if(!(ke&&!pk(z)||!c)&&(G||_e))return xh.Transition.toString({...c,property:eI})}}function RJ(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function Hg(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const AJ=[Qe.Down,Qe.Right,Qe.Up,Qe.Left],IJ=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(AJ.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];i.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const h=o.get(f.id);if(h)switch(e.code){case Qe.Down:r.top<h.top&&l.push(f);break;case Qe.Up:r.top>h.top&&l.push(f);break;case Qe.Left:r.left>h.left&&l.push(f);break;case Qe.Right:r.left<h.left&&l.push(f);break}});const c=mY({active:n,collisionRect:r,droppableRects:o,droppableContainers:l,pointerCoordinates:null});let u=IA(c,"id");if(u===(s==null?void 0:s.id)&&c.length>1&&(u=c[1].id),u!=null){const f=i.get(n.id),h=i.get(u),p=h?o.get(h.id):null,m=h==null?void 0:h.node.current;if(m&&p&&f&&h){const x=xy(m).some((P,_)=>a[_]!==P),b=tI(f,h),w=DJ(f,h),S=x||!b?{x:0,y:0}:{x:w?r.width-p.width:0,y:w?r.height-p.height:0},C={x:p.left,y:p.top};return S.x&&S.y?C:yh(C,S)}}}};function tI(e,t){return!Hg(e)||!Hg(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function DJ(e,t){return!Hg(e)||!Hg(t)||!tI(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function qr({}){return null}function nI({path:e,autoFocus:t}){const n="string",r=Ft(e),o=lt(e,"string"),{patchPath:i,addPatch:s}=bn(e),[a,l]=g.useState(null),c="data"in o&&o.data,u="clientSideOnly"in o&&o.clientSideOnly;return g.useEffect(()=>{u===!1&&l(typeof c=="string"?c:null)},[c,u]),r.status==="error"?d.jsx(Xt,{path:e,error:r.error,type:n}):o.status==="error"?d.jsx(it,{path:e,error:o.error,schema:r}):o.status=="not-found"||r.status==="not-found"?d.jsx(Mn,{path:e,type:n}):r.status==="loading"?d.jsx(yt,{path:e,type:n}):!("data"in o)||o.data===void 0?d.jsx(yt,{path:e,type:n}):r.data.type!==n?d.jsx(kr,{path:e,expectedType:n,actualType:r.data.type}):d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),d.jsx(Qu,{className:"pr-6 sm:pr-8 sm:w-[calc(100%-0.5rem)]",autoFocus:t,value:a||"",onChange:f=>{l(f.target.value),s([{op:"replace",path:i,value:f.target.value}],n)}})]})}function LJ({path:e}){const t=lt(e,"string");return t.status==="error"?d.jsx(it,{path:e,error:t.error}):!("data"in t)||t.data===void 0?d.jsx(wr,{path:e}):t.data===null?d.jsx(Sr,{path:e}):d.jsx("div",{className:"truncate",children:t.data})}function FJ({path:e}){const t="boolean",n=Ft(e),r=lt(e,t),{patchPath:o,addPatch:i}=bn(e);if(n.status==="error")return d.jsx(Xt,{path:e,error:n.error,type:t});if(r.status==="error")return d.jsx(it,{path:e,error:r.error,schema:n});if(r.status=="not-found"||n.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(n.status==="loading")return d.jsx(yt,{path:e,type:t});if(!("data"in r)||r.data===void 0)return d.jsx(yt,{path:e,type:t});if(n.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:n.data.type});const s=r.data,a=s===null?"indeterminate":s;return d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),d.jsx(ed,{checked:a,onCheckedChange:()=>{let l=!1;n.data.opt?a===!0?l=null:a===null?l=!1:a===!1?l=!0:(console.warn("Unexpected value for boolean field",a),l=!1):a===!0?l=!1:a==="indeterminate"||a===!1?l=!0:(console.warn("Unexpected value for boolean field",a),l=!1),i([{op:"replace",path:o,value:l}],n.data.type)}})]})}function zJ({path:e,source:t,isNullable:n,loadingStatus:r}){const{addPatch:o,patchPath:i}=bn(e);return typeof t!="boolean"&&t!==null?d.jsx(it,{path:e,error:"Expected boolean"}):d.jsx(ed,{id:e,disabled:r==="loading",checked:t===null?"indeterminate":typeof t=="boolean"?t:!1,onCheckedChange:()=>{o(t===null?[{op:"replace",path:i,value:!0}]:t===!1&&n?[{op:"replace",path:i,value:null}]:t===!1?[{op:"replace",path:i,value:!0}]:[{op:"replace",path:i,value:!1}],"boolean")}})}function $J({path:e}){const t=lt(e,"boolean");return t.status==="error"?d.jsx(it,{path:e,error:t.error}):!("data"in t)||t.data===void 0?d.jsx(wr,{path:e}):t.data===null?d.jsx(Sr,{path:e}):t.data===!0?d.jsx("div",{className:"flex justify-center items-center w-4 h-4 rounded border border-border-primary",children:d.jsx(Ju,{className:"w-3 h-3"})}):t.data===!1?d.jsx("div",{className:"w-4 h-4 rounded border border-border-primary"}):(console.warn("Unexpected value for boolean field",t.data),d.jsx("div",{className:"w-4 h-4 rounded border-bg-brand-primary"}))}function BJ({path:e}){const t="number",n=Ft(e),r=lt(e,t),{patchPath:o,addPatch:i}=bn(e);if(n.status==="error")return d.jsx(Xt,{path:e,error:n.error,type:t});if(r.status==="error")return d.jsx(it,{path:e,error:r.error,schema:n});if(r.status=="not-found"||n.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(n.status==="loading")return d.jsx(yt,{path:e,type:t});if(!("data"in r)||r.data===void 0)return d.jsx(yt,{path:e,type:t});if(n.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:n.data.type});const s=r.data;return d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),d.jsx(Qu,{inputMode:"numeric",value:s||0,onChange:a=>{const l=Number(a.target.value);Number.isNaN(l)||i([{op:"replace",path:o,value:l}],t)}})]})}function VJ({path:e}){const t=lt(e,"number");return t.status==="error"?d.jsx(it,{path:e,error:t.error}):!("data"in t)||t.data===void 0?d.jsx(wr,{path:e}):t.data===null?d.jsx(Sr,{path:e}):d.jsx("div",{className:"truncate",children:t.data})}var UJ=[" ","Enter","ArrowUp","ArrowDown"],WJ=[" ","Enter"],gp="Select",[Sy,ky,HJ]=my(gp),[od,wge]=So(gp,[HJ,Ti]),Ey=Ti(),[KJ,Wa]=od(gp),[GJ,qJ]=od(gp),rI=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:h,required:p,form:m}=e,v=Ey(t),[x,b]=g.useState(null),[w,S]=g.useState(null),[C,N]=g.useState(!1),P=lp(c),[_=!1,O]=Kr({prop:r,defaultProp:o,onChange:i}),[M,D]=Kr({prop:s,defaultProp:a,onChange:l}),U=g.useRef(null),z=x?m||!!x.closest("form"):!0,[K,H]=g.useState(new Set),V=Array.from(K).map(I=>I.props.value).join(";");return d.jsx(np,{...v,children:d.jsxs(KJ,{required:p,scope:t,trigger:x,onTriggerChange:b,valueNode:w,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:N,contentId:Vr(),value:M,onValueChange:D,open:_,onOpenChange:O,dir:P,triggerPointerDownPosRef:U,disabled:h,children:[d.jsx(Sy.Provider,{scope:t,children:d.jsx(GJ,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(I=>{H(A=>new Set(A).add(I))},[]),onNativeOptionRemove:g.useCallback(I=>{H(A=>{const j=new Set(A);return j.delete(I),j})},[]),children:n})}),z?d.jsxs(NI,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:f,value:M,onChange:I=>D(I.target.value),disabled:h,form:m,children:[M===void 0?d.jsx("option",{value:""}):null,Array.from(K)]},V):null]})})};rI.displayName=gp;var oI="SelectTrigger",iI=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Ey(n),s=Wa(oI,n),a=s.disabled||r,l=Ve(t,s.onTriggerChange),c=ky(n),u=g.useRef("touch"),[f,h,p]=PI(v=>{const x=c().filter(S=>!S.disabled),b=x.find(S=>S.value===s.value),w=_I(x,v,b);w!==void 0&&s.onValueChange(w.value)}),m=v=>{a||(s.onOpenChange(!0),p()),v&&(s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return d.jsx(Hu,{asChild:!0,...i,children:d.jsx(Oe.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":CI(s.value)?"":void 0,...o,ref:l,onClick:te(o.onClick,v=>{v.currentTarget.focus(),u.current!=="mouse"&&m(v)}),onPointerDown:te(o.onPointerDown,v=>{u.current=v.pointerType;const x=v.target;x.hasPointerCapture(v.pointerId)&&x.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(m(v),v.preventDefault())}),onKeyDown:te(o.onKeyDown,v=>{const x=f.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&h(v.key),!(x&&v.key===" ")&&UJ.includes(v.key)&&(m(),v.preventDefault())})})})});iI.displayName=oI;var sI="SelectValue",aI=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Wa(sI,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,f=Ve(t,l.onValueNodeChange);return On(()=>{c(u)},[c,u]),d.jsx(Oe.span,{...a,ref:f,style:{pointerEvents:"none"},children:CI(l.value)?d.jsx(d.Fragment,{children:s}):i})});aI.displayName=sI;var YJ="SelectIcon",lI=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return d.jsx(Oe.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});lI.displayName=YJ;var JJ="SelectPortal",cI=e=>d.jsx(Ku,{asChild:!0,...e});cI.displayName=JJ;var zl="SelectContent",uI=g.forwardRef((e,t)=>{const n=Wa(zl,e.__scopeSelect),[r,o]=g.useState();if(On(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Fr.createPortal(d.jsx(dI,{scope:e.__scopeSelect,children:d.jsx(Sy.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),i):null}return d.jsx(fI,{...e,ref:t})});uI.displayName=zl;var Ro=10,[dI,Ha]=od(zl),XJ="SelectContentImpl",fI=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:v,avoidCollisions:x,...b}=e,w=Wa(zl,n),[S,C]=g.useState(null),[N,P]=g.useState(null),_=Ve(t,X=>C(X)),[O,M]=g.useState(null),[D,U]=g.useState(null),z=ky(n),[K,H]=g.useState(!1),V=g.useRef(!1);g.useEffect(()=>{if(S)return hy(S)},[S]),fy();const I=g.useCallback(X=>{const[Ee,...De]=z().map(_e=>_e.ref.current),[he]=De.slice(-1),Fe=document.activeElement;for(const _e of X)if(_e===Fe||(_e==null||_e.scrollIntoView({block:"nearest"}),_e===Ee&&N&&(N.scrollTop=0),_e===he&&N&&(N.scrollTop=N.scrollHeight),_e==null||_e.focus(),document.activeElement!==Fe))return},[z,N]),A=g.useCallback(()=>I([O,S]),[I,O,S]);g.useEffect(()=>{K&&A()},[K,A]);const{onOpenChange:j,triggerPointerDownPosRef:L}=w;g.useEffect(()=>{if(S){let X={x:0,y:0};const Ee=he=>{var Fe,_e;X={x:Math.abs(Math.round(he.pageX)-(((Fe=L.current)==null?void 0:Fe.x)??0)),y:Math.abs(Math.round(he.pageY)-(((_e=L.current)==null?void 0:_e.y)??0))}},De=he=>{X.x<=10&&X.y<=10?he.preventDefault():S.contains(he.target)||j(!1),document.removeEventListener("pointermove",Ee),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",Ee),document.addEventListener("pointerup",De,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ee),document.removeEventListener("pointerup",De,{capture:!0})}}},[S,j,L]),g.useEffect(()=>{const X=()=>j(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[j]);const[$,W]=PI(X=>{const Ee=z().filter(Fe=>!Fe.disabled),De=Ee.find(Fe=>Fe.ref.current===document.activeElement),he=_I(Ee,X,De);he&&setTimeout(()=>he.ref.current.focus())}),G=g.useCallback((X,Ee,De)=>{const he=!V.current&&!De;(w.value!==void 0&&w.value===Ee||he)&&(M(X),he&&(V.current=!0))},[w.value]),Pe=g.useCallback(()=>S==null?void 0:S.focus(),[S]),ke=g.useCallback((X,Ee,De)=>{const he=!V.current&&!De;(w.value!==void 0&&w.value===Ee||he)&&U(X)},[w.value]),oe=r==="popper"?iw:hI,ae=oe===iw?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:v,avoidCollisions:x}:{};return d.jsx(dI,{scope:n,content:S,viewport:N,onViewportChange:P,itemRefCallback:G,selectedItem:O,onItemLeave:Pe,itemTextRefCallback:ke,focusSelectedItem:A,selectedItemText:D,position:r,isPositioned:K,searchRef:$,children:d.jsx(up,{as:cs,allowPinchZoom:!0,children:d.jsx(cp,{asChild:!0,trapped:w.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:te(o,X=>{var Ee;(Ee=w.trigger)==null||Ee.focus({preventScroll:!0}),X.preventDefault()}),children:d.jsx(Zl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:d.jsx(oe,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:X=>X.preventDefault(),...b,...ae,onPlaced:()=>H(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:te(b.onKeyDown,X=>{const Ee=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!Ee&&X.key.length===1&&W(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let he=z().filter(Fe=>!Fe.disabled).map(Fe=>Fe.ref.current);if(["ArrowUp","End"].includes(X.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const Fe=X.target,_e=he.indexOf(Fe);he=he.slice(_e+1)}setTimeout(()=>I(he)),X.preventDefault()}})})})})})})});fI.displayName=XJ;var ZJ="SelectItemAlignedPosition",hI=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Wa(zl,n),s=Ha(zl,n),[a,l]=g.useState(null),[c,u]=g.useState(null),f=Ve(t,_=>u(_)),h=ky(n),p=g.useRef(!1),m=g.useRef(!0),{viewport:v,selectedItem:x,selectedItemText:b,focusSelectedItem:w}=s,S=g.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&v&&x&&b){const _=i.trigger.getBoundingClientRect(),O=c.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),D=b.getBoundingClientRect();if(i.dir!=="rtl"){const Fe=D.left-O.left,_e=M.left-Fe,tt=_.left-_e,gt=_.width+tt,Kt=Math.max(gt,O.width),T=window.innerWidth-Ro,k=qb(_e,[Ro,Math.max(Ro,T-Kt)]);a.style.minWidth=gt+"px",a.style.left=k+"px"}else{const Fe=O.right-D.right,_e=window.innerWidth-M.right-Fe,tt=window.innerWidth-_.right-_e,gt=_.width+tt,Kt=Math.max(gt,O.width),T=window.innerWidth-Ro,k=qb(_e,[Ro,Math.max(Ro,T-Kt)]);a.style.minWidth=gt+"px",a.style.right=k+"px"}const U=h(),z=window.innerHeight-Ro*2,K=v.scrollHeight,H=window.getComputedStyle(c),V=parseInt(H.borderTopWidth,10),I=parseInt(H.paddingTop,10),A=parseInt(H.borderBottomWidth,10),j=parseInt(H.paddingBottom,10),L=V+I+K+j+A,$=Math.min(x.offsetHeight*5,L),W=window.getComputedStyle(v),G=parseInt(W.paddingTop,10),Pe=parseInt(W.paddingBottom,10),ke=_.top+_.height/2-Ro,oe=z-ke,ae=x.offsetHeight/2,X=x.offsetTop+ae,Ee=V+I+X,De=L-Ee;if(Ee<=ke){const Fe=U.length>0&&x===U[U.length-1].ref.current;a.style.bottom="0px";const _e=c.clientHeight-v.offsetTop-v.offsetHeight,tt=Math.max(oe,ae+(Fe?Pe:0)+_e+A),gt=Ee+tt;a.style.height=gt+"px"}else{const Fe=U.length>0&&x===U[0].ref.current;a.style.top="0px";const tt=Math.max(ke,V+v.offsetTop+(Fe?G:0)+ae)+De;a.style.height=tt+"px",v.scrollTop=Ee-ke+v.offsetTop}a.style.margin=`${Ro}px 0`,a.style.minHeight=$+"px",a.style.maxHeight=z+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[h,i.trigger,i.valueNode,a,c,v,x,b,i.dir,r]);On(()=>S(),[S]);const[C,N]=g.useState();On(()=>{c&&N(window.getComputedStyle(c).zIndex)},[c]);const P=g.useCallback(_=>{_&&m.current===!0&&(S(),w==null||w(),m.current=!1)},[S,w]);return d.jsx(eX,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:P,children:d.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:d.jsx(Oe.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});hI.displayName=ZJ;var QJ="SelectPopperPosition",iw=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Ro,...i}=e,s=Ey(n);return d.jsx(rp,{...s,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});iw.displayName=QJ;var[eX,xk]=od(zl,{}),sw="SelectViewport",pI=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=Ha(sw,n),s=xk(sw,n),a=Ve(t,i.onViewportChange),l=g.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),d.jsx(Sy.Slot,{scope:n,children:d.jsx(Oe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:te(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=s;if(h!=null&&h.current&&f){const p=Math.abs(l.current-u.scrollTop);if(p>0){const m=window.innerHeight-Ro*2,v=parseFloat(f.style.minHeight),x=parseFloat(f.style.height),b=Math.max(v,x);if(b<m){const w=b+p,S=Math.min(m,w),C=w-S;f.style.height=S+"px",f.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,f.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});pI.displayName=sw;var mI="SelectGroup",[tX,nX]=od(mI),rX=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Vr();return d.jsx(tX,{scope:n,id:o,children:d.jsx(Oe.div,{role:"group","aria-labelledby":o,...r,ref:t})})});rX.displayName=mI;var gI="SelectLabel",vI=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=nX(gI,n);return d.jsx(Oe.div,{id:o.id,...r,ref:t})});vI.displayName=gI;var Kg="SelectItem",[oX,yI]=od(Kg),xI=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Wa(Kg,n),l=Ha(Kg,n),c=a.value===r,[u,f]=g.useState(i??""),[h,p]=g.useState(!1),m=Ve(t,w=>{var S;return(S=l.itemRefCallback)==null?void 0:S.call(l,w,r,o)}),v=Vr(),x=g.useRef("touch"),b=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(oX,{scope:n,value:r,disabled:o,textId:v,isSelected:c,onItemTextChange:g.useCallback(w=>{f(S=>S||((w==null?void 0:w.textContent)??"").trim())},[]),children:d.jsx(Sy.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:d.jsx(Oe.div,{role:"option","aria-labelledby":v,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:m,onFocus:te(s.onFocus,()=>p(!0)),onBlur:te(s.onBlur,()=>p(!1)),onClick:te(s.onClick,()=>{x.current!=="mouse"&&b()}),onPointerUp:te(s.onPointerUp,()=>{x.current==="mouse"&&b()}),onPointerDown:te(s.onPointerDown,w=>{x.current=w.pointerType}),onPointerMove:te(s.onPointerMove,w=>{var S;x.current=w.pointerType,o?(S=l.onItemLeave)==null||S.call(l):x.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:te(s.onPointerLeave,w=>{var S;w.currentTarget===document.activeElement&&((S=l.onItemLeave)==null||S.call(l))}),onKeyDown:te(s.onKeyDown,w=>{var C;((C=l.searchRef)==null?void 0:C.current)!==""&&w.key===" "||(WJ.includes(w.key)&&b(),w.key===" "&&w.preventDefault())})})})})});xI.displayName=Kg;var Bd="SelectItemText",bI=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Wa(Bd,n),a=Ha(Bd,n),l=yI(Bd,n),c=qJ(Bd,n),[u,f]=g.useState(null),h=Ve(t,b=>f(b),l.onItemTextChange,b=>{var w;return(w=a.itemTextRefCallback)==null?void 0:w.call(a,b,l.value,l.disabled)}),p=u==null?void 0:u.textContent,m=g.useMemo(()=>d.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:v,onNativeOptionRemove:x}=c;return On(()=>(v(m),()=>x(m)),[v,x,m]),d.jsxs(d.Fragment,{children:[d.jsx(Oe.span,{id:l.textId,...i,ref:h}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Fr.createPortal(i.children,s.valueNode):null]})});bI.displayName=Bd;var wI="SelectItemIndicator",SI=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return yI(wI,n).isSelected?d.jsx(Oe.span,{"aria-hidden":!0,...r,ref:t}):null});SI.displayName=wI;var aw="SelectScrollUpButton",iX=g.forwardRef((e,t)=>{const n=Ha(aw,e.__scopeSelect),r=xk(aw,e.__scopeSelect),[o,i]=g.useState(!1),s=Ve(t,r.onScrollButtonChange);return On(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?d.jsx(kI,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});iX.displayName=aw;var lw="SelectScrollDownButton",sX=g.forwardRef((e,t)=>{const n=Ha(lw,e.__scopeSelect),r=xk(lw,e.__scopeSelect),[o,i]=g.useState(!1),s=Ve(t,r.onScrollButtonChange);return On(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?d.jsx(kI,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});sX.displayName=lw;var kI=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Ha("SelectScrollButton",n),s=g.useRef(null),a=ky(n),l=g.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return g.useEffect(()=>()=>l(),[l]),On(()=>{var u;const c=a().find(f=>f.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),d.jsx(Oe.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:te(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:te(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:te(o.onPointerLeave,()=>{l()})})}),aX="SelectSeparator",EI=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return d.jsx(Oe.div,{"aria-hidden":!0,...r,ref:t})});EI.displayName=aX;var cw="SelectArrow",lX=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ey(n),i=Wa(cw,n),s=Ha(cw,n);return i.open&&s.position==="popper"?d.jsx(op,{...o,...r,ref:t}):null});lX.displayName=cw;function CI(e){return e===""||e===void 0}var NI=g.forwardRef((e,t)=>{const{value:n,...r}=e,o=g.useRef(null),i=Ve(t,o),s=QS(n);return g.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const f=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(f)}},[s,n]),d.jsx(TS,{asChild:!0,children:d.jsx("select",{...r,ref:i,defaultValue:n})})});NI.displayName="BubbleSelect";function PI(e){const t=nn(e),n=g.useRef(""),r=g.useRef(0),o=g.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function _I(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=cX(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function cX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var jI=rI,bk=iI,uX=aI,dX=lI,fX=cI,wk=uI,TI=pI,OI=vI,Sk=xI,MI=bI,hX=SI,RI=EI;const Cy=jI,Ny=uX,vp=g.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(bk,{ref:r,className:fe("flex h-10 m-1 w-[calc(100%-8px)] items-center justify-between rounded-md border border-input bg-bg-primary px-3 py-2 text-sm ring-offset-background placeholder:text-fg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:[t,d.jsx(dX,{asChild:!0,children:d.jsx(Xu,{className:"w-4 h-4 opacity-50"})})]}));vp.displayName=bk.displayName;const yp=g.forwardRef(({className:e,children:t,position:n="popper",container:r,...o},i)=>d.jsx(fX,{container:r,children:d.jsx(wk,{ref:i,className:fe("relative z-50 min-w-[10rem] overflow-hidden rounded-md border bg-bg-primary text-fg-primary shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...o,children:d.jsx(TI,{className:fe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:d.jsx(hr,{orientation:"vertical",children:d.jsx("div",{className:"max-h-[var(--radix-select-content-available-height)]",children:t})})})})}));yp.displayName=wk.displayName;const pX=g.forwardRef(({className:e,...t},n)=>d.jsx(OI,{ref:n,className:fe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));pX.displayName=OI.displayName;const xp=g.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(Sk,{ref:r,className:fe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm text-fg-primary outline-none focus:bg-bg-primary-hover focus:text-fg-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(hX,{children:d.jsx(Ju,{className:"w-4 h-4"})})}),d.jsx(MI,{children:t})]}));xp.displayName=Sk.displayName;const mX=g.forwardRef(({className:e,...t},n)=>d.jsx(RI,{ref:n,className:fe("-mx-1 my-1 h-px bg-bg-secondary",e),...t}));mX.displayName=RI.displayName;function ha(e,t){return e.includes("?p=")?e+"."+JSON.stringify(t):e+"?p="+JSON.stringify(t)}function gX(e){const t=e.replace(/([A-Z])/g," $1").toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function vX({children:e}){return d.jsx("div",{children:gX(e)})}function AI(e){const[t,n]=Y.splitModuleFilePathAndModulePath(e),r=Y.joinModuleFilePathAndModulePath(t,Y.splitModulePath(n).slice(0,-1).join(".")),o=Ft(r);return{path:r,schema:"data"in o?o.data:void 0}}const Mm=(e,t,n)=>t!==e&&(n==null?void 0:n.type)==="record",yX=(e,t,n)=>t!==e&&(n==null?void 0:n.type)==="array",uP=e=>(e==null?void 0:e.type)==="record",xX=e=>(e==null?void 0:e.type)==="array";function II({path:e,variant:t}){const n=Ft(e),{path:r,schema:o}=AI(e),[i]=Y.splitModuleFilePathAndModulePath(e),s=DI(e),a=s[s.length-1],l=q2(r,Mm(e,r,o)?a==null?void 0:a.part:void 0),c=t2(),u=uP("data"in n?n.data:void 0)&&c.status==="success"&&c.data&&"data"in n&&n.data.type==="record"&&n.data.router?dP(i,c.data,n.data.router):null,f=Mm(e,r,o)&&c.status==="success"&&c.data&&o&&o.type==="record"&&o.router?dP(i,c.data,o.router):null,h=(f==null?void 0:f.every(b=>b.type==="literal"))||!1,p=!f||!h,m=!f||!h,v=(u==null?void 0:u.every(b=>b.type==="literal"))||!1,x=!u||!v;return d.jsxs("span",{className:"inline-flex gap-2 items-center",children:[Mm(e,r,o)&&d.jsxs(d.Fragment,{children:[d.jsx(fP,{refs:l,variant:t}),m&&d.jsx(Z2,{defaultValue:a.text,path:e,parentPath:r,variant:_f(t),size:Pf(t),routePattern:f,existingKeys:l,children:d.jsx(EK,{size:Nf(t)})}),p&&d.jsx(Y2,{path:e,parentPath:r,variant:_f(t),size:Pf(t),refs:l,confirmationMessage:`This will delete the ${a.text} record.`,children:d.jsx(jK,{size:Nf(t)})})]}),xX("data"in n?n.data:void 0)&&d.jsx(bX,{path:e,variant:t}),uP("data"in n?n.data:void 0)&&d.jsxs(d.Fragment,{children:[d.jsx(fP,{refs:l,variant:t}),x&&d.jsx(X2,{path:e,variant:_f(t),size:Pf(t),routePattern:u,children:d.jsx(WS,{size:Nf(t)})})]})]})}function dP(e,t,n){if(n==="next-app-router"){const r=Db(e,t);return $M(r)}return null}function fP({refs:e,variant:t}){const n=In();return e.length===0?null:d.jsxs(br,{children:[d.jsxs(zr,{children:[d.jsx(ho,{asChild:!0,children:d.jsx(qe,{asChild:!0,size:Pf(t),variant:_f(t),children:d.jsx(xo,{children:d.jsx(f2,{size:Nf(t)})})})}),d.jsx(fr,{side:"top",children:"References to this record"})]}),d.jsx(tr,{container:n,children:d.jsx("div",{className:"text-sm",children:d.jsx("ul",{children:e.map(r=>{const[o,i]=Y.splitModuleFilePathAndModulePath(r),s=Y.createPatchPath(i);return d.jsx("li",{children:d.jsx(fp,{moduleFilePath:o,patchPath:s})},r)})})})})]})}function Nf(e){return e==="module"?16:12}function Pf(e){return"icon"}function _f(e){return e==="module"?"outline":"ghost"}function bX({path:e,variant:t}){const{navigate:n}=xn(),{addPatch:r,patchPath:o}=bn(e),i=Ft(e),s=lt(e,"array"),[a]=Y.splitModuleFilePathAndModulePath(e);if(!("data"in s)||!s.data||!("data"in i))return null;const l=i.data;if(l.type!=="array")return console.error("Cannot add to non-array",s,{parentPath:e}),null;const c=s.data.length;return d.jsx(qe,{title:"Add",size:Pf(t),variant:_f(t),onClick:()=>{const u=o.concat(c.toString());r([{op:"add",path:u,value:Dl(l.item)}],l.type),l.item.type!=="string"&&n(Y.joinModuleFilePathAndModulePath(a,Y.patchPathToModulePath(u)))},children:d.jsx(WS,{size:Nf(t)})})}function DI(e){const[t,n]=Y.splitModuleFilePathAndModulePath(e),r=Y.splitModuleFilePath(t).map(a=>({text:Cu(a),part:a,sourcePath:t}));if(!n)return r;const o=Y.splitModulePath(n),i=[];let s="";for(let a=0;a<o.length;a++){let l=(s?s+".":"")+JSON.stringify(o[a]);n.startsWith(l)||(l=(s?s+".":"")+o[a]),s=l,i.push({text:o[a],part:o[a],sourcePath:Y.joinModuleFilePathAndModulePath(t,l)})}return r.concat(i)}function kk({validationErrors:e}){return d.jsxs("div",{className:fe("w-full",{"h-6":e.length===0}),children:[e.length>1&&d.jsx(Ll,{type:"single",collapsible:!0,className:"w-full min-h-6",children:d.jsxs(ja,{value:"validation-errors",className:"pb-2 w-full border-b-0 group",children:[d.jsx(Fl,{className:fe("min-h-6","transition-colors duration-200 ease-in-out","group-data-[state=closed]:bg-bg-error-primary rounded-lg","p-2"),children:d.jsxs("div",{className:fe("flex items-center justify-between w-full"),children:[d.jsxs("div",{className:"text-fg-primary group-data-[state=closed]:text-fg-error-primary",children:[e.length," validation error",e.length>1?"s":""]}),d.jsx("div",{className:"text-fg-error-primary",children:d.jsx(ku,{size:16})})]})}),d.jsx(Ta,{children:d.jsx("div",{className:"flex flex-col gap-2",children:e.map((t,n)=>d.jsx("div",{className:fe("p-2 rounded-lg","bg-bg-error-primary text-fg-error-primary"),children:t.message},n))})})]})}),e.length===1&&e[0]&&d.jsx(wX,{validationError:e[0]})]})}function wX({validationError:e}){const[t,n]=g.useState(!1),[r,o]=g.useState(!1),i=g.useRef(null),s=g.useRef(null);return g.useEffect(()=>{const a=()=>{if(i.current){const c=document.createElement("div"),u=window.getComputedStyle(i.current);c.style.cssText=u.cssText,c.style.position="absolute",c.style.visibility="hidden",c.style.left="-9999px",c.style.width=u.width,c.style.webkitLineClamp="unset",c.style.overflow="visible",c.style.display="block",c.textContent=e.message,document.body.appendChild(c);const f=c.getBoundingClientRect().height;document.body.removeChild(c);const h=i.current.getBoundingClientRect().height;o(f>h+1)}},l=setTimeout(a,50);return window.addEventListener("resize",a),()=>{clearTimeout(l),window.removeEventListener("resize",a)}},[e.message]),d.jsxs("div",{ref:s,className:fe("flex items-center justify-between w-full transition-all duration-200 ease-in-out","p-2 mt-2","bg-bg-error-primary text-fg-error-primary rounded-lg"),style:{height:t?"auto":void 0},children:[d.jsx("div",{ref:i,className:fe("transition-all duration-200 ease-in-out",{"line-clamp-1":!t}),style:{flex:r?"1":"auto",marginRight:r?"8px":"0"},children:e.message}),!r&&d.jsx("div",{className:"text-fg-error-primary",children:d.jsx(ku,{size:16})}),r&&d.jsxs("button",{className:"flex flex-shrink-0 items-center",onClick:()=>n(!t),children:[d.jsx("div",{className:"text-fg-error-primary",children:d.jsx(ku,{size:16})}),d.jsx(Xu,{size:16,className:fe("transform transition-transform duration-200 ease-in-out",{"rotate-180":t})})]})]})}function LI({label:e,children:t,path:n,transparent:r,type:o,foldLevel:i="1"}){var S,C;const s=cy(),a=ZR(n),{patchPath:l,addPatch:c}=bn(n),u=Ft(n),f=lt(n,o),[h,p]=g.useState(!0),[m,v]=g.useState(!1);g.useEffect(()=>{var N,P;"data"in f&&f.data===null&&"data"in u&&!u.data.opt&&(((N=u.data)==null?void 0:N.type)==="image"||((P=u.data)==null?void 0:P.type)==="file")&&v(!0)},[f,u]);const x="data"in f?f.data:void 0,b="data"in u&&((S=u.data)==null?void 0:S.type)==="boolean",w="data"in u&&((C=u.data)==null?void 0:C.opt)===!0;return d.jsxs("div",{className:Ne("px-4 pt-6 pb-0 border rounded-lg",{"bg-bg-tertiary":!r,"border-bg-error-secondary":a.length>0}),children:[d.jsxs("div",{className:"flex justify-between items-center pb-2",children:[d.jsxs("div",{className:"flex gap-4 items-center",children:[!b&&w&&d.jsx(ed,{disabled:s==="loading",checked:x!==null||m,onCheckedChange:()=>{(u.data.type==="image"||u.data.type==="file")&&x===null?v(!0):c(x===null?[{op:"replace",path:l,value:Dl({...u.data,opt:!1})}]:[{op:"replace",path:l,value:null}],u.data.type)}}),b&&d.jsx(zJ,{path:n,isNullable:w,loadingStatus:s,source:x}),typeof e=="string"&&d.jsx(vX,{children:e}),e&&typeof e!="string"&&e]}),d.jsxs("div",{className:"flex gap-2 items-center",children:[x!==null&&d.jsx(II,{path:n,variant:"field"}),x!==null&&!b&&d.jsxs("button",{onClick:()=>p(N=>!N),className:Ne("transform transition-transform",{"rotate-180":h}),children:[i==="1"&&d.jsx(Xu,{size:16}),i==="2"&&d.jsx(X7,{size:16})]})]})]}),!b&&d.jsx(Ll,{type:"single",collapsible:!0,value:h&&(x!==null||m)?"open":"closed",children:d.jsx(ja,{value:"open",className:"w-full border-b-0",children:d.jsx(Ta,{children:t})})}),a.length>0&&d.jsx("div",{className:"pb-8",children:d.jsx(kk,{validationErrors:a})})]})}function SX({path:e}){const t="object",n=Ft(e),r=lt(e,t);if(n.status==="error")return d.jsx(Xt,{path:e,error:n.error,type:t});if(r.status==="error")return d.jsx(it,{path:e,error:r.error,schema:n});if(r.status=="not-found"||n.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(n.status==="loading")return d.jsx(yt,{path:e,type:t});if(!("data"in r)||r.data===void 0)return d.jsx(yt,{path:e,type:t});if(n.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:n.data.type});const o=n.data;return d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),d.jsx("div",{className:"flex flex-col gap-6",children:Object.entries(o.items).map(([i,s])=>{const a=ha(e,i);return d.jsx(LI,{label:i,path:a,type:s.type,children:d.jsx(Jy,{path:a,schema:s},a)},a)})})]})}function kX({path:e}){const t="object",n=Ft(e);if(n.status==="error")return d.jsx(Xt,{path:e,error:n.error,type:t});if(n.status==="loading")return d.jsx(yt,{path:e,type:t});if(n.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(n.data.type!=="object")return d.jsx(kr,{path:e,expectedType:"object",actualType:n.data.type});const r=n.data;return d.jsx(FI,{path:e,schema:r})}function FI({path:e,schema:t}){return d.jsx("div",{id:e,className:"grid grid-cols-[min-content,1fr] text-left gap-2 text-xs",children:Object.keys(t.items).map(n=>{const r=ha(e,n);return d.jsx(EX,{label:n,children:d.jsx(bE,{path:r})},n)})})}function EX({label:e,children:t}){return d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"flex whitespace-nowrap text-fg-disabled",children:Sf(e)}),t]})}function uw(e){return typeof e.key!="string"}function CX({path:e}){const t="union",n=Ft(e),r=lt(e,t);if(n.status==="error")return d.jsx(Xt,{path:e,error:n.error,type:t});if(r.status==="error")return d.jsx(it,{path:e,error:r.error,schema:n});if(r.status=="not-found"||n.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(n.status==="loading")return d.jsx(yt,{path:e,type:t});if(!("data"in r)||r.data===void 0)return d.jsx(yt,{path:e,type:t});if(n.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:n.data.type});const o=r.data;if(uw(n.data))return typeof o!="string"&&o!==null?d.jsx(it,{path:e,error:"Expected source to be a string, but found: "+typeof o,schema:n}):d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),d.jsx(PX,{path:e,source:o,options:n.data.items.concat(n.data.key).flatMap(i=>(i==null?void 0:i.type)==="literal"?[i.value]:(console.warn("Unexpected item in string union",i),[]))})]});if(!uw(n.data))return typeof o!="object"?d.jsx(it,{path:e,error:"Expected source to be an object, but found: "+typeof o,schema:n}):Array.isArray(o)?d.jsx(it,{path:e,error:"Expected source to be an object, but found an array",schema:n}):d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),d.jsx(NX,{path:e,schema:n.data})]})}function NX({path:e,schema:t}){const n=BS(e),{addPatch:r,patchPath:o}=bn(e),i=In(),s=ha(e,t.key),a=lt(s,"literal");if(!("data"in a)||a.data===void 0)return d.jsx(yt,{path:e,type:"union"});const l=t.items.find(f=>{var p;const h=(p=f.items)==null?void 0:p[t.key];return h.type==="literal"?h.value===a.data:(console.error("Expected literal schema in object union",h),!1)});if((l==null?void 0:l.items)===void 0)return d.jsx(yt,{path:e,type:"union"});const c=t.items.flatMap(f=>{var p;const h=(p=f.items)==null?void 0:p[t.key];return h.type==="literal"?[h.value]:(console.error("Expected literal schema in object union",h),[])}),u=g.useRef({});return g.useEffect(()=>{n!==void 0&&a.data!==void 0&&typeof a.data=="string"&&n.status==="success"&&(u.current[e]||(u.current[e]={}),u.current[e][a.data]=n.data)},[n,a,e]),d.jsxs("div",{className:"grid gap-4",children:[d.jsxs(Cy,{value:a.data??void 0,onValueChange:f=>{const h=t.items.find(m=>{var x;const v=(x=m.items)==null?void 0:x[t.key];return v.type==="literal"?v.value===f:(console.error("Expected literal schema in object union",v),!1)});if((h==null?void 0:h.items)===void 0){console.error(`Selected schema with ${t.key} = ${f} not found`);return}const p=u.current[e][f]||Dl(h);p[t.key]=f,r([{op:"replace",path:o,value:p}],t.type)},children:[d.jsx(vp,{children:d.jsx(Ny,{children:a.data})}),d.jsx(yp,{container:i,className:"w-32",children:c==null?d.jsx(zI,{}):c.map(f=>d.jsx(xp,{value:f,children:f},f))})]}),Object.keys(l==null?void 0:l.items).filter(f=>f!==(t==null?void 0:t.key)).map(f=>{var p,m,v;const h=ha(e,f);return d.jsx(LI,{path:h,foldLevel:"1",label:f,type:(m=(p=l==null?void 0:l.items)==null?void 0:p[f])==null?void 0:m.type,children:d.jsx(Jy,{path:h,schema:(v=l==null?void 0:l.items)==null?void 0:v[f]},f)},h)})]})}function PX({path:e,source:t,options:n}){const{addPatch:r,patchPath:o}=bn(e),i=In();return d.jsxs(Cy,{value:t??"",onValueChange:s=>{r([{op:"replace",path:o,value:s}],"union")},children:[d.jsx(vp,{children:d.jsx(Ny,{children:t})}),d.jsx(yp,{className:"w-32",container:i,children:n==null?d.jsx(zI,{}):n.map(s=>d.jsx(xp,{value:s,children:s},s))})]})}function zI(){return d.jsx("div",{children:"Loading..."})}function _X({path:e}){const t="union",n=BS(e),r=Ft(e);if(n.status==="error")return d.jsx(it,{path:e,error:n.error,schema:r});if(!("data"in n)||n.data===void 0)return d.jsx(wr,{path:e});if(!("data"in r)||r.data===void 0)return d.jsx(wr,{path:e});if(n.data===null)return d.jsx(Sr,{path:e});if(r.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:r.data.type});const o=r.data;if(uw(o))return typeof n.data!="string"?d.jsx(it,{path:e,error:"Expected source to be a string, but found: "+typeof n.data,schema:r}):d.jsx("div",{className:"truncate",children:n.data});{const i=n.data;if(!i)return d.jsx(Sr,{path:e});if(typeof i!="object"&&!(typeof i=="object"&&o.key in i))return d.jsx(it,{path:e,error:"Expected source to be an object, but found: "+typeof i,schema:r});const s=o.items.find(a=>{var c;const l=(c=a.items)==null?void 0:c[o.key];if((l==null?void 0:l.type)==="literal"&&i!==null&&typeof i=="object"&&o.key in i&&!ea(i))return l.value===i[o.key]});return s?d.jsx(FI,{path:e,schema:s}):d.jsx(it,{path:e,error:"Expected source to have key "+o.key+" but it was not found",schema:r})}}function $I(e){return new Promise((t,n)=>{var i;const r=(i=e.currentTarget.files)==null?void 0:i[0],o=new FileReader;o.addEventListener("load",()=>{const s=o.result;if(typeof s=="string"){const a=new Image;a.addEventListener("load",()=>{const l=qv.Buffer.from(s.split(",")[1],"base64"),c=Y.getSHA256Hash(l);if(a.naturalWidth&&a.naturalHeight){const u=Y.getMimeType(s);t({src:s,width:a.naturalWidth,height:a.naturalHeight,filename:r==null?void 0:r.name,fileHash:c,mimeType:u,fileExt:u&&Y.mimeTypeToFileExt(u)})}else t({src:s,filename:r==null?void 0:r.name,fileHash:c})}),a.src=s}else n(s?{message:"Unexpected image result type",result:s}:{message:"Empty result"})}),r&&o.readAsDataURL(r)})}function jX(e){return new Promise((t,n)=>{var i;const r=(i=e.currentTarget.files)==null?void 0:i[0],o=new FileReader;o.addEventListener("load",()=>{const s=o.result;if(typeof s=="string"){const a=qv.Buffer.from(s.split(",")[1],"base64"),l=Y.getSHA256Hash(a),c=Y.getMimeType(s);t({src:s,filename:r==null?void 0:r.name,fileHash:l,mimeType:c,fileExt:c&&Y.mimeTypeToFileExt(c)})}else n(s?{message:"Unexpected file result type",result:s}:{message:"Empty result"})}),r&&o.readAsDataURL(r)})}function TX(e){return e.split(".").pop()||""}const OX=new TextEncoder;async function BI(e,t,n,r,o,i,s,a="/public/val"){const l=Y.createFilename(t,n,o,r);if(!l||!o)return[];const c=`${a}/${l}`,u=Y.remote.hashToRemoteFileHash(r),f=s?Y.remote.createRemoteRef(s.remoteHost,{publicProjectId:s.publicProjectId,coreVersion:s.coreVersion,bucket:s.bucket,validationHash:Y.remote.getValidationHash(s.coreVersion,s.schema,TX(l),o,u,OX),fileHash:u,filePath:`${a.slice(1)}/${l}`}):c;return[{value:{[bt]:f,[Le]:s?"remote":"file",...i!=="file"?{[Pb]:i}:{},metadata:o},op:"replace",path:e},{value:t,metadata:o,op:"file",path:e,filePath:f,remote:s!==null}]}function MX({path:e}){var U;const t="file",n=qu(),r=DS(),o=IS(),i=Ft(e),s=lt(e,t),[a,l]=g.useState(!1),[c,u]=g.useState(null),[f,h]=g.useState(null),[p,m]=g.useState(!1),{patchPath:v,addAndUploadPatchWithFileOps:x}=bn(e),[b,w]=g.useState(null),S="data"in s&&s.data,C=s.status==="success"&&s.clientSideOnly;if(g.useEffect(()=>{if(S&&S.metadata&&!C){const z=Le in S&&S[Le]==="remote"?Y.convertRemoteSource({...S,[Le]:"remote"}).url:Y.convertFileSource({...S,[Le]:"file"}).url;h(z),m(!1)}},[s]),g.useEffect(()=>{var z,K,H;i.status==="success"&&i.data.type==="file"&&((K=(z=i.data.options)==null?void 0:z.accept)!=null&&K.startsWith("video/"))&&l(!0),S&&typeof((H=S.metadata)==null?void 0:H.mimeType)=="string"&&(S.metadata.mimeType.startsWith("video/")?l(!0):l(!1))},[i,S]),i.status==="error")return d.jsx(Xt,{path:e,error:i.error,type:t});if(s.status==="error")return d.jsx(it,{path:e,error:s.error,schema:i});if(s.status=="not-found"||i.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(i.status==="loading")return d.jsx(yt,{path:e,type:t});if(n===void 0)return d.jsx(yt,{path:e,type:t});if(i.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:i.data.type});const N=s.data;if(N===void 0)return d.jsx(Mn,{path:e,type:t});const _=i.data.type==="file"&&i.data.remote&&o.status!=="ready",O=i.data.remote&&o.status==="ready"&&r?{publicProjectId:o.publicProjectId,coreVersion:o.coreVersion,bucket:r,schema:i.data,remoteHost:n.remoteHost}:null;let M=null;if(N!=null&&N._ref)if(i.data.remote){const z=Y.remote.splitRemoteRef(N==null?void 0:N._ref);z.status==="success"&&(M=z.filePath)}else M=N==null?void 0:N._ref;let D=null;return M&&(D=M.split("/").slice(-1)[0]),d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),c&&d.jsx("div",{className:"p-4 rounded bg-bg-error-primary text-fg-error-primary",children:c}),d.jsxs("div",{className:"grid gap-2",children:[D&&d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx("div",{className:"text-sm text-fg-secondary",children:D}),p&&d.jsx(Gr,{className:`animate-spin text-fg-secondary ${p?"block":"hidden"}`,size:16}),b!==null&&d.jsxs("div",{className:"text-sm text-fg-secondary",children:[b,"%"]})]}),d.jsxs("div",{className:"flex gap-4 items-center",children:[N&&(a?d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("video",{className:"w-full h-auto rounded-lg",controls:!0,src:Le in N&&N[Le]==="remote"?Y.convertRemoteSource({...N,[Le]:"remote"}).url:Y.convertFileSource({...N,[Le]:"file"}).url}),d.jsx(qe,{asChild:!0,variant:"secondary",children:d.jsx("label",{htmlFor:`file_input:${e}`,children:"Upload"})})]}):d.jsxs(d.Fragment,{children:[d.jsx(qe,{asChild:!0,variant:"secondary",children:d.jsx("label",{htmlFor:`file_input:${e}`,children:"Upload"})}),d.jsxs("a",{className:"flex gap-2 items-center",target:"_blank",rel:"noopener noreferrer",download:D,href:Le in N&&N[Le]==="remote"?Y.convertRemoteSource({...N,[Le]:"remote"}).url:Y.convertFileSource({...N,[Le]:"file"}).url,children:[d.jsx("span",{children:" Open file"}),d.jsx(SK,{})]})]})),d.jsx("input",{disabled:_,hidden:!0,id:`file_input:${e}`,type:"file",accept:(U=i.data.options)==null?void 0:U.accept,onChange:z=>{jX(z).then(K=>{var j;const H="file",V=f;h(K.src),m(!0);const I={src:K.src,filename:K.filename};let A;K.mimeType&&(A={mimeType:K.mimeType}),u(null),BI(v,I.src,I.filename??null,K.fileHash,A,H,O,(j=n.files)==null?void 0:j.directory).then(L=>{m(!0),w(0),x(L,H,$=>{h(V),u($)},($,W,G,Pe)=>{const ke=$*(G+1)/(W*Pe);w(Math.round(ke*100))}).finally(()=>{w(null),m(!1)})}).catch(L=>{console.error("Failed to create file patch",L),m(!1),h(V),u("Could not upload file. Please try again later")}),z.target.value=""})}})]})]})]})}function RX({path:e}){const t=lt(e,"image");return t.status==="error"?d.jsx(it,{path:e,error:t.error}):!("data"in t)||t.data===void 0?d.jsx(wr,{path:e}):t.data===null?d.jsx(Sr,{path:e}):d.jsx(l2,{size:12})}function AX({path:e}){var K,H,V,I;const t="image",n=qu(),r=IS(),o=DS(),i=Ft(e),s=lt(e,t),[a,l]=g.useState(void 0),[c,u]=g.useState(null),[f,h]=g.useState(null),[p,m]=g.useState(!1),{addPatch:v,patchPath:x,addAndUploadPatchWithFileOps:b}=bn(e),[w,S]=g.useState(null),C="data"in s&&s.data,N=s.status==="success"&&s.clientSideOnly;if(g.useEffect(()=>{if(C)if(C.metadata){if(!N){const j=Le in C&&C[Le]==="remote"?Y.convertRemoteSource({...C,[Le]:"remote"}).url:Y.convertFileSource({...C,[Le]:"file"}).url;h(j),m(!1)}const A=C.metadata;if(typeof A.width!="number"||typeof A.height!="number"){console.warn(`Expected metadata width and height to be numbers but width was: ${typeof A.width} and height was: ${typeof A.height}`);return}if("hotspot"in A){if(typeof A.hotspot=="object"&&A.hotspot&&"x"in A.hotspot&&"y"in A.hotspot){const{x:j,y:L}=A.hotspot;typeof j=="number"&&typeof L=="number"?l({x:j,y:L}):console.warn(`Expected hotspot to have x and y as numbers but x was: ${typeof j} and y: ${typeof L}`)}}else l(void 0)}else l(void 0)},[s]),i.status==="error")return d.jsx(Xt,{path:e,error:i.error,type:t});if(s.status==="error")return d.jsx(it,{path:e,error:s.error,schema:i});if(s.status=="not-found"||i.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(i.status==="loading")return d.jsx(yt,{path:e,type:t});if(n===void 0)return d.jsx(yt,{path:e,type:t});if(i.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:i.data.type});const P=s.data;if(P===void 0)return d.jsx(Mn,{path:e,type:t});const O=i.data.type==="image"&&i.data.remote&&r.status!=="ready",M=i.data.remote&&r.status==="ready"&&o?{publicProjectId:r.publicProjectId,bucket:o,coreVersion:r.coreVersion,schema:i.data,remoteHost:n.remoteHost}:null,D=Y.createValPathOfItem(e,"metadata"),U=Y.createValPathOfItem(D,"alt"),z=Y.createValPathOfItem(D,"hotspot");return d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),c&&d.jsx("div",{className:"p-4 rounded bg-bg-error-primary text-fg-error-primary",children:c}),i.data.type==="image"&&i.data.remote&&r.status==="inactive"&&d.jsx("div",{className:"p-4 rounded bg-bg-error-primary text-fg-error-primary",children:IX(r.reason)}),d.jsxs("div",{className:"flex flex-col gap-2",children:[P&&d.jsxs("div",{className:"",children:[d.jsx("span",{id:U,children:"Alt text"}),d.jsx(Qu,{value:(K=P.metadata)!=null&&K.alt&&typeof((H=P.metadata)==null?void 0:H.alt)=="string"?(V=P.metadata)==null?void 0:V.alt:"",disabled:O,onChange:A=>{const j=A.target.value;P.metadata&&"alt"in P.metadata?v([{op:"replace",value:j,path:x.concat(["metadata","alt"])}],"string"):P.metadata&&!("alt"in P.metadata)?v([{op:"add",value:j,path:x.concat(["metadata","alt"])}],"string"):P.metadata===void 0?v([{op:"add",value:{...a?{hotspot:a}:{},alt:j},path:x.concat(["metadata"])}],"object"):console.warn(`Expected source.metadata to be an object but got ${typeof P.metadata}`)}})]}),P&&f&&d.jsxs("div",{className:"relative rounded-lg bg-bg-secondary",children:[p&&d.jsxs("div",{className:"flex absolute inset-0 flex-col justify-center items-center",children:[d.jsx("div",{className:"absolute inset-0 w-full h-full opacity-50 bg-bg-secondary"}),d.jsx(Gr,{size:24,className:"animate-spin"}),d.jsx("div",{className:"mt-2 text-xs font-thin text-[white] z-5",children:w!==null?`${w}%`:""})]}),d.jsx("img",{src:f,draggable:!1,className:"object-contain max-h-[500px] w-full",style:{cursor:"crosshair"},id:z,onClick:A=>{const{width:j,height:L,left:$,top:W}=A.currentTarget.getBoundingClientRect(),G={x:Math.max((A.clientX-6-$)/j,0),y:Math.max((A.clientY-6-W)/L,0)};P.metadata&&"hotspot"in P.metadata?v([{op:"replace",path:x.concat(["metadata","hotspot"]),value:G}],"object"):P.metadata?v([{op:"add",path:x.concat(["metadata","hotspot"]),value:G}],"object"):P.metadata===void 0?v([{op:"add",value:{...G?{hotspot:G}:{}},path:x.concat(["metadata"])}],"object"):console.warn(`Expected source.metadata to be an object but got ${typeof P.metadata}`)}}),a&&d.jsx("div",{className:"rounded-full h-[12px] w-[12px] bg-background mix-blend-difference border-bg-brand-primary border-2 absolute pointer-events-none",style:{top:`${a.y*100}%`,left:`${a.x*100}%`}})]}),d.jsx(qe,{asChild:!0,variant:"secondary",children:d.jsx("label",{htmlFor:`img_input:${e}`,children:"Upload"})}),d.jsx("input",{disabled:s.status==="loading",hidden:!0,id:`img_input:${e}`,type:"file",accept:((I=i.data.options)==null?void 0:I.accept)||"image/*",onChange:A=>{$I(A).then(j=>{var Pe,ke;const L="image",$=f;h(j.src),m(!0);const W={src:j.src,filename:j.filename};let G;j.width&&j.height&&j.mimeType&&(G={width:j.width,height:j.height,mimeType:j.mimeType,alt:C&&typeof((Pe=C==null?void 0:C.metadata)==null?void 0:Pe.alt)=="string"?C.metadata.alt:void 0}),u(null),BI(x,W.src,W.filename??null,j.fileHash,G,L,M,(ke=n.files)==null?void 0:ke.directory).then(oe=>{m(!0),S(0),b(oe,L,ae=>{h($),u(ae)},(ae,X,Ee,De)=>{const he=ae*(Ee+1)/(X*De);S(Math.round(he*100))}).finally(()=>{S(null),m(!1)})}).catch(oe=>{console.error("Failed to create file patch",oe),m(!1),h($),u("Could not upload file. Please try again later")}),A.target.value=""})}})]})]})}function IX(e){switch(e){case"api-key-missing":return"Val is running in production mode. To upload remote files and images, the VAL_API_KEY env must be set. Contact a developer to fix this issue.";case"error-could-not-get-settings":return`Could not get settings from the Val remote server. This means that updating or changing certain types of files and images might not work. Check your internet connection and try again. (Error code: ${e})`;case"no-internet-connection":return"Cannot upload remote files and images, since this requires an internet connection";case"pat-error":return"Val is running in development mode. To upload remote files and images, you must either login (by running `npx -p @valbuild/cli val login`) or set the VAL_API_KEY env";case"project-not-configured":return"Project is not configured. To upload remote files and images, the val.config must contain a project id that is obtained from https://app.val.build. Contact a developer to fix this issue.";case"unauthorized":return"Cannot upload remote files and images since you are unauthorized";case"unauthorized-personal-access-token-error":return"Cannot upload remote files and images since the personal access token is unauthorized. Try to login again by running `npx -p @valbuild/cli val login`";case"unknown-error":return"Unknown error";default:return e}}function DX({path:e}){const t=lt(e,"image");if(t.status==="error")return d.jsx(it,{path:e,error:t.error});if(!("data"in t)||t.data===void 0)return d.jsx(wr,{path:e});if(t.data===null)return d.jsx(Sr,{path:e});const n=t.data;return d.jsx("img",{src:Le in n&&n[Le]==="remote"?Y.convertRemoteSource({...n,[Le]:"remote"}).url:Y.convertFileSource({...n,[Le]:"file"}).url,draggable:!1,className:"object-contain max-w-[60px] max-h-[60px] rounded-lg"})}function LX({path:e}){var h;const t="keyOf",{navigate:n}=xn(),r=Ft(e),o="data"in r&&r.data&&r.data.type==="keyOf"?{type:(h=r.data.schema)==null?void 0:h.type,path:r.data.path}:void 0,i=lt(o==null?void 0:o.path,o==null?void 0:o.type),s=lt(e,t),{patchPath:a,addPatch:l}=bn(e),c=In();if(r.status==="error")return d.jsx(Xt,{path:e,error:r.error,type:t});if(s.status==="error")return d.jsx(it,{path:e,error:s.error,schema:r});if(i.status==="error")return d.jsx(it,{path:e,error:i.error,schema:r});if(s.status=="not-found"||r.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(o!==void 0&&!(o.type==="record"||o.type==="object"))return d.jsx(Xt,{path:o.path,error:`Cannot refer to keyOf type: ${o.type}. Must refer to be record or object`});if(o!==void 0&&i.status==="not-found")return d.jsx(Xt,{path:o.path,error:"Referenced source not found",type:o.type});if(!("data"in s)||s.data===void 0)return d.jsx(yt,{path:e,type:t});if("data"in r&&r.data&&r.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:r.data.type});if(!i)return d.jsx(Xt,{path:o==null?void 0:o.path,error:"Referenced source not found",type:"keyOf"});if("data"in i&&i.data===null)return d.jsx(Xt,{path:o==null?void 0:o.path,error:"Referenced source is null",type:"keyOf"});const u="data"in i&&i.data?Object.keys(i.data):void 0,f=s.data;return d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsxs(Cy,{value:f??"",onValueChange:p=>{l([{op:"replace",path:a,value:p}],t)},children:[d.jsx(vp,{children:d.jsx(Ny,{children:f})}),d.jsx(yp,{className:"w-32",container:c,children:r.status==="loading"||o==null||u===void 0?d.jsx(FX,{}):u.map(p=>d.jsx(xp,{value:p,children:p},p))})]}),f&&(o==null?void 0:o.path)&&d.jsx("button",{title:"Go to reference",className:"px-2",onClick:()=>{n(Y.createValPathOfItem(o.path,f))},children:d.jsx(US,{size:16})})]}),u&&u.length>0&&f!==null&&!u.includes(f)&&d.jsxs("div",{className:"flex gap-2 p-2 py-3 mt-2 rounded-md bg-bg-error-primary text-fg-error-primary",children:[d.jsxs("span",{className:"line-clamp-1",children:["Value must be one of: ",u.join(", ")," ",u.join(", "),u.join(", "),u.join(", "),u.join(", "),u.join(", "),u.join(", ")]}),d.jsx("span",{className:"flex-shrink-0",children:d.jsx(ku,{size:16})})]})]})}function FX(){return d.jsx("span",{children:"Loading..."})}function zX({path:e}){const t=lt(e,"keyOf");return t.status==="error"?d.jsx(it,{path:e,error:t.error}):!("data"in t)||t.data===void 0?d.jsx(wr,{path:e}):t.data===null?d.jsx(Sr,{path:e}):d.jsx("div",{className:"truncate",children:t.data})}function VI({className:e,classNames:t,captionLayout:n,showOutsideDays:r=!0,...o}){const i=o.fromDate&&o.toDate;return d.jsx(FU,{showOutsideDays:r,captionLayout:n,className:fe("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex flex-row justify-center pt-1 relative items-center",caption_dropdowns:"flex flex-row space-x-2",caption_label:`text-sm font-medium ${i?"hidden":""}`,nav:"space-x-1 flex items-center",dropdown_month:"flex flex-row text-accent justify-between text-[0.8rem]",dropdown_year:"flex flex-row text-accent justify-between text-[0.8rem]",dropdown:"bg-transparent border-solid rounded-md border-2 border-secondary",nav_button:fe(Jb({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:fe(Jb({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-fg-primary hover:bg-primary hover:text-fg-primary focus:text-fg-primary",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",...t},components:{IconLeft:()=>d.jsx(J7,{className:"w-4 h-4"}),IconRight:()=>d.jsx(Zu,{className:"w-4 h-4"}),Dropdown:({caption:s,children:a,value:l,onChange:c})=>{const u=f=>{c&&c({target:{value:f}})};return d.jsx("div",{className:"flex flex-row space-x-2",children:d.jsxs(jI,{onValueChange:u,value:String(l),children:[d.jsx(bk,{asChild:!0,children:d.jsxs(qe,{variant:"ghost",size:"sm",children:[s,d.jsx(Xu,{className:"w-4 h-4"})]})}),d.jsx(wk,{className:"z-50 p-1 rounded-md bg-bg-secondary text-fg-secondary",children:d.jsx(TI,{className:"overflow-y-auto pr-4 pb-4 max-h-48 rounded-md shadow-lg bg-bg-tertiary text-fg-tertiary",children:g.Children.map(a,f=>{if(g.isValidElement(f)){const{value:h,children:p}=f.props;return d.jsx(Sk,{value:String(h),className:"p-2 rounded-md cursor-pointer hover:bg-bg-secondary-hover hover:text-fg-secondary",children:d.jsx(MI,{children:p})},h)}return null})})})]})})}},...o})}VI.displayName="Calendar";function $X({path:e}){var h,p;const t="date",n=Ft(e),r=lt(e,t),{patchPath:o,addPatch:i}=bn(e),[s,a]=g.useState(null),[l,c]=g.useState(!1),u=In();if(g.useEffect(()=>{if("data"in r&&r.data!==void 0)if(r.data===null)a(r.data);else try{const m=new Date(r.data);a(m)}catch{console.error("Cannot parse invalid date:",r.data)}},["data"in r&&r.data]),n.status==="error")return d.jsx(Xt,{path:e,error:n.error,type:t});if(r.status==="error")return d.jsx(it,{path:e,error:r.error,schema:n});if(r.status=="not-found"||n.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(n.status==="loading")return d.jsx(yt,{path:e,type:t});if(!("data"in r)||r.data===void 0)return d.jsx(yt,{path:e,type:t});if(n.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:n.data.type});const f=n.data;return d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),d.jsxs(br,{open:l,onOpenChange:m=>{c(m)},children:[d.jsx(xo,{asChild:!0,onClick:()=>{c(!0)},children:d.jsxs(qe,{variant:"outline",className:Ne("w-[280px] justify-start text-left font-normal bg-bg-primary hover:bg-bg-secondary"),children:[d.jsx(s2,{className:"w-4 h-4 mr-2"}),s?ms(s,"PPP"):d.jsx("span",{children:"Pick a date"})]})}),d.jsx(tr,{className:"w-auto p-0",container:u,children:d.jsx(VI,{mode:"single",captionLayout:"dropdown-buttons",defaultMonth:s??void 0,weekStartsOn:1,fromDate:(h=f.options)!=null&&h.from?new Date(f.options.from):void 0,toDate:(p=f.options)!=null&&p.to?new Date(f.options.to):void 0,selected:s||void 0,onSelect:m=>{m&&(a(m),i([{op:"replace",value:m.toISOString().slice(0,10),path:o}],f.type),c(!1))}})})]})]})}function BX({path:e}){const t=lt(e,"date");return t.status==="error"?d.jsx(it,{path:e,error:t.error}):!("data"in t)||t.data===void 0?d.jsx(wr,{path:e}):t.data===null?d.jsx(Sr,{path:e}):d.jsx("div",{className:"truncate",children:new Date(t.data).toLocaleString()})}function VX({path:e}){const t=lt(e,"literal");return t.status==="error"?d.jsx(it,{path:e,error:t.error}):!("data"in t)||t.data===void 0?d.jsx(wr,{path:e}):t.data===null?d.jsx(Sr,{path:e}):d.jsx("div",{id:e,className:"truncate",children:t.data})}function UI(e,t){for(const n in t)if(n.startsWith(e))return!0;return!1}function WI(){return d.jsx("div",{className:"w-2 h-2 rounded-full bg-bg-error-secondary"})}function HI({error:e}){return d.jsx("div",{className:"p-4 text-fg-error-primary bg-bg-error-primary",children:d.jsxs("div",{children:["Preview error: ",e]})})}function UX({path:e}){const t="record",n=ec()||{},{navigate:r}=xn(),o=Ft(e),i=XR(e),s=lt(e,t);if(o.status==="error")return d.jsx(Xt,{path:e,error:o.error,type:t});if(s.status==="error")return d.jsx(it,{path:e,error:s.error,schema:o});if(s.status=="not-found"||o.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(o.status==="loading")return d.jsx(yt,{path:e,type:t});if(!("data"in s)||s.data===void 0)return d.jsx(yt,{path:e,type:t});if(o.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:o.data.type});const a=s.data,l=i&&"data"in i&&i.data&&i.data.layout==="list"&&i.data.parent==="record"?i.data:void 0;return d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),(i==null?void 0:i.status)==="error"&&d.jsx(HI,{error:i.message,path:e}),l&&d.jsx(HX,{path:e,...l}),!l&&d.jsx("div",{className:"grid grid-cols-1 gap-4",children:a&&Object.entries(a).map(([c])=>d.jsxs("div",{onClick:()=>r(ha(e,c)),className:Ne("bg-primary-foreground cursor-pointer min-w-[320px] max-h-[170px] overflow-hidden rounded-md border border-border-primary p-4","hover:bg-bg-secondary-hover"),children:[d.jsxs("div",{className:"flex justify-between items-start",children:[d.jsx("div",{className:"pb-4 font-semibold text-md",children:c}),UI(ha(e,c),n)&&d.jsx(WI,{})]}),d.jsx("div",{children:d.jsx(bE,{path:ha(e,c)})})]},c))})]})}function WX({title:e,image:t,subtitle:n}){return d.jsxs("div",{className:Ne("flex w-full items-start justify-between pl-4 flex-grow text-left"),children:[d.jsxs("div",{className:"flex flex-col flex-shrink py-4 overflow-x-clip",children:[d.jsx("div",{className:"text-lg font-medium",children:e}),n&&d.jsx("div",{className:"block overflow-hidden flex-shrink max-h-5 text-sm text-gray-500 text-ellipsis",children:n})]}),t&&d.jsx(KX,{src:t,alt:e})]})}function HX({path:e,items:t}){const{navigate:n}=xn();return d.jsx("div",{className:"flex flex-col space-y-4 w-full",children:t.map(([r,{title:o,subtitle:i,image:s}])=>d.jsx("button",{onClick:()=>n(ha(e,r)),className:Ne("hover:bg-bg-secondary-hover","border rounded-lg cursor-pointer border-border-primary"),children:d.jsx(WX,{title:o,subtitle:i,image:s})},r))})}function KX({src:e,alt:t}){var i;const[n,r]=g.useState(!1);if(e==null)return d.jsx("div",{className:"flex-shrink-0 ml-4 w-20 h-20 opacity-25 bg-bg-brand-secondary"});const o=e[Le]==="file"?Y.convertFileSource(e).url:Y.convertRemoteSource(e).url;return d.jsxs("div",{className:"relative flex-shrink-0 ml-4 w-20 h-20",children:[!n&&d.jsx("div",{className:"absolute inset-0 opacity-25 bg-bg-brand-secondary animate-in"}),d.jsx("img",{src:o,alt:t,onLoad:()=>r(!0),onError:()=>r(!1),className:`absolute inset-0 object-cover w-full h-full rounded-r-lg ${n?"opacity-100":"opacity-0"}`,style:{objectPosition:(i=e.metadata)!=null&&i.hotspot?`${e.metadata.hotspot.x}% ${e.metadata.hotspot.y}%`:"",transition:"opacity 0.2s ease-in-out"}})]})}function GX({path:e}){const t=lt(e,"record");if(t.status==="error")return d.jsx(it,{path:e,error:t.error});if(!("data"in t)||t.data===void 0)return d.jsx(wr,{path:e});if(t.data===null)return d.jsx(Sr,{path:e});const n=Object.keys(t.data);return d.jsxs("div",{className:"text-left",children:[d.jsx("span",{className:"text-fg-brand-primary",children:n.length}),d.jsx("span",{className:"mr-1",children:` item${n.length===1?"":"s"}:`}),n.map((r,o)=>d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-fg-brand-primary",children:r},r),o<n.length-1?", ":""]}))]})}let Py=()=>({events:{},emit(e,...t){(this.events[e]||[]).forEach(n=>n(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(n=>n!==t)}});var dw={exports:{}};(function(e,t){var n=typeof Reflect<"u"?Reflect.construct:void 0,r=Object.defineProperty,o=Error.captureStackTrace;o===void 0&&(o=function(c){var u=new Error;r(c,"stack",{configurable:!0,get:function(){var h=u.stack;return r(this,"stack",{configurable:!0,value:h,writable:!0}),h},set:function(h){r(c,"stack",{configurable:!0,value:h,writable:!0})}})});function i(l){l!==void 0&&r(this,"message",{configurable:!0,value:l,writable:!0});var c=this.constructor.name;c!==void 0&&c!==this.name&&r(this,"name",{configurable:!0,value:c,writable:!0}),o(this,this.constructor)}i.prototype=Object.create(Error.prototype,{constructor:{configurable:!0,value:i,writable:!0}});var s=function(){function l(u,f){return r(u,"name",{configurable:!0,value:f})}try{var c=function(){};if(l(c,"foo"),c.name==="foo")return l}catch{}}();function a(l,c){if(c==null||c===Error)c=i;else if(typeof c!="function")throw new TypeError("super_ should be a function");var u;if(typeof l=="string")u=l,l=n!==void 0?function(){return n(c,arguments,this.constructor)}:function(){c.apply(this,arguments)},s!==void 0&&(s(l,u),u=void 0);else if(typeof l!="function")throw new TypeError("constructor should be either a string or a function");l.super_=l.super=c;var f={constructor:{configurable:!0,value:l,writable:!0}};return u!==void 0&&(f.name={configurable:!0,value:u,writable:!0}),l.prototype=Object.create(c.prototype,f),l}t=e.exports=a,t.BaseError=i})(dw,dw.exports);var KI=dw.exports,hP="ProseMirror-selectednode",GI="",ta="\0",pP="__state_override__",qX={LastNodeCompatible:"lastNodeCompatible",FormattingMark:"formattingMark",FormattingNode:"formattingNode",NodeCursor:"nodeCursor",FontStyle:"fontStyle",Link:"link",Color:"color",Alignment:"alignment",Indentation:"indentation",Behavior:"behavior",Code:"code",InlineNode:"inline",ListContainerNode:"listContainer",ListItemNode:"listItemNode",Block:"block",BlockNode:"block",TextBlock:"textBlock",ExcludeInputRules:"excludeFromInputRules",PreventExits:"preventsExits",Media:"media"},He=qX,fs=Symbol.for("__remirror__"),gn=(e=>(e.PlainExtension="RemirrorPlainExtension",e.NodeExtension="RemirrorNodeExtension",e.MarkExtension="RemirrorMarkExtension",e.PlainExtensionConstructor="RemirrorPlainExtensionConstructor",e.NodeExtensionConstructor="RemirrorNodeExtensionConstructor",e.MarkExtensionConstructor="RemirrorMarkExtensionConstructor",e.Manager="RemirrorManager",e.Preset="RemirrorPreset",e.PresetConstructor="RemirrorPresetConstructor",e))(gn||{}),mt=(e=>(e[e.Critical=1e6]="Critical",e[e.Highest=1e5]="Highest",e[e.High=1e4]="High",e[e.Medium=1e3]="Medium",e[e.Default=100]="Default",e[e.Low=10]="Low",e[e.Lowest=0]="Lowest",e))(mt||{}),lr=(e=>(e[e.None=0]="None",e[e.Create=1]="Create",e[e.EditorView=2]="EditorView",e[e.Runtime=3]="Runtime",e[e.Destroy=4]="Destroy",e))(lr||{}),re=(e=>(e.Undo="_|undo|_",e.Redo="_|redo|_",e.Bold="_|bold|_",e.Italic="_|italic|_",e.Underline="_|underline|_",e.Strike="_|strike|_",e.Code="_|code|_",e.Paragraph="_|paragraph|_",e.H1="_|h1|_",e.H2="_|h2|_",e.H3="_|h3|_",e.H4="_|h4|_",e.H5="_|h5|_",e.H6="_|h6|_",e.TaskList="_|task|_",e.BulletList="_|bullet|_",e.OrderedList="_|number|_",e.Quote="_|quote|_",e.Divider="_|divider|_",e.Codeblock="_|codeblock|_",e.ClearFormatting="_|clear|_",e.Superscript="_|sup|_",e.Subscript="_|sub|_",e.LeftAlignment="_|left-align|_",e.CenterAlignment="_|center-align|_",e.RightAlignment="_|right-align|_",e.JustifyAlignment="_|justify-align|_",e.InsertLink="_|link|_",e.Find="_|find|_",e.FindBackwards="_|find-backwards|_",e.FindReplace="_|find-replace|_",e.AddFootnote="_|footnote|_",e.AddComment="_|comment|_",e.ContextMenu="_|context-menu|_",e.IncreaseFontSize="_|inc-font-size|_",e.DecreaseFontSize="_|dec-font-size|_",e.IncreaseIndent="_|indent|_",e.DecreaseIndent="_|dedent|_",e.Shortcuts="_|shortcuts|_",e.Copy="_|copy|_",e.Cut="_|cut|_",e.Paste="_|paste|_",e.PastePlain="_|paste-plain|_",e.SelectAll="_|select-all|_",e.Format="_|format|_",e))(re||{}),ne=(e=>(e.PROD="RMR0000",e.UNKNOWN="RMR0001",e.INVALID_COMMAND_ARGUMENTS="RMR0002",e.CUSTOM="RMR0003",e.CORE_HELPERS="RMR0004",e.MUTATION="RMR0005",e.INTERNAL="RMR0006",e.MISSING_REQUIRED_EXTENSION="RMR0007",e.MANAGER_PHASE_ERROR="RMR0008",e.INVALID_GET_EXTENSION="RMR0010",e.INVALID_MANAGER_ARGUMENTS="RMR0011",e.SCHEMA="RMR0012",e.HELPERS_CALLED_IN_OUTER_SCOPE="RMR0013",e.INVALID_MANAGER_EXTENSION="RMR0014",e.DUPLICATE_COMMAND_NAMES="RMR0016",e.DUPLICATE_HELPER_NAMES="RMR0017",e.NON_CHAINABLE_COMMAND="RMR0018",e.INVALID_EXTENSION="RMR0019",e.INVALID_CONTENT="RMR0021",e.INVALID_NAME="RMR0050",e.EXTENSION="RMR0100",e.EXTENSION_SPEC="RMR0101",e.EXTENSION_EXTRA_ATTRIBUTES="RMR0102",e.INVALID_SET_EXTENSION_OPTIONS="RMR0103",e.REACT_PROVIDER_CONTEXT="RMR0200",e.REACT_GET_ROOT_PROPS="RMR0201",e.REACT_EDITOR_VIEW="RMR0202",e.REACT_CONTROLLED="RMR0203",e.REACT_NODE_VIEW="RMR0204",e.REACT_GET_CONTEXT="RMR0205",e.REACT_COMPONENTS="RMR0206",e.REACT_HOOKS="RMR0207",e.I18N_CONTEXT="RMR0300",e))(ne||{}),YX=function(t){return JX(t)&&!XX(t)};function JX(e){return!!e&&typeof e=="object"}function XX(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||eZ(e)}var ZX=typeof Symbol=="function"&&Symbol.for,QX=ZX?Symbol.for("react.element"):60103;function eZ(e){return e.$$typeof===QX}function tZ(e){return Array.isArray(e)?[]:{}}function wh(e,t){return t.clone!==!1&&t.isMergeableObject(e)?_u(tZ(e),e,t):e}function nZ(e,t,n){return e.concat(t).map(function(r){return wh(r,n)})}function rZ(e,t){if(!t.customMerge)return _u;var n=t.customMerge(e);return typeof n=="function"?n:_u}function oZ(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function mP(e){return Object.keys(e).concat(oZ(e))}function qI(e,t){try{return t in e}catch{return!1}}function iZ(e,t){return qI(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function sZ(e,t,n){var r={};return n.isMergeableObject(e)&&mP(e).forEach(function(o){r[o]=wh(e[o],n)}),mP(t).forEach(function(o){iZ(e,o)||(qI(e,o)&&n.isMergeableObject(t[o])?r[o]=rZ(o,n)(e[o],t[o],n):r[o]=wh(t[o],n))}),r}function _u(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||nZ,n.isMergeableObject=n.isMergeableObject||YX,n.cloneUnlessOtherwiseSpecified=wh;var r=Array.isArray(t),o=Array.isArray(e),i=r===o;return i?r?n.arrayMerge(e,t,n):sZ(e,t,n):wh(t,n)}_u.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return _u(r,o,n)},{})};var aZ=_u,lZ=aZ;const cZ=La(lZ);/*!
464
+ `},uY={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function dY(e){let{announcements:t=uY,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=cY}=e;const{announce:i,announcement:s}=sY(),a=mp("DndLiveRegion"),[l,c]=g.useState(!1);if(g.useEffect(()=>{c(!0)},[]),aY(g.useMemo(()=>({onDragStart(f){let{active:h}=f;i(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:p}=f;t.onDragMove&&i(t.onDragMove({active:h,over:p}))},onDragOver(f){let{active:h,over:p}=f;i(t.onDragOver({active:h,over:p}))},onDragEnd(f){let{active:h,over:p}=f;i(t.onDragEnd({active:h,over:p}))},onDragCancel(f){let{active:h,over:p}=f;i(t.onDragCancel({active:h,over:p}))}}),[i,t])),!l)return null;const u=Ce.createElement(Ce.Fragment,null,Ce.createElement(oY,{id:r,value:o.draggable}),Ce.createElement(iY,{id:a,announcement:s}));return n?Fr.createPortal(u,n):u}var tn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(tn||(tn={}));function Ug(){}function i0(e,t){return g.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function fY(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const ti=Object.freeze({x:0,y:0});function RA(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function AA(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function hY(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function ZN(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function IA(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function QN(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const pY=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=QN(t,t.left,t.top),i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=RA(QN(l),o);i.push({id:a,data:{droppableContainer:s,value:c}})}}return i.sort(AA)},mY=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=ZN(t),i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=ZN(l),u=o.reduce((h,p,m)=>h+RA(c[m],p),0),f=Number((u/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:f}})}}return i.sort(AA)};function gY(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-r,a=i-n;if(r<o&&n<i){const l=t.width*t.height,c=e.width*e.height,u=s*a,f=u/(l+c-u);return Number(f.toFixed(4))}return 0}const vY=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:s}=i,a=n.get(s);if(a){const l=gY(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(hY)};function yY(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function DA(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ti}function xY(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const bY=xY(1);function wY(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function SY(e,t,n){const r=wY(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:a}=r,l=e.left-s-(1-o)*parseFloat(n),c=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,f=i?e.height/i:e.height;return{width:u,height:f,top:c,right:l+u,bottom:c+f,left:l}}const kY={ignoreTransform:!1};function rd(e,t){t===void 0&&(t=kY);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=Er(e).getComputedStyle(e);c&&(n=SY(n,c,u))}const{top:r,left:o,width:i,height:s,bottom:a,right:l}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:l}}function eP(e){return rd(e,{ignoreTransform:!0})}function EY(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function CY(e,t){return t===void 0&&(t=Er(e).getComputedStyle(e)),t.position==="fixed"}function NY(e,t){t===void 0&&(t=Er(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function xy(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(fk(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!hp(o)||TA(o)||n.includes(o))return n;const i=Er(e).getComputedStyle(o);return o!==e&&NY(o,i)&&n.push(o),CY(o,i)?n:r(o.parentNode)}return e?r(e):n}function LA(e){const[t]=xy(e,1);return t??null}function s0(e){return!yy||!e?null:td(e)?e:dk(e)?fk(e)||e===nd(e).scrollingElement?window:hp(e)?e:null:null}function FA(e){return td(e)?e.scrollX:e.scrollLeft}function zA(e){return td(e)?e.scrollY:e.scrollTop}function nw(e){return{x:FA(e),y:zA(e)}}var fn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(fn||(fn={}));function $A(e){return!yy||!e?!1:e===document.scrollingElement}function BA(e){const t={x:0,y:0},n=$A(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const PY={x:.2,y:.2};function _Y(e,t,n,r,o){let{top:i,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),o===void 0&&(o=PY);const{isTop:c,isBottom:u,isLeft:f,isRight:h}=BA(e),p={x:0,y:0},m={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!c&&i<=t.top+v.height?(p.y=fn.Backward,m.y=r*Math.abs((t.top+v.height-i)/v.height)):!u&&l>=t.bottom-v.height&&(p.y=fn.Forward,m.y=r*Math.abs((t.bottom-v.height-l)/v.height)),!h&&a>=t.right-v.width?(p.x=fn.Forward,m.x=r*Math.abs((t.right-v.width-a)/v.width)):!f&&s<=t.left+v.width&&(p.x=fn.Backward,m.x=r*Math.abs((t.left+v.width-s)/v.width)),{direction:p,speed:m}}function jY(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function VA(e){return e.reduce((t,n)=>Zc(t,nw(n)),ti)}function TY(e){return e.reduce((t,n)=>t+FA(n),0)}function OY(e){return e.reduce((t,n)=>t+zA(n),0)}function MY(e,t){if(t===void 0&&(t=rd),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);LA(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const RY=[["x",["left","right"],TY],["y",["top","bottom"],OY]];class mk{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=xy(n),o=VA(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of RY)for(const l of s)Object.defineProperty(this,l,{get:()=>{const c=a(r),u=o[i]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class kf{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function AY(e){const{EventTarget:t}=Er(e);return e instanceof t?e:nd(e)}function a0(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var io;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(io||(io={}));function tP(e){e.preventDefault()}function IY(e){e.stopPropagation()}var Qe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Qe||(Qe={}));const UA={start:[Qe.Space,Qe.Enter],cancel:[Qe.Esc],end:[Qe.Space,Qe.Enter,Qe.Tab]},DY=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Qe.Right:return{...n,x:n.x+25};case Qe.Left:return{...n,x:n.x-25};case Qe.Down:return{...n,y:n.y+25};case Qe.Up:return{...n,y:n.y-25}}};class gk{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new kf(nd(n)),this.windowListeners=new kf(Er(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(io.Resize,this.handleCancel),this.windowListeners.add(io.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(io.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&MY(r),n(ti)}handleKeyDown(t){if(pk(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=UA,coordinateGetter:s=DY,scrollBehavior:a="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,u=c?{x:c.left,y:c.top}:ti;this.referenceCoordinates||(this.referenceCoordinates=u);const f=s(t,{active:n,context:r.current,currentCoordinates:u});if(f){const h=yh(f,u),p={x:0,y:0},{scrollableAncestors:m}=r.current;for(const v of m){const x=t.code,{isTop:b,isRight:w,isLeft:S,isBottom:C,maxScroll:N,minScroll:P}=BA(v),_=jY(v),O={x:Math.min(x===Qe.Right?_.right-_.width/2:_.right,Math.max(x===Qe.Right?_.left:_.left+_.width/2,f.x)),y:Math.min(x===Qe.Down?_.bottom-_.height/2:_.bottom,Math.max(x===Qe.Down?_.top:_.top+_.height/2,f.y))},M=x===Qe.Right&&!w||x===Qe.Left&&!S,D=x===Qe.Down&&!C||x===Qe.Up&&!b;if(M&&O.x!==f.x){const U=v.scrollLeft+h.x,z=x===Qe.Right&&U<=N.x||x===Qe.Left&&U>=P.x;if(z&&!h.y){v.scrollTo({left:U,behavior:a});return}z?p.x=v.scrollLeft-U:p.x=x===Qe.Right?v.scrollLeft-N.x:v.scrollLeft-P.x,p.x&&v.scrollBy({left:-p.x,behavior:a});break}else if(D&&O.y!==f.y){const U=v.scrollTop+h.y,z=x===Qe.Down&&U<=N.y||x===Qe.Up&&U>=P.y;if(z&&!h.x){v.scrollTo({top:U,behavior:a});return}z?p.y=v.scrollTop-U:p.y=x===Qe.Down?v.scrollTop-N.y:v.scrollTop-P.y,p.y&&v.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,Zc(yh(f,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}gk.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=UA,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function nP(e){return!!(e&&"distance"in e)}function rP(e){return!!(e&&"delay"in e)}class vk{constructor(t,n,r){var o;r===void 0&&(r=AY(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:s}=i;this.props=t,this.events=n,this.document=nd(s),this.documentListeners=new kf(this.document),this.listeners=new kf(r),this.windowListeners=new kf(Er(s)),this.initialCoordinates=(o=tw(i))!=null?o:ti,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(io.Resize,this.handleCancel),this.windowListeners.add(io.DragStart,tP),this.windowListeners.add(io.VisibilityChange,this.handleCancel),this.windowListeners.add(io.ContextMenu,tP),this.documentListeners.add(io.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(rP(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(nP(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(io.Click,IY,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(io.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const l=(n=tw(t))!=null?n:ti,c=yh(o,l);if(!r&&a){if(nP(a)){if(a.tolerance!=null&&a0(c,a.tolerance))return this.handleCancel();if(a0(c,a.distance))return this.handleStart()}if(rP(a)&&a0(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Qe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const LY={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class WA extends vk{constructor(t){const{event:n}=t,r=nd(n.target);super(t,LY,r)}}WA.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const FY={move:{name:"mousemove"},end:{name:"mouseup"}};var rw;(function(e){e[e.RightClick=2]="RightClick"})(rw||(rw={}));class HA extends vk{constructor(t){super(t,FY,nd(t.event.target))}}HA.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===rw.RightClick?!1:(r==null||r({event:n}),!0)}}];const l0={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class KA extends vk{constructor(t){super(t,l0)}static setup(){return window.addEventListener(l0.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(l0.move.name,t)};function t(){}}}KA.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var Ef;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ef||(Ef={}));var Wg;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Wg||(Wg={}));function zY(e){let{acceleration:t,activator:n=Ef.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=Wg.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:f,threshold:h}=e;const p=BY({delta:f,disabled:!i}),[m,v]=Qq(),x=g.useRef({x:0,y:0}),b=g.useRef({x:0,y:0}),w=g.useMemo(()=>{switch(n){case Ef.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Ef.DraggableRect:return o}},[n,o,l]),S=g.useRef(null),C=g.useCallback(()=>{const P=S.current;if(!P)return;const _=x.current.x*b.current.x,O=x.current.y*b.current.y;P.scrollBy(_,O)},[]),N=g.useMemo(()=>a===Wg.TreeOrder?[...c].reverse():c,[a,c]);g.useEffect(()=>{if(!i||!c.length||!w){v();return}for(const P of N){if((r==null?void 0:r(P))===!1)continue;const _=c.indexOf(P),O=u[_];if(!O)continue;const{direction:M,speed:D}=_Y(P,O,w,t,h);for(const U of["x","y"])p[U][M[U]]||(D[U]=0,M[U]=0);if(D.x>0||D.y>0){v(),S.current=P,m(C,s),x.current=D,b.current=M;return}}x.current={x:0,y:0},b.current={x:0,y:0},v()},[t,C,r,v,i,s,JSON.stringify(w),JSON.stringify(p),m,c,N,u,JSON.stringify(h)])}const $Y={x:{[fn.Backward]:!1,[fn.Forward]:!1},y:{[fn.Backward]:!1,[fn.Forward]:!1}};function BY(e){let{delta:t,disabled:n}=e;const r=ew(t);return pp(o=>{if(n||!r||!o)return $Y;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[fn.Backward]:o.x[fn.Backward]||i.x===-1,[fn.Forward]:o.x[fn.Forward]||i.x===1},y:{[fn.Backward]:o.y[fn.Backward]||i.y===-1,[fn.Forward]:o.y[fn.Forward]||i.y===1}}},[n,t,r])}function VY(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return pp(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function UY(e,t){return g.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...i]},[]),[e,t])}var bh;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(bh||(bh={}));var ow;(function(e){e.Optimized="optimized"})(ow||(ow={}));const oP=new Map;function WY(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=g.useState(null),{frequency:a,measure:l,strategy:c}=o,u=g.useRef(e),f=x(),h=vh(f),p=g.useCallback(function(b){b===void 0&&(b=[]),!h.current&&s(w=>w===null?b:w.concat(b.filter(S=>!w.includes(S))))},[h]),m=g.useRef(null),v=pp(b=>{if(f&&!n)return oP;if(!b||b===oP||u.current!==e||i!=null){const w=new Map;for(let S of e){if(!S)continue;if(i&&i.length>0&&!i.includes(S.id)&&S.rect.current){w.set(S.id,S.rect.current);continue}const C=S.node.current,N=C?new mk(l(C),C):null;S.rect.current=N,N&&w.set(S.id,N)}return w}return b},[e,i,n,f,l]);return g.useEffect(()=>{u.current=e},[e]),g.useEffect(()=>{f||p()},[n,f]),g.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),g.useEffect(()=>{f||typeof a!="number"||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},a))},[a,f,p,...r]),{droppableRects:v,measureDroppableContainers:p,measuringScheduled:i!=null};function x(){switch(c){case bh.Always:return!1;case bh.BeforeDragging:return n;default:return!n}}}function GA(e,t){return pp(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function HY(e,t){return GA(e,t)}function KY(e){let{callback:t,disabled:n}=e;const r=hk(t),o=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return g.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function by(e){let{callback:t,disabled:n}=e;const r=hk(t),o=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return g.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function GY(e){return new mk(rd(e),e)}function iP(e,t,n){t===void 0&&(t=GY);const[r,o]=g.useState(null);function i(){o(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const s=KY({callback(l){if(e)for(const c of l){const{type:u,target:f}=c;if(u==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),a=by({callback:i});return Ei(()=>{i(),e?(a==null||a.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),s==null||s.disconnect())},[e]),r}function qY(e){const t=GA(e);return DA(e,t)}const sP=[];function YY(e){const t=g.useRef(e),n=pp(r=>e?r&&r!==sP&&e&&t.current&&e.parentNode===t.current.parentNode?r:xy(e):sP,[e]);return g.useEffect(()=>{t.current=e},[e]),n}function JY(e){const[t,n]=g.useState(null),r=g.useRef(e),o=g.useCallback(i=>{const s=s0(i.target);s&&n(a=>a?(a.set(s,nw(s)),new Map(a)):null)},[]);return g.useEffect(()=>{const i=r.current;if(e!==i){s(i);const a=e.map(l=>{const c=s0(l);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,nw(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(l=>{const c=s0(l);c==null||c.removeEventListener("scroll",o)})}},[o,e]),g.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>Zc(i,s),ti):VA(e):ti,[e,t])}function aP(e,t){t===void 0&&(t=[]);const n=g.useRef(null);return g.useEffect(()=>{n.current=null},t),g.useEffect(()=>{const r=e!==ti;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?yh(e,n.current):ti}function XY(e){g.useEffect(()=>{if(!yy)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function ZY(e,t){return g.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=s=>{i(s,t)},n},{}),[e,t])}function qA(e){return g.useMemo(()=>e?EY(e):null,[e])}const lP=[];function QY(e,t){t===void 0&&(t=rd);const[n]=e,r=qA(n?Er(n):null),[o,i]=g.useState(lP);function s(){i(()=>e.length?e.map(l=>$A(l)?r:new mk(t(l),l)):lP)}const a=by({callback:s});return Ei(()=>{a==null||a.disconnect(),s(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function eJ(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return hp(t)?t:e}function tJ(e){let{measure:t}=e;const[n,r]=g.useState(null),o=g.useCallback(c=>{for(const{target:u}of c)if(hp(u)){r(f=>{const h=t(u);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),i=by({callback:o}),s=g.useCallback(c=>{const u=eJ(c);i==null||i.disconnect(),u&&(i==null||i.observe(u)),r(u?t(u):null)},[t,i]),[a,l]=Vg(s);return g.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const nJ=[{sensor:WA,options:{}},{sensor:gk,options:{}}],rJ={current:{}},Om={draggable:{measure:eP},droppable:{measure:eP,strategy:bh.WhileDragging,frequency:ow.Optimized},dragOverlay:{measure:rd}};class Cf extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const oJ={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Cf,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ug},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Om,measureDroppableContainers:Ug,windowRect:null,measuringScheduled:!1},iJ={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ug,draggableNodes:new Map,over:null,measureDroppableContainers:Ug},wy=g.createContext(iJ),YA=g.createContext(oJ);function sJ(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Cf}}}function aJ(e,t){switch(t.type){case tn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case tn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case tn.DragEnd:case tn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case tn.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Cf(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case tn.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new Cf(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case tn.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Cf(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function lJ(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=g.useContext(wy),i=ew(r),s=ew(n==null?void 0:n.id);return g.useEffect(()=>{if(!t&&!r&&i&&s!=null){if(!pk(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const u of[l.current,c.current]){if(!u)continue;const f=nY(u);if(f){f.focus();break}}})}},[r,t,o,s,i]),null}function cJ(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function uJ(e){return g.useMemo(()=>({draggable:{...Om.draggable,...e==null?void 0:e.draggable},droppable:{...Om.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Om.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function dJ(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=g.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;Ei(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!r)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const u=n(c),f=DA(u,r);if(s||(f.x=0),a||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=LA(c);h&&h.scrollBy({top:f.y,left:f.x})}},[t,s,a,r,n])}const JA=g.createContext({...ti,scaleX:1,scaleY:1});var Bs;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Bs||(Bs={}));const fJ=g.memo(function(t){var n,r,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:u=nJ,collisionDetection:f=vY,measuring:h,modifiers:p,...m}=t;const v=g.useReducer(aJ,void 0,sJ),[x,b]=v,[w,S]=lY(),[C,N]=g.useState(Bs.Uninitialized),P=C===Bs.Initialized,{draggable:{active:_,nodes:O,translate:M},droppable:{containers:D}}=x,U=_!=null?O.get(_):null,z=g.useRef({initial:null,translated:null}),K=g.useMemo(()=>{var Dn;return _!=null?{id:_,data:(Dn=U==null?void 0:U.data)!=null?Dn:rJ,rect:z}:null},[_,U]),H=g.useRef(null),[V,I]=g.useState(null),[A,j]=g.useState(null),L=vh(m,Object.values(m)),$=mp("DndDescribedBy",s),W=g.useMemo(()=>D.getEnabled(),[D]),G=uJ(h),{droppableRects:Pe,measureDroppableContainers:ke,measuringScheduled:oe}=WY(W,{dragging:P,dependencies:[M.x,M.y],config:G.droppable}),ae=VY(O,_),X=g.useMemo(()=>A?tw(A):null,[A]),Ee=AF(),De=HY(ae,G.draggable.measure);dJ({activeNode:_!=null?O.get(_):null,config:Ee.layoutShiftCompensation,initialRect:De,measure:G.draggable.measure});const he=iP(ae,G.draggable.measure,De),Fe=iP(ae?ae.parentElement:null),_e=g.useRef({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:Pe,draggableNodes:O,draggingNode:null,draggingNodeRect:null,droppableContainers:D,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),tt=D.getNodeFor((n=_e.current.over)==null?void 0:n.id),gt=tJ({measure:G.dragOverlay.measure}),Kt=(r=gt.nodeRef.current)!=null?r:ae,T=P?(o=gt.rect)!=null?o:he:null,k=!!(gt.nodeRef.current&&gt.rect),E=qY(k?null:he),R=qA(Kt?Er(Kt):null),F=YY(P?tt??ae:null),J=QY(F),Q=cJ(p,{transform:{x:M.x-E.x,y:M.y-E.y,scaleX:1,scaleY:1},activatorEvent:A,active:K,activeNodeRect:he,containerNodeRect:Fe,draggingNodeRect:T,over:_e.current.over,overlayNodeRect:gt.rect,scrollableAncestors:F,scrollableAncestorRects:J,windowRect:R}),Xe=X?Zc(X,M):null,ct=JY(F),wt=aP(ct),cn=aP(ct,[he]),dt=Zc(Q,wt),Po=T?bY(T,Q):null,xs=K&&Po?f({active:K,collisionRect:Po,droppableRects:Pe,droppableContainers:W,pointerCoordinates:Xe}):null,ud=IA(xs,"id"),[bs,OE]=g.useState(null),jF=k?Q:Zc(Q,cn),TF=yY(jF,(i=bs==null?void 0:bs.rect)!=null?i:null,he),Qy=g.useRef(null),ME=g.useCallback((Dn,Nr)=>{let{sensor:Pr,options:ws}=Nr;if(H.current==null)return;const no=O.get(H.current);if(!no)return;const _r=Dn.nativeEvent,si=new Pr({active:H.current,activeNode:no,event:_r,options:ws,context:_e,onAbort(wn){if(!O.get(wn))return;const{onDragAbort:ai}=L.current,Mi={id:wn};ai==null||ai(Mi),w({type:"onDragAbort",event:Mi})},onPending(wn,Ss,ai,Mi){if(!O.get(wn))return;const{onDragPending:fd}=L.current,ks={id:wn,constraint:Ss,initialCoordinates:ai,offset:Mi};fd==null||fd(ks),w({type:"onDragPending",event:ks})},onStart(wn){const Ss=H.current;if(Ss==null)return;const ai=O.get(Ss);if(!ai)return;const{onDragStart:Mi}=L.current,dd={activatorEvent:_r,active:{id:Ss,data:ai.data,rect:z}};Fr.unstable_batchedUpdates(()=>{Mi==null||Mi(dd),N(Bs.Initializing),b({type:tn.DragStart,initialCoordinates:wn,active:Ss}),w({type:"onDragStart",event:dd}),I(Qy.current),j(_r)})},onMove(wn){b({type:tn.DragMove,coordinates:wn})},onEnd:sc(tn.DragEnd),onCancel:sc(tn.DragCancel)});Qy.current=si;function sc(wn){return async function(){const{active:ai,collisions:Mi,over:dd,scrollAdjustedTranslate:fd}=_e.current;let ks=null;if(ai&&fd){const{cancelDrop:hd}=L.current;ks={activatorEvent:_r,active:ai,collisions:Mi,delta:fd,over:dd},wn===tn.DragEnd&&typeof hd=="function"&&await Promise.resolve(hd(ks))&&(wn=tn.DragCancel)}H.current=null,Fr.unstable_batchedUpdates(()=>{b({type:wn}),N(Bs.Uninitialized),OE(null),I(null),j(null),Qy.current=null;const hd=wn===tn.DragEnd?"onDragEnd":"onDragCancel";if(ks){const ex=L.current[hd];ex==null||ex(ks),w({type:hd,event:ks})}})}}},[O]),OF=g.useCallback((Dn,Nr)=>(Pr,ws)=>{const no=Pr.nativeEvent,_r=O.get(ws);if(H.current!==null||!_r||no.dndKit||no.defaultPrevented)return;const si={active:_r};Dn(Pr,Nr.options,si)===!0&&(no.dndKit={capturedBy:Nr.sensor},H.current=ws,ME(Pr,Nr))},[O,ME]),RE=UY(u,OF);XY(u),Ei(()=>{he&&C===Bs.Initializing&&N(Bs.Initialized)},[he,C]),g.useEffect(()=>{const{onDragMove:Dn}=L.current,{active:Nr,activatorEvent:Pr,collisions:ws,over:no}=_e.current;if(!Nr||!Pr)return;const _r={active:Nr,activatorEvent:Pr,collisions:ws,delta:{x:dt.x,y:dt.y},over:no};Fr.unstable_batchedUpdates(()=>{Dn==null||Dn(_r),w({type:"onDragMove",event:_r})})},[dt.x,dt.y]),g.useEffect(()=>{const{active:Dn,activatorEvent:Nr,collisions:Pr,droppableContainers:ws,scrollAdjustedTranslate:no}=_e.current;if(!Dn||H.current==null||!Nr||!no)return;const{onDragOver:_r}=L.current,si=ws.get(ud),sc=si&&si.rect.current?{id:si.id,rect:si.rect.current,data:si.data,disabled:si.disabled}:null,wn={active:Dn,activatorEvent:Nr,collisions:Pr,delta:{x:no.x,y:no.y},over:sc};Fr.unstable_batchedUpdates(()=>{OE(sc),_r==null||_r(wn),w({type:"onDragOver",event:wn})})},[ud]),Ei(()=>{_e.current={activatorEvent:A,active:K,activeNode:ae,collisionRect:Po,collisions:xs,droppableRects:Pe,draggableNodes:O,draggingNode:Kt,draggingNodeRect:T,droppableContainers:D,over:bs,scrollableAncestors:F,scrollAdjustedTranslate:dt},z.current={initial:T,translated:Po}},[K,ae,xs,Po,O,Kt,T,Pe,D,bs,F,dt]),zY({...Ee,delta:M,draggingRect:Po,pointerCoordinates:Xe,scrollableAncestors:F,scrollableAncestorRects:J});const MF=g.useMemo(()=>({active:K,activeNode:ae,activeNodeRect:he,activatorEvent:A,collisions:xs,containerNodeRect:Fe,dragOverlay:gt,draggableNodes:O,droppableContainers:D,droppableRects:Pe,over:bs,measureDroppableContainers:ke,scrollableAncestors:F,scrollableAncestorRects:J,measuringConfiguration:G,measuringScheduled:oe,windowRect:R}),[K,ae,he,A,xs,Fe,gt,O,D,Pe,bs,ke,F,J,G,oe,R]),RF=g.useMemo(()=>({activatorEvent:A,activators:RE,active:K,activeNodeRect:he,ariaDescribedById:{draggable:$},dispatch:b,draggableNodes:O,over:bs,measureDroppableContainers:ke}),[A,RE,K,he,b,$,O,bs,ke]);return Ce.createElement(MA.Provider,{value:S},Ce.createElement(wy.Provider,{value:RF},Ce.createElement(YA.Provider,{value:MF},Ce.createElement(JA.Provider,{value:TF},c)),Ce.createElement(lJ,{disabled:(a==null?void 0:a.restoreFocus)===!1})),Ce.createElement(dY,{...a,hiddenTextDescribedById:$}));function AF(){const Dn=(V==null?void 0:V.autoScrollEnabled)===!1,Nr=typeof l=="object"?l.enabled===!1:l===!1,Pr=P&&!Dn&&!Nr;return typeof l=="object"?{...l,enabled:Pr}:{enabled:Pr}}}),hJ=g.createContext(null),cP="button",pJ="Draggable";function mJ(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=mp(pJ),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:f,over:h}=g.useContext(wy),{role:p=cP,roleDescription:m="draggable",tabIndex:v=0}=o??{},x=(l==null?void 0:l.id)===t,b=g.useContext(x?JA:hJ),[w,S]=Vg(),[C,N]=Vg(),P=ZY(s,t),_=vh(n);Ei(()=>(f.set(t,{id:t,key:i,node:w,activatorNode:C,data:_}),()=>{const M=f.get(t);M&&M.key===i&&f.delete(t)}),[f,t]);const O=g.useMemo(()=>({role:p,tabIndex:v,"aria-disabled":r,"aria-pressed":x&&p===cP?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,v,x,m,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:O,isDragging:x,listeners:r?void 0:P,node:w,over:h,setNodeRef:S,setActivatorNodeRef:N,transform:b}}function gJ(){return g.useContext(YA)}const vJ="Droppable",yJ={timeout:25};function xJ(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=mp(vJ),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=g.useContext(wy),u=g.useRef({disabled:n}),f=g.useRef(!1),h=g.useRef(null),p=g.useRef(null),{disabled:m,updateMeasurementsFor:v,timeout:x}={...yJ,...o},b=vh(v??r),w=g.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{c(Array.isArray(b.current)?b.current:[b.current]),p.current=null},x)},[x]),S=by({callback:w,disabled:m||!s}),C=g.useCallback((O,M)=>{S&&(M&&(S.unobserve(M),f.current=!1),O&&S.observe(O))},[S]),[N,P]=Vg(C),_=vh(t);return g.useEffect(()=>{!S||!N.current||(S.disconnect(),f.current=!1,S.observe(N.current))},[N,S]),g.useEffect(()=>(a({type:tn.RegisterDroppable,element:{id:r,key:i,disabled:n,node:N,rect:h,data:_}}),()=>a({type:tn.UnregisterDroppable,key:i,id:r})),[r]),g.useEffect(()=>{n!==u.current.disabled&&(a({type:tn.SetDroppableDisabled,id:r,key:i,disabled:n}),u.current.disabled=n)},[r,i,n,a]),{active:s,rect:h,isOver:(l==null?void 0:l.id)===r,node:N,over:l,setNodeRef:P}}function yk(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function bJ(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function sm(e){return e!==null&&e>=0}function wJ(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function SJ(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const XA=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=yk(t,r,n),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},am={scaleX:1,scaleY:1},kJ=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:s}=e;const a=(t=i[n])!=null?t:r;if(!a)return null;if(o===n){const c=i[s];return c?{x:0,y:n<s?c.top+c.height-(a.top+a.height):c.top-a.top,...am}:null}const l=EJ(i,o,n);return o>n&&o<=s?{x:0,y:-a.height-l,...am}:o<n&&o>=s?{x:0,y:a.height+l,...am}:{x:0,y:0,...am}};function EJ(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const ZA="Sortable",QA=Ce.createContext({activeIndex:-1,containerId:ZA,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:XA,disabled:{draggable:!1,droppable:!1}});function CJ(e){let{children:t,id:n,items:r,strategy:o=XA,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:u}=gJ(),f=mp(ZA,n),h=a.rect!==null,p=g.useMemo(()=>r.map(P=>typeof P=="object"&&"id"in P?P.id:P),[r]),m=s!=null,v=s?p.indexOf(s.id):-1,x=c?p.indexOf(c.id):-1,b=g.useRef(p),w=!wJ(p,b.current),S=x!==-1&&v===-1||w,C=SJ(i);Ei(()=>{w&&m&&u(p)},[w,p,m,u]),g.useEffect(()=>{b.current=p},[p]);const N=g.useMemo(()=>({activeIndex:v,containerId:f,disabled:C,disableTransforms:S,items:p,overIndex:x,useDragOverlay:h,sortedRects:bJ(p,l),strategy:o}),[v,f,C.draggable,C.droppable,S,p,x,l,h,o]);return Ce.createElement(QA.Provider,{value:N},t)}const NJ=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return yk(n,r,o).indexOf(t)},PJ=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:l,transition:c}=e;return!c||!r||a!==i&&o===s?!1:n?!0:s!==o&&t===l},_J={duration:200,easing:"ease"},eI="transform",jJ=xh.Transition.toString({property:eI,duration:0,easing:"linear"}),TJ={roleDescription:"sortable"};function OJ(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,s]=g.useState(null),a=g.useRef(n);return Ei(()=>{if(!t&&n!==a.current&&r.current){const l=o.current;if(l){const c=rd(r.current,{ignoreTransform:!0}),u={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(u.x||u.y)&&s(u)}}n!==a.current&&(a.current=n)},[t,n,r,o]),g.useEffect(()=>{i&&s(null)},[i]),i}function MJ(e){let{animateLayoutChanges:t=PJ,attributes:n,disabled:r,data:o,getNewIndex:i=NJ,id:s,strategy:a,resizeObserverConfig:l,transition:c=_J}=e;const{items:u,containerId:f,activeIndex:h,disabled:p,disableTransforms:m,sortedRects:v,overIndex:x,useDragOverlay:b,strategy:w}=g.useContext(QA),S=RJ(r,p),C=u.indexOf(s),N=g.useMemo(()=>({sortable:{containerId:f,index:C,items:u},...o}),[f,o,C,u]),P=g.useMemo(()=>u.slice(u.indexOf(s)),[u,s]),{rect:_,node:O,isOver:M,setNodeRef:D}=xJ({id:s,data:N,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:P,...l}}),{active:U,activatorEvent:z,activeNodeRect:K,attributes:H,setNodeRef:V,listeners:I,isDragging:A,over:j,setActivatorNodeRef:L,transform:$}=mJ({id:s,data:N,attributes:{...TJ,...n},disabled:S.draggable}),W=Zq(D,V),G=!!U,Pe=G&&!m&&sm(h)&&sm(x),ke=!b&&A,oe=ke&&Pe?$:null,X=Pe?oe??(a??w)({rects:v,activeNodeRect:K,activeIndex:h,overIndex:x,index:C}):null,Ee=sm(h)&&sm(x)?i({id:s,items:u,activeIndex:h,overIndex:x}):C,De=U==null?void 0:U.id,he=g.useRef({activeId:De,items:u,newIndex:Ee,containerId:f}),Fe=u!==he.current.items,_e=t({active:U,containerId:f,isDragging:A,isSorting:G,id:s,index:C,items:u,newIndex:he.current.newIndex,previousItems:he.current.items,previousContainerId:he.current.containerId,transition:c,wasDragging:he.current.activeId!=null}),tt=OJ({disabled:!_e,index:C,node:O,rect:_});return g.useEffect(()=>{G&&he.current.newIndex!==Ee&&(he.current.newIndex=Ee),f!==he.current.containerId&&(he.current.containerId=f),u!==he.current.items&&(he.current.items=u)},[G,Ee,f,u]),g.useEffect(()=>{if(De===he.current.activeId)return;if(De&&!he.current.activeId){he.current.activeId=De;return}const Kt=setTimeout(()=>{he.current.activeId=De},50);return()=>clearTimeout(Kt)},[De]),{active:U,activeIndex:h,attributes:H,data:N,rect:_,index:C,newIndex:Ee,items:u,isOver:M,isSorting:G,isDragging:A,listeners:I,node:O,overIndex:x,over:j,setNodeRef:W,setActivatorNodeRef:L,setDroppableNodeRef:D,setDraggableNodeRef:V,transform:tt??X,transition:gt()};function gt(){if(tt||Fe&&he.current.newIndex===C)return jJ;if(!(ke&&!pk(z)||!c)&&(G||_e))return xh.Transition.toString({...c,property:eI})}}function RJ(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function Hg(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const AJ=[Qe.Down,Qe.Right,Qe.Up,Qe.Left],IJ=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(AJ.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];i.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const h=o.get(f.id);if(h)switch(e.code){case Qe.Down:r.top<h.top&&l.push(f);break;case Qe.Up:r.top>h.top&&l.push(f);break;case Qe.Left:r.left>h.left&&l.push(f);break;case Qe.Right:r.left<h.left&&l.push(f);break}});const c=mY({active:n,collisionRect:r,droppableRects:o,droppableContainers:l,pointerCoordinates:null});let u=IA(c,"id");if(u===(s==null?void 0:s.id)&&c.length>1&&(u=c[1].id),u!=null){const f=i.get(n.id),h=i.get(u),p=h?o.get(h.id):null,m=h==null?void 0:h.node.current;if(m&&p&&f&&h){const x=xy(m).some((P,_)=>a[_]!==P),b=tI(f,h),w=DJ(f,h),S=x||!b?{x:0,y:0}:{x:w?r.width-p.width:0,y:w?r.height-p.height:0},C={x:p.left,y:p.top};return S.x&&S.y?C:yh(C,S)}}}};function tI(e,t){return!Hg(e)||!Hg(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function DJ(e,t){return!Hg(e)||!Hg(t)||!tI(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function qr({}){return null}function nI({path:e,autoFocus:t}){const n="string",r=Ft(e),o=lt(e,"string"),{patchPath:i,addPatch:s}=bn(e),[a,l]=g.useState(null),c="data"in o&&o.data,u="clientSideOnly"in o&&o.clientSideOnly;return g.useEffect(()=>{u===!1&&l(typeof c=="string"?c:null)},[c,u]),r.status==="error"?d.jsx(Xt,{path:e,error:r.error,type:n}):o.status==="error"?d.jsx(it,{path:e,error:o.error,schema:r}):o.status=="not-found"||r.status==="not-found"?d.jsx(Mn,{path:e,type:n}):r.status==="loading"?d.jsx(yt,{path:e,type:n}):!("data"in o)||o.data===void 0?d.jsx(yt,{path:e,type:n}):r.data.type!==n?d.jsx(kr,{path:e,expectedType:n,actualType:r.data.type}):d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),d.jsx(Qu,{className:"pr-6 sm:pr-8 sm:w-[calc(100%-0.5rem)]",autoFocus:t,value:a||"",onChange:f=>{l(f.target.value),s([{op:"replace",path:i,value:f.target.value}],n)}})]})}function LJ({path:e}){const t=lt(e,"string");return t.status==="error"?d.jsx(it,{path:e,error:t.error}):!("data"in t)||t.data===void 0?d.jsx(wr,{path:e}):t.data===null?d.jsx(Sr,{path:e}):d.jsx("div",{className:"truncate",children:t.data})}function FJ({path:e}){const t="boolean",n=Ft(e),r=lt(e,t),{patchPath:o,addPatch:i}=bn(e);if(n.status==="error")return d.jsx(Xt,{path:e,error:n.error,type:t});if(r.status==="error")return d.jsx(it,{path:e,error:r.error,schema:n});if(r.status=="not-found"||n.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(n.status==="loading")return d.jsx(yt,{path:e,type:t});if(!("data"in r)||r.data===void 0)return d.jsx(yt,{path:e,type:t});if(n.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:n.data.type});const s=r.data,a=s===null?"indeterminate":s;return d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),d.jsx(ed,{checked:a,onCheckedChange:()=>{let l=!1;n.data.opt?a===!0?l=null:a===null?l=!1:a===!1?l=!0:(console.warn("Unexpected value for boolean field",a),l=!1):a===!0?l=!1:a==="indeterminate"||a===!1?l=!0:(console.warn("Unexpected value for boolean field",a),l=!1),i([{op:"replace",path:o,value:l}],n.data.type)}})]})}function zJ({path:e,source:t,isNullable:n,loadingStatus:r}){const{addPatch:o,patchPath:i}=bn(e);return typeof t!="boolean"&&t!==null?d.jsx(it,{path:e,error:"Expected boolean"}):d.jsx(ed,{id:e,disabled:r==="loading",checked:t===null?"indeterminate":typeof t=="boolean"?t:!1,onCheckedChange:()=>{o(t===null?[{op:"replace",path:i,value:!0}]:t===!1&&n?[{op:"replace",path:i,value:null}]:t===!1?[{op:"replace",path:i,value:!0}]:[{op:"replace",path:i,value:!1}],"boolean")}})}function $J({path:e}){const t=lt(e,"boolean");return t.status==="error"?d.jsx(it,{path:e,error:t.error}):!("data"in t)||t.data===void 0?d.jsx(wr,{path:e}):t.data===null?d.jsx(Sr,{path:e}):t.data===!0?d.jsx("div",{className:"flex justify-center items-center w-4 h-4 rounded border border-border-primary",children:d.jsx(Ju,{className:"w-3 h-3"})}):t.data===!1?d.jsx("div",{className:"w-4 h-4 rounded border border-border-primary"}):(console.warn("Unexpected value for boolean field",t.data),d.jsx("div",{className:"w-4 h-4 rounded border-bg-brand-primary"}))}function BJ({path:e}){const t="number",n=Ft(e),r=lt(e,t),{patchPath:o,addPatch:i}=bn(e);if(n.status==="error")return d.jsx(Xt,{path:e,error:n.error,type:t});if(r.status==="error")return d.jsx(it,{path:e,error:r.error,schema:n});if(r.status=="not-found"||n.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(n.status==="loading")return d.jsx(yt,{path:e,type:t});if(!("data"in r)||r.data===void 0)return d.jsx(yt,{path:e,type:t});if(n.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:n.data.type});const s=r.data;return d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),d.jsx(Qu,{inputMode:"numeric",value:s||0,onChange:a=>{const l=Number(a.target.value);Number.isNaN(l)||i([{op:"replace",path:o,value:l}],t)}})]})}function VJ({path:e}){const t=lt(e,"number");return t.status==="error"?d.jsx(it,{path:e,error:t.error}):!("data"in t)||t.data===void 0?d.jsx(wr,{path:e}):t.data===null?d.jsx(Sr,{path:e}):d.jsx("div",{className:"truncate",children:t.data})}var UJ=[" ","Enter","ArrowUp","ArrowDown"],WJ=[" ","Enter"],gp="Select",[Sy,ky,HJ]=my(gp),[od,wge]=So(gp,[HJ,Ti]),Ey=Ti(),[KJ,Wa]=od(gp),[GJ,qJ]=od(gp),rI=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:h,required:p,form:m}=e,v=Ey(t),[x,b]=g.useState(null),[w,S]=g.useState(null),[C,N]=g.useState(!1),P=lp(c),[_=!1,O]=Kr({prop:r,defaultProp:o,onChange:i}),[M,D]=Kr({prop:s,defaultProp:a,onChange:l}),U=g.useRef(null),z=x?m||!!x.closest("form"):!0,[K,H]=g.useState(new Set),V=Array.from(K).map(I=>I.props.value).join(";");return d.jsx(np,{...v,children:d.jsxs(KJ,{required:p,scope:t,trigger:x,onTriggerChange:b,valueNode:w,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:N,contentId:Vr(),value:M,onValueChange:D,open:_,onOpenChange:O,dir:P,triggerPointerDownPosRef:U,disabled:h,children:[d.jsx(Sy.Provider,{scope:t,children:d.jsx(GJ,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(I=>{H(A=>new Set(A).add(I))},[]),onNativeOptionRemove:g.useCallback(I=>{H(A=>{const j=new Set(A);return j.delete(I),j})},[]),children:n})}),z?d.jsxs(NI,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:f,value:M,onChange:I=>D(I.target.value),disabled:h,form:m,children:[M===void 0?d.jsx("option",{value:""}):null,Array.from(K)]},V):null]})})};rI.displayName=gp;var oI="SelectTrigger",iI=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Ey(n),s=Wa(oI,n),a=s.disabled||r,l=Ve(t,s.onTriggerChange),c=ky(n),u=g.useRef("touch"),[f,h,p]=PI(v=>{const x=c().filter(S=>!S.disabled),b=x.find(S=>S.value===s.value),w=_I(x,v,b);w!==void 0&&s.onValueChange(w.value)}),m=v=>{a||(s.onOpenChange(!0),p()),v&&(s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return d.jsx(Hu,{asChild:!0,...i,children:d.jsx(Oe.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":CI(s.value)?"":void 0,...o,ref:l,onClick:te(o.onClick,v=>{v.currentTarget.focus(),u.current!=="mouse"&&m(v)}),onPointerDown:te(o.onPointerDown,v=>{u.current=v.pointerType;const x=v.target;x.hasPointerCapture(v.pointerId)&&x.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(m(v),v.preventDefault())}),onKeyDown:te(o.onKeyDown,v=>{const x=f.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&h(v.key),!(x&&v.key===" ")&&UJ.includes(v.key)&&(m(),v.preventDefault())})})})});iI.displayName=oI;var sI="SelectValue",aI=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Wa(sI,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,f=Ve(t,l.onValueNodeChange);return On(()=>{c(u)},[c,u]),d.jsx(Oe.span,{...a,ref:f,style:{pointerEvents:"none"},children:CI(l.value)?d.jsx(d.Fragment,{children:s}):i})});aI.displayName=sI;var YJ="SelectIcon",lI=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return d.jsx(Oe.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});lI.displayName=YJ;var JJ="SelectPortal",cI=e=>d.jsx(Ku,{asChild:!0,...e});cI.displayName=JJ;var zl="SelectContent",uI=g.forwardRef((e,t)=>{const n=Wa(zl,e.__scopeSelect),[r,o]=g.useState();if(On(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Fr.createPortal(d.jsx(dI,{scope:e.__scopeSelect,children:d.jsx(Sy.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),i):null}return d.jsx(fI,{...e,ref:t})});uI.displayName=zl;var Ro=10,[dI,Ha]=od(zl),XJ="SelectContentImpl",fI=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:v,avoidCollisions:x,...b}=e,w=Wa(zl,n),[S,C]=g.useState(null),[N,P]=g.useState(null),_=Ve(t,X=>C(X)),[O,M]=g.useState(null),[D,U]=g.useState(null),z=ky(n),[K,H]=g.useState(!1),V=g.useRef(!1);g.useEffect(()=>{if(S)return hy(S)},[S]),fy();const I=g.useCallback(X=>{const[Ee,...De]=z().map(_e=>_e.ref.current),[he]=De.slice(-1),Fe=document.activeElement;for(const _e of X)if(_e===Fe||(_e==null||_e.scrollIntoView({block:"nearest"}),_e===Ee&&N&&(N.scrollTop=0),_e===he&&N&&(N.scrollTop=N.scrollHeight),_e==null||_e.focus(),document.activeElement!==Fe))return},[z,N]),A=g.useCallback(()=>I([O,S]),[I,O,S]);g.useEffect(()=>{K&&A()},[K,A]);const{onOpenChange:j,triggerPointerDownPosRef:L}=w;g.useEffect(()=>{if(S){let X={x:0,y:0};const Ee=he=>{var Fe,_e;X={x:Math.abs(Math.round(he.pageX)-(((Fe=L.current)==null?void 0:Fe.x)??0)),y:Math.abs(Math.round(he.pageY)-(((_e=L.current)==null?void 0:_e.y)??0))}},De=he=>{X.x<=10&&X.y<=10?he.preventDefault():S.contains(he.target)||j(!1),document.removeEventListener("pointermove",Ee),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",Ee),document.addEventListener("pointerup",De,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ee),document.removeEventListener("pointerup",De,{capture:!0})}}},[S,j,L]),g.useEffect(()=>{const X=()=>j(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[j]);const[$,W]=PI(X=>{const Ee=z().filter(Fe=>!Fe.disabled),De=Ee.find(Fe=>Fe.ref.current===document.activeElement),he=_I(Ee,X,De);he&&setTimeout(()=>he.ref.current.focus())}),G=g.useCallback((X,Ee,De)=>{const he=!V.current&&!De;(w.value!==void 0&&w.value===Ee||he)&&(M(X),he&&(V.current=!0))},[w.value]),Pe=g.useCallback(()=>S==null?void 0:S.focus(),[S]),ke=g.useCallback((X,Ee,De)=>{const he=!V.current&&!De;(w.value!==void 0&&w.value===Ee||he)&&U(X)},[w.value]),oe=r==="popper"?iw:hI,ae=oe===iw?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:v,avoidCollisions:x}:{};return d.jsx(dI,{scope:n,content:S,viewport:N,onViewportChange:P,itemRefCallback:G,selectedItem:O,onItemLeave:Pe,itemTextRefCallback:ke,focusSelectedItem:A,selectedItemText:D,position:r,isPositioned:K,searchRef:$,children:d.jsx(up,{as:cs,allowPinchZoom:!0,children:d.jsx(cp,{asChild:!0,trapped:w.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:te(o,X=>{var Ee;(Ee=w.trigger)==null||Ee.focus({preventScroll:!0}),X.preventDefault()}),children:d.jsx(Zl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:d.jsx(oe,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:X=>X.preventDefault(),...b,...ae,onPlaced:()=>H(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:te(b.onKeyDown,X=>{const Ee=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!Ee&&X.key.length===1&&W(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let he=z().filter(Fe=>!Fe.disabled).map(Fe=>Fe.ref.current);if(["ArrowUp","End"].includes(X.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const Fe=X.target,_e=he.indexOf(Fe);he=he.slice(_e+1)}setTimeout(()=>I(he)),X.preventDefault()}})})})})})})});fI.displayName=XJ;var ZJ="SelectItemAlignedPosition",hI=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Wa(zl,n),s=Ha(zl,n),[a,l]=g.useState(null),[c,u]=g.useState(null),f=Ve(t,_=>u(_)),h=ky(n),p=g.useRef(!1),m=g.useRef(!0),{viewport:v,selectedItem:x,selectedItemText:b,focusSelectedItem:w}=s,S=g.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&v&&x&&b){const _=i.trigger.getBoundingClientRect(),O=c.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),D=b.getBoundingClientRect();if(i.dir!=="rtl"){const Fe=D.left-O.left,_e=M.left-Fe,tt=_.left-_e,gt=_.width+tt,Kt=Math.max(gt,O.width),T=window.innerWidth-Ro,k=qb(_e,[Ro,Math.max(Ro,T-Kt)]);a.style.minWidth=gt+"px",a.style.left=k+"px"}else{const Fe=O.right-D.right,_e=window.innerWidth-M.right-Fe,tt=window.innerWidth-_.right-_e,gt=_.width+tt,Kt=Math.max(gt,O.width),T=window.innerWidth-Ro,k=qb(_e,[Ro,Math.max(Ro,T-Kt)]);a.style.minWidth=gt+"px",a.style.right=k+"px"}const U=h(),z=window.innerHeight-Ro*2,K=v.scrollHeight,H=window.getComputedStyle(c),V=parseInt(H.borderTopWidth,10),I=parseInt(H.paddingTop,10),A=parseInt(H.borderBottomWidth,10),j=parseInt(H.paddingBottom,10),L=V+I+K+j+A,$=Math.min(x.offsetHeight*5,L),W=window.getComputedStyle(v),G=parseInt(W.paddingTop,10),Pe=parseInt(W.paddingBottom,10),ke=_.top+_.height/2-Ro,oe=z-ke,ae=x.offsetHeight/2,X=x.offsetTop+ae,Ee=V+I+X,De=L-Ee;if(Ee<=ke){const Fe=U.length>0&&x===U[U.length-1].ref.current;a.style.bottom="0px";const _e=c.clientHeight-v.offsetTop-v.offsetHeight,tt=Math.max(oe,ae+(Fe?Pe:0)+_e+A),gt=Ee+tt;a.style.height=gt+"px"}else{const Fe=U.length>0&&x===U[0].ref.current;a.style.top="0px";const tt=Math.max(ke,V+v.offsetTop+(Fe?G:0)+ae)+De;a.style.height=tt+"px",v.scrollTop=Ee-ke+v.offsetTop}a.style.margin=`${Ro}px 0`,a.style.minHeight=$+"px",a.style.maxHeight=z+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[h,i.trigger,i.valueNode,a,c,v,x,b,i.dir,r]);On(()=>S(),[S]);const[C,N]=g.useState();On(()=>{c&&N(window.getComputedStyle(c).zIndex)},[c]);const P=g.useCallback(_=>{_&&m.current===!0&&(S(),w==null||w(),m.current=!1)},[S,w]);return d.jsx(eX,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:P,children:d.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:d.jsx(Oe.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});hI.displayName=ZJ;var QJ="SelectPopperPosition",iw=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Ro,...i}=e,s=Ey(n);return d.jsx(rp,{...s,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});iw.displayName=QJ;var[eX,xk]=od(zl,{}),sw="SelectViewport",pI=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=Ha(sw,n),s=xk(sw,n),a=Ve(t,i.onViewportChange),l=g.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),d.jsx(Sy.Slot,{scope:n,children:d.jsx(Oe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:te(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=s;if(h!=null&&h.current&&f){const p=Math.abs(l.current-u.scrollTop);if(p>0){const m=window.innerHeight-Ro*2,v=parseFloat(f.style.minHeight),x=parseFloat(f.style.height),b=Math.max(v,x);if(b<m){const w=b+p,S=Math.min(m,w),C=w-S;f.style.height=S+"px",f.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,f.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});pI.displayName=sw;var mI="SelectGroup",[tX,nX]=od(mI),rX=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Vr();return d.jsx(tX,{scope:n,id:o,children:d.jsx(Oe.div,{role:"group","aria-labelledby":o,...r,ref:t})})});rX.displayName=mI;var gI="SelectLabel",vI=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=nX(gI,n);return d.jsx(Oe.div,{id:o.id,...r,ref:t})});vI.displayName=gI;var Kg="SelectItem",[oX,yI]=od(Kg),xI=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Wa(Kg,n),l=Ha(Kg,n),c=a.value===r,[u,f]=g.useState(i??""),[h,p]=g.useState(!1),m=Ve(t,w=>{var S;return(S=l.itemRefCallback)==null?void 0:S.call(l,w,r,o)}),v=Vr(),x=g.useRef("touch"),b=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(oX,{scope:n,value:r,disabled:o,textId:v,isSelected:c,onItemTextChange:g.useCallback(w=>{f(S=>S||((w==null?void 0:w.textContent)??"").trim())},[]),children:d.jsx(Sy.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:d.jsx(Oe.div,{role:"option","aria-labelledby":v,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:m,onFocus:te(s.onFocus,()=>p(!0)),onBlur:te(s.onBlur,()=>p(!1)),onClick:te(s.onClick,()=>{x.current!=="mouse"&&b()}),onPointerUp:te(s.onPointerUp,()=>{x.current==="mouse"&&b()}),onPointerDown:te(s.onPointerDown,w=>{x.current=w.pointerType}),onPointerMove:te(s.onPointerMove,w=>{var S;x.current=w.pointerType,o?(S=l.onItemLeave)==null||S.call(l):x.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:te(s.onPointerLeave,w=>{var S;w.currentTarget===document.activeElement&&((S=l.onItemLeave)==null||S.call(l))}),onKeyDown:te(s.onKeyDown,w=>{var C;((C=l.searchRef)==null?void 0:C.current)!==""&&w.key===" "||(WJ.includes(w.key)&&b(),w.key===" "&&w.preventDefault())})})})})});xI.displayName=Kg;var Bd="SelectItemText",bI=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Wa(Bd,n),a=Ha(Bd,n),l=yI(Bd,n),c=qJ(Bd,n),[u,f]=g.useState(null),h=Ve(t,b=>f(b),l.onItemTextChange,b=>{var w;return(w=a.itemTextRefCallback)==null?void 0:w.call(a,b,l.value,l.disabled)}),p=u==null?void 0:u.textContent,m=g.useMemo(()=>d.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:v,onNativeOptionRemove:x}=c;return On(()=>(v(m),()=>x(m)),[v,x,m]),d.jsxs(d.Fragment,{children:[d.jsx(Oe.span,{id:l.textId,...i,ref:h}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Fr.createPortal(i.children,s.valueNode):null]})});bI.displayName=Bd;var wI="SelectItemIndicator",SI=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return yI(wI,n).isSelected?d.jsx(Oe.span,{"aria-hidden":!0,...r,ref:t}):null});SI.displayName=wI;var aw="SelectScrollUpButton",iX=g.forwardRef((e,t)=>{const n=Ha(aw,e.__scopeSelect),r=xk(aw,e.__scopeSelect),[o,i]=g.useState(!1),s=Ve(t,r.onScrollButtonChange);return On(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?d.jsx(kI,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});iX.displayName=aw;var lw="SelectScrollDownButton",sX=g.forwardRef((e,t)=>{const n=Ha(lw,e.__scopeSelect),r=xk(lw,e.__scopeSelect),[o,i]=g.useState(!1),s=Ve(t,r.onScrollButtonChange);return On(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?d.jsx(kI,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});sX.displayName=lw;var kI=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Ha("SelectScrollButton",n),s=g.useRef(null),a=ky(n),l=g.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return g.useEffect(()=>()=>l(),[l]),On(()=>{var u;const c=a().find(f=>f.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),d.jsx(Oe.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:te(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:te(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:te(o.onPointerLeave,()=>{l()})})}),aX="SelectSeparator",EI=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return d.jsx(Oe.div,{"aria-hidden":!0,...r,ref:t})});EI.displayName=aX;var cw="SelectArrow",lX=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ey(n),i=Wa(cw,n),s=Ha(cw,n);return i.open&&s.position==="popper"?d.jsx(op,{...o,...r,ref:t}):null});lX.displayName=cw;function CI(e){return e===""||e===void 0}var NI=g.forwardRef((e,t)=>{const{value:n,...r}=e,o=g.useRef(null),i=Ve(t,o),s=QS(n);return g.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const f=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(f)}},[s,n]),d.jsx(TS,{asChild:!0,children:d.jsx("select",{...r,ref:i,defaultValue:n})})});NI.displayName="BubbleSelect";function PI(e){const t=nn(e),n=g.useRef(""),r=g.useRef(0),o=g.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function _I(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=cX(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function cX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var jI=rI,bk=iI,uX=aI,dX=lI,fX=cI,wk=uI,TI=pI,OI=vI,Sk=xI,MI=bI,hX=SI,RI=EI;const Cy=jI,Ny=uX,vp=g.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(bk,{ref:r,className:fe("flex h-10 m-1 w-[calc(100%-8px)] items-center justify-between rounded-md border border-input bg-bg-primary px-3 py-2 text-sm ring-offset-background placeholder:text-fg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:[t,d.jsx(dX,{asChild:!0,children:d.jsx(Xu,{className:"w-4 h-4 opacity-50"})})]}));vp.displayName=bk.displayName;const yp=g.forwardRef(({className:e,children:t,position:n="popper",container:r,...o},i)=>d.jsx(fX,{container:r,children:d.jsx(wk,{ref:i,className:fe("relative z-50 min-w-[10rem] overflow-hidden rounded-md border bg-bg-primary text-fg-primary shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...o,children:d.jsx(TI,{className:fe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:d.jsx(hr,{orientation:"vertical",children:d.jsx("div",{className:"max-h-[var(--radix-select-content-available-height)]",children:t})})})})}));yp.displayName=wk.displayName;const pX=g.forwardRef(({className:e,...t},n)=>d.jsx(OI,{ref:n,className:fe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));pX.displayName=OI.displayName;const xp=g.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(Sk,{ref:r,className:fe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm text-fg-primary outline-none focus:bg-bg-primary-hover focus:text-fg-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(hX,{children:d.jsx(Ju,{className:"w-4 h-4"})})}),d.jsx(MI,{children:t})]}));xp.displayName=Sk.displayName;const mX=g.forwardRef(({className:e,...t},n)=>d.jsx(RI,{ref:n,className:fe("-mx-1 my-1 h-px bg-bg-secondary",e),...t}));mX.displayName=RI.displayName;function ha(e,t){return e.includes("?p=")?e+"."+JSON.stringify(t):e+"?p="+JSON.stringify(t)}function gX(e){const t=e.replace(/([A-Z])/g," $1").toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function vX({children:e}){return d.jsx("div",{children:gX(e)})}function AI(e){const[t,n]=Y.splitModuleFilePathAndModulePath(e),r=Y.joinModuleFilePathAndModulePath(t,Y.splitModulePath(n).slice(0,-1).join(".")),o=Ft(r);return{path:r,schema:"data"in o?o.data:void 0}}const Mm=(e,t,n)=>t!==e&&(n==null?void 0:n.type)==="record",yX=(e,t,n)=>t!==e&&(n==null?void 0:n.type)==="array",uP=e=>(e==null?void 0:e.type)==="record",xX=e=>(e==null?void 0:e.type)==="array";function II({path:e,variant:t}){const n=Ft(e),{path:r,schema:o}=AI(e),[i]=Y.splitModuleFilePathAndModulePath(e),s=DI(e),a=s[s.length-1],l=q2(r,Mm(e,r,o)?a==null?void 0:a.part:void 0),c=t2(),u=uP("data"in n?n.data:void 0)&&c.status==="success"&&c.data&&"data"in n&&n.data.type==="record"&&n.data.router?dP(i,c.data,n.data.router):null,f=Mm(e,r,o)&&c.status==="success"&&c.data&&o&&o.type==="record"&&o.router?dP(i,c.data,o.router):null,h=(f==null?void 0:f.every(b=>b.type==="literal"))||!1,p=!f||!h,m=!f||!h,v=(u==null?void 0:u.every(b=>b.type==="literal"))||!1,x=!u||!v;return d.jsxs("span",{className:"inline-flex gap-2 items-center",children:[Mm(e,r,o)&&d.jsxs(d.Fragment,{children:[d.jsx(fP,{refs:l,variant:t}),m&&d.jsx(Z2,{defaultValue:a.text,path:e,parentPath:r,variant:_f(t),size:Pf(t),routePattern:f,existingKeys:l,children:d.jsx(EK,{size:Nf(t)})}),p&&d.jsx(Y2,{path:e,parentPath:r,variant:_f(t),size:Pf(t),refs:l,confirmationMessage:`This will delete the ${a.text} record.`,children:d.jsx(jK,{size:Nf(t)})})]}),xX("data"in n?n.data:void 0)&&d.jsx(bX,{path:e,variant:t}),uP("data"in n?n.data:void 0)&&d.jsxs(d.Fragment,{children:[d.jsx(fP,{refs:l,variant:t}),x&&d.jsx(X2,{path:e,variant:_f(t),size:Pf(t),routePattern:u,children:d.jsx(WS,{size:Nf(t)})})]})]})}function dP(e,t,n){if(n==="next-app-router"){const r=Db(e,t);return $M(r)}return null}function fP({refs:e,variant:t}){const n=In();return e.length===0?null:d.jsxs(br,{children:[d.jsxs(zr,{children:[d.jsx(ho,{asChild:!0,children:d.jsx(qe,{asChild:!0,size:Pf(t),variant:_f(t),children:d.jsx(xo,{children:d.jsx(f2,{size:Nf(t)})})})}),d.jsx(fr,{side:"top",children:"References to this record"})]}),d.jsx(tr,{container:n,children:d.jsx("div",{className:"text-sm",children:d.jsx("ul",{children:e.map(r=>{const[o,i]=Y.splitModuleFilePathAndModulePath(r),s=Y.createPatchPath(i);return d.jsx("li",{children:d.jsx(fp,{moduleFilePath:o,patchPath:s})},r)})})})})]})}function Nf(e){return e==="module"?16:12}function Pf(e){return"icon"}function _f(e){return e==="module"?"outline":"ghost"}function bX({path:e,variant:t}){const{navigate:n}=xn(),{addPatch:r,patchPath:o}=bn(e),i=Ft(e),s=lt(e,"array"),[a]=Y.splitModuleFilePathAndModulePath(e);if(!("data"in s)||!s.data||!("data"in i))return null;const l=i.data;if(l.type!=="array")return console.error("Cannot add to non-array",s,{parentPath:e}),null;const c=s.data.length;return d.jsx(qe,{title:"Add",size:Pf(t),variant:_f(t),onClick:()=>{const u=o.concat(c.toString());r([{op:"add",path:u,value:Dl(l.item)}],l.type),l.item.type!=="string"&&n(Y.joinModuleFilePathAndModulePath(a,Y.patchPathToModulePath(u)))},children:d.jsx(WS,{size:Nf(t)})})}function DI(e){const[t,n]=Y.splitModuleFilePathAndModulePath(e),r=Y.splitModuleFilePath(t).map(a=>({text:Cu(a),part:a,sourcePath:t}));if(!n)return r;const o=Y.splitModulePath(n),i=[];let s="";for(let a=0;a<o.length;a++){let l=(s?s+".":"")+JSON.stringify(o[a]);n.startsWith(l)||(l=(s?s+".":"")+o[a]),s=l,i.push({text:o[a],part:o[a],sourcePath:Y.joinModuleFilePathAndModulePath(t,l)})}return r.concat(i)}function kk({validationErrors:e}){return d.jsxs("div",{className:fe("w-full",{"h-6":e.length===0}),children:[e.length>1&&d.jsx(Ll,{type:"single",collapsible:!0,className:"w-full min-h-6",children:d.jsxs(ja,{value:"validation-errors",className:"pb-2 w-full border-b-0 group",children:[d.jsx(Fl,{className:fe("min-h-6","transition-colors duration-200 ease-in-out","group-data-[state=closed]:bg-bg-error-primary rounded-lg","p-2"),children:d.jsxs("div",{className:fe("flex items-center justify-between w-full"),children:[d.jsxs("div",{className:"text-fg-primary group-data-[state=closed]:text-fg-error-primary",children:[e.length," validation error",e.length>1?"s":""]}),d.jsx("div",{className:"text-fg-error-primary",children:d.jsx(ku,{size:16})})]})}),d.jsx(Ta,{children:d.jsx("div",{className:"flex flex-col gap-2",children:e.map((t,n)=>d.jsx("div",{className:fe("p-2 rounded-lg","bg-bg-error-primary text-fg-error-primary"),children:t.message},n))})})]})}),e.length===1&&e[0]&&d.jsx(wX,{validationError:e[0]})]})}function wX({validationError:e}){const[t,n]=g.useState(!1),[r,o]=g.useState(!1),i=g.useRef(null),s=g.useRef(null);return g.useEffect(()=>{const a=()=>{if(i.current){const c=document.createElement("div"),u=window.getComputedStyle(i.current);c.style.cssText=u.cssText,c.style.position="absolute",c.style.visibility="hidden",c.style.left="-9999px",c.style.width=u.width,c.style.webkitLineClamp="unset",c.style.overflow="visible",c.style.display="block",c.textContent=e.message,document.body.appendChild(c);const f=c.getBoundingClientRect().height;document.body.removeChild(c);const h=i.current.getBoundingClientRect().height;o(f>h+1)}},l=setTimeout(a,50);return window.addEventListener("resize",a),()=>{clearTimeout(l),window.removeEventListener("resize",a)}},[e.message]),d.jsxs("div",{ref:s,className:fe("flex items-center justify-between w-full transition-all duration-200 ease-in-out","p-2 mt-2","bg-bg-error-primary text-fg-error-primary rounded-lg"),style:{height:t?"auto":void 0},children:[d.jsx("div",{ref:i,className:fe("transition-all duration-200 ease-in-out",{"line-clamp-1":!t}),style:{flex:r?"1":"auto",marginRight:r?"8px":"0"},children:e.message}),!r&&d.jsx("div",{className:"text-fg-error-primary",children:d.jsx(ku,{size:16})}),r&&d.jsxs("button",{className:"flex flex-shrink-0 items-center",onClick:()=>n(!t),children:[d.jsx("div",{className:"text-fg-error-primary",children:d.jsx(ku,{size:16})}),d.jsx(Xu,{size:16,className:fe("transform transition-transform duration-200 ease-in-out",{"rotate-180":t})})]})]})}function LI({label:e,children:t,path:n,transparent:r,type:o,foldLevel:i="1"}){var S,C;const s=cy(),a=ZR(n),{patchPath:l,addPatch:c}=bn(n),u=Ft(n),f=lt(n,o),[h,p]=g.useState(!0),[m,v]=g.useState(!1);g.useEffect(()=>{var N,P;"data"in f&&f.data===null&&"data"in u&&!u.data.opt&&(((N=u.data)==null?void 0:N.type)==="image"||((P=u.data)==null?void 0:P.type)==="file")&&v(!0)},[f,u]);const x="data"in f?f.data:void 0,b="data"in u&&((S=u.data)==null?void 0:S.type)==="boolean",w="data"in u&&((C=u.data)==null?void 0:C.opt)===!0;return d.jsxs("div",{className:Ne("px-4 pt-6 pb-0 border rounded-lg",{"bg-bg-tertiary":!r,"border-bg-error-secondary":a.length>0}),children:[d.jsxs("div",{className:"flex justify-between items-center pb-2",children:[d.jsxs("div",{className:"flex gap-4 items-center",children:[!b&&w&&d.jsx(ed,{disabled:s==="loading",checked:x!==null||m,onCheckedChange:()=>{(u.data.type==="image"||u.data.type==="file")&&x===null?v(!0):c(x===null?[{op:"replace",path:l,value:Dl({...u.data,opt:!1})}]:[{op:"replace",path:l,value:null}],u.data.type)}}),b&&d.jsx(zJ,{path:n,isNullable:w,loadingStatus:s,source:x}),typeof e=="string"&&d.jsx(vX,{children:e}),e&&typeof e!="string"&&e]}),d.jsxs("div",{className:"flex gap-2 items-center",children:[x!==null&&d.jsx(II,{path:n,variant:"field"}),x!==null&&!b&&d.jsxs("button",{onClick:()=>p(N=>!N),className:Ne("transform transition-transform",{"rotate-180":h}),children:[i==="1"&&d.jsx(Xu,{size:16}),i==="2"&&d.jsx(X7,{size:16})]})]})]}),!b&&d.jsx(Ll,{type:"single",collapsible:!0,value:h&&(x!==null||m)?"open":"closed",children:d.jsx(ja,{value:"open",className:"w-full border-b-0",children:d.jsx(Ta,{children:t})})}),a.length>0&&d.jsx("div",{className:"pb-8",children:d.jsx(kk,{validationErrors:a})})]})}function SX({path:e}){const t="object",n=Ft(e),r=lt(e,t);if(n.status==="error")return d.jsx(Xt,{path:e,error:n.error,type:t});if(r.status==="error")return d.jsx(it,{path:e,error:r.error,schema:n});if(r.status=="not-found"||n.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(n.status==="loading")return d.jsx(yt,{path:e,type:t});if(!("data"in r)||r.data===void 0)return d.jsx(yt,{path:e,type:t});if(n.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:n.data.type});const o=n.data;return d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),d.jsx("div",{className:"flex flex-col gap-6",children:Object.entries(o.items).map(([i,s])=>{const a=ha(e,i);return d.jsx(LI,{label:i,path:a,type:s.type,children:d.jsx(Jy,{path:a,schema:s},a)},a)})})]})}function kX({path:e}){const t="object",n=Ft(e);if(n.status==="error")return d.jsx(Xt,{path:e,error:n.error,type:t});if(n.status==="loading")return d.jsx(yt,{path:e,type:t});if(n.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(n.data.type!=="object")return d.jsx(kr,{path:e,expectedType:"object",actualType:n.data.type});const r=n.data;return d.jsx(FI,{path:e,schema:r})}function FI({path:e,schema:t}){return d.jsx("div",{id:e,className:"grid grid-cols-[min-content,1fr] text-left gap-2 text-xs",children:Object.keys(t.items).map(n=>{const r=ha(e,n);return d.jsx(EX,{label:n,children:d.jsx(bE,{path:r})},n)})})}function EX({label:e,children:t}){return d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"flex whitespace-nowrap text-fg-disabled",children:Sf(e)}),t]})}function uw(e){return typeof e.key!="string"}function CX({path:e}){const t="union",n=Ft(e),r=lt(e,t);if(n.status==="error")return d.jsx(Xt,{path:e,error:n.error,type:t});if(r.status==="error")return d.jsx(it,{path:e,error:r.error,schema:n});if(r.status=="not-found"||n.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(n.status==="loading")return d.jsx(yt,{path:e,type:t});if(!("data"in r)||r.data===void 0)return d.jsx(yt,{path:e,type:t});if(n.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:n.data.type});const o=r.data;if(uw(n.data))return typeof o!="string"&&o!==null?d.jsx(it,{path:e,error:"Expected source to be a string, but found: "+typeof o,schema:n}):d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),d.jsx(PX,{path:e,source:o,options:n.data.items.concat(n.data.key).flatMap(i=>(i==null?void 0:i.type)==="literal"?[i.value]:(console.warn("Unexpected item in string union",i),[]))})]});if(!uw(n.data))return typeof o!="object"?d.jsx(it,{path:e,error:"Expected source to be an object, but found: "+typeof o,schema:n}):Array.isArray(o)?d.jsx(it,{path:e,error:"Expected source to be an object, but found an array",schema:n}):d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),d.jsx(NX,{path:e,schema:n.data})]})}function NX({path:e,schema:t}){const n=BS(e),{addPatch:r,patchPath:o}=bn(e),i=In(),s=ha(e,t.key),a=lt(s,"literal");if(!("data"in a)||a.data===void 0)return d.jsx(yt,{path:e,type:"union"});const l=t.items.find(f=>{var p;const h=(p=f.items)==null?void 0:p[t.key];return h.type==="literal"?h.value===a.data:(console.error("Expected literal schema in object union",h),!1)});if((l==null?void 0:l.items)===void 0)return d.jsx(yt,{path:e,type:"union"});const c=t.items.flatMap(f=>{var p;const h=(p=f.items)==null?void 0:p[t.key];return h.type==="literal"?[h.value]:(console.error("Expected literal schema in object union",h),[])}),u=g.useRef({});return g.useEffect(()=>{n!==void 0&&a.data!==void 0&&typeof a.data=="string"&&n.status==="success"&&(u.current[e]||(u.current[e]={}),u.current[e][a.data]=n.data)},[n,a,e]),d.jsxs("div",{className:"grid gap-4",children:[d.jsxs(Cy,{value:a.data??void 0,onValueChange:f=>{const h=t.items.find(m=>{var x;const v=(x=m.items)==null?void 0:x[t.key];return v.type==="literal"?v.value===f:(console.error("Expected literal schema in object union",v),!1)});if((h==null?void 0:h.items)===void 0){console.error(`Selected schema with ${t.key} = ${f} not found`);return}const p=u.current[e][f]||Dl(h);p[t.key]=f,r([{op:"replace",path:o,value:p}],t.type)},children:[d.jsx(vp,{children:d.jsx(Ny,{children:a.data})}),d.jsx(yp,{container:i,className:"w-32",children:c==null?d.jsx(zI,{}):c.map(f=>d.jsx(xp,{value:f,children:f},f))})]}),Object.keys(l==null?void 0:l.items).filter(f=>f!==(t==null?void 0:t.key)).map(f=>{var p,m,v;const h=ha(e,f);return d.jsx(LI,{path:h,foldLevel:"1",label:f,type:(m=(p=l==null?void 0:l.items)==null?void 0:p[f])==null?void 0:m.type,children:d.jsx(Jy,{path:h,schema:(v=l==null?void 0:l.items)==null?void 0:v[f]},f)},h)})]})}function PX({path:e,source:t,options:n}){const{addPatch:r,patchPath:o}=bn(e),i=In();return d.jsxs(Cy,{value:t??"",onValueChange:s=>{r([{op:"replace",path:o,value:s}],"union")},children:[d.jsx(vp,{children:d.jsx(Ny,{children:t})}),d.jsx(yp,{className:"w-32",container:i,children:n==null?d.jsx(zI,{}):n.map(s=>d.jsx(xp,{value:s,children:s},s))})]})}function zI(){return d.jsx("div",{children:"Loading..."})}function _X({path:e}){const t="union",n=BS(e),r=Ft(e);if(n.status==="error")return d.jsx(it,{path:e,error:n.error,schema:r});if(!("data"in n)||n.data===void 0)return d.jsx(wr,{path:e});if(!("data"in r)||r.data===void 0)return d.jsx(wr,{path:e});if(n.data===null)return d.jsx(Sr,{path:e});if(r.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:r.data.type});const o=r.data;if(uw(o))return typeof n.data!="string"?d.jsx(it,{path:e,error:"Expected source to be a string, but found: "+typeof n.data,schema:r}):d.jsx("div",{className:"truncate",children:n.data});{const i=n.data;if(!i)return d.jsx(Sr,{path:e});if(typeof i!="object"&&!(typeof i=="object"&&o.key in i))return d.jsx(it,{path:e,error:"Expected source to be an object, but found: "+typeof i,schema:r});const s=o.items.find(a=>{var c;const l=(c=a.items)==null?void 0:c[o.key];if((l==null?void 0:l.type)==="literal"&&i!==null&&typeof i=="object"&&o.key in i&&!ea(i))return l.value===i[o.key]});return s?d.jsx(FI,{path:e,schema:s}):d.jsx(it,{path:e,error:"Expected source to have key "+o.key+" but it was not found",schema:r})}}function $I(e){return new Promise((t,n)=>{var i;const r=(i=e.currentTarget.files)==null?void 0:i[0],o=new FileReader;o.addEventListener("load",()=>{const s=o.result;if(typeof s=="string"){const a=new Image;a.addEventListener("load",()=>{const l=qv.Buffer.from(s.split(",")[1],"base64"),c=Y.getSHA256Hash(l);if(a.naturalWidth&&a.naturalHeight){const u=Y.getMimeType(s);t({src:s,width:a.naturalWidth,height:a.naturalHeight,filename:r==null?void 0:r.name,fileHash:c,mimeType:u,fileExt:u&&Y.mimeTypeToFileExt(u)})}else t({src:s,filename:r==null?void 0:r.name,fileHash:c})}),a.src=s}else n(s?{message:"Unexpected image result type",result:s}:{message:"Empty result"})}),r&&o.readAsDataURL(r)})}function jX(e){return new Promise((t,n)=>{var i;const r=(i=e.currentTarget.files)==null?void 0:i[0],o=new FileReader;o.addEventListener("load",()=>{const s=o.result;if(typeof s=="string"){const a=qv.Buffer.from(s.split(",")[1],"base64"),l=Y.getSHA256Hash(a),c=Y.getMimeType(s);t({src:s,filename:r==null?void 0:r.name,fileHash:l,mimeType:c,fileExt:c&&Y.mimeTypeToFileExt(c)})}else n(s?{message:"Unexpected file result type",result:s}:{message:"Empty result"})}),r&&o.readAsDataURL(r)})}function TX(e){return e.split(".").pop()||""}const OX=new TextEncoder;async function BI(e,t,n,r,o,i,s,a="/public/val"){const l=Y.createFilename(t,n,o,r);if(!l||!o)return[];const c=`${a}/${l}`,u=Y.remote.hashToRemoteFileHash(r),f=s?Y.remote.createRemoteRef(s.remoteHost,{publicProjectId:s.publicProjectId,coreVersion:s.coreVersion,bucket:s.bucket,validationHash:Y.remote.getValidationHash(s.coreVersion,s.schema,TX(l),o,u,OX),fileHash:u,filePath:`${a.slice(1)}/${l}`}):c;return[{value:{[bt]:f,[Le]:s?"remote":"file",...i!=="file"?{[Pb]:i}:{},metadata:o},op:"replace",path:e},{value:t,metadata:o,op:"file",path:e,filePath:f,remote:s!==null}]}function MX({path:e}){var U;const t="file",n=qu(),r=DS(),o=IS(),i=Ft(e),s=lt(e,t),[a,l]=g.useState(!1),[c,u]=g.useState(null),[f,h]=g.useState(null),[p,m]=g.useState(!1),{patchPath:v,addAndUploadPatchWithFileOps:x}=bn(e),[b,w]=g.useState(null),S="data"in s&&s.data,C=s.status==="success"&&s.clientSideOnly;if(g.useEffect(()=>{if(S&&S.metadata&&!C){const z=Le in S&&S[Le]==="remote"?Y.convertRemoteSource({...S,[Le]:"remote"}).url:Y.convertFileSource({...S,[Le]:"file"}).url;h(z),m(!1)}},[s]),g.useEffect(()=>{var z,K,H;i.status==="success"&&i.data.type==="file"&&((K=(z=i.data.options)==null?void 0:z.accept)!=null&&K.startsWith("video/"))&&l(!0),S&&typeof((H=S.metadata)==null?void 0:H.mimeType)=="string"&&(S.metadata.mimeType.startsWith("video/")?l(!0):l(!1))},[i,S]),i.status==="error")return d.jsx(Xt,{path:e,error:i.error,type:t});if(s.status==="error")return d.jsx(it,{path:e,error:s.error,schema:i});if(s.status=="not-found"||i.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(i.status==="loading")return d.jsx(yt,{path:e,type:t});if(n===void 0)return d.jsx(yt,{path:e,type:t});if(i.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:i.data.type});const N=s.data;if(N===void 0)return d.jsx(Mn,{path:e,type:t});const _=i.data.type==="file"&&i.data.remote&&o.status!=="ready",O=i.data.remote&&o.status==="ready"&&r?{publicProjectId:o.publicProjectId,coreVersion:o.coreVersion,bucket:r,schema:i.data,remoteHost:n.remoteHost}:null;let M=null;if(N!=null&&N._ref)if(i.data.remote){const z=Y.remote.splitRemoteRef(N==null?void 0:N._ref);z.status==="success"&&(M=z.filePath)}else M=N==null?void 0:N._ref;let D=null;return M&&(D=M.split("/").slice(-1)[0]),d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),c&&d.jsx("div",{className:"p-4 rounded bg-bg-error-primary text-fg-error-primary",children:c}),d.jsxs("div",{className:"grid gap-2",children:[D&&d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx("div",{className:"text-sm text-fg-secondary",children:D}),p&&d.jsx(Gr,{className:`animate-spin text-fg-secondary ${p?"block":"hidden"}`,size:16}),b!==null&&d.jsxs("div",{className:"text-sm text-fg-secondary",children:[b,"%"]})]}),d.jsxs("div",{className:"flex gap-4 items-center",children:[N&&(a?d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("video",{className:"w-full h-auto rounded-lg",controls:!0,src:Le in N&&N[Le]==="remote"?Y.convertRemoteSource({...N,[Le]:"remote"}).url:Y.convertFileSource({...N,[Le]:"file"}).url}),d.jsx(qe,{asChild:!0,variant:"secondary",children:d.jsx("label",{htmlFor:`file_input:${e}`,children:"Upload"})})]}):d.jsxs(d.Fragment,{children:[d.jsx(qe,{asChild:!0,variant:"secondary",children:d.jsx("label",{htmlFor:`file_input:${e}`,children:"Upload"})}),d.jsxs("a",{className:"flex gap-2 items-center",target:"_blank",rel:"noopener noreferrer",download:D,href:Le in N&&N[Le]==="remote"?Y.convertRemoteSource({...N,[Le]:"remote"}).url:Y.convertFileSource({...N,[Le]:"file"}).url,children:[d.jsx("span",{children:" Open file"}),d.jsx(SK,{})]})]})),d.jsx("input",{disabled:_,hidden:!0,id:`file_input:${e}`,type:"file",accept:(U=i.data.options)==null?void 0:U.accept,onChange:z=>{jX(z).then(K=>{var j;const H="file",V=f;h(K.src),m(!0);const I={src:K.src,filename:K.filename};let A;K.mimeType&&(A={mimeType:K.mimeType}),u(null),BI(v,I.src,I.filename??null,K.fileHash,A,H,O,(j=n.files)==null?void 0:j.directory).then(L=>{m(!0),w(0),x(L,H,$=>{h(V),u($)},($,W,G,Pe)=>{const ke=$*(G+1)/(W*Pe);w(Math.round(ke*100))}).finally(()=>{w(null),m(!1)})}).catch(L=>{console.error("Failed to create file patch",L),m(!1),h(V),u("Could not upload file. Please try again later")}),z.target.value=""})}})]})]})]})}function RX({path:e}){const t=lt(e,"image");return t.status==="error"?d.jsx(it,{path:e,error:t.error}):!("data"in t)||t.data===void 0?d.jsx(wr,{path:e}):t.data===null?d.jsx(Sr,{path:e}):d.jsx(l2,{size:12})}function AX({path:e}){var K,H,V,I;const t="image",n=qu(),r=IS(),o=DS(),i=Ft(e),s=lt(e,t),[a,l]=g.useState(void 0),[c,u]=g.useState(null),[f,h]=g.useState(null),[p,m]=g.useState(!1),{addPatch:v,patchPath:x,addAndUploadPatchWithFileOps:b}=bn(e),[w,S]=g.useState(null),C="data"in s&&s.data,N=s.status==="success"&&s.clientSideOnly;if(g.useEffect(()=>{if(C)if(C.metadata){if(!N){const j=Le in C&&C[Le]==="remote"?Y.convertRemoteSource({...C,[Le]:"remote"}).url:Y.convertFileSource({...C,[Le]:"file"}).url;h(j),m(!1)}const A=C.metadata;if(typeof A.width!="number"||typeof A.height!="number"){console.warn(`Expected metadata width and height to be numbers but width was: ${typeof A.width} and height was: ${typeof A.height}`);return}if("hotspot"in A){if(typeof A.hotspot=="object"&&A.hotspot&&"x"in A.hotspot&&"y"in A.hotspot){const{x:j,y:L}=A.hotspot;typeof j=="number"&&typeof L=="number"?l({x:j,y:L}):console.warn(`Expected hotspot to have x and y as numbers but x was: ${typeof j} and y: ${typeof L}`)}}else l(void 0)}else l(void 0)},[s]),i.status==="error")return d.jsx(Xt,{path:e,error:i.error,type:t});if(s.status==="error")return d.jsx(it,{path:e,error:s.error,schema:i});if(s.status=="not-found"||i.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(i.status==="loading")return d.jsx(yt,{path:e,type:t});if(n===void 0)return d.jsx(yt,{path:e,type:t});if(i.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:i.data.type});const P=s.data;if(P===void 0)return d.jsx(Mn,{path:e,type:t});const O=i.data.type==="image"&&i.data.remote&&r.status!=="ready",M=i.data.remote&&r.status==="ready"&&o?{publicProjectId:r.publicProjectId,bucket:o,coreVersion:r.coreVersion,schema:i.data,remoteHost:n.remoteHost}:null,D=Y.createValPathOfItem(e,"metadata"),U=Y.createValPathOfItem(D,"alt"),z=Y.createValPathOfItem(D,"hotspot");return d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),c&&d.jsx("div",{className:"p-4 rounded bg-bg-error-primary text-fg-error-primary",children:c}),i.data.type==="image"&&i.data.remote&&r.status==="inactive"&&d.jsx("div",{className:"p-4 rounded bg-bg-error-primary text-fg-error-primary",children:IX(r.reason)}),d.jsxs("div",{className:"flex flex-col gap-2",children:[P&&d.jsxs("div",{className:"",children:[d.jsx("span",{id:U,children:"Alt text"}),d.jsx(Qu,{value:(K=P.metadata)!=null&&K.alt&&typeof((H=P.metadata)==null?void 0:H.alt)=="string"?(V=P.metadata)==null?void 0:V.alt:"",disabled:O,onChange:A=>{const j=A.target.value;P.metadata&&"alt"in P.metadata?v([{op:"replace",value:j,path:x.concat(["metadata","alt"])}],"string"):P.metadata&&!("alt"in P.metadata)?v([{op:"add",value:j,path:x.concat(["metadata","alt"])}],"string"):P.metadata===void 0?v([{op:"add",value:{...a?{hotspot:a}:{},alt:j},path:x.concat(["metadata"])}],"object"):console.warn(`Expected source.metadata to be an object but got ${typeof P.metadata}`)}})]}),P&&f&&d.jsxs("div",{className:"relative rounded-lg bg-bg-secondary",children:[p&&d.jsxs("div",{className:"flex absolute inset-0 flex-col justify-center items-center",children:[d.jsx("div",{className:"absolute inset-0 w-full h-full opacity-50 bg-bg-secondary"}),d.jsx(Gr,{size:24,className:"animate-spin"}),d.jsx("div",{className:"mt-2 text-xs font-thin text-[white] z-5",children:w!==null?`${w}%`:""})]}),d.jsx("img",{src:f,draggable:!1,className:"object-contain max-h-[500px] w-full",style:{cursor:"crosshair"},id:z,onClick:A=>{const{width:j,height:L,left:$,top:W}=A.currentTarget.getBoundingClientRect(),G={x:Math.max((A.clientX-6-$)/j,0),y:Math.max((A.clientY-6-W)/L,0)};P.metadata&&"hotspot"in P.metadata?v([{op:"replace",path:x.concat(["metadata","hotspot"]),value:G}],"object"):P.metadata?v([{op:"add",path:x.concat(["metadata","hotspot"]),value:G}],"object"):P.metadata===void 0?v([{op:"add",value:{...G?{hotspot:G}:{}},path:x.concat(["metadata"])}],"object"):console.warn(`Expected source.metadata to be an object but got ${typeof P.metadata}`)}}),a&&d.jsx("div",{className:"rounded-full h-[12px] w-[12px] bg-background mix-blend-difference border-bg-brand-primary border-2 absolute pointer-events-none",style:{top:`${a.y*100}%`,left:`${a.x*100}%`}})]}),d.jsx(qe,{asChild:!0,variant:"secondary",children:d.jsx("label",{htmlFor:`img_input:${e}`,children:"Upload"})}),d.jsx("input",{disabled:s.status==="loading",hidden:!0,id:`img_input:${e}`,type:"file",accept:((I=i.data.options)==null?void 0:I.accept)||"image/*",onChange:A=>{$I(A).then(j=>{var Pe,ke;const L="image",$=f;h(j.src),m(!0);const W={src:j.src,filename:j.filename};let G;j.width&&j.height&&j.mimeType&&(G={width:j.width,height:j.height,mimeType:j.mimeType,alt:C&&typeof((Pe=C==null?void 0:C.metadata)==null?void 0:Pe.alt)=="string"?C.metadata.alt:void 0}),u(null),BI(x,W.src,W.filename??null,j.fileHash,G,L,M,(ke=n.files)==null?void 0:ke.directory).then(oe=>{m(!0),S(0),b(oe,L,ae=>{h($),u(ae)},(ae,X,Ee,De)=>{const he=ae*(Ee+1)/(X*De);S(Math.round(he*100))}).finally(()=>{S(null),m(!1)})}).catch(oe=>{console.error("Failed to create file patch",oe),m(!1),h($),u("Could not upload file. Please try again later")}),A.target.value=""})}})]})]})}function IX(e){switch(e){case"api-key-missing":return"Val is running in production mode. To upload remote files and images, the VAL_API_KEY env must be set. Contact a developer to fix this issue.";case"error-could-not-get-settings":return`Could not get settings from the Val remote server. This means that updating or changing certain types of files and images might not work. Check your internet connection and try again. (Error code: ${e})`;case"no-internet-connection":return"Cannot upload remote files and images, since this requires an internet connection";case"pat-error":return"Val is running in development mode. To upload remote files and images, you must either login (by running `npx -p @valbuild/cli val login`) or set the VAL_API_KEY env";case"project-not-configured":return"Project is not configured. To upload remote files and images, the val.config must contain a project id that is obtained from https://admin.val.build. Contact a developer to fix this issue.";case"unauthorized":return"Cannot upload remote files and images since you are unauthorized";case"unauthorized-personal-access-token-error":return"Cannot upload remote files and images since the personal access token is unauthorized. Try to login again by running `npx -p @valbuild/cli val login`";case"unknown-error":return"Unknown error";default:return e}}function DX({path:e}){const t=lt(e,"image");if(t.status==="error")return d.jsx(it,{path:e,error:t.error});if(!("data"in t)||t.data===void 0)return d.jsx(wr,{path:e});if(t.data===null)return d.jsx(Sr,{path:e});const n=t.data;return d.jsx("img",{src:Le in n&&n[Le]==="remote"?Y.convertRemoteSource({...n,[Le]:"remote"}).url:Y.convertFileSource({...n,[Le]:"file"}).url,draggable:!1,className:"object-contain max-w-[60px] max-h-[60px] rounded-lg"})}function LX({path:e}){var h;const t="keyOf",{navigate:n}=xn(),r=Ft(e),o="data"in r&&r.data&&r.data.type==="keyOf"?{type:(h=r.data.schema)==null?void 0:h.type,path:r.data.path}:void 0,i=lt(o==null?void 0:o.path,o==null?void 0:o.type),s=lt(e,t),{patchPath:a,addPatch:l}=bn(e),c=In();if(r.status==="error")return d.jsx(Xt,{path:e,error:r.error,type:t});if(s.status==="error")return d.jsx(it,{path:e,error:s.error,schema:r});if(i.status==="error")return d.jsx(it,{path:e,error:i.error,schema:r});if(s.status=="not-found"||r.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(o!==void 0&&!(o.type==="record"||o.type==="object"))return d.jsx(Xt,{path:o.path,error:`Cannot refer to keyOf type: ${o.type}. Must refer to be record or object`});if(o!==void 0&&i.status==="not-found")return d.jsx(Xt,{path:o.path,error:"Referenced source not found",type:o.type});if(!("data"in s)||s.data===void 0)return d.jsx(yt,{path:e,type:t});if("data"in r&&r.data&&r.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:r.data.type});if(!i)return d.jsx(Xt,{path:o==null?void 0:o.path,error:"Referenced source not found",type:"keyOf"});if("data"in i&&i.data===null)return d.jsx(Xt,{path:o==null?void 0:o.path,error:"Referenced source is null",type:"keyOf"});const u="data"in i&&i.data?Object.keys(i.data):void 0,f=s.data;return d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsxs(Cy,{value:f??"",onValueChange:p=>{l([{op:"replace",path:a,value:p}],t)},children:[d.jsx(vp,{children:d.jsx(Ny,{children:f})}),d.jsx(yp,{className:"w-32",container:c,children:r.status==="loading"||o==null||u===void 0?d.jsx(FX,{}):u.map(p=>d.jsx(xp,{value:p,children:p},p))})]}),f&&(o==null?void 0:o.path)&&d.jsx("button",{title:"Go to reference",className:"px-2",onClick:()=>{n(Y.createValPathOfItem(o.path,f))},children:d.jsx(US,{size:16})})]}),u&&u.length>0&&f!==null&&!u.includes(f)&&d.jsxs("div",{className:"flex gap-2 p-2 py-3 mt-2 rounded-md bg-bg-error-primary text-fg-error-primary",children:[d.jsxs("span",{className:"line-clamp-1",children:["Value must be one of: ",u.join(", ")," ",u.join(", "),u.join(", "),u.join(", "),u.join(", "),u.join(", "),u.join(", ")]}),d.jsx("span",{className:"flex-shrink-0",children:d.jsx(ku,{size:16})})]})]})}function FX(){return d.jsx("span",{children:"Loading..."})}function zX({path:e}){const t=lt(e,"keyOf");return t.status==="error"?d.jsx(it,{path:e,error:t.error}):!("data"in t)||t.data===void 0?d.jsx(wr,{path:e}):t.data===null?d.jsx(Sr,{path:e}):d.jsx("div",{className:"truncate",children:t.data})}function VI({className:e,classNames:t,captionLayout:n,showOutsideDays:r=!0,...o}){const i=o.fromDate&&o.toDate;return d.jsx(FU,{showOutsideDays:r,captionLayout:n,className:fe("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex flex-row justify-center pt-1 relative items-center",caption_dropdowns:"flex flex-row space-x-2",caption_label:`text-sm font-medium ${i?"hidden":""}`,nav:"space-x-1 flex items-center",dropdown_month:"flex flex-row text-accent justify-between text-[0.8rem]",dropdown_year:"flex flex-row text-accent justify-between text-[0.8rem]",dropdown:"bg-transparent border-solid rounded-md border-2 border-secondary",nav_button:fe(Jb({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:fe(Jb({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-fg-primary hover:bg-primary hover:text-fg-primary focus:text-fg-primary",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",...t},components:{IconLeft:()=>d.jsx(J7,{className:"w-4 h-4"}),IconRight:()=>d.jsx(Zu,{className:"w-4 h-4"}),Dropdown:({caption:s,children:a,value:l,onChange:c})=>{const u=f=>{c&&c({target:{value:f}})};return d.jsx("div",{className:"flex flex-row space-x-2",children:d.jsxs(jI,{onValueChange:u,value:String(l),children:[d.jsx(bk,{asChild:!0,children:d.jsxs(qe,{variant:"ghost",size:"sm",children:[s,d.jsx(Xu,{className:"w-4 h-4"})]})}),d.jsx(wk,{className:"z-50 p-1 rounded-md bg-bg-secondary text-fg-secondary",children:d.jsx(TI,{className:"overflow-y-auto pr-4 pb-4 max-h-48 rounded-md shadow-lg bg-bg-tertiary text-fg-tertiary",children:g.Children.map(a,f=>{if(g.isValidElement(f)){const{value:h,children:p}=f.props;return d.jsx(Sk,{value:String(h),className:"p-2 rounded-md cursor-pointer hover:bg-bg-secondary-hover hover:text-fg-secondary",children:d.jsx(MI,{children:p})},h)}return null})})})]})})}},...o})}VI.displayName="Calendar";function $X({path:e}){var h,p;const t="date",n=Ft(e),r=lt(e,t),{patchPath:o,addPatch:i}=bn(e),[s,a]=g.useState(null),[l,c]=g.useState(!1),u=In();if(g.useEffect(()=>{if("data"in r&&r.data!==void 0)if(r.data===null)a(r.data);else try{const m=new Date(r.data);a(m)}catch{console.error("Cannot parse invalid date:",r.data)}},["data"in r&&r.data]),n.status==="error")return d.jsx(Xt,{path:e,error:n.error,type:t});if(r.status==="error")return d.jsx(it,{path:e,error:r.error,schema:n});if(r.status=="not-found"||n.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(n.status==="loading")return d.jsx(yt,{path:e,type:t});if(!("data"in r)||r.data===void 0)return d.jsx(yt,{path:e,type:t});if(n.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:n.data.type});const f=n.data;return d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),d.jsxs(br,{open:l,onOpenChange:m=>{c(m)},children:[d.jsx(xo,{asChild:!0,onClick:()=>{c(!0)},children:d.jsxs(qe,{variant:"outline",className:Ne("w-[280px] justify-start text-left font-normal bg-bg-primary hover:bg-bg-secondary"),children:[d.jsx(s2,{className:"w-4 h-4 mr-2"}),s?ms(s,"PPP"):d.jsx("span",{children:"Pick a date"})]})}),d.jsx(tr,{className:"w-auto p-0",container:u,children:d.jsx(VI,{mode:"single",captionLayout:"dropdown-buttons",defaultMonth:s??void 0,weekStartsOn:1,fromDate:(h=f.options)!=null&&h.from?new Date(f.options.from):void 0,toDate:(p=f.options)!=null&&p.to?new Date(f.options.to):void 0,selected:s||void 0,onSelect:m=>{m&&(a(m),i([{op:"replace",value:m.toISOString().slice(0,10),path:o}],f.type),c(!1))}})})]})]})}function BX({path:e}){const t=lt(e,"date");return t.status==="error"?d.jsx(it,{path:e,error:t.error}):!("data"in t)||t.data===void 0?d.jsx(wr,{path:e}):t.data===null?d.jsx(Sr,{path:e}):d.jsx("div",{className:"truncate",children:new Date(t.data).toLocaleString()})}function VX({path:e}){const t=lt(e,"literal");return t.status==="error"?d.jsx(it,{path:e,error:t.error}):!("data"in t)||t.data===void 0?d.jsx(wr,{path:e}):t.data===null?d.jsx(Sr,{path:e}):d.jsx("div",{id:e,className:"truncate",children:t.data})}function UI(e,t){for(const n in t)if(n.startsWith(e))return!0;return!1}function WI(){return d.jsx("div",{className:"w-2 h-2 rounded-full bg-bg-error-secondary"})}function HI({error:e}){return d.jsx("div",{className:"p-4 text-fg-error-primary bg-bg-error-primary",children:d.jsxs("div",{children:["Preview error: ",e]})})}function UX({path:e}){const t="record",n=ec()||{},{navigate:r}=xn(),o=Ft(e),i=XR(e),s=lt(e,t);if(o.status==="error")return d.jsx(Xt,{path:e,error:o.error,type:t});if(s.status==="error")return d.jsx(it,{path:e,error:s.error,schema:o});if(s.status=="not-found"||o.status==="not-found")return d.jsx(Mn,{path:e,type:t});if(o.status==="loading")return d.jsx(yt,{path:e,type:t});if(!("data"in s)||s.data===void 0)return d.jsx(yt,{path:e,type:t});if(o.data.type!==t)return d.jsx(kr,{path:e,expectedType:t,actualType:o.data.type});const a=s.data,l=i&&"data"in i&&i.data&&i.data.layout==="list"&&i.data.parent==="record"?i.data:void 0;return d.jsxs("div",{id:e,children:[d.jsx(qr,{path:e}),(i==null?void 0:i.status)==="error"&&d.jsx(HI,{error:i.message,path:e}),l&&d.jsx(HX,{path:e,...l}),!l&&d.jsx("div",{className:"grid grid-cols-1 gap-4",children:a&&Object.entries(a).map(([c])=>d.jsxs("div",{onClick:()=>r(ha(e,c)),className:Ne("bg-primary-foreground cursor-pointer min-w-[320px] max-h-[170px] overflow-hidden rounded-md border border-border-primary p-4","hover:bg-bg-secondary-hover"),children:[d.jsxs("div",{className:"flex justify-between items-start",children:[d.jsx("div",{className:"pb-4 font-semibold text-md",children:c}),UI(ha(e,c),n)&&d.jsx(WI,{})]}),d.jsx("div",{children:d.jsx(bE,{path:ha(e,c)})})]},c))})]})}function WX({title:e,image:t,subtitle:n}){return d.jsxs("div",{className:Ne("flex w-full items-start justify-between pl-4 flex-grow text-left"),children:[d.jsxs("div",{className:"flex flex-col flex-shrink py-4 overflow-x-clip",children:[d.jsx("div",{className:"text-lg font-medium",children:e}),n&&d.jsx("div",{className:"block overflow-hidden flex-shrink max-h-5 text-sm text-gray-500 text-ellipsis",children:n})]}),t&&d.jsx(KX,{src:t,alt:e})]})}function HX({path:e,items:t}){const{navigate:n}=xn();return d.jsx("div",{className:"flex flex-col space-y-4 w-full",children:t.map(([r,{title:o,subtitle:i,image:s}])=>d.jsx("button",{onClick:()=>n(ha(e,r)),className:Ne("hover:bg-bg-secondary-hover","border rounded-lg cursor-pointer border-border-primary"),children:d.jsx(WX,{title:o,subtitle:i,image:s})},r))})}function KX({src:e,alt:t}){var i;const[n,r]=g.useState(!1);if(e==null)return d.jsx("div",{className:"flex-shrink-0 ml-4 w-20 h-20 opacity-25 bg-bg-brand-secondary"});const o=e[Le]==="file"?Y.convertFileSource(e).url:Y.convertRemoteSource(e).url;return d.jsxs("div",{className:"relative flex-shrink-0 ml-4 w-20 h-20",children:[!n&&d.jsx("div",{className:"absolute inset-0 opacity-25 bg-bg-brand-secondary animate-in"}),d.jsx("img",{src:o,alt:t,onLoad:()=>r(!0),onError:()=>r(!1),className:`absolute inset-0 object-cover w-full h-full rounded-r-lg ${n?"opacity-100":"opacity-0"}`,style:{objectPosition:(i=e.metadata)!=null&&i.hotspot?`${e.metadata.hotspot.x}% ${e.metadata.hotspot.y}%`:"",transition:"opacity 0.2s ease-in-out"}})]})}function GX({path:e}){const t=lt(e,"record");if(t.status==="error")return d.jsx(it,{path:e,error:t.error});if(!("data"in t)||t.data===void 0)return d.jsx(wr,{path:e});if(t.data===null)return d.jsx(Sr,{path:e});const n=Object.keys(t.data);return d.jsxs("div",{className:"text-left",children:[d.jsx("span",{className:"text-fg-brand-primary",children:n.length}),d.jsx("span",{className:"mr-1",children:` item${n.length===1?"":"s"}:`}),n.map((r,o)=>d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-fg-brand-primary",children:r},r),o<n.length-1?", ":""]}))]})}let Py=()=>({events:{},emit(e,...t){(this.events[e]||[]).forEach(n=>n(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(n=>n!==t)}});var dw={exports:{}};(function(e,t){var n=typeof Reflect<"u"?Reflect.construct:void 0,r=Object.defineProperty,o=Error.captureStackTrace;o===void 0&&(o=function(c){var u=new Error;r(c,"stack",{configurable:!0,get:function(){var h=u.stack;return r(this,"stack",{configurable:!0,value:h,writable:!0}),h},set:function(h){r(c,"stack",{configurable:!0,value:h,writable:!0})}})});function i(l){l!==void 0&&r(this,"message",{configurable:!0,value:l,writable:!0});var c=this.constructor.name;c!==void 0&&c!==this.name&&r(this,"name",{configurable:!0,value:c,writable:!0}),o(this,this.constructor)}i.prototype=Object.create(Error.prototype,{constructor:{configurable:!0,value:i,writable:!0}});var s=function(){function l(u,f){return r(u,"name",{configurable:!0,value:f})}try{var c=function(){};if(l(c,"foo"),c.name==="foo")return l}catch{}}();function a(l,c){if(c==null||c===Error)c=i;else if(typeof c!="function")throw new TypeError("super_ should be a function");var u;if(typeof l=="string")u=l,l=n!==void 0?function(){return n(c,arguments,this.constructor)}:function(){c.apply(this,arguments)},s!==void 0&&(s(l,u),u=void 0);else if(typeof l!="function")throw new TypeError("constructor should be either a string or a function");l.super_=l.super=c;var f={constructor:{configurable:!0,value:l,writable:!0}};return u!==void 0&&(f.name={configurable:!0,value:u,writable:!0}),l.prototype=Object.create(c.prototype,f),l}t=e.exports=a,t.BaseError=i})(dw,dw.exports);var KI=dw.exports,hP="ProseMirror-selectednode",GI="",ta="\0",pP="__state_override__",qX={LastNodeCompatible:"lastNodeCompatible",FormattingMark:"formattingMark",FormattingNode:"formattingNode",NodeCursor:"nodeCursor",FontStyle:"fontStyle",Link:"link",Color:"color",Alignment:"alignment",Indentation:"indentation",Behavior:"behavior",Code:"code",InlineNode:"inline",ListContainerNode:"listContainer",ListItemNode:"listItemNode",Block:"block",BlockNode:"block",TextBlock:"textBlock",ExcludeInputRules:"excludeFromInputRules",PreventExits:"preventsExits",Media:"media"},He=qX,fs=Symbol.for("__remirror__"),gn=(e=>(e.PlainExtension="RemirrorPlainExtension",e.NodeExtension="RemirrorNodeExtension",e.MarkExtension="RemirrorMarkExtension",e.PlainExtensionConstructor="RemirrorPlainExtensionConstructor",e.NodeExtensionConstructor="RemirrorNodeExtensionConstructor",e.MarkExtensionConstructor="RemirrorMarkExtensionConstructor",e.Manager="RemirrorManager",e.Preset="RemirrorPreset",e.PresetConstructor="RemirrorPresetConstructor",e))(gn||{}),mt=(e=>(e[e.Critical=1e6]="Critical",e[e.Highest=1e5]="Highest",e[e.High=1e4]="High",e[e.Medium=1e3]="Medium",e[e.Default=100]="Default",e[e.Low=10]="Low",e[e.Lowest=0]="Lowest",e))(mt||{}),lr=(e=>(e[e.None=0]="None",e[e.Create=1]="Create",e[e.EditorView=2]="EditorView",e[e.Runtime=3]="Runtime",e[e.Destroy=4]="Destroy",e))(lr||{}),re=(e=>(e.Undo="_|undo|_",e.Redo="_|redo|_",e.Bold="_|bold|_",e.Italic="_|italic|_",e.Underline="_|underline|_",e.Strike="_|strike|_",e.Code="_|code|_",e.Paragraph="_|paragraph|_",e.H1="_|h1|_",e.H2="_|h2|_",e.H3="_|h3|_",e.H4="_|h4|_",e.H5="_|h5|_",e.H6="_|h6|_",e.TaskList="_|task|_",e.BulletList="_|bullet|_",e.OrderedList="_|number|_",e.Quote="_|quote|_",e.Divider="_|divider|_",e.Codeblock="_|codeblock|_",e.ClearFormatting="_|clear|_",e.Superscript="_|sup|_",e.Subscript="_|sub|_",e.LeftAlignment="_|left-align|_",e.CenterAlignment="_|center-align|_",e.RightAlignment="_|right-align|_",e.JustifyAlignment="_|justify-align|_",e.InsertLink="_|link|_",e.Find="_|find|_",e.FindBackwards="_|find-backwards|_",e.FindReplace="_|find-replace|_",e.AddFootnote="_|footnote|_",e.AddComment="_|comment|_",e.ContextMenu="_|context-menu|_",e.IncreaseFontSize="_|inc-font-size|_",e.DecreaseFontSize="_|dec-font-size|_",e.IncreaseIndent="_|indent|_",e.DecreaseIndent="_|dedent|_",e.Shortcuts="_|shortcuts|_",e.Copy="_|copy|_",e.Cut="_|cut|_",e.Paste="_|paste|_",e.PastePlain="_|paste-plain|_",e.SelectAll="_|select-all|_",e.Format="_|format|_",e))(re||{}),ne=(e=>(e.PROD="RMR0000",e.UNKNOWN="RMR0001",e.INVALID_COMMAND_ARGUMENTS="RMR0002",e.CUSTOM="RMR0003",e.CORE_HELPERS="RMR0004",e.MUTATION="RMR0005",e.INTERNAL="RMR0006",e.MISSING_REQUIRED_EXTENSION="RMR0007",e.MANAGER_PHASE_ERROR="RMR0008",e.INVALID_GET_EXTENSION="RMR0010",e.INVALID_MANAGER_ARGUMENTS="RMR0011",e.SCHEMA="RMR0012",e.HELPERS_CALLED_IN_OUTER_SCOPE="RMR0013",e.INVALID_MANAGER_EXTENSION="RMR0014",e.DUPLICATE_COMMAND_NAMES="RMR0016",e.DUPLICATE_HELPER_NAMES="RMR0017",e.NON_CHAINABLE_COMMAND="RMR0018",e.INVALID_EXTENSION="RMR0019",e.INVALID_CONTENT="RMR0021",e.INVALID_NAME="RMR0050",e.EXTENSION="RMR0100",e.EXTENSION_SPEC="RMR0101",e.EXTENSION_EXTRA_ATTRIBUTES="RMR0102",e.INVALID_SET_EXTENSION_OPTIONS="RMR0103",e.REACT_PROVIDER_CONTEXT="RMR0200",e.REACT_GET_ROOT_PROPS="RMR0201",e.REACT_EDITOR_VIEW="RMR0202",e.REACT_CONTROLLED="RMR0203",e.REACT_NODE_VIEW="RMR0204",e.REACT_GET_CONTEXT="RMR0205",e.REACT_COMPONENTS="RMR0206",e.REACT_HOOKS="RMR0207",e.I18N_CONTEXT="RMR0300",e))(ne||{}),YX=function(t){return JX(t)&&!XX(t)};function JX(e){return!!e&&typeof e=="object"}function XX(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||eZ(e)}var ZX=typeof Symbol=="function"&&Symbol.for,QX=ZX?Symbol.for("react.element"):60103;function eZ(e){return e.$$typeof===QX}function tZ(e){return Array.isArray(e)?[]:{}}function wh(e,t){return t.clone!==!1&&t.isMergeableObject(e)?_u(tZ(e),e,t):e}function nZ(e,t,n){return e.concat(t).map(function(r){return wh(r,n)})}function rZ(e,t){if(!t.customMerge)return _u;var n=t.customMerge(e);return typeof n=="function"?n:_u}function oZ(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function mP(e){return Object.keys(e).concat(oZ(e))}function qI(e,t){try{return t in e}catch{return!1}}function iZ(e,t){return qI(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function sZ(e,t,n){var r={};return n.isMergeableObject(e)&&mP(e).forEach(function(o){r[o]=wh(e[o],n)}),mP(t).forEach(function(o){iZ(e,o)||(qI(e,o)&&n.isMergeableObject(t[o])?r[o]=rZ(o,n)(e[o],t[o],n):r[o]=wh(t[o],n))}),r}function _u(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||nZ,n.isMergeableObject=n.isMergeableObject||YX,n.cloneUnlessOtherwiseSpecified=wh;var r=Array.isArray(t),o=Array.isArray(e),i=r===o;return i?r?n.arrayMerge(e,t,n):sZ(e,t,n):wh(t,n)}_u.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return _u(r,o,n)},{})};var aZ=_u,lZ=aZ;const cZ=La(lZ);/*!
465
465
  * isobject <https://github.com/jonschlinkert/isobject>
466
466
  *
467
467
  * Copyright (c) 2014-2017, Jon Schlinkert.