@uxland/primary-shell 7.50.6 → 7.50.8

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.
@@ -91,7 +91,7 @@ Registered bindings:`,oe.forEach(function(ne){var de="Object";ne.implementationT
91
91
  `+de,ne.constraint.metaData&&(re=re+" - "+ne.constraint.metaData)})),re}function alreadyDependencyChain(X,W){return X.parentRequest===null?!1:X.parentRequest.serviceIdentifier===W?!0:alreadyDependencyChain(X.parentRequest,W)}function dependencyChainToString(X){function W(re,oe){oe===void 0&&(oe=[]);var ne=getServiceIdentifierAsString(re.serviceIdentifier);return oe.push(ne),re.parentRequest!==null?W(re.parentRequest,oe):oe}var te=W(X);return te.reverse().join(" --> ")}function circularDependencyToException(X){X.childRequests.forEach(function(W){if(alreadyDependencyChain(W,W.serviceIdentifier)){var te=dependencyChainToString(W);throw new Error(CIRCULAR_DEPENDENCY+" "+te)}else circularDependencyToException(W)})}function listMetadataForTarget(X,W){if(W.isTagged()||W.isNamed()){var te="",re=W.getNamedTag(),oe=W.getCustomTags();return re!==null&&(te+=re.toString()+`
92
92
  `),oe!==null&&oe.forEach(function(ne){te+=ne.toString()+`
93
93
  `})," "+X+`
94
- `+X+" - "+te}else return" "+X}function getFunctionName(X){if(X.name)return X.name;var W=X.toString(),te=W.match(/^function\s*([^\s(]+)/);return te?te[1]:"Anonymous function: "+W}function getSymbolDescription(X){return X.toString().slice(7,-1)}var Context=(function(){function X(W){this.id=id(),this.container=W}return X.prototype.addPlan=function(W){this.plan=W},X.prototype.setCurrentRequest=function(W){this.currentRequest=W},X})(),Metadata=(function(){function X(W,te){this.key=W,this.value=te}return X.prototype.toString=function(){return this.key===NAMED_TAG?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},X})(),Plan=(function(){function X(W,te){this.parentContext=W,this.rootRequest=te}return X})(),LazyServiceIdentifier=(function(){function X(W){this._cb=W}return X.prototype.unwrap=function(){return this._cb()},X})(),QueryableString=(function(){function X(W){this.str=W}return X.prototype.startsWith=function(W){return this.str.indexOf(W)===0},X.prototype.endsWith=function(W){var te="",re=W.split("").reverse().join("");return te=this.str.split("").reverse().join(""),this.startsWith.call({str:te},re)},X.prototype.contains=function(W){return this.str.indexOf(W)!==-1},X.prototype.equals=function(W){return this.str===W},X.prototype.value=function(){return this.str},X})(),Target=(function(){function X(W,te,re,oe){this.id=id(),this.type=W,this.serviceIdentifier=re;var ne=typeof te=="symbol"?getSymbolDescription(te):te;this.name=new QueryableString(ne||""),this.identifier=te,this.metadata=new Array;var de=null;typeof oe=="string"?de=new Metadata(NAMED_TAG,oe):oe instanceof Metadata&&(de=oe),de!==null&&this.metadata.push(de)}return X.prototype.hasTag=function(W){for(var te=0,re=this.metadata;te<re.length;te++){var oe=re[te];if(oe.key===W)return!0}return!1},X.prototype.isArray=function(){return this.hasTag(MULTI_INJECT_TAG)},X.prototype.matchesArray=function(W){return this.matchesTag(MULTI_INJECT_TAG)(W)},X.prototype.isNamed=function(){return this.hasTag(NAMED_TAG)},X.prototype.isTagged=function(){return this.metadata.some(function(W){return NON_CUSTOM_TAG_KEYS.every(function(te){return W.key!==te})})},X.prototype.isOptional=function(){return this.matchesTag(OPTIONAL_TAG)(!0)},X.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter(function(W){return W.key===NAMED_TAG})[0]:null},X.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter(function(W){return NON_CUSTOM_TAG_KEYS.every(function(te){return W.key!==te})}):null},X.prototype.matchesNamedTag=function(W){return this.matchesTag(NAMED_TAG)(W)},X.prototype.matchesTag=function(W){var te=this;return function(re){for(var oe=0,ne=te.metadata;oe<ne.length;oe++){var de=ne[oe];if(de.key===W&&de.value===re)return!0}return!1}},X})(),__spreadArray$2=function(X,W,te){if(te||arguments.length===2)for(var re=0,oe=W.length,ne;re<oe;re++)(ne||!(re in W))&&(ne||(ne=Array.prototype.slice.call(W,0,re)),ne[re]=W[re]);return X.concat(ne||Array.prototype.slice.call(W))};function getDependencies$1(X,W){var te=getFunctionName(W);return getTargets(X,te,W,!1)}function getTargets(X,W,te,re){var oe=X.getConstructorMetadata(te),ne=oe.compilerGeneratedMetadata;if(ne===void 0){var de=MISSING_INJECTABLE_ANNOTATION+" "+W+".";throw new Error(de)}var ce=oe.userGeneratedMetadata,ue=Object.keys(ce),pe=te.length===0&&ue.length>0,he=ue.length>te.length,fe=pe||he?ue.length:te.length,be=getConstructorArgsAsTargets(re,W,ne,ce,fe),ge=getClassPropsAsTargets(X,te,W),ve=__spreadArray$2(__spreadArray$2([],be,!0),ge,!0);return ve}function getConstructorArgsAsTarget(X,W,te,re,oe){var ne=oe[X.toString()]||[],de=formatTargetMetadata(ne),ce=de.unmanaged!==!0,ue=re[X],pe=de.inject||de.multiInject;if(ue=pe||ue,ue instanceof LazyServiceIdentifier&&(ue=ue.unwrap()),ce){var he=ue===Object,fe=ue===Function,be=ue===void 0,ge=he||fe||be;if(!W&&ge){var ve=MISSING_INJECT_ANNOTATION+" argument "+X+" in class "+te+".";throw new Error(ve)}var me=new Target(TargetTypeEnum.ConstructorArgument,de.targetName,ue);return me.metadata=ne,me}return null}function getConstructorArgsAsTargets(X,W,te,re,oe){for(var ne=[],de=0;de<oe;de++){var ce=de,ue=getConstructorArgsAsTarget(ce,X,W,te,re);ue!==null&&ne.push(ue)}return ne}function _getServiceIdentifierForProperty(X,W,te,re){var oe=X||W;if(oe===void 0){var ne=MISSING_INJECTABLE_ANNOTATION+" for property "+String(te)+" in class "+re+".";throw new Error(ne)}return oe}function getClassPropsAsTargets(X,W,te){for(var re=X.getPropertiesMetadata(W),oe=[],ne=Object.getOwnPropertySymbols(re),de=Object.keys(re),ce=de.concat(ne),ue=0,pe=ce;ue<pe.length;ue++){var he=pe[ue],fe=re[he],be=formatTargetMetadata(fe),ge=be.targetName||he,ve=_getServiceIdentifierForProperty(be.inject,be.multiInject,he,te),me=new Target(TargetTypeEnum.ClassProperty,ge,ve);me.metadata=fe,oe.push(me)}var _e=Object.getPrototypeOf(W.prototype).constructor;if(_e!==Object){var ye=getClassPropsAsTargets(X,_e,te);oe=__spreadArray$2(__spreadArray$2([],oe,!0),ye,!0)}return oe}function getBaseClassDependencyCount(X,W){var te=Object.getPrototypeOf(W.prototype).constructor;if(te!==Object){var re=getFunctionName(te),oe=getTargets(X,re,te,!0),ne=oe.map(function(ue){return ue.metadata.filter(function(pe){return pe.key===UNMANAGED_TAG})}),de=[].concat.apply([],ne).length,ce=oe.length-de;return ce>0?ce:getBaseClassDependencyCount(X,te)}else return 0}function formatTargetMetadata(X){var W={};return X.forEach(function(te){W[te.key.toString()]=te.value}),{inject:W[INJECT_TAG],multiInject:W[MULTI_INJECT_TAG],targetName:W[NAME_TAG],unmanaged:W[UNMANAGED_TAG]}}var Request=(function(){function X(W,te,re,oe,ne){this.id=id(),this.serviceIdentifier=W,this.parentContext=te,this.parentRequest=re,this.target=ne,this.childRequests=[],this.bindings=Array.isArray(oe)?oe:[oe],this.requestScope=re===null?new Map:null}return X.prototype.addChildRequest=function(W,te,re){var oe=new X(W,this.parentContext,this,te,re);return this.childRequests.push(oe),oe},X})();function getBindingDictionary(X){return X._bindingDictionary}function _createTarget(X,W,te,re,oe,ne){var de=X?MULTI_INJECT_TAG:INJECT_TAG,ce=new Metadata(de,te),ue=new Target(W,re,te,ce);if(oe!==void 0){var pe=new Metadata(oe,ne);ue.metadata.push(pe)}return ue}function _getActiveBindings(X,W,te,re,oe){var ne=getBindings(te.container,oe.serviceIdentifier),de=[];return ne.length===BindingCount.NoBindingsAvailable&&te.container.options.autoBindInjectable&&typeof oe.serviceIdentifier=="function"&&X.getConstructorMetadata(oe.serviceIdentifier).compilerGeneratedMetadata&&(te.container.bind(oe.serviceIdentifier).toSelf(),ne=getBindings(te.container,oe.serviceIdentifier)),W?de=ne:de=ne.filter(function(ce){var ue=new Request(ce.serviceIdentifier,te,re,ce,oe);return ce.constraint(ue)}),_validateActiveBindingCount(oe.serviceIdentifier,de,oe,te.container),de}function _validateActiveBindingCount(X,W,te,re){switch(W.length){case BindingCount.NoBindingsAvailable:if(te.isOptional())return W;var oe=getServiceIdentifierAsString(X),ne=NOT_REGISTERED;throw ne+=listMetadataForTarget(oe,te),ne+=listRegisteredBindingsForServiceIdentifier(re,oe,getBindings),new Error(ne);case BindingCount.OnlyOneBindingAvailable:return W;case BindingCount.MultipleBindingsAvailable:default:if(te.isArray())return W;var oe=getServiceIdentifierAsString(X),ne=AMBIGUOUS_MATCH+" "+oe;throw ne+=listRegisteredBindingsForServiceIdentifier(re,oe,getBindings),new Error(ne)}}function _createSubRequests(X,W,te,re,oe,ne){var de,ce;if(oe===null){de=_getActiveBindings(X,W,re,null,ne),ce=new Request(te,re,null,de,ne);var ue=new Plan(re,ce);re.addPlan(ue)}else de=_getActiveBindings(X,W,re,oe,ne),ce=oe.addChildRequest(ne.serviceIdentifier,de,ne);de.forEach(function(pe){var he=null;if(ne.isArray())he=ce.addChildRequest(pe.serviceIdentifier,pe,ne);else{if(pe.cache)return;he=ce}if(pe.type===BindingTypeEnum.Instance&&pe.implementationType!==null){var fe=getDependencies$1(X,pe.implementationType);if(!re.container.options.skipBaseClassChecks){var be=getBaseClassDependencyCount(X,pe.implementationType);if(fe.length<be){var ge=ARGUMENTS_LENGTH_MISMATCH(getFunctionName(pe.implementationType));throw new Error(ge)}}fe.forEach(function(ve){_createSubRequests(X,!1,ve.serviceIdentifier,re,he,ve)})}})}function getBindings(X,W){var te=[],re=getBindingDictionary(X);return re.hasKey(W)?te=re.get(W):X.parent!==null&&(te=getBindings(X.parent,W)),te}function plan(X,W,te,re,oe,ne,de,ce){ce===void 0&&(ce=!1);var ue=new Context(W),pe=_createTarget(te,re,oe,"",ne,de);try{return _createSubRequests(X,ce,oe,ue,null,pe),ue}catch(he){throw isStackOverflowExeption(he)&&circularDependencyToException(ue.plan.rootRequest),he}}function createMockRequest(X,W,te,re){var oe=new Target(TargetTypeEnum.Variable,"",W,new Metadata(te,re)),ne=new Context(X),de=new Request(W,ne,null,[],oe);return de}function isPromise$1(X){var W=typeof X=="object"&&X!==null||typeof X=="function";return W&&typeof X.then=="function"}function isPromiseOrContainsPromise(X){return isPromise$1(X)?!0:Array.isArray(X)&&X.some(isPromise$1)}var __awaiter$3=function(X,W,te,re){function oe(ne){return ne instanceof te?ne:new te(function(de){de(ne)})}return new(te||(te=Promise))(function(ne,de){function ce(he){try{pe(re.next(he))}catch(fe){de(fe)}}function ue(he){try{pe(re.throw(he))}catch(fe){de(fe)}}function pe(he){he.done?ne(he.value):oe(he.value).then(ce,ue)}pe((re=re.apply(X,W||[])).next())})},__generator$3=function(X,W){var te={label:0,sent:function(){if(ne[0]&1)throw ne[1];return ne[1]},trys:[],ops:[]},re,oe,ne,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(pe){return function(he){return ue([pe,he])}}function ue(pe){if(re)throw new TypeError("Generator is already executing.");for(;te;)try{if(re=1,oe&&(ne=pe[0]&2?oe.return:pe[0]?oe.throw||((ne=oe.return)&&ne.call(oe),0):oe.next)&&!(ne=ne.call(oe,pe[1])).done)return ne;switch(oe=0,ne&&(pe=[pe[0]&2,ne.value]),pe[0]){case 0:case 1:ne=pe;break;case 4:return te.label++,{value:pe[1],done:!1};case 5:te.label++,oe=pe[1],pe=[0];continue;case 7:pe=te.ops.pop(),te.trys.pop();continue;default:if(ne=te.trys,!(ne=ne.length>0&&ne[ne.length-1])&&(pe[0]===6||pe[0]===2)){te=0;continue}if(pe[0]===3&&(!ne||pe[1]>ne[0]&&pe[1]<ne[3])){te.label=pe[1];break}if(pe[0]===6&&te.label<ne[1]){te.label=ne[1],ne=pe;break}if(ne&&te.label<ne[2]){te.label=ne[2],te.ops.push(pe);break}ne[2]&&te.ops.pop(),te.trys.pop();continue}pe=W.call(X,te)}catch(he){pe=[6,he],oe=0}finally{re=ne=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}},tryGetFromScope=function(X,W){return W.scope===BindingScopeEnum.Singleton&&W.activated?W.cache:W.scope===BindingScopeEnum.Request&&X.has(W.id)?X.get(W.id):null},saveToScope=function(X,W,te){W.scope===BindingScopeEnum.Singleton&&_saveToSingletonScope(W,te),W.scope===BindingScopeEnum.Request&&_saveToRequestScope(X,W,te)},_saveToRequestScope=function(X,W,te){X.has(W.id)||X.set(W.id,te)},_saveToSingletonScope=function(X,W){X.cache=W,X.activated=!0,isPromise$1(W)&&_saveAsyncResultToSingletonScope(X,W)},_saveAsyncResultToSingletonScope=function(X,W){return __awaiter$3(void 0,void 0,void 0,function(){var te,re;return __generator$3(this,function(oe){switch(oe.label){case 0:return oe.trys.push([0,2,,3]),[4,W];case 1:return te=oe.sent(),X.cache=te,[3,3];case 2:throw re=oe.sent(),X.cache=null,X.activated=!1,re;case 3:return[2]}})})},FactoryType;(function(X){X.DynamicValue="toDynamicValue",X.Factory="toFactory",X.Provider="toProvider"})(FactoryType||(FactoryType={}));var ensureFullyBound=function(X){var W=null;switch(X.type){case BindingTypeEnum.ConstantValue:case BindingTypeEnum.Function:W=X.cache;break;case BindingTypeEnum.Constructor:case BindingTypeEnum.Instance:W=X.implementationType;break;case BindingTypeEnum.DynamicValue:W=X.dynamicValue;break;case BindingTypeEnum.Provider:W=X.provider;break;case BindingTypeEnum.Factory:W=X.factory;break}if(W===null){var te=getServiceIdentifierAsString(X.serviceIdentifier);throw new Error(INVALID_BINDING_TYPE+" "+te)}},getFactoryDetails=function(X){switch(X.type){case BindingTypeEnum.Factory:return{factory:X.factory,factoryType:FactoryType.Factory};case BindingTypeEnum.Provider:return{factory:X.provider,factoryType:FactoryType.Provider};case BindingTypeEnum.DynamicValue:return{factory:X.dynamicValue,factoryType:FactoryType.DynamicValue};default:throw new Error("Unexpected factory type "+X.type)}},__assign$4=function(){return __assign$4=Object.assign||function(X){for(var W,te=1,re=arguments.length;te<re;te++){W=arguments[te];for(var oe in W)Object.prototype.hasOwnProperty.call(W,oe)&&(X[oe]=W[oe])}return X},__assign$4.apply(this,arguments)},__awaiter$2=function(X,W,te,re){function oe(ne){return ne instanceof te?ne:new te(function(de){de(ne)})}return new(te||(te=Promise))(function(ne,de){function ce(he){try{pe(re.next(he))}catch(fe){de(fe)}}function ue(he){try{pe(re.throw(he))}catch(fe){de(fe)}}function pe(he){he.done?ne(he.value):oe(he.value).then(ce,ue)}pe((re=re.apply(X,W||[])).next())})},__generator$2=function(X,W){var te={label:0,sent:function(){if(ne[0]&1)throw ne[1];return ne[1]},trys:[],ops:[]},re,oe,ne,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(pe){return function(he){return ue([pe,he])}}function ue(pe){if(re)throw new TypeError("Generator is already executing.");for(;te;)try{if(re=1,oe&&(ne=pe[0]&2?oe.return:pe[0]?oe.throw||((ne=oe.return)&&ne.call(oe),0):oe.next)&&!(ne=ne.call(oe,pe[1])).done)return ne;switch(oe=0,ne&&(pe=[pe[0]&2,ne.value]),pe[0]){case 0:case 1:ne=pe;break;case 4:return te.label++,{value:pe[1],done:!1};case 5:te.label++,oe=pe[1],pe=[0];continue;case 7:pe=te.ops.pop(),te.trys.pop();continue;default:if(ne=te.trys,!(ne=ne.length>0&&ne[ne.length-1])&&(pe[0]===6||pe[0]===2)){te=0;continue}if(pe[0]===3&&(!ne||pe[1]>ne[0]&&pe[1]<ne[3])){te.label=pe[1];break}if(pe[0]===6&&te.label<ne[1]){te.label=ne[1],ne=pe;break}if(ne&&te.label<ne[2]){te.label=ne[2],te.ops.push(pe);break}ne[2]&&te.ops.pop(),te.trys.pop();continue}pe=W.call(X,te)}catch(he){pe=[6,he],oe=0}finally{re=ne=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}},__spreadArray$1=function(X,W,te){if(te||arguments.length===2)for(var re=0,oe=W.length,ne;re<oe;re++)(ne||!(re in W))&&(ne||(ne=Array.prototype.slice.call(W,0,re)),ne[re]=W[re]);return X.concat(ne||Array.prototype.slice.call(W))};function _resolveRequests(X,W){return X.reduce(function(te,re){var oe=W(re),ne=re.target.type;return ne===TargetTypeEnum.ConstructorArgument?te.constructorInjections.push(oe):(te.propertyRequests.push(re),te.propertyInjections.push(oe)),te.isAsync||(te.isAsync=isPromiseOrContainsPromise(oe)),te},{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}function _createInstance(X,W,te){var re;if(W.length>0){var oe=_resolveRequests(W,te),ne=__assign$4(__assign$4({},oe),{constr:X});oe.isAsync?re=createInstanceWithInjectionsAsync(ne):re=createInstanceWithInjections(ne)}else re=new X;return re}function createInstanceWithInjections(X){var W,te=new((W=X.constr).bind.apply(W,__spreadArray$1([void 0],X.constructorInjections,!1)));return X.propertyRequests.forEach(function(re,oe){var ne=re.target.identifier,de=X.propertyInjections[oe];(!re.target.isOptional()||de!==void 0)&&(te[ne]=de)}),te}function createInstanceWithInjectionsAsync(X){return __awaiter$2(this,void 0,void 0,function(){var W,te;return __generator$2(this,function(re){switch(re.label){case 0:return[4,possiblyWaitInjections(X.constructorInjections)];case 1:return W=re.sent(),[4,possiblyWaitInjections(X.propertyInjections)];case 2:return te=re.sent(),[2,createInstanceWithInjections(__assign$4(__assign$4({},X),{constructorInjections:W,propertyInjections:te}))]}})})}function possiblyWaitInjections(X){return __awaiter$2(this,void 0,void 0,function(){var W,te,re,oe;return __generator$2(this,function(ne){for(W=[],te=0,re=X;te<re.length;te++)oe=re[te],Array.isArray(oe)?W.push(Promise.all(oe)):W.push(oe);return[2,Promise.all(W)]})})}function _getInstanceAfterPostConstruct(X,W){var te=_postConstruct(X,W);return isPromise$1(te)?te.then(function(){return W}):W}function _postConstruct(X,W){var te,re;if(Reflect.hasMetadata(POST_CONSTRUCT,X)){var oe=Reflect.getMetadata(POST_CONSTRUCT,X);try{return(re=(te=W)[oe.value])===null||re===void 0?void 0:re.call(te)}catch(ne){if(ne instanceof Error)throw new Error(POST_CONSTRUCT_ERROR(X.name,ne.message))}}}function _validateInstanceResolution(X,W){X.scope!==BindingScopeEnum.Singleton&&_throwIfHandlingDeactivation(X,W)}function _throwIfHandlingDeactivation(X,W){var te="Class cannot be instantiated in "+(X.scope===BindingScopeEnum.Request?"request":"transient")+" scope.";if(typeof X.onDeactivation=="function")throw new Error(ON_DEACTIVATION_ERROR(W.name,te));if(Reflect.hasMetadata(PRE_DESTROY,W))throw new Error(PRE_DESTROY_ERROR(W.name,te))}function resolveInstance(X,W,te,re){_validateInstanceResolution(X,W);var oe=_createInstance(W,te,re);return isPromise$1(oe)?oe.then(function(ne){return _getInstanceAfterPostConstruct(W,ne)}):_getInstanceAfterPostConstruct(W,oe)}var __awaiter$1=function(X,W,te,re){function oe(ne){return ne instanceof te?ne:new te(function(de){de(ne)})}return new(te||(te=Promise))(function(ne,de){function ce(he){try{pe(re.next(he))}catch(fe){de(fe)}}function ue(he){try{pe(re.throw(he))}catch(fe){de(fe)}}function pe(he){he.done?ne(he.value):oe(he.value).then(ce,ue)}pe((re=re.apply(X,W||[])).next())})},__generator$1=function(X,W){var te={label:0,sent:function(){if(ne[0]&1)throw ne[1];return ne[1]},trys:[],ops:[]},re,oe,ne,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(pe){return function(he){return ue([pe,he])}}function ue(pe){if(re)throw new TypeError("Generator is already executing.");for(;te;)try{if(re=1,oe&&(ne=pe[0]&2?oe.return:pe[0]?oe.throw||((ne=oe.return)&&ne.call(oe),0):oe.next)&&!(ne=ne.call(oe,pe[1])).done)return ne;switch(oe=0,ne&&(pe=[pe[0]&2,ne.value]),pe[0]){case 0:case 1:ne=pe;break;case 4:return te.label++,{value:pe[1],done:!1};case 5:te.label++,oe=pe[1],pe=[0];continue;case 7:pe=te.ops.pop(),te.trys.pop();continue;default:if(ne=te.trys,!(ne=ne.length>0&&ne[ne.length-1])&&(pe[0]===6||pe[0]===2)){te=0;continue}if(pe[0]===3&&(!ne||pe[1]>ne[0]&&pe[1]<ne[3])){te.label=pe[1];break}if(pe[0]===6&&te.label<ne[1]){te.label=ne[1],ne=pe;break}if(ne&&te.label<ne[2]){te.label=ne[2],te.ops.push(pe);break}ne[2]&&te.ops.pop(),te.trys.pop();continue}pe=W.call(X,te)}catch(he){pe=[6,he],oe=0}finally{re=ne=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}},_resolveRequest=function(X){return function(W){W.parentContext.setCurrentRequest(W);var te=W.bindings,re=W.childRequests,oe=W.target&&W.target.isArray(),ne=!W.parentRequest||!W.parentRequest.target||!W.target||!W.parentRequest.target.matchesArray(W.target.serviceIdentifier);if(oe&&ne)return re.map(function(ce){var ue=_resolveRequest(X);return ue(ce)});if(W.target.isOptional()&&te.length===0)return;var de=te[0];return _resolveBinding(X,W,de)}},_resolveFactoryFromBinding=function(X,W){var te=getFactoryDetails(X);return tryAndThrowErrorIfStackOverflow(function(){return te.factory.bind(X)(W)},function(){return new Error(CIRCULAR_DEPENDENCY_IN_FACTORY(te.factoryType,W.currentRequest.serviceIdentifier.toString()))})},_getResolvedFromBinding=function(X,W,te){var re,oe=W.childRequests;switch(ensureFullyBound(te),te.type){case BindingTypeEnum.ConstantValue:case BindingTypeEnum.Function:re=te.cache;break;case BindingTypeEnum.Constructor:re=te.implementationType;break;case BindingTypeEnum.Instance:re=resolveInstance(te,te.implementationType,oe,_resolveRequest(X));break;default:re=_resolveFactoryFromBinding(te,W.parentContext)}return re},_resolveInScope=function(X,W,te){var re=tryGetFromScope(X,W);return re!==null||(re=te(),saveToScope(X,W,re)),re},_resolveBinding=function(X,W,te){return _resolveInScope(X,te,function(){var re=_getResolvedFromBinding(X,W,te);return isPromise$1(re)?re=re.then(function(oe){return _onActivation(W,te,oe)}):re=_onActivation(W,te,re),re})};function _onActivation(X,W,te){var re=_bindingActivation(X.parentContext,W,te),oe=_getContainersIterator(X.parentContext.container),ne,de=oe.next();do{ne=de.value;var ce=X.parentContext,ue=X.serviceIdentifier,pe=_getContainerActivationsForService(ne,ue);isPromise$1(re)?re=_activateContainerAsync(pe,ce,re):re=_activateContainer(pe,ce,re),de=oe.next()}while(de.done!==!0&&!getBindingDictionary(ne).hasKey(X.serviceIdentifier));return re}var _bindingActivation=function(X,W,te){var re;return typeof W.onActivation=="function"?re=W.onActivation(X,te):re=te,re},_activateContainer=function(X,W,te){for(var re=X.next();!re.done;){if(te=re.value(W,te),isPromise$1(te))return _activateContainerAsync(X,W,te);re=X.next()}return te},_activateContainerAsync=function(X,W,te){return __awaiter$1(void 0,void 0,void 0,function(){var re,oe;return __generator$1(this,function(ne){switch(ne.label){case 0:return[4,te];case 1:re=ne.sent(),oe=X.next(),ne.label=2;case 2:return oe.done?[3,4]:[4,oe.value(W,re)];case 3:return re=ne.sent(),oe=X.next(),[3,2];case 4:return[2,re]}})})},_getContainerActivationsForService=function(X,W){var te=X._activations;return te.hasKey(W)?te.get(W).values():[].values()},_getContainersIterator=function(X){for(var W=[X],te=X.parent;te!==null;)W.push(te),te=te.parent;var re=function(){var ne=W.pop();return ne!==void 0?{done:!1,value:ne}:{done:!0,value:void 0}},oe={next:re};return oe};function resolve(X){var W=_resolveRequest(X.plan.rootRequest.requestScope);return W(X.plan.rootRequest)}var traverseAncerstors=function(X,W){var te=X.parentRequest;return te!==null?W(te)?!0:traverseAncerstors(te,W):!1},taggedConstraint=function(X){return function(W){var te=function(re){return re!==null&&re.target!==null&&re.target.matchesTag(X)(W)};return te.metaData=new Metadata(X,W),te}},namedConstraint=taggedConstraint(NAMED_TAG),typeConstraint=function(X){return function(W){var te=null;if(W!==null)if(te=W.bindings[0],typeof X=="string"){var re=te.serviceIdentifier;return re===X}else{var oe=W.bindings[0].implementationType;return X===oe}return!1}},BindingWhenSyntax=(function(){function X(W){this._binding=W}return X.prototype.when=function(W){return this._binding.constraint=W,new BindingOnSyntax(this._binding)},X.prototype.whenTargetNamed=function(W){return this._binding.constraint=namedConstraint(W),new BindingOnSyntax(this._binding)},X.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(W){if(W===null)return!1;var te=W.target!==null&&!W.target.isNamed()&&!W.target.isTagged();return te},new BindingOnSyntax(this._binding)},X.prototype.whenTargetTagged=function(W,te){return this._binding.constraint=taggedConstraint(W)(te),new BindingOnSyntax(this._binding)},X.prototype.whenInjectedInto=function(W){return this._binding.constraint=function(te){return te!==null&&typeConstraint(W)(te.parentRequest)},new BindingOnSyntax(this._binding)},X.prototype.whenParentNamed=function(W){return this._binding.constraint=function(te){return te!==null&&namedConstraint(W)(te.parentRequest)},new BindingOnSyntax(this._binding)},X.prototype.whenParentTagged=function(W,te){return this._binding.constraint=function(re){return re!==null&&taggedConstraint(W)(te)(re.parentRequest)},new BindingOnSyntax(this._binding)},X.prototype.whenAnyAncestorIs=function(W){return this._binding.constraint=function(te){return te!==null&&traverseAncerstors(te,typeConstraint(W))},new BindingOnSyntax(this._binding)},X.prototype.whenNoAncestorIs=function(W){return this._binding.constraint=function(te){return te!==null&&!traverseAncerstors(te,typeConstraint(W))},new BindingOnSyntax(this._binding)},X.prototype.whenAnyAncestorNamed=function(W){return this._binding.constraint=function(te){return te!==null&&traverseAncerstors(te,namedConstraint(W))},new BindingOnSyntax(this._binding)},X.prototype.whenNoAncestorNamed=function(W){return this._binding.constraint=function(te){return te!==null&&!traverseAncerstors(te,namedConstraint(W))},new BindingOnSyntax(this._binding)},X.prototype.whenAnyAncestorTagged=function(W,te){return this._binding.constraint=function(re){return re!==null&&traverseAncerstors(re,taggedConstraint(W)(te))},new BindingOnSyntax(this._binding)},X.prototype.whenNoAncestorTagged=function(W,te){return this._binding.constraint=function(re){return re!==null&&!traverseAncerstors(re,taggedConstraint(W)(te))},new BindingOnSyntax(this._binding)},X.prototype.whenAnyAncestorMatches=function(W){return this._binding.constraint=function(te){return te!==null&&traverseAncerstors(te,W)},new BindingOnSyntax(this._binding)},X.prototype.whenNoAncestorMatches=function(W){return this._binding.constraint=function(te){return te!==null&&!traverseAncerstors(te,W)},new BindingOnSyntax(this._binding)},X})(),BindingOnSyntax=(function(){function X(W){this._binding=W}return X.prototype.onActivation=function(W){return this._binding.onActivation=W,new BindingWhenSyntax(this._binding)},X.prototype.onDeactivation=function(W){return this._binding.onDeactivation=W,new BindingWhenSyntax(this._binding)},X})(),BindingWhenOnSyntax=(function(){function X(W){this._binding=W,this._bindingWhenSyntax=new BindingWhenSyntax(this._binding),this._bindingOnSyntax=new BindingOnSyntax(this._binding)}return X.prototype.when=function(W){return this._bindingWhenSyntax.when(W)},X.prototype.whenTargetNamed=function(W){return this._bindingWhenSyntax.whenTargetNamed(W)},X.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},X.prototype.whenTargetTagged=function(W,te){return this._bindingWhenSyntax.whenTargetTagged(W,te)},X.prototype.whenInjectedInto=function(W){return this._bindingWhenSyntax.whenInjectedInto(W)},X.prototype.whenParentNamed=function(W){return this._bindingWhenSyntax.whenParentNamed(W)},X.prototype.whenParentTagged=function(W,te){return this._bindingWhenSyntax.whenParentTagged(W,te)},X.prototype.whenAnyAncestorIs=function(W){return this._bindingWhenSyntax.whenAnyAncestorIs(W)},X.prototype.whenNoAncestorIs=function(W){return this._bindingWhenSyntax.whenNoAncestorIs(W)},X.prototype.whenAnyAncestorNamed=function(W){return this._bindingWhenSyntax.whenAnyAncestorNamed(W)},X.prototype.whenAnyAncestorTagged=function(W,te){return this._bindingWhenSyntax.whenAnyAncestorTagged(W,te)},X.prototype.whenNoAncestorNamed=function(W){return this._bindingWhenSyntax.whenNoAncestorNamed(W)},X.prototype.whenNoAncestorTagged=function(W,te){return this._bindingWhenSyntax.whenNoAncestorTagged(W,te)},X.prototype.whenAnyAncestorMatches=function(W){return this._bindingWhenSyntax.whenAnyAncestorMatches(W)},X.prototype.whenNoAncestorMatches=function(W){return this._bindingWhenSyntax.whenNoAncestorMatches(W)},X.prototype.onActivation=function(W){return this._bindingOnSyntax.onActivation(W)},X.prototype.onDeactivation=function(W){return this._bindingOnSyntax.onDeactivation(W)},X})(),BindingInSyntax=(function(){function X(W){this._binding=W}return X.prototype.inRequestScope=function(){return this._binding.scope=BindingScopeEnum.Request,new BindingWhenOnSyntax(this._binding)},X.prototype.inSingletonScope=function(){return this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.inTransientScope=function(){return this._binding.scope=BindingScopeEnum.Transient,new BindingWhenOnSyntax(this._binding)},X})(),BindingInWhenOnSyntax=(function(){function X(W){this._binding=W,this._bindingWhenSyntax=new BindingWhenSyntax(this._binding),this._bindingOnSyntax=new BindingOnSyntax(this._binding),this._bindingInSyntax=new BindingInSyntax(W)}return X.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},X.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},X.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},X.prototype.when=function(W){return this._bindingWhenSyntax.when(W)},X.prototype.whenTargetNamed=function(W){return this._bindingWhenSyntax.whenTargetNamed(W)},X.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},X.prototype.whenTargetTagged=function(W,te){return this._bindingWhenSyntax.whenTargetTagged(W,te)},X.prototype.whenInjectedInto=function(W){return this._bindingWhenSyntax.whenInjectedInto(W)},X.prototype.whenParentNamed=function(W){return this._bindingWhenSyntax.whenParentNamed(W)},X.prototype.whenParentTagged=function(W,te){return this._bindingWhenSyntax.whenParentTagged(W,te)},X.prototype.whenAnyAncestorIs=function(W){return this._bindingWhenSyntax.whenAnyAncestorIs(W)},X.prototype.whenNoAncestorIs=function(W){return this._bindingWhenSyntax.whenNoAncestorIs(W)},X.prototype.whenAnyAncestorNamed=function(W){return this._bindingWhenSyntax.whenAnyAncestorNamed(W)},X.prototype.whenAnyAncestorTagged=function(W,te){return this._bindingWhenSyntax.whenAnyAncestorTagged(W,te)},X.prototype.whenNoAncestorNamed=function(W){return this._bindingWhenSyntax.whenNoAncestorNamed(W)},X.prototype.whenNoAncestorTagged=function(W,te){return this._bindingWhenSyntax.whenNoAncestorTagged(W,te)},X.prototype.whenAnyAncestorMatches=function(W){return this._bindingWhenSyntax.whenAnyAncestorMatches(W)},X.prototype.whenNoAncestorMatches=function(W){return this._bindingWhenSyntax.whenNoAncestorMatches(W)},X.prototype.onActivation=function(W){return this._bindingOnSyntax.onActivation(W)},X.prototype.onDeactivation=function(W){return this._bindingOnSyntax.onDeactivation(W)},X})(),BindingToSyntax=(function(){function X(W){this._binding=W}return X.prototype.to=function(W){return this._binding.type=BindingTypeEnum.Instance,this._binding.implementationType=W,new BindingInWhenOnSyntax(this._binding)},X.prototype.toSelf=function(){if(typeof this._binding.serviceIdentifier!="function")throw new Error(""+INVALID_TO_SELF_VALUE);var W=this._binding.serviceIdentifier;return this.to(W)},X.prototype.toConstantValue=function(W){return this._binding.type=BindingTypeEnum.ConstantValue,this._binding.cache=W,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toDynamicValue=function(W){return this._binding.type=BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=W,this._binding.implementationType=null,new BindingInWhenOnSyntax(this._binding)},X.prototype.toConstructor=function(W){return this._binding.type=BindingTypeEnum.Constructor,this._binding.implementationType=W,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toFactory=function(W){return this._binding.type=BindingTypeEnum.Factory,this._binding.factory=W,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toFunction=function(W){if(typeof W!="function")throw new Error(INVALID_FUNCTION_BINDING);var te=this.toConstantValue(W);return this._binding.type=BindingTypeEnum.Function,this._binding.scope=BindingScopeEnum.Singleton,te},X.prototype.toAutoFactory=function(W){return this._binding.type=BindingTypeEnum.Factory,this._binding.factory=function(te){var re=function(){return te.container.get(W)};return re},this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toAutoNamedFactory=function(W){return this._binding.type=BindingTypeEnum.Factory,this._binding.factory=function(te){return function(re){return te.container.getNamed(W,re)}},new BindingWhenOnSyntax(this._binding)},X.prototype.toProvider=function(W){return this._binding.type=BindingTypeEnum.Provider,this._binding.provider=W,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toService=function(W){this.toDynamicValue(function(te){return te.container.get(W)})},X})(),ContainerSnapshot=(function(){function X(){}return X.of=function(W,te,re,oe,ne){var de=new X;return de.bindings=W,de.middleware=te,de.deactivations=oe,de.activations=re,de.moduleActivationStore=ne,de},X})();function isClonable(X){return typeof X=="object"&&X!==null&&"clone"in X&&typeof X.clone=="function"}var Lookup=(function(){function X(){this._map=new Map}return X.prototype.getMap=function(){return this._map},X.prototype.add=function(W,te){if(W==null)throw new Error(NULL_ARGUMENT);if(te==null)throw new Error(NULL_ARGUMENT);var re=this._map.get(W);re!==void 0?re.push(te):this._map.set(W,[te])},X.prototype.get=function(W){if(W==null)throw new Error(NULL_ARGUMENT);var te=this._map.get(W);if(te!==void 0)return te;throw new Error(KEY_NOT_FOUND)},X.prototype.remove=function(W){if(W==null)throw new Error(NULL_ARGUMENT);if(!this._map.delete(W))throw new Error(KEY_NOT_FOUND)},X.prototype.removeIntersection=function(W){var te=this;this.traverse(function(re,oe){var ne=W.hasKey(re)?W.get(re):void 0;if(ne!==void 0){var de=oe.filter(function(ce){return!ne.some(function(ue){return ce===ue})});te._setValue(re,de)}})},X.prototype.removeByCondition=function(W){var te=this,re=[];return this._map.forEach(function(oe,ne){for(var de=[],ce=0,ue=oe;ce<ue.length;ce++){var pe=ue[ce],he=W(pe);he?re.push(pe):de.push(pe)}te._setValue(ne,de)}),re},X.prototype.hasKey=function(W){if(W==null)throw new Error(NULL_ARGUMENT);return this._map.has(W)},X.prototype.clone=function(){var W=new X;return this._map.forEach(function(te,re){te.forEach(function(oe){return W.add(re,isClonable(oe)?oe.clone():oe)})}),W},X.prototype.traverse=function(W){this._map.forEach(function(te,re){W(re,te)})},X.prototype._setValue=function(W,te){te.length>0?this._map.set(W,te):this._map.delete(W)},X})(),ModuleActivationStore=(function(){function X(){this._map=new Map}return X.prototype.remove=function(W){if(this._map.has(W)){var te=this._map.get(W);return this._map.delete(W),te}return this._getEmptyHandlersStore()},X.prototype.addDeactivation=function(W,te,re){this._getModuleActivationHandlers(W).onDeactivations.add(te,re)},X.prototype.addActivation=function(W,te,re){this._getModuleActivationHandlers(W).onActivations.add(te,re)},X.prototype.clone=function(){var W=new X;return this._map.forEach(function(te,re){W._map.set(re,{onActivations:te.onActivations.clone(),onDeactivations:te.onDeactivations.clone()})}),W},X.prototype._getModuleActivationHandlers=function(W){var te=this._map.get(W);return te===void 0&&(te=this._getEmptyHandlersStore(),this._map.set(W,te)),te},X.prototype._getEmptyHandlersStore=function(){var W={onActivations:new Lookup,onDeactivations:new Lookup};return W},X})(),__assign$3=function(){return __assign$3=Object.assign||function(X){for(var W,te=1,re=arguments.length;te<re;te++){W=arguments[te];for(var oe in W)Object.prototype.hasOwnProperty.call(W,oe)&&(X[oe]=W[oe])}return X},__assign$3.apply(this,arguments)},__awaiter=function(X,W,te,re){function oe(ne){return ne instanceof te?ne:new te(function(de){de(ne)})}return new(te||(te=Promise))(function(ne,de){function ce(he){try{pe(re.next(he))}catch(fe){de(fe)}}function ue(he){try{pe(re.throw(he))}catch(fe){de(fe)}}function pe(he){he.done?ne(he.value):oe(he.value).then(ce,ue)}pe((re=re.apply(X,W||[])).next())})},__generator=function(X,W){var te={label:0,sent:function(){if(ne[0]&1)throw ne[1];return ne[1]},trys:[],ops:[]},re,oe,ne,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(pe){return function(he){return ue([pe,he])}}function ue(pe){if(re)throw new TypeError("Generator is already executing.");for(;te;)try{if(re=1,oe&&(ne=pe[0]&2?oe.return:pe[0]?oe.throw||((ne=oe.return)&&ne.call(oe),0):oe.next)&&!(ne=ne.call(oe,pe[1])).done)return ne;switch(oe=0,ne&&(pe=[pe[0]&2,ne.value]),pe[0]){case 0:case 1:ne=pe;break;case 4:return te.label++,{value:pe[1],done:!1};case 5:te.label++,oe=pe[1],pe=[0];continue;case 7:pe=te.ops.pop(),te.trys.pop();continue;default:if(ne=te.trys,!(ne=ne.length>0&&ne[ne.length-1])&&(pe[0]===6||pe[0]===2)){te=0;continue}if(pe[0]===3&&(!ne||pe[1]>ne[0]&&pe[1]<ne[3])){te.label=pe[1];break}if(pe[0]===6&&te.label<ne[1]){te.label=ne[1],ne=pe;break}if(ne&&te.label<ne[2]){te.label=ne[2],te.ops.push(pe);break}ne[2]&&te.ops.pop(),te.trys.pop();continue}pe=W.call(X,te)}catch(he){pe=[6,he],oe=0}finally{re=ne=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}},__spreadArray=function(X,W,te){if(te||arguments.length===2)for(var re=0,oe=W.length,ne;re<oe;re++)(ne||!(re in W))&&(ne||(ne=Array.prototype.slice.call(W,0,re)),ne[re]=W[re]);return X.concat(ne||Array.prototype.slice.call(W))},Container=(function(){function X(W){var te=W||{};if(typeof te!="object")throw new Error(""+CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(te.defaultScope===void 0)te.defaultScope=BindingScopeEnum.Transient;else if(te.defaultScope!==BindingScopeEnum.Singleton&&te.defaultScope!==BindingScopeEnum.Transient&&te.defaultScope!==BindingScopeEnum.Request)throw new Error(""+CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(te.autoBindInjectable===void 0)te.autoBindInjectable=!1;else if(typeof te.autoBindInjectable!="boolean")throw new Error(""+CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(te.skipBaseClassChecks===void 0)te.skipBaseClassChecks=!1;else if(typeof te.skipBaseClassChecks!="boolean")throw new Error(""+CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:te.autoBindInjectable,defaultScope:te.defaultScope,skipBaseClassChecks:te.skipBaseClassChecks},this.id=id(),this._bindingDictionary=new Lookup,this._snapshots=[],this._middleware=null,this._activations=new Lookup,this._deactivations=new Lookup,this.parent=null,this._metadataReader=new MetadataReader,this._moduleActivationStore=new ModuleActivationStore}return X.merge=function(W,te){for(var re=[],oe=2;oe<arguments.length;oe++)re[oe-2]=arguments[oe];var ne=new X,de=__spreadArray([W,te],re,!0).map(function(pe){return getBindingDictionary(pe)}),ce=getBindingDictionary(ne);function ue(pe,he){pe.traverse(function(fe,be){be.forEach(function(ge){he.add(ge.serviceIdentifier,ge.clone())})})}return de.forEach(function(pe){ue(pe,ce)}),ne},X.prototype.load=function(){for(var W=[],te=0;te<arguments.length;te++)W[te]=arguments[te];for(var re=this._getContainerModuleHelpersFactory(),oe=0,ne=W;oe<ne.length;oe++){var de=ne[oe],ce=re(de.id);de.registry(ce.bindFunction,ce.unbindFunction,ce.isboundFunction,ce.rebindFunction,ce.unbindAsyncFunction,ce.onActivationFunction,ce.onDeactivationFunction)}},X.prototype.loadAsync=function(){for(var W=[],te=0;te<arguments.length;te++)W[te]=arguments[te];return __awaiter(this,void 0,void 0,function(){var re,oe,ne,de,ce;return __generator(this,function(ue){switch(ue.label){case 0:re=this._getContainerModuleHelpersFactory(),oe=0,ne=W,ue.label=1;case 1:return oe<ne.length?(de=ne[oe],ce=re(de.id),[4,de.registry(ce.bindFunction,ce.unbindFunction,ce.isboundFunction,ce.rebindFunction,ce.unbindAsyncFunction,ce.onActivationFunction,ce.onDeactivationFunction)]):[3,4];case 2:ue.sent(),ue.label=3;case 3:return oe++,[3,1];case 4:return[2]}})})},X.prototype.unload=function(){for(var W=this,te=[],re=0;re<arguments.length;re++)te[re]=arguments[re];te.forEach(function(oe){var ne=W._removeModuleBindings(oe.id);W._deactivateSingletons(ne),W._removeModuleHandlers(oe.id)})},X.prototype.unloadAsync=function(){for(var W=[],te=0;te<arguments.length;te++)W[te]=arguments[te];return __awaiter(this,void 0,void 0,function(){var re,oe,ne,de;return __generator(this,function(ce){switch(ce.label){case 0:re=0,oe=W,ce.label=1;case 1:return re<oe.length?(ne=oe[re],de=this._removeModuleBindings(ne.id),[4,this._deactivateSingletonsAsync(de)]):[3,4];case 2:ce.sent(),this._removeModuleHandlers(ne.id),ce.label=3;case 3:return re++,[3,1];case 4:return[2]}})})},X.prototype.bind=function(W){var te=this.options.defaultScope||BindingScopeEnum.Transient,re=new Binding(W,te);return this._bindingDictionary.add(W,re),new BindingToSyntax(re)},X.prototype.rebind=function(W){return this.unbind(W),this.bind(W)},X.prototype.rebindAsync=function(W){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(te){switch(te.label){case 0:return[4,this.unbindAsync(W)];case 1:return te.sent(),[2,this.bind(W)]}})})},X.prototype.unbind=function(W){if(this._bindingDictionary.hasKey(W)){var te=this._bindingDictionary.get(W);this._deactivateSingletons(te)}this._removeServiceFromDictionary(W)},X.prototype.unbindAsync=function(W){return __awaiter(this,void 0,void 0,function(){var te;return __generator(this,function(re){switch(re.label){case 0:return this._bindingDictionary.hasKey(W)?(te=this._bindingDictionary.get(W),[4,this._deactivateSingletonsAsync(te)]):[3,2];case 1:re.sent(),re.label=2;case 2:return this._removeServiceFromDictionary(W),[2]}})})},X.prototype.unbindAll=function(){var W=this;this._bindingDictionary.traverse(function(te,re){W._deactivateSingletons(re)}),this._bindingDictionary=new Lookup},X.prototype.unbindAllAsync=function(){return __awaiter(this,void 0,void 0,function(){var W,te=this;return __generator(this,function(re){switch(re.label){case 0:return W=[],this._bindingDictionary.traverse(function(oe,ne){W.push(te._deactivateSingletonsAsync(ne))}),[4,Promise.all(W)];case 1:return re.sent(),this._bindingDictionary=new Lookup,[2]}})})},X.prototype.onActivation=function(W,te){this._activations.add(W,te)},X.prototype.onDeactivation=function(W,te){this._deactivations.add(W,te)},X.prototype.isBound=function(W){var te=this._bindingDictionary.hasKey(W);return!te&&this.parent&&(te=this.parent.isBound(W)),te},X.prototype.isCurrentBound=function(W){return this._bindingDictionary.hasKey(W)},X.prototype.isBoundNamed=function(W,te){return this.isBoundTagged(W,NAMED_TAG,te)},X.prototype.isBoundTagged=function(W,te,re){var oe=!1;if(this._bindingDictionary.hasKey(W)){var ne=this._bindingDictionary.get(W),de=createMockRequest(this,W,te,re);oe=ne.some(function(ce){return ce.constraint(de)})}return!oe&&this.parent&&(oe=this.parent.isBoundTagged(W,te,re)),oe},X.prototype.snapshot=function(){this._snapshots.push(ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},X.prototype.restore=function(){var W=this._snapshots.pop();if(W===void 0)throw new Error(NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=W.bindings,this._activations=W.activations,this._deactivations=W.deactivations,this._middleware=W.middleware,this._moduleActivationStore=W.moduleActivationStore},X.prototype.createChild=function(W){var te=new X(W||this.options);return te.parent=this,te},X.prototype.applyMiddleware=function(){for(var W=[],te=0;te<arguments.length;te++)W[te]=arguments[te];var re=this._middleware?this._middleware:this._planAndResolve();this._middleware=W.reduce(function(oe,ne){return ne(oe)},re)},X.prototype.applyCustomMetadataReader=function(W){this._metadataReader=W},X.prototype.get=function(W){var te=this._getNotAllArgs(W,!1);return this._getButThrowIfAsync(te)},X.prototype.getAsync=function(W){return __awaiter(this,void 0,void 0,function(){var te;return __generator(this,function(re){return te=this._getNotAllArgs(W,!1),[2,this._get(te)]})})},X.prototype.getTagged=function(W,te,re){var oe=this._getNotAllArgs(W,!1,te,re);return this._getButThrowIfAsync(oe)},X.prototype.getTaggedAsync=function(W,te,re){return __awaiter(this,void 0,void 0,function(){var oe;return __generator(this,function(ne){return oe=this._getNotAllArgs(W,!1,te,re),[2,this._get(oe)]})})},X.prototype.getNamed=function(W,te){return this.getTagged(W,NAMED_TAG,te)},X.prototype.getNamedAsync=function(W,te){return this.getTaggedAsync(W,NAMED_TAG,te)},X.prototype.getAll=function(W){var te=this._getAllArgs(W);return this._getButThrowIfAsync(te)},X.prototype.getAllAsync=function(W){var te=this._getAllArgs(W);return this._getAll(te)},X.prototype.getAllTagged=function(W,te,re){var oe=this._getNotAllArgs(W,!0,te,re);return this._getButThrowIfAsync(oe)},X.prototype.getAllTaggedAsync=function(W,te,re){var oe=this._getNotAllArgs(W,!0,te,re);return this._getAll(oe)},X.prototype.getAllNamed=function(W,te){return this.getAllTagged(W,NAMED_TAG,te)},X.prototype.getAllNamedAsync=function(W,te){return this.getAllTaggedAsync(W,NAMED_TAG,te)},X.prototype.resolve=function(W){var te=this.isBound(W);te||this.bind(W).toSelf();var re=this.get(W);return te||this.unbind(W),re},X.prototype._preDestroy=function(W,te){var re,oe;if(Reflect.hasMetadata(PRE_DESTROY,W)){var ne=Reflect.getMetadata(PRE_DESTROY,W);return(oe=(re=te)[ne.value])===null||oe===void 0?void 0:oe.call(re)}},X.prototype._removeModuleHandlers=function(W){var te=this._moduleActivationStore.remove(W);this._activations.removeIntersection(te.onActivations),this._deactivations.removeIntersection(te.onDeactivations)},X.prototype._removeModuleBindings=function(W){return this._bindingDictionary.removeByCondition(function(te){return te.moduleId===W})},X.prototype._deactivate=function(W,te){var re=this,oe=Object.getPrototypeOf(te).constructor;try{if(this._deactivations.hasKey(W.serviceIdentifier)){var ne=this._deactivateContainer(te,this._deactivations.get(W.serviceIdentifier).values());if(isPromise$1(ne))return this._handleDeactivationError(ne.then(function(){return re._propagateContainerDeactivationThenBindingAndPreDestroyAsync(W,te,oe)}),oe)}var de=this._propagateContainerDeactivationThenBindingAndPreDestroy(W,te,oe);if(isPromise$1(de))return this._handleDeactivationError(de,oe)}catch(ce){if(ce instanceof Error)throw new Error(ON_DEACTIVATION_ERROR(oe.name,ce.message))}},X.prototype._handleDeactivationError=function(W,te){return __awaiter(this,void 0,void 0,function(){var re;return __generator(this,function(oe){switch(oe.label){case 0:return oe.trys.push([0,2,,3]),[4,W];case 1:return oe.sent(),[3,3];case 2:if(re=oe.sent(),re instanceof Error)throw new Error(ON_DEACTIVATION_ERROR(te.name,re.message));return[3,3];case 3:return[2]}})})},X.prototype._deactivateContainer=function(W,te){for(var re=this,oe=te.next();oe.value;){var ne=oe.value(W);if(isPromise$1(ne))return ne.then(function(){return re._deactivateContainerAsync(W,te)});oe=te.next()}},X.prototype._deactivateContainerAsync=function(W,te){return __awaiter(this,void 0,void 0,function(){var re;return __generator(this,function(oe){switch(oe.label){case 0:re=te.next(),oe.label=1;case 1:return re.value?[4,re.value(W)]:[3,3];case 2:return oe.sent(),re=te.next(),[3,1];case 3:return[2]}})})},X.prototype._getContainerModuleHelpersFactory=function(){var W=this,te=function(he,fe){he._binding.moduleId=fe},re=function(he){return function(fe){var be=W.bind(fe);return te(be,he),be}},oe=function(){return function(he){return W.unbind(he)}},ne=function(){return function(he){return W.unbindAsync(he)}},de=function(){return function(he){return W.isBound(he)}},ce=function(he){return function(fe){var be=W.rebind(fe);return te(be,he),be}},ue=function(he){return function(fe,be){W._moduleActivationStore.addActivation(he,fe,be),W.onActivation(fe,be)}},pe=function(he){return function(fe,be){W._moduleActivationStore.addDeactivation(he,fe,be),W.onDeactivation(fe,be)}};return function(he){return{bindFunction:re(he),isboundFunction:de(),onActivationFunction:ue(he),onDeactivationFunction:pe(he),rebindFunction:ce(he),unbindFunction:oe(),unbindAsyncFunction:ne()}}},X.prototype._getAll=function(W){return Promise.all(this._get(W))},X.prototype._get=function(W){var te=__assign$3(__assign$3({},W),{contextInterceptor:function(oe){return oe},targetType:TargetTypeEnum.Variable});if(this._middleware){var re=this._middleware(te);if(re==null)throw new Error(INVALID_MIDDLEWARE_RETURN);return re}return this._planAndResolve()(te)},X.prototype._getButThrowIfAsync=function(W){var te=this._get(W);if(isPromiseOrContainsPromise(te))throw new Error(LAZY_IN_SYNC(W.serviceIdentifier));return te},X.prototype._getAllArgs=function(W){var te={avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:W};return te},X.prototype._getNotAllArgs=function(W,te,re,oe){var ne={avoidConstraints:!1,isMultiInject:te,serviceIdentifier:W,key:re,value:oe};return ne},X.prototype._planAndResolve=function(){var W=this;return function(te){var re=plan(W._metadataReader,W,te.isMultiInject,te.targetType,te.serviceIdentifier,te.key,te.value,te.avoidConstraints);re=te.contextInterceptor(re);var oe=resolve(re);return oe}},X.prototype._deactivateIfSingleton=function(W){var te=this;if(W.activated)return isPromise$1(W.cache)?W.cache.then(function(re){return te._deactivate(W,re)}):this._deactivate(W,W.cache)},X.prototype._deactivateSingletons=function(W){for(var te=0,re=W;te<re.length;te++){var oe=re[te],ne=this._deactivateIfSingleton(oe);if(isPromise$1(ne))throw new Error(ASYNC_UNBIND_REQUIRED)}},X.prototype._deactivateSingletonsAsync=function(W){return __awaiter(this,void 0,void 0,function(){var te=this;return __generator(this,function(re){switch(re.label){case 0:return[4,Promise.all(W.map(function(oe){return te._deactivateIfSingleton(oe)}))];case 1:return re.sent(),[2]}})})},X.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(W,te,re){return this.parent?this._deactivate.bind(this.parent)(W,te):this._bindingDeactivationAndPreDestroy(W,te,re)},X.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(W,te,re){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(oe){switch(oe.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(W,te)]:[3,2];case 1:return oe.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(W,te,re)];case 3:oe.sent(),oe.label=4;case 4:return[2]}})})},X.prototype._removeServiceFromDictionary=function(W){try{this._bindingDictionary.remove(W)}catch{throw new Error(CANNOT_UNBIND+" "+getServiceIdentifierAsString(W))}},X.prototype._bindingDeactivationAndPreDestroy=function(W,te,re){var oe=this;if(typeof W.onDeactivation=="function"){var ne=W.onDeactivation(te);if(isPromise$1(ne))return ne.then(function(){return oe._preDestroy(re,te)})}return this._preDestroy(re,te)},X.prototype._bindingDeactivationAndPreDestroyAsync=function(W,te,re){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(oe){switch(oe.label){case 0:return typeof W.onDeactivation!="function"?[3,2]:[4,W.onDeactivation(te)];case 1:oe.sent(),oe.label=2;case 2:return[4,this._preDestroy(re,te)];case 3:return oe.sent(),[2]}})})},X})();function getFirstArrayDuplicate(X){for(var W=new Set,te=0,re=X;te<re.length;te++){var oe=re[te];if(W.has(oe))return oe;W.add(oe)}}function targetIsConstructorFunction(X){return X.prototype!==void 0}function _throwIfMethodParameter(X){if(X!==void 0)throw new Error(INVALID_DECORATOR_OPERATION)}function tagParameter(X,W,te,re){_throwIfMethodParameter(W),_tagParameterOrProperty(TAGGED,X,te.toString(),re)}function tagProperty(X,W,te){if(targetIsConstructorFunction(X))throw new Error(INVALID_DECORATOR_OPERATION);_tagParameterOrProperty(TAGGED_PROP,X.constructor,W,te)}function _ensureNoMetadataKeyDuplicates(X){var W=[];if(Array.isArray(X)){W=X;var te=getFirstArrayDuplicate(W.map(function(re){return re.key}));if(te!==void 0)throw new Error(DUPLICATED_METADATA+" "+te.toString())}else W=[X];return W}function _tagParameterOrProperty(X,W,te,re){var oe=_ensureNoMetadataKeyDuplicates(re),ne={};Reflect.hasOwnMetadata(X,W)&&(ne=Reflect.getMetadata(X,W));var de=ne[te];if(de===void 0)de=[];else for(var ce=function(fe){if(oe.some(function(be){return be.key===fe.key}))throw new Error(DUPLICATED_METADATA+" "+fe.key.toString())},ue=0,pe=de;ue<pe.length;ue++){var he=pe[ue];ce(he)}de.push.apply(de,oe),ne[te]=de,Reflect.defineMetadata(X,ne,W)}function createTaggedDecorator(X){return function(W,te,re){typeof re=="number"?tagParameter(W,te,re,X):tagProperty(W,te,X)}}function _decorate(X,W){Reflect.decorate(X,W)}function _param(X,W){return function(te,re){W(te,re,X)}}function decorate(X,W,te){typeof te=="number"?_decorate([_param(te,X)],W):typeof te=="string"?Reflect.decorate([X],W,te):_decorate([X],W)}function injectable(){return function(X){if(Reflect.hasOwnMetadata(PARAM_TYPES,X))throw new Error(DUPLICATED_INJECTABLE_DECORATOR);var W=Reflect.getMetadata(DESIGN_PARAM_TYPES,X)||[];return Reflect.defineMetadata(PARAM_TYPES,W,X),X}}function injectBase(X){return function(W){return function(te,re,oe){if(W===void 0){var ne=typeof te=="function"?te.name:te.constructor.name;throw new Error(UNDEFINED_INJECT_ANNOTATION(ne))}return createTaggedDecorator(new Metadata(X,W))(te,re,oe)}}}var inject=injectBase(INJECT_TAG);const createBaseHandlers=({primaryApi:X,store:W})=>{class te{constructor(de){this.api=de}}decorate(injectable(),te),decorate(inject(X),te,0);class re{constructor(de){this.store=de}}class oe{constructor(de,ce){this.store=de,this.api=ce}}return W&&(decorate(injectable(),re),decorate(inject(W),re,0),decorate(injectable(),oe),decorate(inject(W),oe,0),decorate(inject(X),oe,1)),{ApiBaseHandler:te,BaseHandler:oe,StoreBaseHandler:re}},registerRequest$1=(X,W)=>(te,re)=>{W.bind(re).to(re).inTransientScope(),injectable()(re);const oe=X.broker.registerRequest(te,ne=>W.get(re).handle(ne));return{dispose:()=>{W.isBound(re)&&W.unbind(re),oe.dispose()}}},brokerExtensions=(X,W)=>({registerRequest:registerRequest$1(X,W)}),generateId$1=()=>{try{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch{console.warn("crypto.randomUUID() failed, using fallback")}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,X=>{const W=Math.random()*16|0;return(X==="x"?W:W&3|8).toString(16)})},DIACRITICS_REGEX=new RegExp("\\p{Diacritic}","gu"),normalizeText=X=>X.normalize("NFD").replace(DIACRITICS_REGEX,"").toLowerCase().trim();function createConnectToStoreDecorator(X){return function(te){return(re,oe)=>{const ne=`__${oe}`,de=`__unsubscribe__${oe}`;Object.defineProperty(re,oe,{get(){return this[ne]},set(pe){this[ne]!==pe&&(this[ne]=pe,this.requestUpdate(oe))},configurable:!0,enumerable:!0});const ce=re.connectedCallback,ue=re.disconnectedCallback;re.connectedCallback=function(){ce&&ce.call(this),this[oe]=te(X.getState());let pe=!1,he=!1;const fe=()=>{pe=!1,!he&&(this[oe]=te(X.getState()))},be=X.subscribe(()=>{pe||(pe=!0,queueMicrotask(fe))});this[de]=()=>{he=!0,be()}},re.disconnectedCallback=function(){ue&&ue.call(this),this[de]&&this[de]()}}}}function createConnectedProperty(X){return(W,te={})=>{const re=createConnectToStoreDecorator(X);return(oe,ne)=>{n$A(te)(oe,ne),re(W)(oe,ne)}}}const REQUEST_DIAGNOSTICS_SELECTOR="request_diagnostics_selector",CIPDS_SELECTION_REQUEST="cipds_selection_request",CIPDS_DIAGNOSTIC_FILTER_HISTORIC_REQUESTED="cipds_diagnostic_filter_historic_requested",LAST_WORKED_DIAGNOSTICS_KEY="lastWorkedDiagnostics",CLINICAL_COURSE_DRAFT_APPEND_REQUESTED="clinical_course_draft_append_requested",HELP_REQUESTED="help_requested",PLUGIN_BROKER_REQUESTS={cipds:{diagnosticsSelectorRequested:REQUEST_DIAGNOSTICS_SELECTOR,selectionRequested:CIPDS_SELECTION_REQUEST}},PLUGIN_BROKER_EVENTS={cipds:{filterHistoricRequested:CIPDS_DIAGNOSTIC_FILTER_HISTORIC_REQUESTED},clinicalCourse:{draftAppendRequested:CLINICAL_COURSE_DRAFT_APPEND_REQUESTED},helpCenter:{helpRequested:HELP_REQUESTED}},STANDALONE_NOTE_TYPE_IDS={reports:"INFC",results:"RES",laboratory:"LAB",derivations:"DER"};var ActivityHistoryFilterType=(X=>(X.Checkbox="checkbox",X.Switch="switch",X))(ActivityHistoryFilterType||{});const BROKER_EVENTS={...PLUGIN_BROKER_EVENTS,activityHistory:{refreshDataRequested:"refresh_history_data_requested",errorLoadingData:"error_loading_activity_history_data",searched:"activity_history_searched",filtersCleaned:"activity_history_filters_cleaned",diagnosticFilterDeactivated:"activity_history_diagnostic_filter_deactivated",injectAsyncHistoryItemsRequest:"inject_async_history_items_request",addHistoryItemRequest:"add_history_item_request",addHistoryItemsRequest:"add_history_items_request",updateHistoryItemRequest:"update_history_item_request",removeHistoryItemRequest:"remove_history_item_request"},shell:{appCrashed:"appCrashed",mainViewChanged:"mainViewChanged",refreshTokenFailed:"refreshTokenFailed",mpidHeaderInvalid:"mpidHeaderInvalid",quickActionBusyChanged:"quickActionBusyChanged"},administrativeManagement:{tabSelected:"administrative_management_tab_selected"}},BROKER_REQUESTS={...PLUGIN_BROKER_REQUESTS};class Broker{constructor(){this.events=BROKER_EVENTS,this.requests=BROKER_REQUESTS,this.requestHandlers=new Map,this.eventSubscribers=new Map}async send(W,te){const re=typeof W=="string"?W:W.constructor,oe=this.requestHandlers.get(re);if(!oe){const de=typeof W=="string"?W:W.constructor?.name;throw new Error(`Broker: no request handler registered for "${de}".`)}const ne=typeof W=="string"?{...te}:{...W};return await oe(ne)}registerRequest(W,te){if(this.requestHandlers.has(W)){const re=typeof W=="string"?W:W.name;throw new Error(`Broker: a request handler is already registered for "${re}".`)}return this.requestHandlers.set(W,te),{dispose:()=>{this.requestHandlers.get(W)===te&&this.requestHandlers.delete(W)}}}async publish(W,te){const re=typeof W=="string"?W:W.constructor,oe=this.eventSubscribers.get(re);if(!oe||oe.size===0)return;const ne=typeof W=="string"?te:{...W},de=typeof W=="string"?W:W.constructor?.name;await Promise.all([...oe].map(async ce=>{try{await ce(ne)}catch(ue){console.error(`Broker: a subscriber for event "${de}" threw and was isolated.`,ue)}}))}subscribe(W,te){let re=this.eventSubscribers.get(W);return re||(re=new Set,this.eventSubscribers.set(W,re)),re.add(te),{dispose:()=>{const oe=this.eventSubscribers.get(W);oe&&(oe.delete(te),oe.size===0&&this.eventSubscribers.delete(W))}}}_clear(){this.requestHandlers.clear(),this.eventSubscribers.clear()}}const createBroker=()=>new Broker,EVENTS_WITH_DIAGNOSTICS=["PROVES_ORDRES_CLINIQUES_CONSULTAR","RESULT_OC","LABORATORI_SEROTECA_PETICIO_CONSULTA","LABORATORI","ORDRE_TRACTAMENT","PRESCRIPCIO_ACTIVA","REV_IT","OC_EXPRES"];class EcapEventManager{}class EcapEventManagerImpl{constructor(W){this.globalStateManager=W}publish(W,te,re){const oe=this.createEcapEvent(W,te,re??{});EVENTS_WITH_DIAGNOSTICS.includes(W)&&(oe.DIAGNOSTICS=this.globalStateManager.getData(LAST_WORKED_DIAGNOSTICS_KEY)??[]),this.raiseEcapEvent(oe)}createEcapEvent(W,te,re){return{TipusEvent:W,Accio:te,...re}}raiseEcapEvent(W){window.parent&&window.parent.postMessage(JSON.stringify(W),"*"),console.log("method",JSON.stringify(W))}}const createEcapEventManager=X=>new EcapEventManagerImpl(X);class ExitGuardManagerImpl{constructor(){this.guards=new Map}register(W,te){this.guards.set(W,te)}unregister(W){this.guards.delete(W)}async canExit(){for(const W of this.guards.values())try{if(!await W())return!1}catch(te){console.error("Exit guard failed:",te)}return!0}}class PrimariaGlobalStateManagerImpl{constructor(W){this.broker=W,this.state={}}setData(W,te){this.state[W]=te,this.broker.publish("data_set",{key:W,value:te})}getData(W){return this.state[W]}clearData(){this.state={}}}const createGlobalStateManager=X=>new PrimariaGlobalStateManagerImpl(X),ACTIVITY_EVENTS=["keydown","click","scroll"];class ActivityMonitorImpl{constructor(){this.lastActivityTimestamp=0,this.activityHandler=()=>{this.lastActivityTimestamp=Date.now()},this.start=()=>{for(const W of ACTIVITY_EVENTS)window.addEventListener(W,this.activityHandler)},this.stop=()=>{for(const W of ACTIVITY_EVENTS)window.removeEventListener(W,this.activityHandler)},this.getLastActivityTimestamp=()=>this.lastActivityTimestamp}}const createActivityMonitor=()=>new ActivityMonitorImpl;function bind(X,W){return function(){return X.apply(W,arguments)}}const{toString}=Object.prototype,{getPrototypeOf:getPrototypeOf$1}=Object,{iterator,toStringTag}=Symbol,kindOf=(X=>W=>{const te=toString.call(W);return X[te]||(X[te]=te.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=X=>(X=X.toLowerCase(),W=>kindOf(W)===X),typeOfTest=X=>W=>typeof W===X,{isArray}=Array,isUndefined=typeOfTest("undefined");function isBuffer(X){return X!==null&&!isUndefined(X)&&X.constructor!==null&&!isUndefined(X.constructor)&&isFunction$1(X.constructor.isBuffer)&&X.constructor.isBuffer(X)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(X){let W;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?W=ArrayBuffer.isView(X):W=X&&X.buffer&&isArrayBuffer(X.buffer),W}const isString$1=typeOfTest("string"),isFunction$1=typeOfTest("function"),isNumber=typeOfTest("number"),isObject=X=>X!==null&&typeof X=="object",isBoolean$1=X=>X===!0||X===!1,isPlainObject$2=X=>{if(kindOf(X)!=="object")return!1;const W=getPrototypeOf$1(X);return(W===null||W===Object.prototype||Object.getPrototypeOf(W)===null)&&!(toStringTag in X)&&!(iterator in X)},isEmptyObject=X=>{if(!isObject(X)||isBuffer(X))return!1;try{return Object.keys(X).length===0&&Object.getPrototypeOf(X)===Object.prototype}catch{return!1}},isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=X=>isObject(X)&&isFunction$1(X.pipe),isFormData=X=>{let W;return X&&(typeof FormData=="function"&&X instanceof FormData||isFunction$1(X.append)&&((W=kindOf(X))==="formdata"||W==="object"&&isFunction$1(X.toString)&&X.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=X=>X.trim?X.trim():X.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(X,W,{allOwnKeys:te=!1}={}){if(X===null||typeof X>"u")return;let re,oe;if(typeof X!="object"&&(X=[X]),isArray(X))for(re=0,oe=X.length;re<oe;re++)W.call(null,X[re],re,X);else{if(isBuffer(X))return;const ne=te?Object.getOwnPropertyNames(X):Object.keys(X),de=ne.length;let ce;for(re=0;re<de;re++)ce=ne[re],W.call(null,X[ce],ce,X)}}function findKey$1(X,W){if(isBuffer(X))return null;W=W.toLowerCase();const te=Object.keys(X);let re=te.length,oe;for(;re-- >0;)if(oe=te[re],W===oe.toLowerCase())return oe;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,isContextDefined=X=>!isUndefined(X)&&X!==_global;function merge(){const{caseless:X,skipUndefined:W}=isContextDefined(this)&&this||{},te={},re=(oe,ne)=>{const de=X&&findKey$1(te,ne)||ne;isPlainObject$2(te[de])&&isPlainObject$2(oe)?te[de]=merge(te[de],oe):isPlainObject$2(oe)?te[de]=merge({},oe):isArray(oe)?te[de]=oe.slice():(!W||!isUndefined(oe))&&(te[de]=oe)};for(let oe=0,ne=arguments.length;oe<ne;oe++)arguments[oe]&&forEach(arguments[oe],re);return te}const extend=(X,W,te,{allOwnKeys:re}={})=>(forEach(W,(oe,ne)=>{te&&isFunction$1(oe)?X[ne]=bind(oe,te):X[ne]=oe},{allOwnKeys:re}),X),stripBOM=X=>(X.charCodeAt(0)===65279&&(X=X.slice(1)),X),inherits=(X,W,te,re)=>{X.prototype=Object.create(W.prototype,re),X.prototype.constructor=X,Object.defineProperty(X,"super",{value:W.prototype}),te&&Object.assign(X.prototype,te)},toFlatObject=(X,W,te,re)=>{let oe,ne,de;const ce={};if(W=W||{},X==null)return W;do{for(oe=Object.getOwnPropertyNames(X),ne=oe.length;ne-- >0;)de=oe[ne],(!re||re(de,X,W))&&!ce[de]&&(W[de]=X[de],ce[de]=!0);X=te!==!1&&getPrototypeOf$1(X)}while(X&&(!te||te(X,W))&&X!==Object.prototype);return W},endsWith=(X,W,te)=>{X=String(X),(te===void 0||te>X.length)&&(te=X.length),te-=W.length;const re=X.indexOf(W,te);return re!==-1&&re===te},toArray=X=>{if(!X)return null;if(isArray(X))return X;let W=X.length;if(!isNumber(W))return null;const te=new Array(W);for(;W-- >0;)te[W]=X[W];return te},isTypedArray=(X=>W=>X&&W instanceof X)(typeof Uint8Array<"u"&&getPrototypeOf$1(Uint8Array)),forEachEntry=(X,W)=>{const re=(X&&X[iterator]).call(X);let oe;for(;(oe=re.next())&&!oe.done;){const ne=oe.value;W.call(X,ne[0],ne[1])}},matchAll=(X,W)=>{let te;const re=[];for(;(te=X.exec(W))!==null;)re.push(te);return re},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=X=>X.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(te,re,oe){return re.toUpperCase()+oe}),hasOwnProperty=(({hasOwnProperty:X})=>(W,te)=>X.call(W,te))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(X,W)=>{const te=Object.getOwnPropertyDescriptors(X),re={};forEach(te,(oe,ne)=>{let de;(de=W(oe,ne,X))!==!1&&(re[ne]=de||oe)}),Object.defineProperties(X,re)},freezeMethods=X=>{reduceDescriptors(X,(W,te)=>{if(isFunction$1(X)&&["arguments","caller","callee"].indexOf(te)!==-1)return!1;const re=X[te];if(isFunction$1(re)){if(W.enumerable=!1,"writable"in W){W.writable=!1;return}W.set||(W.set=()=>{throw Error("Can not rewrite read-only method '"+te+"'")})}})},toObjectSet=(X,W)=>{const te={},re=oe=>{oe.forEach(ne=>{te[ne]=!0})};return isArray(X)?re(X):re(String(X).split(W)),te},noop$1=()=>{},toFiniteNumber=(X,W)=>X!=null&&Number.isFinite(X=+X)?X:W;function isSpecCompliantForm(X){return!!(X&&isFunction$1(X.append)&&X[toStringTag]==="FormData"&&X[iterator])}const toJSONObject=X=>{const W=new Array(10),te=(re,oe)=>{if(isObject(re)){if(W.indexOf(re)>=0)return;if(isBuffer(re))return re;if(!("toJSON"in re)){W[oe]=re;const ne=isArray(re)?[]:{};return forEach(re,(de,ce)=>{const ue=te(de,oe+1);!isUndefined(ue)&&(ne[ce]=ue)}),W[oe]=void 0,ne}}return re};return te(X,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=X=>X&&(isObject(X)||isFunction$1(X))&&isFunction$1(X.then)&&isFunction$1(X.catch),_setImmediate=((X,W)=>X?setImmediate:W?((te,re)=>(_global.addEventListener("message",({source:oe,data:ne})=>{oe===_global&&ne===te&&re.length&&re.shift()()},!1),oe=>{re.push(oe),_global.postMessage(te,"*")}))(`axios@${Math.random()}`,[]):te=>setTimeout(te))(typeof setImmediate=="function",isFunction$1(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process<"u"&&process.nextTick||_setImmediate,isIterable=X=>X!=null&&isFunction$1(X[iterator]),utils$1={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString:isString$1,isNumber,isBoolean:isBoolean$1,isObject,isPlainObject:isPlainObject$2,isEmptyObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate:isDate$1,isFile,isBlob,isRegExp,isFunction:isFunction$1,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge,extend,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$1,toFiniteNumber,findKey:findKey$1,global:_global,isContextDefined,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap,isIterable};function AxiosError$1(X,W,te,re,oe){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=X,this.name="AxiosError",W&&(this.code=W),te&&(this.config=te),re&&(this.request=re),oe&&(this.response=oe,this.status=oe.status?oe.status:null)}utils$1.inherits(AxiosError$1,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$1.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1=AxiosError$1.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(X=>{descriptors[X]={value:X}}),Object.defineProperties(AxiosError$1,descriptors),Object.defineProperty(prototype$1,"isAxiosError",{value:!0}),AxiosError$1.from=(X,W,te,re,oe,ne)=>{const de=Object.create(prototype$1);utils$1.toFlatObject(X,de,function(he){return he!==Error.prototype},pe=>pe!=="isAxiosError");const ce=X&&X.message?X.message:"Error",ue=W==null&&X?X.code:W;return AxiosError$1.call(de,ce,ue,te,re,oe),X&&de.cause==null&&Object.defineProperty(de,"cause",{value:X,configurable:!0}),de.name=X&&X.name||"Error",ne&&Object.assign(de,ne),de};const httpAdapter=null;function isVisitable(X){return utils$1.isPlainObject(X)||utils$1.isArray(X)}function removeBrackets(X){return utils$1.endsWith(X,"[]")?X.slice(0,-2):X}function renderKey(X,W,te){return X?X.concat(W).map(function(oe,ne){return oe=removeBrackets(oe),!te&&ne?"["+oe+"]":oe}).join(te?".":""):W}function isFlatArray(X){return utils$1.isArray(X)&&!X.some(isVisitable)}const predicates=utils$1.toFlatObject(utils$1,{},null,function(W){return/^is[A-Z]/.test(W)});function toFormData$1(X,W,te){if(!utils$1.isObject(X))throw new TypeError("target must be an object");W=W||new FormData,te=utils$1.toFlatObject(te,{metaTokens:!0,dots:!1,indexes:!1},!1,function(me,_e){return!utils$1.isUndefined(_e[me])});const re=te.metaTokens,oe=te.visitor||he,ne=te.dots,de=te.indexes,ue=(te.Blob||typeof Blob<"u"&&Blob)&&utils$1.isSpecCompliantForm(W);if(!utils$1.isFunction(oe))throw new TypeError("visitor must be a function");function pe(ve){if(ve===null)return"";if(utils$1.isDate(ve))return ve.toISOString();if(utils$1.isBoolean(ve))return ve.toString();if(!ue&&utils$1.isBlob(ve))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$1.isArrayBuffer(ve)||utils$1.isTypedArray(ve)?ue&&typeof Blob=="function"?new Blob([ve]):Buffer.from(ve):ve}function he(ve,me,_e){let ye=ve;if(ve&&!_e&&typeof ve=="object"){if(utils$1.endsWith(me,"{}"))me=re?me:me.slice(0,-2),ve=JSON.stringify(ve);else if(utils$1.isArray(ve)&&isFlatArray(ve)||(utils$1.isFileList(ve)||utils$1.endsWith(me,"[]"))&&(ye=utils$1.toArray(ve)))return me=removeBrackets(me),ye.forEach(function(Ae,Se){!(utils$1.isUndefined(Ae)||Ae===null)&&W.append(de===!0?renderKey([me],Se,ne):de===null?me:me+"[]",pe(Ae))}),!1}return isVisitable(ve)?!0:(W.append(renderKey(_e,me,ne),pe(ve)),!1)}const fe=[],be=Object.assign(predicates,{defaultVisitor:he,convertValue:pe,isVisitable});function ge(ve,me){if(!utils$1.isUndefined(ve)){if(fe.indexOf(ve)!==-1)throw Error("Circular reference detected in "+me.join("."));fe.push(ve),utils$1.forEach(ve,function(ye,we){(!(utils$1.isUndefined(ye)||ye===null)&&oe.call(W,ye,utils$1.isString(we)?we.trim():we,me,be))===!0&&ge(ye,me?me.concat(we):[we])}),fe.pop()}}if(!utils$1.isObject(X))throw new TypeError("data must be an object");return ge(X),W}function encode$1(X){const W={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(X).replace(/[!'()~]|%20|%00/g,function(re){return W[re]})}function AxiosURLSearchParams(X,W){this._pairs=[],X&&toFormData$1(X,this,W)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(W,te){this._pairs.push([W,te])},prototype.toString=function(W){const te=W?function(re){return W.call(this,re,encode$1)}:encode$1;return this._pairs.map(function(oe){return te(oe[0])+"="+te(oe[1])},"").join("&")};function encode(X){return encodeURIComponent(X).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function buildURL(X,W,te){if(!W)return X;const re=te&&te.encode||encode;utils$1.isFunction(te)&&(te={serialize:te});const oe=te&&te.serialize;let ne;if(oe?ne=oe(W,te):ne=utils$1.isURLSearchParams(W)?W.toString():new AxiosURLSearchParams(W,te).toString(re),ne){const de=X.indexOf("#");de!==-1&&(X=X.slice(0,de)),X+=(X.indexOf("?")===-1?"?":"&")+ne}return X}class InterceptorManager{constructor(){this.handlers=[]}use(W,te,re){return this.handlers.push({fulfilled:W,rejected:te,synchronous:re?re.synchronous:!1,runWhen:re?re.runWhen:null}),this.handlers.length-1}eject(W){this.handlers[W]&&(this.handlers[W]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(W){utils$1.forEach(this.handlers,function(re){re!==null&&W(re)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),platform={...utils,...platform$1};function toURLEncodedForm(X,W){return toFormData$1(X,new platform.classes.URLSearchParams,{visitor:function(te,re,oe,ne){return platform.isNode&&utils$1.isBuffer(te)?(this.append(re,te.toString("base64")),!1):ne.defaultVisitor.apply(this,arguments)},...W})}function parsePropPath(X){return utils$1.matchAll(/\w+|\[(\w*)]/g,X).map(W=>W[0]==="[]"?"":W[1]||W[0])}function arrayToObject(X){const W={},te=Object.keys(X);let re;const oe=te.length;let ne;for(re=0;re<oe;re++)ne=te[re],W[ne]=X[ne];return W}function formDataToJSON(X){function W(te,re,oe,ne){let de=te[ne++];if(de==="__proto__")return!0;const ce=Number.isFinite(+de),ue=ne>=te.length;return de=!de&&utils$1.isArray(oe)?oe.length:de,ue?(utils$1.hasOwnProp(oe,de)?oe[de]=[oe[de],re]:oe[de]=re,!ce):((!oe[de]||!utils$1.isObject(oe[de]))&&(oe[de]=[]),W(te,re,oe[de],ne)&&utils$1.isArray(oe[de])&&(oe[de]=arrayToObject(oe[de])),!ce)}if(utils$1.isFormData(X)&&utils$1.isFunction(X.entries)){const te={};return utils$1.forEachEntry(X,(re,oe)=>{W(parsePropPath(re),oe,te,0)}),te}return null}function stringifySafely(X,W,te){if(utils$1.isString(X))try{return(W||JSON.parse)(X),utils$1.trim(X)}catch(re){if(re.name!=="SyntaxError")throw re}return(te||JSON.stringify)(X)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(W,te){const re=te.getContentType()||"",oe=re.indexOf("application/json")>-1,ne=utils$1.isObject(W);if(ne&&utils$1.isHTMLForm(W)&&(W=new FormData(W)),utils$1.isFormData(W))return oe?JSON.stringify(formDataToJSON(W)):W;if(utils$1.isArrayBuffer(W)||utils$1.isBuffer(W)||utils$1.isStream(W)||utils$1.isFile(W)||utils$1.isBlob(W)||utils$1.isReadableStream(W))return W;if(utils$1.isArrayBufferView(W))return W.buffer;if(utils$1.isURLSearchParams(W))return te.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),W.toString();let ce;if(ne){if(re.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(W,this.formSerializer).toString();if((ce=utils$1.isFileList(W))||re.indexOf("multipart/form-data")>-1){const ue=this.env&&this.env.FormData;return toFormData$1(ce?{"files[]":W}:W,ue&&new ue,this.formSerializer)}}return ne||oe?(te.setContentType("application/json",!1),stringifySafely(W)):W}],transformResponse:[function(W){const te=this.transitional||defaults.transitional,re=te&&te.forcedJSONParsing,oe=this.responseType==="json";if(utils$1.isResponse(W)||utils$1.isReadableStream(W))return W;if(W&&utils$1.isString(W)&&(re&&!this.responseType||oe)){const de=!(te&&te.silentJSONParsing)&&oe;try{return JSON.parse(W,this.parseReviver)}catch(ce){if(de)throw ce.name==="SyntaxError"?AxiosError$1.from(ce,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):ce}}return W}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(W){return W>=200&&W<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1.forEach(["delete","get","head","post","put","patch"],X=>{defaults.headers[X]={}});const ignoreDuplicateOf=utils$1.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=X=>{const W={};let te,re,oe;return X&&X.split(`
94
+ `+X+" - "+te}else return" "+X}function getFunctionName(X){if(X.name)return X.name;var W=X.toString(),te=W.match(/^function\s*([^\s(]+)/);return te?te[1]:"Anonymous function: "+W}function getSymbolDescription(X){return X.toString().slice(7,-1)}var Context=(function(){function X(W){this.id=id(),this.container=W}return X.prototype.addPlan=function(W){this.plan=W},X.prototype.setCurrentRequest=function(W){this.currentRequest=W},X})(),Metadata=(function(){function X(W,te){this.key=W,this.value=te}return X.prototype.toString=function(){return this.key===NAMED_TAG?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},X})(),Plan=(function(){function X(W,te){this.parentContext=W,this.rootRequest=te}return X})(),LazyServiceIdentifier=(function(){function X(W){this._cb=W}return X.prototype.unwrap=function(){return this._cb()},X})(),QueryableString=(function(){function X(W){this.str=W}return X.prototype.startsWith=function(W){return this.str.indexOf(W)===0},X.prototype.endsWith=function(W){var te="",re=W.split("").reverse().join("");return te=this.str.split("").reverse().join(""),this.startsWith.call({str:te},re)},X.prototype.contains=function(W){return this.str.indexOf(W)!==-1},X.prototype.equals=function(W){return this.str===W},X.prototype.value=function(){return this.str},X})(),Target=(function(){function X(W,te,re,oe){this.id=id(),this.type=W,this.serviceIdentifier=re;var ne=typeof te=="symbol"?getSymbolDescription(te):te;this.name=new QueryableString(ne||""),this.identifier=te,this.metadata=new Array;var de=null;typeof oe=="string"?de=new Metadata(NAMED_TAG,oe):oe instanceof Metadata&&(de=oe),de!==null&&this.metadata.push(de)}return X.prototype.hasTag=function(W){for(var te=0,re=this.metadata;te<re.length;te++){var oe=re[te];if(oe.key===W)return!0}return!1},X.prototype.isArray=function(){return this.hasTag(MULTI_INJECT_TAG)},X.prototype.matchesArray=function(W){return this.matchesTag(MULTI_INJECT_TAG)(W)},X.prototype.isNamed=function(){return this.hasTag(NAMED_TAG)},X.prototype.isTagged=function(){return this.metadata.some(function(W){return NON_CUSTOM_TAG_KEYS.every(function(te){return W.key!==te})})},X.prototype.isOptional=function(){return this.matchesTag(OPTIONAL_TAG)(!0)},X.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter(function(W){return W.key===NAMED_TAG})[0]:null},X.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter(function(W){return NON_CUSTOM_TAG_KEYS.every(function(te){return W.key!==te})}):null},X.prototype.matchesNamedTag=function(W){return this.matchesTag(NAMED_TAG)(W)},X.prototype.matchesTag=function(W){var te=this;return function(re){for(var oe=0,ne=te.metadata;oe<ne.length;oe++){var de=ne[oe];if(de.key===W&&de.value===re)return!0}return!1}},X})(),__spreadArray$2=function(X,W,te){if(te||arguments.length===2)for(var re=0,oe=W.length,ne;re<oe;re++)(ne||!(re in W))&&(ne||(ne=Array.prototype.slice.call(W,0,re)),ne[re]=W[re]);return X.concat(ne||Array.prototype.slice.call(W))};function getDependencies$1(X,W){var te=getFunctionName(W);return getTargets(X,te,W,!1)}function getTargets(X,W,te,re){var oe=X.getConstructorMetadata(te),ne=oe.compilerGeneratedMetadata;if(ne===void 0){var de=MISSING_INJECTABLE_ANNOTATION+" "+W+".";throw new Error(de)}var ce=oe.userGeneratedMetadata,ue=Object.keys(ce),pe=te.length===0&&ue.length>0,he=ue.length>te.length,fe=pe||he?ue.length:te.length,be=getConstructorArgsAsTargets(re,W,ne,ce,fe),ge=getClassPropsAsTargets(X,te,W),ve=__spreadArray$2(__spreadArray$2([],be,!0),ge,!0);return ve}function getConstructorArgsAsTarget(X,W,te,re,oe){var ne=oe[X.toString()]||[],de=formatTargetMetadata(ne),ce=de.unmanaged!==!0,ue=re[X],pe=de.inject||de.multiInject;if(ue=pe||ue,ue instanceof LazyServiceIdentifier&&(ue=ue.unwrap()),ce){var he=ue===Object,fe=ue===Function,be=ue===void 0,ge=he||fe||be;if(!W&&ge){var ve=MISSING_INJECT_ANNOTATION+" argument "+X+" in class "+te+".";throw new Error(ve)}var me=new Target(TargetTypeEnum.ConstructorArgument,de.targetName,ue);return me.metadata=ne,me}return null}function getConstructorArgsAsTargets(X,W,te,re,oe){for(var ne=[],de=0;de<oe;de++){var ce=de,ue=getConstructorArgsAsTarget(ce,X,W,te,re);ue!==null&&ne.push(ue)}return ne}function _getServiceIdentifierForProperty(X,W,te,re){var oe=X||W;if(oe===void 0){var ne=MISSING_INJECTABLE_ANNOTATION+" for property "+String(te)+" in class "+re+".";throw new Error(ne)}return oe}function getClassPropsAsTargets(X,W,te){for(var re=X.getPropertiesMetadata(W),oe=[],ne=Object.getOwnPropertySymbols(re),de=Object.keys(re),ce=de.concat(ne),ue=0,pe=ce;ue<pe.length;ue++){var he=pe[ue],fe=re[he],be=formatTargetMetadata(fe),ge=be.targetName||he,ve=_getServiceIdentifierForProperty(be.inject,be.multiInject,he,te),me=new Target(TargetTypeEnum.ClassProperty,ge,ve);me.metadata=fe,oe.push(me)}var _e=Object.getPrototypeOf(W.prototype).constructor;if(_e!==Object){var ye=getClassPropsAsTargets(X,_e,te);oe=__spreadArray$2(__spreadArray$2([],oe,!0),ye,!0)}return oe}function getBaseClassDependencyCount(X,W){var te=Object.getPrototypeOf(W.prototype).constructor;if(te!==Object){var re=getFunctionName(te),oe=getTargets(X,re,te,!0),ne=oe.map(function(ue){return ue.metadata.filter(function(pe){return pe.key===UNMANAGED_TAG})}),de=[].concat.apply([],ne).length,ce=oe.length-de;return ce>0?ce:getBaseClassDependencyCount(X,te)}else return 0}function formatTargetMetadata(X){var W={};return X.forEach(function(te){W[te.key.toString()]=te.value}),{inject:W[INJECT_TAG],multiInject:W[MULTI_INJECT_TAG],targetName:W[NAME_TAG],unmanaged:W[UNMANAGED_TAG]}}var Request=(function(){function X(W,te,re,oe,ne){this.id=id(),this.serviceIdentifier=W,this.parentContext=te,this.parentRequest=re,this.target=ne,this.childRequests=[],this.bindings=Array.isArray(oe)?oe:[oe],this.requestScope=re===null?new Map:null}return X.prototype.addChildRequest=function(W,te,re){var oe=new X(W,this.parentContext,this,te,re);return this.childRequests.push(oe),oe},X})();function getBindingDictionary(X){return X._bindingDictionary}function _createTarget(X,W,te,re,oe,ne){var de=X?MULTI_INJECT_TAG:INJECT_TAG,ce=new Metadata(de,te),ue=new Target(W,re,te,ce);if(oe!==void 0){var pe=new Metadata(oe,ne);ue.metadata.push(pe)}return ue}function _getActiveBindings(X,W,te,re,oe){var ne=getBindings(te.container,oe.serviceIdentifier),de=[];return ne.length===BindingCount.NoBindingsAvailable&&te.container.options.autoBindInjectable&&typeof oe.serviceIdentifier=="function"&&X.getConstructorMetadata(oe.serviceIdentifier).compilerGeneratedMetadata&&(te.container.bind(oe.serviceIdentifier).toSelf(),ne=getBindings(te.container,oe.serviceIdentifier)),W?de=ne:de=ne.filter(function(ce){var ue=new Request(ce.serviceIdentifier,te,re,ce,oe);return ce.constraint(ue)}),_validateActiveBindingCount(oe.serviceIdentifier,de,oe,te.container),de}function _validateActiveBindingCount(X,W,te,re){switch(W.length){case BindingCount.NoBindingsAvailable:if(te.isOptional())return W;var oe=getServiceIdentifierAsString(X),ne=NOT_REGISTERED;throw ne+=listMetadataForTarget(oe,te),ne+=listRegisteredBindingsForServiceIdentifier(re,oe,getBindings),new Error(ne);case BindingCount.OnlyOneBindingAvailable:return W;case BindingCount.MultipleBindingsAvailable:default:if(te.isArray())return W;var oe=getServiceIdentifierAsString(X),ne=AMBIGUOUS_MATCH+" "+oe;throw ne+=listRegisteredBindingsForServiceIdentifier(re,oe,getBindings),new Error(ne)}}function _createSubRequests(X,W,te,re,oe,ne){var de,ce;if(oe===null){de=_getActiveBindings(X,W,re,null,ne),ce=new Request(te,re,null,de,ne);var ue=new Plan(re,ce);re.addPlan(ue)}else de=_getActiveBindings(X,W,re,oe,ne),ce=oe.addChildRequest(ne.serviceIdentifier,de,ne);de.forEach(function(pe){var he=null;if(ne.isArray())he=ce.addChildRequest(pe.serviceIdentifier,pe,ne);else{if(pe.cache)return;he=ce}if(pe.type===BindingTypeEnum.Instance&&pe.implementationType!==null){var fe=getDependencies$1(X,pe.implementationType);if(!re.container.options.skipBaseClassChecks){var be=getBaseClassDependencyCount(X,pe.implementationType);if(fe.length<be){var ge=ARGUMENTS_LENGTH_MISMATCH(getFunctionName(pe.implementationType));throw new Error(ge)}}fe.forEach(function(ve){_createSubRequests(X,!1,ve.serviceIdentifier,re,he,ve)})}})}function getBindings(X,W){var te=[],re=getBindingDictionary(X);return re.hasKey(W)?te=re.get(W):X.parent!==null&&(te=getBindings(X.parent,W)),te}function plan(X,W,te,re,oe,ne,de,ce){ce===void 0&&(ce=!1);var ue=new Context(W),pe=_createTarget(te,re,oe,"",ne,de);try{return _createSubRequests(X,ce,oe,ue,null,pe),ue}catch(he){throw isStackOverflowExeption(he)&&circularDependencyToException(ue.plan.rootRequest),he}}function createMockRequest(X,W,te,re){var oe=new Target(TargetTypeEnum.Variable,"",W,new Metadata(te,re)),ne=new Context(X),de=new Request(W,ne,null,[],oe);return de}function isPromise$1(X){var W=typeof X=="object"&&X!==null||typeof X=="function";return W&&typeof X.then=="function"}function isPromiseOrContainsPromise(X){return isPromise$1(X)?!0:Array.isArray(X)&&X.some(isPromise$1)}var __awaiter$3=function(X,W,te,re){function oe(ne){return ne instanceof te?ne:new te(function(de){de(ne)})}return new(te||(te=Promise))(function(ne,de){function ce(he){try{pe(re.next(he))}catch(fe){de(fe)}}function ue(he){try{pe(re.throw(he))}catch(fe){de(fe)}}function pe(he){he.done?ne(he.value):oe(he.value).then(ce,ue)}pe((re=re.apply(X,W||[])).next())})},__generator$3=function(X,W){var te={label:0,sent:function(){if(ne[0]&1)throw ne[1];return ne[1]},trys:[],ops:[]},re,oe,ne,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(pe){return function(he){return ue([pe,he])}}function ue(pe){if(re)throw new TypeError("Generator is already executing.");for(;te;)try{if(re=1,oe&&(ne=pe[0]&2?oe.return:pe[0]?oe.throw||((ne=oe.return)&&ne.call(oe),0):oe.next)&&!(ne=ne.call(oe,pe[1])).done)return ne;switch(oe=0,ne&&(pe=[pe[0]&2,ne.value]),pe[0]){case 0:case 1:ne=pe;break;case 4:return te.label++,{value:pe[1],done:!1};case 5:te.label++,oe=pe[1],pe=[0];continue;case 7:pe=te.ops.pop(),te.trys.pop();continue;default:if(ne=te.trys,!(ne=ne.length>0&&ne[ne.length-1])&&(pe[0]===6||pe[0]===2)){te=0;continue}if(pe[0]===3&&(!ne||pe[1]>ne[0]&&pe[1]<ne[3])){te.label=pe[1];break}if(pe[0]===6&&te.label<ne[1]){te.label=ne[1],ne=pe;break}if(ne&&te.label<ne[2]){te.label=ne[2],te.ops.push(pe);break}ne[2]&&te.ops.pop(),te.trys.pop();continue}pe=W.call(X,te)}catch(he){pe=[6,he],oe=0}finally{re=ne=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}},tryGetFromScope=function(X,W){return W.scope===BindingScopeEnum.Singleton&&W.activated?W.cache:W.scope===BindingScopeEnum.Request&&X.has(W.id)?X.get(W.id):null},saveToScope=function(X,W,te){W.scope===BindingScopeEnum.Singleton&&_saveToSingletonScope(W,te),W.scope===BindingScopeEnum.Request&&_saveToRequestScope(X,W,te)},_saveToRequestScope=function(X,W,te){X.has(W.id)||X.set(W.id,te)},_saveToSingletonScope=function(X,W){X.cache=W,X.activated=!0,isPromise$1(W)&&_saveAsyncResultToSingletonScope(X,W)},_saveAsyncResultToSingletonScope=function(X,W){return __awaiter$3(void 0,void 0,void 0,function(){var te,re;return __generator$3(this,function(oe){switch(oe.label){case 0:return oe.trys.push([0,2,,3]),[4,W];case 1:return te=oe.sent(),X.cache=te,[3,3];case 2:throw re=oe.sent(),X.cache=null,X.activated=!1,re;case 3:return[2]}})})},FactoryType;(function(X){X.DynamicValue="toDynamicValue",X.Factory="toFactory",X.Provider="toProvider"})(FactoryType||(FactoryType={}));var ensureFullyBound=function(X){var W=null;switch(X.type){case BindingTypeEnum.ConstantValue:case BindingTypeEnum.Function:W=X.cache;break;case BindingTypeEnum.Constructor:case BindingTypeEnum.Instance:W=X.implementationType;break;case BindingTypeEnum.DynamicValue:W=X.dynamicValue;break;case BindingTypeEnum.Provider:W=X.provider;break;case BindingTypeEnum.Factory:W=X.factory;break}if(W===null){var te=getServiceIdentifierAsString(X.serviceIdentifier);throw new Error(INVALID_BINDING_TYPE+" "+te)}},getFactoryDetails=function(X){switch(X.type){case BindingTypeEnum.Factory:return{factory:X.factory,factoryType:FactoryType.Factory};case BindingTypeEnum.Provider:return{factory:X.provider,factoryType:FactoryType.Provider};case BindingTypeEnum.DynamicValue:return{factory:X.dynamicValue,factoryType:FactoryType.DynamicValue};default:throw new Error("Unexpected factory type "+X.type)}},__assign$4=function(){return __assign$4=Object.assign||function(X){for(var W,te=1,re=arguments.length;te<re;te++){W=arguments[te];for(var oe in W)Object.prototype.hasOwnProperty.call(W,oe)&&(X[oe]=W[oe])}return X},__assign$4.apply(this,arguments)},__awaiter$2=function(X,W,te,re){function oe(ne){return ne instanceof te?ne:new te(function(de){de(ne)})}return new(te||(te=Promise))(function(ne,de){function ce(he){try{pe(re.next(he))}catch(fe){de(fe)}}function ue(he){try{pe(re.throw(he))}catch(fe){de(fe)}}function pe(he){he.done?ne(he.value):oe(he.value).then(ce,ue)}pe((re=re.apply(X,W||[])).next())})},__generator$2=function(X,W){var te={label:0,sent:function(){if(ne[0]&1)throw ne[1];return ne[1]},trys:[],ops:[]},re,oe,ne,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(pe){return function(he){return ue([pe,he])}}function ue(pe){if(re)throw new TypeError("Generator is already executing.");for(;te;)try{if(re=1,oe&&(ne=pe[0]&2?oe.return:pe[0]?oe.throw||((ne=oe.return)&&ne.call(oe),0):oe.next)&&!(ne=ne.call(oe,pe[1])).done)return ne;switch(oe=0,ne&&(pe=[pe[0]&2,ne.value]),pe[0]){case 0:case 1:ne=pe;break;case 4:return te.label++,{value:pe[1],done:!1};case 5:te.label++,oe=pe[1],pe=[0];continue;case 7:pe=te.ops.pop(),te.trys.pop();continue;default:if(ne=te.trys,!(ne=ne.length>0&&ne[ne.length-1])&&(pe[0]===6||pe[0]===2)){te=0;continue}if(pe[0]===3&&(!ne||pe[1]>ne[0]&&pe[1]<ne[3])){te.label=pe[1];break}if(pe[0]===6&&te.label<ne[1]){te.label=ne[1],ne=pe;break}if(ne&&te.label<ne[2]){te.label=ne[2],te.ops.push(pe);break}ne[2]&&te.ops.pop(),te.trys.pop();continue}pe=W.call(X,te)}catch(he){pe=[6,he],oe=0}finally{re=ne=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}},__spreadArray$1=function(X,W,te){if(te||arguments.length===2)for(var re=0,oe=W.length,ne;re<oe;re++)(ne||!(re in W))&&(ne||(ne=Array.prototype.slice.call(W,0,re)),ne[re]=W[re]);return X.concat(ne||Array.prototype.slice.call(W))};function _resolveRequests(X,W){return X.reduce(function(te,re){var oe=W(re),ne=re.target.type;return ne===TargetTypeEnum.ConstructorArgument?te.constructorInjections.push(oe):(te.propertyRequests.push(re),te.propertyInjections.push(oe)),te.isAsync||(te.isAsync=isPromiseOrContainsPromise(oe)),te},{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}function _createInstance(X,W,te){var re;if(W.length>0){var oe=_resolveRequests(W,te),ne=__assign$4(__assign$4({},oe),{constr:X});oe.isAsync?re=createInstanceWithInjectionsAsync(ne):re=createInstanceWithInjections(ne)}else re=new X;return re}function createInstanceWithInjections(X){var W,te=new((W=X.constr).bind.apply(W,__spreadArray$1([void 0],X.constructorInjections,!1)));return X.propertyRequests.forEach(function(re,oe){var ne=re.target.identifier,de=X.propertyInjections[oe];(!re.target.isOptional()||de!==void 0)&&(te[ne]=de)}),te}function createInstanceWithInjectionsAsync(X){return __awaiter$2(this,void 0,void 0,function(){var W,te;return __generator$2(this,function(re){switch(re.label){case 0:return[4,possiblyWaitInjections(X.constructorInjections)];case 1:return W=re.sent(),[4,possiblyWaitInjections(X.propertyInjections)];case 2:return te=re.sent(),[2,createInstanceWithInjections(__assign$4(__assign$4({},X),{constructorInjections:W,propertyInjections:te}))]}})})}function possiblyWaitInjections(X){return __awaiter$2(this,void 0,void 0,function(){var W,te,re,oe;return __generator$2(this,function(ne){for(W=[],te=0,re=X;te<re.length;te++)oe=re[te],Array.isArray(oe)?W.push(Promise.all(oe)):W.push(oe);return[2,Promise.all(W)]})})}function _getInstanceAfterPostConstruct(X,W){var te=_postConstruct(X,W);return isPromise$1(te)?te.then(function(){return W}):W}function _postConstruct(X,W){var te,re;if(Reflect.hasMetadata(POST_CONSTRUCT,X)){var oe=Reflect.getMetadata(POST_CONSTRUCT,X);try{return(re=(te=W)[oe.value])===null||re===void 0?void 0:re.call(te)}catch(ne){if(ne instanceof Error)throw new Error(POST_CONSTRUCT_ERROR(X.name,ne.message))}}}function _validateInstanceResolution(X,W){X.scope!==BindingScopeEnum.Singleton&&_throwIfHandlingDeactivation(X,W)}function _throwIfHandlingDeactivation(X,W){var te="Class cannot be instantiated in "+(X.scope===BindingScopeEnum.Request?"request":"transient")+" scope.";if(typeof X.onDeactivation=="function")throw new Error(ON_DEACTIVATION_ERROR(W.name,te));if(Reflect.hasMetadata(PRE_DESTROY,W))throw new Error(PRE_DESTROY_ERROR(W.name,te))}function resolveInstance(X,W,te,re){_validateInstanceResolution(X,W);var oe=_createInstance(W,te,re);return isPromise$1(oe)?oe.then(function(ne){return _getInstanceAfterPostConstruct(W,ne)}):_getInstanceAfterPostConstruct(W,oe)}var __awaiter$1=function(X,W,te,re){function oe(ne){return ne instanceof te?ne:new te(function(de){de(ne)})}return new(te||(te=Promise))(function(ne,de){function ce(he){try{pe(re.next(he))}catch(fe){de(fe)}}function ue(he){try{pe(re.throw(he))}catch(fe){de(fe)}}function pe(he){he.done?ne(he.value):oe(he.value).then(ce,ue)}pe((re=re.apply(X,W||[])).next())})},__generator$1=function(X,W){var te={label:0,sent:function(){if(ne[0]&1)throw ne[1];return ne[1]},trys:[],ops:[]},re,oe,ne,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(pe){return function(he){return ue([pe,he])}}function ue(pe){if(re)throw new TypeError("Generator is already executing.");for(;te;)try{if(re=1,oe&&(ne=pe[0]&2?oe.return:pe[0]?oe.throw||((ne=oe.return)&&ne.call(oe),0):oe.next)&&!(ne=ne.call(oe,pe[1])).done)return ne;switch(oe=0,ne&&(pe=[pe[0]&2,ne.value]),pe[0]){case 0:case 1:ne=pe;break;case 4:return te.label++,{value:pe[1],done:!1};case 5:te.label++,oe=pe[1],pe=[0];continue;case 7:pe=te.ops.pop(),te.trys.pop();continue;default:if(ne=te.trys,!(ne=ne.length>0&&ne[ne.length-1])&&(pe[0]===6||pe[0]===2)){te=0;continue}if(pe[0]===3&&(!ne||pe[1]>ne[0]&&pe[1]<ne[3])){te.label=pe[1];break}if(pe[0]===6&&te.label<ne[1]){te.label=ne[1],ne=pe;break}if(ne&&te.label<ne[2]){te.label=ne[2],te.ops.push(pe);break}ne[2]&&te.ops.pop(),te.trys.pop();continue}pe=W.call(X,te)}catch(he){pe=[6,he],oe=0}finally{re=ne=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}},_resolveRequest=function(X){return function(W){W.parentContext.setCurrentRequest(W);var te=W.bindings,re=W.childRequests,oe=W.target&&W.target.isArray(),ne=!W.parentRequest||!W.parentRequest.target||!W.target||!W.parentRequest.target.matchesArray(W.target.serviceIdentifier);if(oe&&ne)return re.map(function(ce){var ue=_resolveRequest(X);return ue(ce)});if(W.target.isOptional()&&te.length===0)return;var de=te[0];return _resolveBinding(X,W,de)}},_resolveFactoryFromBinding=function(X,W){var te=getFactoryDetails(X);return tryAndThrowErrorIfStackOverflow(function(){return te.factory.bind(X)(W)},function(){return new Error(CIRCULAR_DEPENDENCY_IN_FACTORY(te.factoryType,W.currentRequest.serviceIdentifier.toString()))})},_getResolvedFromBinding=function(X,W,te){var re,oe=W.childRequests;switch(ensureFullyBound(te),te.type){case BindingTypeEnum.ConstantValue:case BindingTypeEnum.Function:re=te.cache;break;case BindingTypeEnum.Constructor:re=te.implementationType;break;case BindingTypeEnum.Instance:re=resolveInstance(te,te.implementationType,oe,_resolveRequest(X));break;default:re=_resolveFactoryFromBinding(te,W.parentContext)}return re},_resolveInScope=function(X,W,te){var re=tryGetFromScope(X,W);return re!==null||(re=te(),saveToScope(X,W,re)),re},_resolveBinding=function(X,W,te){return _resolveInScope(X,te,function(){var re=_getResolvedFromBinding(X,W,te);return isPromise$1(re)?re=re.then(function(oe){return _onActivation(W,te,oe)}):re=_onActivation(W,te,re),re})};function _onActivation(X,W,te){var re=_bindingActivation(X.parentContext,W,te),oe=_getContainersIterator(X.parentContext.container),ne,de=oe.next();do{ne=de.value;var ce=X.parentContext,ue=X.serviceIdentifier,pe=_getContainerActivationsForService(ne,ue);isPromise$1(re)?re=_activateContainerAsync(pe,ce,re):re=_activateContainer(pe,ce,re),de=oe.next()}while(de.done!==!0&&!getBindingDictionary(ne).hasKey(X.serviceIdentifier));return re}var _bindingActivation=function(X,W,te){var re;return typeof W.onActivation=="function"?re=W.onActivation(X,te):re=te,re},_activateContainer=function(X,W,te){for(var re=X.next();!re.done;){if(te=re.value(W,te),isPromise$1(te))return _activateContainerAsync(X,W,te);re=X.next()}return te},_activateContainerAsync=function(X,W,te){return __awaiter$1(void 0,void 0,void 0,function(){var re,oe;return __generator$1(this,function(ne){switch(ne.label){case 0:return[4,te];case 1:re=ne.sent(),oe=X.next(),ne.label=2;case 2:return oe.done?[3,4]:[4,oe.value(W,re)];case 3:return re=ne.sent(),oe=X.next(),[3,2];case 4:return[2,re]}})})},_getContainerActivationsForService=function(X,W){var te=X._activations;return te.hasKey(W)?te.get(W).values():[].values()},_getContainersIterator=function(X){for(var W=[X],te=X.parent;te!==null;)W.push(te),te=te.parent;var re=function(){var ne=W.pop();return ne!==void 0?{done:!1,value:ne}:{done:!0,value:void 0}},oe={next:re};return oe};function resolve(X){var W=_resolveRequest(X.plan.rootRequest.requestScope);return W(X.plan.rootRequest)}var traverseAncerstors=function(X,W){var te=X.parentRequest;return te!==null?W(te)?!0:traverseAncerstors(te,W):!1},taggedConstraint=function(X){return function(W){var te=function(re){return re!==null&&re.target!==null&&re.target.matchesTag(X)(W)};return te.metaData=new Metadata(X,W),te}},namedConstraint=taggedConstraint(NAMED_TAG),typeConstraint=function(X){return function(W){var te=null;if(W!==null)if(te=W.bindings[0],typeof X=="string"){var re=te.serviceIdentifier;return re===X}else{var oe=W.bindings[0].implementationType;return X===oe}return!1}},BindingWhenSyntax=(function(){function X(W){this._binding=W}return X.prototype.when=function(W){return this._binding.constraint=W,new BindingOnSyntax(this._binding)},X.prototype.whenTargetNamed=function(W){return this._binding.constraint=namedConstraint(W),new BindingOnSyntax(this._binding)},X.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(W){if(W===null)return!1;var te=W.target!==null&&!W.target.isNamed()&&!W.target.isTagged();return te},new BindingOnSyntax(this._binding)},X.prototype.whenTargetTagged=function(W,te){return this._binding.constraint=taggedConstraint(W)(te),new BindingOnSyntax(this._binding)},X.prototype.whenInjectedInto=function(W){return this._binding.constraint=function(te){return te!==null&&typeConstraint(W)(te.parentRequest)},new BindingOnSyntax(this._binding)},X.prototype.whenParentNamed=function(W){return this._binding.constraint=function(te){return te!==null&&namedConstraint(W)(te.parentRequest)},new BindingOnSyntax(this._binding)},X.prototype.whenParentTagged=function(W,te){return this._binding.constraint=function(re){return re!==null&&taggedConstraint(W)(te)(re.parentRequest)},new BindingOnSyntax(this._binding)},X.prototype.whenAnyAncestorIs=function(W){return this._binding.constraint=function(te){return te!==null&&traverseAncerstors(te,typeConstraint(W))},new BindingOnSyntax(this._binding)},X.prototype.whenNoAncestorIs=function(W){return this._binding.constraint=function(te){return te!==null&&!traverseAncerstors(te,typeConstraint(W))},new BindingOnSyntax(this._binding)},X.prototype.whenAnyAncestorNamed=function(W){return this._binding.constraint=function(te){return te!==null&&traverseAncerstors(te,namedConstraint(W))},new BindingOnSyntax(this._binding)},X.prototype.whenNoAncestorNamed=function(W){return this._binding.constraint=function(te){return te!==null&&!traverseAncerstors(te,namedConstraint(W))},new BindingOnSyntax(this._binding)},X.prototype.whenAnyAncestorTagged=function(W,te){return this._binding.constraint=function(re){return re!==null&&traverseAncerstors(re,taggedConstraint(W)(te))},new BindingOnSyntax(this._binding)},X.prototype.whenNoAncestorTagged=function(W,te){return this._binding.constraint=function(re){return re!==null&&!traverseAncerstors(re,taggedConstraint(W)(te))},new BindingOnSyntax(this._binding)},X.prototype.whenAnyAncestorMatches=function(W){return this._binding.constraint=function(te){return te!==null&&traverseAncerstors(te,W)},new BindingOnSyntax(this._binding)},X.prototype.whenNoAncestorMatches=function(W){return this._binding.constraint=function(te){return te!==null&&!traverseAncerstors(te,W)},new BindingOnSyntax(this._binding)},X})(),BindingOnSyntax=(function(){function X(W){this._binding=W}return X.prototype.onActivation=function(W){return this._binding.onActivation=W,new BindingWhenSyntax(this._binding)},X.prototype.onDeactivation=function(W){return this._binding.onDeactivation=W,new BindingWhenSyntax(this._binding)},X})(),BindingWhenOnSyntax=(function(){function X(W){this._binding=W,this._bindingWhenSyntax=new BindingWhenSyntax(this._binding),this._bindingOnSyntax=new BindingOnSyntax(this._binding)}return X.prototype.when=function(W){return this._bindingWhenSyntax.when(W)},X.prototype.whenTargetNamed=function(W){return this._bindingWhenSyntax.whenTargetNamed(W)},X.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},X.prototype.whenTargetTagged=function(W,te){return this._bindingWhenSyntax.whenTargetTagged(W,te)},X.prototype.whenInjectedInto=function(W){return this._bindingWhenSyntax.whenInjectedInto(W)},X.prototype.whenParentNamed=function(W){return this._bindingWhenSyntax.whenParentNamed(W)},X.prototype.whenParentTagged=function(W,te){return this._bindingWhenSyntax.whenParentTagged(W,te)},X.prototype.whenAnyAncestorIs=function(W){return this._bindingWhenSyntax.whenAnyAncestorIs(W)},X.prototype.whenNoAncestorIs=function(W){return this._bindingWhenSyntax.whenNoAncestorIs(W)},X.prototype.whenAnyAncestorNamed=function(W){return this._bindingWhenSyntax.whenAnyAncestorNamed(W)},X.prototype.whenAnyAncestorTagged=function(W,te){return this._bindingWhenSyntax.whenAnyAncestorTagged(W,te)},X.prototype.whenNoAncestorNamed=function(W){return this._bindingWhenSyntax.whenNoAncestorNamed(W)},X.prototype.whenNoAncestorTagged=function(W,te){return this._bindingWhenSyntax.whenNoAncestorTagged(W,te)},X.prototype.whenAnyAncestorMatches=function(W){return this._bindingWhenSyntax.whenAnyAncestorMatches(W)},X.prototype.whenNoAncestorMatches=function(W){return this._bindingWhenSyntax.whenNoAncestorMatches(W)},X.prototype.onActivation=function(W){return this._bindingOnSyntax.onActivation(W)},X.prototype.onDeactivation=function(W){return this._bindingOnSyntax.onDeactivation(W)},X})(),BindingInSyntax=(function(){function X(W){this._binding=W}return X.prototype.inRequestScope=function(){return this._binding.scope=BindingScopeEnum.Request,new BindingWhenOnSyntax(this._binding)},X.prototype.inSingletonScope=function(){return this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.inTransientScope=function(){return this._binding.scope=BindingScopeEnum.Transient,new BindingWhenOnSyntax(this._binding)},X})(),BindingInWhenOnSyntax=(function(){function X(W){this._binding=W,this._bindingWhenSyntax=new BindingWhenSyntax(this._binding),this._bindingOnSyntax=new BindingOnSyntax(this._binding),this._bindingInSyntax=new BindingInSyntax(W)}return X.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},X.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},X.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},X.prototype.when=function(W){return this._bindingWhenSyntax.when(W)},X.prototype.whenTargetNamed=function(W){return this._bindingWhenSyntax.whenTargetNamed(W)},X.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},X.prototype.whenTargetTagged=function(W,te){return this._bindingWhenSyntax.whenTargetTagged(W,te)},X.prototype.whenInjectedInto=function(W){return this._bindingWhenSyntax.whenInjectedInto(W)},X.prototype.whenParentNamed=function(W){return this._bindingWhenSyntax.whenParentNamed(W)},X.prototype.whenParentTagged=function(W,te){return this._bindingWhenSyntax.whenParentTagged(W,te)},X.prototype.whenAnyAncestorIs=function(W){return this._bindingWhenSyntax.whenAnyAncestorIs(W)},X.prototype.whenNoAncestorIs=function(W){return this._bindingWhenSyntax.whenNoAncestorIs(W)},X.prototype.whenAnyAncestorNamed=function(W){return this._bindingWhenSyntax.whenAnyAncestorNamed(W)},X.prototype.whenAnyAncestorTagged=function(W,te){return this._bindingWhenSyntax.whenAnyAncestorTagged(W,te)},X.prototype.whenNoAncestorNamed=function(W){return this._bindingWhenSyntax.whenNoAncestorNamed(W)},X.prototype.whenNoAncestorTagged=function(W,te){return this._bindingWhenSyntax.whenNoAncestorTagged(W,te)},X.prototype.whenAnyAncestorMatches=function(W){return this._bindingWhenSyntax.whenAnyAncestorMatches(W)},X.prototype.whenNoAncestorMatches=function(W){return this._bindingWhenSyntax.whenNoAncestorMatches(W)},X.prototype.onActivation=function(W){return this._bindingOnSyntax.onActivation(W)},X.prototype.onDeactivation=function(W){return this._bindingOnSyntax.onDeactivation(W)},X})(),BindingToSyntax=(function(){function X(W){this._binding=W}return X.prototype.to=function(W){return this._binding.type=BindingTypeEnum.Instance,this._binding.implementationType=W,new BindingInWhenOnSyntax(this._binding)},X.prototype.toSelf=function(){if(typeof this._binding.serviceIdentifier!="function")throw new Error(""+INVALID_TO_SELF_VALUE);var W=this._binding.serviceIdentifier;return this.to(W)},X.prototype.toConstantValue=function(W){return this._binding.type=BindingTypeEnum.ConstantValue,this._binding.cache=W,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toDynamicValue=function(W){return this._binding.type=BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=W,this._binding.implementationType=null,new BindingInWhenOnSyntax(this._binding)},X.prototype.toConstructor=function(W){return this._binding.type=BindingTypeEnum.Constructor,this._binding.implementationType=W,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toFactory=function(W){return this._binding.type=BindingTypeEnum.Factory,this._binding.factory=W,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toFunction=function(W){if(typeof W!="function")throw new Error(INVALID_FUNCTION_BINDING);var te=this.toConstantValue(W);return this._binding.type=BindingTypeEnum.Function,this._binding.scope=BindingScopeEnum.Singleton,te},X.prototype.toAutoFactory=function(W){return this._binding.type=BindingTypeEnum.Factory,this._binding.factory=function(te){var re=function(){return te.container.get(W)};return re},this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toAutoNamedFactory=function(W){return this._binding.type=BindingTypeEnum.Factory,this._binding.factory=function(te){return function(re){return te.container.getNamed(W,re)}},new BindingWhenOnSyntax(this._binding)},X.prototype.toProvider=function(W){return this._binding.type=BindingTypeEnum.Provider,this._binding.provider=W,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toService=function(W){this.toDynamicValue(function(te){return te.container.get(W)})},X})(),ContainerSnapshot=(function(){function X(){}return X.of=function(W,te,re,oe,ne){var de=new X;return de.bindings=W,de.middleware=te,de.deactivations=oe,de.activations=re,de.moduleActivationStore=ne,de},X})();function isClonable(X){return typeof X=="object"&&X!==null&&"clone"in X&&typeof X.clone=="function"}var Lookup=(function(){function X(){this._map=new Map}return X.prototype.getMap=function(){return this._map},X.prototype.add=function(W,te){if(W==null)throw new Error(NULL_ARGUMENT);if(te==null)throw new Error(NULL_ARGUMENT);var re=this._map.get(W);re!==void 0?re.push(te):this._map.set(W,[te])},X.prototype.get=function(W){if(W==null)throw new Error(NULL_ARGUMENT);var te=this._map.get(W);if(te!==void 0)return te;throw new Error(KEY_NOT_FOUND)},X.prototype.remove=function(W){if(W==null)throw new Error(NULL_ARGUMENT);if(!this._map.delete(W))throw new Error(KEY_NOT_FOUND)},X.prototype.removeIntersection=function(W){var te=this;this.traverse(function(re,oe){var ne=W.hasKey(re)?W.get(re):void 0;if(ne!==void 0){var de=oe.filter(function(ce){return!ne.some(function(ue){return ce===ue})});te._setValue(re,de)}})},X.prototype.removeByCondition=function(W){var te=this,re=[];return this._map.forEach(function(oe,ne){for(var de=[],ce=0,ue=oe;ce<ue.length;ce++){var pe=ue[ce],he=W(pe);he?re.push(pe):de.push(pe)}te._setValue(ne,de)}),re},X.prototype.hasKey=function(W){if(W==null)throw new Error(NULL_ARGUMENT);return this._map.has(W)},X.prototype.clone=function(){var W=new X;return this._map.forEach(function(te,re){te.forEach(function(oe){return W.add(re,isClonable(oe)?oe.clone():oe)})}),W},X.prototype.traverse=function(W){this._map.forEach(function(te,re){W(re,te)})},X.prototype._setValue=function(W,te){te.length>0?this._map.set(W,te):this._map.delete(W)},X})(),ModuleActivationStore=(function(){function X(){this._map=new Map}return X.prototype.remove=function(W){if(this._map.has(W)){var te=this._map.get(W);return this._map.delete(W),te}return this._getEmptyHandlersStore()},X.prototype.addDeactivation=function(W,te,re){this._getModuleActivationHandlers(W).onDeactivations.add(te,re)},X.prototype.addActivation=function(W,te,re){this._getModuleActivationHandlers(W).onActivations.add(te,re)},X.prototype.clone=function(){var W=new X;return this._map.forEach(function(te,re){W._map.set(re,{onActivations:te.onActivations.clone(),onDeactivations:te.onDeactivations.clone()})}),W},X.prototype._getModuleActivationHandlers=function(W){var te=this._map.get(W);return te===void 0&&(te=this._getEmptyHandlersStore(),this._map.set(W,te)),te},X.prototype._getEmptyHandlersStore=function(){var W={onActivations:new Lookup,onDeactivations:new Lookup};return W},X})(),__assign$3=function(){return __assign$3=Object.assign||function(X){for(var W,te=1,re=arguments.length;te<re;te++){W=arguments[te];for(var oe in W)Object.prototype.hasOwnProperty.call(W,oe)&&(X[oe]=W[oe])}return X},__assign$3.apply(this,arguments)},__awaiter=function(X,W,te,re){function oe(ne){return ne instanceof te?ne:new te(function(de){de(ne)})}return new(te||(te=Promise))(function(ne,de){function ce(he){try{pe(re.next(he))}catch(fe){de(fe)}}function ue(he){try{pe(re.throw(he))}catch(fe){de(fe)}}function pe(he){he.done?ne(he.value):oe(he.value).then(ce,ue)}pe((re=re.apply(X,W||[])).next())})},__generator=function(X,W){var te={label:0,sent:function(){if(ne[0]&1)throw ne[1];return ne[1]},trys:[],ops:[]},re,oe,ne,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(pe){return function(he){return ue([pe,he])}}function ue(pe){if(re)throw new TypeError("Generator is already executing.");for(;te;)try{if(re=1,oe&&(ne=pe[0]&2?oe.return:pe[0]?oe.throw||((ne=oe.return)&&ne.call(oe),0):oe.next)&&!(ne=ne.call(oe,pe[1])).done)return ne;switch(oe=0,ne&&(pe=[pe[0]&2,ne.value]),pe[0]){case 0:case 1:ne=pe;break;case 4:return te.label++,{value:pe[1],done:!1};case 5:te.label++,oe=pe[1],pe=[0];continue;case 7:pe=te.ops.pop(),te.trys.pop();continue;default:if(ne=te.trys,!(ne=ne.length>0&&ne[ne.length-1])&&(pe[0]===6||pe[0]===2)){te=0;continue}if(pe[0]===3&&(!ne||pe[1]>ne[0]&&pe[1]<ne[3])){te.label=pe[1];break}if(pe[0]===6&&te.label<ne[1]){te.label=ne[1],ne=pe;break}if(ne&&te.label<ne[2]){te.label=ne[2],te.ops.push(pe);break}ne[2]&&te.ops.pop(),te.trys.pop();continue}pe=W.call(X,te)}catch(he){pe=[6,he],oe=0}finally{re=ne=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}},__spreadArray=function(X,W,te){if(te||arguments.length===2)for(var re=0,oe=W.length,ne;re<oe;re++)(ne||!(re in W))&&(ne||(ne=Array.prototype.slice.call(W,0,re)),ne[re]=W[re]);return X.concat(ne||Array.prototype.slice.call(W))},Container=(function(){function X(W){var te=W||{};if(typeof te!="object")throw new Error(""+CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(te.defaultScope===void 0)te.defaultScope=BindingScopeEnum.Transient;else if(te.defaultScope!==BindingScopeEnum.Singleton&&te.defaultScope!==BindingScopeEnum.Transient&&te.defaultScope!==BindingScopeEnum.Request)throw new Error(""+CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(te.autoBindInjectable===void 0)te.autoBindInjectable=!1;else if(typeof te.autoBindInjectable!="boolean")throw new Error(""+CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(te.skipBaseClassChecks===void 0)te.skipBaseClassChecks=!1;else if(typeof te.skipBaseClassChecks!="boolean")throw new Error(""+CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:te.autoBindInjectable,defaultScope:te.defaultScope,skipBaseClassChecks:te.skipBaseClassChecks},this.id=id(),this._bindingDictionary=new Lookup,this._snapshots=[],this._middleware=null,this._activations=new Lookup,this._deactivations=new Lookup,this.parent=null,this._metadataReader=new MetadataReader,this._moduleActivationStore=new ModuleActivationStore}return X.merge=function(W,te){for(var re=[],oe=2;oe<arguments.length;oe++)re[oe-2]=arguments[oe];var ne=new X,de=__spreadArray([W,te],re,!0).map(function(pe){return getBindingDictionary(pe)}),ce=getBindingDictionary(ne);function ue(pe,he){pe.traverse(function(fe,be){be.forEach(function(ge){he.add(ge.serviceIdentifier,ge.clone())})})}return de.forEach(function(pe){ue(pe,ce)}),ne},X.prototype.load=function(){for(var W=[],te=0;te<arguments.length;te++)W[te]=arguments[te];for(var re=this._getContainerModuleHelpersFactory(),oe=0,ne=W;oe<ne.length;oe++){var de=ne[oe],ce=re(de.id);de.registry(ce.bindFunction,ce.unbindFunction,ce.isboundFunction,ce.rebindFunction,ce.unbindAsyncFunction,ce.onActivationFunction,ce.onDeactivationFunction)}},X.prototype.loadAsync=function(){for(var W=[],te=0;te<arguments.length;te++)W[te]=arguments[te];return __awaiter(this,void 0,void 0,function(){var re,oe,ne,de,ce;return __generator(this,function(ue){switch(ue.label){case 0:re=this._getContainerModuleHelpersFactory(),oe=0,ne=W,ue.label=1;case 1:return oe<ne.length?(de=ne[oe],ce=re(de.id),[4,de.registry(ce.bindFunction,ce.unbindFunction,ce.isboundFunction,ce.rebindFunction,ce.unbindAsyncFunction,ce.onActivationFunction,ce.onDeactivationFunction)]):[3,4];case 2:ue.sent(),ue.label=3;case 3:return oe++,[3,1];case 4:return[2]}})})},X.prototype.unload=function(){for(var W=this,te=[],re=0;re<arguments.length;re++)te[re]=arguments[re];te.forEach(function(oe){var ne=W._removeModuleBindings(oe.id);W._deactivateSingletons(ne),W._removeModuleHandlers(oe.id)})},X.prototype.unloadAsync=function(){for(var W=[],te=0;te<arguments.length;te++)W[te]=arguments[te];return __awaiter(this,void 0,void 0,function(){var re,oe,ne,de;return __generator(this,function(ce){switch(ce.label){case 0:re=0,oe=W,ce.label=1;case 1:return re<oe.length?(ne=oe[re],de=this._removeModuleBindings(ne.id),[4,this._deactivateSingletonsAsync(de)]):[3,4];case 2:ce.sent(),this._removeModuleHandlers(ne.id),ce.label=3;case 3:return re++,[3,1];case 4:return[2]}})})},X.prototype.bind=function(W){var te=this.options.defaultScope||BindingScopeEnum.Transient,re=new Binding(W,te);return this._bindingDictionary.add(W,re),new BindingToSyntax(re)},X.prototype.rebind=function(W){return this.unbind(W),this.bind(W)},X.prototype.rebindAsync=function(W){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(te){switch(te.label){case 0:return[4,this.unbindAsync(W)];case 1:return te.sent(),[2,this.bind(W)]}})})},X.prototype.unbind=function(W){if(this._bindingDictionary.hasKey(W)){var te=this._bindingDictionary.get(W);this._deactivateSingletons(te)}this._removeServiceFromDictionary(W)},X.prototype.unbindAsync=function(W){return __awaiter(this,void 0,void 0,function(){var te;return __generator(this,function(re){switch(re.label){case 0:return this._bindingDictionary.hasKey(W)?(te=this._bindingDictionary.get(W),[4,this._deactivateSingletonsAsync(te)]):[3,2];case 1:re.sent(),re.label=2;case 2:return this._removeServiceFromDictionary(W),[2]}})})},X.prototype.unbindAll=function(){var W=this;this._bindingDictionary.traverse(function(te,re){W._deactivateSingletons(re)}),this._bindingDictionary=new Lookup},X.prototype.unbindAllAsync=function(){return __awaiter(this,void 0,void 0,function(){var W,te=this;return __generator(this,function(re){switch(re.label){case 0:return W=[],this._bindingDictionary.traverse(function(oe,ne){W.push(te._deactivateSingletonsAsync(ne))}),[4,Promise.all(W)];case 1:return re.sent(),this._bindingDictionary=new Lookup,[2]}})})},X.prototype.onActivation=function(W,te){this._activations.add(W,te)},X.prototype.onDeactivation=function(W,te){this._deactivations.add(W,te)},X.prototype.isBound=function(W){var te=this._bindingDictionary.hasKey(W);return!te&&this.parent&&(te=this.parent.isBound(W)),te},X.prototype.isCurrentBound=function(W){return this._bindingDictionary.hasKey(W)},X.prototype.isBoundNamed=function(W,te){return this.isBoundTagged(W,NAMED_TAG,te)},X.prototype.isBoundTagged=function(W,te,re){var oe=!1;if(this._bindingDictionary.hasKey(W)){var ne=this._bindingDictionary.get(W),de=createMockRequest(this,W,te,re);oe=ne.some(function(ce){return ce.constraint(de)})}return!oe&&this.parent&&(oe=this.parent.isBoundTagged(W,te,re)),oe},X.prototype.snapshot=function(){this._snapshots.push(ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},X.prototype.restore=function(){var W=this._snapshots.pop();if(W===void 0)throw new Error(NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=W.bindings,this._activations=W.activations,this._deactivations=W.deactivations,this._middleware=W.middleware,this._moduleActivationStore=W.moduleActivationStore},X.prototype.createChild=function(W){var te=new X(W||this.options);return te.parent=this,te},X.prototype.applyMiddleware=function(){for(var W=[],te=0;te<arguments.length;te++)W[te]=arguments[te];var re=this._middleware?this._middleware:this._planAndResolve();this._middleware=W.reduce(function(oe,ne){return ne(oe)},re)},X.prototype.applyCustomMetadataReader=function(W){this._metadataReader=W},X.prototype.get=function(W){var te=this._getNotAllArgs(W,!1);return this._getButThrowIfAsync(te)},X.prototype.getAsync=function(W){return __awaiter(this,void 0,void 0,function(){var te;return __generator(this,function(re){return te=this._getNotAllArgs(W,!1),[2,this._get(te)]})})},X.prototype.getTagged=function(W,te,re){var oe=this._getNotAllArgs(W,!1,te,re);return this._getButThrowIfAsync(oe)},X.prototype.getTaggedAsync=function(W,te,re){return __awaiter(this,void 0,void 0,function(){var oe;return __generator(this,function(ne){return oe=this._getNotAllArgs(W,!1,te,re),[2,this._get(oe)]})})},X.prototype.getNamed=function(W,te){return this.getTagged(W,NAMED_TAG,te)},X.prototype.getNamedAsync=function(W,te){return this.getTaggedAsync(W,NAMED_TAG,te)},X.prototype.getAll=function(W){var te=this._getAllArgs(W);return this._getButThrowIfAsync(te)},X.prototype.getAllAsync=function(W){var te=this._getAllArgs(W);return this._getAll(te)},X.prototype.getAllTagged=function(W,te,re){var oe=this._getNotAllArgs(W,!0,te,re);return this._getButThrowIfAsync(oe)},X.prototype.getAllTaggedAsync=function(W,te,re){var oe=this._getNotAllArgs(W,!0,te,re);return this._getAll(oe)},X.prototype.getAllNamed=function(W,te){return this.getAllTagged(W,NAMED_TAG,te)},X.prototype.getAllNamedAsync=function(W,te){return this.getAllTaggedAsync(W,NAMED_TAG,te)},X.prototype.resolve=function(W){var te=this.isBound(W);te||this.bind(W).toSelf();var re=this.get(W);return te||this.unbind(W),re},X.prototype._preDestroy=function(W,te){var re,oe;if(Reflect.hasMetadata(PRE_DESTROY,W)){var ne=Reflect.getMetadata(PRE_DESTROY,W);return(oe=(re=te)[ne.value])===null||oe===void 0?void 0:oe.call(re)}},X.prototype._removeModuleHandlers=function(W){var te=this._moduleActivationStore.remove(W);this._activations.removeIntersection(te.onActivations),this._deactivations.removeIntersection(te.onDeactivations)},X.prototype._removeModuleBindings=function(W){return this._bindingDictionary.removeByCondition(function(te){return te.moduleId===W})},X.prototype._deactivate=function(W,te){var re=this,oe=Object.getPrototypeOf(te).constructor;try{if(this._deactivations.hasKey(W.serviceIdentifier)){var ne=this._deactivateContainer(te,this._deactivations.get(W.serviceIdentifier).values());if(isPromise$1(ne))return this._handleDeactivationError(ne.then(function(){return re._propagateContainerDeactivationThenBindingAndPreDestroyAsync(W,te,oe)}),oe)}var de=this._propagateContainerDeactivationThenBindingAndPreDestroy(W,te,oe);if(isPromise$1(de))return this._handleDeactivationError(de,oe)}catch(ce){if(ce instanceof Error)throw new Error(ON_DEACTIVATION_ERROR(oe.name,ce.message))}},X.prototype._handleDeactivationError=function(W,te){return __awaiter(this,void 0,void 0,function(){var re;return __generator(this,function(oe){switch(oe.label){case 0:return oe.trys.push([0,2,,3]),[4,W];case 1:return oe.sent(),[3,3];case 2:if(re=oe.sent(),re instanceof Error)throw new Error(ON_DEACTIVATION_ERROR(te.name,re.message));return[3,3];case 3:return[2]}})})},X.prototype._deactivateContainer=function(W,te){for(var re=this,oe=te.next();oe.value;){var ne=oe.value(W);if(isPromise$1(ne))return ne.then(function(){return re._deactivateContainerAsync(W,te)});oe=te.next()}},X.prototype._deactivateContainerAsync=function(W,te){return __awaiter(this,void 0,void 0,function(){var re;return __generator(this,function(oe){switch(oe.label){case 0:re=te.next(),oe.label=1;case 1:return re.value?[4,re.value(W)]:[3,3];case 2:return oe.sent(),re=te.next(),[3,1];case 3:return[2]}})})},X.prototype._getContainerModuleHelpersFactory=function(){var W=this,te=function(he,fe){he._binding.moduleId=fe},re=function(he){return function(fe){var be=W.bind(fe);return te(be,he),be}},oe=function(){return function(he){return W.unbind(he)}},ne=function(){return function(he){return W.unbindAsync(he)}},de=function(){return function(he){return W.isBound(he)}},ce=function(he){return function(fe){var be=W.rebind(fe);return te(be,he),be}},ue=function(he){return function(fe,be){W._moduleActivationStore.addActivation(he,fe,be),W.onActivation(fe,be)}},pe=function(he){return function(fe,be){W._moduleActivationStore.addDeactivation(he,fe,be),W.onDeactivation(fe,be)}};return function(he){return{bindFunction:re(he),isboundFunction:de(),onActivationFunction:ue(he),onDeactivationFunction:pe(he),rebindFunction:ce(he),unbindFunction:oe(),unbindAsyncFunction:ne()}}},X.prototype._getAll=function(W){return Promise.all(this._get(W))},X.prototype._get=function(W){var te=__assign$3(__assign$3({},W),{contextInterceptor:function(oe){return oe},targetType:TargetTypeEnum.Variable});if(this._middleware){var re=this._middleware(te);if(re==null)throw new Error(INVALID_MIDDLEWARE_RETURN);return re}return this._planAndResolve()(te)},X.prototype._getButThrowIfAsync=function(W){var te=this._get(W);if(isPromiseOrContainsPromise(te))throw new Error(LAZY_IN_SYNC(W.serviceIdentifier));return te},X.prototype._getAllArgs=function(W){var te={avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:W};return te},X.prototype._getNotAllArgs=function(W,te,re,oe){var ne={avoidConstraints:!1,isMultiInject:te,serviceIdentifier:W,key:re,value:oe};return ne},X.prototype._planAndResolve=function(){var W=this;return function(te){var re=plan(W._metadataReader,W,te.isMultiInject,te.targetType,te.serviceIdentifier,te.key,te.value,te.avoidConstraints);re=te.contextInterceptor(re);var oe=resolve(re);return oe}},X.prototype._deactivateIfSingleton=function(W){var te=this;if(W.activated)return isPromise$1(W.cache)?W.cache.then(function(re){return te._deactivate(W,re)}):this._deactivate(W,W.cache)},X.prototype._deactivateSingletons=function(W){for(var te=0,re=W;te<re.length;te++){var oe=re[te],ne=this._deactivateIfSingleton(oe);if(isPromise$1(ne))throw new Error(ASYNC_UNBIND_REQUIRED)}},X.prototype._deactivateSingletonsAsync=function(W){return __awaiter(this,void 0,void 0,function(){var te=this;return __generator(this,function(re){switch(re.label){case 0:return[4,Promise.all(W.map(function(oe){return te._deactivateIfSingleton(oe)}))];case 1:return re.sent(),[2]}})})},X.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(W,te,re){return this.parent?this._deactivate.bind(this.parent)(W,te):this._bindingDeactivationAndPreDestroy(W,te,re)},X.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(W,te,re){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(oe){switch(oe.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(W,te)]:[3,2];case 1:return oe.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(W,te,re)];case 3:oe.sent(),oe.label=4;case 4:return[2]}})})},X.prototype._removeServiceFromDictionary=function(W){try{this._bindingDictionary.remove(W)}catch{throw new Error(CANNOT_UNBIND+" "+getServiceIdentifierAsString(W))}},X.prototype._bindingDeactivationAndPreDestroy=function(W,te,re){var oe=this;if(typeof W.onDeactivation=="function"){var ne=W.onDeactivation(te);if(isPromise$1(ne))return ne.then(function(){return oe._preDestroy(re,te)})}return this._preDestroy(re,te)},X.prototype._bindingDeactivationAndPreDestroyAsync=function(W,te,re){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(oe){switch(oe.label){case 0:return typeof W.onDeactivation!="function"?[3,2]:[4,W.onDeactivation(te)];case 1:oe.sent(),oe.label=2;case 2:return[4,this._preDestroy(re,te)];case 3:return oe.sent(),[2]}})})},X})();function getFirstArrayDuplicate(X){for(var W=new Set,te=0,re=X;te<re.length;te++){var oe=re[te];if(W.has(oe))return oe;W.add(oe)}}function targetIsConstructorFunction(X){return X.prototype!==void 0}function _throwIfMethodParameter(X){if(X!==void 0)throw new Error(INVALID_DECORATOR_OPERATION)}function tagParameter(X,W,te,re){_throwIfMethodParameter(W),_tagParameterOrProperty(TAGGED,X,te.toString(),re)}function tagProperty(X,W,te){if(targetIsConstructorFunction(X))throw new Error(INVALID_DECORATOR_OPERATION);_tagParameterOrProperty(TAGGED_PROP,X.constructor,W,te)}function _ensureNoMetadataKeyDuplicates(X){var W=[];if(Array.isArray(X)){W=X;var te=getFirstArrayDuplicate(W.map(function(re){return re.key}));if(te!==void 0)throw new Error(DUPLICATED_METADATA+" "+te.toString())}else W=[X];return W}function _tagParameterOrProperty(X,W,te,re){var oe=_ensureNoMetadataKeyDuplicates(re),ne={};Reflect.hasOwnMetadata(X,W)&&(ne=Reflect.getMetadata(X,W));var de=ne[te];if(de===void 0)de=[];else for(var ce=function(fe){if(oe.some(function(be){return be.key===fe.key}))throw new Error(DUPLICATED_METADATA+" "+fe.key.toString())},ue=0,pe=de;ue<pe.length;ue++){var he=pe[ue];ce(he)}de.push.apply(de,oe),ne[te]=de,Reflect.defineMetadata(X,ne,W)}function createTaggedDecorator(X){return function(W,te,re){typeof re=="number"?tagParameter(W,te,re,X):tagProperty(W,te,X)}}function _decorate(X,W){Reflect.decorate(X,W)}function _param(X,W){return function(te,re){W(te,re,X)}}function decorate(X,W,te){typeof te=="number"?_decorate([_param(te,X)],W):typeof te=="string"?Reflect.decorate([X],W,te):_decorate([X],W)}function injectable(){return function(X){if(Reflect.hasOwnMetadata(PARAM_TYPES,X))throw new Error(DUPLICATED_INJECTABLE_DECORATOR);var W=Reflect.getMetadata(DESIGN_PARAM_TYPES,X)||[];return Reflect.defineMetadata(PARAM_TYPES,W,X),X}}function injectBase(X){return function(W){return function(te,re,oe){if(W===void 0){var ne=typeof te=="function"?te.name:te.constructor.name;throw new Error(UNDEFINED_INJECT_ANNOTATION(ne))}return createTaggedDecorator(new Metadata(X,W))(te,re,oe)}}}var inject=injectBase(INJECT_TAG);const createBaseHandlers=({primaryApi:X,store:W})=>{class te{constructor(de){this.api=de}}decorate(injectable(),te),decorate(inject(X),te,0);class re{constructor(de){this.store=de}}class oe{constructor(de,ce){this.store=de,this.api=ce}}return W&&(decorate(injectable(),re),decorate(inject(W),re,0),decorate(injectable(),oe),decorate(inject(W),oe,0),decorate(inject(X),oe,1)),{ApiBaseHandler:te,BaseHandler:oe,StoreBaseHandler:re}},registerRequest$1=(X,W)=>(te,re)=>{W.bind(re).to(re).inTransientScope(),injectable()(re);const oe=X.broker.registerRequest(te,ne=>W.get(re).handle(ne));return{dispose:()=>{W.isBound(re)&&W.unbind(re),oe.dispose()}}},brokerExtensions=(X,W)=>({registerRequest:registerRequest$1(X,W)}),generateId$1=()=>{try{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch{console.warn("crypto.randomUUID() failed, using fallback")}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,X=>{const W=Math.random()*16|0;return(X==="x"?W:W&3|8).toString(16)})},DIACRITICS_REGEX=new RegExp("\\p{Diacritic}","gu"),normalizeText=X=>X.normalize("NFD").replace(DIACRITICS_REGEX,"").toLowerCase().trim();function createConnectToStoreDecorator(X){return function(te){return(re,oe)=>{const ne=`__${oe}`,de=`__unsubscribe__${oe}`;Object.defineProperty(re,oe,{get(){return this[ne]},set(pe){this[ne]!==pe&&(this[ne]=pe,this.requestUpdate(oe))},configurable:!0,enumerable:!0});const ce=re.connectedCallback,ue=re.disconnectedCallback;re.connectedCallback=function(){ce&&ce.call(this),this[oe]=te(X.getState());let pe=!1,he=!1;const fe=()=>{pe=!1,!he&&(this[oe]=te(X.getState()))},be=X.subscribe(()=>{pe||(pe=!0,queueMicrotask(fe))});this[de]=()=>{he=!0,be()}},re.disconnectedCallback=function(){ue&&ue.call(this),this[de]&&this[de]()}}}}function createConnectedProperty(X){return(W,te={})=>{const re=createConnectToStoreDecorator(X);return(oe,ne)=>{n$A(te)(oe,ne),re(W)(oe,ne)}}}const REQUEST_DIAGNOSTICS_SELECTOR="request_diagnostics_selector",CIPDS_SELECTION_REQUEST="cipds_selection_request",CIPDS_DIAGNOSTIC_FILTER_HISTORIC_REQUESTED="cipds_diagnostic_filter_historic_requested",LAST_WORKED_DIAGNOSTICS_KEY="lastWorkedDiagnostics",CLINICAL_COURSE_DRAFT_APPEND_REQUESTED="clinical_course_draft_append_requested",HELP_REQUESTED="help_requested",PLUGIN_BROKER_REQUESTS={cipds:{diagnosticsSelectorRequested:REQUEST_DIAGNOSTICS_SELECTOR,selectionRequested:CIPDS_SELECTION_REQUEST}},PLUGIN_BROKER_EVENTS={cipds:{filterHistoricRequested:CIPDS_DIAGNOSTIC_FILTER_HISTORIC_REQUESTED},clinicalCourse:{draftAppendRequested:CLINICAL_COURSE_DRAFT_APPEND_REQUESTED},helpCenter:{helpRequested:HELP_REQUESTED}},STANDALONE_NOTE_TYPE_IDS={reports:"INFC",results:"RES",laboratory:"LAB",derivations:"DER"},PETITIONS_NOTE_TYPE={id:"PETI"},CLINICAL_FOLLOW_UP_IMPORT_TITLE="Seguiment Clínic";var ActivityHistoryFilterType=(X=>(X.Checkbox="checkbox",X.Switch="switch",X))(ActivityHistoryFilterType||{});const BROKER_EVENTS={...PLUGIN_BROKER_EVENTS,activityHistory:{refreshDataRequested:"refresh_history_data_requested",errorLoadingData:"error_loading_activity_history_data",searched:"activity_history_searched",filtersCleaned:"activity_history_filters_cleaned",diagnosticFilterDeactivated:"activity_history_diagnostic_filter_deactivated",injectAsyncHistoryItemsRequest:"inject_async_history_items_request",addHistoryItemRequest:"add_history_item_request",addHistoryItemsRequest:"add_history_items_request",updateHistoryItemRequest:"update_history_item_request",removeHistoryItemRequest:"remove_history_item_request"},shell:{appCrashed:"appCrashed",mainViewChanged:"mainViewChanged",refreshTokenFailed:"refreshTokenFailed",mpidHeaderInvalid:"mpidHeaderInvalid",quickActionBusyChanged:"quickActionBusyChanged"},administrativeManagement:{tabSelected:"administrative_management_tab_selected"}},BROKER_REQUESTS={...PLUGIN_BROKER_REQUESTS};class Broker{constructor(){this.events=BROKER_EVENTS,this.requests=BROKER_REQUESTS,this.requestHandlers=new Map,this.eventSubscribers=new Map}async send(W,te){const re=typeof W=="string"?W:W.constructor,oe=this.requestHandlers.get(re);if(!oe){const de=typeof W=="string"?W:W.constructor?.name;throw new Error(`Broker: no request handler registered for "${de}".`)}const ne=typeof W=="string"?{...te}:{...W};return await oe(ne)}registerRequest(W,te){if(this.requestHandlers.has(W)){const re=typeof W=="string"?W:W.name;throw new Error(`Broker: a request handler is already registered for "${re}".`)}return this.requestHandlers.set(W,te),{dispose:()=>{this.requestHandlers.get(W)===te&&this.requestHandlers.delete(W)}}}async publish(W,te){const re=typeof W=="string"?W:W.constructor,oe=this.eventSubscribers.get(re);if(!oe||oe.size===0)return;const ne=typeof W=="string"?te:{...W},de=typeof W=="string"?W:W.constructor?.name;await Promise.all([...oe].map(async ce=>{try{await ce(ne)}catch(ue){console.error(`Broker: a subscriber for event "${de}" threw and was isolated.`,ue)}}))}subscribe(W,te){let re=this.eventSubscribers.get(W);return re||(re=new Set,this.eventSubscribers.set(W,re)),re.add(te),{dispose:()=>{const oe=this.eventSubscribers.get(W);oe&&(oe.delete(te),oe.size===0&&this.eventSubscribers.delete(W))}}}_clear(){this.requestHandlers.clear(),this.eventSubscribers.clear()}}const createBroker=()=>new Broker,EVENTS_WITH_DIAGNOSTICS=["PROVES_ORDRES_CLINIQUES_CONSULTAR","RESULT_OC","LABORATORI_SEROTECA_PETICIO_CONSULTA","LABORATORI","ORDRE_TRACTAMENT","PRESCRIPCIO_ACTIVA","REV_IT","OC_EXPRES"];class EcapEventManager{}class EcapEventManagerImpl{constructor(W){this.globalStateManager=W}publish(W,te,re){const oe=this.createEcapEvent(W,te,re??{});EVENTS_WITH_DIAGNOSTICS.includes(W)&&(oe.DIAGNOSTICS=this.globalStateManager.getData(LAST_WORKED_DIAGNOSTICS_KEY)??[]),this.raiseEcapEvent(oe)}createEcapEvent(W,te,re){return{TipusEvent:W,Accio:te,...re}}raiseEcapEvent(W){window.parent&&window.parent.postMessage(JSON.stringify(W),"*"),console.log("method",JSON.stringify(W))}}const createEcapEventManager=X=>new EcapEventManagerImpl(X);class ExitGuardManagerImpl{constructor(){this.guards=new Map}register(W,te){this.guards.set(W,te)}unregister(W){this.guards.delete(W)}async canExit(){for(const W of this.guards.values())try{if(!await W())return!1}catch(te){console.error("Exit guard failed:",te)}return!0}}class PrimariaGlobalStateManagerImpl{constructor(W){this.broker=W,this.state={}}setData(W,te){this.state[W]=te,this.broker.publish("data_set",{key:W,value:te})}getData(W){return this.state[W]}clearData(){this.state={}}}const createGlobalStateManager=X=>new PrimariaGlobalStateManagerImpl(X),ACTIVITY_EVENTS=["keydown","click","scroll"];class ActivityMonitorImpl{constructor(){this.lastActivityTimestamp=0,this.activityHandler=()=>{this.lastActivityTimestamp=Date.now()},this.start=()=>{for(const W of ACTIVITY_EVENTS)window.addEventListener(W,this.activityHandler)},this.stop=()=>{for(const W of ACTIVITY_EVENTS)window.removeEventListener(W,this.activityHandler)},this.getLastActivityTimestamp=()=>this.lastActivityTimestamp}}const createActivityMonitor=()=>new ActivityMonitorImpl;function bind(X,W){return function(){return X.apply(W,arguments)}}const{toString}=Object.prototype,{getPrototypeOf:getPrototypeOf$1}=Object,{iterator,toStringTag}=Symbol,kindOf=(X=>W=>{const te=toString.call(W);return X[te]||(X[te]=te.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=X=>(X=X.toLowerCase(),W=>kindOf(W)===X),typeOfTest=X=>W=>typeof W===X,{isArray}=Array,isUndefined=typeOfTest("undefined");function isBuffer(X){return X!==null&&!isUndefined(X)&&X.constructor!==null&&!isUndefined(X.constructor)&&isFunction$1(X.constructor.isBuffer)&&X.constructor.isBuffer(X)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(X){let W;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?W=ArrayBuffer.isView(X):W=X&&X.buffer&&isArrayBuffer(X.buffer),W}const isString$1=typeOfTest("string"),isFunction$1=typeOfTest("function"),isNumber=typeOfTest("number"),isObject=X=>X!==null&&typeof X=="object",isBoolean$1=X=>X===!0||X===!1,isPlainObject$2=X=>{if(kindOf(X)!=="object")return!1;const W=getPrototypeOf$1(X);return(W===null||W===Object.prototype||Object.getPrototypeOf(W)===null)&&!(toStringTag in X)&&!(iterator in X)},isEmptyObject=X=>{if(!isObject(X)||isBuffer(X))return!1;try{return Object.keys(X).length===0&&Object.getPrototypeOf(X)===Object.prototype}catch{return!1}},isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=X=>isObject(X)&&isFunction$1(X.pipe),isFormData=X=>{let W;return X&&(typeof FormData=="function"&&X instanceof FormData||isFunction$1(X.append)&&((W=kindOf(X))==="formdata"||W==="object"&&isFunction$1(X.toString)&&X.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=X=>X.trim?X.trim():X.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(X,W,{allOwnKeys:te=!1}={}){if(X===null||typeof X>"u")return;let re,oe;if(typeof X!="object"&&(X=[X]),isArray(X))for(re=0,oe=X.length;re<oe;re++)W.call(null,X[re],re,X);else{if(isBuffer(X))return;const ne=te?Object.getOwnPropertyNames(X):Object.keys(X),de=ne.length;let ce;for(re=0;re<de;re++)ce=ne[re],W.call(null,X[ce],ce,X)}}function findKey$1(X,W){if(isBuffer(X))return null;W=W.toLowerCase();const te=Object.keys(X);let re=te.length,oe;for(;re-- >0;)if(oe=te[re],W===oe.toLowerCase())return oe;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,isContextDefined=X=>!isUndefined(X)&&X!==_global;function merge(){const{caseless:X,skipUndefined:W}=isContextDefined(this)&&this||{},te={},re=(oe,ne)=>{const de=X&&findKey$1(te,ne)||ne;isPlainObject$2(te[de])&&isPlainObject$2(oe)?te[de]=merge(te[de],oe):isPlainObject$2(oe)?te[de]=merge({},oe):isArray(oe)?te[de]=oe.slice():(!W||!isUndefined(oe))&&(te[de]=oe)};for(let oe=0,ne=arguments.length;oe<ne;oe++)arguments[oe]&&forEach(arguments[oe],re);return te}const extend=(X,W,te,{allOwnKeys:re}={})=>(forEach(W,(oe,ne)=>{te&&isFunction$1(oe)?X[ne]=bind(oe,te):X[ne]=oe},{allOwnKeys:re}),X),stripBOM=X=>(X.charCodeAt(0)===65279&&(X=X.slice(1)),X),inherits=(X,W,te,re)=>{X.prototype=Object.create(W.prototype,re),X.prototype.constructor=X,Object.defineProperty(X,"super",{value:W.prototype}),te&&Object.assign(X.prototype,te)},toFlatObject=(X,W,te,re)=>{let oe,ne,de;const ce={};if(W=W||{},X==null)return W;do{for(oe=Object.getOwnPropertyNames(X),ne=oe.length;ne-- >0;)de=oe[ne],(!re||re(de,X,W))&&!ce[de]&&(W[de]=X[de],ce[de]=!0);X=te!==!1&&getPrototypeOf$1(X)}while(X&&(!te||te(X,W))&&X!==Object.prototype);return W},endsWith=(X,W,te)=>{X=String(X),(te===void 0||te>X.length)&&(te=X.length),te-=W.length;const re=X.indexOf(W,te);return re!==-1&&re===te},toArray=X=>{if(!X)return null;if(isArray(X))return X;let W=X.length;if(!isNumber(W))return null;const te=new Array(W);for(;W-- >0;)te[W]=X[W];return te},isTypedArray=(X=>W=>X&&W instanceof X)(typeof Uint8Array<"u"&&getPrototypeOf$1(Uint8Array)),forEachEntry=(X,W)=>{const re=(X&&X[iterator]).call(X);let oe;for(;(oe=re.next())&&!oe.done;){const ne=oe.value;W.call(X,ne[0],ne[1])}},matchAll=(X,W)=>{let te;const re=[];for(;(te=X.exec(W))!==null;)re.push(te);return re},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=X=>X.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(te,re,oe){return re.toUpperCase()+oe}),hasOwnProperty=(({hasOwnProperty:X})=>(W,te)=>X.call(W,te))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(X,W)=>{const te=Object.getOwnPropertyDescriptors(X),re={};forEach(te,(oe,ne)=>{let de;(de=W(oe,ne,X))!==!1&&(re[ne]=de||oe)}),Object.defineProperties(X,re)},freezeMethods=X=>{reduceDescriptors(X,(W,te)=>{if(isFunction$1(X)&&["arguments","caller","callee"].indexOf(te)!==-1)return!1;const re=X[te];if(isFunction$1(re)){if(W.enumerable=!1,"writable"in W){W.writable=!1;return}W.set||(W.set=()=>{throw Error("Can not rewrite read-only method '"+te+"'")})}})},toObjectSet=(X,W)=>{const te={},re=oe=>{oe.forEach(ne=>{te[ne]=!0})};return isArray(X)?re(X):re(String(X).split(W)),te},noop$1=()=>{},toFiniteNumber=(X,W)=>X!=null&&Number.isFinite(X=+X)?X:W;function isSpecCompliantForm(X){return!!(X&&isFunction$1(X.append)&&X[toStringTag]==="FormData"&&X[iterator])}const toJSONObject=X=>{const W=new Array(10),te=(re,oe)=>{if(isObject(re)){if(W.indexOf(re)>=0)return;if(isBuffer(re))return re;if(!("toJSON"in re)){W[oe]=re;const ne=isArray(re)?[]:{};return forEach(re,(de,ce)=>{const ue=te(de,oe+1);!isUndefined(ue)&&(ne[ce]=ue)}),W[oe]=void 0,ne}}return re};return te(X,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=X=>X&&(isObject(X)||isFunction$1(X))&&isFunction$1(X.then)&&isFunction$1(X.catch),_setImmediate=((X,W)=>X?setImmediate:W?((te,re)=>(_global.addEventListener("message",({source:oe,data:ne})=>{oe===_global&&ne===te&&re.length&&re.shift()()},!1),oe=>{re.push(oe),_global.postMessage(te,"*")}))(`axios@${Math.random()}`,[]):te=>setTimeout(te))(typeof setImmediate=="function",isFunction$1(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process<"u"&&process.nextTick||_setImmediate,isIterable=X=>X!=null&&isFunction$1(X[iterator]),utils$1={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString:isString$1,isNumber,isBoolean:isBoolean$1,isObject,isPlainObject:isPlainObject$2,isEmptyObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate:isDate$1,isFile,isBlob,isRegExp,isFunction:isFunction$1,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge,extend,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$1,toFiniteNumber,findKey:findKey$1,global:_global,isContextDefined,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap,isIterable};function AxiosError$1(X,W,te,re,oe){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=X,this.name="AxiosError",W&&(this.code=W),te&&(this.config=te),re&&(this.request=re),oe&&(this.response=oe,this.status=oe.status?oe.status:null)}utils$1.inherits(AxiosError$1,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$1.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1=AxiosError$1.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(X=>{descriptors[X]={value:X}}),Object.defineProperties(AxiosError$1,descriptors),Object.defineProperty(prototype$1,"isAxiosError",{value:!0}),AxiosError$1.from=(X,W,te,re,oe,ne)=>{const de=Object.create(prototype$1);utils$1.toFlatObject(X,de,function(he){return he!==Error.prototype},pe=>pe!=="isAxiosError");const ce=X&&X.message?X.message:"Error",ue=W==null&&X?X.code:W;return AxiosError$1.call(de,ce,ue,te,re,oe),X&&de.cause==null&&Object.defineProperty(de,"cause",{value:X,configurable:!0}),de.name=X&&X.name||"Error",ne&&Object.assign(de,ne),de};const httpAdapter=null;function isVisitable(X){return utils$1.isPlainObject(X)||utils$1.isArray(X)}function removeBrackets(X){return utils$1.endsWith(X,"[]")?X.slice(0,-2):X}function renderKey(X,W,te){return X?X.concat(W).map(function(oe,ne){return oe=removeBrackets(oe),!te&&ne?"["+oe+"]":oe}).join(te?".":""):W}function isFlatArray(X){return utils$1.isArray(X)&&!X.some(isVisitable)}const predicates=utils$1.toFlatObject(utils$1,{},null,function(W){return/^is[A-Z]/.test(W)});function toFormData$1(X,W,te){if(!utils$1.isObject(X))throw new TypeError("target must be an object");W=W||new FormData,te=utils$1.toFlatObject(te,{metaTokens:!0,dots:!1,indexes:!1},!1,function(me,_e){return!utils$1.isUndefined(_e[me])});const re=te.metaTokens,oe=te.visitor||he,ne=te.dots,de=te.indexes,ue=(te.Blob||typeof Blob<"u"&&Blob)&&utils$1.isSpecCompliantForm(W);if(!utils$1.isFunction(oe))throw new TypeError("visitor must be a function");function pe(ve){if(ve===null)return"";if(utils$1.isDate(ve))return ve.toISOString();if(utils$1.isBoolean(ve))return ve.toString();if(!ue&&utils$1.isBlob(ve))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$1.isArrayBuffer(ve)||utils$1.isTypedArray(ve)?ue&&typeof Blob=="function"?new Blob([ve]):Buffer.from(ve):ve}function he(ve,me,_e){let ye=ve;if(ve&&!_e&&typeof ve=="object"){if(utils$1.endsWith(me,"{}"))me=re?me:me.slice(0,-2),ve=JSON.stringify(ve);else if(utils$1.isArray(ve)&&isFlatArray(ve)||(utils$1.isFileList(ve)||utils$1.endsWith(me,"[]"))&&(ye=utils$1.toArray(ve)))return me=removeBrackets(me),ye.forEach(function(Ae,Se){!(utils$1.isUndefined(Ae)||Ae===null)&&W.append(de===!0?renderKey([me],Se,ne):de===null?me:me+"[]",pe(Ae))}),!1}return isVisitable(ve)?!0:(W.append(renderKey(_e,me,ne),pe(ve)),!1)}const fe=[],be=Object.assign(predicates,{defaultVisitor:he,convertValue:pe,isVisitable});function ge(ve,me){if(!utils$1.isUndefined(ve)){if(fe.indexOf(ve)!==-1)throw Error("Circular reference detected in "+me.join("."));fe.push(ve),utils$1.forEach(ve,function(ye,we){(!(utils$1.isUndefined(ye)||ye===null)&&oe.call(W,ye,utils$1.isString(we)?we.trim():we,me,be))===!0&&ge(ye,me?me.concat(we):[we])}),fe.pop()}}if(!utils$1.isObject(X))throw new TypeError("data must be an object");return ge(X),W}function encode$1(X){const W={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(X).replace(/[!'()~]|%20|%00/g,function(re){return W[re]})}function AxiosURLSearchParams(X,W){this._pairs=[],X&&toFormData$1(X,this,W)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(W,te){this._pairs.push([W,te])},prototype.toString=function(W){const te=W?function(re){return W.call(this,re,encode$1)}:encode$1;return this._pairs.map(function(oe){return te(oe[0])+"="+te(oe[1])},"").join("&")};function encode(X){return encodeURIComponent(X).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function buildURL(X,W,te){if(!W)return X;const re=te&&te.encode||encode;utils$1.isFunction(te)&&(te={serialize:te});const oe=te&&te.serialize;let ne;if(oe?ne=oe(W,te):ne=utils$1.isURLSearchParams(W)?W.toString():new AxiosURLSearchParams(W,te).toString(re),ne){const de=X.indexOf("#");de!==-1&&(X=X.slice(0,de)),X+=(X.indexOf("?")===-1?"?":"&")+ne}return X}class InterceptorManager{constructor(){this.handlers=[]}use(W,te,re){return this.handlers.push({fulfilled:W,rejected:te,synchronous:re?re.synchronous:!1,runWhen:re?re.runWhen:null}),this.handlers.length-1}eject(W){this.handlers[W]&&(this.handlers[W]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(W){utils$1.forEach(this.handlers,function(re){re!==null&&W(re)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),platform={...utils,...platform$1};function toURLEncodedForm(X,W){return toFormData$1(X,new platform.classes.URLSearchParams,{visitor:function(te,re,oe,ne){return platform.isNode&&utils$1.isBuffer(te)?(this.append(re,te.toString("base64")),!1):ne.defaultVisitor.apply(this,arguments)},...W})}function parsePropPath(X){return utils$1.matchAll(/\w+|\[(\w*)]/g,X).map(W=>W[0]==="[]"?"":W[1]||W[0])}function arrayToObject(X){const W={},te=Object.keys(X);let re;const oe=te.length;let ne;for(re=0;re<oe;re++)ne=te[re],W[ne]=X[ne];return W}function formDataToJSON(X){function W(te,re,oe,ne){let de=te[ne++];if(de==="__proto__")return!0;const ce=Number.isFinite(+de),ue=ne>=te.length;return de=!de&&utils$1.isArray(oe)?oe.length:de,ue?(utils$1.hasOwnProp(oe,de)?oe[de]=[oe[de],re]:oe[de]=re,!ce):((!oe[de]||!utils$1.isObject(oe[de]))&&(oe[de]=[]),W(te,re,oe[de],ne)&&utils$1.isArray(oe[de])&&(oe[de]=arrayToObject(oe[de])),!ce)}if(utils$1.isFormData(X)&&utils$1.isFunction(X.entries)){const te={};return utils$1.forEachEntry(X,(re,oe)=>{W(parsePropPath(re),oe,te,0)}),te}return null}function stringifySafely(X,W,te){if(utils$1.isString(X))try{return(W||JSON.parse)(X),utils$1.trim(X)}catch(re){if(re.name!=="SyntaxError")throw re}return(te||JSON.stringify)(X)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(W,te){const re=te.getContentType()||"",oe=re.indexOf("application/json")>-1,ne=utils$1.isObject(W);if(ne&&utils$1.isHTMLForm(W)&&(W=new FormData(W)),utils$1.isFormData(W))return oe?JSON.stringify(formDataToJSON(W)):W;if(utils$1.isArrayBuffer(W)||utils$1.isBuffer(W)||utils$1.isStream(W)||utils$1.isFile(W)||utils$1.isBlob(W)||utils$1.isReadableStream(W))return W;if(utils$1.isArrayBufferView(W))return W.buffer;if(utils$1.isURLSearchParams(W))return te.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),W.toString();let ce;if(ne){if(re.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(W,this.formSerializer).toString();if((ce=utils$1.isFileList(W))||re.indexOf("multipart/form-data")>-1){const ue=this.env&&this.env.FormData;return toFormData$1(ce?{"files[]":W}:W,ue&&new ue,this.formSerializer)}}return ne||oe?(te.setContentType("application/json",!1),stringifySafely(W)):W}],transformResponse:[function(W){const te=this.transitional||defaults.transitional,re=te&&te.forcedJSONParsing,oe=this.responseType==="json";if(utils$1.isResponse(W)||utils$1.isReadableStream(W))return W;if(W&&utils$1.isString(W)&&(re&&!this.responseType||oe)){const de=!(te&&te.silentJSONParsing)&&oe;try{return JSON.parse(W,this.parseReviver)}catch(ce){if(de)throw ce.name==="SyntaxError"?AxiosError$1.from(ce,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):ce}}return W}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(W){return W>=200&&W<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1.forEach(["delete","get","head","post","put","patch"],X=>{defaults.headers[X]={}});const ignoreDuplicateOf=utils$1.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=X=>{const W={};let te,re,oe;return X&&X.split(`
95
95
  `).forEach(function(de){oe=de.indexOf(":"),te=de.substring(0,oe).trim().toLowerCase(),re=de.substring(oe+1).trim(),!(!te||W[te]&&ignoreDuplicateOf[te])&&(te==="set-cookie"?W[te]?W[te].push(re):W[te]=[re]:W[te]=W[te]?W[te]+", "+re:re)}),W},$internals=Symbol("internals");function normalizeHeader(X){return X&&String(X).trim().toLowerCase()}function normalizeValue(X){return X===!1||X==null?X:utils$1.isArray(X)?X.map(normalizeValue):String(X)}function parseTokens(X){const W=Object.create(null),te=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let re;for(;re=te.exec(X);)W[re[1]]=re[2];return W}const isValidHeaderName=X=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(X.trim());function matchHeaderValue(X,W,te,re,oe){if(utils$1.isFunction(re))return re.call(this,W,te);if(oe&&(W=te),!!utils$1.isString(W)){if(utils$1.isString(re))return W.indexOf(re)!==-1;if(utils$1.isRegExp(re))return re.test(W)}}function formatHeader(X){return X.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(W,te,re)=>te.toUpperCase()+re)}function buildAccessors(X,W){const te=utils$1.toCamelCase(" "+W);["get","set","has"].forEach(re=>{Object.defineProperty(X,re+te,{value:function(oe,ne,de){return this[re].call(this,W,oe,ne,de)},configurable:!0})})}let AxiosHeaders$1=class{constructor(W){W&&this.set(W)}set(W,te,re){const oe=this;function ne(ce,ue,pe){const he=normalizeHeader(ue);if(!he)throw new Error("header name must be a non-empty string");const fe=utils$1.findKey(oe,he);(!fe||oe[fe]===void 0||pe===!0||pe===void 0&&oe[fe]!==!1)&&(oe[fe||ue]=normalizeValue(ce))}const de=(ce,ue)=>utils$1.forEach(ce,(pe,he)=>ne(pe,he,ue));if(utils$1.isPlainObject(W)||W instanceof this.constructor)de(W,te);else if(utils$1.isString(W)&&(W=W.trim())&&!isValidHeaderName(W))de(parseHeaders(W),te);else if(utils$1.isObject(W)&&utils$1.isIterable(W)){let ce={},ue,pe;for(const he of W){if(!utils$1.isArray(he))throw TypeError("Object iterator must return a key-value pair");ce[pe=he[0]]=(ue=ce[pe])?utils$1.isArray(ue)?[...ue,he[1]]:[ue,he[1]]:he[1]}de(ce,te)}else W!=null&&ne(te,W,re);return this}get(W,te){if(W=normalizeHeader(W),W){const re=utils$1.findKey(this,W);if(re){const oe=this[re];if(!te)return oe;if(te===!0)return parseTokens(oe);if(utils$1.isFunction(te))return te.call(this,oe,re);if(utils$1.isRegExp(te))return te.exec(oe);throw new TypeError("parser must be boolean|regexp|function")}}}has(W,te){if(W=normalizeHeader(W),W){const re=utils$1.findKey(this,W);return!!(re&&this[re]!==void 0&&(!te||matchHeaderValue(this,this[re],re,te)))}return!1}delete(W,te){const re=this;let oe=!1;function ne(de){if(de=normalizeHeader(de),de){const ce=utils$1.findKey(re,de);ce&&(!te||matchHeaderValue(re,re[ce],ce,te))&&(delete re[ce],oe=!0)}}return utils$1.isArray(W)?W.forEach(ne):ne(W),oe}clear(W){const te=Object.keys(this);let re=te.length,oe=!1;for(;re--;){const ne=te[re];(!W||matchHeaderValue(this,this[ne],ne,W,!0))&&(delete this[ne],oe=!0)}return oe}normalize(W){const te=this,re={};return utils$1.forEach(this,(oe,ne)=>{const de=utils$1.findKey(re,ne);if(de){te[de]=normalizeValue(oe),delete te[ne];return}const ce=W?formatHeader(ne):String(ne).trim();ce!==ne&&delete te[ne],te[ce]=normalizeValue(oe),re[ce]=!0}),this}concat(...W){return this.constructor.concat(this,...W)}toJSON(W){const te=Object.create(null);return utils$1.forEach(this,(re,oe)=>{re!=null&&re!==!1&&(te[oe]=W&&utils$1.isArray(re)?re.join(", "):re)}),te}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([W,te])=>W+": "+te).join(`
96
96
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(W){return W instanceof this?W:new this(W)}static concat(W,...te){const re=new this(W);return te.forEach(oe=>re.set(oe)),re}static accessor(W){const re=(this[$internals]=this[$internals]={accessors:{}}).accessors,oe=this.prototype;function ne(de){const ce=normalizeHeader(de);re[ce]||(buildAccessors(oe,de),re[ce]=!0)}return utils$1.isArray(W)?W.forEach(ne):ne(W),this}};AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),utils$1.reduceDescriptors(AxiosHeaders$1.prototype,({value:X},W)=>{let te=W[0].toUpperCase()+W.slice(1);return{get:()=>X,set(re){this[te]=re}}}),utils$1.freezeMethods(AxiosHeaders$1);function transformData(X,W){const te=this||defaults,re=W||te,oe=AxiosHeaders$1.from(re.headers);let ne=re.data;return utils$1.forEach(X,function(ce){ne=ce.call(te,ne,oe.normalize(),W?W.status:void 0)}),oe.normalize(),ne}function isCancel$1(X){return!!(X&&X.__CANCEL__)}function CanceledError$1(X,W,te){AxiosError$1.call(this,X??"canceled",AxiosError$1.ERR_CANCELED,W,te),this.name="CanceledError"}utils$1.inherits(CanceledError$1,AxiosError$1,{__CANCEL__:!0});function settle(X,W,te){const re=te.config.validateStatus;!te.status||!re||re(te.status)?X(te):W(new AxiosError$1("Request failed with status code "+te.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.ERR_BAD_RESPONSE][Math.floor(te.status/100)-4],te.config,te.request,te))}function parseProtocol(X){const W=/^([-+\w]{1,25})(:?\/\/|:)/.exec(X);return W&&W[1]||""}function speedometer(X,W){X=X||10;const te=new Array(X),re=new Array(X);let oe=0,ne=0,de;return W=W!==void 0?W:1e3,function(ue){const pe=Date.now(),he=re[ne];de||(de=pe),te[oe]=ue,re[oe]=pe;let fe=ne,be=0;for(;fe!==oe;)be+=te[fe++],fe=fe%X;if(oe=(oe+1)%X,oe===ne&&(ne=(ne+1)%X),pe-de<W)return;const ge=he&&pe-he;return ge?Math.round(be*1e3/ge):void 0}}function throttle(X,W){let te=0,re=1e3/W,oe,ne;const de=(pe,he=Date.now())=>{te=he,oe=null,ne&&(clearTimeout(ne),ne=null),X(...pe)};return[(...pe)=>{const he=Date.now(),fe=he-te;fe>=re?de(pe,he):(oe=pe,ne||(ne=setTimeout(()=>{ne=null,de(oe)},re-fe)))},()=>oe&&de(oe)]}const progressEventReducer=(X,W,te=3)=>{let re=0;const oe=speedometer(50,250);return throttle(ne=>{const de=ne.loaded,ce=ne.lengthComputable?ne.total:void 0,ue=de-re,pe=oe(ue),he=de<=ce;re=de;const fe={loaded:de,total:ce,progress:ce?de/ce:void 0,bytes:ue,rate:pe||void 0,estimated:pe&&ce&&he?(ce-de)/pe:void 0,event:ne,lengthComputable:ce!=null,[W?"download":"upload"]:!0};X(fe)},te)},progressEventDecorator=(X,W)=>{const te=X!=null;return[re=>W[0]({lengthComputable:te,total:X,loaded:re}),W[1]]},asyncDecorator=X=>(...W)=>utils$1.asap(()=>X(...W)),isURLSameOrigin=platform.hasStandardBrowserEnv?((X,W)=>te=>(te=new URL(te,platform.origin),X.protocol===te.protocol&&X.host===te.host&&(W||X.port===te.port)))(new URL(platform.origin),platform.navigator&&/(msie|trident)/i.test(platform.navigator.userAgent)):()=>!0,cookies=platform.hasStandardBrowserEnv?{write(X,W,te,re,oe,ne){const de=[X+"="+encodeURIComponent(W)];utils$1.isNumber(te)&&de.push("expires="+new Date(te).toGMTString()),utils$1.isString(re)&&de.push("path="+re),utils$1.isString(oe)&&de.push("domain="+oe),ne===!0&&de.push("secure"),document.cookie=de.join("; ")},read(X){const W=document.cookie.match(new RegExp("(^|;\\s*)("+X+")=([^;]*)"));return W?decodeURIComponent(W[3]):null},remove(X){this.write(X,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(X){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(X)}function combineURLs(X,W){return W?X.replace(/\/?\/$/,"")+"/"+W.replace(/^\/+/,""):X}function buildFullPath(X,W,te){let re=!isAbsoluteURL(W);return X&&(re||te==!1)?combineURLs(X,W):W}const headersToObject=X=>X instanceof AxiosHeaders$1?{...X}:X;function mergeConfig$2(X,W){W=W||{};const te={};function re(pe,he,fe,be){return utils$1.isPlainObject(pe)&&utils$1.isPlainObject(he)?utils$1.merge.call({caseless:be},pe,he):utils$1.isPlainObject(he)?utils$1.merge({},he):utils$1.isArray(he)?he.slice():he}function oe(pe,he,fe,be){if(utils$1.isUndefined(he)){if(!utils$1.isUndefined(pe))return re(void 0,pe,fe,be)}else return re(pe,he,fe,be)}function ne(pe,he){if(!utils$1.isUndefined(he))return re(void 0,he)}function de(pe,he){if(utils$1.isUndefined(he)){if(!utils$1.isUndefined(pe))return re(void 0,pe)}else return re(void 0,he)}function ce(pe,he,fe){if(fe in W)return re(pe,he);if(fe in X)return re(void 0,pe)}const ue={url:ne,method:ne,data:ne,baseURL:de,transformRequest:de,transformResponse:de,paramsSerializer:de,timeout:de,timeoutMessage:de,withCredentials:de,withXSRFToken:de,adapter:de,responseType:de,xsrfCookieName:de,xsrfHeaderName:de,onUploadProgress:de,onDownloadProgress:de,decompress:de,maxContentLength:de,maxBodyLength:de,beforeRedirect:de,transport:de,httpAgent:de,httpsAgent:de,cancelToken:de,socketPath:de,responseEncoding:de,validateStatus:ce,headers:(pe,he,fe)=>oe(headersToObject(pe),headersToObject(he),fe,!0)};return utils$1.forEach(Object.keys({...X,...W}),function(he){const fe=ue[he]||oe,be=fe(X[he],W[he],he);utils$1.isUndefined(be)&&fe!==ce||(te[he]=be)}),te}const resolveConfig=X=>{const W=mergeConfig$2({},X);let{data:te,withXSRFToken:re,xsrfHeaderName:oe,xsrfCookieName:ne,headers:de,auth:ce}=W;if(W.headers=de=AxiosHeaders$1.from(de),W.url=buildURL(buildFullPath(W.baseURL,W.url,W.allowAbsoluteUrls),X.params,X.paramsSerializer),ce&&de.set("Authorization","Basic "+btoa((ce.username||"")+":"+(ce.password?unescape(encodeURIComponent(ce.password)):""))),utils$1.isFormData(te)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)de.setContentType(void 0);else if(utils$1.isFunction(te.getHeaders)){const ue=te.getHeaders(),pe=["content-type","content-length"];Object.entries(ue).forEach(([he,fe])=>{pe.includes(he.toLowerCase())&&de.set(he,fe)})}}if(platform.hasStandardBrowserEnv&&(re&&utils$1.isFunction(re)&&(re=re(W)),re||re!==!1&&isURLSameOrigin(W.url))){const ue=oe&&ne&&cookies.read(ne);ue&&de.set(oe,ue)}return W},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(X){return new Promise(function(te,re){const oe=resolveConfig(X);let ne=oe.data;const de=AxiosHeaders$1.from(oe.headers).normalize();let{responseType:ce,onUploadProgress:ue,onDownloadProgress:pe}=oe,he,fe,be,ge,ve;function me(){ge&&ge(),ve&&ve(),oe.cancelToken&&oe.cancelToken.unsubscribe(he),oe.signal&&oe.signal.removeEventListener("abort",he)}let _e=new XMLHttpRequest;_e.open(oe.method.toUpperCase(),oe.url,!0),_e.timeout=oe.timeout;function ye(){if(!_e)return;const Ae=AxiosHeaders$1.from("getAllResponseHeaders"in _e&&_e.getAllResponseHeaders()),Ce={data:!ce||ce==="text"||ce==="json"?_e.responseText:_e.response,status:_e.status,statusText:_e.statusText,headers:Ae,config:X,request:_e};settle(function(Ie){te(Ie),me()},function(Ie){re(Ie),me()},Ce),_e=null}"onloadend"in _e?_e.onloadend=ye:_e.onreadystatechange=function(){!_e||_e.readyState!==4||_e.status===0&&!(_e.responseURL&&_e.responseURL.indexOf("file:")===0)||setTimeout(ye)},_e.onabort=function(){_e&&(re(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,X,_e)),_e=null)},_e.onerror=function(Se){const Ce=Se&&Se.message?Se.message:"Network Error",Pe=new AxiosError$1(Ce,AxiosError$1.ERR_NETWORK,X,_e);Pe.event=Se||null,re(Pe),_e=null},_e.ontimeout=function(){let Se=oe.timeout?"timeout of "+oe.timeout+"ms exceeded":"timeout exceeded";const Ce=oe.transitional||transitionalDefaults;oe.timeoutErrorMessage&&(Se=oe.timeoutErrorMessage),re(new AxiosError$1(Se,Ce.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.ECONNABORTED,X,_e)),_e=null},ne===void 0&&de.setContentType(null),"setRequestHeader"in _e&&utils$1.forEach(de.toJSON(),function(Se,Ce){_e.setRequestHeader(Ce,Se)}),utils$1.isUndefined(oe.withCredentials)||(_e.withCredentials=!!oe.withCredentials),ce&&ce!=="json"&&(_e.responseType=oe.responseType),pe&&([be,ve]=progressEventReducer(pe,!0),_e.addEventListener("progress",be)),ue&&_e.upload&&([fe,ge]=progressEventReducer(ue),_e.upload.addEventListener("progress",fe),_e.upload.addEventListener("loadend",ge)),(oe.cancelToken||oe.signal)&&(he=Ae=>{_e&&(re(!Ae||Ae.type?new CanceledError$1(null,X,_e):Ae),_e.abort(),_e=null)},oe.cancelToken&&oe.cancelToken.subscribe(he),oe.signal&&(oe.signal.aborted?he():oe.signal.addEventListener("abort",he)));const we=parseProtocol(oe.url);if(we&&platform.protocols.indexOf(we)===-1){re(new AxiosError$1("Unsupported protocol "+we+":",AxiosError$1.ERR_BAD_REQUEST,X));return}_e.send(ne||null)})},composeSignals=(X,W)=>{const{length:te}=X=X?X.filter(Boolean):[];if(W||te){let re=new AbortController,oe;const ne=function(pe){if(!oe){oe=!0,ce();const he=pe instanceof Error?pe:this.reason;re.abort(he instanceof AxiosError$1?he:new CanceledError$1(he instanceof Error?he.message:he))}};let de=W&&setTimeout(()=>{de=null,ne(new AxiosError$1(`timeout ${W} of ms exceeded`,AxiosError$1.ETIMEDOUT))},W);const ce=()=>{X&&(de&&clearTimeout(de),de=null,X.forEach(pe=>{pe.unsubscribe?pe.unsubscribe(ne):pe.removeEventListener("abort",ne)}),X=null)};X.forEach(pe=>pe.addEventListener("abort",ne));const{signal:ue}=re;return ue.unsubscribe=()=>utils$1.asap(ce),ue}},streamChunk=function*(X,W){let te=X.byteLength;if(te<W){yield X;return}let re=0,oe;for(;re<te;)oe=re+W,yield X.slice(re,oe),re=oe},readBytes=async function*(X,W){for await(const te of readStream(X))yield*streamChunk(te,W)},readStream=async function*(X){if(X[Symbol.asyncIterator]){yield*X;return}const W=X.getReader();try{for(;;){const{done:te,value:re}=await W.read();if(te)break;yield re}}finally{await W.cancel()}},trackStream=(X,W,te,re)=>{const oe=readBytes(X,W);let ne=0,de,ce=ue=>{de||(de=!0,re&&re(ue))};return new ReadableStream({async pull(ue){try{const{done:pe,value:he}=await oe.next();if(pe){ce(),ue.close();return}let fe=he.byteLength;if(te){let be=ne+=fe;te(be)}ue.enqueue(new Uint8Array(he))}catch(pe){throw ce(pe),pe}},cancel(ue){return ce(ue),oe.return()}},{highWaterMark:2})},DEFAULT_CHUNK_SIZE=64*1024,{isFunction}=utils$1,globalFetchAPI=(({Request:X,Response:W})=>({Request:X,Response:W}))(utils$1.global),{ReadableStream:ReadableStream$1,TextEncoder}=utils$1.global,test=(X,...W)=>{try{return!!X(...W)}catch{return!1}},factory=X=>{X=utils$1.merge.call({skipUndefined:!0},globalFetchAPI,X);const{fetch:W,Request:te,Response:re}=X,oe=W?isFunction(W):typeof fetch=="function",ne=isFunction(te),de=isFunction(re);if(!oe)return!1;const ce=oe&&isFunction(ReadableStream$1),ue=oe&&(typeof TextEncoder=="function"?(ve=>me=>ve.encode(me))(new TextEncoder):async ve=>new Uint8Array(await new te(ve).arrayBuffer())),pe=ne&&ce&&test(()=>{let ve=!1;const me=new te(platform.origin,{body:new ReadableStream$1,method:"POST",get duplex(){return ve=!0,"half"}}).headers.has("Content-Type");return ve&&!me}),he=de&&ce&&test(()=>utils$1.isReadableStream(new re("").body)),fe={stream:he&&(ve=>ve.body)};oe&&["text","arrayBuffer","blob","formData","stream"].forEach(ve=>{!fe[ve]&&(fe[ve]=(me,_e)=>{let ye=me&&me[ve];if(ye)return ye.call(me);throw new AxiosError$1(`Response type '${ve}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,_e)})});const be=async ve=>{if(ve==null)return 0;if(utils$1.isBlob(ve))return ve.size;if(utils$1.isSpecCompliantForm(ve))return(await new te(platform.origin,{method:"POST",body:ve}).arrayBuffer()).byteLength;if(utils$1.isArrayBufferView(ve)||utils$1.isArrayBuffer(ve))return ve.byteLength;if(utils$1.isURLSearchParams(ve)&&(ve=ve+""),utils$1.isString(ve))return(await ue(ve)).byteLength},ge=async(ve,me)=>{const _e=utils$1.toFiniteNumber(ve.getContentLength());return _e??be(me)};return async ve=>{let{url:me,method:_e,data:ye,signal:we,cancelToken:Ae,timeout:Se,onDownloadProgress:Ce,onUploadProgress:Pe,responseType:Ie,headers:Me,withCredentials:He="same-origin",fetchOptions:Le}=resolveConfig(ve),Oe=W||fetch;Ie=Ie?(Ie+"").toLowerCase():"text";let qe=composeSignals([we,Ae&&Ae.toAbortSignal()],Se),Fe=null;const Ve=qe&&qe.unsubscribe&&(()=>{qe.unsubscribe()});let Ge;try{if(Pe&&pe&&_e!=="get"&&_e!=="head"&&(Ge=await ge(Me,ye))!==0){let ze=new te(me,{method:"POST",body:ye,duplex:"half"}),je;if(utils$1.isFormData(ye)&&(je=ze.headers.get("content-type"))&&Me.setContentType(je),ze.body){const[Be,Xe]=progressEventDecorator(Ge,progressEventReducer(asyncDecorator(Pe)));ye=trackStream(ze.body,DEFAULT_CHUNK_SIZE,Be,Xe)}}utils$1.isString(He)||(He=He?"include":"omit");const Ye=ne&&"credentials"in te.prototype,Ke={...Le,signal:qe,method:_e.toUpperCase(),headers:Me.normalize().toJSON(),body:ye,duplex:"half",credentials:Ye?He:void 0};Fe=ne&&new te(me,Ke);let vt=await(ne?Oe(Fe,Le):Oe(me,Ke));const Je=he&&(Ie==="stream"||Ie==="response");if(he&&(Ce||Je&&Ve)){const ze={};["status","statusText","headers"].forEach(tt=>{ze[tt]=vt[tt]});const je=utils$1.toFiniteNumber(vt.headers.get("content-length")),[Be,Xe]=Ce&&progressEventDecorator(je,progressEventReducer(asyncDecorator(Ce),!0))||[];vt=new re(trackStream(vt.body,DEFAULT_CHUNK_SIZE,Be,()=>{Xe&&Xe(),Ve&&Ve()}),ze)}Ie=Ie||"text";let Ze=await fe[utils$1.findKey(fe,Ie)||"text"](vt,ve);return!Je&&Ve&&Ve(),await new Promise((ze,je)=>{settle(ze,je,{data:Ze,headers:AxiosHeaders$1.from(vt.headers),status:vt.status,statusText:vt.statusText,config:ve,request:Fe})})}catch(Ye){throw Ve&&Ve(),Ye&&Ye.name==="TypeError"&&/Load failed|fetch/i.test(Ye.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,ve,Fe),{cause:Ye.cause||Ye}):AxiosError$1.from(Ye,Ye&&Ye.code,ve,Fe)}}},seedCache=new Map,getFetch=X=>{let W=X?X.env:{};const{fetch:te,Request:re,Response:oe}=W,ne=[re,oe,te];let de=ne.length,ce=de,ue,pe,he=seedCache;for(;ce--;)ue=ne[ce],pe=he.get(ue),pe===void 0&&he.set(ue,pe=ce?new Map:factory(W)),he=pe;return pe};getFetch();const knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:{get:getFetch}};utils$1.forEach(knownAdapters,(X,W)=>{if(X){try{Object.defineProperty(X,"name",{value:W})}catch{}Object.defineProperty(X,"adapterName",{value:W})}});const renderReason=X=>`- ${X}`,isResolvedHandle=X=>utils$1.isFunction(X)||X===null||X===!1,adapters={getAdapter:(X,W)=>{X=utils$1.isArray(X)?X:[X];const{length:te}=X;let re,oe;const ne={};for(let de=0;de<te;de++){re=X[de];let ce;if(oe=re,!isResolvedHandle(re)&&(oe=knownAdapters[(ce=String(re)).toLowerCase()],oe===void 0))throw new AxiosError$1(`Unknown adapter '${ce}'`);if(oe&&(utils$1.isFunction(oe)||(oe=oe.get(W))))break;ne[ce||"#"+de]=oe}if(!oe){const de=Object.entries(ne).map(([ue,pe])=>`adapter ${ue} `+(pe===!1?"is not supported by the environment":"is not available in the build"));let ce=te?de.length>1?`since :
97
97
  `+de.map(renderReason).join(`
@@ -269,9 +269,14 @@ Try polyfilling it using "@formatjs/intl-pluralrules"
269
269
  </div>
270
270
  `,Us=class Us extends h$n{render(){return ke$1`${template$p(this)}`}};Us.styles=i$R`
271
271
  ${r$L(styles$o)}
272
- `;let PluginBusyList=Us;class PluginBusyManagerImpl{constructor(){this.tasks=[],customElements.get("plugin-busy-list")||t$z("plugin-busy-list")(PluginBusyList)}addTask(W){this.tasks.some(re=>re.taskId===W.taskId)||this.tasks.push(W)}removeTask(W){const te=this.tasks.findIndex(re=>re.taskId===W);te>-1&&this.tasks.splice(te,1)}isBusy(){return this.tasks.length>0}clearAll(){this.tasks=[]}getTasks(){return this.tasks}}class QuickActionBusyManagerImpl{constructor(W){this.broker=W,this.tasks=[]}addTask(W){this.tasks.findIndex(re=>re.taskId===W.taskId)>-1||(this.tasks.push(W),this.emitBusyChanged())}removeTask(W){const te=this.tasks.findIndex(re=>re.taskId===W);te>-1&&(this.tasks.splice(te,1),this.emitBusyChanged())}isBusy(){return this.tasks.length>0}clearAll(){this.tasks=[]}emitBusyChanged(){const W=this.isBusy();this.broker.publish(BROKER_EVENTS.shell.quickActionBusyChanged,{busy:W})}}const shellRegions={header:"header-region",headerRightActions:"header-actions-region",main:"main-region",navigationMenu:"menu-region",navigationLowerLeftMenu:"navigation-lower-left-menu",quickActions:"quick-actions-region",floating:"floating-region",communicationSidenav:"communication-sidenav-region",clinicalPathwaysSidenav:"clinical-pathways-sidenav-region",petitionerSidenav:"petitioner-sidenav-region",importData:"import-data-region",importDataActivityHistory:"import-data-activity-history-region"},clinicalMonitoringRegions={sidebar:"clinical-monitoring-widgets-sidebar-region",header:"clinical-monitoring-header-widgets-region",content:"clinical-monitoring-content-widgets-region"},activityHistoryRegions={customFilters:"clinical-monitoring-activity-history-filters-region"},administrativeManagementRegions={widgets:"administrative-management-widgets-region",tabs:"administrative-management-tabs-region",detail:"administrative-management-detail-region"},ALL_REGION_NAMES=[...Object.values(shellRegions),...Object.values(clinicalMonitoringRegions),...Object.values(activityHistoryRegions),...Object.values(administrativeManagementRegions)];class RegionManagerProxy{constructor(W,te,re){this.pluginInfo=W,this.regionManager=te,this.broker=re,this.regions={shell:shellRegions,clinicalMonitoring:clinicalMonitoringRegions,activityHistory:activityHistoryRegions,administrativeManagement:administrativeManagementRegions}}async registerView(W,te){const re=`${this.pluginInfo.pluginId}::${te.id}`;await this.regionManager.registerViewWithRegion(W,re,te),this.activateIfDefault(W,re,te)}async removeView(W,te){await this.regionManager.unregisterViewFromRegion(W,`${this.pluginInfo.pluginId}::${te}`)}activateView(W,te){return this.regionManager.getRegion(W).activate(`${this.pluginInfo.pluginId}::${te}`),W===this.regions.shell.main&&this._notifyMainViewChanged(te),Promise.resolve()}deactivateView(W,te){return this.regionManager.getRegion(W).deactivate(`${this.pluginInfo.pluginId}::${te}`),Promise.resolve()}getRegion(W){return Promise.resolve(this.regionManager.getRegion(W))}containsView(W,te){const re=this.regionManager.getRegion(W);return Promise.resolve(re?.containsView(`${this.pluginInfo.pluginId}::${te}`))}isViewActive(W,te){const oe=this.regionManager.getRegion(W).currentActiveViews.some(ne=>ne.id===te);return Promise.resolve(oe)}async registerQuickAction(W){await this.regionManager.registerViewWithRegion(this.regions.shell.quickActions,`${this.pluginInfo.pluginId}::${W.id}`,W)}async registerNavigationMenu(W){await this.regionManager.registerViewWithRegion(this.regions.shell.navigationMenu,`${this.pluginInfo.pluginId}::${W.id}`,W)}async registerMainView(W){await this.regionManager.registerViewWithRegion(this.regions.shell.main,`${this.pluginInfo.pluginId}::${W.id}`,W)}activateMainView(W){return this.regionManager.getRegion(this.regions.shell.main).activate(`${this.pluginInfo.pluginId}::${W}`),this._notifyMainViewChanged(W),Promise.resolve()}activatePluginView(W,te,re){return this.regionManager.getRegion(W).activate(`${te}::${re}`),W===this.regions.shell.main&&this._notifyMainViewChanged(re),Promise.resolve()}getCurrentMainViewActive(){return this.regionManager.getRegion(this.regions.shell.main).currentActiveViews[0]?.id}getRegisteredMainViews(){return this.regionManager.getRegisteredViews(this.regions.shell.main).map(({key:W,view:te})=>{const re=W.indexOf("::"),oe=re!==-1;return{pluginId:oe?W.slice(0,re):"",viewId:te.id??(oe?W.slice(re+2):W)}})}activateIfDefault(W,te,re){if(!re.isDefault)return;const oe=this.regionManager.getRegion(W);if(!oe||typeof oe.activate!="function")return;oe.currentActiveViews?.length>0||oe.activate(te)}_notifyMainViewChanged(W){this.broker.publish(BROKER_EVENTS.shell.mainViewChanged,{viewId:W})}async _removeAllViews(){for(const W of ALL_REGION_NAMES){const te=this.regionManager.getRegisteredViews(W)??[];for(const{key:re}of[...te])await this.regionManager.unregisterViewFromRegion(W,re)}}async _destroy(){await this.regionManager.destroy()}}const createRegionManagerProxy=(X,W,te)=>new RegionManagerProxy(X,W,te);let token,refreshToken,tokenInitialized=!1;class TokenManagerImpl{constructor(W){this.broker=W,this.getUrlParams=()=>new URLSearchParams(window.location.search),this.initToken=()=>{if(tokenInitialized)throw new Error("Token already initialized");tokenInitialized=!0;const te=this.getUrlParams();return token=te.get("access_token")||"",refreshToken=te.get("refresh_token")||"",token},this.setInitialTokens=(te,re)=>{if(tokenInitialized)throw new Error("Token already initialized");token=te,refreshToken=re,tokenInitialized=!0},this.getToken=()=>(tokenInitialized||this.initToken(),token),this.refreshToken=async()=>{tokenInitialized||this.initToken();try{const te=await axios.post("/api/token/refresh",{token:refreshToken}),{access_token:re,refresh_token:oe}=te.data;if(!re)throw new Error("Invalid refresh token response");return token=re,refreshToken=oe,token}catch(te){throw this.broker.publish(BROKER_EVENTS.shell.refreshTokenFailed,{}),te}}}}let tokenManager$1;const createTokenManager=X=>tokenManager$1||(tokenManager$1=new TokenManagerImpl(X),tokenManager$1);class UserManagerImpl{constructor(W){this.tokenManager=W,this.getRole=()=>this.getAccessInfo()?.role_type,this.isUserRoleAdministrative=()=>this.getRole()==="ADM",this.getFullName=()=>{const te=this.getAccessInfo();if(!te)return;const re=te.trace_user_given_name,oe=te.trace_user_family_name;if(!(!re&&!oe))return[oe,re].filter(Boolean).join(" ")},this.getSector=()=>this.getAccessInfo()?.module_code,this.getDNI=()=>{const te=this.getAccessInfo()?.identifier;return te?te.find(oe=>oe.type==="DNI")?.value:void 0}}getAccessInfo(){const W=this.tokenManager.getToken();if(W)try{return jwtDecode(W).access_info}catch(te){console.error("Error decoding JWT token:",te);return}}}let userManager$1;const createUserManager=X=>userManager$1||(userManager$1=new UserManagerImpl(X),userManager$1);class ImportDataManagerImpl{constructor(W){this.interactionService=W,this.selectedItems={},this.currentImporterId="",this.pluginTexts={}}async import(W,te){this.currentImporterId=W,this.currentImportParams=te,this.selectedItems={},this.pluginTexts={};try{const{ImportDataManagerModal:re}=await Promise.resolve().then(()=>component),{confirmed:oe}=await this.interactionService.confirm(void 0,{component:re},{fullCustomization:!0}),ne=this.getConcatenatedText(),de={accepted:oe,data:oe?this.selectedItems:{},text:oe?ne:{raw:"",html:""}};return oe&&console.log("[ImportDataManager] Imported data:",de),this.selectedItems={},this.currentImporterId="",this.currentImportParams=void 0,this.pluginTexts={},de}catch(re){throw this.selectedItems={},this.currentImporterId="",this.currentImportParams=void 0,this.pluginTexts={},re}}selectItems(W){console.log(`[ImportDataManager] selectItems — pluginId: "${W.pluginId}" | items: ${W.data.length} | text.raw: ${W.text.raw.length} chars | text.html: ${W.text.html.length} chars`),this.selectedItems[W.pluginId]=W.data,this.pluginTexts[W.pluginId]=W.text}getCurrentImporterId(){return this.currentImporterId}getCurrentImportParams(){return this.currentImportParams}getConcatenatedText(){const W=[],te=[];for(const re of Object.values(this.pluginTexts))re.raw&&W.push(re.raw),re.html&&te.push(re.html);return{raw:W.join(`
272
+ `;let PluginBusyList=Us;class PluginBusyManagerImpl{constructor(){this.tasks=[],customElements.get("plugin-busy-list")||t$z("plugin-busy-list")(PluginBusyList)}addTask(W){this.tasks.some(re=>re.taskId===W.taskId)||this.tasks.push(W)}removeTask(W){const te=this.tasks.findIndex(re=>re.taskId===W);te>-1&&this.tasks.splice(te,1)}isBusy(){return this.tasks.length>0}clearAll(){this.tasks=[]}getTasks(){return this.tasks}}class QuickActionBusyManagerImpl{constructor(W){this.broker=W,this.tasks=[]}addTask(W){this.tasks.findIndex(re=>re.taskId===W.taskId)>-1||(this.tasks.push(W),this.emitBusyChanged())}removeTask(W){const te=this.tasks.findIndex(re=>re.taskId===W);te>-1&&(this.tasks.splice(te,1),this.emitBusyChanged())}isBusy(){return this.tasks.length>0}clearAll(){this.tasks=[]}emitBusyChanged(){const W=this.isBusy();this.broker.publish(BROKER_EVENTS.shell.quickActionBusyChanged,{busy:W})}}const shellRegions={header:"header-region",headerRightActions:"header-actions-region",main:"main-region",navigationMenu:"menu-region",navigationLowerLeftMenu:"navigation-lower-left-menu",quickActions:"quick-actions-region",floating:"floating-region",communicationSidenav:"communication-sidenav-region",clinicalPathwaysSidenav:"clinical-pathways-sidenav-region",petitionerSidenav:"petitioner-sidenav-region",importData:"import-data-region",importDataActivityHistory:"import-data-activity-history-region"},clinicalMonitoringRegions={sidebar:"clinical-monitoring-widgets-sidebar-region",header:"clinical-monitoring-header-widgets-region",content:"clinical-monitoring-content-widgets-region"},activityHistoryRegions={customFilters:"clinical-monitoring-activity-history-filters-region"},administrativeManagementRegions={widgets:"administrative-management-widgets-region",tabs:"administrative-management-tabs-region",detail:"administrative-management-detail-region"},ALL_REGION_NAMES=[...Object.values(shellRegions),...Object.values(clinicalMonitoringRegions),...Object.values(activityHistoryRegions),...Object.values(administrativeManagementRegions)];class RegionManagerProxy{constructor(W,te,re){this.pluginInfo=W,this.regionManager=te,this.broker=re,this.regions={shell:shellRegions,clinicalMonitoring:clinicalMonitoringRegions,activityHistory:activityHistoryRegions,administrativeManagement:administrativeManagementRegions}}async registerView(W,te){const re=`${this.pluginInfo.pluginId}::${te.id}`;await this.regionManager.registerViewWithRegion(W,re,te),this.activateIfDefault(W,re,te)}async removeView(W,te){await this.regionManager.unregisterViewFromRegion(W,`${this.pluginInfo.pluginId}::${te}`)}activateView(W,te){return this.regionManager.getRegion(W).activate(`${this.pluginInfo.pluginId}::${te}`),W===this.regions.shell.main&&this._notifyMainViewChanged(te),Promise.resolve()}deactivateView(W,te){return this.regionManager.getRegion(W).deactivate(`${this.pluginInfo.pluginId}::${te}`),Promise.resolve()}getRegion(W){return Promise.resolve(this.regionManager.getRegion(W))}containsView(W,te){const re=this.regionManager.getRegion(W);return Promise.resolve(re?.containsView(`${this.pluginInfo.pluginId}::${te}`))}isViewActive(W,te){const oe=this.regionManager.getRegion(W).currentActiveViews.some(ne=>ne.id===te);return Promise.resolve(oe)}async registerQuickAction(W){await this.regionManager.registerViewWithRegion(this.regions.shell.quickActions,`${this.pluginInfo.pluginId}::${W.id}`,W)}async registerNavigationMenu(W){await this.regionManager.registerViewWithRegion(this.regions.shell.navigationMenu,`${this.pluginInfo.pluginId}::${W.id}`,W)}async registerMainView(W){await this.regionManager.registerViewWithRegion(this.regions.shell.main,`${this.pluginInfo.pluginId}::${W.id}`,W)}activateMainView(W){return this.regionManager.getRegion(this.regions.shell.main).activate(`${this.pluginInfo.pluginId}::${W}`),this._notifyMainViewChanged(W),Promise.resolve()}activatePluginView(W,te,re){return this.regionManager.getRegion(W).activate(`${te}::${re}`),W===this.regions.shell.main&&this._notifyMainViewChanged(re),Promise.resolve()}getCurrentMainViewActive(){return this.regionManager.getRegion(this.regions.shell.main).currentActiveViews[0]?.id}getRegisteredMainViews(){return this.regionManager.getRegisteredViews(this.regions.shell.main).map(({key:W,view:te})=>{const re=W.indexOf("::"),oe=re!==-1;return{pluginId:oe?W.slice(0,re):"",viewId:te.id??(oe?W.slice(re+2):W)}})}activateIfDefault(W,te,re){if(!re.isDefault)return;const oe=this.regionManager.getRegion(W);if(!oe||typeof oe.activate!="function")return;oe.currentActiveViews?.length>0||oe.activate(te)}_notifyMainViewChanged(W){this.broker.publish(BROKER_EVENTS.shell.mainViewChanged,{viewId:W})}async _removeAllViews(){for(const W of ALL_REGION_NAMES){const te=this.regionManager.getRegisteredViews(W)??[];for(const{key:re}of[...te])await this.regionManager.unregisterViewFromRegion(W,re)}}async _destroy(){await this.regionManager.destroy()}}const createRegionManagerProxy=(X,W,te)=>new RegionManagerProxy(X,W,te);let token,refreshToken,tokenInitialized=!1;class TokenManagerImpl{constructor(W){this.broker=W,this.getUrlParams=()=>new URLSearchParams(window.location.search),this.initToken=()=>{if(tokenInitialized)throw new Error("Token already initialized");tokenInitialized=!0;const te=this.getUrlParams();return token=te.get("access_token")||"",refreshToken=te.get("refresh_token")||"",token},this.setInitialTokens=(te,re)=>{if(tokenInitialized)throw new Error("Token already initialized");token=te,refreshToken=re,tokenInitialized=!0},this.getToken=()=>(tokenInitialized||this.initToken(),token),this.refreshToken=async()=>{tokenInitialized||this.initToken();try{const te=await axios.post("/api/token/refresh",{token:refreshToken}),{access_token:re,refresh_token:oe}=te.data;if(!re)throw new Error("Invalid refresh token response");return token=re,refreshToken=oe,token}catch(te){throw this.broker.publish(BROKER_EVENTS.shell.refreshTokenFailed,{}),te}}}}let tokenManager$1;const createTokenManager=X=>tokenManager$1||(tokenManager$1=new TokenManagerImpl(X),tokenManager$1);class UserManagerImpl{constructor(W){this.tokenManager=W,this.getRole=()=>this.getAccessInfo()?.role_type,this.isUserRoleAdministrative=()=>this.getRole()==="ADM",this.getFullName=()=>{const te=this.getAccessInfo();if(!te)return;const re=te.trace_user_given_name,oe=te.trace_user_family_name;if(!(!re&&!oe))return[oe,re].filter(Boolean).join(" ")},this.getSector=()=>this.getAccessInfo()?.module_code,this.getDNI=()=>{const te=this.getAccessInfo()?.identifier;return te?te.find(oe=>oe.type==="DNI")?.value:void 0}}getAccessInfo(){const W=this.tokenManager.getToken();if(W)try{return jwtDecode(W).access_info}catch(te){console.error("Error decoding JWT token:",te);return}}}let userManager$1;const createUserManager=X=>userManager$1||(userManager$1=new UserManagerImpl(X),userManager$1);class ImportDataManagerImpl{constructor(W){this.interactionService=W,this.selectedItems={},this.currentImporterId="",this.pluginTexts={}}async import(W,te){this.currentImporterId=W,this.currentImportParams=te,this.selectedItems={},this.pluginTexts={};try{const{ImportDataManagerModal:re}=await Promise.resolve().then(()=>component),{confirmed:oe}=await this.interactionService.confirm(void 0,{component:re},{fullCustomization:!0}),ne=this.getConcatenatedText(),de={accepted:oe,data:oe?this.selectedItems:{},text:oe?ne:{raw:"",html:""}};return oe&&console.log("[ImportDataManager] Imported data:",de),this.selectedItems={},this.currentImporterId="",this.currentImportParams=void 0,this.pluginTexts={},de}catch(re){throw this.selectedItems={},this.currentImporterId="",this.currentImportParams=void 0,this.pluginTexts={},re}}selectItems(W){console.log(`[ImportDataManager] selectItems — pluginId: "${W.pluginId}" | items: ${W.data.length} | text.raw: ${W.text.raw.length} chars | text.html: ${W.text.html.length} chars`),this.selectedItems[W.pluginId]=W.data,this.pluginTexts[W.pluginId]={...W.text,title:W.title}}getCurrentImporterId(){return this.currentImporterId}getCurrentImportParams(){return this.currentImportParams}getConcatenatedText(){const W=[];for(const{raw:oe,html:ne,title:de}of Object.values(this.pluginTexts)){if(!oe&&!ne)continue;const ce=de??"";let ue=W.find(pe=>pe.title===ce);ue||(ue={title:ce,raw:[],html:[]},W.push(ue)),oe&&ue.raw.push(oe),ne&&ue.html.push(ne)}const te=W.filter(oe=>oe.raw.length>0).map(oe=>(oe.title?`${oe.title}
273
273
 
274
- `),html:te.join("<br><br>")}}}class PrimariaContextManagerImpl{constructor(){this.context={}}initializeContext(W){this.context={...W}}getContext(){return{...this.context}}}let contextManager$1;const createContextManager=()=>contextManager$1||(contextManager$1=new PrimariaContextManagerImpl,contextManager$1),broker$1=createBroker(),regionManager=v$n("primaria"),PrimariaRegionHost=f$o(regionManager),tokenManager=createTokenManager(broker$1),userManager=createUserManager(tokenManager),activityMonitor=createActivityMonitor(),sessionRefreshTimer=createSessionRefreshTimer(tokenManager,activityMonitor),globalStateManager=createGlobalStateManager(broker$1),contextManager=createContextManager(),pluginBusyManager=new PluginBusyManagerImpl,exitGuardManager=new ExitGuardManagerImpl,quickActionBusyManager=new QuickActionBusyManagerImpl(broker$1),interactionService=new ParimariaInteractionServiceImpl,notificationService=new PrimariaNotificationServiceImpl,ecapEventManager=createEcapEventManager(globalStateManager),pdfViewerManager=createPdfViewerManager(broker$1,notificationService),importDataManager=new ImportDataManagerImpl(interactionService),primariaApiFactory=X=>{const W=createRegionManagerProxy(X,regionManager,broker$1);return{pluginInfo:X,regionManager:W,httpClient:createHttpClient(tokenManager,broker$1),broker:broker$1,createLocaleManager:createLocaleManager(X.pluginId),globalStateManager,contextManager,tokenManager,userManager,ecapEventManager,pluginBusyManager,exitGuardManager,quickActionBusyManager,interactionService,notificationService,pdfViewerManager,importDataManager}},shellApi=primariaApiFactory({pluginId:primariaShellId}),api=Object.freeze(Object.defineProperty({__proto__:null,PrimariaRegionHost,activityMonitor,primariaApiFactory,sessionRefreshTimer,shellApi},Symbol.toStringTag,{value:"Module"})),registerRequest=(X,W)=>(te,re)=>{W.bind(re).to(re).inTransientScope(),injectable()(re);const oe=X.broker.registerRequest(te,ne=>W.get(re).handle(ne));return{dispose:()=>{W.isBound(re)&&W.unbind(re),oe.dispose()}}};let bootstrappedPlugins=[];const CORE_FIRST_ID="activity-history",bundledActivityHistory={pluginId:CORE_FIRST_ID,importer:()=>Promise.resolve().then(()=>plugin)},bootstrapPlugins=async(X,W)=>{const te=X??[],re=te.filter(ue=>ue.pluginId===CORE_FIRST_ID),oe=te.filter(ue=>ue.pluginId!==CORE_FIRST_ID),ne=re.length?re:[bundledActivityHistory],de=await p$d(ne,primariaApiFactory),ce=oe.length?await p$d(oe,primariaApiFactory):[];bootstrappedPlugins=[...de,...ce],handleStartupPlugin(bootstrappedPlugins,W)},handleStartupPlugin=(X,W)=>{if(X&&X.length>0&&W?.pluginId){const te=X.find(re=>re?.apiInstance.pluginInfo.pluginId===W.pluginId);te?.importedPlugin?.startup&&te?.importedPlugin?.startup?.(te.apiInstance,W.params)}},disposePlugins=async()=>Promise.all(bootstrappedPlugins.map(X=>X?.dispose()));var __getOwnPropDesc$i=Object.getOwnPropertyDescriptor,__decorateClass$x=(X,W,te,re)=>{for(var oe=re>1?void 0:re?__getOwnPropDesc$i(W,te):W,ne=X.length-1,de;ne>=0;ne--)(de=X[ne])&&(oe=de(oe)||oe);return oe},__decorateParam$2=(X,W)=>(te,re)=>W(te,re,X);let ExitShellHandler=class{constructor(X){this.api=X}async handle(X){const W=X&&X.ecapEvent!==void 0?X:void 0;try{if(!await this.api.exitGuardManager.canExit())return;const re=this.api.pluginBusyManager.getTasks();if(re.length>0){const{confirmed:oe}=await this.askForClose(re);if(!oe)return}await Promise.race([this.unmountViewsAndDisposePlugins(),this.timeout(1e4)]),await disposeShell(),this.emitClose(W)}catch{this.api.notificationService.error(translate$1("errors.exit")),this.emitClose(W)}}async unmountViewsAndDisposePlugins(){await this.api.regionManager._removeAllViews(),await disposePlugins()}timeout(X){return new Promise(W=>setTimeout(W,X))}askForClose(X){return this.api.interactionService.confirm({busyTasks:X},{component:PluginBusyList},{title:translate$1("actions.askExit"),state:"error",confirmButtonText:"Sí",cancelButtonText:"No"})}emitClose(X){X?raiseCustomCloseEvent(X):raiseCloseEvent()}};ExitShellHandler=__decorateClass$x([__decorateParam$2(0,inject(TYPES$1.primaryApi))],ExitShellHandler);class ExitShell{constructor(W,te){this.ecapEvent=W,this.payload=te}}let request$f;const useExitShell=X=>{disposeExitShell(),request$f=registerRequest(X,container$1)(ExitShell,ExitShellHandler)},disposeExitShell=()=>{request$f?.dispose()};var __getOwnPropDesc$h=Object.getOwnPropertyDescriptor,__decorateClass$w=(X,W,te,re)=>{for(var oe=re>1?void 0:re?__getOwnPropDesc$h(W,te):W,ne=X.length-1,de;ne>=0;ne--)(de=X[ne])&&(oe=de(oe)||oe);return oe},__decorateParam$1=(X,W)=>(te,re)=>W(te,re,X);const USER_ID_TYPES=["DNI","NIE","PASS"];let GetUserInfoBackendAdapter=class{constructor(X){this.api=X}getUserInfo(){const W=jwtDecode(this.api.tokenManager.getToken()).access_info,te={userId:this.getUserId(W)??"",firstName:W?.trace_user_given_name??"",familyName:W?.trace_user_family_name??"",lastName:W?.trace_user_last_name??"",registrationNumber:this.findIdentifier(W,"NUMCOL")??"",workCenter:W?.center_code??"",role:W?.role_type??"",speciality:W?.professional_category??""};return Promise.resolve(te)}findIdentifier(X,W){return X?.identifier?.find(te=>te.type===W)?.value}getUserId(X){for(const W of USER_ID_TYPES){const te=this.findIdentifier(X,W);if(te)return te}}};GetUserInfoBackendAdapter=__decorateClass$w([injectable(),__decorateParam$1(0,inject(TYPES$1.primaryApi))],GetUserInfoBackendAdapter);var __getOwnPropDesc$g=Object.getOwnPropertyDescriptor,__decorateClass$v=(X,W,te,re)=>{for(var oe=re>1?void 0:re?__getOwnPropDesc$g(W,te):W,ne=X.length-1,de;ne>=0;ne--)(de=X[ne])&&(oe=de(oe)||oe);return oe},__decorateParam=(X,W)=>(te,re)=>W(te,re,X);let GetUserInfoHandler=class{constructor(X,W){this.api=X,this.backendAdapter=W}async handle(X){try{const W=await this.backendAdapter.getUserInfo();return this.api.globalStateManager.setData("userInfo",W),W}catch(W){this.api.notificationService.error(W.message)}}};GetUserInfoHandler=__decorateClass$v([__decorateParam(0,inject(TYPES$1.primaryApi)),__decorateParam(1,inject(GetUserInfoBackendAdapter))],GetUserInfoHandler);class GetUserInfo{}let request$e;const useGetUserInfo=X=>{disposeGetUserInfo(),request$e=registerRequest(X,container$1)(GetUserInfo,GetUserInfoHandler),registerDep(GetUserInfoBackendAdapter)},disposeGetUserInfo=()=>{request$e?.dispose(),unregisterDep(GetUserInfoBackendAdapter)},useFeatures=X=>{container$1.bind(TYPES$1.primaryApi).toConstantValue(X),useGetUserInfo(X),useExitShell(X),X.broker.send(new GetUserInfo)},disposeFeatures=async X=>{disposeGetUserInfo(),disposeExitShell(),container$1.unbindAll(),await X.regionManager._destroy(),X.broker._clear()},disposeShell=async()=>{await disposeFeatures(shellApi),shellApi.interactionService.dispose(),sessionRefreshTimer.stop(),activityMonitor.stop()},raiseCloseEvent=()=>{shellApi.ecapEventManager.publish("CLOSE_FORM","",{})},raiseCustomCloseEvent=X=>{shellApi.ecapEventManager.publish(X.ecapEvent,"",X.payload)};var shellViews=(X=>(X.shell="primaria-shell",X.error="primaria-error-view",X))(shellViews||{});const styles$n=":host{width:100%;overflow:hidden}#main-switcher{display:inherit}.container{width:100%;height:100%;display:flex;flex-direction:column;background:#fff}.main-container{min-height:1px;height:100%;display:flex}.main-container .sidebar{padding-inline:16px;display:flex;flex-direction:column;justify-content:space-between;align-items:center;background:var(--color-primary-700);width:40px;height:100%;color:#fff}.main-container .sidebar .quick-actions-content{padding-top:24px;padding-bottom:22px;border-radius:8px}.main-container .sidebar .quick-actions-content .create-button-icon-badge{position:relative}.main-container .sidebar .quick-actions-content .create-button-icon-badge dss-notification-badge{position:absolute;top:-7px;right:-6px;z-index:1}.main-container .sidebar .quick-actions-content .create-button-icon-badge dss-icon{position:relative}.main-container .sidebar .icon{margin-left:8px}.main-container .sidebar #menu-region{width:100%;height:100%;min-height:1px}.main-container .sidebar #menu-region-container{padding-top:15px;min-height:1px;height:100%;width:100%;display:flex;flex-direction:column;gap:4px;overflow-y:auto;margin-right:-14px;padding-right:14px;scrollbar-color:var(--color-primary-200) var(--color-primary-700);scrollbar-width:thin}.main-container .sidebar #menu-region-container::-webkit-scrollbar{width:6px}.main-container .sidebar #menu-region-container::-webkit-scrollbar-track{background:var(--color-primary-700)}.main-container .sidebar #menu-region-container::-webkit-scrollbar-thumb{background-color:var(--color-primary-400);border-radius:4px}.main-container .sidebar .bottom-content{display:flex;flex-direction:column;gap:24px;width:100%}.main-container .sidebar .bottom-content .bottom-content-first{display:flex;flex-direction:column;gap:22px}.main-container .sidebar[expanded]{width:252px;align-items:flex-start}.main-container .sidebar .create-button-closed{cursor:pointer;background-color:#f0f0f0;color:var(--color-primary-700);border-radius:8px;width:40px;height:40px;display:flex;flex-direction:row;align-items:center;justify-content:center;transition:background-color .3s ease}.main-container .sidebar .create-button-closed:hover{background-color:var(--color-primary-900);color:#fff}.main-container .sidebar .create-button-opened{cursor:pointer;background-color:#f0f0f0;color:var(--color-primary-700);border-radius:8px;gap:8px;font-weight:600;width:220px;height:40px;display:flex;flex-direction:row;align-items:center;transition:background-color .3s ease}.main-container .sidebar .create-button-opened:hover{background-color:var(--color-primary-900);color:#fff}.main-container .content{display:flex;height:100%;width:100%;min-width:0}.main-container #main-region-container{min-height:1px;min-width:0;height:100%;flex:1}.main-container #navigation-menu-lower-region-container{display:flex;flex-direction:column;gap:4px}.footer{display:flex;height:48px;padding:12px 24px}.footer .footer-logo{align-self:center;display:flex;gap:16px}.divider-opened{width:220px}.divider-closed{width:40px}.toggle-button{margin-bottom:24px}@media (max-width: 1439px){.bottom-content-first{margin-bottom:24px}.toggle-button{display:none}.content{overflow-y:auto}}";let t$v="";function f$n(){return t$v}function s$E(X,W){const te=f$n(),re=`${X}${te}`;customElements.define(re,W)}const e$P="*,*:before,*:after{box-sizing:border-box}*{margin:0;padding:0;font-family:var(--font-family)}ul,ol{list-style:none}",n$y={type:Boolean,converter:{fromAttribute:X=>X!==null&&X!=="false",toAttribute:X=>X?"true":null}},o$U={fromAttribute:X=>!(X===null||X==="false"),toAttribute:X=>X?"":null},i$N={type:Array,converter:{fromAttribute:X=>{if(!X)return[];const W=JSON.parse(X);return Array.isArray(W)?W.map(te=>te.toString()):[W.toString()]},toAttribute:X=>JSON.stringify(X)}},i$M=':host{display:flex;align-items:center}.dss-icon,.material-symbols-rounded{font-family:var(--icon-font);font-size:var(--icon-size-md);font-weight:400;font-style:normal;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased;font-variation-settings:"FILL" 0,"wght" 400,"GRAD" 0,"opsz" 24}.dss-icon--fill,.material-symbols-rounded--fill{font-variation-settings:"FILL" 1}.dss-icon--sm{font-size:var(--icon-size-sm)}.dss-icon--md{font-size:var(--icon-size-md)}.dss-icon--lg{font-size:var(--icon-size-lg)}.dss-icon--xl{font-size:var(--icon-size-xl)}.dss-icon-ghost{display:inline-block;height:var(--icon-size-md);width:var(--icon-size-md);overflow:hidden;background-color:transparent}.dss-icon-ghost--sm{height:var(--icon-size-sm);width:var(--icon-size-sm);border-radius:var(--dss-radius-xs)}.dss-icon-ghost--lg{height:var(--icon-size-lg);width:var(--icon-size-lg)}.dss-icon-ghost--xl{height:var(--icon-size-xl);width:var(--icon-size-xl)}.dss-icon--spin{animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}';/**
274
+ `:"")+oe.raw.join(`
275
+
276
+ `)).join(`
277
+
278
+ `),re=W.filter(oe=>oe.html.length>0).map(oe=>(oe.title?`<p><strong>${oe.title}</strong></p>`:"")+oe.html.join("<br><br>")).join("<br><br>");return{raw:te?`${te}
279
+ `:"",html:re?`${re}<p><br></p>`:""}}}class PrimariaContextManagerImpl{constructor(){this.context={}}initializeContext(W){this.context={...W}}getContext(){return{...this.context}}}let contextManager$1;const createContextManager=()=>contextManager$1||(contextManager$1=new PrimariaContextManagerImpl,contextManager$1),broker$1=createBroker(),regionManager=v$n("primaria"),PrimariaRegionHost=f$o(regionManager),tokenManager=createTokenManager(broker$1),userManager=createUserManager(tokenManager),activityMonitor=createActivityMonitor(),sessionRefreshTimer=createSessionRefreshTimer(tokenManager,activityMonitor),globalStateManager=createGlobalStateManager(broker$1),contextManager=createContextManager(),pluginBusyManager=new PluginBusyManagerImpl,exitGuardManager=new ExitGuardManagerImpl,quickActionBusyManager=new QuickActionBusyManagerImpl(broker$1),interactionService=new ParimariaInteractionServiceImpl,notificationService=new PrimariaNotificationServiceImpl,ecapEventManager=createEcapEventManager(globalStateManager),pdfViewerManager=createPdfViewerManager(broker$1,notificationService),importDataManager=new ImportDataManagerImpl(interactionService),primariaApiFactory=X=>{const W=createRegionManagerProxy(X,regionManager,broker$1);return{pluginInfo:X,regionManager:W,httpClient:createHttpClient(tokenManager,broker$1),broker:broker$1,createLocaleManager:createLocaleManager(X.pluginId),globalStateManager,contextManager,tokenManager,userManager,ecapEventManager,pluginBusyManager,exitGuardManager,quickActionBusyManager,interactionService,notificationService,pdfViewerManager,importDataManager}},shellApi=primariaApiFactory({pluginId:primariaShellId}),api=Object.freeze(Object.defineProperty({__proto__:null,PrimariaRegionHost,activityMonitor,primariaApiFactory,sessionRefreshTimer,shellApi},Symbol.toStringTag,{value:"Module"})),registerRequest=(X,W)=>(te,re)=>{W.bind(re).to(re).inTransientScope(),injectable()(re);const oe=X.broker.registerRequest(te,ne=>W.get(re).handle(ne));return{dispose:()=>{W.isBound(re)&&W.unbind(re),oe.dispose()}}};let bootstrappedPlugins=[];const CORE_FIRST_ID="activity-history",bundledActivityHistory={pluginId:CORE_FIRST_ID,importer:()=>Promise.resolve().then(()=>plugin)},bootstrapPlugins=async(X,W)=>{const te=X??[],re=te.filter(ue=>ue.pluginId===CORE_FIRST_ID),oe=te.filter(ue=>ue.pluginId!==CORE_FIRST_ID),ne=re.length?re:[bundledActivityHistory],de=await p$d(ne,primariaApiFactory),ce=oe.length?await p$d(oe,primariaApiFactory):[];bootstrappedPlugins=[...de,...ce],handleStartupPlugin(bootstrappedPlugins,W)},handleStartupPlugin=(X,W)=>{if(X&&X.length>0&&W?.pluginId){const te=X.find(re=>re?.apiInstance.pluginInfo.pluginId===W.pluginId);te?.importedPlugin?.startup&&te?.importedPlugin?.startup?.(te.apiInstance,W.params)}},disposePlugins=async()=>Promise.all(bootstrappedPlugins.map(X=>X?.dispose()));var __getOwnPropDesc$i=Object.getOwnPropertyDescriptor,__decorateClass$x=(X,W,te,re)=>{for(var oe=re>1?void 0:re?__getOwnPropDesc$i(W,te):W,ne=X.length-1,de;ne>=0;ne--)(de=X[ne])&&(oe=de(oe)||oe);return oe},__decorateParam$2=(X,W)=>(te,re)=>W(te,re,X);let ExitShellHandler=class{constructor(X){this.api=X}async handle(X){const W=X&&X.ecapEvent!==void 0?X:void 0;try{if(!await this.api.exitGuardManager.canExit())return;const re=this.api.pluginBusyManager.getTasks();if(re.length>0){const{confirmed:oe}=await this.askForClose(re);if(!oe)return}await Promise.race([this.unmountViewsAndDisposePlugins(),this.timeout(1e4)]),await disposeShell(),this.emitClose(W)}catch{this.api.notificationService.error(translate$1("errors.exit")),this.emitClose(W)}}async unmountViewsAndDisposePlugins(){await this.api.regionManager._removeAllViews(),await disposePlugins()}timeout(X){return new Promise(W=>setTimeout(W,X))}askForClose(X){return this.api.interactionService.confirm({busyTasks:X},{component:PluginBusyList},{title:translate$1("actions.askExit"),state:"error",confirmButtonText:"Sí",cancelButtonText:"No"})}emitClose(X){X?raiseCustomCloseEvent(X):raiseCloseEvent()}};ExitShellHandler=__decorateClass$x([__decorateParam$2(0,inject(TYPES$1.primaryApi))],ExitShellHandler);class ExitShell{constructor(W,te){this.ecapEvent=W,this.payload=te}}let request$f;const useExitShell=X=>{disposeExitShell(),request$f=registerRequest(X,container$1)(ExitShell,ExitShellHandler)},disposeExitShell=()=>{request$f?.dispose()};var __getOwnPropDesc$h=Object.getOwnPropertyDescriptor,__decorateClass$w=(X,W,te,re)=>{for(var oe=re>1?void 0:re?__getOwnPropDesc$h(W,te):W,ne=X.length-1,de;ne>=0;ne--)(de=X[ne])&&(oe=de(oe)||oe);return oe},__decorateParam$1=(X,W)=>(te,re)=>W(te,re,X);const USER_ID_TYPES=["DNI","NIE","PASS"];let GetUserInfoBackendAdapter=class{constructor(X){this.api=X}getUserInfo(){const W=jwtDecode(this.api.tokenManager.getToken()).access_info,te={userId:this.getUserId(W)??"",firstName:W?.trace_user_given_name??"",familyName:W?.trace_user_family_name??"",lastName:W?.trace_user_last_name??"",registrationNumber:this.findIdentifier(W,"NUMCOL")??"",workCenter:W?.center_code??"",role:W?.role_type??"",speciality:W?.professional_category??""};return Promise.resolve(te)}findIdentifier(X,W){return X?.identifier?.find(te=>te.type===W)?.value}getUserId(X){for(const W of USER_ID_TYPES){const te=this.findIdentifier(X,W);if(te)return te}}};GetUserInfoBackendAdapter=__decorateClass$w([injectable(),__decorateParam$1(0,inject(TYPES$1.primaryApi))],GetUserInfoBackendAdapter);var __getOwnPropDesc$g=Object.getOwnPropertyDescriptor,__decorateClass$v=(X,W,te,re)=>{for(var oe=re>1?void 0:re?__getOwnPropDesc$g(W,te):W,ne=X.length-1,de;ne>=0;ne--)(de=X[ne])&&(oe=de(oe)||oe);return oe},__decorateParam=(X,W)=>(te,re)=>W(te,re,X);let GetUserInfoHandler=class{constructor(X,W){this.api=X,this.backendAdapter=W}async handle(X){try{const W=await this.backendAdapter.getUserInfo();return this.api.globalStateManager.setData("userInfo",W),W}catch(W){this.api.notificationService.error(W.message)}}};GetUserInfoHandler=__decorateClass$v([__decorateParam(0,inject(TYPES$1.primaryApi)),__decorateParam(1,inject(GetUserInfoBackendAdapter))],GetUserInfoHandler);class GetUserInfo{}let request$e;const useGetUserInfo=X=>{disposeGetUserInfo(),request$e=registerRequest(X,container$1)(GetUserInfo,GetUserInfoHandler),registerDep(GetUserInfoBackendAdapter)},disposeGetUserInfo=()=>{request$e?.dispose(),unregisterDep(GetUserInfoBackendAdapter)},useFeatures=X=>{container$1.bind(TYPES$1.primaryApi).toConstantValue(X),useGetUserInfo(X),useExitShell(X),X.broker.send(new GetUserInfo)},disposeFeatures=async X=>{disposeGetUserInfo(),disposeExitShell(),container$1.unbindAll(),await X.regionManager._destroy(),X.broker._clear()},disposeShell=async()=>{await disposeFeatures(shellApi),shellApi.interactionService.dispose(),sessionRefreshTimer.stop(),activityMonitor.stop()},raiseCloseEvent=()=>{shellApi.ecapEventManager.publish("CLOSE_FORM","",{})},raiseCustomCloseEvent=X=>{shellApi.ecapEventManager.publish(X.ecapEvent,"",X.payload)};var shellViews=(X=>(X.shell="primaria-shell",X.error="primaria-error-view",X))(shellViews||{});const styles$n=":host{width:100%;overflow:hidden}#main-switcher{display:inherit}.container{width:100%;height:100%;display:flex;flex-direction:column;background:#fff}.main-container{min-height:1px;height:100%;display:flex}.main-container .sidebar{padding-inline:16px;display:flex;flex-direction:column;justify-content:space-between;align-items:center;background:var(--color-primary-700);width:40px;height:100%;color:#fff}.main-container .sidebar .quick-actions-content{padding-top:24px;padding-bottom:22px;border-radius:8px}.main-container .sidebar .quick-actions-content .create-button-icon-badge{position:relative}.main-container .sidebar .quick-actions-content .create-button-icon-badge dss-notification-badge{position:absolute;top:-7px;right:-6px;z-index:1}.main-container .sidebar .quick-actions-content .create-button-icon-badge dss-icon{position:relative}.main-container .sidebar .icon{margin-left:8px}.main-container .sidebar #menu-region{width:100%;height:100%;min-height:1px}.main-container .sidebar #menu-region-container{padding-top:15px;min-height:1px;height:100%;width:100%;display:flex;flex-direction:column;gap:4px;overflow-y:auto;margin-right:-14px;padding-right:14px;scrollbar-color:var(--color-primary-200) var(--color-primary-700);scrollbar-width:thin}.main-container .sidebar #menu-region-container::-webkit-scrollbar{width:6px}.main-container .sidebar #menu-region-container::-webkit-scrollbar-track{background:var(--color-primary-700)}.main-container .sidebar #menu-region-container::-webkit-scrollbar-thumb{background-color:var(--color-primary-400);border-radius:4px}.main-container .sidebar .bottom-content{display:flex;flex-direction:column;gap:24px;width:100%}.main-container .sidebar .bottom-content .bottom-content-first{display:flex;flex-direction:column;gap:22px}.main-container .sidebar[expanded]{width:252px;align-items:flex-start}.main-container .sidebar .create-button-closed{cursor:pointer;background-color:#f0f0f0;color:var(--color-primary-700);border-radius:8px;width:40px;height:40px;display:flex;flex-direction:row;align-items:center;justify-content:center;transition:background-color .3s ease}.main-container .sidebar .create-button-closed:hover{background-color:var(--color-primary-900);color:#fff}.main-container .sidebar .create-button-opened{cursor:pointer;background-color:#f0f0f0;color:var(--color-primary-700);border-radius:8px;gap:8px;font-weight:600;width:220px;height:40px;display:flex;flex-direction:row;align-items:center;transition:background-color .3s ease}.main-container .sidebar .create-button-opened:hover{background-color:var(--color-primary-900);color:#fff}.main-container .content{display:flex;height:100%;width:100%;min-width:0}.main-container #main-region-container{min-height:1px;min-width:0;height:100%;flex:1}.main-container #navigation-menu-lower-region-container{display:flex;flex-direction:column;gap:4px}.footer{display:flex;height:48px;padding:12px 24px}.footer .footer-logo{align-self:center;display:flex;gap:16px}.divider-opened{width:220px}.divider-closed{width:40px}.toggle-button{margin-bottom:24px}@media (max-width: 1439px){.bottom-content-first{margin-bottom:24px}.toggle-button{display:none}.content{overflow-y:auto}}";let t$v="";function f$n(){return t$v}function s$E(X,W){const te=f$n(),re=`${X}${te}`;customElements.define(re,W)}const e$P="*,*:before,*:after{box-sizing:border-box}*{margin:0;padding:0;font-family:var(--font-family)}ul,ol{list-style:none}",n$y={type:Boolean,converter:{fromAttribute:X=>X!==null&&X!=="false",toAttribute:X=>X?"true":null}},o$U={fromAttribute:X=>!(X===null||X==="false"),toAttribute:X=>X?"":null},i$N={type:Array,converter:{fromAttribute:X=>{if(!X)return[];const W=JSON.parse(X);return Array.isArray(W)?W.map(te=>te.toString()):[W.toString()]},toAttribute:X=>JSON.stringify(X)}},i$M=':host{display:flex;align-items:center}.dss-icon,.material-symbols-rounded{font-family:var(--icon-font);font-size:var(--icon-size-md);font-weight:400;font-style:normal;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased;font-variation-settings:"FILL" 0,"wght" 400,"GRAD" 0,"opsz" 24}.dss-icon--fill,.material-symbols-rounded--fill{font-variation-settings:"FILL" 1}.dss-icon--sm{font-size:var(--icon-size-sm)}.dss-icon--md{font-size:var(--icon-size-md)}.dss-icon--lg{font-size:var(--icon-size-lg)}.dss-icon--xl{font-size:var(--icon-size-xl)}.dss-icon-ghost{display:inline-block;height:var(--icon-size-md);width:var(--icon-size-md);overflow:hidden;background-color:transparent}.dss-icon-ghost--sm{height:var(--icon-size-sm);width:var(--icon-size-sm);border-radius:var(--dss-radius-xs)}.dss-icon-ghost--lg{height:var(--icon-size-lg);width:var(--icon-size-lg)}.dss-icon-ghost--xl{height:var(--icon-size-xl);width:var(--icon-size-xl)}.dss-icon--spin{animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}';/**
275
280
  * @license
276
281
  * Copyright 2018 Google LLC
277
282
  * SPDX-License-Identifier: BSD-3-Clause
@@ -8778,7 +8783,11 @@ ${X.searchString?.length>1?ke$1`
8778
8783
  </div>
8779
8784
  `};var __defProp$2=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__decorateClass$2=(X,W,te,re)=>{for(var oe=re>1?void 0:re?__getOwnPropDesc$2(W,te):W,ne=X.length-1,de;ne>=0;ne--)(de=X[ne])&&(oe=(re?de(W,te,oe):de(oe))||oe);return re&&oe&&__defProp$2(W,te,oe),oe};let ActiveFiltersBadges=class extends h$n{render(){return ke$1`${template$2(this)}`}_onDeleteFilterValue(X,W,te,re){this.api.broker.send(new SetCustomFilterValue({filterGroupId:X,filterId:W,optionId:te,enabled:re}))}_onDeleteCommonFilterValue(X){this.api.broker.send(new SetCommonFilter({id:X,enabled:!1}))}_onDeleteDiagnosticFilterValue(X){this.api.broker.send(new DeleteDiagnosticFilterValueCommand({diagnosticCodi:X}))}_onDeleteGlobalFilterGroup(X,W){const te=this.activeGlobalFilters.find(oe=>oe.id===X)?.groups.find(oe=>oe.id===W);if(!te)return;const re=new Set(te.values.map(oe=>oe.value));this._setGlobalFilterValues(X,oe=>oe.enabledValues.filter(ne=>!re.has(ne)))}_onDeleteGlobalFilterValue(X,W){this._setGlobalFilterValues(X,te=>te.enabledValues.filter(re=>re!==W))}_setGlobalFilterValues(X,W){const te=this.activeGlobalFilters.find(re=>re.id===X);te&&this.api.broker.send(new SetGlobalFilterValuesCommand({id:X,values:W(te)}))}resetFilters(){this.api.broker.send(new ResetFiltersCommand)}};ActiveFiltersBadges.styles=i$R`
8780
8785
  ${r$L(styles$2)}
8781
- `,__decorateClass$2([lazyInject(TYPES.primaryApi)],ActiveFiltersBadges.prototype,"api",2),__decorateClass$2([connectedProperty(activityHistoryEnabledCommonFiltersSelector)],ActiveFiltersBadges.prototype,"enabledCommonFilters",2),__decorateClass$2([connectedProperty(customFilterGroupsWithOptionsSelector)],ActiveFiltersBadges.prototype,"customFilterGroups",2),__decorateClass$2([connectedProperty(diagnosticFilterSelector)],ActiveFiltersBadges.prototype,"diagnosticFilterEnabled",2),__decorateClass$2([connectedProperty(activeGlobalFiltersSelector)],ActiveFiltersBadges.prototype,"activeGlobalFilters",2),ActiveFiltersBadges=__decorateClass$2([t$z("active-filters-badges")],ActiveFiltersBadges);let request$1;const bootstrapSearchItems=X=>{request$1=X.registerRequest(SearchActivityHistoryItems,SearchItemsHandler)},teardownSearchItems=()=>{request$1?.dispose()},{updateActivityHistoryItem}=activityHistoryCollectionsSlice.actions;class UpdateHistoryItemHandler extends StoreBaseHandler{async handle(W){try{ensureAreValidBasicActivityHistoryItems([W.item]),this.store.dispatch(updateActivityHistoryItem({id:W.entityId,item:W.item}))}catch(te){console.error(te.message)}}}let request;const bootstrapUpdateHistoryItem=X=>{request=X.registerRequest("update_history_item_request",UpdateHistoryItemHandler)},teardownUpdateHistoryItem=()=>{request?.dispose()};let broker;const bootstrapActivityHistoryItem=X=>{broker=brokerExtensions(X,container),bootstrapInjectAsyncHistoryItems(broker,X),bootstrapAddHistoryItem(broker,X),bootstrapAddHistoryItems(broker,X),bootstrapHandleHistoryItemsAddError(broker),bootstrapHandleRefreshHistoryItems(broker),bootstrapUpdateHistoryItem(broker),bootstrapExportPdf(broker),bootstrapFilters(broker,X),bootstrapSearchItems(broker),bootstrapRemoveHistoryItem(broker)},teardownActivityHistoryItem=()=>{teardownInjectAsyncHistoryItems(),teardownAddHistoryItem(),teardownAddHistoryItems(),teardownHandleHistoryItemsAddError(),teardownUpdateHistoryItem(),teardownExportPdf(),teardownFilters(),teardownSearchItems(),teardownRemoveHistoryItem()},pluginName="activity-history",prepareGroupComponents=async X=>{const W=te=>Promise.all(te.map(async re=>({...re,component:re.componentFactory?await re.componentFactory({item:re}):void 0})));return Promise.all(X.map(async te=>({...te,items:await W(te.items||[]),subGroups:await Promise.all((te.subGroups||[]).map(async re=>({...re,items:await W(re.items)})))})))},INITIAL_SCROLLER_STATE={virtualItems:[],totalHeight:0};class ScrollerController{sync({viewport:W,items:te,onStateChange:re,estimateItemHeight:oe}){return W?(this._scroller&&W!==this._lastViewport&&this.teardown(),this._scroller?this._scroller.updateItems(te,re):(this._scroller=new VirtualScroller({items:te,estimateItemHeight:oe}),this._cleanup=this._scroller.setup(W,re)),this._lastViewport=W,this._scroller.getState()):this._scroller?.getState()??INITIAL_SCROLLER_STATE}teardown(){this._cleanup?.(),this._cleanup=void 0,this._scroller=void 0,this._lastViewport=void 0}scrollToIndex(W,te){this._scroller?.scrollToIndex(W,te)}measureElement(W){this._scroller?.measureElement(W)}}const isToday=X=>{const W=new Date(X),te=new Date;return W.toDateString()===te.toDateString()},itemMatchesToday=X=>!!(X&&isToday(X.date)),itemHasAnyDiagnostic=(X,W)=>!!X.diagnostics?.some(te=>W.includes(te.codi)),isAllowedItem=(X,W)=>{const te=X.type?W[X.type]:void 0;return!te?.allowedTagIds||te.allowedTagIds.length===0?!0:te.allowedTagIds.includes(X.tag?.id??"")},groupMatchesToday=X=>{const W=X.items?.[0]||X.subGroups?.[0]?.items?.[0];return itemMatchesToday(W)},filterGroupItemsByPredicate=(X,W)=>({...X,items:(X.items||[]).filter(W),subGroups:(X.subGroups||[]).map(te=>({...te,items:te.items.filter(W)})).filter(te=>te.items.length>0)}),filterGroupByDiagnostics=(X,W)=>filterGroupItemsByPredicate(X,te=>itemHasAnyDiagnostic(te,W)),isGroupNonEmpty=X=>X.items.length>0||X.subGroups.length>0,applyImporterFilters=(X,{todayOnly:W,diagnosticCodes:te},re={})=>{const oe=X.map(ce=>filterGroupItemsByPredicate(ce,ue=>isAllowedItem(ue,re))).filter(isGroupNonEmpty),ne=W,de=te.length>0;return!ne&&!de?oe:oe.map(ce=>ne&&groupMatchesToday(ce)?ce:de?filterGroupByDiagnostics(ce,te):null).filter(ce=>ce!==null&&isGroupNonEmpty(ce))},flattenGroupItems=X=>{const W=[];for(const te of X){for(const re of te.items||[])W.push(re);for(const re of te.subGroups||[])for(const oe of re.items)W.push(oe)}return W},styles$1=":host{display:block;width:100%}dss-accordion{width:100%}.importer{display:flex;flex-direction:column;gap:12px;min-height:0}.importer__search{display:block}.importer__filters{display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding-bottom:8px;border-bottom:1px solid var(--color-neutral-200)}.importer__filters-label{color:var(--color-neutral-700);font-size:13px}.importer__empty{color:var(--color-neutral-600);font-size:13px;padding:24px 0;text-align:center}.virtual-container{height:62vh;min-height:0;position:relative}.virtual-viewport{height:100%;overflow:auto}.virtual-content{position:relative;width:100%}.virtual-items{position:relative}.visit:first-child{margin-top:var(--dss-spacing-xs)}.visit{display:flex;flex-direction:column;gap:var(--dss-spacing-sm);background-color:#fff;padding:var(--dss-spacing-sm);border-bottom:1px solid var(--color-neutral-100)}.visit:last-child{border-bottom:none}.visit__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit__header .title{flex:1;font-size:14px;line-height:24px;display:flex;flex-direction:row;gap:12px;color:var(--color-neutral-800)}.visit__header .title-date{font-weight:700}.visit__header .title-description{font-weight:600;display:flex;flex-direction:row;gap:4px}.visit__items{display:flex;flex-direction:column;gap:var(--dss-spacing-sm)}.visit__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit__items .item[has-divider]:last-of-type{border:none}.diagnostics{display:flex;flex-direction:column;gap:var(--dss-spacing-sm);border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.diagnostics:last-of-type{border:none}.diagnostics__header{display:flex;flex-direction:row;align-items:center;gap:16px;flex-wrap:wrap}.diagnostics__items{display:flex;flex-direction:column}.diagnostics__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.diagnostics__items .item[has-divider]:last-of-type{border:none}.item{display:grid;grid-template-columns:auto 1fr;gap:8px;align-items:start}.item__check{margin-top:4px}",checkboxState=X=>({checked:X==="all",indeterminate:X==="some"}),template$1=X=>{const W=checkboxState(X.allState());return ke$1`
8786
+ `,__decorateClass$2([lazyInject(TYPES.primaryApi)],ActiveFiltersBadges.prototype,"api",2),__decorateClass$2([connectedProperty(activityHistoryEnabledCommonFiltersSelector)],ActiveFiltersBadges.prototype,"enabledCommonFilters",2),__decorateClass$2([connectedProperty(customFilterGroupsWithOptionsSelector)],ActiveFiltersBadges.prototype,"customFilterGroups",2),__decorateClass$2([connectedProperty(diagnosticFilterSelector)],ActiveFiltersBadges.prototype,"diagnosticFilterEnabled",2),__decorateClass$2([connectedProperty(activeGlobalFiltersSelector)],ActiveFiltersBadges.prototype,"activeGlobalFilters",2),ActiveFiltersBadges=__decorateClass$2([t$z("active-filters-badges")],ActiveFiltersBadges);let request$1;const bootstrapSearchItems=X=>{request$1=X.registerRequest(SearchActivityHistoryItems,SearchItemsHandler)},teardownSearchItems=()=>{request$1?.dispose()},{updateActivityHistoryItem}=activityHistoryCollectionsSlice.actions;class UpdateHistoryItemHandler extends StoreBaseHandler{async handle(W){try{ensureAreValidBasicActivityHistoryItems([W.item]),this.store.dispatch(updateActivityHistoryItem({id:W.entityId,item:W.item}))}catch(te){console.error(te.message)}}}let request;const bootstrapUpdateHistoryItem=X=>{request=X.registerRequest("update_history_item_request",UpdateHistoryItemHandler)},teardownUpdateHistoryItem=()=>{request?.dispose()};let broker;const bootstrapActivityHistoryItem=X=>{broker=brokerExtensions(X,container),bootstrapInjectAsyncHistoryItems(broker,X),bootstrapAddHistoryItem(broker,X),bootstrapAddHistoryItems(broker,X),bootstrapHandleHistoryItemsAddError(broker),bootstrapHandleRefreshHistoryItems(broker),bootstrapUpdateHistoryItem(broker),bootstrapExportPdf(broker),bootstrapFilters(broker,X),bootstrapSearchItems(broker),bootstrapRemoveHistoryItem(broker)},teardownActivityHistoryItem=()=>{teardownInjectAsyncHistoryItems(),teardownAddHistoryItem(),teardownAddHistoryItems(),teardownHandleHistoryItemsAddError(),teardownUpdateHistoryItem(),teardownExportPdf(),teardownFilters(),teardownSearchItems(),teardownRemoveHistoryItem()},pluginName="activity-history",prepareGroupComponents=async X=>{const W=te=>Promise.all(te.map(async re=>({...re,component:re.componentFactory?await re.componentFactory({item:re}):void 0})));return Promise.all(X.map(async te=>({...te,items:await W(te.items||[]),subGroups:await Promise.all((te.subGroups||[]).map(async re=>({...re,items:await W(re.items)})))})))},INITIAL_SCROLLER_STATE={virtualItems:[],totalHeight:0};class ScrollerController{sync({viewport:W,items:te,onStateChange:re,estimateItemHeight:oe}){return W?(this._scroller&&W!==this._lastViewport&&this.teardown(),this._scroller?this._scroller.updateItems(te,re):(this._scroller=new VirtualScroller({items:te,estimateItemHeight:oe}),this._cleanup=this._scroller.setup(W,re)),this._lastViewport=W,this._scroller.getState()):this._scroller?.getState()??INITIAL_SCROLLER_STATE}teardown(){this._cleanup?.(),this._cleanup=void 0,this._scroller=void 0,this._lastViewport=void 0}scrollToIndex(W,te){this._scroller?.scrollToIndex(W,te)}measureElement(W){this._scroller?.measureElement(W)}}const IMPORTER_ALLOWED_NOTE_TYPE_IDS=["CC","GRU","PA","ORD","VS","SOL",PETITIONS_NOTE_TYPE.id],isImportableItem=X=>IMPORTER_ALLOWED_NOTE_TYPE_IDS.includes(X.noteType?.id??""),isToday=X=>{const W=new Date(X),te=new Date;return W.toDateString()===te.toDateString()},itemMatchesToday=X=>!!(X&&isToday(X.date)),itemHasAnyDiagnostic=(X,W)=>!!X.diagnostics?.some(te=>W.includes(te.codi)),groupMatchesToday=X=>{const W=X.items?.[0]||X.subGroups?.[0]?.items?.[0];return itemMatchesToday(W)},filterGroupItemsByPredicate=(X,W)=>({...X,items:(X.items||[]).filter(W),subGroups:(X.subGroups||[]).map(te=>({...te,items:te.items.filter(W)})).filter(te=>te.items.length>0)}),filterGroupByDiagnostics=(X,W)=>filterGroupItemsByPredicate(X,te=>itemHasAnyDiagnostic(te,W)),isGroupNonEmpty=X=>X.items.length>0||X.subGroups.length>0,applyImporterFilters=(X,{todayOnly:W,diagnosticCodes:te})=>{const re=X.map(de=>filterGroupItemsByPredicate(de,isImportableItem)).filter(isGroupNonEmpty),oe=W,ne=te.length>0;return!oe&&!ne?re:re.map(de=>oe&&groupMatchesToday(de)?de:ne?filterGroupByDiagnostics(de,te):null).filter(de=>de!==null&&isGroupNonEmpty(de))},flattenGroupItems=X=>{const W=[];for(const te of X){for(const re of te.items||[])W.push(re);for(const re of te.subGroups||[])for(const oe of re.items)W.push(oe)}return W},escapeHtml=X=>{const W=document.createElement("div");return W.textContent=X,W.innerHTML},ALLOWED_HTML_TAGS=["p","br","span","div","strong","em","u","s","sub","sup","b","i","a","code","pre","blockquote","h1","h2","h3","h4","h5","h6","ul","ol","li"],strayLessThan=new RegExp(`<(?!/?(?:${ALLOWED_HTML_TAGS.join("|")})\\b)`,"gi"),escapeUnknownTags=X=>X.replace(strayLessThan,"&lt;"),HEADER_SEPARATOR=" | ",parseDate=X=>{if(!X)return;const W=new Date(X);return Number.isNaN(W.getTime())?void 0:W},buildVisitHeader=X=>{const W=[],te=parseDate(X.date);return te&&W.push(format(te,"dd/MM/yyyy")),X.professional?.name&&W.push(X.professional.name),shouldShowRole(X)&&X.professional?.role?.description&&W.push(X.professional.role.description),X.professional?.speciality?.description&&W.push(X.professional.speciality.description),X.up?.description&&W.push(X.up.description),X.service?.description&&W.push(X.service.description),W.join(HEADER_SEPARATOR)},buildItemTime=X=>{const W=parseDate(X.date);return W?format(W,"HH:mm"):""},firstBlockTag=/^(<(?:p|div|li|h[1-6])\b[^>]*>)/i,htmlBodyWithTime=(X,W)=>{if(!W)return X;const te=X.match(firstBlockTag)?.[1];return te?`${te}${W} ${X.slice(te.length)}`:`<p>${W}</p>${X}`},buildSelectionText=X=>{const W=[],te=[];for(const re of X){const oe=flattenGroupItems([re]).sort((ue,pe)=>(parseDate(pe.date)?.getTime()??0)-(parseDate(ue.date)?.getTime()??0)),ne=oe[0];if(!ne)continue;const de=buildVisitHeader(ne),ce=de?[de]:[];de&&te.push(`<p><strong>${escapeHtml(de)}</strong></p>`);for(const ue of oe){const pe=buildItemTime(ue),he=ue.content?.plainText?.trim(),fe=ue.content?.html?.trim();!he&&!fe||(ce.push([pe,he].filter(Boolean).join(" ")),fe?te.push(htmlBodyWithTime(escapeUnknownTags(fe),pe)):he&&te.push(`<p>${[pe,escapeHtml(he)].filter(Boolean).join(" ")}</p>`))}ce.length&&W.push(ce.join(`
8787
+
8788
+ `))}return{raw:W.join(`
8789
+
8790
+ `),html:te.join("")}},styles$1=":host{display:block;width:100%}dss-accordion{width:100%}.importer{display:flex;flex-direction:column;gap:12px;min-height:0}.importer__search{display:block}.importer__filters{display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding-bottom:8px;border-bottom:1px solid var(--color-neutral-200)}.importer__select-all{display:flex;flex-direction:row;align-items:center;gap:var(--dss-spacing-xs)}.importer__label{color:var(--color-neutral-900);font-size:14px;font-weight:700;line-height:24px}.importer__select-all .importer__label{cursor:pointer}.importer__divider{width:1px;align-self:stretch;min-height:20px;background-color:var(--color-neutral-300)}.importer__empty{color:var(--color-neutral-600);font-size:13px;padding:24px 0;text-align:center}.virtual-container{height:62vh;min-height:0;position:relative}.virtual-viewport{height:100%;overflow:auto}.virtual-content{position:relative;width:100%}.virtual-items{position:relative}.visit:first-child{margin-top:var(--dss-spacing-xs)}.visit{display:flex;flex-direction:column;gap:var(--dss-spacing-sm);background-color:#fff;padding:var(--dss-spacing-sm);border-bottom:1px solid var(--color-neutral-100)}.visit:last-child{border-bottom:none}.visit__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit__header .title{flex:1;font-size:14px;line-height:24px;display:flex;flex-direction:row;gap:12px;color:var(--color-neutral-800)}.visit__header .title-date{font-weight:700}.visit__header .title-description{font-weight:600;display:flex;flex-direction:row;gap:4px}.visit__items{display:flex;flex-direction:column;gap:var(--dss-spacing-sm)}.visit__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit__items .item[has-divider]:last-of-type{border:none}.diagnostics{display:flex;flex-direction:column;gap:var(--dss-spacing-sm);border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.diagnostics:last-of-type{border:none}.diagnostics__header{display:flex;flex-direction:row;align-items:center;gap:16px;flex-wrap:wrap}.diagnostics__items{display:flex;flex-direction:column}.diagnostics__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.diagnostics__items .item[has-divider]:last-of-type{border:none}.item{display:grid;grid-template-columns:auto 1fr;gap:8px;align-items:start}.item__check{margin-top:4px}",checkboxState=X=>({checked:X==="all",indeterminate:X==="some"}),template$1=X=>{const W=checkboxState(X.allState());return ke$1`
8782
8791
  <dss-accordion
8783
8792
  accordionstyle="box"
8784
8793
  titletext="${translate("importer.title")}"
@@ -8798,14 +8807,25 @@ ${X.searchString?.length>1?ke$1`
8798
8807
  </div>
8799
8808
  `,filtersTemplate=(X,W)=>ke$1`
8800
8809
  <div class="importer__filters">
8801
- <dss-form-checkbox
8802
- label=${translate("importer.selectAll")}
8803
- .checked=${W.checked}
8804
- .indeterminate=${W.indeterminate}
8805
- @change=${te=>X._toggleAll(te)}
8806
- ></dss-form-checkbox>
8810
+ <div class="importer__select-all">
8811
+ <dss-form-checkbox
8812
+ label=${translate("importer.selectAll")}
8813
+ hideLabel
8814
+ .checked=${W.checked}
8815
+ .indeterminate=${W.indeterminate}
8816
+ @change=${te=>X._toggleAll(te)}
8817
+ ></dss-form-checkbox>
8818
+ <span
8819
+ class="importer__label"
8820
+ aria-hidden="true"
8821
+ @click=${()=>X._toggleAllTo(X.allState()!=="all")}
8822
+ >${translate("importer.selectAll")}</span
8823
+ >
8824
+ </div>
8825
+
8826
+ <span class="importer__divider" aria-hidden="true"></span>
8807
8827
 
8808
- <span class="importer__filters-label">${translate("importer.filters")}</span>
8828
+ <span class="importer__label">${translate("importer.filters")}</span>
8809
8829
 
8810
8830
  <dss-form-checkbox
8811
8831
  label=${translate("importer.today")}
@@ -8875,9 +8895,7 @@ ${X.searchString?.length>1?ke$1`
8875
8895
  </div>
8876
8896
  `,diagnosticHeaderTemplate=X=>X&&ke$1`
8877
8897
  ${X.diagnostics.filter(W=>W.descripcio!=null&&W.descripcio.trim()!=="").map(W=>ke$1`<dss-badge text=${W.descripcio?.toUpperCase()} state="info" size="sm" outlined hideIcon></dss-badge>`)}
8878
- `;var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=(X,W,te,re)=>{for(var oe=re>1?void 0:re?__getOwnPropDesc$1(W,te):W,ne=X.length-1,de;ne>=0;ne--)(de=X[ne])&&(oe=(re?de(W,te,oe):de(oe))||oe);return re&&oe&&__defProp$1(W,te,oe),oe};const escapeHtml=X=>{const W=document.createElement("div");return W.textContent=X,W.innerHTML},ALLOWED_HTML_TAGS=["p","br","span","div","strong","em","u","s","sub","sup","b","i","a","code","pre","blockquote","h1","h2","h3","h4","h5","h6","ul","ol","li"],strayLessThan=new RegExp(`<(?!/?(?:${ALLOWED_HTML_TAGS.join("|")})\\b)`,"gi"),escapeUnknownTags=X=>X.replace(strayLessThan,"&lt;"),buildSelectionText=X=>{const W=[],te=[];for(const re of X){const oe=re.content?.plainText?.trim(),ne=re.content?.html?.trim();oe&&W.push(oe),ne?te.push(escapeUnknownTags(ne)):oe&&te.push(`<p>${escapeHtml(oe)}</p>`)}return{raw:W.join(`
8879
-
8880
- `),html:te.join("")}};let ActivityHistoryImporter=class extends h$n{constructor(){super(...arguments),this.historyGroups=[],this.searchString="",this.rulesByCollectionId={},this.todayOnly=!1,this.diagnosticsOnly=!1,this.availableDiagnostics=[],this.filteredGroups=[],this.totalCount=0,this.selectedIds=[],this._virtualScrollerState=INITIAL_SCROLLER_STATE,this._scrollerController=new ScrollerController,this._searchTimeout=null,this._didInitialPreselect=!1,this._measureElement=X=>{X&&this._scrollerController.measureElement(X)}}render(){return ke$1`${template$1(this)}`}connectedCallback(){super.connectedCallback(),this.selectedIds=[],this._didInitialPreselect=!1;const X=this.api?.importDataManager?.getCurrentImportParams?.();this.availableDiagnostics=X?.diagnostics??[]}disconnectedCallback(){super.disconnectedCallback(),this._scrollerController.teardown(),this._clearSearchTimeout(),this.api.broker.send(new SearchActivityHistoryItems(""))}updated(X){super.updated(X),(X.has("historyGroups")||X.has("todayOnly")||X.has("diagnosticsOnly"))&&this._recomputeFiltered(),!this._didInitialPreselect&&this.historyGroups?.length&&(this._didInitialPreselect=!0,this._preselectMatchingItems()),X.has("filteredGroups")&&this._syncVirtualScroller(),X.has("selectedIds")&&this._publishSelection()}_onSearchChange(X){typeof X.detail=="string"&&(this._clearSearchTimeout(),this._searchTimeout=window.setTimeout(()=>{this.api.broker.send(new SearchActivityHistoryItems(X.detail))},300))}_onToggleToday(X){this.todayOnly=X.target.checked}_onToggleDiagnostics(X){this.diagnosticsOnly=X.target.checked}_toggleItem(X){this.selectedIds=this.selectedIds.includes(X)?this.selectedIds.filter(W=>W!==X):[...this.selectedIds,X]}_toggleSubGroup(X,W){this._setSelection(X.map(te=>te.id),W)}_toggleAll(X){this._setSelection(flattenGroupItems(this.filteredGroups).map(W=>W.id),X.target.checked)}isItemSelected(X){return this.selectedIds.includes(X)}subGroupState(X){return this._tristate(X.map(W=>W.id))}allState(){return this._tristate(flattenGroupItems(this.filteredGroups).map(X=>X.id))}hasDiagnosticsFilter(){return this.availableDiagnostics.length>0}get _visibleRows(){return this._virtualScrollerState.virtualItems.map(X=>({index:X.index,group:this.filteredGroups?.[X.index]})).filter(X=>!!X.group)}get _containerOffset(){return this._virtualScrollerState.virtualItems[0]?.start??0}get _totalHeight(){return this._virtualScrollerState.totalHeight}_clearSearchTimeout(){this._searchTimeout!==null&&(clearTimeout(this._searchTimeout),this._searchTimeout=null)}_setSelection(X,W){if(W){const te=X.filter(re=>!this.selectedIds.includes(re));te.length&&(this.selectedIds=[...this.selectedIds,...te])}else{const te=new Set(X);this.selectedIds=this.selectedIds.filter(re=>!te.has(re))}}_tristate(X){if(!X.length)return"none";const W=X.filter(te=>this.selectedIds.includes(te)).length;return W===0?"none":W===X.length?"all":"some"}async _recomputeFiltered(){const X={todayOnly:this.todayOnly,diagnosticCodes:this.diagnosticsOnly?this.availableDiagnostics.map(te=>te.code):[]},W=applyImporterFilters(this.historyGroups||[],X,this.rulesByCollectionId);this.filteredGroups=await prepareGroupComponents(W),this.totalCount=flattenGroupItems(this.filteredGroups).length}_syncVirtualScroller(){this._virtualScrollerState=this._scrollerController.sync({viewport:this._viewport,items:this.filteredGroups,estimateItemHeight:()=>200,onStateChange:X=>{this._virtualScrollerState=X,this.requestUpdate()}})}_preselectMatchingItems(){const X={diagnostics:this.availableDiagnostics},W=[],te=re=>{for(const oe of re){const ne=oe.type?this.rulesByCollectionId[oe.type]:void 0;ne?.shouldPreselect&&ne.shouldPreselect(oe,X)&&W.push(oe.id)}};for(const re of this.historyGroups||[]){te(re.items||[]);for(const oe of re.subGroups||[])te(oe.items)}W.length&&(this.selectedIds=[...new Set([...this.selectedIds,...W])])}_publishSelection(){const X=new Set(this.selectedIds),W=(this.historyGroups||[]).map(te=>({...te,items:(te.items||[]).filter(re=>X.has(re.id)),subGroups:(te.subGroups||[]).map(re=>({...re,items:re.items.filter(oe=>X.has(oe.id))})).filter(re=>re.items.length>0)})).filter(te=>te.items.length>0||te.subGroups.length>0);this.api.importDataManager.selectItems({pluginId:pluginName,data:W,text:buildSelectionText(flattenGroupItems(W))})}};ActivityHistoryImporter.styles=i$R`
8898
+ `;var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=(X,W,te,re)=>{for(var oe=re>1?void 0:re?__getOwnPropDesc$1(W,te):W,ne=X.length-1,de;ne>=0;ne--)(de=X[ne])&&(oe=(re?de(W,te,oe):de(oe))||oe);return re&&oe&&__defProp$1(W,te,oe),oe};let ActivityHistoryImporter=class extends h$n{constructor(){super(...arguments),this.historyGroups=[],this.searchString="",this.rulesByCollectionId={},this.todayOnly=!1,this.diagnosticsOnly=!1,this.availableDiagnostics=[],this.filteredGroups=[],this.totalCount=0,this.selectedIds=[],this._virtualScrollerState=INITIAL_SCROLLER_STATE,this._scrollerController=new ScrollerController,this._searchTimeout=null,this._didInitialPreselect=!1,this._measureElement=X=>{X&&this._scrollerController.measureElement(X)}}render(){return ke$1`${template$1(this)}`}connectedCallback(){super.connectedCallback(),this.selectedIds=[],this._didInitialPreselect=!1;const X=this.api?.importDataManager?.getCurrentImportParams?.();this.availableDiagnostics=X?.diagnostics??[]}disconnectedCallback(){super.disconnectedCallback(),this._scrollerController.teardown(),this._clearSearchTimeout(),this.api.broker.send(new SearchActivityHistoryItems(""))}updated(X){super.updated(X),(X.has("historyGroups")||X.has("todayOnly")||X.has("diagnosticsOnly"))&&this._recomputeFiltered(),!this._didInitialPreselect&&this.historyGroups?.length&&(this._didInitialPreselect=!0,this._preselectMatchingItems()),X.has("filteredGroups")&&this._syncVirtualScroller(),X.has("selectedIds")&&this._publishSelection()}_onSearchChange(X){typeof X.detail=="string"&&(this._clearSearchTimeout(),this._searchTimeout=window.setTimeout(()=>{this.api.broker.send(new SearchActivityHistoryItems(X.detail))},300))}_onToggleToday(X){this.todayOnly=X.target.checked}_onToggleDiagnostics(X){this.diagnosticsOnly=X.target.checked}_toggleItem(X){this.selectedIds=this.selectedIds.includes(X)?this.selectedIds.filter(W=>W!==X):[...this.selectedIds,X]}_toggleSubGroup(X,W){this._setSelection(X.map(te=>te.id),W)}_toggleAll(X){this._toggleAllTo(X.target.checked)}_toggleAllTo(X){this._setSelection(flattenGroupItems(this.filteredGroups).map(W=>W.id),X)}isItemSelected(X){return this.selectedIds.includes(X)}subGroupState(X){return this._tristate(X.map(W=>W.id))}allState(){return this._tristate(flattenGroupItems(this.filteredGroups).map(X=>X.id))}hasDiagnosticsFilter(){return this.availableDiagnostics.length>0}get _visibleRows(){return this._virtualScrollerState.virtualItems.map(X=>({index:X.index,group:this.filteredGroups?.[X.index]})).filter(X=>!!X.group)}get _containerOffset(){return this._virtualScrollerState.virtualItems[0]?.start??0}get _totalHeight(){return this._virtualScrollerState.totalHeight}_clearSearchTimeout(){this._searchTimeout!==null&&(clearTimeout(this._searchTimeout),this._searchTimeout=null)}_setSelection(X,W){if(W){const te=X.filter(re=>!this.selectedIds.includes(re));te.length&&(this.selectedIds=[...this.selectedIds,...te])}else{const te=new Set(X);this.selectedIds=this.selectedIds.filter(re=>!te.has(re))}}_tristate(X){if(!X.length)return"none";const W=X.filter(te=>this.selectedIds.includes(te)).length;return W===0?"none":W===X.length?"all":"some"}async _recomputeFiltered(){const X={todayOnly:this.todayOnly,diagnosticCodes:this.diagnosticsOnly?this.availableDiagnostics.map(te=>te.code):[]},W=applyImporterFilters(this.historyGroups||[],X);this.filteredGroups=await prepareGroupComponents(W),this.totalCount=flattenGroupItems(this.filteredGroups).length}_syncVirtualScroller(){this._virtualScrollerState=this._scrollerController.sync({viewport:this._viewport,items:this.filteredGroups,estimateItemHeight:()=>200,onStateChange:X=>{this._virtualScrollerState=X,this.requestUpdate()}})}_preselectMatchingItems(){const X={diagnostics:this.availableDiagnostics},W=[],te=re=>{for(const oe of re){const ne=oe.type?this.rulesByCollectionId[oe.type]:void 0;ne?.shouldPreselect&&ne.shouldPreselect(oe,X)&&W.push(oe.id)}};for(const re of this.historyGroups||[]){te(re.items||[]);for(const oe of re.subGroups||[])te(oe.items)}W.length&&(this.selectedIds=[...new Set([...this.selectedIds,...W])])}_publishSelection(){const X=new Set(this.selectedIds),W=(this.historyGroups||[]).map(te=>({...te,items:(te.items||[]).filter(re=>X.has(re.id)),subGroups:(te.subGroups||[]).map(re=>({...re,items:re.items.filter(oe=>X.has(oe.id))})).filter(re=>re.items.length>0)})).filter(te=>te.items.length>0||te.subGroups.length>0);this.api.importDataManager.selectItems({pluginId:pluginName,data:W,text:buildSelectionText(W),title:CLINICAL_FOLLOW_UP_IMPORT_TITLE})}};ActivityHistoryImporter.styles=i$R`
8881
8899
  ${r$L(styles$1)}
8882
8900
  `,__decorateClass$1([lazyInject(TYPES.primaryApi)],ActivityHistoryImporter.prototype,"api",2),__decorateClass$1([connectedProperty(activityHistoryGroupedItems)],ActivityHistoryImporter.prototype,"historyGroups",2),__decorateClass$1([connectedProperty(activityHistorySearchStringSelector)],ActivityHistoryImporter.prototype,"searchString",2),__decorateClass$1([connectedProperty(historyDataImporterRulesByCollectionIdSelector)],ActivityHistoryImporter.prototype,"rulesByCollectionId",2),__decorateClass$1([r$H()],ActivityHistoryImporter.prototype,"todayOnly",2),__decorateClass$1([r$H()],ActivityHistoryImporter.prototype,"diagnosticsOnly",2),__decorateClass$1([r$H()],ActivityHistoryImporter.prototype,"availableDiagnostics",2),__decorateClass$1([r$H()],ActivityHistoryImporter.prototype,"filteredGroups",2),__decorateClass$1([r$H()],ActivityHistoryImporter.prototype,"totalCount",2),__decorateClass$1([r$H()],ActivityHistoryImporter.prototype,"selectedIds",2),__decorateClass$1([e$T(".virtual-viewport")],ActivityHistoryImporter.prototype,"_viewport",2),__decorateClass$1([r$H()],ActivityHistoryImporter.prototype,"_virtualScrollerState",2),ActivityHistoryImporter=__decorateClass$1([t$z("activity-history-importer")],ActivityHistoryImporter);const styles=":host{display:flex;min-height:1px;height:100%;width:100%}.container{display:flex;flex-direction:column;width:100%;border:1px solid rgb(189,189,189);border-radius:var(--dss-radius-sm)}.container[maximized]{position:absolute;background:#fff;top:0;left:0;bottom:0;border:none}.container[maximized] .header-maximized-container{display:flex;flex-direction:column}.container[maximized] .header-maximized-container .header__maximized{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:24px;padding-top:12px;padding-bottom:12px;padding-inline:40px}.container[maximized] .header-maximized-container .header__maximized .header__maximized__search{flex:1;border-radius:8px;border:1px solid rgb(189,189,189);padding:8px;width:300px}.container[maximized] .header-maximized-container .header__maximized .title{color:var(--color-neutral-900);font-weight:700;font-size:20px;line-height:30px;white-space:nowrap}.container[maximized] .header-maximized-container .header__maximized .options{display:flex;align-items:center;color:var(--color-primary-400);font-weight:600;font-size:14px;line-height:24px;cursor:pointer}.container[maximized] .header-maximized-container .header__maximized .header__maximized__left{display:flex;flex-direction:row;gap:24px;align-items:center;width:100%}.container[maximized] .header-maximized-container .header__maximized .header__maximized__right{display:flex;flex-direction:row;gap:16px;align-items:center}.container[maximized] .wrapper{height:calc(100vh - 175px);border:1px solid rgb(189,189,189);border-radius:var(--dss-radius-sm);margin-bottom:24px;margin-inline:40px;width:calc(100% - 80px)}.container .header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:8px 12px;border-bottom:1px solid rgb(189,189,189);gap:16px}.container .header .header__left{display:flex;flex-direction:row;align-items:center;flex:1;gap:16px}.container .header .header__left .title{color:var(--color-neutral-800);font-weight:700;font-size:16px;line-height:24px;white-space:nowrap}.container .header .header__right{display:flex;flex-direction:row;align-items:center;gap:8px}.container .header .header__right .action-icons{display:flex;align-items:center}.container .wrapper{display:flex;flex-direction:row;min-height:1px;width:100%;height:100%}.container .wrapper[maximized] .content{width:100%;background:var(--color-neutral-50);border-top-right-radius:var(--dss-radius-sm);display:flex;flex-direction:column}.container .wrapper .content{width:100%;background:var(--color-neutral-50);border-bottom-right-radius:var(--dss-radius-sm);overflow:hidden;display:flex;flex-direction:column}",template=X=>ke$1`<div class="container" ?maximized=${X.maximized}>
8883
8901
  ${X.maximized?ke$1`${headerMaximizedTemplate(X)}`:ke$1`<div class="header">