/**
 * Skipped minification because the original files appears to be already minified.
 * Original file: /npm/interceptors@1.0.2/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:true});class Override{constructor(){this.methodInterceptors=[];this.accessInterceptors=[]}}const metaKey="proxy-data";function createOverrideOnMember(targetClass,member){let data=Reflect.getMetadata(metaKey,targetClass);if(!data){Reflect.defineMetadata(metaKey,data=new Map,targetClass)}let override=data.get(member);if(!override){data.set(member,override=new Override)}return override}function proxy(){return targetClass=>{const data=Reflect.getMetadata(metaKey,targetClass);if(!data){return targetClass}return function(){const unproxied=new targetClass(...arguments);const interceptorContext={};const proxyInstance=new Proxy(unproxied,{get(target,p,receiver){const override=data.get(p.toString());if(!override){return unproxied[p]}const name=p.toString();let accessInterceptor=override.accessInterceptors.length;const propertyAccess={get target(){return target},this:target,get member(){return name},get setter(){return false},get persistentContext(){return interceptorContext},value:undefined,next(){if(accessInterceptor>0){return override.accessInterceptors[--accessInterceptor].call(interceptorContext,propertyAccess)}let invokee=propertyAccess.this;if(target===invokee){invokee=unproxied}return invokee[name]}};const accessResult=propertyAccess.next();if(typeof accessResult!=="function"){return accessResult}return function(){let methodInterceptor=override.methodInterceptors.length;const invocation={args:[],get target(){return target},this:propertyAccess.this,get member(){return name},get persistentContext(){return interceptorContext},next(){if(methodInterceptor>0){return override.methodInterceptors[--methodInterceptor].call(interceptorContext,invocation)}return accessResult.apply(invocation.this,invocation.args)}};for(const arg of arguments){invocation.args.push(arg)}return invocation.next()}},set(target,p,value,receiver){const override=data.get(p.toString());if(!override){unproxied[p]=value;return true}const name=p.toString();let accessInterceptor=override.accessInterceptors.length;const propertyAccess={get target(){return target},this:target,get member(){return name},get setter(){return true},get persistentContext(){return interceptorContext},value:value,next(){if(accessInterceptor>0){return override.accessInterceptors[--accessInterceptor].call(interceptorContext,propertyAccess)}let invokee=propertyAccess.this;if(target===invokee){invokee=unproxied}invokee[name]=propertyAccess.value;return true}};return!!propertyAccess.next()}});return proxyInstance}}}exports.proxy=proxy;function around(...interceptors){return function(target,propertyKey,descriptor){createOverrideOnMember(target.constructor,propertyKey.toString()).methodInterceptors.push(...interceptors)}}exports.around=around;function access(...interceptors){return function(target,propertyKey,descriptor){createOverrideOnMember(target.constructor,propertyKey.toString()).accessInterceptors.push(...interceptors)}}exports.access=access;function after(...interceptors){const aroundInterceptors=[];for(const afterInterceptor of interceptors){aroundInterceptors.push(invocation=>{return afterInterceptor(invocation.next())})}return around(...aroundInterceptors)}exports.after=after;function before(...interceptors){const aroundInterceptors=[];for(const beforeInterceptor of interceptors){aroundInterceptors.push(invocation=>{invocation.args=beforeInterceptor(invocation.args);return invocation.next()})}return around(...aroundInterceptors)}exports.before=before;function getter(...interceptors){const accessInterceptors=[];for(const getterInterceptor of interceptors){accessInterceptors.push(acc=>{if(acc.setter){return acc.next()}return getterInterceptor(acc.next())})}return access(...accessInterceptors)}exports.getter=getter;function setter(...interceptors){const accessInterceptors=[];for(const setterInterceptor of interceptors){accessInterceptors.push(acc=>{if(!acc.setter){return acc.next()}acc.value=setterInterceptor(acc.value);return acc.next()})}return access(...accessInterceptors)}exports.setter=setter;