!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o((t="undefined"!=typeof globalThis?globalThis:t||self).ClassTransformer={})}(this,(function(t){"use strict";var o;t.TransformationType=void 0,(o=t.TransformationType||(t.TransformationType={}))[o.PLAIN_TO_CLASS=0]="PLAIN_TO_CLASS",o[o.CLASS_TO_PLAIN=1]="CLASS_TO_PLAIN",o[o.CLASS_TO_CLASS=2]="CLASS_TO_CLASS";var e=new(function(){function o(){this._typeMetadatas=new Map,this._transformMetadatas=new Map,this._exposeMetadatas=new Map,this._excludeMetadatas=new Map,this._ancestorsMap=new Map}return o.prototype.addTypeMetadata=function(t){this._typeMetadatas.has(t.target)||this._typeMetadatas.set(t.target,new Map),this._typeMetadatas.get(t.target).set(t.propertyName,t)},o.prototype.addTransformMetadata=function(t){this._transformMetadatas.has(t.target)||this._transformMetadatas.set(t.target,new Map),this._transformMetadatas.get(t.target).has(t.propertyName)||this._transformMetadatas.get(t.target).set(t.propertyName,[]),this._transformMetadatas.get(t.target).get(t.propertyName).push(t)},o.prototype.addExposeMetadata=function(t){this._exposeMetadatas.has(t.target)||this._exposeMetadatas.set(t.target,new Map),this._exposeMetadatas.get(t.target).set(t.propertyName,t)},o.prototype.addExcludeMetadata=function(t){this._excludeMetadatas.has(t.target)||this._excludeMetadatas.set(t.target,new Map),this._excludeMetadatas.get(t.target).set(t.propertyName,t)},o.prototype.findTransformMetadatas=function(o,e,n){return this.findMetadatas(this._transformMetadatas,o,e).filter((function(o){return!o.options||(!0===o.options.toClassOnly&&!0===o.options.toPlainOnly||(!0===o.options.toClassOnly?n===t.TransformationType.CLASS_TO_CLASS||n===t.TransformationType.PLAIN_TO_CLASS:!0!==o.options.toPlainOnly||n===t.TransformationType.CLASS_TO_PLAIN))}))},o.prototype.findExcludeMetadata=function(t,o){return this.findMetadata(this._excludeMetadatas,t,o)},o.prototype.findExposeMetadata=function(t,o){return this.findMetadata(this._exposeMetadatas,t,o)},o.prototype.findExposeMetadataByCustomName=function(t,o){return this.getExposedMetadatas(t).find((function(t){return t.options&&t.options.name===o}))},o.prototype.findTypeMetadata=function(t,o){return this.findMetadata(this._typeMetadatas,t,o)},o.prototype.getStrategy=function(t){var o=this._excludeMetadatas.get(t),e=o&&o.get(void 0),n=this._exposeMetadatas.get(t),r=n&&n.get(void 0);return e&&r||!e&&!r?"none":e?"excludeAll":"exposeAll"},o.prototype.getExposedMetadatas=function(t){return this.getMetadata(this._exposeMetadatas,t)},o.prototype.getExcludedMetadatas=function(t){return this.getMetadata(this._excludeMetadatas,t)},o.prototype.getExposedProperties=function(o,e){return this.getExposedMetadatas(o).filter((function(o){return!o.options||(!0===o.options.toClassOnly&&!0===o.options.toPlainOnly||(!0===o.options.toClassOnly?e===t.TransformationType.CLASS_TO_CLASS||e===t.TransformationType.PLAIN_TO_CLASS:!0!==o.options.toPlainOnly||e===t.TransformationType.CLASS_TO_PLAIN))})).map((function(t){return t.propertyName}))},o.prototype.getExcludedProperties=function(o,e){return this.getExcludedMetadatas(o).filter((function(o){return!o.options||(!0===o.options.toClassOnly&&!0===o.options.toPlainOnly||(!0===o.options.toClassOnly?e===t.TransformationType.CLASS_TO_CLASS||e===t.TransformationType.PLAIN_TO_CLASS:!0!==o.options.toPlainOnly||e===t.TransformationType.CLASS_TO_PLAIN))})).map((function(t){return t.propertyName}))},o.prototype.clear=function(){this._typeMetadatas.clear(),this._exposeMetadatas.clear(),this._excludeMetadatas.clear(),this._ancestorsMap.clear()},o.prototype.getMetadata=function(t,o){var e,n=t.get(o);n&&(e=Array.from(n.values()).filter((function(t){return void 0!==t.propertyName})));for(var r=[],a=0,i=this.getAncestors(o);a0&&(s=s.filter((function(t){return!f.includes(t)}))),void 0!==this.options.version&&(s=s.filter((function(t){var n=e.findExposeMetadata(o,t);return!n||!n.options||a.checkVersion(n.options.since,n.options.until)}))),s=this.options.groups&&this.options.groups.length?s.filter((function(t){var n=e.findExposeMetadata(o,t);return!n||!n.options||a.checkGroups(n.options.groups)})):s.filter((function(t){var n=e.findExposeMetadata(o,t);return!(n&&n.options&&n.options.groups&&n.options.groups.length)}))}return this.options.excludePrefixes&&this.options.excludePrefixes.length&&(s=s.filter((function(t){return a.options.excludePrefixes.every((function(o){return t.substr(0,o.length)!==o}))}))),s=s.filter((function(t,o,e){return e.indexOf(t)===o}))},o.prototype.checkVersion=function(t,o){var e=!0;return e&&t&&(e=this.options.version>=t),e&&o&&(e=this.options.version