@qubit-ltd/common-decorator 3.10.8 → 3.10.9

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";var t,r,o=require("@babel/runtime/helpers/typeof"),i=require("@babel/runtime/helpers/defineProperty"),a=require("@qubit-ltd/clone"),c=require("@qubit-ltd/common-util"),u=require("@qubit-ltd/type-detect"),l=require("@babel/runtime/helpers/slicedToArray"),p=require("@qubit-ltd/typeinfo"),d=require("@babel/runtime/helpers/classCallCheck"),h=require("@babel/runtime/helpers/createClass"),y=require("@qubit-ltd/naming-style"),m=require("@qubit-ltd/json"),g=require("url"),b="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},v={},w={};function requireGlobalThis(){if(r)return t;r=1;var check=function(t){return t&&t.Math===Math&&t};return t=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof b&&b)||check("object"==typeof t&&t)||function(){return this}()||Function("return this")()}var I,S,O,P,E,j,q,T,N,R,U,C,_,A,D,L,$,k,x,z,M,V,H,W,K,J,G,B,Q,Z,Y,X,ee,te={exports:{}};function requireDefineGlobalProperty(){if(P)return O;P=1;var t=requireGlobalThis(),r=Object.defineProperty;return O=function(o,i){try{r(t,o,{value:i,configurable:!0,writable:!0})}catch(r){t[o]=i}return i}}function requireSharedStore(){if(E)return te.exports;E=1;var t=function requireIsPure(){return S?I:(S=1,I=!1)}(),r=requireGlobalThis(),o=requireDefineGlobalProperty(),i="__core-js_shared__",a=te.exports=r[i]||o(i,{});return(a.versions||(a.versions=[])).push({version:"3.45.1",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.45.1/LICENSE",source:"https://github.com/zloirock/core-js"}),te.exports}function requireShared(){if(q)return j;q=1;var t=requireSharedStore();return j=function(r,o){return t[r]||(t[r]=o||{})}}function requireFails(){return N?T:(N=1,T=function(t){try{return!!t()}catch(t){return!0}})}function requireFunctionBindNative(){if(U)return R;U=1;var t=requireFails();return R=!t((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))}function requireFunctionUncurryThis(){if(_)return C;_=1;var t=requireFunctionBindNative(),r=Function.prototype,o=r.call,i=t&&r.bind.bind(o,o);return C=t?i:function(t){return function(){return o.apply(t,arguments)}},C}function requireIsNullOrUndefined(){return D?A:(D=1,A=function(t){return null==t})}function requireRequireObjectCoercible(){if($)return L;$=1;var t=requireIsNullOrUndefined(),r=TypeError;return L=function(o){if(t(o))throw new r("Can't call method on "+o);return o}}function requireToObject(){if(x)return k;x=1;var t=requireRequireObjectCoercible(),r=Object;return k=function(o){return r(t(o))}}function requireHasOwnProperty(){if(M)return z;M=1;var t=requireFunctionUncurryThis(),r=requireToObject(),o=t({}.hasOwnProperty);return z=Object.hasOwn||function hasOwn(t,i){return o(r(t),i)}}function requireUid(){if(H)return V;H=1;var t=requireFunctionUncurryThis(),r=0,o=Math.random(),i=t(1.1.toString);return V=function(t){return"Symbol("+(void 0===t?"":t)+")_"+i(++r+o,36)}}function requireEnvironmentV8Version(){if(G)return J;G=1;var t,r,o=requireGlobalThis(),i=function requireEnvironmentUserAgent(){if(K)return W;K=1;var t=requireGlobalThis().navigator,r=t&&t.userAgent;return W=r?String(r):""}(),a=o.process,c=o.Deno,u=a&&a.versions||c&&c.version,l=u&&u.v8;return l&&(r=(t=l.split("."))[0]>0&&t[0]<4?1:+(t[0]+t[1])),!r&&i&&(!(t=i.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=i.match(/Chrome\/(\d+)/))&&(r=+t[1]),J=r}function requireSymbolConstructorDetection(){if(Q)return B;Q=1;var t=requireEnvironmentV8Version(),r=requireFails(),o=requireGlobalThis().String;return B=!!Object.getOwnPropertySymbols&&!r((function(){var r=Symbol("symbol detection");return!o(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&t&&t<41}))}function requireUseSymbolAsUid(){if(Y)return Z;Y=1;var t=requireSymbolConstructorDetection();return Z=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function requireWellKnownSymbol(){if(ee)return X;ee=1;var t=requireGlobalThis(),r=requireShared(),o=requireHasOwnProperty(),i=requireUid(),a=requireSymbolConstructorDetection(),c=requireUseSymbolAsUid(),u=t.Symbol,l=r("wks"),p=c?u.for||u:u&&u.withoutSetter||i;return X=function(t){return o(l,t)||(l[t]=a&&o(u,t)?u[t]:p("Symbol."+t)),l[t]}}var re,ne,oe,ie,ae,ce,ue,se,le,fe,pe,de,he,ye,me,ge,be,ve,we,Ie,Se,Oe,Pe,Ee,je,qe,Te,Ne,Re,Ue,Ce,_e,Fe,Ae,De,Le,$e={};function requireDescriptors(){if(ne)return re;ne=1;var t=requireFails();return re=!t((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function requireIsCallable(){if(ie)return oe;ie=1;var t="object"==typeof document&&document.all;return oe=void 0===t&&void 0!==t?function(r){return"function"==typeof r||r===t}:function(t){return"function"==typeof t}}function requireIsObject(){if(ce)return ae;ce=1;var t=requireIsCallable();return ae=function(r){return"object"==typeof r?null!==r:t(r)}}function requireIe8DomDefine(){if(fe)return le;fe=1;var t=requireDescriptors(),r=requireFails(),o=function requireDocumentCreateElement(){if(se)return ue;se=1;var t=requireGlobalThis(),r=requireIsObject(),o=t.document,i=r(o)&&r(o.createElement);return ue=function(t){return i?o.createElement(t):{}}}();return le=!t&&!r((function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))}function requireAnObject(){if(ye)return he;ye=1;var t=requireIsObject(),r=String,o=TypeError;return he=function(i){if(t(i))return i;throw new o(r(i)+" is not an object")}}function requireFunctionCall(){if(ge)return me;ge=1;var t=requireFunctionBindNative(),r=Function.prototype.call;return me=t?r.bind(r):function(){return r.apply(r,arguments)},me}function requireGetBuiltIn(){if(ve)return be;ve=1;var t=requireGlobalThis(),r=requireIsCallable();return be=function(o,i){return arguments.length<2?(a=t[o],r(a)?a:void 0):t[o]&&t[o][i];var a},be}function requireIsSymbol(){if(Oe)return Se;Oe=1;var t=requireGetBuiltIn(),r=requireIsCallable(),o=function requireObjectIsPrototypeOf(){if(Ie)return we;Ie=1;var t=requireFunctionUncurryThis();return we=t({}.isPrototypeOf)}(),i=requireUseSymbolAsUid(),a=Object;return Se=i?function(t){return"symbol"==typeof t}:function(i){var c=t("Symbol");return r(c)&&o(c.prototype,a(i))}}function requireTryToString(){if(Ee)return Pe;Ee=1;var t=String;return Pe=function(r){try{return t(r)}catch(t){return"Object"}}}function requireACallable(){if(qe)return je;qe=1;var t=requireIsCallable(),r=requireTryToString(),o=TypeError;return je=function(i){if(t(i))return i;throw new o(r(i)+" is not a function")}}function requireGetMethod(){if(Ne)return Te;Ne=1;var t=requireACallable(),r=requireIsNullOrUndefined();return Te=function(o,i){var a=o[i];return r(a)?void 0:t(a)},Te}function requireOrdinaryToPrimitive(){if(Ue)return Re;Ue=1;var t=requireFunctionCall(),r=requireIsCallable(),o=requireIsObject(),i=TypeError;return Re=function(a,c){var u,l;if("string"===c&&r(u=a.toString)&&!o(l=t(u,a)))return l;if(r(u=a.valueOf)&&!o(l=t(u,a)))return l;if("string"!==c&&r(u=a.toString)&&!o(l=t(u,a)))return l;throw new i("Can't convert object to primitive value")}}function requireToPrimitive(){if(_e)return Ce;_e=1;var t=requireFunctionCall(),r=requireIsObject(),o=requireIsSymbol(),i=requireGetMethod(),a=requireOrdinaryToPrimitive(),c=requireWellKnownSymbol(),u=TypeError,l=c("toPrimitive");return Ce=function(c,p){if(!r(c)||o(c))return c;var d,h=i(c,l);if(h){if(void 0===p&&(p="default"),d=t(h,c,p),!r(d)||o(d))return d;throw new u("Can't convert object to primitive value")}return void 0===p&&(p="number"),a(c,p)}}function requireToPropertyKey(){if(Ae)return Fe;Ae=1;var t=requireToPrimitive(),r=requireIsSymbol();return Fe=function(o){var i=t(o,"string");return r(i)?i:i+""}}function requireObjectDefineProperty(){if(De)return $e;De=1;var t=requireDescriptors(),r=requireIe8DomDefine(),o=function requireV8PrototypeDefineBug(){if(de)return pe;de=1;var t=requireDescriptors(),r=requireFails();return pe=t&&r((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))}(),i=requireAnObject(),a=requireToPropertyKey(),c=TypeError,u=Object.defineProperty,l=Object.getOwnPropertyDescriptor,p="enumerable",d="configurable",h="writable";return $e.f=t?o?function defineProperty(t,r,o){if(i(t),r=a(r),i(o),"function"==typeof t&&"prototype"===r&&"value"in o&&h in o&&!o[h]){var c=l(t,r);c&&c[h]&&(t[r]=o.value,o={configurable:d in o?o[d]:c[d],enumerable:p in o?o[p]:c[p],writable:!1})}return u(t,r,o)}:u:function defineProperty(t,o,l){if(i(t),o=a(o),i(l),r)try{return u(t,o,l)}catch(t){}if("get"in l||"set"in l)throw new c("Accessors not supported");return"value"in l&&(t[o]=l.value),t},$e}var ke,xe,ze={};function requirePath(){if(xe)return ke;xe=1;var t=requireGlobalThis();return ke=t}var Me,Ve,He,We,Ke,Je={};function requireWellKnownSymbolDefine(){if(He)return Ve;He=1;var t=requirePath(),r=requireHasOwnProperty(),o=function requireWellKnownSymbolWrapped(){if(Me)return Je;Me=1;var t=requireWellKnownSymbol();return Je.f=t,Je}(),i=requireObjectDefineProperty().f;return Ve=function(a){var c=t.Symbol||(t.Symbol={});r(c,a)||i(c,a,{value:o.f(a)})}}!function requireDecoratorMetadataV2(){return Ke||(Ke=1,function requireEsnext_function_metadata(){if(Le)return w;Le=1;var t=requireWellKnownSymbol(),r=requireObjectDefineProperty().f,o=t("metadata"),i=Function.prototype;return void 0===i[o]&&r(i,o,{value:null}),w}(),function requireEsnext_symbol_metadata(){return We||(We=1,requireWellKnownSymbolDefine()("metadata")),ze}()),v}();var Ge="__cd_category__",Be="__cd_default_instance__",Qe="__cd_next_id__",Ze="__cd_name_field__",Ye="__cd_fields_metadata__",Xe="__type__",et="__element_type__",tt="__nullable__",rt="__empty__",nt="__label__",ot="__normalizer__",it="__validator__",at=new WeakMap,ct=function get(t){var r=at.get(t);if(r)return r;var o=t[Symbol.metadata];return o?(at.set(t,o),o):{}},ut=function set(t,r){at.set(t,r)};function getClassMetadata(t,r){if("function"!=typeof t)throw new TypeError("The first argument must be a class constructor.");var o=ct(t);if(o)return o[r]}function isEnumClass(t){return"function"==typeof t&&"enum"===getClassMetadata(t,Ge)}function enumNormalizer(t){if(!isEnumClass(t))throw new TypeError("The argument must be the constructor function of an enumeration class decorated by `@Enum`.");return function(r){return t.of(r)}}function defaultNormalizer(t){var r,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};null!=i||(i={}),null!==(o=(r=i).path)&&void 0!==o||(r.path="");var a=p(t);switch(a.category){case"string":return isEnumClass(i.type)?enumNormalizer(i.type)(t):t.trim();case"array":case"typed-array":return t.map((function(t){return defaultNormalizer(t)}));case"map":return new Map(Array.from(t,(function(t){var r=l(t,2);return[r[0],defaultNormalizer(r[1],i)]})));case"set":return new Set(Array.from(t,(function(t){return defaultNormalizer(t,i)})));default:if(a.isBuiltIn)return t;if("function"==typeof t.normalize){var c={path:i.path,types:i.types,elementTypes:i.elementTypes};t.normalize("*",c)}return t}}var st=h((function DefaultAssignmentOptions(){d(this,DefaultAssignmentOptions),i(this,"normalize",!0),i(this,"convertNaming",!1),i(this,"sourceNamingStyle","LOWER_UNDERSCORE"),i(this,"targetNamingStyle","LOWER_CAMEL"),i(this,"types",{}),i(this,"elementTypes",{})})),lt=h((function DefaultToJsonOptions(){d(this,DefaultToJsonOptions),i(this,"normalize",!0),i(this,"removeEmptyFields",!1),i(this,"convertNaming",!1),i(this,"sourceNamingStyle","LOWER_CAMEL"),i(this,"targetNamingStyle","LOWER_UNDERSCORE"),i(this,"space",void 0)}));function ownKeys$5(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),o.push.apply(o,i)}return o}function _objectSpread$5(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys$5(Object(o),!0).forEach((function(r){i(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys$5(Object(o)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))}))}return t}var ft=new Map,pt=function(){return h((function DefaultOptions(){d(this,DefaultOptions)}),null,[{key:"get",value:function get(t){var r=ft.get(t);return r?a(r):void 0}},{key:"merge",value:function merge(t,r){var o=ft.get(t);return a(void 0===o?r:_objectSpread$5(_objectSpread$5({},o),r))}},{key:"set",value:function set(t,r){var o=a(r),i=ft.get(t);void 0===i?ft.set(t,o):ft.set(t,_objectSpread$5(_objectSpread$5({},i),o))}},{key:"reset",value:function reset(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(t)switch(t){case"assign":ft.set("assign",new st);break;case"toJSON":ft.set("toJSON",new lt);break;default:throw new Error("Unknown aspect: ".concat(t))}else ft.set("assign",new st),ft.set("toJSON",new lt)}}])}();function ofValueImpl(t,r){if(u.isString(r)){var o=t[String(r).trim().toUpperCase()];return o instanceof t?o:void 0}}function getDefaultInstance(t){if(t.prototype===Object.prototype)return{};var r=ct(t),o=r[Be];return o instanceof t||(o=new t,r[Be]=o),o}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o={}.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}(t))||r){o&&(t=o);var i=0,a=function F(){};return{s:a,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,u=!0,l=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();return u=t.done,t},e:function e(t){l=!0,c=t},f:function f(){try{u||null==o.return||o.return()}finally{if(l)throw c}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,i=Array(r);o<r;o++)i[o]=t[o];return i}function getFieldMetadataObject(t,r){var o,i;if(null!=t){null!==(o=t[Ye])&&void 0!==o||(t[Ye]={});var a=t[Ye];return null!==(i=a[r])&&void 0!==i||(a[r]={}),a[r]}}function getFieldMetadata(t,r,o){var i=getFieldMetadataObject(t,r);return i?i[o]:void 0}function getFieldElementType(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};null!=o||(o=".".concat(r)),null!=i||(i={});var a=getFieldMetadata(ct(t),r,et);if(a){if("function"!=typeof a)throw new TypeError("The annotated element type of '".concat(t.name,".").concat(o,"' is not a function."));return a}if(i&&i.elementTypes&&i.elementTypes[o]){var c=i.elementTypes[o];if("function"!=typeof c)throw new TypeError("The target element type of '".concat(t.name,".").concat(o,"' is not a function."));return c}var l=getDefaultInstance(t)[r];if(null!=l){var p=function getCollectionElementType(t){var r;if(Array.isArray(t)||u.isTypedArray(t)){if(t.length>0&&"function"==typeof(null===(r=t[0])||void 0===r?void 0:r.constructor))return t[0].constructor}else if(u.isCollection(t)&&t.size>0){var o=t.values().next().value;if(o&&"function"==typeof o.constructor)return o.constructor}return null}(l);if(null!=p)return p}return null}function getFieldType(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};null!=o||(o=".".concat(r)),null!=i||(i={});var a=getFieldMetadata(ct(t),r,Xe);if(a){if("function"!=typeof a)throw new TypeError("The annotated type of '".concat(t.name,".").concat(o,"' is not a function."));return a}if(i&&i.types&&i.types[o]){var c=i.types[o];if("function"!=typeof c)throw new TypeError("The target type of '".concat(t.name,".").concat(o,"' is not a function."));return c}var u=getDefaultInstance(t)[r];if(null!=u&&"function"==typeof u.constructor)return u.constructor}function getSourceField(t,r){if(!0===(null==r?void 0:r.convertNaming)){var o=y.NamingStyle.of(r.sourceNamingStyle);return y.NamingStyle.of(r.targetNamingStyle).to(o,t)}return t}function hasPrototypeFunction(t,r){return null!==t&&t.prototype&&Reflect.has(t.prototype,r)&&"function"==typeof t.prototype[r]}pt.reset();var dt={includeAccessor:!1,includeNonEnumerable:!1,includeReadonly:!0,includeNonConfigurable:!0};function ownKeys$4(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),o.push.apply(o,i)}return o}function _objectSpread$4(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys$4(Object(o),!0).forEach((function(r){i(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys$4(Object(o)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))}))}return t}var ht={getAllFields:function getAllFields(t,r,o){var i=o.type,a=o.options,c=Object.keys(t),u=Object.getPrototypeOf(i);if(hasPrototypeFunction(u,"assign")){u.prototype.assign.call(t,r,a);var l=getDefaultInstance(u),p=Object.keys(l);return c.filter((function(t){return!p.includes(t)}))}return c},copyPropertiesWithoutNamingConversion:function copyPropertiesWithoutNamingConversion(t,r){c.isUndefinedOrNull(r)||Object.keys(t).forEach((function(o){Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=a(r[o],dt))}))},cloneEnum:function cloneEnum(t,r){var o=r.sourcePath,i=r.targetType,a=r.defaultInstance;if(null===t)return null;if(void 0===t)return a;if(t instanceof i)return t;if("string"==typeof t){if(0===t.trim().length)return a;var c=ofValueImpl(i,t);if(void 0===c)throw new RangeError("The value of property '".concat(o,"' of the ")+"source object is not an enumerator of ".concat(i.name,": ").concat(t));return c}throw new RangeError("The value of property '".concat(o,"' of the source ")+"object is not an enumerator of ".concat(i.name,": ").concat(t))},cloneWithType:function cloneWithType(t,r){var o=r.targetPath,i=r.sourcePath,l=r.targetType,p=r.defaultInstance,d=r.options;if(c.isUndefinedOrNull(t))return a(p,dt);if(u.isBuiltInClass(l))return null===t?null:void 0===t?p:(t.constructor===l||console.warn("The value of the property '".concat(i,"' of the source ")+"object is not an instance of ".concat(l.name,":"),t),a(t,dt));if("enum"===getClassMetadata(l,Ge))return this.cloneEnum(t,{sourcePath:i,targetType:l,defaultInstance:p});var h=new l;return this.doAssign(h,t,{targetPath:o,sourcePath:i,targetType:l,defaultInstance:p,options:d})},cloneArrayWithElementType:function cloneArrayWithElementType(t,r){var o=this,i=r.targetPath,l=r.sourcePath,p=r.elementType,d=r.defaultArray,h=r.options;if(!Array.isArray(t))return console.error("The value of the property '".concat(l,"' of the source ")+"object should be an array:",t),a(d,dt);if(u.isBuiltInClass(p))return a(t,dt);if("enum"===getClassMetadata(p,Ge))return t.map((function(t,r){return o.cloneEnum(t,{sourcePath:"".concat(l,"[").concat(r,"]"),targetType:p,defaultInstance:d?d[r]:void 0})}));var y=getDefaultInstance(p);return t.map((function(t,r){if(c.isUndefinedOrNull(t))return t;var a=new p,u=d&&d[r]?d[r]:y;return o.doAssign(a,t,{targetPath:"".concat(i,"[").concat(r,"]"),sourcePath:"".concat(l,"[").concat(r,"]"),targetType:p,defaultInstance:u,options:h}),a}))},cloneNoType:function cloneNoType(t,r){var o=r.targetPath,i=r.sourcePath,u=r.defaultInstance,l=r.options;if(c.isUndefinedOrNull(u))return a(t,_objectSpread$4(_objectSpread$4({},dt),{},{convertNaming:l.convertNaming,sourceNamingStyle:l.sourceNamingStyle,targetNamingStyle:l.targetNamingStyle}));var p=Object.getPrototypeOf(u).constructor,d=new p;return this.doAssign(d,t,{targetPath:o,sourcePath:i,targetType:p,defaultInstance:u,options:l})},cloneArrayNoElementType:function cloneArrayNoElementType(t,r){var o=r.sourcePath,i=r.defaultArray,c=r.options;return Array.isArray(t)?a(t,_objectSpread$4(_objectSpread$4({},dt),{},{convertNaming:c.convertNaming,sourceNamingStyle:c.sourceNamingStyle,targetNamingStyle:c.targetNamingStyle})):(console.error("The value of the property '".concat(o,"' of the source ")+"object should be an array:",t),a(i,dt))},doAssign:function doAssign(t,r,i){var u=this,l=i.targetPath,p=i.sourcePath,d=i.targetType,h=i.defaultInstance,m=i.options;if(c.isUndefinedOrNull(r))this.copyPropertiesWithoutNamingConversion(t,h);else{var g=null!=h?h:getDefaultInstance(d);this.getAllFields(t,r,{type:d,options:m}).forEach((function(i){var h=g[i],b="".concat(l,".").concat(i),v=getSourceField(i,m),w="".concat(p,".").concat(v),I=r[v],S=getFieldType(d,i,b,m),O=getFieldElementType(d,i,b,m);if(Object.prototype.hasOwnProperty.call(r,v))c.isUndefinedOrNull(I)?t[i]=I:O?t[i]=u.cloneArrayWithElementType(I,{targetPath:b,sourcePath:w,elementType:O,defaultArray:h,options:m}):S?t[i]=u.cloneWithType(I,{targetPath:b,sourcePath:w,targetType:S,defaultInstance:h,options:m}):c.isUndefinedOrNull(h)?t[i]=a(I,_objectSpread$4(_objectSpread$4({},dt),{},{convertNaming:m.convertNaming,sourceNamingStyle:m.sourceNamingStyle,targetNamingStyle:m.targetNamingStyle})):Array.isArray(h)?t[i]=u.cloneArrayNoElementType(I,{targetPath:b,sourcePath:w,defaultArray:h,options:m}):"object"===o(h)?t[i]=u.cloneNoType(I,{targetPath:b,sourcePath:w,defaultInstance:h,options:m}):t[i]=a(I,_objectSpread$4(_objectSpread$4({},dt),{},{convertNaming:m.convertNaming,sourceNamingStyle:m.sourceNamingStyle,targetNamingStyle:m.targetNamingStyle}));else{var P=function getExistFieldWithDifferentNamingStyle(t,r){var o,i=y.NamingStyle.values(),a=_createForOfIteratorHelper(i);try{for(a.s();!(o=a.n()).done;){var c,u=o.value,l=_createForOfIteratorHelper(i);try{for(l.s();!(c=l.n()).done;){var p=c.value,d=u.to(p,t);if(Object.prototype.hasOwnProperty.call(r,d))return d}}catch(t){l.e(t)}finally{l.f()}}}catch(t){a.e(t)}finally{a.f()}}(v,r);P&&(console.warn("Cannot find the source property '".concat(w,"' ")+"for the target property '".concat(b,"'. ")+"But the source object has a property '".concat(p,".").concat(P,"'. ")+"A correct naming conversion may be needed."),console.warn("The source object:",r),console.warn("The target object:",t)),t[i]=a(h,dt)}}))}return m.normalize?defaultNormalizer(t):t}};function assignImpl(t,r,o,i){var a=pt.merge("assign",i);return o instanceof t&&(a.convertNaming=!1),ht.doAssign(r,o,{targetPath:"",sourcePath:"",targetType:t,defaultInstance:getDefaultInstance(t),options:a})}function createImpl(t,r,i){if(null==r)return null;if("object"!==o(r))throw new TypeError("The first argument of ".concat(t.name,".create() must be an object."));if(hasPrototypeFunction(t,"assign")){var a=new t;return a.assign(r,i),a}var c=new t;return assignImpl(t,c,r,i)}function createArrayImpl(t,r,o){if(null==r)return null;if(Array.isArray(r))return r.map((function(r){return createImpl(t,r,o)}));throw new TypeError("The first argument of ".concat(t.name,".createArray() must be an array."))}var yt=function(){function Page(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];d(this,Page),i(this,"totalCount",0),i(this,"totalPages",0),i(this,"pageIndex",0),i(this,"pageSize",0),i(this,"content",[]),this.totalCount=t,this.totalPages=r,this.pageIndex=o,this.pageSize=a,this.content=c}return h(Page,[{key:"assign",value:function assign(t){return assignImpl(Page,this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)}}],[{key:"newEmpty",value:function newEmpty(t){return new Page(0,0,0,t,[])}},{key:"getFrom",value:function getFrom(t,r){var o=r.length,i=t.pageSize,a=t.pageIndex,c=Math.ceil(o/i),u=a*i,l=Math.min(u+i,o);return new Page(o,c,a,i,r.slice(u,l))}}])}();function ownKeys$3(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),o.push.apply(o,i)}return o}function createPageImpl(t,r,a){if(null==r)return null;if(function isValidPageSource(t,r){var i=pt.merge("assign",r);return null!=t&&"object"===o(t)&&"number"==typeof t[getSourceField("totalCount",i)]&&"number"==typeof t[getSourceField("totalPages",i)]&&"number"==typeof t[getSourceField("pageIndex",i)]&&"number"==typeof t[getSourceField("pageSize",i)]&&Array.isArray(t[getSourceField("content",i)])}(r,a)){var c=new yt,u=function _objectSpread$3(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys$3(Object(o),!0).forEach((function(r){i(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys$3(Object(o)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))}))}return t}({},a);return u.elementTypes?u.elementTypes[".content"]=t:u.elementTypes={".content":t},assignImpl(yt,c,r,u)}throw new TypeError("Invalid page format: ".concat(m.stringify(r)))}function setFieldMetadata(t,r,o,i){var a=getFieldMetadataObject(t,r);if(!a)throw new Error('The metadata of the field "'.concat(r,'" of the class does not exist.'));a[o]=i}function ofCodeImpl(t,r){if(u.isString(r)){var o=String(r).trim(),i=Object.keys(t).filter((function(r){return t[r]instanceof t})).find((function(r){var i;return(null===(i=t[r])||void 0===i?void 0:i.code)===o}));return i?t[i]:void 0}}function ofNameImpl(t,r){if(u.isString(r)){var o=String(r).trim(),i=Object.keys(t).filter((function(r){return t[r]instanceof t})).find((function(r){var i;return(null===(i=t[r])||void 0===i?void 0:i.name)===o}));return i?t[i]:void 0}}function ofImpl(t,r){if(null!=r){if(r instanceof t)return r;var o,i;if(u.isString(r))return null!==(o=null!==(i=ofValueImpl(t,r))&&void 0!==i?i:ofNameImpl(t,r))&&void 0!==o?o:ofCodeImpl(t,r)}}function setClassMetadata(t,r,o){var i=ct(t);if(!i)throw new Error('The metadata of the class "'.concat(t.name,'" has not been cached.'));i[r]=o}function isEnumerator(t){if(null==t||"object"!==o(t))return!1;var r=Object.getPrototypeOf(t);return!(!r||!r.constructor)&&"enum"===getClassMetadata(r.constructor,Ge)}function hasOwnProperty(t,r){if(!t||!t.prototype)return!1;if(Object.prototype.hasOwnProperty.call(t.prototype,r))return!0;var o=getDefaultInstance(t);return o&&Object.prototype.hasOwnProperty.call(o,r)}function hasOwnPrototypeFunction(t,r){return null!==t&&t.prototype&&Object.prototype.hasOwnProperty.call(t.prototype,r)&&"function"==typeof t.prototype[r]}function requirePrototypeMethod(t,r){if(!hasPrototypeFunction(t,r))throw new TypeError("The class ".concat(t.name,' does not implement the prototype method "').concat(r,'()".'))}function normalizeFieldImpl(t,r,o,i){var a,c;if(null!=i||(i={}),null!==(c=(a=i).path)&&void 0!==c||(a.path=""),!Object.prototype.hasOwnProperty.call(r,o))return!1;var p=Object.getPrototypeOf(t);if(hasOwnPrototypeFunction(p,"normalizeField")&&p.prototype.normalizeField.call(r,o,i))return!0;var d=getFieldMetadata(ct(t),o,ot);if(void 0===d)return!1;var h=r[o];return function normalizeNullishField(t,r,o,i){return null==i}(0,0,0,h)||function normalizeArrayField(t,r,o,i,a,c){if(Array.isArray(i)||u.isTypedArray(i)){var l="".concat(a.path,".").concat(o),p={type:getFieldElementType(t,o,l,a),path:l,types:a.types,elementTypes:a.elementTypes};return r[o]=i.map((function(t){return null==t?t:c(t,p)})),!0}return!1}(t,r,o,h,i,d)||function normalizeSetField(t,r,o,i,a,c){if(i instanceof Set){var u="".concat(a.path,".").concat(o),l={type:getFieldElementType(t,o,u,a),path:u,types:a.types,elementTypes:a.elementTypes};return r[o]=new Set(Array.from(i,(function(t){return c(t,l)}))),!0}return!1}(t,r,o,h,i,d)||function normalizeMapField(t,r,o,i,a,c){if(i instanceof Map){var u="".concat(a.path,".").concat(o),p={type:getFieldElementType(t,o,u,a),path:u,types:a.types,elementTypes:a.elementTypes};return r[o]=new Map(Array.from(i,(function(t){var r=l(t,2),o=r[0],i=r[1];return[o,c(i,p)]}))),!0}return!1}(t,r,o,h,i,d)||function normalizeNormalField(t,r,o,i,a,c){var u="".concat(a.path,".").concat(o),l={type:getFieldType(t,o,u,a),path:u,types:a.types,elementTypes:a.elementTypes};return r[o]=c(i,l),!0}(t,r,o,h,i,d)}function ownKeys$2(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),o.push.apply(o,i)}return o}function _objectSpread$2(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys$2(Object(o),!0).forEach((function(r){i(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys$2(Object(o)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))}))}return t}function toJsonImpl(t,r,o){var i=pt.merge("toJSON",o);i.normalize&&(t=defaultNormalizer(t=a(t,dt)));var c=_objectSpread$2(_objectSpread$2({},dt),{},{pojo:!0,disableHooks:!0,useToJSON:!0,convertNaming:i.convertNaming,sourceNamingStyle:i.sourceNamingStyle,targetNamingStyle:i.targetNamingStyle,removeEmptyFields:i.removeEmptyFields,skipRootToJSON:i.skipRootToJSON});return a(t,c)}function toJsonStringImpl(t,r,o){var i=pt.merge("toJSON",o),a=r.toJSON("",i);return m.stringify(a,null,i.space)}function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}a.registerCloneHook((function(t,r){return isEnumerator(r)?r:null}));var mt,gt,bt,vt,wt,It,St,Ot,Pt,Et,jt,qt,Tt,Nt,Rt,Ut,Ct,_t,Ft,At,Dt,Lt,$t,kt,xt,zt,Mt,Vt,Ht,Wt={};function requireObject(){if(bt)return gt;bt=1;const t=function exists(t){return!(null==t||Number.isNaN(t))};return gt=Object.freeze({exists:t,is:function is(r,o){return t(r)&&t(o)&&(o.constructor===r||o instanceof r)}})}function requireHelpers(){if(St)return It;St=1;const t=function requireCast(){if(wt)return vt;wt=1;const{is:t,exists:r}=requireObject(),o=function number(o){let i;if(r(o)){const r=o.valueOf();if(t(Number,r))Number.isFinite(r)&&(i=r);else if(t(String,r)||t(Boolean,r)){const t=Number(r);Number.isFinite(t)&&(i=t)}}return i},i=function integer(t){const r=o(t);let i;if(void 0!==r){const t=parseInt(r,10);Number.isNaN(t)||(i=t)}return i};return vt=Object.freeze({number:o,num:function num(t,{ge:r,le:i}={}){let a=o(t);if(void 0!==a){const t=o(i),c=o(r);void 0!==t&&void 0!==c?(a<c||a>t)&&(a=void 0):(void 0!==t&&a>t||void 0!==c&&a<c)&&(a=void 0)}return a},int:function int(t,{le:r,ge:o}={}){let a=i(t);if(void 0!==a){const t=i(r),c=i(o);void 0!==t&&void 0!==c?(a<c||a>t)&&(a=void 0):(void 0!==t&&a>t||void 0!==c&&a<c)&&(a=void 0)}return a},integer:i})}(),r=requireObject();return It=Object.freeze({cast:t,object:r})}function requireIp(){if(Pt)return Ot;Pt=1;const{object:{is:t}}=requireHelpers(),r="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",o="[a-fA-F\\d]{1,4}",i=`\n(\n(?:${o}:){7}(?:${o}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:${o}:){6}(?:${r}|:${o}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:${o}:){5}(?::${r}|(:${o}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:${o}:){4}(?:(:${o}){0,1}:${r}|(:${o}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:${o}:){3}(?:(:${o}){0,2}:${r}|(:${o}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:${o}:){2}(?:(:${o}){0,3}:${r}|(:${o}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:${o}:){1}(?:(:${o}){0,4}:${r}|(:${o}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::((?::${o}){0,5}:${r}|(?::${o}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(%[0-9a-zA-Z]{1,})? // %eth0 %1\n`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim();return Ot=Object.freeze({isIP:function isIP(o){return!!t(String,o)&&new RegExp(`(?:^${r}$)|(?:^${i}$)`).test(o)},isIPv4:function isIPv4(o){return!!t(String,o)&&new RegExp(`^${r}$`).test(o)},isIPv6:function isIPv6(r){return!!t(String,r)&&new RegExp(`^${i}$`).test(r)}})}function requirePunycode(){if(jt)return Et;jt=1;const{domainToASCII:t,domainToUnicode:r}=g,{isIPv6:o}=requireIp(),{object:{is:i}}=requireHelpers();return Et=Object.freeze({punycode:function punycode(r){return o(r)?r:i(String,r)?t(r):""},punydecode:function punydecode(t){return o(t)?t:i(String,t)?r(t):""}})}function requireConfig(){return Tt?qt:(Tt=1,qt=Object.freeze({maxLengthURL:2048,minPortInteger:0,maxPortInteger:65535}))}function requireParser(){if(Rt)return Nt;Rt=1;const{punycode:t,punydecode:r}=requirePunycode(),{isIPv6:o}=requireIp(),{cast:{int:i},object:{exists:a,is:c}}=requireHelpers(),{minPortInteger:u,maxPortInteger:l}=requireConfig(),p=/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/,d=/^(?:\[([^\]]+)\]:?)([0-9]+)?$/,h=function hostToURI(t){return c(String,t)?o(t)?`[${t}]`:t:""},y=function recomposeURI(t){const r=t||{};if(!(c(String,r.scheme)&&r.scheme.length>0&&c(String,r.path)))return"";let o=r.scheme;if(c(String,r.host)){if(""!==r.path&&!r.path.startsWith("/"))return"";if(r.host.length<=2)return"";o+="://",c(String,r.userinfo)&&r.userinfo.length>0&&(o+=`${r.userinfo}@`),o+=h(r.host),a(r.port)&&void 0!==i(r.port,{ge:u,le:l})&&(o+=`:${r.port}`)}else{if(r.path.startsWith("//"))return"";o+=":"}return""===r.path&&c(String,r.host)?o+="/":o+=r.path,c(String,r.query)&&r.query.length>0&&(o+=`?${r.query}`),c(String,r.fragment)&&r.fragment.length>0&&(o+=`#${r.fragment}`),o};return Nt=Object.freeze({hostToURI:h,recomposeURI:y,parseURI:function parseURI(o){const u={scheme:null,authority:null,authorityPunydecoded:null,userinfo:null,host:null,hostPunydecoded:null,port:null,path:null,pathqf:null,query:null,fragment:null,href:null};if(!(c(String,o)&&o.length>0))return u;const[,l,m,g,b,v]=o.match(p);if(!(c(String,l)&&l.length>0))return u;let w=null,I=null,S=null,O=null,P=null,E=null;if(c(String,m)){let o=null;if([S=null,o=null]=m.split("@"),!a(o)&&a(S)&&(o=S,S=null),c(String,o)){const u=o.match(d);let l,p;c(Array,u)?[,l=null,p=null]=u:[l=null,p=null]=o.split(":");const y=c(String,l)?l.toLowerCase():null,m=t(y),g=r(y);y!==m?(O=m,P=y):y!==g?(O=y,P=g):(O=y,P=y),""!==O&&""!==P||(O=null),E=i(p)||p,a(P)&&(I="",a(S)&&(I+=`${S}@`),I+=h(P),a(E)&&(I+=`:${E}`)),a(O)?(w="",a(S)&&(w+=`${S}@`),w+=h(O),a(E)&&(w+=`:${E}`)):(S=null,E=null)}}const j=c(String,b)&&b.length>0?b:null,q=c(String,v)&&v.length>0?v:null;u.pathqf=c(String,g)?g.valueOf():null,c(String,u.pathqf)&&(c(String,j)&&(u.pathqf+=`?${j}`),c(String,q)&&(u.pathqf+=`#${q}`)),u.scheme=l.toLowerCase(),u.authority=w,u.authorityPunydecoded=I,u.userinfo=S,u.host=O,u.hostPunydecoded=P,u.port=E,u.path=g,u.query=j,u.fragment=q;const T=y({scheme:u.scheme,userinfo:u.userinfo,host:u.host,port:u.port,path:u.path,query:u.query,fragment:u.fragment});return u.href=""!==T?T:null,u}}),Nt}function requireChars(){if(Ct)return Ut;Ct=1;const{object:{is:t}}=requireHelpers(),r=function isPathChar(r,o){if(!t(String,r))return!1;const i=!0===o,a=r.charCodeAt();return 37===a?!i:a>=36&&a<=59||a>=64&&a<=90||a>=97&&a<=122||33===a||61===a||95===a||126===a},o=function isSitemapPathChar(r,o){if(!t(String,r))return!1;const i=!0===o,a=r.charCodeAt();return 37===a?!i:a>=36&&a<=38||a>=40&&a<=41||a>=43&&a<=59||a>=97&&a<=122||33===a||61===a||64===a||95===a||126===a};return Ut=Object.freeze({isSchemeChar:function isSchemeChar(r,{start:o}={}){if(!t(String,r))return!1;const i=r.charCodeAt();return o?i>=97&&i<=122:i>=48&&i<=57||i>=97&&i<=122||43===i||45===i||46===i},isUserinfoChar:function isUserinfoChar(r,o){if(!t(String,r))return!1;const i=!0===o,a=r.charCodeAt();return 37===a?!i:a>=38&&a<=46||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||33===a||36===a||58===a||59===a||61===a||95===a||126===a},isSitemapUserinfoChar:function isSitemapUserinfoChar(r,o){if(!t(String,r))return!1;const i=!0===o,a=r.charCodeAt();return 37===a?!i:a>=40&&a<=41||a>=43&&a<=46||a>=48&&a<=57||a>=97&&a<=122||33===a||36===a||38===a||58===a||59===a||61===a||95===a||126===a},isDomainChar:function isDomainChar(r,{start:o,end:i}={}){if(!t(String,r))return!1;const a=r.charCodeAt();return(!0!==o&&!0!==i||45!==a)&&(a>=48&&a<=57||a>=97&&a<=122||45===a)},isPathChar:r,isSitemapPathChar:o,isQueryOrFragmentChar:function isQueryOrFragmentChar(o,i){return!!r(o,i)||t(String,o)&&63===o.charCodeAt()},isSitemapQueryOrFragmentChar:function isSitemapQueryOrFragmentChar(r,i){return!!o(r,i)||t(String,r)&&63===r.charCodeAt()},isPercentEncodingChar:function isPercentEncodingChar(r){if(!t(String,r))return!1;const o=r.charCodeAt();return o>=48&&o<=57||o>=65&&o<=70}})}function requireDomain(){if(Ft)return _t;Ft=1;const{punycode:t}=requirePunycode(),{isDomainChar:r}=requireChars(),{object:{is:o}}=requireHelpers(),i=function isDomainLabel(t){if(!o(String,t))return!1;const i=t.length;if(i<1||i>63)return!1;for(let o=0;o<i;o+=1){if(!r(t[o],{start:0===o,end:o===i-1}))return!1;if("-"===t[o]&&o+1<i&&"-"===t[o+1])return!1}return!0};return _t=Object.freeze({isDomainLabel:i,isDomain:function isDomain(r){if(!o(String,r))return!1;const a=t(r);if("localhost"===a)return!0;const c=a.length;if(c<=0||c>255)return!1;const u=a.split("."),l=u.length;if(l<=1)return!1;const p={};for(let t=0;t<l;t+=1)if(t!==l-1||""!==u[t]){const r=u[t].startsWith("xn--")?u[t].slice(4):u[t];if(!i(r))return!1;if(p[u[t]]=(p[u[t]]||0)+1,p[u[t]]>1)return!1}return!0}})}function requireSitemap(){if(Dt)return At;Dt=1;const t={"*":"%2A"},r=Object.keys(t),o={};r.forEach((r=>{o[t[r]]=r}));const i=Object.keys(o),a={"&":"&amp;","'":"&apos;"},c=Object.keys(a),u={};c.forEach((t=>{u[a[t]]=t}));const l=Object.keys(u),p=l.length;return At=Object.freeze({specialChars:t,specialCharsKeys:r,pencodings:o,pencodingsKeys:i,entities:a,entitiesKeys:c,escapeCodes:u,escapeCodesKeys:l,escapeCodesKeysLen:p})}function requireCheckers(){if($t)return Lt;$t=1;const{maxLengthURL:t,minPortInteger:r,maxPortInteger:o}=requireConfig(),{parseURI:i}=requireParser(),{isDomain:a}=requireDomain(),{cast:{int:c},object:{exists:u,is:l}}=requireHelpers(),{isIP:p}=requireIp(),{escapeCodesKeys:d,escapeCodesKeysLen:h}=requireSitemap(),{isSchemeChar:y,isUserinfoChar:m,isPathChar:g,isQueryOrFragmentChar:b,isSitemapUserinfoChar:v,isSitemapPathChar:w,isSitemapQueryOrFragmentChar:I,isPercentEncodingChar:S}=requireChars(),O=function checkPercentEncoding(t,r,o){if(!l(String,t)){const t=new URIError("a string is required when checking for percent encoding");throw t.code="URI_INVALID_PERCENT_ENCODING",t}const i=l(Number,o)&&o>=0?o:t.length,a=l(Number,r)&&r<i?r:0;let c=0;if(i>0&&"%"===t[a]){if(!(a+2<i)){const t=new URIError("incomplete percent encoding found");throw t.code="URI_INVALID_PERCENT_ENCODING",t}if(!S(t[a+1])){const r=new URIError(`invalid percent encoding char '${t[a+1]}'`);throw r.code="URI_INVALID_PERCENT_ENCODING",r}if(!S(t[a+2])){const r=new URIError(`invalid percent encoding char '${t[a+2]}'`);throw r.code="URI_INVALID_PERCENT_ENCODING",r}c=2}return c},P=function checkSitemapEncoding(t,r,o){if(!l(String,t)){const t=new URIError("a string is required when checking for sitemap encoding");throw t.code="URI_INVALID_SITEMAP_ENCODING",t}const i=l(Number,o)&&o>=0?o:t.length,a=l(Number,r)&&r<i?r:0;let c=0;if(i>0&&"&"===t[a]){let r;for(let o=0;o<h;o+=1){const c=d[o],u=c.length;if(a+u<=i&&c===t.substring(a,a+u)){r=u-1;break}}if(!u(r)){const r=new URIError(`entity '${t[a]}' is not properly escaped`);throw r.code="URI_INVALID_SITEMAP_ENCODING",r}c=r}return c},E=function checkComponent({type:t,string:r,sitemap:o}={}){if(!["userinfo","path","query","fragment"].includes(t)){const r=new URIError(`unable to check pathqf, got '${t}' component to check`);throw r.code="URI_INVALID_CHECKING_COMPONENT",r}if("path"===t&&(!u(r)||""===r)||!u(r))return!0;const i=r.length,a=!0===o;let c;switch(t){case"userinfo":c=a?v:m;break;case"path":c=a?w:g;break;case"query":case"fragment":c=a?I:b}for(let o=0;o<i;o+=1){if(!c(r[o])){const i=new URIError(`invalid ${t} char '${r[o]}'`);throw i.code=`URI_INVALID_${t.toUpperCase()}_CHAR`,i}o+=O(r,o,i),a&&(o+=P(r,o,i))}return!0},j=function checkSchemeChars(t,r){if(!l(String,t)){const t=new URIError("scheme must be a string");throw t.code="URI_INVALID_SCHEME",t}const o=l(Number,r)&&r>0?r:t.length;if(o<=0){const t=new URIError("scheme cannot be empty");throw t.code="URI_INVALID_SCHEME",t}for(let r=0;r<o;r+=1)if(!y(t[r],{start:0===r})){const o=new URIError(`invalid scheme char '${t[r]}'`);throw o.code="URI_INVALID_SCHEME_CHAR",o}return!0},q=function checkLowercase(t){if(!l(String,t)){const t=new URIError("uri must be a string");throw t.code="URI_INVALID_TYPE",t}if(t.toLowerCase()!==t){const t=new URIError("uri cannot contain any uppercase characters");throw t.code="URI_INVALID_CHAR",t}return!0},T=function checkURISyntax(t){if(!l(String,t)){const t=new URIError("uri must be a string");throw t.code="URI_INVALID_TYPE",t}const{scheme:r,authority:o,authorityPunydecoded:a,userinfo:c,host:p,hostPunydecoded:d,port:h,path:y,pathqf:m,query:g,fragment:b,href:v}=i(t),w=l(String,r)?r.length:0;if(!l(String,r)){const t=new URIError("uri scheme is required");throw t.code="URI_MISSING_SCHEME",t}if(w<=0){const t=new URIError("uri scheme must not be empty");throw t.code="URI_EMPTY_SCHEME",t}if(!l(String,y)){const t=new URIError("uri path is required");throw t.code="URI_MISSING_PATH",t}if(l(String,o)&&o.length>0){if(""!==y&&!y.startsWith("/")){const t=new URIError("path must be empty or start with '/' when authority is present");throw t.code="URI_INVALID_PATH",t}}else if(y.startsWith("//")){const t=new URIError("path must not start with '//' when authority is not present");throw t.code="URI_INVALID_PATH",t}if(!u(o)&&u(a)){const t=new URIError(`host must be a valid ip or domain name, got '${d}'`);throw t.code="URI_INVALID_HOST",t}return{scheme:r,authority:o,authorityPunydecoded:a,userinfo:c,host:p,hostPunydecoded:d,port:h,path:y,pathqf:m,query:g,fragment:b,href:v,schemeLen:w,valid:!0}},N=function checkURI(t,{sitemap:i}={}){const{scheme:l,authority:d,authorityPunydecoded:h,userinfo:y,host:m,hostPunydecoded:g,port:b,path:v,pathqf:w,query:I,fragment:S,href:O,schemeLen:P}=T(t);if(j(l,P),u(d)){if(E({sitemap:i,type:"userinfo",string:y}),!p(m)&&!a(m)){const t=new URIError(`host must be a valid ip or domain name, got '${m}'`);throw t.code="URI_INVALID_HOST",t}if(u(b)&&void 0===c(b,{ge:r,le:o})){const t=new URIError(`port must be an integer between ${r}-${o}, got '${b}'`);throw t.code="URI_INVALID_PORT",t}}return E({sitemap:i,type:"path",string:v}),E({sitemap:i,type:"query",string:I}),E({sitemap:i,type:"fragment",string:S}),{scheme:l,authority:d,authorityPunydecoded:h,userinfo:y,host:m,hostPunydecoded:g,port:b,path:v,pathqf:w,query:I,fragment:S,href:O,valid:!0}},R=function checkHttpURL(r,{https:o,web:i,sitemap:a}={}){!0===a&&q(r);const c=[];!0===o?c.push("https"):!0===i?c.push("http","https"):c.push("http");const{scheme:u,authority:p,authorityPunydecoded:d,userinfo:h,host:y,hostPunydecoded:m,port:g,path:b,pathqf:v,query:w,fragment:I,href:S}=N(r,{sitemap:a});if(!c.includes(u)){const t=new URIError(`scheme must be ${c.join(" or ")}, got '${u}'`);throw t.code="URI_INVALID_SCHEME",t}if(!l(String,p)){const t=new URIError("authority is required");throw t.code="URI_MISSING_AUTHORITY",t}if(l(String,S)&&S.length>t){const r=new URIError(`max URL length of ${t} reached: ${S.length}`);throw r.code="URI_MAX_LENGTH_URL",r}return{scheme:u,authority:p,authorityPunydecoded:d,userinfo:h,host:y,hostPunydecoded:m,port:g,path:b,pathqf:v,query:w,fragment:I,href:S,valid:!0}};return Lt=Object.freeze({checkPercentEncoding:O,checkSitemapEncoding:P,checkComponent:E,checkSchemeChars:j,checkLowercase:q,checkURISyntax:T,checkURI:N,checkHttpURL:R,checkHttpsURL:function checkHttpsURL(t){return R(t,{https:!0})},checkHttpSitemapURL:function checkHttpSitemapURL(t){return R(t,{sitemap:!0})},checkHttpsSitemapURL:function checkHttpsSitemapURL(t){return R(t,{https:!0,sitemap:!0})},checkWebURL:function checkWebURL(t){return R(t,{web:!0})},checkSitemapURL:function checkSitemapURL(t){return R(t,{web:!0,sitemap:!0})}}),Lt}getDefaultExportFromCjs(function requireEmailValidator(){if(mt)return Wt;mt=1;var t=/^[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~](\.?[-!#$%&'*+\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$/;return Wt.validate=function(r){if(!r)return!1;if(r.length>254)return!1;if(!t.test(r))return!1;var o=r.split("@");return!(o[0].length>64||o[1].split(".").some((function(t){return t.length>63})))},Wt}());var Kt=function requireSrc(){if(Ht)return Vt;Ht=1;const{punycode:t,punydecode:r}=requirePunycode(),{parseURI:o,recomposeURI:i}=requireParser(),{isDomainLabel:a,isDomain:c}=requireDomain(),{isIP:u,isIPv4:l,isIPv6:p}=requireIp(),{checkURI:d,checkHttpURL:h,checkHttpsURL:y,checkHttpSitemapURL:m,checkHttpsSitemapURL:g,checkWebURL:b,checkSitemapURL:v}=requireCheckers(),{encodeURIComponentString:w,encodeURIString:I,encodeWebURL:S,encodeSitemapURL:O}=function requireEncoders(){if(xt)return kt;xt=1;const{maxLengthURL:t,minPortInteger:r,maxPortInteger:o}=requireConfig(),{checkURISyntax:i,checkSchemeChars:a}=requireCheckers(),{isUserinfoChar:c,isPathChar:u,isQueryOrFragmentChar:l,isSitemapUserinfoChar:p,isSitemapPathChar:d,isSitemapQueryOrFragmentChar:h}=requireChars(),{recomposeURI:y}=requireParser(),{entities:m,specialChars:g}=requireSitemap(),{isDomain:b}=requireDomain(),{isIP:v}=requireIp(),{cast:{int:w},object:{exists:I,is:S}}=requireHelpers(),O=function encodeURIComponentString(t,{type:r,sitemap:o,lowercase:i}={}){if(!S(String,t))return"";const a=!0===i||!0===o?t.toLowerCase():t,y=a.length;let b="";for(let t=0;t<y;t+=1){let i=!1;if(!0===o&&(I(m[a[t]])?(b+=m[a[t]],i=!0):I(g[a[t]])&&(b+=g[a[t]],i=!0)),!i){let i;switch(r){case"userinfo":i=o&&p(a[t],!0)||c(a[t],!0);break;case"path":i=o&&d(a[t],!0)||u(a[t],!0);break;case"query":case"fragment":i=o&&h(a[t],!0)||l(a[t],!0);break;default:i=!1}b+=i?a[t]:encodeURIComponent(a[t])}}return b},P=function encodeURIString(c,{web:u,sitemap:l,lowercase:p}={}){const d=S(String,c)&&!0===p?c.toLowerCase():c,h=!0===u||!0===l,{scheme:m,authority:g,userinfo:P,host:E,port:j,path:q,query:T,fragment:N,schemeLen:R}=i(d);if(h){if("http"!==m&&"https"!==m){const t=new URIError(`scheme must be http or https, got '${m}'`);throw t.code="URI_INVALID_SCHEME",t}}else a(m,R);if(h&&!S(String,g)){const t=new URIError("authority is required");throw t.code="URI_MISSING_AUTHORITY",t}if(I(E)&&!v(E)&&!b(E)){const t=new URIError(`host must be a valid ip or domain name, got '${E}'`);throw t.code="URI_INVALID_HOST",t}if(I(j)&&void 0===w(j,{ge:r,le:o})){const t=new URIError(`port must be an integer between ${r}-${o}, got '${j}'`);throw t.code="URI_INVALID_PORT",t}const U=O(P,{sitemap:l,type:"userinfo",lowercase:!1}),C=O(q,{sitemap:l,type:"path",lowercase:!1}),_=O(T,{sitemap:l,type:"query",lowercase:!1}),A=O(N,{sitemap:l,type:"fragment",lowercase:!1}),D=y({scheme:m,host:E,port:j,userinfo:U,path:C,query:_,fragment:A});if(h&&D.length>t){const r=new URIError(`max URL length of ${t} reached: ${D.length}`);throw r.code="URI_MAX_LENGTH_URL",r}return D};return kt=Object.freeze({encodeURIComponentString:O,encodeURIString:P,encodeWebURL:function encodeWebURL(t,{lowercase:r}={}){return P(t,{lowercase:r,web:!0})},encodeSitemapURL:function encodeSitemapURL(t){return P(t,{lowercase:!0,sitemap:!0})}}),kt}(),{decodeURIComponentString:P,decodeURIString:E,decodeWebURL:j,decodeSitemapURL:q}=function requireDecoders(){if(Mt)return zt;Mt=1;const{maxLengthURL:t,minPortInteger:r,maxPortInteger:o}=requireConfig(),{checkURISyntax:i,checkSchemeChars:a}=requireCheckers(),{cast:{int:c},object:{exists:u,is:l}}=requireHelpers(),{recomposeURI:p}=requireParser(),{isDomain:d}=requireDomain(),{isIP:h}=requireIp(),{escapeCodes:y,escapeCodesKeys:m,pencodings:g,pencodingsKeys:b}=requireSitemap(),v=function decodeURIComponentString(t,{sitemap:r,lowercase:o}={}){if(!l(String,t))return"";const i=!0===o?t.toLowerCase():t;if(!0===r){const r=new RegExp(m.concat(b).join("|"),"g"),o=i.replace(r,(t=>y[t]||g[t]));try{return decodeURIComponent(o)}catch(t){return""}}try{return decodeURIComponent(i)}catch(t){return""}},w=function decodeURIString(y,{web:m,sitemap:g,lowercase:b}={}){const w=l(String,y)&&!0===b?y.toLowerCase():y,I=!0===m||!0===g,{scheme:S,authority:O,userinfo:P,host:E,hostPunydecoded:j,port:q,path:T,query:N,fragment:R,schemeLen:U}=i(w);if(I){if("http"!==S&&"https"!==S){const t=new URIError(`scheme must be http or https, got '${S}'`);throw t.code="URI_INVALID_SCHEME",t}}else a(S,U);if(I&&!l(String,O)){const t=new URIError("authority is required");throw t.code="URI_MISSING_AUTHORITY",t}if(u(E)&&!h(E)&&!d(E)){const t=new URIError(`host must be a valid ip or domain name, got '${E}'`);throw t.code="URI_INVALID_HOST",t}if(u(q)&&void 0===c(q,{ge:r,le:o})){const t=new URIError(`port must be an integer between ${r}-${o}, got '${q}'`);throw t.code="URI_INVALID_PORT",t}const C=v(P,{sitemap:g,lowercase:!1}),_=v(T,{sitemap:g,lowercase:!1}),A=v(N,{sitemap:g,lowercase:!1}),D=v(R,{sitemap:g,lowercase:!1}),L=p({scheme:S,port:q,host:j,userinfo:C,path:_,query:A,fragment:D});if(I&&L.length>t){const r=new URIError(`max URL length of ${t} reached: ${L.length}`);throw r.code="URI_MAX_LENGTH_URL",r}return L};return zt=Object.freeze({decodeURIComponentString:v,decodeURIString:w,decodeWebURL:function decodeWebURL(t,{lowercase:r}={}){return w(t,{lowercase:r,web:!0})},decodeSitemapURL:function decodeSitemapURL(t,{lowercase:r}={}){return w(t,{lowercase:r,sitemap:!0})}}),zt}();return Vt=Object.freeze({punycode:t,punydecode:r,parseURI:o,recomposeURI:i,isDomainLabel:a,isDomain:c,isIP:u,isIPv4:l,isIPv6:p,checkURI:d,checkHttpURL:h,checkHttpsURL:y,checkHttpSitemapURL:m,checkHttpsSitemapURL:g,checkWebURL:b,checkSitemapURL:v,encodeURIComponentString:w,encodeURIString:I,encodeWebURL:S,encodeSitemapURL:O,decodeURIComponentString:P,decodeURIString:E,decodeWebURL:j,decodeSitemapURL:q})}();getDefaultExportFromCjs(Kt);var Jt=function(){function ValidationResult(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";d(this,ValidationResult),i(this,"success",!0),i(this,"description",""),i(this,"next",null),this.success=null==t||t,this.description=null!=r?r:"",this.next=null}return h(ValidationResult,null,[{key:"merge",value:function merge(t){if(Array.isArray(t)&&t.length>0){for(var r=new ValidationResult(!0),o=r,i=0;i<t.length;++i){var a=t[i];a&&!a.success&&(o.next=a,o=a)}return o.next=null,r.next?(o=r.next,r.next=null,o):r}return new ValidationResult(!0)}}])}();function getFieldLabel(t,r){var o=getFieldMetadata(t,r,nt);return o?o.label:r}function getInstanceName(t,r){var o=t[Ze];return o?r[o]:void 0}function isFieldNonEmpty(t,r){return!0===getFieldMetadata(t,r,rt)}function isFieldNullable(t,r){return!0===getFieldMetadata(t,r,tt)}function getElementValidationContext(t,r,o,i,a){var c,u,l,p,d,h={instance:o,owner:null!==(c=a.owner)&&void 0!==c?c:getInstanceName(r,o),field:i,type:null!==(u=a.type)&&void 0!==u?u:getFieldElementType(t,i),label:null!==(l=a.label)&&void 0!==l?l:getFieldLabel(r,i),nullable:null!==(p=a.nullable)&&void 0!==p?p:isFieldNullable(r,i),nonEmpty:null!==(d=a.nonEmpty)&&void 0!==d?d:isFieldNonEmpty(r,i)};return Object.assign(h,a)}function validateEmptyField(t,r,o,i,a){if(c.isEmpty(i)){if(a.nonEmpty||isFieldNonEmpty(t,o)){var u,l,p=null!==(u=a.label)&&void 0!==u?u:getFieldLabel(t,o),d=null!==(l=a.owner)&&void 0!==l?l:getInstanceName(t,r),h=d?"The ".concat(p," of ").concat(d," cannot be empty."):"The ".concat(p," cannot be empty.");return new Jt(!1,h)}return new Jt(!0)}return null}function validateNormalField(t,r,o,i,a,c,u){var l=function getValidationContext(t,r,o,i,a){var c,u,l,p,d,h={instance:o,owner:null!==(c=a.owner)&&void 0!==c?c:getInstanceName(r,o),field:i,type:null!==(u=a.type)&&void 0!==u?u:getFieldType(t,i),label:null!==(l=a.label)&&void 0!==l?l:getFieldLabel(r,i),nullable:null!==(p=a.nullable)&&void 0!==p?p:isFieldNullable(r,i),nonEmpty:null!==(d=a.nonEmpty)&&void 0!==d?d:isFieldNonEmpty(r,i)};return Object.assign(h,a)}(t,r,o,i,u);return c(a,l)}function validateFieldImpl(t,r,o,i){var a,c,l;if(!Object.prototype.hasOwnProperty.call(r,o))return null;var p=Object.getPrototypeOf(t);if(hasOwnPrototypeFunction(p,"validateField")){var d=p.prototype.validateField.call(r,o,i);if(null!==d)return d}var h=ct(t),y=getFieldMetadata(h,o,it);if(void 0===y)return new Jt(!0);var m=r[o];return null!==(a=null!==(c=null!==(l=function validateArrayField(t,r,o,i,a,c,l){if(Array.isArray(a)||u.isTypedArray(a)){var p=validateEmptyField(r,o,i,a,l);if(p)return p;var d=getElementValidationContext(t,r,o,i,l),h=a.map((function(t,r){return d.index=r,c(t,d)}));return Jt.merge(h)}return null}(t,h,r,o,m,y,i))&&void 0!==l?l:function validateSetField(t,r,o,i,a,c,u){if(a instanceof Set){var l=validateEmptyField(r,o,i,a,u);if(l)return l;var p=getElementValidationContext(t,r,o,i,u),d=Array.from(a,(function(t,r){return p.index=r,c(t,p)}));return Jt.merge(d)}return null}(t,h,r,o,m,y,i))&&void 0!==c?c:function validateMapField(t,r,o,i,a,c,u){if(a instanceof Map){var l=validateEmptyField(r,o,i,a,u);if(l)return l;var p=getElementValidationContext(t,r,o,i,u),d=Array.from(a,(function(t,r){return p.index=r,c(t[1],p)}));return Jt.merge(d)}return null}(t,h,r,o,m,y,i))&&void 0!==a?a:validateNormalField(t,h,r,o,m,y,i)}function ownKeys$1(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),o.push.apply(o,i)}return o}function _objectSpread$1(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys$1(Object(o),!0).forEach((function(r){i(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys$1(Object(o)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))}))}return t}function isDecoratorContext(t){return null!==t&&"object"===o(t)&&null!==t.metadata&&"object"===o(t.metadata)&&"string"==typeof t.kind&&"string"==typeof t.name}function setNormalizer(t,r,i){var a=r.metadata,c=r.kind,u=r.name;if("field"!==c)throw new SyntaxError("The @Normalizable must decorate a class field: ".concat(u));if("function"!=typeof i)throw new TypeError('The argument of @Normalizable decorated on the "'.concat(u,'" field must be a function, but it is a ').concat(o(i),"."));setFieldMetadata(a,u,ot,i)}function ownKeys(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),o.push.apply(o,i)}return o}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(o),!0).forEach((function(r){i(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))}))}return t}function defaultValidator(t,r){var i=r.owner,a=r.type,u=r.label,l=r.nullable,p=r.nonEmpty;if(null==t){if(l)return new Jt(!0);var d=i?"必须设置".concat(i,"的").concat(u,"的值"):"必须设置".concat(u,"的值");return new Jt(!1,d)}if(c.isEmpty(t)&&p){var h=i?"".concat(i,"的").concat(u,"不能为空"):"".concat(u,"不能为空");return new Jt(!1,h)}if(a){if(isEnumClass(a)&&"string"==typeof t){if(a.hasValue(t))return new Jt(!0);var y=i?"".concat(i,"的").concat(u,"的值不受支持: ").concat(t):"".concat(u,"的值不受支持: ").concat(t);return new Jt(!1,y)}if(t.constructor!==a){var m=i?"".concat(i,"的").concat(u,"必须是 ").concat(a.name," 类型"):"".concat(u,"必须是 ").concat(a.name," 类型");return new Jt(!1,m)}}return"object"===o(t)&&"function"==typeof t.validate?t.validate("*",{owner:i}):new Jt(!0)}function setValidator(t,r,i){var a=r.metadata,c=r.kind,u=r.name;if("field"!==c)throw new SyntaxError("The @Validatable must decorate a class field: ".concat(u));if("function"!=typeof i)throw new TypeError('The argument of @Validatable decorated on the "'.concat(u,'" field must be a function, but it is a ').concat(o(i),"."));setFieldMetadata(a,u,it,i)}exports.DefaultOptions=pt,exports.ElementType=function ElementType(t){return function decorate(r,o){var i=o.kind,a=o.name,c=o.metadata;if("field"!==i)throw new SyntaxError("The decorator @ElementType can only decorate a class field: ".concat(a));if("function"!=typeof t)throw new TypeError('The argument of @ElementType decorated on "'.concat(a,'" must be the constructor of a class.'));return setFieldMetadata(c,a,et,t),function(t){if(null!=t&&!Array.isArray(t))throw new TypeError('The field "'.concat(a,'" decorated by @ElementType must be initialized with an array.'));return t}}},exports.Enum=function Enum(t,r){if(null===r||"object"!==o(r))throw new TypeError("The context must be an object.");if("function"!=typeof t||"class"!==r.kind)throw new TypeError("The `@Enum` can only decorate a class.");ut(t,r.metadata),setClassMetadata(t,Ge,"enum"),r.addInitializer((function(){Object.keys(t).forEach((function(r){"function"!=typeof t[r]&&function defineEnumerator(t,r){var i=t[r],a=new t;if(a.value=r,null==i)a.name=r;else if("string"==typeof i)a.name=i;else{if("object"!==o(i))throw new TypeError("The default value of the enumerator "+"".concat(t.name,".").concat(r," should be either a string or an object."));Object.assign(a,i)}Object.freeze(a),t[r]=a}(t,r)})),Object.freeze(t)})),t.prototype.toString=function toString(){return this.value},t.prototype.toJSON=function toJSON(){return this.value},t.values=function values(){return function valuesImpl(t){return Object.keys(t).filter((function(r){return t[r]instanceof t})).map((function(r){return t[r]}))}(t)},t.ofValue=function ofValue(r){return ofValueImpl(t,r)},t.hasValue=function hasValue(r){return void 0!==ofValueImpl(t,r)},t.ofName=function ofName(r){return ofNameImpl(t,r)},t.hasName=function hasName(r){return void 0!==ofNameImpl(t,r)},t.ofCode=function ofCode(r){return ofCodeImpl(t,r)},t.hasCode=function hasCode(r){return void 0!==ofCodeImpl(t,r)},t.of=function of(r){return ofImpl(t,r)},t.has=function has(r){return void 0!==ofImpl(t,r)}},exports.Label=function Label(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return function decorate(o,i){var a=i.kind,c=i.name,u=i.metadata;if("field"!==a)throw new SyntaxError("The decorator @Label can only decorate a class field: ".concat(c));if("string"!=typeof t)throw new TypeError('The first argument of @Label decorated on "'.concat(c,'" must be a string.'));if(void 0!==r&&"string"!=typeof r)throw new TypeError('The second argument of @Label decorated on "'.concat(c,'" must be a string.'));setFieldMetadata(u,c,nt,{label:t,i18n:r})}},exports.Model=function Model(t,r){if(null===r||"object"!==o(r))throw new TypeError("The context must be an object.");if("function"!=typeof t||"class"!==r.kind)throw new TypeError("The `@Model` can only decorate a class.");ut(t,r.metadata),setClassMetadata(t,Ge,"model"),hasOwnPrototypeFunction(t,"assign")||(t.prototype.assign=function assign(r){return assignImpl(t,this,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)}),hasOwnPrototypeFunction(t,"clear")||(t.prototype.clear=function clear(){return function clearImpl(t,r){requirePrototypeMethod(t,"assign");var o=getDefaultInstance(t);return r.assign(o,{normalize:!1,convertNaming:!1})}(t,this)}),hasOwnPrototypeFunction(t,"clone")||(t.prototype.clone=function clone(){return function cloneImpl(t,r){return requirePrototypeMethod(t,"assign"),(new t).assign(r,{normalize:!1,convertNaming:!1})}(t,this)}),hasOwnPrototypeFunction(t,"isEmpty")||(t.prototype.isEmpty=function isEmpty(){return function isEmptyImpl(t,r){var o=getDefaultInstance(t);return c.deepEqual(r,o)}(t,this)}),hasOwnPrototypeFunction(t,"equals")||(t.prototype.equals=function equals(t){return function equalsImpl(t,r){return t===r||(null==r?null==t:null!=t&&Object.getPrototypeOf(t)===Object.getPrototypeOf(r)&&c.deepEqual(t,r))}(this,t)}),hasOwnPrototypeFunction(t,"normalize")||(t.prototype.normalize=function normalize(){return function normalizeImpl(t,r,o,i){if(null==o||"*"===o)Object.keys(r).forEach((function(t){return r.normalizeField(t,i)}));else if(Array.isArray(o))o.forEach((function(t){return r.normalizeField(t,i)}));else{if("string"!=typeof o)throw new TypeError("The argument ".concat(t.name,".normalize() must be a string or an array of strings."));r.normalizeField(o,i)}return r}(t,this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:"*",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}),hasOwnPrototypeFunction(t,"normalizeField")||(t.prototype.normalizeField=function normalizeField(r){return normalizeFieldImpl(t,this,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}),hasOwnPrototypeFunction(t,"validate")||(t.prototype.validate=function validate(){return function validateImpl(t,r,o,i){if(null==o||"*"===o){var a=Object.keys(r).map((function(t){return r.validateField(t,i)}));return Jt.merge(a)}if(Array.isArray(o)){var c=o.map((function(t){return r.validateField(t,i)}));return Jt.merge(c)}if("string"==typeof o){var u=r.validateField(o,i);return null!=u?u:new Jt(!0)}throw new TypeError("The argument of ".concat(t.name,".validate()")+" must be a string or an array of strings.")}(t,this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:"*",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}),hasOwnPrototypeFunction(t,"validateField")||(t.prototype.validateField=function validateField(r){return validateFieldImpl(t,this,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}),hasOwnProperty(t,"id")&&!hasPrototypeFunction(t,"generateId")&&(setClassMetadata(t,Qe,0),t.prototype.generateId=function generateId(){return function generateIdImpl(t,r){var o=getClassMetadata(t,Qe);return r.id=o,setClassMetadata(t,Qe,o+1),r.id}(t,this)}),hasOwnPrototypeFunction(t,"toJSON")||(t.prototype.toJSON=function toJSON(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"object"===o(t)&&(r=t,t=""),toJsonImpl(this,0,_objectSpread$1(_objectSpread$1({},r),{},{skipRootToJSON:!0}))}),hasOwnPrototypeFunction(t,"toJsonString")||(t.prototype.toJsonString=function toJsonString(){return toJsonStringImpl(0,this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}),Object.prototype.hasOwnProperty.call(t,"create")||(t.create=function create(r){return createImpl(t,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)}),Object.prototype.hasOwnProperty.call(t,"createArray")||(t.createArray=function createArray(r){return createArrayImpl(t,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)}),Object.prototype.hasOwnProperty.call(t,"createPage")||(t.createPage=function createPage(r){return createPageImpl(t,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)}),Object.prototype.hasOwnProperty.call(t,"isNullishOrEmpty")||(t.isNullishOrEmpty=function isNullishOrEmpty(r){return function isNullishOrEmptyImpl(t,r){if(requirePrototypeMethod(t,"isEmpty"),null==r)return!0;if(!(r instanceof t))throw new TypeError("The object must be an instance of the class ".concat(t.name,"."));return r.isEmpty()}(t,r)}),Object.prototype.hasOwnProperty.call(t,"parseJsonString")||(t.parseJsonString=function parseJsonString(r){return function parseJsonStringImpl(t,r,o){var i=m.parse(r),a=new t;return assignImpl(t,a,i,o)}(t,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)})},exports.NameField=function NameField(t,r){var o=r.kind,i=r.name,a=r.metadata;if("field"!==o)throw new SyntaxError("The decorator @NameField can only decorate a class field: ".concat(i));var c=a[Ze];if(c)throw new SyntaxError('@NameField cannot decorate on "'.concat(i,'", since it has already decorated on "').concat(c,'".'));a[Ze]=i},exports.NonEmpty=function NonEmpty(t,r){var o=r.kind,i=r.name,a=r.metadata;if("field"!==o)throw new SyntaxError("The decorator @NonEmpty can only decorate a class field: ".concat(i));setFieldMetadata(a,i,rt,!0)},exports.Normalizable=function Normalizable(){if(1===arguments.length){var t,r=null!==(t=arguments.length<=0?void 0:arguments[0])&&void 0!==t?t:defaultNormalizer;return function(t,o){return setNormalizer(0,o,r)}}if(2!==arguments.length||!isDecoratorContext(arguments.length<=1?void 0:arguments[1]))throw new SyntaxError("Invalid use of @Normalizable decorator.");setNormalizer(0,arguments.length<=1?void 0:arguments[1],defaultNormalizer)},exports.Nullable=function Nullable(t,r){var o=r.kind,i=r.name,a=r.metadata;if("field"!==o)throw new SyntaxError("The decorator @Nullable can only decorate a class field: ".concat(i));setFieldMetadata(a,i,tt,!0)},exports.Page=yt,exports.Readonly=function Readonly(t,r){if("field"!==r.kind)throw new Error("@Readonly can only be applied to class fields.");var o;return r.addInitializer((function initializer(){void 0!==o?function createImmediateReadonlyInitializer(t,r){return function immediateReadonlyInitializer(){Object.defineProperty(this,t,{value:r,writable:!1,configurable:!1,enumerable:!0})}}(r.name,o).call(this):function createDeferredReadonlyInitializer(t){return function deferredReadonlyInitializer(){var r;Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:function get(){return r},set:function set(o){r=o,Object.defineProperty(this,t,{value:o,writable:!1,configurable:!1,enumerable:!0})}})}}(r.name).call(this)})),function initializer(t){return o=t,t}},exports.Type=function Type(t){return function decorate(r,o){var i=o.kind,a=o.name,c=o.metadata;if("field"!==i)throw new SyntaxError("The decorator @Type can only decorate a class field: ".concat(a));if("function"!=typeof t)throw new TypeError('The argument of @Type decorated on "'.concat(a,'" must be the constructor of a class.'));setFieldMetadata(c,a,Xe,t)}},exports.Validatable=function Validatable(){if(1===arguments.length){var t,r=null!==(t=arguments.length<=0?void 0:arguments[0])&&void 0!==t?t:defaultValidator;return function(t,o){return setValidator(0,o,r)}}if(2!==arguments.length||!isDecoratorContext(arguments.length<=1?void 0:arguments[1]))throw new SyntaxError("Invalid use of @Validatable decorator.");setValidator(0,arguments.length<=1?void 0:arguments[1],defaultValidator)},exports.assign=function assign(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if("object"!==o(t))throw new TypeError("The target object must be an object.");return assignImpl(t.constructor,t,r,i)},exports.create=function create(t,r){return createImpl(t,r,arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0)},exports.createArray=function createArray(t,r){return createArrayImpl(t,r,arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0)},exports.createPage=function createPage(t,r){return createPageImpl(t,r,arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0)},exports.defaultNormalizer=defaultNormalizer,exports.enumNormalizer=enumNormalizer,exports.getDefaultInstance=getDefaultInstance,exports.getFieldElementType=getFieldElementType,exports.getFieldType=getFieldType,exports.getSourceField=getSourceField,exports.hasOwnProperty=hasOwnProperty,exports.hasOwnPrototypeFunction=hasOwnPrototypeFunction,exports.hasProperty=function hasProperty(t,r){if(!t||!t.prototype)return!1;if(Reflect.has(t.prototype,r))return!0;var o=getDefaultInstance(t);return o&&Reflect.has(o,r)},exports.hasPrototypeFunction=hasPrototypeFunction,exports.isEnumClass=isEnumClass,exports.isEnumerator=isEnumerator,exports.normalize=function normalize(t){return defaultNormalizer(t)},exports.stringifyId=function stringifyId(t){return null==t?"":u.isString(t)?t:m.stringify(t)},exports.toJSON=function toJSON(t){return toJsonImpl(t,0,_objectSpread(_objectSpread({},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),{},{skipRootToJSON:!1}))},exports.toJsonString=function toJsonString(t,r){if("object"!==o(t))throw new TypeError("The object to be serialized must be an object.");return t.constructor,toJsonStringImpl(0,t,r)};//# sourceMappingURL=common-decorator.min.cjs.map
1
+ "use strict";var t,r,o=require("@babel/runtime/helpers/typeof"),i=require("@babel/runtime/helpers/defineProperty"),a=require("@qubit-ltd/clone"),u=require("@qubit-ltd/common-util"),l=require("@qubit-ltd/type-detect"),c=require("@babel/runtime/helpers/slicedToArray"),p=require("@qubit-ltd/typeinfo"),y=require("@babel/runtime/helpers/classCallCheck"),d=require("@babel/runtime/helpers/createClass"),m=require("@qubit-ltd/naming-style"),g=require("@qubit-ltd/json"),h=require("@qubit-ltd/validation-rule"),v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},b={},w={};function requireGlobalThis(){if(r)return t;r=1;var check=function(t){return t&&t.Math===Math&&t};return t=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof v&&v)||check("object"==typeof t&&t)||function(){return this}()||Function("return this")()}var O,j,S,T,P,E,N,q,I,_,A,C,D,z,x,M,k,V,R,$,J,U,K,W,L,G,B,H,Q,X,Y,Z,ee,te={exports:{}};function requireDefineGlobalProperty(){if(T)return S;T=1;var t=requireGlobalThis(),r=Object.defineProperty;return S=function(o,i){try{r(t,o,{value:i,configurable:!0,writable:!0})}catch(r){t[o]=i}return i}}function requireSharedStore(){if(P)return te.exports;P=1;var t=function requireIsPure(){return j?O:(j=1,O=!1)}(),r=requireGlobalThis(),o=requireDefineGlobalProperty(),i="__core-js_shared__",a=te.exports=r[i]||o(i,{});return(a.versions||(a.versions=[])).push({version:"3.48.0",mode:t?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.48.0/LICENSE",source:"https://github.com/zloirock/core-js"}),te.exports}function requireShared(){if(N)return E;N=1;var t=requireSharedStore();return E=function(r,o){return t[r]||(t[r]=o||{})}}function requireFails(){return I?q:(I=1,q=function(t){try{return!!t()}catch(t){return!0}})}function requireFunctionBindNative(){if(A)return _;A=1;var t=requireFails();return _=!t(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}function requireFunctionUncurryThis(){if(D)return C;D=1;var t=requireFunctionBindNative(),r=Function.prototype,o=r.call,i=t&&r.bind.bind(o,o);return C=t?i:function(t){return function(){return o.apply(t,arguments)}},C}function requireIsNullOrUndefined(){return x?z:(x=1,z=function(t){return null==t})}function requireRequireObjectCoercible(){if(k)return M;k=1;var t=requireIsNullOrUndefined(),r=TypeError;return M=function(o){if(t(o))throw new r("Can't call method on "+o);return o}}function requireToObject(){if(R)return V;R=1;var t=requireRequireObjectCoercible(),r=Object;return V=function(o){return r(t(o))}}function requireHasOwnProperty(){if(J)return $;J=1;var t=requireFunctionUncurryThis(),r=requireToObject(),o=t({}.hasOwnProperty);return $=Object.hasOwn||function hasOwn(t,i){return o(r(t),i)}}function requireUid(){if(K)return U;K=1;var t=requireFunctionUncurryThis(),r=0,o=Math.random(),i=t(1.1.toString);return U=function(t){return"Symbol("+(void 0===t?"":t)+")_"+i(++r+o,36)}}function requireEnvironmentV8Version(){if(B)return G;B=1;var t,r,o=requireGlobalThis(),i=function requireEnvironmentUserAgent(){if(L)return W;L=1;var t=requireGlobalThis().navigator,r=t&&t.userAgent;return W=r?String(r):""}(),a=o.process,u=o.Deno,l=a&&a.versions||u&&u.version,c=l&&l.v8;return c&&(r=(t=c.split("."))[0]>0&&t[0]<4?1:+(t[0]+t[1])),!r&&i&&(!(t=i.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=i.match(/Chrome\/(\d+)/))&&(r=+t[1]),G=r}function requireSymbolConstructorDetection(){if(Q)return H;Q=1;var t=requireEnvironmentV8Version(),r=requireFails(),o=requireGlobalThis().String;return H=!!Object.getOwnPropertySymbols&&!r(function(){var r=Symbol("symbol detection");return!o(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&t&&t<41})}function requireUseSymbolAsUid(){if(Y)return X;Y=1;var t=requireSymbolConstructorDetection();return X=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function requireWellKnownSymbol(){if(ee)return Z;ee=1;var t=requireGlobalThis(),r=requireShared(),o=requireHasOwnProperty(),i=requireUid(),a=requireSymbolConstructorDetection(),u=requireUseSymbolAsUid(),l=t.Symbol,c=r("wks"),p=u?l.for||l:l&&l.withoutSetter||i;return Z=function(t){return o(c,t)||(c[t]=a&&o(l,t)?l[t]:p("Symbol."+t)),c[t]}}var re,ne,oe,ie,ae,ue,le,ce,se,fe,pe,ye,de,me,ge,he,ve,be,we,Oe,je,Se,Te,Pe,Ee,Ne,Fe,qe,Ie,_e,Ae,Ce,De,ze,xe,Me,ke={};function requireDescriptors(){if(ne)return re;ne=1;var t=requireFails();return re=!t(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function requireIsCallable(){if(ie)return oe;ie=1;var t="object"==typeof document&&document.all;return oe=void 0===t&&void 0!==t?function(r){return"function"==typeof r||r===t}:function(t){return"function"==typeof t}}function requireIsObject(){if(ue)return ae;ue=1;var t=requireIsCallable();return ae=function(r){return"object"==typeof r?null!==r:t(r)}}function requireIe8DomDefine(){if(fe)return se;fe=1;var t=requireDescriptors(),r=requireFails(),o=function requireDocumentCreateElement(){if(ce)return le;ce=1;var t=requireGlobalThis(),r=requireIsObject(),o=t.document,i=r(o)&&r(o.createElement);return le=function(t){return i?o.createElement(t):{}}}();return se=!t&&!r(function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a})}function requireAnObject(){if(me)return de;me=1;var t=requireIsObject(),r=String,o=TypeError;return de=function(i){if(t(i))return i;throw new o(r(i)+" is not an object")}}function requireFunctionCall(){if(he)return ge;he=1;var t=requireFunctionBindNative(),r=Function.prototype.call;return ge=t?r.bind(r):function(){return r.apply(r,arguments)},ge}function requireGetBuiltIn(){if(be)return ve;be=1;var t=requireGlobalThis(),r=requireIsCallable();return ve=function(o,i){return arguments.length<2?(a=t[o],r(a)?a:void 0):t[o]&&t[o][i];var a},ve}function requireIsSymbol(){if(Se)return je;Se=1;var t=requireGetBuiltIn(),r=requireIsCallable(),o=function requireObjectIsPrototypeOf(){if(Oe)return we;Oe=1;var t=requireFunctionUncurryThis();return we=t({}.isPrototypeOf)}(),i=requireUseSymbolAsUid(),a=Object;return je=i?function(t){return"symbol"==typeof t}:function(i){var u=t("Symbol");return r(u)&&o(u.prototype,a(i))}}function requireTryToString(){if(Pe)return Te;Pe=1;var t=String;return Te=function(r){try{return t(r)}catch(t){return"Object"}}}function requireACallable(){if(Ne)return Ee;Ne=1;var t=requireIsCallable(),r=requireTryToString(),o=TypeError;return Ee=function(i){if(t(i))return i;throw new o(r(i)+" is not a function")}}function requireGetMethod(){if(qe)return Fe;qe=1;var t=requireACallable(),r=requireIsNullOrUndefined();return Fe=function(o,i){var a=o[i];return r(a)?void 0:t(a)}}function requireOrdinaryToPrimitive(){if(_e)return Ie;_e=1;var t=requireFunctionCall(),r=requireIsCallable(),o=requireIsObject(),i=TypeError;return Ie=function(a,u){var l,c;if("string"===u&&r(l=a.toString)&&!o(c=t(l,a)))return c;if(r(l=a.valueOf)&&!o(c=t(l,a)))return c;if("string"!==u&&r(l=a.toString)&&!o(c=t(l,a)))return c;throw new i("Can't convert object to primitive value")}}function requireToPrimitive(){if(Ce)return Ae;Ce=1;var t=requireFunctionCall(),r=requireIsObject(),o=requireIsSymbol(),i=requireGetMethod(),a=requireOrdinaryToPrimitive(),u=requireWellKnownSymbol(),l=TypeError,c=u("toPrimitive");return Ae=function(u,p){if(!r(u)||o(u))return u;var y,d=i(u,c);if(d){if(void 0===p&&(p="default"),y=t(d,u,p),!r(y)||o(y))return y;throw new l("Can't convert object to primitive value")}return void 0===p&&(p="number"),a(u,p)}}function requireToPropertyKey(){if(ze)return De;ze=1;var t=requireToPrimitive(),r=requireIsSymbol();return De=function(o){var i=t(o,"string");return r(i)?i:i+""}}function requireObjectDefineProperty(){if(xe)return ke;xe=1;var t=requireDescriptors(),r=requireIe8DomDefine(),o=function requireV8PrototypeDefineBug(){if(ye)return pe;ye=1;var t=requireDescriptors(),r=requireFails();return pe=t&&r(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}(),i=requireAnObject(),a=requireToPropertyKey(),u=TypeError,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,p="enumerable",y="configurable",d="writable";return ke.f=t?o?function defineProperty(t,r,o){if(i(t),r=a(r),i(o),"function"==typeof t&&"prototype"===r&&"value"in o&&d in o&&!o[d]){var u=c(t,r);u&&u[d]&&(t[r]=o.value,o={configurable:y in o?o[y]:u[y],enumerable:p in o?o[p]:u[p],writable:!1})}return l(t,r,o)}:l:function defineProperty(t,o,c){if(i(t),o=a(o),i(c),r)try{return l(t,o,c)}catch(t){}if("get"in c||"set"in c)throw new u("Accessors not supported");return"value"in c&&(t[o]=c.value),t},ke}var Ve,Re,$e={};function requirePath(){if(Re)return Ve;Re=1;var t=requireGlobalThis();return Ve=t}var Je,Ue,Ke,We,Le,Ge={};function requireWellKnownSymbolDefine(){if(Ke)return Ue;Ke=1;var t=requirePath(),r=requireHasOwnProperty(),o=function requireWellKnownSymbolWrapped(){if(Je)return Ge;Je=1;var t=requireWellKnownSymbol();return Ge.f=t,Ge}(),i=requireObjectDefineProperty().f;return Ue=function(a){var u=t.Symbol||(t.Symbol={});r(u,a)||i(u,a,{value:o.f(a)})}}!function requireDecoratorMetadataV2(){return Le||(Le=1,function requireEsnext_function_metadata(){if(Me)return w;Me=1;var t=requireWellKnownSymbol(),r=requireObjectDefineProperty().f,o=t("metadata"),i=Function.prototype;return void 0===i[o]&&r(i,o,{value:null}),w}(),function requireEsnext_symbol_metadata(){return We||(We=1,requireWellKnownSymbolDefine()("metadata")),$e}()),b}();var Be="__cd_category__",He="__cd_default_instance__",Qe="__cd_next_id__",Xe="__cd_name_field__",Ye="__cd_fields_metadata__",Ze="__type__",et="__element_type__",tt="__nullable__",rt="__empty__",nt="__label__",ot="__normalizer__",it="__validator__",at=new WeakMap,ut=function get(t){var r=at.get(t);if(r)return r;var o=t[Symbol.metadata];return o?(at.set(t,o),o):{}},lt=function set(t,r){at.set(t,r)};function getClassMetadata(t,r){if("function"!=typeof t)throw new TypeError("The first argument must be a class constructor.");var o=ut(t);if(o)return o[r]}function isEnumClass(t){return"function"==typeof t&&"enum"===getClassMetadata(t,Be)}function enumNormalizer(t){if(!isEnumClass(t))throw new TypeError("The argument must be the constructor function of an enumeration class decorated by `@Enum`.");return function(r){return t.of(r)}}function defaultNormalizer(t){var r,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};null!=i||(i={}),null!==(o=(r=i).path)&&void 0!==o||(r.path="");var a=p(t);switch(a.category){case"string":return isEnumClass(i.type)?enumNormalizer(i.type)(t):t.trim();case"array":case"typed-array":return t.map(function(t){return defaultNormalizer(t)});case"map":return new Map(Array.from(t,function(t){var r=c(t,2);return[r[0],defaultNormalizer(r[1],i)]}));case"set":return new Set(Array.from(t,function(t){return defaultNormalizer(t,i)}));default:if(a.isBuiltIn)return t;if("function"==typeof t.normalize){var u={path:i.path,types:i.types,elementTypes:i.elementTypes};t.normalize("*",u)}return t}}var ct=d(function DefaultAssignmentOptions(){y(this,DefaultAssignmentOptions),i(this,"normalize",!0),i(this,"convertNaming",!1),i(this,"sourceNamingStyle","LOWER_UNDERSCORE"),i(this,"targetNamingStyle","LOWER_CAMEL"),i(this,"types",{}),i(this,"elementTypes",{})}),st=d(function DefaultToJsonOptions(){y(this,DefaultToJsonOptions),i(this,"normalize",!0),i(this,"removeEmptyFields",!1),i(this,"convertNaming",!1),i(this,"sourceNamingStyle","LOWER_CAMEL"),i(this,"targetNamingStyle","LOWER_UNDERSCORE"),i(this,"space",void 0)});function ownKeys$5(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),o.push.apply(o,i)}return o}function _objectSpread$5(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys$5(Object(o),!0).forEach(function(r){i(t,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys$5(Object(o)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))})}return t}var ft=new Map,pt=function(){return d(function DefaultOptions(){y(this,DefaultOptions)},null,[{key:"get",value:function get(t){var r=ft.get(t);return r?a(r):void 0}},{key:"merge",value:function merge(t,r){var o=ft.get(t);return a(void 0===o?r:_objectSpread$5(_objectSpread$5({},o),r))}},{key:"set",value:function set(t,r){var o=a(r),i=ft.get(t);void 0===i?ft.set(t,o):ft.set(t,_objectSpread$5(_objectSpread$5({},i),o))}},{key:"reset",value:function reset(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(t)switch(t){case"assign":ft.set("assign",new ct);break;case"toJSON":ft.set("toJSON",new st);break;default:throw new Error("Unknown aspect: ".concat(t))}else ft.set("assign",new ct),ft.set("toJSON",new st)}}])}();function ofValueImpl(t,r){if(l.isString(r)){var o=t[String(r).trim().toUpperCase()];return o instanceof t?o:void 0}}function getDefaultInstance(t){if(t.prototype===Object.prototype)return{};var r=ut(t),o=r[He];return o instanceof t||(o=new t,r[He]=o),o}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o={}.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}(t))||r){o&&(t=o);var i=0,a=function F(){};return{s:a,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,l=!0,c=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();return l=t.done,t},e:function e(t){c=!0,u=t},f:function f(){try{l||null==o.return||o.return()}finally{if(c)throw u}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,i=Array(r);o<r;o++)i[o]=t[o];return i}function getFieldMetadataObject(t,r){var o,i;if(null!=t){null!==(o=t[Ye])&&void 0!==o||(t[Ye]={});var a=t[Ye];return null!==(i=a[r])&&void 0!==i||(a[r]={}),a[r]}}function getFieldMetadata(t,r,o){var i=getFieldMetadataObject(t,r);return i?i[o]:void 0}function getFieldElementType(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};null!=o||(o=".".concat(r)),null!=i||(i={});var a=getFieldMetadata(ut(t),r,et);if(a){if("function"!=typeof a)throw new TypeError("The annotated element type of '".concat(t.name,".").concat(o,"' is not a function."));return a}if(i&&i.elementTypes&&i.elementTypes[o]){var u=i.elementTypes[o];if("function"!=typeof u)throw new TypeError("The target element type of '".concat(t.name,".").concat(o,"' is not a function."));return u}var c=getDefaultInstance(t)[r];if(null!=c){var p=function getCollectionElementType(t){var r;if(Array.isArray(t)||l.isTypedArray(t)){if(t.length>0&&"function"==typeof(null===(r=t[0])||void 0===r?void 0:r.constructor))return t[0].constructor}else if(l.isCollection(t)&&t.size>0){var o=t.values().next().value;if(o&&"function"==typeof o.constructor)return o.constructor}return null}(c);if(null!=p)return p}return null}function getFieldType(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};null!=o||(o=".".concat(r)),null!=i||(i={});var a=getFieldMetadata(ut(t),r,Ze);if(a){if("function"!=typeof a)throw new TypeError("The annotated type of '".concat(t.name,".").concat(o,"' is not a function."));return a}if(i&&i.types&&i.types[o]){var u=i.types[o];if("function"!=typeof u)throw new TypeError("The target type of '".concat(t.name,".").concat(o,"' is not a function."));return u}var l=getDefaultInstance(t)[r];if(null!=l&&"function"==typeof l.constructor)return l.constructor}function getSourceField(t,r){if(!0===(null==r?void 0:r.convertNaming)){var o=m.NamingStyle.of(r.sourceNamingStyle);return m.NamingStyle.of(r.targetNamingStyle).to(o,t)}return t}function hasPrototypeFunction(t,r){return null!==t&&t.prototype&&Reflect.has(t.prototype,r)&&"function"==typeof t.prototype[r]}pt.reset();var yt={includeAccessor:!1,includeNonEnumerable:!1,includeReadonly:!0,includeNonConfigurable:!0};function ownKeys$4(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),o.push.apply(o,i)}return o}function _objectSpread$4(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys$4(Object(o),!0).forEach(function(r){i(t,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys$4(Object(o)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))})}return t}var dt={getAllFields:function getAllFields(t,r,o){var i=o.type,a=o.options,u=Object.keys(t),l=Object.getPrototypeOf(i);if(hasPrototypeFunction(l,"assign")){l.prototype.assign.call(t,r,a);var c=getDefaultInstance(l),p=Object.keys(c);return u.filter(function(t){return!p.includes(t)})}return u},copyPropertiesWithoutNamingConversion:function copyPropertiesWithoutNamingConversion(t,r){u.isUndefinedOrNull(r)||Object.keys(t).forEach(function(o){Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=a(r[o],yt))})},cloneEnum:function cloneEnum(t,r){var o=r.sourcePath,i=r.targetType,a=r.defaultInstance;if(null===t)return null;if(void 0===t)return a;if(t instanceof i)return t;if("string"==typeof t){if(0===t.trim().length)return a;var u=ofValueImpl(i,t);if(void 0===u)throw new RangeError("The value of property '".concat(o,"' of the ")+"source object is not an enumerator of ".concat(i.name,": ").concat(t));return u}throw new RangeError("The value of property '".concat(o,"' of the source ")+"object is not an enumerator of ".concat(i.name,": ").concat(t))},cloneWithType:function cloneWithType(t,r){var o=r.targetPath,i=r.sourcePath,c=r.targetType,p=r.defaultInstance,y=r.options;if(u.isUndefinedOrNull(t))return a(p,yt);if(l.isBuiltInClass(c))return null===t?null:void 0===t?p:(t.constructor===c||console.warn("The value of the property '".concat(i,"' of the source ")+"object is not an instance of ".concat(c.name,":"),t),a(t,yt));if("enum"===getClassMetadata(c,Be))return this.cloneEnum(t,{sourcePath:i,targetType:c,defaultInstance:p});var d=new c;return this.doAssign(d,t,{targetPath:o,sourcePath:i,targetType:c,defaultInstance:p,options:y})},cloneArrayWithElementType:function cloneArrayWithElementType(t,r){var o=this,i=r.targetPath,c=r.sourcePath,p=r.elementType,y=r.defaultArray,d=r.options;if(!Array.isArray(t))return console.error("The value of the property '".concat(c,"' of the source ")+"object should be an array:",t),a(y,yt);if(l.isBuiltInClass(p))return a(t,yt);if("enum"===getClassMetadata(p,Be))return t.map(function(t,r){return o.cloneEnum(t,{sourcePath:"".concat(c,"[").concat(r,"]"),targetType:p,defaultInstance:y?y[r]:void 0})});var m=getDefaultInstance(p);return t.map(function(t,r){if(u.isUndefinedOrNull(t))return t;var a=new p,l=y&&y[r]?y[r]:m;return o.doAssign(a,t,{targetPath:"".concat(i,"[").concat(r,"]"),sourcePath:"".concat(c,"[").concat(r,"]"),targetType:p,defaultInstance:l,options:d}),a})},cloneNoType:function cloneNoType(t,r){var o=r.targetPath,i=r.sourcePath,l=r.defaultInstance,c=r.options;if(u.isUndefinedOrNull(l))return a(t,_objectSpread$4(_objectSpread$4({},yt),{},{convertNaming:c.convertNaming,sourceNamingStyle:c.sourceNamingStyle,targetNamingStyle:c.targetNamingStyle}));var p=Object.getPrototypeOf(l).constructor,y=new p;return this.doAssign(y,t,{targetPath:o,sourcePath:i,targetType:p,defaultInstance:l,options:c})},cloneArrayNoElementType:function cloneArrayNoElementType(t,r){var o=r.sourcePath,i=r.defaultArray,u=r.options;return Array.isArray(t)?a(t,_objectSpread$4(_objectSpread$4({},yt),{},{convertNaming:u.convertNaming,sourceNamingStyle:u.sourceNamingStyle,targetNamingStyle:u.targetNamingStyle})):(console.error("The value of the property '".concat(o,"' of the source ")+"object should be an array:",t),a(i,yt))},doAssign:function doAssign(t,r,i){var l=this,c=i.targetPath,p=i.sourcePath,y=i.targetType,d=i.defaultInstance,g=i.options;if(u.isUndefinedOrNull(r))this.copyPropertiesWithoutNamingConversion(t,d);else{var h=null!=d?d:getDefaultInstance(y);this.getAllFields(t,r,{type:y,options:g}).forEach(function(i){var d=h[i],v="".concat(c,".").concat(i),b=getSourceField(i,g),w="".concat(p,".").concat(b),O=r[b],j=getFieldType(y,i,v,g),S=getFieldElementType(y,i,v,g);if(Object.prototype.hasOwnProperty.call(r,b))u.isUndefinedOrNull(O)?t[i]=O:S?t[i]=l.cloneArrayWithElementType(O,{targetPath:v,sourcePath:w,elementType:S,defaultArray:d,options:g}):j?t[i]=l.cloneWithType(O,{targetPath:v,sourcePath:w,targetType:j,defaultInstance:d,options:g}):u.isUndefinedOrNull(d)?t[i]=a(O,_objectSpread$4(_objectSpread$4({},yt),{},{convertNaming:g.convertNaming,sourceNamingStyle:g.sourceNamingStyle,targetNamingStyle:g.targetNamingStyle})):Array.isArray(d)?t[i]=l.cloneArrayNoElementType(O,{targetPath:v,sourcePath:w,defaultArray:d,options:g}):"object"===o(d)?t[i]=l.cloneNoType(O,{targetPath:v,sourcePath:w,defaultInstance:d,options:g}):t[i]=a(O,_objectSpread$4(_objectSpread$4({},yt),{},{convertNaming:g.convertNaming,sourceNamingStyle:g.sourceNamingStyle,targetNamingStyle:g.targetNamingStyle}));else{var T=function getExistFieldWithDifferentNamingStyle(t,r){var o,i=m.NamingStyle.values(),a=_createForOfIteratorHelper(i);try{for(a.s();!(o=a.n()).done;){var u,l=o.value,c=_createForOfIteratorHelper(i);try{for(c.s();!(u=c.n()).done;){var p=u.value,y=l.to(p,t);if(Object.prototype.hasOwnProperty.call(r,y))return y}}catch(t){c.e(t)}finally{c.f()}}}catch(t){a.e(t)}finally{a.f()}}(b,r);T&&(console.warn("Cannot find the source property '".concat(w,"' ")+"for the target property '".concat(v,"'. ")+"But the source object has a property '".concat(p,".").concat(T,"'. ")+"A correct naming conversion may be needed."),console.warn("The source object:",r),console.warn("The target object:",t)),t[i]=a(d,yt)}})}return g.normalize?defaultNormalizer(t):t}};function assignImpl(t,r,o,i){var a=pt.merge("assign",i);return o instanceof t&&(a.convertNaming=!1),dt.doAssign(r,o,{targetPath:"",sourcePath:"",targetType:t,defaultInstance:getDefaultInstance(t),options:a})}function createImpl(t,r,i){if(null==r)return null;if("object"!==o(r))throw new TypeError("The first argument of ".concat(t.name,".create() must be an object."));if(hasPrototypeFunction(t,"assign")){var a=new t;return a.assign(r,i),a}var u=new t;return assignImpl(t,u,r,i)}function createArrayImpl(t,r,o){if(null==r)return null;if(Array.isArray(r))return r.map(function(r){return createImpl(t,r,o)});throw new TypeError("The first argument of ".concat(t.name,".createArray() must be an array."))}var mt=function(){function Page(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];y(this,Page),i(this,"totalCount",0),i(this,"totalPages",0),i(this,"pageIndex",0),i(this,"pageSize",0),i(this,"content",[]),this.totalCount=t,this.totalPages=r,this.pageIndex=o,this.pageSize=a,this.content=u}return d(Page,[{key:"assign",value:function assign(t){return assignImpl(Page,this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)}}],[{key:"newEmpty",value:function newEmpty(t){return new Page(0,0,0,t,[])}},{key:"getFrom",value:function getFrom(t,r){var o=r.length,i=t.pageSize,a=t.pageIndex,u=Math.ceil(o/i),l=a*i,c=Math.min(l+i,o);return new Page(o,u,a,i,r.slice(l,c))}}])}();function ownKeys$3(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),o.push.apply(o,i)}return o}function createPageImpl(t,r,a){if(null==r)return null;if(function isValidPageSource(t,r){var i=pt.merge("assign",r);return null!=t&&"object"===o(t)&&"number"==typeof t[getSourceField("totalCount",i)]&&"number"==typeof t[getSourceField("totalPages",i)]&&"number"==typeof t[getSourceField("pageIndex",i)]&&"number"==typeof t[getSourceField("pageSize",i)]&&Array.isArray(t[getSourceField("content",i)])}(r,a)){var u=new mt,l=function _objectSpread$3(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys$3(Object(o),!0).forEach(function(r){i(t,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys$3(Object(o)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))})}return t}({},a);return l.elementTypes?l.elementTypes[".content"]=t:l.elementTypes={".content":t},assignImpl(mt,u,r,l)}throw new TypeError("Invalid page format: ".concat(g.stringify(r)))}function setFieldMetadata(t,r,o,i){var a=getFieldMetadataObject(t,r);if(!a)throw new Error('The metadata of the field "'.concat(r,'" of the class does not exist.'));a[o]=i}function ofCodeImpl(t,r){if(l.isString(r)){var o=String(r).trim(),i=Object.keys(t).filter(function(r){return t[r]instanceof t}).find(function(r){var i;return(null===(i=t[r])||void 0===i?void 0:i.code)===o});return i?t[i]:void 0}}function ofNameImpl(t,r){if(l.isString(r)){var o=String(r).trim(),i=Object.keys(t).filter(function(r){return t[r]instanceof t}).find(function(r){var i;return(null===(i=t[r])||void 0===i?void 0:i.name)===o});return i?t[i]:void 0}}function ofImpl(t,r){if(null!=r){if(r instanceof t)return r;var o,i;if(l.isString(r))return null!==(o=null!==(i=ofValueImpl(t,r))&&void 0!==i?i:ofNameImpl(t,r))&&void 0!==o?o:ofCodeImpl(t,r)}}function setClassMetadata(t,r,o){var i=ut(t);if(!i)throw new Error('The metadata of the class "'.concat(t.name,'" has not been cached.'));i[r]=o}function isEnumerator(t){if(null==t||"object"!==o(t))return!1;var r=Object.getPrototypeOf(t);return!(!r||!r.constructor)&&"enum"===getClassMetadata(r.constructor,Be)}function hasOwnProperty(t,r){if(!t||!t.prototype)return!1;if(Object.prototype.hasOwnProperty.call(t.prototype,r))return!0;var o=getDefaultInstance(t);return o&&Object.prototype.hasOwnProperty.call(o,r)}function hasOwnPrototypeFunction(t,r){return null!==t&&t.prototype&&Object.prototype.hasOwnProperty.call(t.prototype,r)&&"function"==typeof t.prototype[r]}function requirePrototypeMethod(t,r){if(!hasPrototypeFunction(t,r))throw new TypeError("The class ".concat(t.name,' does not implement the prototype method "').concat(r,'()".'))}function normalizeFieldImpl(t,r,o,i){var a,u;if(null!=i||(i={}),null!==(u=(a=i).path)&&void 0!==u||(a.path=""),!Object.prototype.hasOwnProperty.call(r,o))return!1;var p=Object.getPrototypeOf(t);if(hasOwnPrototypeFunction(p,"normalizeField")&&p.prototype.normalizeField.call(r,o,i))return!0;var y=getFieldMetadata(ut(t),o,ot);if(void 0===y)return!1;var d=r[o];return function normalizeNullishField(t,r,o,i){return null==i}(0,0,0,d)||function normalizeArrayField(t,r,o,i,a,u){if(Array.isArray(i)||l.isTypedArray(i)){var c="".concat(a.path,".").concat(o),p={type:getFieldElementType(t,o,c,a),path:c,types:a.types,elementTypes:a.elementTypes};return r[o]=i.map(function(t){return null==t?t:u(t,p)}),!0}return!1}(t,r,o,d,i,y)||function normalizeSetField(t,r,o,i,a,u){if(i instanceof Set){var l="".concat(a.path,".").concat(o),c={type:getFieldElementType(t,o,l,a),path:l,types:a.types,elementTypes:a.elementTypes};return r[o]=new Set(Array.from(i,function(t){return u(t,c)})),!0}return!1}(t,r,o,d,i,y)||function normalizeMapField(t,r,o,i,a,u){if(i instanceof Map){var l="".concat(a.path,".").concat(o),p={type:getFieldElementType(t,o,l,a),path:l,types:a.types,elementTypes:a.elementTypes};return r[o]=new Map(Array.from(i,function(t){var r=c(t,2),o=r[0],i=r[1];return[o,u(i,p)]})),!0}return!1}(t,r,o,d,i,y)||function normalizeNormalField(t,r,o,i,a,u){var l="".concat(a.path,".").concat(o),c={type:getFieldType(t,o,l,a),path:l,types:a.types,elementTypes:a.elementTypes};return r[o]=u(i,c),!0}(t,r,o,d,i,y)}function ownKeys$2(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),o.push.apply(o,i)}return o}function _objectSpread$2(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys$2(Object(o),!0).forEach(function(r){i(t,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys$2(Object(o)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))})}return t}function toJsonImpl(t,r,o){var i=pt.merge("toJSON",o);i.normalize&&(t=defaultNormalizer(t=a(t,yt)));var u=_objectSpread$2(_objectSpread$2({},yt),{},{pojo:!0,disableHooks:!0,useToJSON:!0,convertNaming:i.convertNaming,sourceNamingStyle:i.sourceNamingStyle,targetNamingStyle:i.targetNamingStyle,removeEmptyFields:i.removeEmptyFields,skipRootToJSON:i.skipRootToJSON});return a(t,u)}function toJsonStringImpl(t,r,o){var i=pt.merge("toJSON",o),a=r.toJSON("",i);return g.stringify(a,null,i.space)}function getFieldLabel(t,r){var o=getFieldMetadata(t,r,nt);return o?o.label:r}function getInstanceName(t,r){var o=t[Xe];return o?r[o]:void 0}function isFieldNonEmpty(t,r){return!0===getFieldMetadata(t,r,rt)}function isFieldNullable(t,r){return!0===getFieldMetadata(t,r,tt)}function getElementValidationContext(t,r,o,i,a){var u,l,c,p,y,d={instance:o,owner:null!==(u=a.owner)&&void 0!==u?u:getInstanceName(r,o),field:i,type:null!==(l=a.type)&&void 0!==l?l:getFieldElementType(t,i),label:null!==(c=a.label)&&void 0!==c?c:getFieldLabel(r,i),nullable:null!==(p=a.nullable)&&void 0!==p?p:isFieldNullable(r,i),nonEmpty:null!==(y=a.nonEmpty)&&void 0!==y?y:isFieldNonEmpty(r,i)};return Object.assign(d,a)}function validateEmptyField(t,r,o,i,a){if(u.isEmpty(i)){if(a.nonEmpty||isFieldNonEmpty(t,o)){var l,c,p=null!==(l=a.label)&&void 0!==l?l:getFieldLabel(t,o),y=null!==(c=a.owner)&&void 0!==c?c:getInstanceName(t,r),d=y?"The ".concat(p," of ").concat(y," cannot be empty."):"The ".concat(p," cannot be empty.");return new h.ValidationResult(!1,d)}return new h.ValidationResult(!0)}return null}function validateNormalField(t,r,o,i,a,u,l){var c=function getValidationContext(t,r,o,i,a){var u,l,c,p,y,d={instance:o,owner:null!==(u=a.owner)&&void 0!==u?u:getInstanceName(r,o),field:i,type:null!==(l=a.type)&&void 0!==l?l:getFieldType(t,i),label:null!==(c=a.label)&&void 0!==c?c:getFieldLabel(r,i),nullable:null!==(p=a.nullable)&&void 0!==p?p:isFieldNullable(r,i),nonEmpty:null!==(y=a.nonEmpty)&&void 0!==y?y:isFieldNonEmpty(r,i)};return Object.assign(d,a)}(t,r,o,i,l);return u(a,c)}function validateFieldImpl(t,r,o,i){var a,u,c;if(!Object.prototype.hasOwnProperty.call(r,o))return null;var p=Object.getPrototypeOf(t);if(hasOwnPrototypeFunction(p,"validateField")){var y=p.prototype.validateField.call(r,o,i);if(null!==y)return y}var d=ut(t),m=getFieldMetadata(d,o,it);if(void 0===m)return new h.ValidationResult(!0);var g=r[o];return null!==(a=null!==(u=null!==(c=function validateArrayField(t,r,o,i,a,u,c){if(Array.isArray(a)||l.isTypedArray(a)){var p=validateEmptyField(r,o,i,a,c);if(p)return p;var y=getElementValidationContext(t,r,o,i,c),d=a.map(function(t,r){return y.index=r,u(t,y)});return h.ValidationResult.merge(d)}return null}(t,d,r,o,g,m,i))&&void 0!==c?c:function validateSetField(t,r,o,i,a,u,l){if(a instanceof Set){var c=validateEmptyField(r,o,i,a,l);if(c)return c;var p=getElementValidationContext(t,r,o,i,l),y=Array.from(a,function(t,r){return p.index=r,u(t,p)});return h.ValidationResult.merge(y)}return null}(t,d,r,o,g,m,i))&&void 0!==u?u:function validateMapField(t,r,o,i,a,u,l){if(a instanceof Map){var c=validateEmptyField(r,o,i,a,l);if(c)return c;var p=getElementValidationContext(t,r,o,i,l),y=Array.from(a,function(t,r){return p.index=r,u(t[1],p)});return h.ValidationResult.merge(y)}return null}(t,d,r,o,g,m,i))&&void 0!==a?a:validateNormalField(t,d,r,o,g,m,i)}function ownKeys$1(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),o.push.apply(o,i)}return o}function _objectSpread$1(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys$1(Object(o),!0).forEach(function(r){i(t,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys$1(Object(o)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))})}return t}function isDecoratorContext(t){return null!==t&&"object"===o(t)&&null!==t.metadata&&"object"===o(t.metadata)&&"string"==typeof t.kind&&"string"==typeof t.name}function setNormalizer(t,r,i){var a=r.metadata,u=r.kind,l=r.name;if("field"!==u)throw new SyntaxError("The @Normalizable must decorate a class field: ".concat(l));if("function"!=typeof i)throw new TypeError('The argument of @Normalizable decorated on the "'.concat(l,'" field must be a function, but it is a ').concat(o(i),"."));setFieldMetadata(a,l,ot,i)}function ownKeys(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),o.push.apply(o,i)}return o}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(o),!0).forEach(function(r){i(t,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))})}return t}function defaultValidator(t,r){var i=r.owner,a=r.type,l=r.label,c=r.nullable,p=r.nonEmpty;if(null==t){if(c)return new h.ValidationResult(!0);var y=i?"必须设置".concat(i,"的").concat(l,"的值"):"必须设置".concat(l,"的值");return new h.ValidationResult(!1,y)}if(u.isEmpty(t)&&p){var d=i?"".concat(i,"的").concat(l,"不能为空"):"".concat(l,"不能为空");return new h.ValidationResult(!1,d)}if(a){if(isEnumClass(a)&&"string"==typeof t){if(a.hasValue(t))return new h.ValidationResult(!0);var m=i?"".concat(i,"的").concat(l,"的值不受支持: ").concat(t):"".concat(l,"的值不受支持: ").concat(t);return new h.ValidationResult(!1,m)}if(t.constructor!==a){var g=i?"".concat(i,"的").concat(l,"必须是 ").concat(a.name," 类型"):"".concat(l,"必须是 ").concat(a.name," 类型");return new h.ValidationResult(!1,g)}}return"object"===o(t)&&"function"==typeof t.validate?t.validate("*",{owner:i}):new h.ValidationResult(!0)}function setValidator(t,r,i){var a=r.metadata,u=r.kind,l=r.name;if("field"!==u)throw new SyntaxError("The @Validatable must decorate a class field: ".concat(l));if("function"!=typeof i)throw new TypeError('The argument of @Validatable decorated on the "'.concat(l,'" field must be a function, but it is a ').concat(o(i),"."));setFieldMetadata(a,l,it,i)}a.registerCloneHook(function(t,r){return isEnumerator(r)?r:null}),exports.DefaultOptions=pt,exports.ElementType=function ElementType(t){return function decorate(r,o){var i=o.kind,a=o.name,u=o.metadata;if("field"!==i)throw new SyntaxError("The decorator @ElementType can only decorate a class field: ".concat(a));if("function"!=typeof t)throw new TypeError('The argument of @ElementType decorated on "'.concat(a,'" must be the constructor of a class.'));return setFieldMetadata(u,a,et,t),function(t){if(null!=t&&!Array.isArray(t))throw new TypeError('The field "'.concat(a,'" decorated by @ElementType must be initialized with an array.'));return t}}},exports.Enum=function Enum(t,r){if(null===r||"object"!==o(r))throw new TypeError("The context must be an object.");if("function"!=typeof t||"class"!==r.kind)throw new TypeError("The `@Enum` can only decorate a class.");lt(t,r.metadata),setClassMetadata(t,Be,"enum"),r.addInitializer(function(){Object.keys(t).forEach(function(r){"function"!=typeof t[r]&&function defineEnumerator(t,r){var i=t[r],a=new t;if(a.value=r,null==i)a.name=r;else if("string"==typeof i)a.name=i;else{if("object"!==o(i))throw new TypeError("The default value of the enumerator "+"".concat(t.name,".").concat(r," should be either a string or an object."));Object.assign(a,i)}Object.freeze(a),t[r]=a}(t,r)}),Object.freeze(t)}),t.prototype.toString=function toString(){return this.value},t.prototype.toJSON=function toJSON(){return this.value},t.values=function values(){return function valuesImpl(t){return Object.keys(t).filter(function(r){return t[r]instanceof t}).map(function(r){return t[r]})}(t)},t.ofValue=function ofValue(r){return ofValueImpl(t,r)},t.hasValue=function hasValue(r){return void 0!==ofValueImpl(t,r)},t.ofName=function ofName(r){return ofNameImpl(t,r)},t.hasName=function hasName(r){return void 0!==ofNameImpl(t,r)},t.ofCode=function ofCode(r){return ofCodeImpl(t,r)},t.hasCode=function hasCode(r){return void 0!==ofCodeImpl(t,r)},t.of=function of(r){return ofImpl(t,r)},t.has=function has(r){return void 0!==ofImpl(t,r)}},exports.Label=function Label(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return function decorate(o,i){var a=i.kind,u=i.name,l=i.metadata;if("field"!==a)throw new SyntaxError("The decorator @Label can only decorate a class field: ".concat(u));if("string"!=typeof t)throw new TypeError('The first argument of @Label decorated on "'.concat(u,'" must be a string.'));if(void 0!==r&&"string"!=typeof r)throw new TypeError('The second argument of @Label decorated on "'.concat(u,'" must be a string.'));setFieldMetadata(l,u,nt,{label:t,i18n:r})}},exports.Model=function Model(t,r){if(null===r||"object"!==o(r))throw new TypeError("The context must be an object.");if("function"!=typeof t||"class"!==r.kind)throw new TypeError("The `@Model` can only decorate a class.");lt(t,r.metadata),setClassMetadata(t,Be,"model"),hasOwnPrototypeFunction(t,"assign")||(t.prototype.assign=function assign(r){return assignImpl(t,this,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)}),hasOwnPrototypeFunction(t,"clear")||(t.prototype.clear=function clear(){return function clearImpl(t,r){requirePrototypeMethod(t,"assign");var o=getDefaultInstance(t);return r.assign(o,{normalize:!1,convertNaming:!1})}(t,this)}),hasOwnPrototypeFunction(t,"clone")||(t.prototype.clone=function clone(){return function cloneImpl(t,r){return requirePrototypeMethod(t,"assign"),(new t).assign(r,{normalize:!1,convertNaming:!1})}(t,this)}),hasOwnPrototypeFunction(t,"isEmpty")||(t.prototype.isEmpty=function isEmpty(){return function isEmptyImpl(t,r){var o=getDefaultInstance(t);return u.deepEqual(r,o)}(t,this)}),hasOwnPrototypeFunction(t,"equals")||(t.prototype.equals=function equals(t){return function equalsImpl(t,r){return t===r||(null==r?null==t:null!=t&&Object.getPrototypeOf(t)===Object.getPrototypeOf(r)&&u.deepEqual(t,r))}(this,t)}),hasOwnPrototypeFunction(t,"normalize")||(t.prototype.normalize=function normalize(){return function normalizeImpl(t,r,o,i){if(null==o||"*"===o)Object.keys(r).forEach(function(t){return r.normalizeField(t,i)});else if(Array.isArray(o))o.forEach(function(t){return r.normalizeField(t,i)});else{if("string"!=typeof o)throw new TypeError("The argument ".concat(t.name,".normalize() must be a string or an array of strings."));r.normalizeField(o,i)}return r}(t,this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:"*",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}),hasOwnPrototypeFunction(t,"normalizeField")||(t.prototype.normalizeField=function normalizeField(r){return normalizeFieldImpl(t,this,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}),hasOwnPrototypeFunction(t,"validate")||(t.prototype.validate=function validate(){return function validateImpl(t,r,o,i){if(null==o||"*"===o){var a=Object.keys(r).map(function(t){return r.validateField(t,i)});return h.ValidationResult.merge(a)}if(Array.isArray(o)){var u=o.map(function(t){return r.validateField(t,i)});return h.ValidationResult.merge(u)}if("string"==typeof o){var l=r.validateField(o,i);return null!=l?l:new h.ValidationResult(!0)}throw new TypeError("The argument of ".concat(t.name,".validate()")+" must be a string or an array of strings.")}(t,this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:"*",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}),hasOwnPrototypeFunction(t,"validateField")||(t.prototype.validateField=function validateField(r){return validateFieldImpl(t,this,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}),hasOwnProperty(t,"id")&&!hasPrototypeFunction(t,"generateId")&&(setClassMetadata(t,Qe,0),t.prototype.generateId=function generateId(){return function generateIdImpl(t,r){var o=getClassMetadata(t,Qe);return r.id=o,setClassMetadata(t,Qe,o+1),r.id}(t,this)}),hasOwnPrototypeFunction(t,"toJSON")||(t.prototype.toJSON=function toJSON(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"object"===o(t)&&(r=t,t=""),toJsonImpl(this,0,_objectSpread$1(_objectSpread$1({},r),{},{skipRootToJSON:!0}))}),hasOwnPrototypeFunction(t,"toJsonString")||(t.prototype.toJsonString=function toJsonString(){return toJsonStringImpl(0,this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}),Object.prototype.hasOwnProperty.call(t,"create")||(t.create=function create(r){return createImpl(t,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)}),Object.prototype.hasOwnProperty.call(t,"createArray")||(t.createArray=function createArray(r){return createArrayImpl(t,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)}),Object.prototype.hasOwnProperty.call(t,"createPage")||(t.createPage=function createPage(r){return createPageImpl(t,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)}),Object.prototype.hasOwnProperty.call(t,"isNullishOrEmpty")||(t.isNullishOrEmpty=function isNullishOrEmpty(r){return function isNullishOrEmptyImpl(t,r){if(requirePrototypeMethod(t,"isEmpty"),null==r)return!0;if(!(r instanceof t))throw new TypeError("The object must be an instance of the class ".concat(t.name,"."));return r.isEmpty()}(t,r)}),Object.prototype.hasOwnProperty.call(t,"parseJsonString")||(t.parseJsonString=function parseJsonString(r){return function parseJsonStringImpl(t,r,o){var i=g.parse(r),a=new t;return assignImpl(t,a,i,o)}(t,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)})},exports.NameField=function NameField(t,r){var o=r.kind,i=r.name,a=r.metadata;if("field"!==o)throw new SyntaxError("The decorator @NameField can only decorate a class field: ".concat(i));var u=a[Xe];if(u)throw new SyntaxError('@NameField cannot decorate on "'.concat(i,'", since it has already decorated on "').concat(u,'".'));a[Xe]=i},exports.NonEmpty=function NonEmpty(t,r){var o=r.kind,i=r.name,a=r.metadata;if("field"!==o)throw new SyntaxError("The decorator @NonEmpty can only decorate a class field: ".concat(i));setFieldMetadata(a,i,rt,!0)},exports.Normalizable=function Normalizable(){if(1===arguments.length){var t,r=null!==(t=arguments.length<=0?void 0:arguments[0])&&void 0!==t?t:defaultNormalizer;return function(t,o){return setNormalizer(0,o,r)}}if(2!==arguments.length||!isDecoratorContext(arguments.length<=1?void 0:arguments[1]))throw new SyntaxError("Invalid use of @Normalizable decorator.");setNormalizer(0,arguments.length<=1?void 0:arguments[1],defaultNormalizer)},exports.Nullable=function Nullable(t,r){var o=r.kind,i=r.name,a=r.metadata;if("field"!==o)throw new SyntaxError("The decorator @Nullable can only decorate a class field: ".concat(i));setFieldMetadata(a,i,tt,!0)},exports.Page=mt,exports.Readonly=function Readonly(t,r){if("field"!==r.kind)throw new Error("@Readonly can only be applied to class fields.");var o;return r.addInitializer(function initializer(){void 0!==o?function createImmediateReadonlyInitializer(t,r){return function immediateReadonlyInitializer(){Object.defineProperty(this,t,{value:r,writable:!1,configurable:!1,enumerable:!0})}}(r.name,o).call(this):function createDeferredReadonlyInitializer(t){return function deferredReadonlyInitializer(){var r;Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:function get(){return r},set:function set(o){r=o,Object.defineProperty(this,t,{value:o,writable:!1,configurable:!1,enumerable:!0})}})}}(r.name).call(this)}),function initializer(t){return o=t,t}},exports.Type=function Type(t){return function decorate(r,o){var i=o.kind,a=o.name,u=o.metadata;if("field"!==i)throw new SyntaxError("The decorator @Type can only decorate a class field: ".concat(a));if("function"!=typeof t)throw new TypeError('The argument of @Type decorated on "'.concat(a,'" must be the constructor of a class.'));setFieldMetadata(u,a,Ze,t)}},exports.Validatable=function Validatable(){if(1===arguments.length){var t,r=null!==(t=arguments.length<=0?void 0:arguments[0])&&void 0!==t?t:defaultValidator;return function(t,o){return setValidator(0,o,r)}}if(2!==arguments.length||!isDecoratorContext(arguments.length<=1?void 0:arguments[1]))throw new SyntaxError("Invalid use of @Validatable decorator.");setValidator(0,arguments.length<=1?void 0:arguments[1],defaultValidator)},exports.assign=function assign(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if("object"!==o(t))throw new TypeError("The target object must be an object.");return assignImpl(t.constructor,t,r,i)},exports.create=function create(t,r){return createImpl(t,r,arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0)},exports.createArray=function createArray(t,r){return createArrayImpl(t,r,arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0)},exports.createPage=function createPage(t,r){return createPageImpl(t,r,arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0)},exports.defaultNormalizer=defaultNormalizer,exports.enumNormalizer=enumNormalizer,exports.getDefaultInstance=getDefaultInstance,exports.getFieldElementType=getFieldElementType,exports.getFieldType=getFieldType,exports.getSourceField=getSourceField,exports.hasOwnProperty=hasOwnProperty,exports.hasOwnPrototypeFunction=hasOwnPrototypeFunction,exports.hasProperty=function hasProperty(t,r){if(!t||!t.prototype)return!1;if(Reflect.has(t.prototype,r))return!0;var o=getDefaultInstance(t);return o&&Reflect.has(o,r)},exports.hasPrototypeFunction=hasPrototypeFunction,exports.isEnumClass=isEnumClass,exports.isEnumerator=isEnumerator,exports.normalize=function normalize(t){return defaultNormalizer(t)},exports.stringifyId=function stringifyId(t){return null==t?"":l.isString(t)?t:g.stringify(t)},exports.toJSON=function toJSON(t){return toJsonImpl(t,0,_objectSpread(_objectSpread({},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),{},{skipRootToJSON:!1}))},exports.toJsonString=function toJsonString(t,r){if("object"!==o(t))throw new TypeError("The object to be serialized must be an object.");return t.constructor,toJsonStringImpl(0,t,r)};//# sourceMappingURL=common-decorator.min.cjs.map