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