denwa-react-shared 1.0.83 → 1.0.84

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-D8o-Dvl8.cjs");exports.AdminTable=e.AdminTable;exports.BaseDatePicker=e.BaseDatePicker;exports.BaseDrawerForm=e.BaseDrawerForm;exports.BaseFileUpload=e.BaseFileUpload;exports.BaseImage=e.BaseImage;exports.BaseImageUpload=e.BaseImageUpload;exports.BaseInput=e.BaseInput;exports.BaseInputNumber=e.BaseInputNumber;exports.BaseMaterialMap=e.BaseMaterialMap;exports.BasePasswordInput=e.BasePasswordInput;exports.BaseReadonlyInput=e.BaseReadonlyInput;exports.BaseSearchInput=e.BaseSearchInput;exports.BaseSpin=e.BaseSpin;exports.BaseTextAreaInput=e.BaseTextAreaInput;exports.BaseTextEditor=e.BaseTextEditor;exports.COOKIE=e.COOKIE;exports.Container=e.Container;exports.LOCAL_STORAGE=e.LOCAL_STORAGE;exports.Languages=e.Languages;exports.LayoutCard=e.LayoutCard;exports.MonthsNumber=e.MonthsNumber;exports.ProviderComposer=e.ProviderComposer;exports.THEME=e.THEME;exports.TIME=e.TIME;exports.VALIDATION_VALUE=e.VALIDATION_VALUE;exports.checkCorrectFileObject=e.checkCorrectFileObject;exports.checkCorrectImageObject=e.checkCorrectImageObject;exports.compareRolesPriority=e.compareRolesPriority;exports.convertPhoneMask=e.convertPhoneMask;exports.createProfileLabel=e.createProfileLabel;exports.createUploadImagesStore=e.createUploadImagesStore;exports.deleteCookie=e.deleteCookie;exports.escapeHtml=e.escapeHtml;exports.fileToBase64=e.fileToBase64;exports.formatPhoneToInternational=e.formatPhoneToInternational;exports.formatPhoneToNumber=e.formatPhoneToNumber;exports.getCookie=e.getCookie;exports.getImagePrefix=e.getImagePrefix;exports.getTokenInCookie=e.getTokenInCookie;exports.getUploadFileUrl=e.getUploadFileUrl;exports.getUploadImageUrl=e.getUploadImageUrl;exports.insertLink=e.insertLink;exports.isBlockActive=e.isBlockActive;exports.isLinkActive=e.isLinkActive;exports.isMarkActive=e.isMarkActive;exports.isUrl=e.isUrl;exports.mergeObjectArrays=e.mergeObjectArrays;exports.normalizeSlateData=e.normalizeSlateData;exports.objectArrayToOptions=e.objectArrayToOptions;exports.onFilterSelectOptionsByLabel=e.onFilterSelectOptionsByLabel;exports.prepareFilesToSubmit=e.prepareFilesToSubmit;exports.prepareImagesToSubmit=e.prepareImagesToSubmit;exports.prepareServerFiles=e.prepareServerFiles;exports.prepareServerImages=e.prepareServerImages;exports.provider=e.provider;exports.responseSchema=e.responseSchema;exports.searchRadioDefaultValue=e.searchRadioDefaultValue;exports.serializeToHtml=e.serializeToHtml;exports.serverFileSchema=e.serverFileSchema;exports.serverImageSchema=e.serverImageSchema;exports.sessionCookieSchema=e.sessionCookieSchema;exports.setCookie=e.setCookie;exports.sortFilesArrayByReference=e.sortFilesArrayByReference;exports.toggleBlock=e.toggleBlock;exports.toggleMark=e.toggleMark;exports.translateContent=e.translateContent;exports.translateField=e.translateField;exports.translateImagesAlt=e.translateImagesAlt;exports.unwrapLink=e.unwrapLink;exports.uploadFilesSchema=e.uploadFilesSchema;exports.uploadImageSchema=e.uploadImageSchema;exports.uploadTempSchema=e.uploadTempSchema;exports.useExtraMediumViewPort=e.useExtraMediumViewPort;exports.useFetchTableData=e.useFetchTableData;exports.useLaptopBigViewPort=e.useLaptopBigViewPort;exports.useLaptopViewPort=e.useLaptopViewPort;exports.useMobileViewPort=e.useMobileViewPort;exports.useSession=e.useSession;exports.useSmallViewPort=e.useSmallViewPort;exports.useTabletViewPort=e.useTabletViewPort;exports.withInlines=e.withInlines;exports.wrapLink=e.wrapLink;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BNZucDbs.cjs");exports.AdminTable=e.AdminTable;exports.BaseDatePicker=e.BaseDatePicker;exports.BaseDrawerForm=e.BaseDrawerForm;exports.BaseFileUpload=e.BaseFileUpload;exports.BaseImage=e.BaseImage;exports.BaseImageUpload=e.BaseImageUpload;exports.BaseInput=e.BaseInput;exports.BaseInputNumber=e.BaseInputNumber;exports.BaseMaterialMap=e.BaseMaterialMap;exports.BasePasswordInput=e.BasePasswordInput;exports.BaseReadonlyInput=e.BaseReadonlyInput;exports.BaseSearchInput=e.BaseSearchInput;exports.BaseSpin=e.BaseSpin;exports.BaseTextAreaInput=e.BaseTextAreaInput;exports.BaseTextEditor=e.BaseTextEditor;exports.COOKIE=e.COOKIE;exports.Container=e.Container;exports.LOCAL_STORAGE=e.LOCAL_STORAGE;exports.Languages=e.Languages;exports.LayoutCard=e.LayoutCard;exports.MonthsNumber=e.MonthsNumber;exports.ProviderComposer=e.ProviderComposer;exports.THEME=e.THEME;exports.TIME=e.TIME;exports.VALIDATION_VALUE=e.VALIDATION_VALUE;exports.checkCorrectFileObject=e.checkCorrectFileObject;exports.checkCorrectImageObject=e.checkCorrectImageObject;exports.compareRolesPriority=e.compareRolesPriority;exports.convertPhoneMask=e.convertPhoneMask;exports.createProfileLabel=e.createProfileLabel;exports.createUploadImagesStore=e.createUploadImagesStore;exports.deleteCookie=e.deleteCookie;exports.escapeHtml=e.escapeHtml;exports.fileToBase64=e.fileToBase64;exports.formatPhoneToInternational=e.formatPhoneToInternational;exports.formatPhoneToNumber=e.formatPhoneToNumber;exports.getCookie=e.getCookie;exports.getImagePrefix=e.getImagePrefix;exports.getTokenInCookie=e.getTokenInCookie;exports.getUploadFileUrl=e.getUploadFileUrl;exports.getUploadImageUrl=e.getUploadImageUrl;exports.insertLink=e.insertLink;exports.isBlockActive=e.isBlockActive;exports.isLinkActive=e.isLinkActive;exports.isMarkActive=e.isMarkActive;exports.isUrl=e.isUrl;exports.mergeObjectArrays=e.mergeObjectArrays;exports.normalizeSlateData=e.normalizeSlateData;exports.objectArrayToOptions=e.objectArrayToOptions;exports.onFilterSelectOptionsByLabel=e.onFilterSelectOptionsByLabel;exports.prepareFilesToSubmit=e.prepareFilesToSubmit;exports.prepareImagesToSubmit=e.prepareImagesToSubmit;exports.prepareServerFiles=e.prepareServerFiles;exports.prepareServerImages=e.prepareServerImages;exports.provider=e.provider;exports.responseSchema=e.responseSchema;exports.searchRadioDefaultValue=e.searchRadioDefaultValue;exports.serializeToHtml=e.serializeToHtml;exports.serverFileSchema=e.serverFileSchema;exports.serverImageSchema=e.serverImageSchema;exports.sessionCookieSchema=e.sessionCookieSchema;exports.setCookie=e.setCookie;exports.sortFilesArrayByReference=e.sortFilesArrayByReference;exports.toggleBlock=e.toggleBlock;exports.toggleMark=e.toggleMark;exports.translateContent=e.translateContent;exports.translateField=e.translateField;exports.translateImagesAlt=e.translateImagesAlt;exports.unwrapLink=e.unwrapLink;exports.uploadFilesSchema=e.uploadFilesSchema;exports.uploadImageSchema=e.uploadImageSchema;exports.uploadTempSchema=e.uploadTempSchema;exports.useExtraMediumViewPort=e.useExtraMediumViewPort;exports.useFetchTableData=e.useFetchTableData;exports.useLaptopBigViewPort=e.useLaptopBigViewPort;exports.useLaptopViewPort=e.useLaptopViewPort;exports.useMobileViewPort=e.useMobileViewPort;exports.useSession=e.useSession;exports.useSmallViewPort=e.useSmallViewPort;exports.useTabletViewPort=e.useTabletViewPort;exports.withInlines=e.withInlines;exports.wrapLink=e.wrapLink;
@@ -1,4 +1,4 @@
1
- import { cm as s, bZ as r, b_ as o, cn as t, b$ as b, c0 as i, c1 as c, B as l, c5 as n, c2 as p, c6 as m, c7 as u, c8 as g, c3 as I, c9 as B, bd as d, bY as k, be as S, bn as T, c4 as h, bo as A, bq as P, E as L, T as C, bf as w, bO as F, bN as v, bJ as M, bw as O, bF as f, bz as E, bV as U, cj as V, by as y, bE as D, bx as j, bT as x, bS as R, bW as N, bM as H, bL as z, cg as _, ca as G, ce as K, cb as q, bD as J, bX as Q, cl as W, bA as X, bK as Y, bC as Z, bB as $, bQ as aa, bR as ea, bp as sa, bg as ra, A as oa, ck as ta, bk as ba, bj as ia, bh as ca, bU as la, bP as na, cd as pa, cc as ma, bI as ua, bG as ga, bH as Ia, cf as Ba, bm as da, bl as ka, bi as Sa, bu as Ta, bv as ha, br as Aa, bs as Pa, v as La, bc as Ca, w as wa, bt as Fa, ci as va, ch as Ma } from "./index-CtZfv44S.js";
1
+ import { cm as s, bZ as r, b_ as o, cn as t, b$ as b, c0 as i, c1 as c, B as l, c5 as n, c2 as p, c6 as m, c7 as u, c8 as g, c3 as I, c9 as B, bd as d, bY as k, be as S, bn as T, c4 as h, bo as A, bq as P, E as L, T as C, bf as w, bO as F, bN as v, bJ as M, bw as O, bF as f, bz as E, bV as U, cj as V, by as y, bE as D, bx as j, bT as x, bS as R, bW as N, bM as H, bL as z, cg as _, ca as G, ce as K, cb as q, bD as J, bX as Q, cl as W, bA as X, bK as Y, bC as Z, bB as $, bQ as aa, bR as ea, bp as sa, bg as ra, A as oa, ck as ta, bk as ba, bj as ia, bh as ca, bU as la, bP as na, cd as pa, cc as ma, bI as ua, bG as ga, bH as Ia, cf as Ba, bm as da, bl as ka, bi as Sa, bu as Ta, bv as ha, br as Aa, bs as Pa, v as La, bc as Ca, w as wa, bt as Fa, ci as va, ch as Ma } from "./index-BnFfk_nx.js";
2
2
  export {
3
3
  s as AdminTable,
4
4
  r as BaseDatePicker,
@@ -29,7 +29,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
29
29
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DB(e,t){if(e){if(typeof e=="string")return n2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return n2(e,t)}}function n2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function r2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function a2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?r2(Object(n),!0).forEach(function(r){IB(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IB(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o2={formatExtension:function(t,n,r){return"".concat(t).concat(r.ext()).concat(n)}};function NB(e,t,n,r){if(n?n=a2(a2({},o2),n):n=o2,r=new zr(r),e.country&&e.country!=="001"){if(!r.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));r.country(e.country)}else if(e.countryCallingCode)r.selectNumberingPlan(e.countryCallingCode);else return e.phone||"";var a=r.countryCallingCode(),o=n.v2?e.nationalNumber:e.phone,i;switch(t){case"NATIONAL":return o?(i=dd(o,e.carrierCode,"NATIONAL",r,n),eh(i,e.ext,r,n.formatExtension)):"";case"INTERNATIONAL":return o?(i=dd(o,null,"INTERNATIONAL",r,n),i="+".concat(a," ").concat(i),eh(i,e.ext,r,n.formatExtension)):"+".concat(a);case"E.164":return"+".concat(a).concat(o);case"RFC3966":return wB({number:"+".concat(a).concat(o),ext:e.ext});case"IDD":if(!n.fromCountry)return;var s=_B(o,e.carrierCode,a,n.fromCountry,r);return eh(s,e.ext,r,n.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}function dd(e,t,n,r,a){var o=PB(r.formats(),e);return o?mB(e,o,{useInternationalFormat:n==="INTERNATIONAL",withNationalPrefix:!(o.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&a&&a.nationalPrefix===!1)}):e}function PB(e,t){for(var n=OB(e),r;!(r=n()).done;){var a=r.value;if(a.leadingDigitsPatterns().length>0){var o=a.leadingDigitsPatterns()[a.leadingDigitsPatterns().length-1];if(t.search(o)!==0)continue}if(Oo(t,a.pattern()))return a}}function eh(e,t,n,r){return t?r(e,t,n):e}function _B(e,t,n,r,a){var o=qp(r,a.metadata);if(o===n){var i=dd(e,t,"NATIONAL",a);return n==="1"?n+" "+i:i}var s=pB(r,void 0,a.metadata);if(s)return"".concat(s," ").concat(n," ").concat(dd(e,null,"INTERNATIONAL",a))}function i2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function s2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i2(Object(n),!0).forEach(function(r){AB(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AB(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MB(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,r.key,r)}}function TB(e,t,n){return t&&MB(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var BB=function(){function e(t,n,r){if(RB(this,e),!t)throw new TypeError("First argument is required");if(typeof t!="string")throw new TypeError("First argument must be a string");if(typeof t=="string"){if(t[0]==="+"&&!n)throw new TypeError("`metadata` argument not passed");if(ms(n)&&ms(n.countries)){r=n;var a=t;if(!jB.test(a))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var o=e2(a,void 0,void 0,r),i=o.countryCallingCode,s=o.number;if(n=s,t=i,!n)throw new Error("Invalid `number` argument passed: too short")}}if(!n)throw new TypeError("`nationalNumber` argument is required");if(typeof n!="string")throw new TypeError("`nationalNumber` argument must be a string");ZS(r);var l=kB(t,r),u=l.country,c=l.countryCallingCode;this.country=u,this.countryCallingCode=c,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}}return TB(e,[{key:"setExt",value:function(n){this.ext=n}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:Z7(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return K7(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return Y7(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var n=new zr(this.getMetadata());return n.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(n){return this.number===n.number&&this.ext===n.ext}},{key:"getType",value:function(){return Yp(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(n,r){return NB(this,n,r?s2(s2({},r),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(n){return this.format("NATIONAL",n)}},{key:"formatInternational",value:function(n){return this.format("INTERNATIONAL",n)}},{key:"getURI",value:function(n){return this.format("RFC3966",n)}}]),e}(),FB=function(t){return/^[A-Z]{2}$/.test(t)};function kB(e,t){var n,r,a=new zr(t);return FB(e)?(n=e,a.selectNumberingPlan(n),r=a.countryCallingCode()):r=e,{country:n,countryCallingCode:r}}var jB=/^\+\d+$/;function th(e){"@babel/helpers - typeof";return th=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},th(e)}function LB(e,t,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function zB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HB(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&&ru(e,t)}function VB(e){var t=u2();return function(){var r=au(e),a;if(t){var o=au(this).constructor;a=Reflect.construct(r,arguments,o)}else a=r.apply(this,arguments);return WB(this,a)}}function WB(e,t){if(t&&(th(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return l2(e)}function l2(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nh(e){var t=typeof Map=="function"?new Map:void 0;return nh=function(r){if(r===null||!KB(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,a)}function a(){return fd(r,arguments,au(this).constructor)}return a.prototype=Object.create(r.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),ru(a,r)},nh(e)}function fd(e,t,n){return u2()?fd=Reflect.construct:fd=function(a,o,i){var s=[null];s.push.apply(s,o);var l=Function.bind.apply(a,s),u=new l;return i&&ru(u,i.prototype),u},fd.apply(null,arguments)}function u2(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function KB(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function ru(e,t){return ru=Object.setPrototypeOf||function(r,a){return r.__proto__=a,r},ru(e,t)}function au(e){return au=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},au(e)}var Do=function(e){HB(n,e);var t=VB(n);function n(r){var a;return zB(this,n),a=t.call(this,r),Object.setPrototypeOf(l2(a),n.prototype),a.name=a.constructor.name,a}return LB(n)}(nh(Error)),c2=new RegExp("(?:"+t2()+")$","i");function UB(e){var t=e.search(c2);if(t<0)return{};for(var n=e.slice(0,t),r=e.match(c2),a=1;a<r.length;){if(r[a])return{number:n,ext:r[a]};a++}}var qB={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function GB(e){return qB[e]}function YB(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=ZB(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
30
30
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZB(e,t){if(e){if(typeof e=="string")return d2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d2(e,t)}}function d2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f2(e){for(var t="",n=YB(e.split("")),r;!(r=n()).done;){var a=r.value;t+=XB(a,t)||""}return t}function XB(e,t,n){return e==="+"?t?void 0:"+":GB(e)}function QB(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=JB(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
31
31
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JB(e,t){if(e){if(typeof e=="string")return v2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v2(e,t)}}function v2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eF(e,t){var n=t.countries,r=t.metadata;r=new zr(r);for(var a=QB(n),o;!(o=a()).done;){var i=o.value;if(r.country(i),r.leadingDigits()){if(e&&e.search(r.leadingDigits())===0)return i}else if(Yp({phone:e,country:i},void 0,r.metadata))return i}}function tF(e,t){var n=t.nationalNumber,r=t.metadata,a=r.getCountryCodesForCallingCode(e);if(a)return a.length===1?a[0]:eF(n,{countries:a,metadata:r.metadata})}var m2="+",nF="[\\-\\.\\(\\)]?",g2="(["+Ta+"]|"+nF+")",rF="^\\"+m2+g2+"*["+Ta+"]"+g2+"*$",aF=new RegExp(rF,"g"),rh=Ta,oF="["+rh+"]+((\\-)*["+rh+"])*",iF="a-zA-Z",sF="["+iF+"]+((\\-)*["+rh+"])*",lF="^("+oF+"\\.)*"+sF+"\\.?$",uF=new RegExp(lF,"g"),p2="tel:",ah=";phone-context=",cF=";isub=";function dF(e){var t=e.indexOf(ah);if(t<0)return null;var n=t+ah.length;if(n>=e.length)return"";var r=e.indexOf(";",n);return r>=0?e.substring(n,r):e.substring(n)}function fF(e){return e===null?!0:e.length===0?!1:aF.test(e)||uF.test(e)}function vF(e,t){var n=t.extractFormattedPhoneNumber,r=dF(e);if(!fF(r))throw new Do("NOT_A_NUMBER");var a;if(r===null)a=n(e)||"";else{a="",r.charAt(0)===m2&&(a+=r);var o=e.indexOf(p2),i;o>=0?i=o+p2.length:i=0;var s=e.indexOf(ah);a+=e.substring(i,s)}var l=a.indexOf(cF);if(l>0&&(a=a.substring(0,l)),a!=="")return a}var mF=250,gF=new RegExp("["+Qp+Ta+"]"),pF=new RegExp("[^"+Ta+"#]+$");function hF(e,t,n){if(t=t||{},n=new zr(n),t.defaultCountry&&!n.hasCountry(t.defaultCountry))throw t.v2?new Do("INVALID_COUNTRY"):new Error("Unknown country: ".concat(t.defaultCountry));var r=yF(e,t.v2,t.extract),a=r.number,o=r.ext,i=r.error;if(!a){if(t.v2)throw i==="TOO_SHORT"?new Do("TOO_SHORT"):new Do("NOT_A_NUMBER");return{}}var s=$F(a,t.defaultCountry,t.defaultCallingCode,n),l=s.country,u=s.nationalNumber,c=s.countryCallingCode,f=s.countryCallingCodeSource,v=s.carrierCode;if(!n.hasSelectedNumberingPlan()){if(t.v2)throw new Do("INVALID_COUNTRY");return{}}if(!u||u.length<Xp){if(t.v2)throw new Do("TOO_SHORT");return{}}if(u.length>Q7){if(t.v2)throw new Do("TOO_LONG");return{}}if(t.v2){var g=new BB(c,u,n.metadata);return l&&(g.country=l),v&&(g.carrierCode=v),o&&(g.ext=o),g.__countryCallingCodeSource=f,g}var b=(t.extended?n.hasSelectedNumberingPlan():l)?Oo(u,n.nationalNumberPattern()):!1;return t.extended?{country:l,countryCallingCode:c,carrierCode:v,valid:b,possible:b?!0:!!(t.extended===!0&&n.possibleLengths()&&QS(u,n)),phone:u,ext:o}:b?CF(l,u,o):{}}function bF(e,t,n){if(e){if(e.length>mF){if(n)throw new Do("TOO_LONG");return}if(t===!1)return e;var r=e.search(gF);if(!(r<0))return e.slice(r).replace(pF,"")}}function yF(e,t,n){var r=vF(e,{extractFormattedPhoneNumber:function(i){return bF(i,n,t)}});if(!r)return{};if(!xB(r))return EB(r)?{error:"TOO_SHORT"}:{};var a=UB(r);return a.ext?a:{number:r}}function CF(e,t,n){var r={country:e,phone:t};return n&&(r.ext=n),r}function $F(e,t,n,r){var a=e2(f2(e),t,n,r.metadata),o=a.countryCallingCodeSource,i=a.countryCallingCode,s=a.number,l;if(i)r.selectNumberingPlan(i);else if(s&&(t||n))r.selectNumberingPlan(t,n),t&&(l=t),i=n||qp(t,r.metadata);else return{};if(!s)return{countryCallingCodeSource:o,countryCallingCode:i};var u=Jp(f2(s),r),c=u.nationalNumber,f=u.carrierCode,v=tF(i,{nationalNumber:c,metadata:r});return v&&(l=v,v==="001"||r.country(l)),{country:l,countryCallingCode:i,countryCallingCodeSource:o,nationalNumber:c,carrierCode:f}}function h2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function b2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?h2(Object(n),!0).forEach(function(r){SF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SF(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xF(e,t,n){return hF(e,b2(b2({},t),{},{v2:!0}),n)}function y2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function EF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?y2(Object(n),!0).forEach(function(r){wF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wF(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OF(e,t){return PF(e)||NF(e,t)||IF(e,t)||DF()}function DF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
32
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IF(e,t){if(e){if(typeof e=="string")return C2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return C2(e,t)}}function C2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NF(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],a=!0,o=!1,i,s;try{for(n=n.call(e);!(a=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));a=!0);}catch(l){o=!0,s=l}finally{try{!a&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function PF(e){if(Array.isArray(e))return e}function _F(e){var t=Array.prototype.slice.call(e),n=OF(t,4),r=n[0],a=n[1],o=n[2],i=n[3],s,l,u;if(typeof r=="string")s=r;else throw new TypeError("A text for parsing must be a string.");if(!a||typeof a=="string")i?(l=o,u=i):(l=void 0,u=o),a&&(l=EF({defaultCountry:a},l));else if(ms(a))o?(l=a,u=o):u=a;else throw new Error("Invalid second argument: ".concat(a));return{text:s,options:l,metadata:u}}function $2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function S2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$2(Object(n),!0).forEach(function(r){AF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AF(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RF(e,t,n){t&&t.defaultCountry&&!V7(t.defaultCountry,n)&&(t=S2(S2({},t),{},{defaultCountry:void 0}));try{return xF(e,t,n)}catch(r){if(!(r instanceof Do))throw r}}function MF(){var e=_F(arguments),t=e.text,n=e.options,r=e.metadata;return RF(t,n,r)}function x2(){return R7(MF,arguments)}var En;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function n(a){throw new Error}e.assertNever=n,e.arrayToEnum=a=>{const o={};for(const i of a)o[i]=i;return o},e.getValidEnumValues=a=>{const o=e.objectKeys(a).filter(s=>typeof a[a[s]]!="number"),i={};for(const s of o)i[s]=a[s];return e.objectValues(i)},e.objectValues=a=>e.objectKeys(a).map(function(o){return a[o]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const o=[];for(const i in a)Object.prototype.hasOwnProperty.call(a,i)&&o.push(i);return o},e.find=(a,o)=>{for(const i of a)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,o=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(a,o)=>typeof o=="bigint"?o.toString():o})(En||(En={}));var E2;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(E2||(E2={}));const Rt=En.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Wo=e=>{switch(typeof e){case"undefined":return Rt.undefined;case"string":return Rt.string;case"number":return Number.isNaN(e)?Rt.nan:Rt.number;case"boolean":return Rt.boolean;case"function":return Rt.function;case"bigint":return Rt.bigint;case"symbol":return Rt.symbol;case"object":return Array.isArray(e)?Rt.array:e===null?Rt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Rt.promise:typeof Map<"u"&&e instanceof Map?Rt.map:typeof Set<"u"&&e instanceof Set?Rt.set:typeof Date<"u"&&e instanceof Date?Rt.date:Rt.object;default:return Rt.unknown}},ct=En.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Io extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(o){return o.message},r={_errors:[]},a=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let s=r,l=0;for(;l<i.path.length;){const u=i.path[l];l===i.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(n(i))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return a(this),r}static assert(t){if(!(t instanceof Io))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,En.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const a of this.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(t(a))):r.push(t(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Io.create=e=>new Io(e);const oh=(e,t)=>{let n;switch(e.code){case ct.invalid_type:e.received===Rt.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ct.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,En.jsonStringifyReplacer)}`;break;case ct.unrecognized_keys:n=`Unrecognized key(s) in object: ${En.joinValues(e.keys,", ")}`;break;case ct.invalid_union:n="Invalid input";break;case ct.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${En.joinValues(e.options)}`;break;case ct.invalid_enum_value:n=`Invalid enum value. Expected ${En.joinValues(e.options)}, received '${e.received}'`;break;case ct.invalid_arguments:n="Invalid function arguments";break;case ct.invalid_return_type:n="Invalid function return type";break;case ct.invalid_date:n="Invalid date";break;case ct.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:En.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ct.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ct.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ct.custom:n="Invalid input";break;case ct.invalid_intersection_types:n="Intersection results could not be merged";break;case ct.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ct.not_finite:n="Number must be finite";break;default:n=t.defaultError,En.assertNever(e)}return{message:n}};let TF=oh;function BF(){return TF}const FF=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,o=[...n,...a.path||[]],i={...a,path:o};if(a.message!==void 0)return{...a,path:o,message:a.message};let s="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)s=u(i,{data:t,defaultError:s}).message;return{...a,path:o,message:s}};function wt(e,t){const n=BF(),r=FF({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===oh?void 0:oh].filter(a=>!!a)});e.common.issues.push(r)}class sa{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const a of n){if(a.status==="aborted")return rn;a.status==="dirty"&&t.dirty(),r.push(a.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const a of n){const o=await a.key,i=await a.value;r.push({key:o,value:i})}return sa.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const a of n){const{key:o,value:i}=a;if(o.status==="aborted"||i.status==="aborted")return rn;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(r[o.value]=i.value)}return{status:t.value,value:r}}}const rn=Object.freeze({status:"aborted"}),ou=e=>({status:"dirty",value:e}),ya=e=>({status:"valid",value:e}),w2=e=>e.status==="aborted",O2=e=>e.status==="dirty",ps=e=>e.status==="valid",vd=e=>typeof Promise<"u"&&e instanceof Promise;var Tt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Tt||(Tt={}));class Ko{constructor(t,n,r,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const D2=(e,t)=>{if(ps(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Io(e.common.issues);return this._error=n,this._error}}};function vn(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(i,s)=>{const{message:l}=e;return i.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??r??s.defaultError}:i.code!=="invalid_type"?{message:s.defaultError}:{message:l??n??s.defaultError}},description:a}}class $n{get description(){return this._def.description}_getType(t){return Wo(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Wo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new sa,ctx:{common:t.parent.common,data:t.data,parsedType:Wo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(vd(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Wo(t)},a=this._parseSync({data:t,path:r.path,parent:r});return D2(r,a)}"~validate"(t){var r,a;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Wo(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:n});return ps(o)?{value:o.value}:{issues:n.common.issues}}catch(o){(a=(r=o==null?void 0:o.message)==null?void 0:r.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(o=>ps(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Wo(t)},a=this._parse({data:t,path:r.path,parent:r}),o=await(vd(a)?a:Promise.resolve(a));return D2(r,o)}refine(t,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,o)=>{const i=t(a),s=()=>o.addIssue({code:ct.custom,...r(a)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(s(),!1)):i?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(t){return new Cs({schema:this,typeName:an.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Go.create(this,this._def)}nullable(){return $s.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ro.create(this)}promise(){return hd.create(this,this._def)}or(t){return gd.create([this,t],this._def)}and(t){return pd.create(this,t,this._def)}transform(t){return new Cs({...vn(this._def),schema:this,typeName:an.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new ch({...vn(this._def),innerType:this,defaultValue:n,typeName:an.ZodDefault})}brand(){return new ik({typeName:an.ZodBranded,type:this,...vn(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new dh({...vn(this._def),innerType:this,catchValue:n,typeName:an.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return fh.create(this,t)}readonly(){return vh.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const kF=/^c[^\s-]{8,}$/i,jF=/^[0-9a-z]+$/,LF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,zF=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,HF=/^[a-z0-9_-]{21}$/i,VF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,WF=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,KF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,UF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ih;const qF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,GF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,YF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ZF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,XF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,QF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,I2="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",JF=new RegExp(`^${I2}$`);function N2(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function ek(e){return new RegExp(`^${N2(e)}$`)}function tk(e){let t=`${I2}T${N2(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function nk(e,t){return!!((t==="v4"||!t)&&qF.test(e)||(t==="v6"||!t)&&YF.test(e))}function rk(e,t){if(!VF.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function ak(e,t){return!!((t==="v4"||!t)&&GF.test(e)||(t==="v6"||!t)&&ZF.test(e))}class Uo extends $n{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Rt.string){const o=this._getOrReturnCtx(t);return wt(o,{code:ct.invalid_type,expected:Rt.string,received:o.parsedType}),rn}const r=new sa;let a;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const i=t.data.length>o.value,s=t.data.length<o.value;(i||s)&&(a=this._getOrReturnCtx(t,a),i?wt(a,{code:ct.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&wt(a,{code:ct.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")KF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"email",code:ct.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")ih||(ih=new RegExp(UF,"u")),ih.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"emoji",code:ct.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")zF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"uuid",code:ct.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")HF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"nanoid",code:ct.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")kF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"cuid",code:ct.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")jF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"cuid2",code:ct.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")LF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"ulid",code:ct.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),wt(a,{validation:"url",code:ct.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"regex",code:ct.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?tk(o).test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?JF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?ek(o).test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?WF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"duration",code:ct.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?nk(t.data,o.version)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"ip",code:ct.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?rk(t.data,o.alg)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"jwt",code:ct.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?ak(t.data,o.version)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"cidr",code:ct.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?XF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"base64",code:ct.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?QF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"base64url",code:ct.invalid_string,message:o.message}),r.dirty()):En.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(a=>t.test(a),{validation:n,code:ct.invalid_string,...Tt.errToObj(r)})}_addCheck(t){return new Uo({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Tt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Tt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Tt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Tt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Tt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Tt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Tt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Tt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Tt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Tt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Tt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Tt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Tt.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...Tt.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Tt.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Tt.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Tt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Tt.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Tt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Tt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Tt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Tt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Tt.errToObj(n)})}nonempty(t){return this.min(1,Tt.errToObj(t))}trim(){return new Uo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Uo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Uo({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Uo.create=e=>new Uo({checks:[],typeName:an.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...vn(e)});function ok(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r,o=Number.parseInt(e.toFixed(a).replace(".","")),i=Number.parseInt(t.toFixed(a).replace(".",""));return o%i/10**a}class hs extends $n{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Rt.number){const o=this._getOrReturnCtx(t);return wt(o,{code:ct.invalid_type,expected:Rt.number,received:o.parsedType}),rn}let r;const a=new sa;for(const o of this._def.checks)o.kind==="int"?En.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),wt(r,{code:ct.invalid_type,expected:"integer",received:"float",message:o.message}),a.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),wt(r,{code:ct.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),wt(r,{code:ct.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="multipleOf"?ok(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),wt(r,{code:ct.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),wt(r,{code:ct.not_finite,message:o.message}),a.dirty()):En.assertNever(o);return{status:a.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Tt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Tt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Tt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Tt.toString(n))}setLimit(t,n,r,a){return new hs({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Tt.toString(a)}]})}_addCheck(t){return new hs({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Tt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Tt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Tt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Tt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Tt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Tt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Tt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Tt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Tt.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&En.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}hs.create=e=>new hs({checks:[],typeName:an.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...vn(e)});class iu extends $n{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Rt.bigint)return this._getInvalidInput(t);let r;const a=new sa;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),wt(r,{code:ct.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),wt(r,{code:ct.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),wt(r,{code:ct.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):En.assertNever(o);return{status:a.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return wt(n,{code:ct.invalid_type,expected:Rt.bigint,received:n.parsedType}),rn}gte(t,n){return this.setLimit("min",t,!0,Tt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Tt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Tt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Tt.toString(n))}setLimit(t,n,r,a){return new iu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Tt.toString(a)}]})}_addCheck(t){return new iu({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Tt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Tt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Tt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Tt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Tt.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}iu.create=e=>new iu({checks:[],typeName:an.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...vn(e)});class sh extends $n{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Rt.boolean){const r=this._getOrReturnCtx(t);return wt(r,{code:ct.invalid_type,expected:Rt.boolean,received:r.parsedType}),rn}return ya(t.data)}}sh.create=e=>new sh({typeName:an.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...vn(e)});class md extends $n{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Rt.date){const o=this._getOrReturnCtx(t);return wt(o,{code:ct.invalid_type,expected:Rt.date,received:o.parsedType}),rn}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return wt(o,{code:ct.invalid_date}),rn}const r=new sa;let a;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):En.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new md({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Tt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Tt.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}md.create=e=>new md({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:an.ZodDate,...vn(e)});class P2 extends $n{_parse(t){if(this._getType(t)!==Rt.symbol){const r=this._getOrReturnCtx(t);return wt(r,{code:ct.invalid_type,expected:Rt.symbol,received:r.parsedType}),rn}return ya(t.data)}}P2.create=e=>new P2({typeName:an.ZodSymbol,...vn(e)});class _2 extends $n{_parse(t){if(this._getType(t)!==Rt.undefined){const r=this._getOrReturnCtx(t);return wt(r,{code:ct.invalid_type,expected:Rt.undefined,received:r.parsedType}),rn}return ya(t.data)}}_2.create=e=>new _2({typeName:an.ZodUndefined,...vn(e)});class A2 extends $n{_parse(t){if(this._getType(t)!==Rt.null){const r=this._getOrReturnCtx(t);return wt(r,{code:ct.invalid_type,expected:Rt.null,received:r.parsedType}),rn}return ya(t.data)}}A2.create=e=>new A2({typeName:an.ZodNull,...vn(e)});class lh extends $n{constructor(){super(...arguments),this._any=!0}_parse(t){return ya(t.data)}}lh.create=e=>new lh({typeName:an.ZodAny,...vn(e)});class R2 extends $n{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ya(t.data)}}R2.create=e=>new R2({typeName:an.ZodUnknown,...vn(e)});class qo extends $n{_parse(t){const n=this._getOrReturnCtx(t);return wt(n,{code:ct.invalid_type,expected:Rt.never,received:n.parsedType}),rn}}qo.create=e=>new qo({typeName:an.ZodNever,...vn(e)});class M2 extends $n{_parse(t){if(this._getType(t)!==Rt.undefined){const r=this._getOrReturnCtx(t);return wt(r,{code:ct.invalid_type,expected:Rt.void,received:r.parsedType}),rn}return ya(t.data)}}M2.create=e=>new M2({typeName:an.ZodVoid,...vn(e)});class ro extends $n{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),a=this._def;if(n.parsedType!==Rt.array)return wt(n,{code:ct.invalid_type,expected:Rt.array,received:n.parsedType}),rn;if(a.exactLength!==null){const i=n.data.length>a.exactLength.value,s=n.data.length<a.exactLength.value;(i||s)&&(wt(n,{code:i?ct.too_big:ct.too_small,minimum:s?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(wt(n,{code:ct.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(wt(n,{code:ct.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,s)=>a.type._parseAsync(new Ko(n,i,n.path,s)))).then(i=>sa.mergeArray(r,i));const o=[...n.data].map((i,s)=>a.type._parseSync(new Ko(n,i,n.path,s)));return sa.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new ro({...this._def,minLength:{value:t,message:Tt.toString(n)}})}max(t,n){return new ro({...this._def,maxLength:{value:t,message:Tt.toString(n)}})}length(t,n){return new ro({...this._def,exactLength:{value:t,message:Tt.toString(n)}})}nonempty(t){return this.min(1,t)}}ro.create=(e,t)=>new ro({type:e,minLength:null,maxLength:null,exactLength:null,typeName:an.ZodArray,...vn(t)});function bs(e){if(e instanceof Qn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Go.create(bs(r))}return new Qn({...e._def,shape:()=>t})}else return e instanceof ro?new ro({...e._def,type:bs(e.element)}):e instanceof Go?Go.create(bs(e.unwrap())):e instanceof $s?$s.create(bs(e.unwrap())):e instanceof Ei?Ei.create(e.items.map(t=>bs(t))):e}class Qn extends $n{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=En.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Rt.object){const u=this._getOrReturnCtx(t);return wt(u,{code:ct.invalid_type,expected:Rt.object,received:u.parsedType}),rn}const{status:r,ctx:a}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof qo&&this._def.unknownKeys==="strip"))for(const u in a.data)i.includes(u)||s.push(u);const l=[];for(const u of i){const c=o[u],f=a.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Ko(a,f,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof qo){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of s)l.push({key:{status:"valid",value:c},value:{status:"valid",value:a.data[c]}});else if(u==="strict")s.length>0&&(wt(a,{code:ct.unrecognized_keys,keys:s}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of s){const f=a.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Ko(a,f,a.path,c)),alwaysSet:c in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const f=await c.key,v=await c.value;u.push({key:f,value:v,alwaysSet:c.alwaysSet})}return u}).then(u=>sa.mergeObjectSync(r,u)):sa.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Tt.errToObj,new Qn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,i;const a=((i=(o=this._def).errorMap)==null?void 0:i.call(o,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Tt.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new Qn({...this._def,unknownKeys:"strip"})}passthrough(){return new Qn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Qn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Qn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:an.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Qn({...this._def,catchall:t})}pick(t){const n={};for(const r of En.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Qn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of En.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Qn({...this._def,shape:()=>n})}deepPartial(){return bs(this)}partial(t){const n={};for(const r of En.objectKeys(this.shape)){const a=this.shape[r];t&&!t[r]?n[r]=a:n[r]=a.optional()}return new Qn({...this._def,shape:()=>n})}required(t){const n={};for(const r of En.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Go;)o=o._def.innerType;n[r]=o}return new Qn({...this._def,shape:()=>n})}keyof(){return k2(En.objectKeys(this.shape))}}Qn.create=(e,t)=>new Qn({shape:()=>e,unknownKeys:"strip",catchall:qo.create(),typeName:an.ZodObject,...vn(t)}),Qn.strictCreate=(e,t)=>new Qn({shape:()=>e,unknownKeys:"strict",catchall:qo.create(),typeName:an.ZodObject,...vn(t)}),Qn.lazycreate=(e,t)=>new Qn({shape:e,unknownKeys:"strip",catchall:qo.create(),typeName:an.ZodObject,...vn(t)});class gd extends $n{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function a(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const i=o.map(s=>new Io(s.ctx.common.issues));return wt(n,{code:ct.invalid_union,unionErrors:i}),rn}if(n.common.async)return Promise.all(r.map(async o=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(a);{let o;const i=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=i.map(l=>new Io(l));return wt(n,{code:ct.invalid_union,unionErrors:s}),rn}}get options(){return this._def.options}}gd.create=(e,t)=>new gd({options:e,typeName:an.ZodUnion,...vn(t)});function uh(e,t){const n=Wo(e),r=Wo(t);if(e===t)return{valid:!0,data:e};if(n===Rt.object&&r===Rt.object){const a=En.objectKeys(t),o=En.objectKeys(e).filter(s=>a.indexOf(s)!==-1),i={...e,...t};for(const s of o){const l=uh(e[s],t[s]);if(!l.valid)return{valid:!1};i[s]=l.data}return{valid:!0,data:i}}else if(n===Rt.array&&r===Rt.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let o=0;o<e.length;o++){const i=e[o],s=t[o],l=uh(i,s);if(!l.valid)return{valid:!1};a.push(l.data)}return{valid:!0,data:a}}else return n===Rt.date&&r===Rt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class pd extends $n{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=(o,i)=>{if(w2(o)||w2(i))return rn;const s=uh(o.value,i.value);return s.valid?((O2(o)||O2(i))&&n.dirty(),{status:n.value,value:s.data}):(wt(r,{code:ct.invalid_intersection_types}),rn)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,i])=>a(o,i)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}pd.create=(e,t,n)=>new pd({left:e,right:t,typeName:an.ZodIntersection,...vn(n)});class Ei extends $n{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Rt.array)return wt(r,{code:ct.invalid_type,expected:Rt.array,received:r.parsedType}),rn;if(r.data.length<this._def.items.length)return wt(r,{code:ct.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),rn;!this._def.rest&&r.data.length>this._def.items.length&&(wt(r,{code:ct.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((i,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new Ko(r,i,r.path,s)):null}).filter(i=>!!i);return r.common.async?Promise.all(o).then(i=>sa.mergeArray(n,i)):sa.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Ei({...this._def,rest:t})}}Ei.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ei({items:e,typeName:an.ZodTuple,rest:null,...vn(t)})};class T2 extends $n{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Rt.map)return wt(r,{code:ct.invalid_type,expected:Rt.map,received:r.parsedType}),rn;const a=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([s,l],u)=>({key:a._parse(new Ko(r,s,r.path,[u,"key"])),value:o._parse(new Ko(r,l,r.path,[u,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of i){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return rn;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const l of i){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return rn;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}}}}T2.create=(e,t,n)=>new T2({valueType:t,keyType:e,typeName:an.ZodMap,...vn(n)});class su extends $n{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Rt.set)return wt(r,{code:ct.invalid_type,expected:Rt.set,received:r.parsedType}),rn;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(wt(r,{code:ct.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(wt(r,{code:ct.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const o=this._def.valueType;function i(l){const u=new Set;for(const c of l){if(c.status==="aborted")return rn;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const s=[...r.data.values()].map((l,u)=>o._parse(new Ko(r,l,r.path,u)));return r.common.async?Promise.all(s).then(l=>i(l)):i(s)}min(t,n){return new su({...this._def,minSize:{value:t,message:Tt.toString(n)}})}max(t,n){return new su({...this._def,maxSize:{value:t,message:Tt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}su.create=(e,t)=>new su({valueType:e,minSize:null,maxSize:null,typeName:an.ZodSet,...vn(t)});class B2 extends $n{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}B2.create=(e,t)=>new B2({getter:e,typeName:an.ZodLazy,...vn(t)});class F2 extends $n{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return wt(n,{received:n.data,code:ct.invalid_literal,expected:this._def.value}),rn}return{status:"valid",value:t.data}}get value(){return this._def.value}}F2.create=(e,t)=>new F2({value:e,typeName:an.ZodLiteral,...vn(t)});function k2(e,t){return new ys({values:e,typeName:an.ZodEnum,...vn(t)})}class ys extends $n{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return wt(n,{expected:En.joinValues(r),received:n.parsedType,code:ct.invalid_type}),rn}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return wt(n,{received:n.data,code:ct.invalid_enum_value,options:r}),rn}return ya(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return ys.create(t,{...this._def,...n})}exclude(t,n=this._def){return ys.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}ys.create=k2;class j2 extends $n{_parse(t){const n=En.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Rt.string&&r.parsedType!==Rt.number){const a=En.objectValues(n);return wt(r,{expected:En.joinValues(a),received:r.parsedType,code:ct.invalid_type}),rn}if(this._cache||(this._cache=new Set(En.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const a=En.objectValues(n);return wt(r,{received:r.data,code:ct.invalid_enum_value,options:a}),rn}return ya(t.data)}get enum(){return this._def.values}}j2.create=(e,t)=>new j2({values:e,typeName:an.ZodNativeEnum,...vn(t)});class hd extends $n{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Rt.promise&&n.common.async===!1)return wt(n,{code:ct.invalid_type,expected:Rt.promise,received:n.parsedType}),rn;const r=n.parsedType===Rt.promise?n.data:Promise.resolve(n.data);return ya(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}hd.create=(e,t)=>new hd({type:e,typeName:an.ZodPromise,...vn(t)});class Cs extends $n{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===an.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,o={addIssue:i=>{wt(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),a.type==="preprocess"){const i=a.transform(r.data,o);if(r.common.async)return Promise.resolve(i).then(async s=>{if(n.value==="aborted")return rn;const l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?rn:l.status==="dirty"||n.value==="dirty"?ou(l.value):l});{if(n.value==="aborted")return rn;const s=this._def.schema._parseSync({data:i,path:r.path,parent:r});return s.status==="aborted"?rn:s.status==="dirty"||n.value==="dirty"?ou(s.value):s}}if(a.type==="refinement"){const i=s=>{const l=a.refinement(s,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?rn:(s.status==="dirty"&&n.dirty(),i(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?rn:(s.status==="dirty"&&n.dirty(),i(s.value).then(()=>({status:n.value,value:s.value}))))}if(a.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ps(i))return rn;const s=a.transform(i.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>ps(i)?Promise.resolve(a.transform(i.value,o)).then(s=>({status:n.value,value:s})):rn);En.assertNever(a)}}Cs.create=(e,t,n)=>new Cs({schema:e,typeName:an.ZodEffects,effect:t,...vn(n)}),Cs.createWithPreprocess=(e,t,n)=>new Cs({schema:t,effect:{type:"preprocess",transform:e},typeName:an.ZodEffects,...vn(n)});class Go extends $n{_parse(t){return this._getType(t)===Rt.undefined?ya(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Go.create=(e,t)=>new Go({innerType:e,typeName:an.ZodOptional,...vn(t)});class $s extends $n{_parse(t){return this._getType(t)===Rt.null?ya(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}$s.create=(e,t)=>new $s({innerType:e,typeName:an.ZodNullable,...vn(t)});class ch extends $n{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Rt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ch.create=(e,t)=>new ch({innerType:e,typeName:an.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...vn(t)});class dh extends $n{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return vd(a)?a.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Io(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Io(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}dh.create=(e,t)=>new dh({innerType:e,typeName:an.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...vn(t)});class L2 extends $n{_parse(t){if(this._getType(t)!==Rt.nan){const r=this._getOrReturnCtx(t);return wt(r,{code:ct.invalid_type,expected:Rt.nan,received:r.parsedType}),rn}return{status:"valid",value:t.data}}}L2.create=e=>new L2({typeName:an.ZodNaN,...vn(e)});class ik extends $n{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class fh extends $n{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?rn:o.status==="dirty"?(n.dirty(),ou(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?rn:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(t,n){return new fh({in:t,out:n,typeName:an.ZodPipeline})}}class vh extends $n{_parse(t){const n=this._def.innerType._parse(t),r=a=>(ps(a)&&(a.value=Object.freeze(a.value)),a);return vd(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}vh.create=(e,t)=>new vh({innerType:e,typeName:an.ZodReadonly,...vn(t)});var an;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(an||(an={}));const hn=Uo.create,lu=hs.create,sk=sh.create,z2=lh.create;qo.create,ro.create;const Ca=Qn.create;gd.create,pd.create,Ei.create,ys.create,hd.create,Go.create,$s.create;const H2=Ca({statusCode:lu().optional(),message:hn().optional().nullable(),messages:hn().array().optional().nullable(),data:z2().optional().nullable(),error:Ca({statusCode:lu(),message:hn().optional().nullable(),messages:hn().array().optional().nullable()}).optional().nullable(),response:z2().optional().nullable()}),V2=Ca({id:hn(),profileId:hn(),phone:hn().optional().nullable(),email:hn().optional().nullable(),name:hn().optional().nullable(),surname:hn().optional().nullable(),roles:hn().array(),maxRolePriority:lu().optional().nullable(),isAllDomains:sk().optional().nullable(),domains:hn().array().optional().nullable(),tokens:Ca({accessToken:Ca({token:hn(),exp:lu()}),refreshToken:Ca({token:hn(),exp:lu()})})}),lk=Ca({tempFiles:hn().array()}),W2=Ca({altRU:hn().optional().nullable(),altEN:hn().optional().nullable(),altAR:hn().optional().nullable(),name:hn(),originalFileExtension:hn(),fileExtensions:hn().array(),prefixes:hn().array(),folder:hn().optional()}),mh=Ca({name:hn(),fullName:hn(),extension:hn(),entityId:hn().uuid(),fullPathExample:hn(),folder:hn().optional()}),uk=Ca({files:Ca({imageName:hn(),originalFileExtension:hn(),entityId:hn(),folder:hn().optional(),fullPathExample:hn(),fileExtensions:hn().array(),prefixes:hn().array()}).array()}),ck=Ca({files:mh.array()}),K2=({name:e,extension:t,entityId:n,prefixe:r,folder:a,bucketFolder:o,uploadUrl:i})=>`${i}/${o}/${n}${a?`/${a}`:""}/${e}-${r}.${t}`,U2=({fullName:e,entityId:t,folder:n,bucketFolder:r,uploadUrl:a})=>`${a}/${r}/${t}${n?`/${n}`:""}/${e}`,q2=(e,t)=>{try{return W2.parse(e),!0}catch(n){return t({error:n}),!1}},G2=(e,t)=>{try{return mh.parse(e),!0}catch(n){return t({error:n}),!1}},gh=(e,t)=>{const n=[...e];return n.sort(function(r,a){return t.indexOf(r.uid??"")-t.indexOf(a.uid??"")}),n},dk=(e,t,n,r)=>{if(!e)return{serverFiles:[],uploadFiles:[]};try{const a=JSON.parse(e);if(!Array.isArray(a))return{serverFiles:[],uploadFiles:[]};const o=a.map(s=>{if(!G2(s,r))return null;const l=U2({fullName:s.fullName,entityId:s.entityId,folder:s.folder,uploadUrl:n,bucketFolder:t});return{uid:l,url:l}}).filter(s=>!!s),i=o.map(s=>({uid:s.uid,name:s.url}));return{serverFiles:o,uploadFiles:i}}catch(a){return r({error:a}),{serverFiles:[],uploadFiles:[]}}},fk=(e,t,n,r)=>{if(!e)return{serverImages:[],uploadImages:[]};try{const a=JSON.parse(e);if(!Array.isArray(a))return{serverImages:[],uploadImages:[]};const o=a.map(s=>{if(!q2(s,r))return null;const l=Y2(s.prefixes,"1hd"),u=K2({name:s.name,extension:s.fileExtensions[1],entityId:s.entityId,folder:s.folder,prefixe:l??"",uploadUrl:n,bucketFolder:t});return{uid:u,url:u,altRU:s.altRU,altEN:s.altEN,altAR:s.altAR}}).filter(s=>!!s),i=o.map(s=>({uid:s.uid,name:s.url,altRU:s.altRU,altEN:s.altEN,altAR:s.altAR}));return{serverImages:o,uploadImages:i}}catch(a){return r({error:a}),{serverImages:[],uploadImages:[]}}},Y2=(e,t)=>{let n;switch(t){case"original":n=e[0];break;case"0.25hd":n=e[1];break;case"0.5hd":n=e[2];break;case"1hd":n=e[3];break;case"2hd":n=e[4];break;case"4hd":n=e[5];break}return n??e[0]},vk=e=>{let t=e;if(t!=="+"&&Number.isNaN(Number(t))||t.length>13)return"";const n=t.split(""),r=n[0],a=n[1];return r==="7"||r==="8"?n[0]="+7":`${r}${a}`=="+8"?n[1]="7":r&&r!=="+"&&(n[0]=`+${r}`),t=n.join("").trim(),t},mk=e=>{const t=x2(e);return t!=null&&t.isValid()?t.number:""},Z2=e=>new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=a=>n(a)}),gk=e=>({images:[],updatedImages:[],onSetData:t=>e(()=>({images:t,updatedImages:t})),onUpdateData:t=>e(n=>{const r=[...n.images],a=r.findIndex(l=>l.uid===t.uid);if(a<0)return{images:[...r,t]};const{altRU:o,altEN:i,altAR:s}=r[a];return r[a]={...t,altRU:t.altRU||(o&&(o==null?void 0:o.length)>1?o:""),altEN:t.altEN||(i&&(i==null?void 0:i.length)>1?i:""),altAR:t.altAR||(s&&(s==null?void 0:s.length)>1?s:"")},{images:r}}),onDeleteImage:t=>e(n=>({images:n.images.filter(a=>a.uid!==t)})),onAllDelete:()=>e(()=>({images:[]}))}),pk=(e,t,n)=>e.map(r=>({label:r[t],value:r[n]})),hk=({newImages:e,serverImages:t,imagesOrder:n,imagesData:r,limit:a=10})=>{const o=[...t,...e].slice(0,a),i=gh(o,n),s=/-\d+x\d+/g,l=i.map(c=>{if(!c.tempName)return null;const f=r.find(v=>v.uid===c.uid&&!v.isError);return{tempName:c.tempName,altRU:f==null?void 0:f.altRU,altEN:f==null?void 0:f.altEN,altAR:f==null?void 0:f.altAR}}).filter(c=>c!==null),u=i.map(c=>{var g;const f=r.find(b=>b.uid===c.uid&&!b.isError);let v="";if(c.url){const b=c.url.split("/"),h=(g=b[b.length-1])==null?void 0:g.split(".");v=h[h.length-2]??"",v=v.replace(s,""),v=v.replace("-original","")}return{name:v??null,tempName:c.tempName??null,altRU:(f==null?void 0:f.altRU)||c.altRU,altEN:(f==null?void 0:f.altEN)||c.altEN,altAR:(f==null?void 0:f.altAR)||c.altAR}}).filter(c=>c!==null);return{tempImages:l,allImages:u}},bk=({newFiles:e,serverFiles:t,filesOrder:n,limit:r=10})=>{const a=[...e,...t].slice(0,r),o=gh(a,n),i=o.map(l=>l.tempName?{tempName:l.tempName}:null).filter(l=>l!==null),s=o.map(l=>{var c;let u="";if(l.url){const f=l.url.split("/"),v=(c=f[f.length-1])==null?void 0:c.split(".");u=v[v.length-2]??""}return{name:u??null,tempName:l.tempName??null}}).filter(l=>l!==null);return{tempFiles:i,allFiles:s}},ph=e=>{const t=/^(?:\w+:)?\/\/(\S+)$/,n=/^localhost[\\:?\d]*(?:[^\\:?\d]\S*)?$/,r=/^[^\s\\.]+\.\S{2,}$/;if(typeof e!="string")return!1;const a=e.match(t);if(!a)return!1;const o=a[1];return o?!!(n.test(o)||r.test(o)):!1},X2=e=>{const t=x2(e);return t!=null&&t.isValid()?t.formatInternational():""},yk=({fullName:e,phone:t,email:n})=>`${e||""}${t?`${e?",":""} ${X2(t)}`:""}${n?`${e||t?",":""} ${n}`:""}`,Q2=async({name:e,lang:t,langsList:n,value:r,translateText:a})=>{if(!r)return[];const o=[],i=[];return await Promise.all(n.map(s=>{if(s!==t)return i.push(s),a(r,t,s)})).then(s=>{s.filter(l=>!!l).forEach((l,u)=>{if((l==null?void 0:l.status)===BS.Ok){const c=i[u],f=`${e}${c.toUpperCase()}`;o.push({[f]:l.data.data.translatedText})}})}),o},Ck=async({data:e,mainLang:t,langsList:n,translateText:r})=>{const a=[];for(const o of e){const i=o[`alt${t.toUpperCase()}`];if(!i){a.push(o);continue}const s=await Q2({name:"alt",lang:t,langsList:n,value:String(i),translateText:r});let l={...o};s.map(u=>{Object.entries(u).map(([c,f])=>{l={...l,[c]:f}})}),a.push(l)}return a},$k=async({nodes:e,sourceLanguage:t,targetLanguage:n,translateText:r})=>{const o=(c=>{const f=[],v=[...c];for(;v.length>0;){const g=v.pop();g&&("text"in g&&g.text&&f.push(g.text),Array.isArray(g.children)&&v.push(...g.children))}return f})(e),i=o.map(c=>c?r(c,t,n):""),s=await Promise.all(i),l={};s.forEach((c,f)=>{if(!c){l[o[f]]="";return}c.status===200&&(l[o[f]]=c.data.data.translatedText)});const u=c=>c.map(f=>{const v={...f};return"text"in v&&v.text&&l[v.text]&&(v.text=l[v.text]),Array.isArray(v.children)&&(v.children=u(v.children)),v});return u(e)},J2=({userRoles:e,comparedUserRoles:t,rolePriority:n})=>{const r=e.reduce((o,i)=>{const s=n[i];return s!==void 0&&s>o?s:o},0),a=t.reduce((o,i)=>{const s=n[i];return s!==void 0&&s>o?s:o},0);return{maxUserRolePriority:r,maxComparedUserRolePriority:a,isPriorityHigher:r>a,isPriorityEqual:r===a,isPriorityLower:r<a}},Sk=(e,t)=>((t==null?void 0:t.label)??"").toLowerCase().indexOf(e.toLowerCase())>=0,hh=e=>{const t=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},wi=(e,t,n={})=>{n={path:"/",...n},n.expires instanceof Date&&(n.expires=n.expires.toUTCString());let r=encodeURIComponent(e)+"="+encodeURIComponent(t);for(const a in n){r+="; "+a;const o=n[a];o!==!0&&(r+="="+o)}document.cookie=r},ao=(e,t)=>{wi(e,"",{domain:t,"max-age":-1})},ex=async({baseURL:e,domain:t,isRefresh:n=!1,isNotSecure:r=!1,getError:a})=>{var m,p,y,C,$;const o=hh(dr.SESSION),i=hh(dr.SESSION_TEMP);if(!o&&!i)return"";let s=null;if(i?s=JSON.parse(i):o&&(s=JSON.parse(o)),!s)return"";try{V2.parse(s)}catch(S){return a({error:S}),i?ao(dr.SESSION_TEMP):o&&ao(dr.SESSION),""}const l=(m=s==null?void 0:s.tokens)==null?void 0:m.accessToken,u=(p=s==null?void 0:s.tokens)==null?void 0:p.refreshToken;if(n)return(u==null?void 0:u.token)??"";if(!(new Date().getTime()>=((l==null?void 0:l.exp)??0)-xi.milliseconds.minutes1))return l==null?void 0:l.token;let v=null;try{const S=qn.create({baseURL:e,adapter:"fetch"}),x=await ex({baseURL:e,domain:t,isRefresh:!0,getError:a});v=(y=(await S.post("/auth/v1/refresh",void 0,{headers:{Authorization:`Bearer ${x}`}})).data)==null?void 0:y.data}catch(S){return a({error:S}),""}if(!v)return"";try{H2.parse(v)}catch(S){return a({error:S}),i?ao(dr.SESSION_TEMP):o&&ao(dr.SESSION),""}const g=Vn(),h=Vn((u==null?void 0:u.exp)??0).diff(g,"seconds");return i?wi(dr.SESSION_TEMP,JSON.stringify(v),{domain:t,secure:!r,"max-age":h}):o&&wi(dr.SESSION,JSON.stringify(v),{domain:t,secure:!r,"max-age":h}),(($=(C=v.tokens)==null?void 0:C.accessToken)==null?void 0:$.token)??""},xk=(e,t)=>{const n=t.flat(),r=new Map;return n.forEach(a=>{!a[e]||r.has(a[e])||r.set(a[e],a)}),Array.from(r.values())},Ek=zM((e,t)=>({isLoading:!1,isFirstLoadCompleted:!1,currentSession:void 0,loadSession:async({domain:n,ROLE_PRIORITY:r,isNotSecure:a=!1,navigate:o,refresh:i})=>{var h,m,p,y,C,$,S,x,E,D;if(t().currentSession)return;ao(dr.SESSION_TEMP,n),e({isLoading:!0});const l=await i();if(l.status!==BS.Ok){e({currentSession:void 0,isLoading:!1,isFirstLoadCompleted:!0}),o({to:"/login"}),ao(dr.SESSION,n);return}const u=l.data.data;if(!u){e({currentSession:void 0,isLoading:!1,isFirstLoadCompleted:!0}),o({to:"/login"}),ao(dr.SESSION,n);return}const{maxUserRolePriority:c}=J2({userRoles:u.roles,comparedUserRoles:u.roles,rolePriority:r}),f={id:u.id,profileId:u.profileId,phone:u.phone,email:u.email,roles:u.roles,isAllDomains:u.isAllDomains||u.isAllCities,domains:u.domains||u.cities,maxRolePriority:c,tokens:{accessToken:{token:((m=(h=u.tokens)==null?void 0:h.accessToken)==null?void 0:m.token)??"",exp:((y=(p=u.tokens)==null?void 0:p.accessToken)==null?void 0:y.exp)??0},refreshToken:{token:(($=(C=u.tokens)==null?void 0:C.refreshToken)==null?void 0:$.token)??"",exp:((x=(S=u.tokens)==null?void 0:S.refreshToken)==null?void 0:x.exp)??0}}},v=Vn(),b=Vn(((D=(E=u.tokens)==null?void 0:E.refreshToken)==null?void 0:D.exp)??0).diff(v,"seconds");return wi(dr.SESSION,JSON.stringify(f),{domain:n,secure:!a,"max-age":b}),e({currentSession:f,isLoading:!1,isFirstLoadCompleted:!0}),f},setCurrentSession:({domain:n,session:r,isRemember:a,isNotSecure:o})=>{var u,c;e({currentSession:r});const i=Vn(),l=Vn(((c=(u=r.tokens)==null?void 0:u.refreshToken)==null?void 0:c.exp)??0).diff(i,"seconds");a?wi(dr.SESSION,JSON.stringify(r),{domain:n,secure:!o,"max-age":l}):wi(dr.SESSION_TEMP,JSON.stringify(r),{domain:n,secure:!o,"max-age":l})},removeSession:({domain:n,navigate:r})=>{e({currentSession:void 0}),ao(dr.SESSION,n),ao(dr.SESSION_TEMP,n),r({to:"/login"})}}));var tx=(e=>(e.russian="ru",e.english="en",e.arabic="ar",e))(tx||{}),nx=(e=>(e[e.January=1]="January",e[e.February=2]="February",e[e.March=3]="March",e[e.April=4]="April",e[e.May=5]="May",e[e.June=6]="June",e[e.July=7]="July",e[e.August=8]="August",e[e.September=9]="September",e[e.October=10]="October",e[e.November=11]="November",e[e.December=12]="December",e))(nx||{});const wk={container:"_container_j6rsl_1"},Ok=({children:e})=>Re.jsx("div",{className:wk.container,children:e});var bh={exports:{}};/*!
32
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IF(e,t){if(e){if(typeof e=="string")return C2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return C2(e,t)}}function C2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NF(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],a=!0,o=!1,i,s;try{for(n=n.call(e);!(a=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));a=!0);}catch(l){o=!0,s=l}finally{try{!a&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function PF(e){if(Array.isArray(e))return e}function _F(e){var t=Array.prototype.slice.call(e),n=OF(t,4),r=n[0],a=n[1],o=n[2],i=n[3],s,l,u;if(typeof r=="string")s=r;else throw new TypeError("A text for parsing must be a string.");if(!a||typeof a=="string")i?(l=o,u=i):(l=void 0,u=o),a&&(l=EF({defaultCountry:a},l));else if(ms(a))o?(l=a,u=o):u=a;else throw new Error("Invalid second argument: ".concat(a));return{text:s,options:l,metadata:u}}function $2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function S2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$2(Object(n),!0).forEach(function(r){AF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AF(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RF(e,t,n){t&&t.defaultCountry&&!V7(t.defaultCountry,n)&&(t=S2(S2({},t),{},{defaultCountry:void 0}));try{return xF(e,t,n)}catch(r){if(!(r instanceof Do))throw r}}function MF(){var e=_F(arguments),t=e.text,n=e.options,r=e.metadata;return RF(t,n,r)}function x2(){return R7(MF,arguments)}var En;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function n(a){throw new Error}e.assertNever=n,e.arrayToEnum=a=>{const o={};for(const i of a)o[i]=i;return o},e.getValidEnumValues=a=>{const o=e.objectKeys(a).filter(s=>typeof a[a[s]]!="number"),i={};for(const s of o)i[s]=a[s];return e.objectValues(i)},e.objectValues=a=>e.objectKeys(a).map(function(o){return a[o]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const o=[];for(const i in a)Object.prototype.hasOwnProperty.call(a,i)&&o.push(i);return o},e.find=(a,o)=>{for(const i of a)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,o=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(a,o)=>typeof o=="bigint"?o.toString():o})(En||(En={}));var E2;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(E2||(E2={}));const Rt=En.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Wo=e=>{switch(typeof e){case"undefined":return Rt.undefined;case"string":return Rt.string;case"number":return Number.isNaN(e)?Rt.nan:Rt.number;case"boolean":return Rt.boolean;case"function":return Rt.function;case"bigint":return Rt.bigint;case"symbol":return Rt.symbol;case"object":return Array.isArray(e)?Rt.array:e===null?Rt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Rt.promise:typeof Map<"u"&&e instanceof Map?Rt.map:typeof Set<"u"&&e instanceof Set?Rt.set:typeof Date<"u"&&e instanceof Date?Rt.date:Rt.object;default:return Rt.unknown}},ct=En.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Io extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(o){return o.message},r={_errors:[]},a=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let s=r,l=0;for(;l<i.path.length;){const u=i.path[l];l===i.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(n(i))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return a(this),r}static assert(t){if(!(t instanceof Io))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,En.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const a of this.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(t(a))):r.push(t(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Io.create=e=>new Io(e);const oh=(e,t)=>{let n;switch(e.code){case ct.invalid_type:e.received===Rt.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ct.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,En.jsonStringifyReplacer)}`;break;case ct.unrecognized_keys:n=`Unrecognized key(s) in object: ${En.joinValues(e.keys,", ")}`;break;case ct.invalid_union:n="Invalid input";break;case ct.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${En.joinValues(e.options)}`;break;case ct.invalid_enum_value:n=`Invalid enum value. Expected ${En.joinValues(e.options)}, received '${e.received}'`;break;case ct.invalid_arguments:n="Invalid function arguments";break;case ct.invalid_return_type:n="Invalid function return type";break;case ct.invalid_date:n="Invalid date";break;case ct.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:En.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ct.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ct.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ct.custom:n="Invalid input";break;case ct.invalid_intersection_types:n="Intersection results could not be merged";break;case ct.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ct.not_finite:n="Number must be finite";break;default:n=t.defaultError,En.assertNever(e)}return{message:n}};let TF=oh;function BF(){return TF}const FF=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,o=[...n,...a.path||[]],i={...a,path:o};if(a.message!==void 0)return{...a,path:o,message:a.message};let s="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)s=u(i,{data:t,defaultError:s}).message;return{...a,path:o,message:s}};function wt(e,t){const n=BF(),r=FF({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===oh?void 0:oh].filter(a=>!!a)});e.common.issues.push(r)}class sa{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const a of n){if(a.status==="aborted")return rn;a.status==="dirty"&&t.dirty(),r.push(a.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const a of n){const o=await a.key,i=await a.value;r.push({key:o,value:i})}return sa.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const a of n){const{key:o,value:i}=a;if(o.status==="aborted"||i.status==="aborted")return rn;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(r[o.value]=i.value)}return{status:t.value,value:r}}}const rn=Object.freeze({status:"aborted"}),ou=e=>({status:"dirty",value:e}),ya=e=>({status:"valid",value:e}),w2=e=>e.status==="aborted",O2=e=>e.status==="dirty",ps=e=>e.status==="valid",vd=e=>typeof Promise<"u"&&e instanceof Promise;var Tt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Tt||(Tt={}));class Ko{constructor(t,n,r,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const D2=(e,t)=>{if(ps(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Io(e.common.issues);return this._error=n,this._error}}};function vn(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(i,s)=>{const{message:l}=e;return i.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??r??s.defaultError}:i.code!=="invalid_type"?{message:s.defaultError}:{message:l??n??s.defaultError}},description:a}}class $n{get description(){return this._def.description}_getType(t){return Wo(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Wo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new sa,ctx:{common:t.parent.common,data:t.data,parsedType:Wo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(vd(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Wo(t)},a=this._parseSync({data:t,path:r.path,parent:r});return D2(r,a)}"~validate"(t){var r,a;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Wo(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:n});return ps(o)?{value:o.value}:{issues:n.common.issues}}catch(o){(a=(r=o==null?void 0:o.message)==null?void 0:r.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(o=>ps(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Wo(t)},a=this._parse({data:t,path:r.path,parent:r}),o=await(vd(a)?a:Promise.resolve(a));return D2(r,o)}refine(t,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,o)=>{const i=t(a),s=()=>o.addIssue({code:ct.custom,...r(a)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(s(),!1)):i?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(t){return new Cs({schema:this,typeName:an.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Go.create(this,this._def)}nullable(){return $s.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ro.create(this)}promise(){return hd.create(this,this._def)}or(t){return gd.create([this,t],this._def)}and(t){return pd.create(this,t,this._def)}transform(t){return new Cs({...vn(this._def),schema:this,typeName:an.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new ch({...vn(this._def),innerType:this,defaultValue:n,typeName:an.ZodDefault})}brand(){return new ik({typeName:an.ZodBranded,type:this,...vn(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new dh({...vn(this._def),innerType:this,catchValue:n,typeName:an.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return fh.create(this,t)}readonly(){return vh.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const kF=/^c[^\s-]{8,}$/i,jF=/^[0-9a-z]+$/,LF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,zF=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,HF=/^[a-z0-9_-]{21}$/i,VF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,WF=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,KF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,UF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ih;const qF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,GF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,YF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ZF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,XF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,QF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,I2="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",JF=new RegExp(`^${I2}$`);function N2(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function ek(e){return new RegExp(`^${N2(e)}$`)}function tk(e){let t=`${I2}T${N2(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function nk(e,t){return!!((t==="v4"||!t)&&qF.test(e)||(t==="v6"||!t)&&YF.test(e))}function rk(e,t){if(!VF.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function ak(e,t){return!!((t==="v4"||!t)&&GF.test(e)||(t==="v6"||!t)&&ZF.test(e))}class Uo extends $n{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Rt.string){const o=this._getOrReturnCtx(t);return wt(o,{code:ct.invalid_type,expected:Rt.string,received:o.parsedType}),rn}const r=new sa;let a;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const i=t.data.length>o.value,s=t.data.length<o.value;(i||s)&&(a=this._getOrReturnCtx(t,a),i?wt(a,{code:ct.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&wt(a,{code:ct.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")KF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"email",code:ct.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")ih||(ih=new RegExp(UF,"u")),ih.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"emoji",code:ct.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")zF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"uuid",code:ct.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")HF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"nanoid",code:ct.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")kF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"cuid",code:ct.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")jF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"cuid2",code:ct.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")LF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"ulid",code:ct.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),wt(a,{validation:"url",code:ct.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"regex",code:ct.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?tk(o).test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?JF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?ek(o).test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?WF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"duration",code:ct.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?nk(t.data,o.version)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"ip",code:ct.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?rk(t.data,o.alg)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"jwt",code:ct.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?ak(t.data,o.version)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"cidr",code:ct.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?XF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"base64",code:ct.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?QF.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"base64url",code:ct.invalid_string,message:o.message}),r.dirty()):En.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(a=>t.test(a),{validation:n,code:ct.invalid_string,...Tt.errToObj(r)})}_addCheck(t){return new Uo({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Tt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Tt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Tt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Tt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Tt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Tt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Tt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Tt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Tt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Tt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Tt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Tt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Tt.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...Tt.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Tt.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Tt.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Tt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Tt.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Tt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Tt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Tt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Tt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Tt.errToObj(n)})}nonempty(t){return this.min(1,Tt.errToObj(t))}trim(){return new Uo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Uo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Uo({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Uo.create=e=>new Uo({checks:[],typeName:an.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...vn(e)});function ok(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r,o=Number.parseInt(e.toFixed(a).replace(".","")),i=Number.parseInt(t.toFixed(a).replace(".",""));return o%i/10**a}class hs extends $n{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Rt.number){const o=this._getOrReturnCtx(t);return wt(o,{code:ct.invalid_type,expected:Rt.number,received:o.parsedType}),rn}let r;const a=new sa;for(const o of this._def.checks)o.kind==="int"?En.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),wt(r,{code:ct.invalid_type,expected:"integer",received:"float",message:o.message}),a.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),wt(r,{code:ct.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),wt(r,{code:ct.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="multipleOf"?ok(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),wt(r,{code:ct.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),wt(r,{code:ct.not_finite,message:o.message}),a.dirty()):En.assertNever(o);return{status:a.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Tt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Tt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Tt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Tt.toString(n))}setLimit(t,n,r,a){return new hs({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Tt.toString(a)}]})}_addCheck(t){return new hs({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Tt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Tt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Tt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Tt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Tt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Tt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Tt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Tt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Tt.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&En.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}hs.create=e=>new hs({checks:[],typeName:an.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...vn(e)});class iu extends $n{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Rt.bigint)return this._getInvalidInput(t);let r;const a=new sa;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),wt(r,{code:ct.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),wt(r,{code:ct.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),wt(r,{code:ct.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):En.assertNever(o);return{status:a.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return wt(n,{code:ct.invalid_type,expected:Rt.bigint,received:n.parsedType}),rn}gte(t,n){return this.setLimit("min",t,!0,Tt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Tt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Tt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Tt.toString(n))}setLimit(t,n,r,a){return new iu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Tt.toString(a)}]})}_addCheck(t){return new iu({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Tt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Tt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Tt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Tt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Tt.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}iu.create=e=>new iu({checks:[],typeName:an.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...vn(e)});class sh extends $n{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Rt.boolean){const r=this._getOrReturnCtx(t);return wt(r,{code:ct.invalid_type,expected:Rt.boolean,received:r.parsedType}),rn}return ya(t.data)}}sh.create=e=>new sh({typeName:an.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...vn(e)});class md extends $n{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Rt.date){const o=this._getOrReturnCtx(t);return wt(o,{code:ct.invalid_type,expected:Rt.date,received:o.parsedType}),rn}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return wt(o,{code:ct.invalid_date}),rn}const r=new sa;let a;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(a=this._getOrReturnCtx(t,a),wt(a,{code:ct.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):En.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new md({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Tt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Tt.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}md.create=e=>new md({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:an.ZodDate,...vn(e)});class P2 extends $n{_parse(t){if(this._getType(t)!==Rt.symbol){const r=this._getOrReturnCtx(t);return wt(r,{code:ct.invalid_type,expected:Rt.symbol,received:r.parsedType}),rn}return ya(t.data)}}P2.create=e=>new P2({typeName:an.ZodSymbol,...vn(e)});class _2 extends $n{_parse(t){if(this._getType(t)!==Rt.undefined){const r=this._getOrReturnCtx(t);return wt(r,{code:ct.invalid_type,expected:Rt.undefined,received:r.parsedType}),rn}return ya(t.data)}}_2.create=e=>new _2({typeName:an.ZodUndefined,...vn(e)});class A2 extends $n{_parse(t){if(this._getType(t)!==Rt.null){const r=this._getOrReturnCtx(t);return wt(r,{code:ct.invalid_type,expected:Rt.null,received:r.parsedType}),rn}return ya(t.data)}}A2.create=e=>new A2({typeName:an.ZodNull,...vn(e)});class lh extends $n{constructor(){super(...arguments),this._any=!0}_parse(t){return ya(t.data)}}lh.create=e=>new lh({typeName:an.ZodAny,...vn(e)});class R2 extends $n{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ya(t.data)}}R2.create=e=>new R2({typeName:an.ZodUnknown,...vn(e)});class qo extends $n{_parse(t){const n=this._getOrReturnCtx(t);return wt(n,{code:ct.invalid_type,expected:Rt.never,received:n.parsedType}),rn}}qo.create=e=>new qo({typeName:an.ZodNever,...vn(e)});class M2 extends $n{_parse(t){if(this._getType(t)!==Rt.undefined){const r=this._getOrReturnCtx(t);return wt(r,{code:ct.invalid_type,expected:Rt.void,received:r.parsedType}),rn}return ya(t.data)}}M2.create=e=>new M2({typeName:an.ZodVoid,...vn(e)});class ro extends $n{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),a=this._def;if(n.parsedType!==Rt.array)return wt(n,{code:ct.invalid_type,expected:Rt.array,received:n.parsedType}),rn;if(a.exactLength!==null){const i=n.data.length>a.exactLength.value,s=n.data.length<a.exactLength.value;(i||s)&&(wt(n,{code:i?ct.too_big:ct.too_small,minimum:s?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(wt(n,{code:ct.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(wt(n,{code:ct.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,s)=>a.type._parseAsync(new Ko(n,i,n.path,s)))).then(i=>sa.mergeArray(r,i));const o=[...n.data].map((i,s)=>a.type._parseSync(new Ko(n,i,n.path,s)));return sa.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new ro({...this._def,minLength:{value:t,message:Tt.toString(n)}})}max(t,n){return new ro({...this._def,maxLength:{value:t,message:Tt.toString(n)}})}length(t,n){return new ro({...this._def,exactLength:{value:t,message:Tt.toString(n)}})}nonempty(t){return this.min(1,t)}}ro.create=(e,t)=>new ro({type:e,minLength:null,maxLength:null,exactLength:null,typeName:an.ZodArray,...vn(t)});function bs(e){if(e instanceof Qn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Go.create(bs(r))}return new Qn({...e._def,shape:()=>t})}else return e instanceof ro?new ro({...e._def,type:bs(e.element)}):e instanceof Go?Go.create(bs(e.unwrap())):e instanceof $s?$s.create(bs(e.unwrap())):e instanceof Ei?Ei.create(e.items.map(t=>bs(t))):e}class Qn extends $n{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=En.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Rt.object){const u=this._getOrReturnCtx(t);return wt(u,{code:ct.invalid_type,expected:Rt.object,received:u.parsedType}),rn}const{status:r,ctx:a}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof qo&&this._def.unknownKeys==="strip"))for(const u in a.data)i.includes(u)||s.push(u);const l=[];for(const u of i){const c=o[u],f=a.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Ko(a,f,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof qo){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of s)l.push({key:{status:"valid",value:c},value:{status:"valid",value:a.data[c]}});else if(u==="strict")s.length>0&&(wt(a,{code:ct.unrecognized_keys,keys:s}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of s){const f=a.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Ko(a,f,a.path,c)),alwaysSet:c in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const f=await c.key,v=await c.value;u.push({key:f,value:v,alwaysSet:c.alwaysSet})}return u}).then(u=>sa.mergeObjectSync(r,u)):sa.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Tt.errToObj,new Qn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,i;const a=((i=(o=this._def).errorMap)==null?void 0:i.call(o,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Tt.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new Qn({...this._def,unknownKeys:"strip"})}passthrough(){return new Qn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Qn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Qn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:an.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Qn({...this._def,catchall:t})}pick(t){const n={};for(const r of En.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Qn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of En.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Qn({...this._def,shape:()=>n})}deepPartial(){return bs(this)}partial(t){const n={};for(const r of En.objectKeys(this.shape)){const a=this.shape[r];t&&!t[r]?n[r]=a:n[r]=a.optional()}return new Qn({...this._def,shape:()=>n})}required(t){const n={};for(const r of En.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Go;)o=o._def.innerType;n[r]=o}return new Qn({...this._def,shape:()=>n})}keyof(){return k2(En.objectKeys(this.shape))}}Qn.create=(e,t)=>new Qn({shape:()=>e,unknownKeys:"strip",catchall:qo.create(),typeName:an.ZodObject,...vn(t)}),Qn.strictCreate=(e,t)=>new Qn({shape:()=>e,unknownKeys:"strict",catchall:qo.create(),typeName:an.ZodObject,...vn(t)}),Qn.lazycreate=(e,t)=>new Qn({shape:e,unknownKeys:"strip",catchall:qo.create(),typeName:an.ZodObject,...vn(t)});class gd extends $n{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function a(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const i=o.map(s=>new Io(s.ctx.common.issues));return wt(n,{code:ct.invalid_union,unionErrors:i}),rn}if(n.common.async)return Promise.all(r.map(async o=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(a);{let o;const i=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=i.map(l=>new Io(l));return wt(n,{code:ct.invalid_union,unionErrors:s}),rn}}get options(){return this._def.options}}gd.create=(e,t)=>new gd({options:e,typeName:an.ZodUnion,...vn(t)});function uh(e,t){const n=Wo(e),r=Wo(t);if(e===t)return{valid:!0,data:e};if(n===Rt.object&&r===Rt.object){const a=En.objectKeys(t),o=En.objectKeys(e).filter(s=>a.indexOf(s)!==-1),i={...e,...t};for(const s of o){const l=uh(e[s],t[s]);if(!l.valid)return{valid:!1};i[s]=l.data}return{valid:!0,data:i}}else if(n===Rt.array&&r===Rt.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let o=0;o<e.length;o++){const i=e[o],s=t[o],l=uh(i,s);if(!l.valid)return{valid:!1};a.push(l.data)}return{valid:!0,data:a}}else return n===Rt.date&&r===Rt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class pd extends $n{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=(o,i)=>{if(w2(o)||w2(i))return rn;const s=uh(o.value,i.value);return s.valid?((O2(o)||O2(i))&&n.dirty(),{status:n.value,value:s.data}):(wt(r,{code:ct.invalid_intersection_types}),rn)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,i])=>a(o,i)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}pd.create=(e,t,n)=>new pd({left:e,right:t,typeName:an.ZodIntersection,...vn(n)});class Ei extends $n{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Rt.array)return wt(r,{code:ct.invalid_type,expected:Rt.array,received:r.parsedType}),rn;if(r.data.length<this._def.items.length)return wt(r,{code:ct.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),rn;!this._def.rest&&r.data.length>this._def.items.length&&(wt(r,{code:ct.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((i,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new Ko(r,i,r.path,s)):null}).filter(i=>!!i);return r.common.async?Promise.all(o).then(i=>sa.mergeArray(n,i)):sa.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Ei({...this._def,rest:t})}}Ei.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ei({items:e,typeName:an.ZodTuple,rest:null,...vn(t)})};class T2 extends $n{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Rt.map)return wt(r,{code:ct.invalid_type,expected:Rt.map,received:r.parsedType}),rn;const a=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([s,l],u)=>({key:a._parse(new Ko(r,s,r.path,[u,"key"])),value:o._parse(new Ko(r,l,r.path,[u,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of i){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return rn;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const l of i){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return rn;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}}}}T2.create=(e,t,n)=>new T2({valueType:t,keyType:e,typeName:an.ZodMap,...vn(n)});class su extends $n{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Rt.set)return wt(r,{code:ct.invalid_type,expected:Rt.set,received:r.parsedType}),rn;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(wt(r,{code:ct.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(wt(r,{code:ct.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const o=this._def.valueType;function i(l){const u=new Set;for(const c of l){if(c.status==="aborted")return rn;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const s=[...r.data.values()].map((l,u)=>o._parse(new Ko(r,l,r.path,u)));return r.common.async?Promise.all(s).then(l=>i(l)):i(s)}min(t,n){return new su({...this._def,minSize:{value:t,message:Tt.toString(n)}})}max(t,n){return new su({...this._def,maxSize:{value:t,message:Tt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}su.create=(e,t)=>new su({valueType:e,minSize:null,maxSize:null,typeName:an.ZodSet,...vn(t)});class B2 extends $n{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}B2.create=(e,t)=>new B2({getter:e,typeName:an.ZodLazy,...vn(t)});class F2 extends $n{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return wt(n,{received:n.data,code:ct.invalid_literal,expected:this._def.value}),rn}return{status:"valid",value:t.data}}get value(){return this._def.value}}F2.create=(e,t)=>new F2({value:e,typeName:an.ZodLiteral,...vn(t)});function k2(e,t){return new ys({values:e,typeName:an.ZodEnum,...vn(t)})}class ys extends $n{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return wt(n,{expected:En.joinValues(r),received:n.parsedType,code:ct.invalid_type}),rn}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return wt(n,{received:n.data,code:ct.invalid_enum_value,options:r}),rn}return ya(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return ys.create(t,{...this._def,...n})}exclude(t,n=this._def){return ys.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}ys.create=k2;class j2 extends $n{_parse(t){const n=En.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Rt.string&&r.parsedType!==Rt.number){const a=En.objectValues(n);return wt(r,{expected:En.joinValues(a),received:r.parsedType,code:ct.invalid_type}),rn}if(this._cache||(this._cache=new Set(En.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const a=En.objectValues(n);return wt(r,{received:r.data,code:ct.invalid_enum_value,options:a}),rn}return ya(t.data)}get enum(){return this._def.values}}j2.create=(e,t)=>new j2({values:e,typeName:an.ZodNativeEnum,...vn(t)});class hd extends $n{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Rt.promise&&n.common.async===!1)return wt(n,{code:ct.invalid_type,expected:Rt.promise,received:n.parsedType}),rn;const r=n.parsedType===Rt.promise?n.data:Promise.resolve(n.data);return ya(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}hd.create=(e,t)=>new hd({type:e,typeName:an.ZodPromise,...vn(t)});class Cs extends $n{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===an.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,o={addIssue:i=>{wt(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),a.type==="preprocess"){const i=a.transform(r.data,o);if(r.common.async)return Promise.resolve(i).then(async s=>{if(n.value==="aborted")return rn;const l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?rn:l.status==="dirty"||n.value==="dirty"?ou(l.value):l});{if(n.value==="aborted")return rn;const s=this._def.schema._parseSync({data:i,path:r.path,parent:r});return s.status==="aborted"?rn:s.status==="dirty"||n.value==="dirty"?ou(s.value):s}}if(a.type==="refinement"){const i=s=>{const l=a.refinement(s,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?rn:(s.status==="dirty"&&n.dirty(),i(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?rn:(s.status==="dirty"&&n.dirty(),i(s.value).then(()=>({status:n.value,value:s.value}))))}if(a.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ps(i))return rn;const s=a.transform(i.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>ps(i)?Promise.resolve(a.transform(i.value,o)).then(s=>({status:n.value,value:s})):rn);En.assertNever(a)}}Cs.create=(e,t,n)=>new Cs({schema:e,typeName:an.ZodEffects,effect:t,...vn(n)}),Cs.createWithPreprocess=(e,t,n)=>new Cs({schema:t,effect:{type:"preprocess",transform:e},typeName:an.ZodEffects,...vn(n)});class Go extends $n{_parse(t){return this._getType(t)===Rt.undefined?ya(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Go.create=(e,t)=>new Go({innerType:e,typeName:an.ZodOptional,...vn(t)});class $s extends $n{_parse(t){return this._getType(t)===Rt.null?ya(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}$s.create=(e,t)=>new $s({innerType:e,typeName:an.ZodNullable,...vn(t)});class ch extends $n{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Rt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ch.create=(e,t)=>new ch({innerType:e,typeName:an.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...vn(t)});class dh extends $n{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return vd(a)?a.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Io(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Io(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}dh.create=(e,t)=>new dh({innerType:e,typeName:an.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...vn(t)});class L2 extends $n{_parse(t){if(this._getType(t)!==Rt.nan){const r=this._getOrReturnCtx(t);return wt(r,{code:ct.invalid_type,expected:Rt.nan,received:r.parsedType}),rn}return{status:"valid",value:t.data}}}L2.create=e=>new L2({typeName:an.ZodNaN,...vn(e)});class ik extends $n{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class fh extends $n{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?rn:o.status==="dirty"?(n.dirty(),ou(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?rn:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(t,n){return new fh({in:t,out:n,typeName:an.ZodPipeline})}}class vh extends $n{_parse(t){const n=this._def.innerType._parse(t),r=a=>(ps(a)&&(a.value=Object.freeze(a.value)),a);return vd(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}vh.create=(e,t)=>new vh({innerType:e,typeName:an.ZodReadonly,...vn(t)});var an;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(an||(an={}));const hn=Uo.create,lu=hs.create,sk=sh.create,z2=lh.create;qo.create,ro.create;const Ca=Qn.create;gd.create,pd.create,Ei.create,ys.create,hd.create,Go.create,$s.create;const H2=Ca({statusCode:lu().optional(),message:hn().optional().nullable(),messages:hn().array().optional().nullable(),data:z2().optional().nullable(),error:Ca({statusCode:lu(),message:hn().optional().nullable(),messages:hn().array().optional().nullable()}).optional().nullable(),response:z2().optional().nullable()}),V2=Ca({id:hn(),profileId:hn(),phone:hn().optional().nullable(),email:hn().optional().nullable(),name:hn().optional().nullable(),surname:hn().optional().nullable(),roles:hn().array(),maxRolePriority:lu().optional().nullable(),isAllDomains:sk().optional().nullable(),domains:hn().array().optional().nullable(),tokens:Ca({accessToken:Ca({token:hn(),exp:lu()}),refreshToken:Ca({token:hn(),exp:lu()})})}),lk=Ca({tempFiles:hn().array()}),W2=Ca({altRU:hn().optional().nullable(),altEN:hn().optional().nullable(),altAR:hn().optional().nullable(),name:hn(),originalFileExtension:hn(),fileExtensions:hn().array().optional(),prefixes:hn().array().optional(),folder:hn().optional()}),mh=Ca({name:hn(),fullName:hn(),extension:hn(),entityId:hn().uuid(),fullPathExample:hn(),folder:hn().optional()}),uk=Ca({files:Ca({imageName:hn(),originalFileExtension:hn(),entityId:hn(),folder:hn().optional(),fullPathExample:hn(),fileExtensions:hn().array().optional(),prefixes:hn().array().optional()}).array()}),ck=Ca({files:mh.array()}),K2=({name:e,extension:t,entityId:n,prefixe:r,folder:a,bucketFolder:o,uploadUrl:i})=>`${i}/${o}/${n}${a?`/${a}`:""}/${e}-${r}.${t}`,U2=({fullName:e,entityId:t,folder:n,bucketFolder:r,uploadUrl:a})=>`${a}/${r}/${t}${n?`/${n}`:""}/${e}`,q2=(e,t)=>{try{return W2.parse(e),!0}catch(n){return t({error:n}),!1}},G2=(e,t)=>{try{return mh.parse(e),!0}catch(n){return t({error:n}),!1}},gh=(e,t)=>{const n=[...e];return n.sort(function(r,a){return t.indexOf(r.uid??"")-t.indexOf(a.uid??"")}),n},dk=(e,t,n,r)=>{if(!e)return{serverFiles:[],uploadFiles:[]};try{const a=JSON.parse(e);if(!Array.isArray(a))return{serverFiles:[],uploadFiles:[]};const o=a.map(s=>{if(!G2(s,r))return null;const l=U2({fullName:s.fullName,entityId:s.entityId,folder:s.folder,uploadUrl:n,bucketFolder:t});return{uid:l,url:l}}).filter(s=>!!s),i=o.map(s=>({uid:s.uid,name:s.url}));return{serverFiles:o,uploadFiles:i}}catch(a){return r({error:a}),{serverFiles:[],uploadFiles:[]}}},fk=(e,t,n,r)=>{if(!e)return{serverImages:[],uploadImages:[]};try{const a=JSON.parse(e);if(!Array.isArray(a))return{serverImages:[],uploadImages:[]};const o=a.map(s=>{if(!q2(s,r))return null;const l=Y2(s.prefixes??[],"1hd"),u=K2({name:s.name,extension:s.fileExtensions?s.fileExtensions[1]:s.originalFileExtension,entityId:s.entityId,folder:s.folder,prefixe:l??"",uploadUrl:n,bucketFolder:t});return{uid:u,url:u,altRU:s.altRU,altEN:s.altEN,altAR:s.altAR}}).filter(s=>!!s),i=o.map(s=>({uid:s.uid,name:s.url,altRU:s.altRU,altEN:s.altEN,altAR:s.altAR}));return{serverImages:o,uploadImages:i}}catch(a){return r({error:a}),{serverImages:[],uploadImages:[]}}},Y2=(e,t)=>{let n;switch(t){case"original":n=e[0];break;case"0.25hd":n=e[1];break;case"0.5hd":n=e[2];break;case"1hd":n=e[3];break;case"2hd":n=e[4];break;case"4hd":n=e[5];break}return n??"original"},vk=e=>{let t=e;if(t!=="+"&&Number.isNaN(Number(t))||t.length>13)return"";const n=t.split(""),r=n[0],a=n[1];return r==="7"||r==="8"?n[0]="+7":`${r}${a}`=="+8"?n[1]="7":r&&r!=="+"&&(n[0]=`+${r}`),t=n.join("").trim(),t},mk=e=>{const t=x2(e);return t!=null&&t.isValid()?t.number:""},Z2=e=>new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=a=>n(a)}),gk=e=>({images:[],updatedImages:[],onSetData:t=>e(()=>({images:t,updatedImages:t})),onUpdateData:t=>e(n=>{const r=[...n.images],a=r.findIndex(l=>l.uid===t.uid);if(a<0)return{images:[...r,t]};const{altRU:o,altEN:i,altAR:s}=r[a];return r[a]={...t,altRU:t.altRU||(o&&(o==null?void 0:o.length)>1?o:""),altEN:t.altEN||(i&&(i==null?void 0:i.length)>1?i:""),altAR:t.altAR||(s&&(s==null?void 0:s.length)>1?s:"")},{images:r}}),onDeleteImage:t=>e(n=>({images:n.images.filter(a=>a.uid!==t)})),onAllDelete:()=>e(()=>({images:[]}))}),pk=(e,t,n)=>e.map(r=>({label:r[t],value:r[n]})),hk=({newImages:e,serverImages:t,imagesOrder:n,imagesData:r,limit:a=10})=>{const o=[...t,...e].slice(0,a),i=gh(o,n),s=/-\d+x\d+/g,l=i.map(c=>{if(!c.tempName)return null;const f=r.find(v=>v.uid===c.uid&&!v.isError);return{tempName:c.tempName,altRU:f==null?void 0:f.altRU,altEN:f==null?void 0:f.altEN,altAR:f==null?void 0:f.altAR}}).filter(c=>c!==null),u=i.map(c=>{var g;const f=r.find(b=>b.uid===c.uid&&!b.isError);let v="";if(c.url){const b=c.url.split("/"),h=(g=b[b.length-1])==null?void 0:g.split(".");v=h[h.length-2]??"",v=v.replace(s,""),v=v.replace("-original","")}return{name:v??null,tempName:c.tempName??null,altRU:(f==null?void 0:f.altRU)||c.altRU,altEN:(f==null?void 0:f.altEN)||c.altEN,altAR:(f==null?void 0:f.altAR)||c.altAR}}).filter(c=>c!==null);return{tempImages:l,allImages:u}},bk=({newFiles:e,serverFiles:t,filesOrder:n,limit:r=10})=>{const a=[...e,...t].slice(0,r),o=gh(a,n),i=o.map(l=>l.tempName?{tempName:l.tempName}:null).filter(l=>l!==null),s=o.map(l=>{var c;let u="";if(l.url){const f=l.url.split("/"),v=(c=f[f.length-1])==null?void 0:c.split(".");u=v[v.length-2]??""}return{name:u??null,tempName:l.tempName??null}}).filter(l=>l!==null);return{tempFiles:i,allFiles:s}},ph=e=>{const t=/^(?:\w+:)?\/\/(\S+)$/,n=/^localhost[\\:?\d]*(?:[^\\:?\d]\S*)?$/,r=/^[^\s\\.]+\.\S{2,}$/;if(typeof e!="string")return!1;const a=e.match(t);if(!a)return!1;const o=a[1];return o?!!(n.test(o)||r.test(o)):!1},X2=e=>{const t=x2(e);return t!=null&&t.isValid()?t.formatInternational():""},yk=({fullName:e,phone:t,email:n})=>`${e||""}${t?`${e?",":""} ${X2(t)}`:""}${n?`${e||t?",":""} ${n}`:""}`,Q2=async({name:e,lang:t,langsList:n,value:r,translateText:a})=>{if(!r)return[];const o=[],i=[];return await Promise.all(n.map(s=>{if(s!==t)return i.push(s),a(r,t,s)})).then(s=>{s.filter(l=>!!l).forEach((l,u)=>{if((l==null?void 0:l.status)===BS.Ok){const c=i[u],f=`${e}${c.toUpperCase()}`;o.push({[f]:l.data.data.translatedText})}})}),o},Ck=async({data:e,mainLang:t,langsList:n,translateText:r})=>{const a=[];for(const o of e){const i=o[`alt${t.toUpperCase()}`];if(!i){a.push(o);continue}const s=await Q2({name:"alt",lang:t,langsList:n,value:String(i),translateText:r});let l={...o};s.map(u=>{Object.entries(u).map(([c,f])=>{l={...l,[c]:f}})}),a.push(l)}return a},$k=async({nodes:e,sourceLanguage:t,targetLanguage:n,translateText:r})=>{const o=(c=>{const f=[],v=[...c];for(;v.length>0;){const g=v.pop();g&&("text"in g&&g.text&&f.push(g.text),Array.isArray(g.children)&&v.push(...g.children))}return f})(e),i=o.map(c=>c?r(c,t,n):""),s=await Promise.all(i),l={};s.forEach((c,f)=>{if(!c){l[o[f]]="";return}c.status===200&&(l[o[f]]=c.data.data.translatedText)});const u=c=>c.map(f=>{const v={...f};return"text"in v&&v.text&&l[v.text]&&(v.text=l[v.text]),Array.isArray(v.children)&&(v.children=u(v.children)),v});return u(e)},J2=({userRoles:e,comparedUserRoles:t,rolePriority:n})=>{const r=e.reduce((o,i)=>{const s=n[i];return s!==void 0&&s>o?s:o},0),a=t.reduce((o,i)=>{const s=n[i];return s!==void 0&&s>o?s:o},0);return{maxUserRolePriority:r,maxComparedUserRolePriority:a,isPriorityHigher:r>a,isPriorityEqual:r===a,isPriorityLower:r<a}},Sk=(e,t)=>((t==null?void 0:t.label)??"").toLowerCase().indexOf(e.toLowerCase())>=0,hh=e=>{const t=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},wi=(e,t,n={})=>{n={path:"/",...n},n.expires instanceof Date&&(n.expires=n.expires.toUTCString());let r=encodeURIComponent(e)+"="+encodeURIComponent(t);for(const a in n){r+="; "+a;const o=n[a];o!==!0&&(r+="="+o)}document.cookie=r},ao=(e,t)=>{wi(e,"",{domain:t,"max-age":-1})},ex=async({baseURL:e,domain:t,isRefresh:n=!1,isNotSecure:r=!1,getError:a})=>{var m,p,y,C,$;const o=hh(dr.SESSION),i=hh(dr.SESSION_TEMP);if(!o&&!i)return"";let s=null;if(i?s=JSON.parse(i):o&&(s=JSON.parse(o)),!s)return"";try{V2.parse(s)}catch(S){return a({error:S}),i?ao(dr.SESSION_TEMP):o&&ao(dr.SESSION),""}const l=(m=s==null?void 0:s.tokens)==null?void 0:m.accessToken,u=(p=s==null?void 0:s.tokens)==null?void 0:p.refreshToken;if(n)return(u==null?void 0:u.token)??"";if(!(new Date().getTime()>=((l==null?void 0:l.exp)??0)-xi.milliseconds.minutes1))return l==null?void 0:l.token;let v=null;try{const S=qn.create({baseURL:e,adapter:"fetch"}),x=await ex({baseURL:e,domain:t,isRefresh:!0,getError:a});v=(y=(await S.post("/auth/v1/refresh",void 0,{headers:{Authorization:`Bearer ${x}`}})).data)==null?void 0:y.data}catch(S){return a({error:S}),""}if(!v)return"";try{H2.parse(v)}catch(S){return a({error:S}),i?ao(dr.SESSION_TEMP):o&&ao(dr.SESSION),""}const g=Vn(),h=Vn((u==null?void 0:u.exp)??0).diff(g,"seconds");return i?wi(dr.SESSION_TEMP,JSON.stringify(v),{domain:t,secure:!r,"max-age":h}):o&&wi(dr.SESSION,JSON.stringify(v),{domain:t,secure:!r,"max-age":h}),(($=(C=v.tokens)==null?void 0:C.accessToken)==null?void 0:$.token)??""},xk=(e,t)=>{const n=t.flat(),r=new Map;return n.forEach(a=>{!a[e]||r.has(a[e])||r.set(a[e],a)}),Array.from(r.values())},Ek=zM((e,t)=>({isLoading:!1,isFirstLoadCompleted:!1,currentSession:void 0,loadSession:async({domain:n,ROLE_PRIORITY:r,isNotSecure:a=!1,navigate:o,refresh:i})=>{var h,m,p,y,C,$,S,x,E,D;if(t().currentSession)return;ao(dr.SESSION_TEMP,n),e({isLoading:!0});const l=await i();if(l.status!==BS.Ok){e({currentSession:void 0,isLoading:!1,isFirstLoadCompleted:!0}),o({to:"/login"}),ao(dr.SESSION,n);return}const u=l.data.data;if(!u){e({currentSession:void 0,isLoading:!1,isFirstLoadCompleted:!0}),o({to:"/login"}),ao(dr.SESSION,n);return}const{maxUserRolePriority:c}=J2({userRoles:u.roles,comparedUserRoles:u.roles,rolePriority:r}),f={id:u.id,profileId:u.profileId,phone:u.phone,email:u.email,roles:u.roles,isAllDomains:u.isAllDomains||u.isAllCities,domains:u.domains||u.cities,maxRolePriority:c,tokens:{accessToken:{token:((m=(h=u.tokens)==null?void 0:h.accessToken)==null?void 0:m.token)??"",exp:((y=(p=u.tokens)==null?void 0:p.accessToken)==null?void 0:y.exp)??0},refreshToken:{token:(($=(C=u.tokens)==null?void 0:C.refreshToken)==null?void 0:$.token)??"",exp:((x=(S=u.tokens)==null?void 0:S.refreshToken)==null?void 0:x.exp)??0}}},v=Vn(),b=Vn(((D=(E=u.tokens)==null?void 0:E.refreshToken)==null?void 0:D.exp)??0).diff(v,"seconds");return wi(dr.SESSION,JSON.stringify(f),{domain:n,secure:!a,"max-age":b}),e({currentSession:f,isLoading:!1,isFirstLoadCompleted:!0}),f},setCurrentSession:({domain:n,session:r,isRemember:a,isNotSecure:o})=>{var u,c;e({currentSession:r});const i=Vn(),l=Vn(((c=(u=r.tokens)==null?void 0:u.refreshToken)==null?void 0:c.exp)??0).diff(i,"seconds");a?wi(dr.SESSION,JSON.stringify(r),{domain:n,secure:!o,"max-age":l}):wi(dr.SESSION_TEMP,JSON.stringify(r),{domain:n,secure:!o,"max-age":l})},removeSession:({domain:n,navigate:r})=>{e({currentSession:void 0}),ao(dr.SESSION,n),ao(dr.SESSION_TEMP,n),r({to:"/login"})}}));var tx=(e=>(e.russian="ru",e.english="en",e.arabic="ar",e))(tx||{}),nx=(e=>(e[e.January=1]="January",e[e.February=2]="February",e[e.March=3]="March",e[e.April=4]="April",e[e.May=5]="May",e[e.June=6]="June",e[e.July=7]="July",e[e.August=8]="August",e[e.September=9]="September",e[e.October=10]="October",e[e.November=11]="November",e[e.December=12]="December",e))(nx||{});const wk={container:"_container_j6rsl_1"},Ok=({children:e})=>Re.jsx("div",{className:wk.container,children:e});var bh={exports:{}};/*!
33
33
  Copyright (c) 2018 Jed Watson.
34
34
  Licensed under the MIT License (MIT), see
35
35
  http://jedwatson.github.io/classnames
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-D8o-Dvl8.cjs"),H=require("react"),oa=require("react-dom");function ra(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const s=ra(H);function sn(e){return e!=null&&e===e.window}const aa=e=>{var t,o;if(typeof window>"u")return 0;let n=0;return sn(e)?n=e.pageYOffset:e instanceof Document?n=e.documentElement.scrollTop:(e instanceof HTMLElement||e)&&(n=e.scrollTop),e&&!sn(e)&&typeof n!="number"&&(n=(o=((t=e.ownerDocument)!==null&&t!==void 0?t:e).documentElement)===null||o===void 0?void 0:o.scrollTop),n};function ia(e,t,o,n){const a=o-t;return e/=n/2,e<1?a/2*e*e*e+t:a/2*((e-=2)*e*e+2)+t}function la(e,t={}){const{getContainer:o=()=>window,callback:n,duration:a=450}=t,i=o(),d=aa(i),l=Date.now(),c=()=>{const p=Date.now()-l,g=ia(p>a?a:p,d,e,a);sn(i)?i.scrollTo(window.pageXOffset,g):i instanceof Document||i.constructor.name==="HTMLDocument"?i.documentElement.scrollTop=g:i.scrollTop=g,p<a?r.wrapperRaf(c):typeof n=="function"&&n()};r.wrapperRaf(c)}const sa=e=>typeof e!="object"&&typeof e!="function"||e===null;var da={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},ca=function(t,o){return s.createElement(r.Icon$1,r._extends({},t,{ref:o,icon:da}))},To=s.forwardRef(ca);process.env.NODE_ENV!=="production"&&(To.displayName="BarsOutlined");const ua=s.createContext({siderHook:{addSider:()=>null,removeSider:()=>null}}),fa=e=>{const{antCls:t,componentCls:o,colorText:n,footerBg:a,headerHeight:i,headerPadding:d,headerColor:l,footerPadding:c,fontSize:u,bodyBg:p,headerBg:g}=e;return{[o]:{display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:p,"&, *":{boxSizing:"border-box"},[`&${o}-has-sider`]:{flexDirection:"row",[`> ${o}, > ${o}-content`]:{width:0}},[`${o}-header, &${o}-footer`]:{flex:"0 0 auto"},"&-rtl":{direction:"rtl"}},[`${o}-header`]:{height:i,padding:d,color:l,lineHeight:r.unit(i),background:g,[`${t}-menu`]:{lineHeight:"inherit"}},[`${o}-footer`]:{padding:c,color:n,fontSize:u,background:a},[`${o}-content`]:{flex:"auto",color:n,minHeight:0}}},Do=e=>{const{colorBgLayout:t,controlHeight:o,controlHeightLG:n,colorText:a,controlHeightSM:i,marginXXS:d,colorTextLightSolid:l,colorBgContainer:c}=e,u=n*1.25;return{colorBgHeader:"#001529",colorBgBody:t,colorBgTrigger:"#002140",bodyBg:t,headerBg:"#001529",headerHeight:o*2,headerPadding:`0 ${u}px`,headerColor:a,footerPadding:`${i}px ${u}px`,footerBg:t,siderBg:"#001529",triggerHeight:n+d*2,triggerBg:"#002140",triggerColor:l,zeroTriggerWidth:n,zeroTriggerHeight:n,lightSiderBg:c,lightTriggerBg:c,lightTriggerColor:a}},Bo=[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]];r.genStyleHooks("Layout",e=>[fa(e)],Do,{deprecatedTokens:Bo});const pa=e=>{const{componentCls:t,siderBg:o,motionDurationMid:n,motionDurationSlow:a,antCls:i,triggerHeight:d,triggerColor:l,triggerBg:c,headerHeight:u,zeroTriggerWidth:p,zeroTriggerHeight:g,borderRadiusLG:m,lightSiderBg:f,lightTriggerColor:v,lightTriggerBg:C,bodyBg:h}=e;return{[t]:{position:"relative",minWidth:0,background:o,transition:`all ${n}, background 0s`,"&-has-trigger":{paddingBottom:d},"&-right":{order:1},[`${t}-children`]:{height:"100%",marginTop:-.1,paddingTop:.1,[`${i}-menu${i}-menu-inline-collapsed`]:{width:"auto"}},[`&-zero-width ${t}-children`]:{overflow:"hidden"},[`${t}-trigger`]:{position:"fixed",bottom:0,zIndex:1,height:d,color:l,lineHeight:r.unit(d),textAlign:"center",background:c,cursor:"pointer",transition:`all ${n}`},[`${t}-zero-width-trigger`]:{position:"absolute",top:u,insetInlineEnd:e.calc(p).mul(-1).equal(),zIndex:1,width:p,height:g,color:l,fontSize:e.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:o,borderRadius:`0 ${r.unit(m)} ${r.unit(m)} 0`,cursor:"pointer",transition:`background ${a} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${a}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:e.calc(p).mul(-1).equal(),borderRadius:`${r.unit(m)} 0 0 ${r.unit(m)}`}},"&-light":{background:f,[`${t}-trigger`]:{color:v,background:C},[`${t}-zero-width-trigger`]:{color:v,background:C,border:`1px solid ${h}`,borderInlineStart:0}}}}},ma=r.genStyleHooks(["Layout","Sider"],e=>[pa(e)],Do,{deprecatedTokens:Bo});var ga=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const Qn={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},va=e=>!Number.isNaN(Number.parseFloat(e))&&isFinite(e),xn=s.createContext({}),ha=(()=>{let e=0;return(t="")=>(e+=1,`${t}${e}`)})(),ba=s.forwardRef((e,t)=>{const{prefixCls:o,className:n,trigger:a,children:i,defaultCollapsed:d=!1,theme:l="dark",style:c={},collapsible:u=!1,reverseArrow:p=!1,width:g=200,collapsedWidth:m=80,zeroWidthTriggerStyle:f,breakpoint:v,onCollapse:C,onBreakpoint:h}=e,b=ga(e,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:S}=H.useContext(ua),[x,w]=H.useState("collapsed"in e?e.collapsed:d),[$,N]=H.useState(!1);H.useEffect(()=>{"collapsed"in e&&w(e.collapsed)},[e.collapsed]);const k=(X,de)=>{"collapsed"in e||w(X),C==null||C(X,de)},{getPrefixCls:_,direction:y}=H.useContext(r.ConfigContext),T=_("layout-sider",o),[R,O,P]=ma(T),I=H.useRef(null);I.current=X=>{N(X.matches),h==null||h(X.matches),x!==X.matches&&k(X.matches,"responsive")},H.useEffect(()=>{function X(he){var j;return(j=I.current)===null||j===void 0?void 0:j.call(I,he)}let de;return typeof(window==null?void 0:window.matchMedia)<"u"&&v&&v in Qn&&(de=window.matchMedia(`screen and (max-width: ${Qn[v]})`),r.addMediaQueryListener(de,X),X(de)),()=>{r.removeMediaQueryListener(de,X)}},[v]),H.useEffect(()=>{const X=ha("ant-sider-");return S.addSider(X),()=>S.removeSider(X)},[]);const E=()=>{k(!x,"clickTrigger")},D=r.omit(b,["collapsed"]),B=x?m:g,K=va(B)?`${B}px`:String(B),M=parseFloat(String(m||0))===0?s.createElement("span",{onClick:E,className:r.cn(`${T}-zero-width-trigger`,`${T}-zero-width-trigger-${p?"right":"left"}`),style:f},a||s.createElement(To,null)):null,A=y==="rtl"==!p,Y={expanded:A?s.createElement(r.RefIcon$2,null):s.createElement(r.RefIcon$1,null),collapsed:A?s.createElement(r.RefIcon$1,null):s.createElement(r.RefIcon$2,null)}[x?"collapsed":"expanded"],J=a!==null?M||s.createElement("div",{className:`${T}-trigger`,onClick:E,style:{width:K}},a||Y):null,oe=Object.assign(Object.assign({},c),{flex:`0 0 ${K}`,maxWidth:K,minWidth:K,width:K}),re=r.cn(T,`${T}-${l}`,{[`${T}-collapsed`]:!!x,[`${T}-has-trigger`]:u&&a!==null&&!M,[`${T}-below`]:!!$,[`${T}-zero-width`]:parseFloat(K)===0},n,O,P),Z=s.useMemo(()=>({siderCollapsed:x}),[x]);return R(s.createElement(xn.Provider,{value:Z},s.createElement("aside",Object.assign({className:re},D,{style:oe,ref:t}),s.createElement("div",{className:`${T}-children`},i),u||$&&M?J:null)))});process.env.NODE_ENV!=="production"&&(ba.displayName="Sider");const zt=H.createContext({prefixCls:"",firstLevel:!0,inlineCollapsed:!1});var ya=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const Ko=e=>{const{prefixCls:t,className:o,dashed:n}=e,a=ya(e,["prefixCls","className","dashed"]),{getPrefixCls:i}=s.useContext(r.ConfigContext),d=i("menu",t),l=r.cn({[`${d}-item-divider-dashed`]:!!n},o);return s.createElement(r.Divider,Object.assign({className:l},a))},Mo=e=>{var t;const{className:o,children:n,icon:a,title:i,danger:d,extra:l}=e,{prefixCls:c,firstLevel:u,direction:p,disableMenuItemTitleTooltip:g,inlineCollapsed:m}=s.useContext(zt),f=x=>{const w=n==null?void 0:n[0],$=s.createElement("span",{className:r.cn(`${c}-title-content`,{[`${c}-title-content-with-extra`]:!!l||l===0})},n);return(!a||s.isValidElement(n)&&n.type==="span")&&n&&x&&u&&typeof w=="string"?s.createElement("div",{className:`${c}-inline-collapsed-noicon`},w.charAt(0)):$},{siderCollapsed:v}=s.useContext(xn);let C=i;typeof i>"u"?C=u?n:"":i===!1&&(C="");const h={title:C};!v&&!m&&(h.title=null,h.open=!1);const b=r.toArray(n).length;let S=s.createElement(r.MenuItem,Object.assign({},r.omit(e,["title","icon","danger"]),{className:r.cn({[`${c}-item-danger`]:d,[`${c}-item-only-child`]:(a?b+1:b)===1},o),title:typeof i=="string"?i:void 0}),r.cloneElement(a,{className:r.cn(s.isValidElement(a)?(t=a.props)===null||t===void 0?void 0:t.className:"",`${c}-item-icon`)}),f(m));return g||(S=s.createElement(r.Tooltip,Object.assign({},h,{placement:p==="rtl"?"left":"right",classNames:{root:`${c}-inline-collapsed-tooltip`}}),S)),S};var Ca=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const jt=s.createContext(null),zo=s.forwardRef((e,t)=>{const{children:o}=e,n=Ca(e,["children"]),a=s.useContext(jt),i=s.useMemo(()=>Object.assign(Object.assign({},a),n),[a,n.prefixCls,n.mode,n.selectable,n.rootClassName]),d=r.supportNodeRef(o),l=r.useComposeRef(t,d?r.getNodeRef(o):null);return s.createElement(jt.Provider,{value:i},s.createElement(r.ContextIsolator,{space:!0},d?s.cloneElement(o,{ref:l}):o))}),xa=e=>{const{componentCls:t,motionDurationSlow:o,horizontalLineHeight:n,colorSplit:a,lineWidth:i,lineType:d,itemPaddingInline:l}=e;return{[`${t}-horizontal`]:{lineHeight:n,border:0,borderBottom:`${r.unit(i)} ${d} ${a}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${t}-item, ${t}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:l},[`> ${t}-item:hover,
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-BNZucDbs.cjs"),H=require("react"),oa=require("react-dom");function ra(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const s=ra(H);function sn(e){return e!=null&&e===e.window}const aa=e=>{var t,o;if(typeof window>"u")return 0;let n=0;return sn(e)?n=e.pageYOffset:e instanceof Document?n=e.documentElement.scrollTop:(e instanceof HTMLElement||e)&&(n=e.scrollTop),e&&!sn(e)&&typeof n!="number"&&(n=(o=((t=e.ownerDocument)!==null&&t!==void 0?t:e).documentElement)===null||o===void 0?void 0:o.scrollTop),n};function ia(e,t,o,n){const a=o-t;return e/=n/2,e<1?a/2*e*e*e+t:a/2*((e-=2)*e*e+2)+t}function la(e,t={}){const{getContainer:o=()=>window,callback:n,duration:a=450}=t,i=o(),d=aa(i),l=Date.now(),c=()=>{const p=Date.now()-l,g=ia(p>a?a:p,d,e,a);sn(i)?i.scrollTo(window.pageXOffset,g):i instanceof Document||i.constructor.name==="HTMLDocument"?i.documentElement.scrollTop=g:i.scrollTop=g,p<a?r.wrapperRaf(c):typeof n=="function"&&n()};r.wrapperRaf(c)}const sa=e=>typeof e!="object"&&typeof e!="function"||e===null;var da={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},ca=function(t,o){return s.createElement(r.Icon$1,r._extends({},t,{ref:o,icon:da}))},To=s.forwardRef(ca);process.env.NODE_ENV!=="production"&&(To.displayName="BarsOutlined");const ua=s.createContext({siderHook:{addSider:()=>null,removeSider:()=>null}}),fa=e=>{const{antCls:t,componentCls:o,colorText:n,footerBg:a,headerHeight:i,headerPadding:d,headerColor:l,footerPadding:c,fontSize:u,bodyBg:p,headerBg:g}=e;return{[o]:{display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:p,"&, *":{boxSizing:"border-box"},[`&${o}-has-sider`]:{flexDirection:"row",[`> ${o}, > ${o}-content`]:{width:0}},[`${o}-header, &${o}-footer`]:{flex:"0 0 auto"},"&-rtl":{direction:"rtl"}},[`${o}-header`]:{height:i,padding:d,color:l,lineHeight:r.unit(i),background:g,[`${t}-menu`]:{lineHeight:"inherit"}},[`${o}-footer`]:{padding:c,color:n,fontSize:u,background:a},[`${o}-content`]:{flex:"auto",color:n,minHeight:0}}},Do=e=>{const{colorBgLayout:t,controlHeight:o,controlHeightLG:n,colorText:a,controlHeightSM:i,marginXXS:d,colorTextLightSolid:l,colorBgContainer:c}=e,u=n*1.25;return{colorBgHeader:"#001529",colorBgBody:t,colorBgTrigger:"#002140",bodyBg:t,headerBg:"#001529",headerHeight:o*2,headerPadding:`0 ${u}px`,headerColor:a,footerPadding:`${i}px ${u}px`,footerBg:t,siderBg:"#001529",triggerHeight:n+d*2,triggerBg:"#002140",triggerColor:l,zeroTriggerWidth:n,zeroTriggerHeight:n,lightSiderBg:c,lightTriggerBg:c,lightTriggerColor:a}},Bo=[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]];r.genStyleHooks("Layout",e=>[fa(e)],Do,{deprecatedTokens:Bo});const pa=e=>{const{componentCls:t,siderBg:o,motionDurationMid:n,motionDurationSlow:a,antCls:i,triggerHeight:d,triggerColor:l,triggerBg:c,headerHeight:u,zeroTriggerWidth:p,zeroTriggerHeight:g,borderRadiusLG:m,lightSiderBg:f,lightTriggerColor:v,lightTriggerBg:C,bodyBg:h}=e;return{[t]:{position:"relative",minWidth:0,background:o,transition:`all ${n}, background 0s`,"&-has-trigger":{paddingBottom:d},"&-right":{order:1},[`${t}-children`]:{height:"100%",marginTop:-.1,paddingTop:.1,[`${i}-menu${i}-menu-inline-collapsed`]:{width:"auto"}},[`&-zero-width ${t}-children`]:{overflow:"hidden"},[`${t}-trigger`]:{position:"fixed",bottom:0,zIndex:1,height:d,color:l,lineHeight:r.unit(d),textAlign:"center",background:c,cursor:"pointer",transition:`all ${n}`},[`${t}-zero-width-trigger`]:{position:"absolute",top:u,insetInlineEnd:e.calc(p).mul(-1).equal(),zIndex:1,width:p,height:g,color:l,fontSize:e.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:o,borderRadius:`0 ${r.unit(m)} ${r.unit(m)} 0`,cursor:"pointer",transition:`background ${a} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${a}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:e.calc(p).mul(-1).equal(),borderRadius:`${r.unit(m)} 0 0 ${r.unit(m)}`}},"&-light":{background:f,[`${t}-trigger`]:{color:v,background:C},[`${t}-zero-width-trigger`]:{color:v,background:C,border:`1px solid ${h}`,borderInlineStart:0}}}}},ma=r.genStyleHooks(["Layout","Sider"],e=>[pa(e)],Do,{deprecatedTokens:Bo});var ga=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const Qn={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},va=e=>!Number.isNaN(Number.parseFloat(e))&&isFinite(e),xn=s.createContext({}),ha=(()=>{let e=0;return(t="")=>(e+=1,`${t}${e}`)})(),ba=s.forwardRef((e,t)=>{const{prefixCls:o,className:n,trigger:a,children:i,defaultCollapsed:d=!1,theme:l="dark",style:c={},collapsible:u=!1,reverseArrow:p=!1,width:g=200,collapsedWidth:m=80,zeroWidthTriggerStyle:f,breakpoint:v,onCollapse:C,onBreakpoint:h}=e,b=ga(e,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:S}=H.useContext(ua),[x,w]=H.useState("collapsed"in e?e.collapsed:d),[$,N]=H.useState(!1);H.useEffect(()=>{"collapsed"in e&&w(e.collapsed)},[e.collapsed]);const k=(X,de)=>{"collapsed"in e||w(X),C==null||C(X,de)},{getPrefixCls:_,direction:y}=H.useContext(r.ConfigContext),T=_("layout-sider",o),[R,O,P]=ma(T),I=H.useRef(null);I.current=X=>{N(X.matches),h==null||h(X.matches),x!==X.matches&&k(X.matches,"responsive")},H.useEffect(()=>{function X(he){var j;return(j=I.current)===null||j===void 0?void 0:j.call(I,he)}let de;return typeof(window==null?void 0:window.matchMedia)<"u"&&v&&v in Qn&&(de=window.matchMedia(`screen and (max-width: ${Qn[v]})`),r.addMediaQueryListener(de,X),X(de)),()=>{r.removeMediaQueryListener(de,X)}},[v]),H.useEffect(()=>{const X=ha("ant-sider-");return S.addSider(X),()=>S.removeSider(X)},[]);const E=()=>{k(!x,"clickTrigger")},D=r.omit(b,["collapsed"]),B=x?m:g,K=va(B)?`${B}px`:String(B),M=parseFloat(String(m||0))===0?s.createElement("span",{onClick:E,className:r.cn(`${T}-zero-width-trigger`,`${T}-zero-width-trigger-${p?"right":"left"}`),style:f},a||s.createElement(To,null)):null,A=y==="rtl"==!p,Y={expanded:A?s.createElement(r.RefIcon$2,null):s.createElement(r.RefIcon$1,null),collapsed:A?s.createElement(r.RefIcon$1,null):s.createElement(r.RefIcon$2,null)}[x?"collapsed":"expanded"],J=a!==null?M||s.createElement("div",{className:`${T}-trigger`,onClick:E,style:{width:K}},a||Y):null,oe=Object.assign(Object.assign({},c),{flex:`0 0 ${K}`,maxWidth:K,minWidth:K,width:K}),re=r.cn(T,`${T}-${l}`,{[`${T}-collapsed`]:!!x,[`${T}-has-trigger`]:u&&a!==null&&!M,[`${T}-below`]:!!$,[`${T}-zero-width`]:parseFloat(K)===0},n,O,P),Z=s.useMemo(()=>({siderCollapsed:x}),[x]);return R(s.createElement(xn.Provider,{value:Z},s.createElement("aside",Object.assign({className:re},D,{style:oe,ref:t}),s.createElement("div",{className:`${T}-children`},i),u||$&&M?J:null)))});process.env.NODE_ENV!=="production"&&(ba.displayName="Sider");const zt=H.createContext({prefixCls:"",firstLevel:!0,inlineCollapsed:!1});var ya=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const Ko=e=>{const{prefixCls:t,className:o,dashed:n}=e,a=ya(e,["prefixCls","className","dashed"]),{getPrefixCls:i}=s.useContext(r.ConfigContext),d=i("menu",t),l=r.cn({[`${d}-item-divider-dashed`]:!!n},o);return s.createElement(r.Divider,Object.assign({className:l},a))},Mo=e=>{var t;const{className:o,children:n,icon:a,title:i,danger:d,extra:l}=e,{prefixCls:c,firstLevel:u,direction:p,disableMenuItemTitleTooltip:g,inlineCollapsed:m}=s.useContext(zt),f=x=>{const w=n==null?void 0:n[0],$=s.createElement("span",{className:r.cn(`${c}-title-content`,{[`${c}-title-content-with-extra`]:!!l||l===0})},n);return(!a||s.isValidElement(n)&&n.type==="span")&&n&&x&&u&&typeof w=="string"?s.createElement("div",{className:`${c}-inline-collapsed-noicon`},w.charAt(0)):$},{siderCollapsed:v}=s.useContext(xn);let C=i;typeof i>"u"?C=u?n:"":i===!1&&(C="");const h={title:C};!v&&!m&&(h.title=null,h.open=!1);const b=r.toArray(n).length;let S=s.createElement(r.MenuItem,Object.assign({},r.omit(e,["title","icon","danger"]),{className:r.cn({[`${c}-item-danger`]:d,[`${c}-item-only-child`]:(a?b+1:b)===1},o),title:typeof i=="string"?i:void 0}),r.cloneElement(a,{className:r.cn(s.isValidElement(a)?(t=a.props)===null||t===void 0?void 0:t.className:"",`${c}-item-icon`)}),f(m));return g||(S=s.createElement(r.Tooltip,Object.assign({},h,{placement:p==="rtl"?"left":"right",classNames:{root:`${c}-inline-collapsed-tooltip`}}),S)),S};var Ca=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]]);return o};const jt=s.createContext(null),zo=s.forwardRef((e,t)=>{const{children:o}=e,n=Ca(e,["children"]),a=s.useContext(jt),i=s.useMemo(()=>Object.assign(Object.assign({},a),n),[a,n.prefixCls,n.mode,n.selectable,n.rootClassName]),d=r.supportNodeRef(o),l=r.useComposeRef(t,d?r.getNodeRef(o):null);return s.createElement(jt.Provider,{value:i},s.createElement(r.ContextIsolator,{space:!0},d?s.cloneElement(o,{ref:l}):o))}),xa=e=>{const{componentCls:t,motionDurationSlow:o,horizontalLineHeight:n,colorSplit:a,lineWidth:i,lineType:d,itemPaddingInline:l}=e;return{[`${t}-horizontal`]:{lineHeight:n,border:0,borderBottom:`${r.unit(i)} ${d} ${a}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${t}-item, ${t}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:l},[`> ${t}-item:hover,
2
2
  > ${t}-item-active,
3
3
  > ${t}-submenu ${t}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${t}-item, ${t}-submenu-title`]:{transition:[`border-color ${o}`,`background ${o}`].join(",")},[`${t}-submenu-arrow`]:{display:"none"}}}},Sa=({componentCls:e,menuArrowOffset:t,calc:o})=>({[`${e}-rtl`]:{direction:"rtl"},[`${e}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${e}-rtl${e}-vertical,
4
4
  ${e}-submenu-rtl ${e}-vertical`]:{[`${e}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(${r.unit(o(t).mul(-1).equal())})`},"&::after":{transform:`rotate(45deg) translateY(${r.unit(t)})`}}}}),Jn=e=>Object.assign({},r.genFocusOutline(e)),eo=(e,t)=>{const{componentCls:o,itemColor:n,itemSelectedColor:a,subMenuItemSelectedColor:i,groupTitleColor:d,itemBg:l,subMenuItemBg:c,itemSelectedBg:u,activeBarHeight:p,activeBarWidth:g,activeBarBorderWidth:m,motionDurationSlow:f,motionEaseInOut:v,motionEaseOut:C,itemPaddingInline:h,motionDurationMid:b,itemHoverColor:S,lineType:x,colorSplit:w,itemDisabledColor:$,dangerItemColor:N,dangerItemHoverColor:k,dangerItemSelectedColor:_,dangerItemActiveBg:y,dangerItemSelectedBg:T,popupBg:R,itemHoverBg:O,itemActiveBg:P,menuSubMenuBg:I,horizontalItemSelectedColor:E,horizontalItemSelectedBg:D,horizontalItemBorderRadius:B,horizontalItemHoverBg:K}=e;return{[`${o}-${t}, ${o}-${t} > ${o}`]:{color:n,background:l,[`&${o}-root:focus-visible`]:Object.assign({},Jn(e)),[`${o}-item`]:{"&-group-title, &-extra":{color:d}},[`${o}-submenu-selected > ${o}-submenu-title`]:{color:i},[`${o}-item, ${o}-submenu-title`]:{color:n,[`&:not(${o}-item-disabled):focus-visible`]:Object.assign({},Jn(e))},[`${o}-item-disabled, ${o}-submenu-disabled`]:{color:`${$} !important`},[`${o}-item:not(${o}-item-selected):not(${o}-submenu-selected)`]:{[`&:hover, > ${o}-submenu-title:hover`]:{color:S}},[`&:not(${o}-horizontal)`]:{[`${o}-item:not(${o}-item-selected)`]:{"&:hover":{backgroundColor:O},"&:active":{backgroundColor:P}},[`${o}-submenu-title`]:{"&:hover":{backgroundColor:O},"&:active":{backgroundColor:P}}},[`${o}-item-danger`]:{color:N,[`&${o}-item:hover`]:{[`&:not(${o}-item-selected):not(${o}-submenu-selected)`]:{color:k}},[`&${o}-item:active`]:{background:y}},[`${o}-item a`]:{"&, &:hover":{color:"inherit"}},[`${o}-item-selected`]:{color:a,[`&${o}-item-danger`]:{color:_},"a, a:hover":{color:"inherit"}},[`& ${o}-item-selected`]:{backgroundColor:u,[`&${o}-item-danger`]:{backgroundColor:T}},[`&${o}-submenu > ${o}`]:{backgroundColor:I},[`&${o}-popup > ${o}`]:{backgroundColor:R},[`&${o}-submenu-popup > ${o}`]:{backgroundColor:R},[`&${o}-horizontal`]:Object.assign(Object.assign({},t==="dark"?{borderBottom:0}:{}),{[`> ${o}-item, > ${o}-submenu`]:{top:m,marginTop:e.calc(m).mul(-1).equal(),marginBottom:0,borderRadius:B,"&::after":{position:"absolute",insetInline:h,bottom:0,borderBottom:`${r.unit(p)} solid transparent`,transition:`border-color ${f} ${v}`,content:'""'},"&:hover, &-active, &-open":{background:K,"&::after":{borderBottomWidth:p,borderBottomColor:E}},"&-selected":{color:E,backgroundColor:D,"&:hover":{backgroundColor:D},"&::after":{borderBottomWidth:p,borderBottomColor:E}}}}),[`&${o}-root`]:{[`&${o}-inline, &${o}-vertical`]:{borderInlineEnd:`${r.unit(m)} ${x} ${w}`}},[`&${o}-inline`]:{[`${o}-sub${o}-inline`]:{background:c},[`${o}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${r.unit(g)} solid ${a}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${b} ${C}`,`opacity ${b} ${C}`].join(","),content:'""'},[`&${o}-item-danger`]:{"&::after":{borderInlineEndColor:_}}},[`${o}-selected, ${o}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${b} ${v}`,`opacity ${b} ${v}`].join(",")}}}}}},to=e=>{const{componentCls:t,itemHeight:o,itemMarginInline:n,padding:a,menuArrowSize:i,marginXS:d,itemMarginBlock:l,itemWidth:c,itemPaddingInline:u}=e,p=e.calc(i).add(a).add(d).equal();return{[`${t}-item`]:{position:"relative",overflow:"hidden"},[`${t}-item, ${t}-submenu-title`]:{height:o,lineHeight:r.unit(o),paddingInline:u,overflow:"hidden",textOverflow:"ellipsis",marginInline:n,marginBlock:l,width:c},[`> ${t}-item,