@uxland/primary-shell 7.2.0-rc.2 → 7.2.0
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.
- package/dist/index.js +3 -6
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +2 -2
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +14 -11
- package/src/styles.css +0 -5
- /package/dist/{index.css → styles.css} +0 -0
package/dist/index.umd.cjs
CHANGED
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
* @license
|
|
108
108
|
* Copyright 2017 Google LLC
|
|
109
109
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
110
|
-
*/function e$O(te,J){return(X,re,ne)=>{const oe=de=>de.renderRoot?.querySelector(te)??null;return e$P(X,re,{get(){return oe(this)}})}}const d$q=te=>j$2(te,p$g);let a$p=class{constructor(){this.viewsByRegion={},this.regions={}}registerRegion(J,X){this.regions[J]=[...this.regions[J]||[],X]}unregisterRegion(J,X){this.regions[J]=this.getRegionsByName(J).filter(re=>re!==X)}registerView(J,X,re){this.viewsByRegion[J]=[...this.viewsByRegion[J]||[],{key:X,view:re}]}getRegisteredViews(J){return this.viewsByRegion[J]||[]}getRegionsByName(J){return this.regions[J]||[]}destroy(){this.viewsByRegion={},this.regions={}}clear(){this.viewsByRegion={}}},n$y=class Ei{constructor(J){this._viewRegistry=J,this._regions={}}add(J,X){if(this.getRegion(J))throw new Error("A region with the same name already exists");return this._regions[J]=X,this._viewRegistry.registerRegion(J,X),this}getRegion(J){return this._regions[J]}remove(J){let X,re="";return typeof J=="string"?(X=this.getRegion(J),re=J,delete this._regions[J]):typeof J=="object"&&(re=Object.keys(this._regions).find(ne=>this._regions[ne]===J),re&&(X=J,delete this._regions[re])),re&&X&&this._viewRegistry.unregisterRegion(re,X),X}addViewToRegion(J,X,re){const ne=this.getRegion(J);if(!ne)throw new Error(`Couldn't find a region with name: ${J}`);return ne.addView(X,re),this}registerViewWithRegion(J,X,re){return this._viewRegistry.registerView(J,X,re),this._viewRegistry.getRegionsByName(J).forEach(ne=>ne.addView(X,re)),this}getRegisteredViews(J){return this._viewRegistry.getRegisteredViews(J)}clear(){return Object.values(this._viewRegistry.regions).forEach(J=>{J!=null&&J.length&&Object.keys(J[0].views).forEach(X=>{var re;return(re=J[0])==null?void 0:re.removeView(X)})}),this}destroy(){return this.clear(),Object.values(this._viewRegistry.regions).forEach(J=>this.remove(J[0])),this._regions={},this}createRegionManager(){return new Ei(this._viewRegistry)}},h$l=class extends n$y{constructor(J){const X=new a$p;super(X),this._name=J}clear(){return super.clear(),this._viewRegistry.clear(),this}destroy(){return super.destroy(),this._viewRegistry.destroy(),this}};const x$6=te=>new h$l(te),c$l=te=>te.importer(),l$s=async(te,J,X)=>{try{const re=await c$l(te);console.debug("imported plugin: ",te.pluginId);const ne=J(te);return await X(ne,re),console.debug("initialized plugin: ",te.pluginId),{dispose:()=>w$2(ne,re)}}catch(re){console.error(re)}},u$s=async(te,J)=>{await J.initialize(te)},w$2=(te,J)=>J.dispose(te),v$f=async(te,J)=>{if(!(te!=null&&te.length))throw new Error("No plugins to bootstrap");return(await Promise.allSettled(te.map(X=>l$s(X,J,u$s)))).map(X=>X.status==="fulfilled"?X.value:null)},primariaShellId="primaria-shell";var __extends$2=(function(){var te=function(J,X){return te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(re,ne){re.__proto__=ne}||function(re,ne){for(var oe in ne)Object.prototype.hasOwnProperty.call(ne,oe)&&(re[oe]=ne[oe])},te(J,X)};return function(J,X){if(typeof X!="function"&&X!==null)throw new TypeError("Class extends value "+String(X)+" is not a constructor or null");te(J,X);function re(){this.constructor=J}J.prototype=X===null?Object.create(X):(re.prototype=X.prototype,new re)}})(),__spreadArray$3=function(te,J,X){if(X||arguments.length===2)for(var re=0,ne=J.length,oe;re<ne;re++)(oe||!(re in J))&&(oe||(oe=Array.prototype.slice.call(J,0,re)),oe[re]=J[re]);return te.concat(oe||Array.prototype.slice.call(J))},OrderMappings=(function(){function te(){this._mappings=[]}return te.prototype.add=function(J){J.order!==0&&(J.order=this._mappings.length),this._mappings.push(J),this.onAdded(J)},te.prototype.clear=function(){this._mappings=[]},te})();function byOrder(te,J){return(J.order||0)-(te.order||0)}var NotificationMappings=(function(te){__extends$2(J,te);function J(){return te!==null&&te.apply(this,arguments)||this}return J.prototype.onAdded=function(X){var re=X.handler.prototype.constructor.name;mediatorSettings.resolver.add(re,X.handler)},J.prototype.setOrder=function(X,re){for(var ne=this.getAll(X),oe=0,de=ne;oe<de.length;oe++){var ce=de[oe];ce.order=re.indexOf(ce.handler)}},J.prototype.getAll=function(X){var re=this._mappings.filter(function(ne){return ne.notification===X});if(re.length===0)throw new Error("Cannot find notification handler with key: ".concat(X.prototype.name));return re.sort(byOrder)},J})(OrderMappings),BehaviorMappings=(function(te){__extends$2(J,te);function J(){return te!==null&&te.apply(this,arguments)||this}return J.prototype.onAdded=function(X){var re=X.behavior.prototype.constructor.name;mediatorSettings.resolver.add(re,X.behavior)},J.prototype.setOrder=function(X){for(var re=this.getAll(),ne=0,oe=re;ne<oe.length;ne++){var de=oe[ne];de.order=X.indexOf(de.behavior)}},J.prototype.getAll=function(){var X=__spreadArray$3([],this._mappings,!0);return X.sort(byOrder)},J})(OrderMappings),Dispatcher=(function(){function te(){this._notifications=new NotificationMappings,this._behaviors=new BehaviorMappings}return Object.defineProperty(te.prototype,"notifications",{get:function(){return this._notifications},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"behaviors",{get:function(){return this._behaviors},enumerable:!1,configurable:!0}),te})(),HandlerInstance=(function(){function te(J,X){this._name=J,this._value=X}return Object.defineProperty(te.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"value",{get:function(){return this._value},enumerable:!1,configurable:!0}),te})(),Resolver=(function(){function te(){this._instances=[]}return te.prototype.resolve=function(J){var X=this._instances.find(function(ne){return ne.name===J});if(!X)throw new Error("Cannot find element with key: ".concat(J));var re=X.value;return new re},te.prototype.add=function(J,X){var re=this._instances.find(function(ne){return ne.name===J});if(re===void 0)this._instances.push(new HandlerInstance(J,X));else throw new Error("The key ".concat(J," is already been added"))},te.prototype.remove=function(J){var X=this._instances.findIndex(function(re){return re.name===J});X>=0&&this._instances.splice(X,1)},te.prototype.clear=function(){this._instances=[]},te})(),MediatrSettings=(function(){function te(){this.resolver=new Resolver,this.dispatcher=new Dispatcher}return te})(),mediatorSettings=new MediatrSettings,requestHandler=function(te){return function(J){var X=te.prototype.constructor.name;mediatorSettings.resolver.add(X,J)}},notificationHandler=function(te){return function(J){mediatorSettings.dispatcher.notifications.add({notification:te,handler:J})}},__awaiter$4=function(te,J,X,re){function ne(oe){return oe instanceof X?oe:new X(function(de){de(oe)})}return new(X||(X=Promise))(function(oe,de){function ce(pe){try{ue(re.next(pe))}catch(fe){de(fe)}}function he(pe){try{ue(re.throw(pe))}catch(fe){de(fe)}}function ue(pe){pe.done?oe(pe.value):ne(pe.value).then(ce,he)}ue((re=re.apply(te,J||[])).next())})},__generator$4=function(te,J){var X={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},re,ne,oe,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(ue){return function(pe){return he([ue,pe])}}function he(ue){if(re)throw new TypeError("Generator is already executing.");for(;de&&(de=0,ue[0]&&(X=0)),X;)try{if(re=1,ne&&(oe=ue[0]&2?ne.return:ue[0]?ne.throw||((oe=ne.return)&&oe.call(ne),0):ne.next)&&!(oe=oe.call(ne,ue[1])).done)return oe;switch(ne=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return X.label++,{value:ue[1],done:!1};case 5:X.label++,ne=ue[1],ue=[0];continue;case 7:ue=X.ops.pop(),X.trys.pop();continue;default:if(oe=X.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){X=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){X.label=ue[1];break}if(ue[0]===6&&X.label<oe[1]){X.label=oe[1],oe=ue;break}if(oe&&X.label<oe[2]){X.label=oe[2],X.ops.push(ue);break}oe[2]&&X.ops.pop(),X.trys.pop();continue}ue=J.call(te,X)}catch(pe){ue=[6,pe],ne=0}finally{re=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},Mediator=(function(){function te(){}return te.prototype.send=function(J){return __awaiter$4(this,void 0,void 0,function(){var X,re,ne,oe,de,ce=this;return __generator$4(this,function(he){switch(he.label){case 0:return X=J.constructor.name,re=mediatorSettings.resolver.resolve(X),ne=mediatorSettings.dispatcher.behaviors.getAll().map(function(ue){return ue.behavior}),oe=0,de=function(){return __awaiter$4(ce,void 0,void 0,function(){var ue,pe;return __generator$4(this,function(fe){switch(fe.label){case 0:return oe<ne.length?(ue=ne[oe],pe=mediatorSettings.resolver.resolve(ue.name),oe++,[4,pe.handle(J,de)]):[3,2];case 1:return[2,fe.sent()];case 2:return[4,re.handle(J)];case 3:return[2,fe.sent()]}})})},[4,de()];case 1:return[2,he.sent()]}})})},te.prototype.publish=function(J){return __awaiter$4(this,void 0,void 0,function(){var X,re=this;return __generator$4(this,function(ne){switch(ne.label){case 0:return X=mediatorSettings.dispatcher.notifications.getAll(J.constructor),[4,Promise.all(X.map(function(oe){return __awaiter$4(re,void 0,void 0,function(){var de;return __generator$4(this,function(ce){return de=mediatorSettings.resolver.resolve(oe.handler.name),[2,de.handle(J)]})})}))];case 1:return ne.sent(),[2]}})})},te})();const disposableFactory=te=>({dispose:()=>{mediatorSettings.resolver.remove(te.name);const J=mediatorSettings.dispatcher.notifications._mappings.findIndex(X=>X.handler.name===te.name);J>-1&&mediatorSettings.dispatcher.notifications._mappings.splice(J,1)}});class Broker{constructor(){this.eventConstructorMap=new Map,this.requestConstructorMap=new Map,this.mediator=new Mediator,mediatorSettings.resolver.clear()}send(J,X){const re=typeof J=="string"?this.getRequest(J,X):J;return this.mediator.send(re)}publish(J,X){const re=typeof J=="string"?this.getEvent(J,X):J,ne=re.constructor||Object.getPrototypeOf(re).constructor;return mediatorSettings.dispatcher.notifications._mappings.filter(de=>de.notification===ne).length?this.mediator.publish(re):Promise.resolve()}subscribe(J,X){const re=typeof J=="function"?J:this.getEventType(J),ne=createDynamicEventHandler(X);return notificationHandler(re)(ne),disposableFactory(ne)}registerRequest(J,X){const re=typeof J=="function"?J:this.getRequestType(J),ne=createDynamicRequestHandler(X);return requestHandler(re)(ne),disposableFactory(ne)}getEvent(J,X){const re=this.getEventType(J);return new re(X)}getRequest(J,X){const re=this.getRequestType(J);return new re(X)}getEventType(J){if(!this.eventConstructorMap.has(J)){const X=createDynamicEventClass(J);this.eventConstructorMap.set(J,X)}return this.eventConstructorMap.get(J)}getRequestType(J){if(!this.requestConstructorMap.has(J)){const X=createDynamicRequestClass(J);this.requestConstructorMap.set(J,X)}return this.requestConstructorMap.get(J)}}const createDynamicEventClass=te=>createDynamicMessageClass(te,"Event"),createDynamicRequestClass=te=>createDynamicMessageClass(te,"Request"),createDynamicMessageClass=(te,J)=>new Function(`return class ${J}_${te} {
|
|
110
|
+
*/function e$O(te,J){return(X,re,ne)=>{const oe=de=>de.renderRoot?.querySelector(te)??null;return e$P(X,re,{get(){return oe(this)}})}}const d$q=te=>j$2(te,p$g);let a$p=class{constructor(){this.viewsByRegion={},this.regions={}}registerRegion(J,X){this.regions[J]=[...this.regions[J]||[],X]}unregisterRegion(J,X){this.regions[J]=this.getRegionsByName(J).filter(re=>re!==X)}registerView(J,X,re){this.viewsByRegion[J]=[...this.viewsByRegion[J]||[],{key:X,view:re}]}getRegisteredViews(J){return this.viewsByRegion[J]||[]}getRegionsByName(J){return this.regions[J]||[]}destroy(){this.viewsByRegion={},this.regions={}}clear(){this.viewsByRegion={}}},n$y=class Ei{constructor(J){this._viewRegistry=J,this._regions={}}add(J,X){if(this.getRegion(J))throw new Error("A region with the same name already exists");return this._regions[J]=X,this._viewRegistry.registerRegion(J,X),this}getRegion(J){return this._regions[J]}remove(J){let X,re="";return typeof J=="string"?(X=this.getRegion(J),re=J,delete this._regions[J]):typeof J=="object"&&(re=Object.keys(this._regions).find(ne=>this._regions[ne]===J),re&&(X=J,delete this._regions[re])),re&&X&&this._viewRegistry.unregisterRegion(re,X),X}addViewToRegion(J,X,re){const ne=this.getRegion(J);if(!ne)throw new Error(`Couldn't find a region with name: ${J}`);return ne.addView(X,re),this}registerViewWithRegion(J,X,re){return this._viewRegistry.registerView(J,X,re),this._viewRegistry.getRegionsByName(J).forEach(ne=>ne.addView(X,re)),this}getRegisteredViews(J){return this._viewRegistry.getRegisteredViews(J)}clear(){return Object.values(this._viewRegistry.regions).forEach(J=>{J?.length&&Object.keys(J[0].views).forEach(X=>J[0]?.removeView(X))}),this}destroy(){return this.clear(),Object.values(this._viewRegistry.regions).forEach(J=>this.remove(J[0])),this._regions={},this}createRegionManager(){return new Ei(this._viewRegistry)}},h$l=class extends n$y{constructor(J){const X=new a$p;super(X),this._name=J}clear(){return super.clear(),this._viewRegistry.clear(),this}destroy(){return super.destroy(),this._viewRegistry.destroy(),this}};const x$6=te=>new h$l(te),c$l=te=>te.importer(),l$s=async(te,J,X)=>{try{const re=await c$l(te);console.debug("imported plugin: ",te.pluginId);const ne=J(te);return await X(ne,re),console.debug("initialized plugin: ",te.pluginId),{dispose:()=>w$2(ne,re)}}catch(re){console.error(re)}},u$s=async(te,J)=>{await J.initialize(te)},w$2=(te,J)=>J.dispose(te),v$f=async(te,J)=>{if(!te?.length)throw new Error("No plugins to bootstrap");return(await Promise.allSettled(te.map(X=>l$s(X,J,u$s)))).map(X=>X.status==="fulfilled"?X.value:null)},primariaShellId="primaria-shell";var __extends$2=(function(){var te=function(J,X){return te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(re,ne){re.__proto__=ne}||function(re,ne){for(var oe in ne)Object.prototype.hasOwnProperty.call(ne,oe)&&(re[oe]=ne[oe])},te(J,X)};return function(J,X){if(typeof X!="function"&&X!==null)throw new TypeError("Class extends value "+String(X)+" is not a constructor or null");te(J,X);function re(){this.constructor=J}J.prototype=X===null?Object.create(X):(re.prototype=X.prototype,new re)}})(),__spreadArray$3=function(te,J,X){if(X||arguments.length===2)for(var re=0,ne=J.length,oe;re<ne;re++)(oe||!(re in J))&&(oe||(oe=Array.prototype.slice.call(J,0,re)),oe[re]=J[re]);return te.concat(oe||Array.prototype.slice.call(J))},OrderMappings=(function(){function te(){this._mappings=[]}return te.prototype.add=function(J){J.order!==0&&(J.order=this._mappings.length),this._mappings.push(J),this.onAdded(J)},te.prototype.clear=function(){this._mappings=[]},te})();function byOrder(te,J){return(J.order||0)-(te.order||0)}var NotificationMappings=(function(te){__extends$2(J,te);function J(){return te!==null&&te.apply(this,arguments)||this}return J.prototype.onAdded=function(X){var re=X.handler.prototype.constructor.name;mediatorSettings.resolver.add(re,X.handler)},J.prototype.setOrder=function(X,re){for(var ne=this.getAll(X),oe=0,de=ne;oe<de.length;oe++){var ce=de[oe];ce.order=re.indexOf(ce.handler)}},J.prototype.getAll=function(X){var re=this._mappings.filter(function(ne){return ne.notification===X});if(re.length===0)throw new Error("Cannot find notification handler with key: ".concat(X.prototype.name));return re.sort(byOrder)},J})(OrderMappings),BehaviorMappings=(function(te){__extends$2(J,te);function J(){return te!==null&&te.apply(this,arguments)||this}return J.prototype.onAdded=function(X){var re=X.behavior.prototype.constructor.name;mediatorSettings.resolver.add(re,X.behavior)},J.prototype.setOrder=function(X){for(var re=this.getAll(),ne=0,oe=re;ne<oe.length;ne++){var de=oe[ne];de.order=X.indexOf(de.behavior)}},J.prototype.getAll=function(){var X=__spreadArray$3([],this._mappings,!0);return X.sort(byOrder)},J})(OrderMappings),Dispatcher=(function(){function te(){this._notifications=new NotificationMappings,this._behaviors=new BehaviorMappings}return Object.defineProperty(te.prototype,"notifications",{get:function(){return this._notifications},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"behaviors",{get:function(){return this._behaviors},enumerable:!1,configurable:!0}),te})(),HandlerInstance=(function(){function te(J,X){this._name=J,this._value=X}return Object.defineProperty(te.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"value",{get:function(){return this._value},enumerable:!1,configurable:!0}),te})(),Resolver=(function(){function te(){this._instances=[]}return te.prototype.resolve=function(J){var X=this._instances.find(function(ne){return ne.name===J});if(!X)throw new Error("Cannot find element with key: ".concat(J));var re=X.value;return new re},te.prototype.add=function(J,X){var re=this._instances.find(function(ne){return ne.name===J});if(re===void 0)this._instances.push(new HandlerInstance(J,X));else throw new Error("The key ".concat(J," is already been added"))},te.prototype.remove=function(J){var X=this._instances.findIndex(function(re){return re.name===J});X>=0&&this._instances.splice(X,1)},te.prototype.clear=function(){this._instances=[]},te})(),MediatrSettings=(function(){function te(){this.resolver=new Resolver,this.dispatcher=new Dispatcher}return te})(),mediatorSettings=new MediatrSettings,requestHandler=function(te){return function(J){var X=te.prototype.constructor.name;mediatorSettings.resolver.add(X,J)}},notificationHandler=function(te){return function(J){mediatorSettings.dispatcher.notifications.add({notification:te,handler:J})}},__awaiter$4=function(te,J,X,re){function ne(oe){return oe instanceof X?oe:new X(function(de){de(oe)})}return new(X||(X=Promise))(function(oe,de){function ce(pe){try{ue(re.next(pe))}catch(fe){de(fe)}}function he(pe){try{ue(re.throw(pe))}catch(fe){de(fe)}}function ue(pe){pe.done?oe(pe.value):ne(pe.value).then(ce,he)}ue((re=re.apply(te,J||[])).next())})},__generator$4=function(te,J){var X={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},re,ne,oe,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(ue){return function(pe){return he([ue,pe])}}function he(ue){if(re)throw new TypeError("Generator is already executing.");for(;de&&(de=0,ue[0]&&(X=0)),X;)try{if(re=1,ne&&(oe=ue[0]&2?ne.return:ue[0]?ne.throw||((oe=ne.return)&&oe.call(ne),0):ne.next)&&!(oe=oe.call(ne,ue[1])).done)return oe;switch(ne=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return X.label++,{value:ue[1],done:!1};case 5:X.label++,ne=ue[1],ue=[0];continue;case 7:ue=X.ops.pop(),X.trys.pop();continue;default:if(oe=X.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){X=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){X.label=ue[1];break}if(ue[0]===6&&X.label<oe[1]){X.label=oe[1],oe=ue;break}if(oe&&X.label<oe[2]){X.label=oe[2],X.ops.push(ue);break}oe[2]&&X.ops.pop(),X.trys.pop();continue}ue=J.call(te,X)}catch(pe){ue=[6,pe],ne=0}finally{re=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},Mediator=(function(){function te(){}return te.prototype.send=function(J){return __awaiter$4(this,void 0,void 0,function(){var X,re,ne,oe,de,ce=this;return __generator$4(this,function(he){switch(he.label){case 0:return X=J.constructor.name,re=mediatorSettings.resolver.resolve(X),ne=mediatorSettings.dispatcher.behaviors.getAll().map(function(ue){return ue.behavior}),oe=0,de=function(){return __awaiter$4(ce,void 0,void 0,function(){var ue,pe;return __generator$4(this,function(fe){switch(fe.label){case 0:return oe<ne.length?(ue=ne[oe],pe=mediatorSettings.resolver.resolve(ue.name),oe++,[4,pe.handle(J,de)]):[3,2];case 1:return[2,fe.sent()];case 2:return[4,re.handle(J)];case 3:return[2,fe.sent()]}})})},[4,de()];case 1:return[2,he.sent()]}})})},te.prototype.publish=function(J){return __awaiter$4(this,void 0,void 0,function(){var X,re=this;return __generator$4(this,function(ne){switch(ne.label){case 0:return X=mediatorSettings.dispatcher.notifications.getAll(J.constructor),[4,Promise.all(X.map(function(oe){return __awaiter$4(re,void 0,void 0,function(){var de;return __generator$4(this,function(ce){return de=mediatorSettings.resolver.resolve(oe.handler.name),[2,de.handle(J)]})})}))];case 1:return ne.sent(),[2]}})})},te})();const disposableFactory=te=>({dispose:()=>{mediatorSettings.resolver.remove(te.name);const J=mediatorSettings.dispatcher.notifications._mappings.findIndex(X=>X.handler.name===te.name);J>-1&&mediatorSettings.dispatcher.notifications._mappings.splice(J,1)}});class Broker{constructor(){this.eventConstructorMap=new Map,this.requestConstructorMap=new Map,this.mediator=new Mediator,mediatorSettings.resolver.clear()}send(J,X){const re=typeof J=="string"?this.getRequest(J,X):J;return this.mediator.send(re)}publish(J,X){const re=typeof J=="string"?this.getEvent(J,X):J,ne=re.constructor||Object.getPrototypeOf(re).constructor;return mediatorSettings.dispatcher.notifications._mappings.filter(de=>de.notification===ne).length?this.mediator.publish(re):Promise.resolve()}subscribe(J,X){const re=typeof J=="function"?J:this.getEventType(J),ne=createDynamicEventHandler(X);return notificationHandler(re)(ne),disposableFactory(ne)}registerRequest(J,X){const re=typeof J=="function"?J:this.getRequestType(J),ne=createDynamicRequestHandler(X);return requestHandler(re)(ne),disposableFactory(ne)}getEvent(J,X){const re=this.getEventType(J);return new re(X)}getRequest(J,X){const re=this.getRequestType(J);return new re(X)}getEventType(J){if(!this.eventConstructorMap.has(J)){const X=createDynamicEventClass(J);this.eventConstructorMap.set(J,X)}return this.eventConstructorMap.get(J)}getRequestType(J){if(!this.requestConstructorMap.has(J)){const X=createDynamicRequestClass(J);this.requestConstructorMap.set(J,X)}return this.requestConstructorMap.get(J)}}const createDynamicEventClass=te=>createDynamicMessageClass(te,"Event"),createDynamicRequestClass=te=>createDynamicMessageClass(te,"Request"),createDynamicMessageClass=(te,J)=>new Function(`return class ${J}_${te} {
|
|
111
111
|
constructor(payload) {
|
|
112
112
|
Object.assign(this, payload);
|
|
113
113
|
}
|
|
@@ -6860,6 +6860,6 @@ ${te.searchString?.length>1?ke$1`
|
|
|
6860
6860
|
${r$F(styles)}
|
|
6861
6861
|
`;let PrimariaCharacterLimitBadge=Js;__decorateClass$1([n$z({type:Number})],PrimariaCharacterLimitBadge.prototype,"characterCount"),__decorateClass$1([n$z({type:Number})],PrimariaCharacterLimitBadge.prototype,"characterLimit"),__decorateClass$1([n$z({type:String})],PrimariaCharacterLimitBadge.prototype,"label");const useSharedUI=()=>{t$k("primaria-content-switcher")(PrimariaContentSwitcher),t$k("primaria-nav-item")(PrimariaNavItem),t$k("primaria-rich-text-editor")(PrimariaRichTextEditor),t$k("primaria-nav-tree-menu")(PrimariaNavTreeMenu),t$k("primaria-character-limit-badge")(PrimariaCharacterLimitBadge)},getPatientCip=async te=>await te.broker.send("get_patient_cip"),navigateToEcapWithoutClosingWithCip=async te=>{const J=await getPatientCip(shellApi);shellApi.ecapEventManager.publish(te,"NO_TANCAR",{CIP:J})},template=te=>ke$1`
|
|
6862
6862
|
<dss-action-menu-item @click=${te.callbackFn} notificationsstate="error" rightIcon=${te.icon} label=${te.label}></dss-action-menu-item>
|
|
6863
|
-
`;var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__decorateClass=(te,J,X,re)=>{for(var ne=re>1?void 0:re?__getOwnPropDesc(J,X):J,oe=te.length-1,de;oe>=0;oe--)(de=te[oe])&&(ne=(re?de(J,X,ne):de(ne))||ne);return re&&ne&&__defProp(J,X,ne),ne};let QuickActionItem=class extends h$m{constructor(te,J,X){super(),this.icon="",this.label="",this.callbackFn=()=>{},this.icon=te,this.label=J,this.callbackFn=X}render(){return ke$1`${template(this)}`}};__decorateClass([n$z({type:String})],QuickActionItem.prototype,"icon",2),__decorateClass([n$z({type:String})],QuickActionItem.prototype,"label",2),__decorateClass([n$z({attribute:!1})],QuickActionItem.prototype,"callbackFn",2),QuickActionItem=__decorateClass([t$k("quick-action-item")],QuickActionItem);const upperNavMenuItems=[{id:"landing",icon:"home",label:"Pàgina inici",type:"item",sortHint:"0010",callbackFn:()=>shellApi.broker.send(new ExitShell("OBRIR_PI"))},{id:"dinamic-monitoring",icon:"poll",label:"Monitoratge dinàmic",type:"item",sortHint:"0030",callbackFn:()=>navigateToEcapWithoutClosingWithCip("IA_DEV")},{id:"processes",icon:"account_tree",label:"Vies clíniques",type:"tree",sortHint:"0040",actionMenuItems:[{icon:"open_in_new",label:"Proces d'atenció - ARES",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PROCES_ATENCIO")},{icon:"open_in_new",label:"Nen sa",callbackFn:()=>navigateToEcapWithoutClosingWithCip("NEN_SA")},{icon:"open_in_new",label:"ASSIR",callbackFn:()=>navigateToEcapWithoutClosingWithCip("NAVEGACIO_ASSIR")},{icon:"open_in_new",label:"Odontologia",callbackFn:()=>navigateToEcapWithoutClosingWithCip("ODONTOLOGO")},{icon:"open_in_new",label:"Situació d'especial cura",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SIT_ESPEC_CURA_DEV")},{icon:"open_in_new",label:"Valoració social",callbackFn:()=>navigateToEcapWithoutClosingWithCip("VALORACIO_SOCIAL")}]},{id:"unique-petition",icon:"playlist_add",label:"Peticionari",type:"tree",sortHint:"0050",actionMenuItems:[{icon:"open_in_new",label:"Analítiques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("LABORATORI")},{icon:"open_in_new",label:"Ordres Clíniques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("RESULT_OC")},{icon:"open_in_new",label:"OC Exprés",callbackFn:()=>navigateToEcapWithoutClosingWithCip("OC_EXPRES")},{icon:"open_in_new",label:"Sol·licitud de trasllat",callbackFn:()=>navigateToEcapWithoutClosingWithCip("TRANSPORT")}]},{id:"analytics-monitoring",icon:"science",label:"Seguiment analític",type:"item",sortHint:"0060",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SEGUIMENT_ANALITIC")},{id:"results-reports",icon:"folder_shared",label:"Documents",type:"tree",sortHint:"0070",actionMenuItems:[{icon:"open_in_new",label:"Resultats i informes",callbackFn:()=>navigateToEcapWithoutClosingWithCip("RESULTAT_INFORMES")},{icon:"open_in_new",label:"Documents usuari",callbackFn:()=>setTimeout(()=>{navigateToEcapWithoutClosingWithCip("CRIDA_DOCS_USU")},0)},{icon:"open_in_new",label:"Informes clínics",callbackFn:()=>navigateToEcapWithoutClosingWithCip("INFORME_CLINIC_NET")}]},{id:"test-cabinets",icon:"list_alt",label:"Gabinets de proves",type:"item",sortHint:"0080",callbackFn:()=>navigateToEcapWithoutClosingWithCip("GABINETS_PROVES")},{id:"prescriptions",icon:"pill",label:"Prescripció",type:"tree",sortHint:"0090",actionMenuItems:[{icon:"open_in_new",label:"Prescripció",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PRESCRIPCIO_ACTIVA")},{icon:"open_in_new",label:"Ordres de tractament",callbackFn:()=>navigateToEcapWithoutClosingWithCip("ORDRE_TRACTAMENT")},{icon:"open_in_new",label:"Dispensació material sanitari",callbackFn:()=>navigateToEcapWithoutClosingWithCip("DISPENSACIO_MATERIAL_PACIENT")},{icon:"open_in_new",label:"Prescripció social",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PRESCRIPCIO_SOCIAL")}]},{id:"vaccines",icon:"vaccines",label:"Immunitzacions",type:"item",sortHint:"0100",callbackFn:()=>navigateToEcapWithoutClosingWithCip("IMMUNITZACIONS")},{id:"it",icon:"history_toggle_off",label:"Incapacitat temporal",type:"item",sortHint:"0100",callbackFn:()=>navigateToEcapWithoutClosingWithCip("REV_IT")},{id:"visits",icon:"event",label:"Visites",type:"item",sortHint:"0130",callbackFn:()=>navigateToEcapWithoutClosingWithCip("CONSULTA_VISITES")}],registerUpperNavMenuViews=()=>{for(const te of upperNavMenuItems)shellApi.regionManager.registerView(shellApi.regionManager.regions.shell.navigationMenu,{id:te.id,sortHint:te.sortHint,factory:()=>{const J=te.type==="item"?new PrimariaNavItem({icon:te.icon,label:te.label,callbackFn:te.callbackFn}):new PrimariaNavTreeMenu({icon:te.icon,label:te.label,actionMenuItems:te.actionMenuItems});return Promise.resolve(J)}})},registerCommunicationNavMenuItem=()=>{shellApi.regionManager.registerView(shellApi.regionManager.regions.shell.navigationMenu,{id:"communication",sortHint:"0120",factory:()=>{const te=new CommunicationActionMenu("3p","Comunicació");return Promise.resolve(te)}})},registerCommunicationMenuActions=()=>{const te=[{id:"1",sortHint:"0010",icon:"open_in_new",label:"SMS",callbackFn:async()=>{const J=await getPatientCip(shellApi);shellApi.ecapEventManager.publish("MISSATGES_DEV","NO_TANCAR",{CIP:J||"",TipusMissatge:"SMS"})}},{id:"2",sortHint:"0020",icon:"open_in_new",label:"eConsulta",callbackFn:async()=>{const J=await getPatientCip(shellApi),X=await shellApi.broker.send(new GetVisitId);shellApi.ecapEventManager.publish("NAVEGACIO_ECAP_ECONSULTA","NO_TANCAR",{CIP:J||"",VisiID:X||""})}},{id:"3",icon:"open_in_new",label:"Mail",callbackFn:async()=>{const J=await getPatientCip(shellApi);shellApi.ecapEventManager.publish("COMUNICACIO_MISSATGES_CREAR","NO_TANCAR",{CIP:J||"",TipusMissatge:"SMS"})}},{id:"4",sortHint:"0030",icon:"open_in_new",label:"Veu IP",callbackFn:()=>navigateToEcapWithoutClosingWithCip("VOIP")}];for(const J of te)shellApi.regionManager.registerView(shellApi.regionManager.regions.shell.communicationSidenav,{id:J.id,sortHint:J.sortHint,factory:()=>{new PrimariaNavItem({icon:J.icon,label:J.label,callbackFn:J.callbackFn});const X=new QuickActionItem(J.icon,J.label,J.callbackFn);return Promise.resolve(X)}})},registerMainViews=()=>{registerPDFVisorMainView()},useInternalViews=()=>{registerMainViews(),registerCommunicationNavMenuItem(),registerUpperNavMenuViews(),registerCommunicationMenuActions()},useUI=()=>{p$g.registerAdapterFactory("primaria-content-switcher",d$w),useSharedUI(),useComponents(),useInternalViews()},initializeShell=te=>{useLocalization(shellApi),useUI(),useFeatures(shellApi);const J=new PrimariaShell;te.appendChild(J)};class n extends HTMLElement{constructor(J,X,re={}){super(),this.jsx=J,this.styles=X,this.root=this.attachShadow({mode:"open"}),this.reactRoot=null,re&&(this.props=re)}connectedCallback(){const J=document.createElement("div");J.style.minHeight="100%",J.style.width="100%";const X=document.createElement("style");X.innerText=this.styles,this.root.appendChild(J),this.root.appendChild(X),this.reactRoot=r$L.createRoot(J),this.renderReact()}disconnectedCallback(){this.reactRoot&&this.reactRoot.unmount()}renderReact(){this.reactRoot&&this.reactRoot.render(c$s.createElement(this.jsx,{...this.props}))}}customElements.define("ux-react-web-component",n);const h=(te,J)=>(X={})=>Promise.resolve(new n(te,J,X));if(typeof document<"u"){const te=document.createElement("style");te.textContent=fontsCSS+`
|
|
6863
|
+
`;var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__decorateClass=(te,J,X,re)=>{for(var ne=re>1?void 0:re?__getOwnPropDesc(J,X):J,oe=te.length-1,de;oe>=0;oe--)(de=te[oe])&&(ne=(re?de(J,X,ne):de(ne))||ne);return re&&ne&&__defProp(J,X,ne),ne};let QuickActionItem=class extends h$m{constructor(te,J,X){super(),this.icon="",this.label="",this.callbackFn=()=>{},this.icon=te,this.label=J,this.callbackFn=X}render(){return ke$1`${template(this)}`}};__decorateClass([n$z({type:String})],QuickActionItem.prototype,"icon",2),__decorateClass([n$z({type:String})],QuickActionItem.prototype,"label",2),__decorateClass([n$z({attribute:!1})],QuickActionItem.prototype,"callbackFn",2),QuickActionItem=__decorateClass([t$k("quick-action-item")],QuickActionItem);const upperNavMenuItems=[{id:"landing",icon:"home",label:"Pàgina inici",type:"item",sortHint:"0010",callbackFn:()=>shellApi.broker.send(new ExitShell("OBRIR_PI"))},{id:"dinamic-monitoring",icon:"poll",label:"Monitoratge dinàmic",type:"item",sortHint:"0030",callbackFn:()=>navigateToEcapWithoutClosingWithCip("IA_DEV")},{id:"processes",icon:"account_tree",label:"Vies clíniques",type:"tree",sortHint:"0040",actionMenuItems:[{icon:"open_in_new",label:"Proces d'atenció - ARES",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PROCES_ATENCIO")},{icon:"open_in_new",label:"Nen sa",callbackFn:()=>navigateToEcapWithoutClosingWithCip("NEN_SA")},{icon:"open_in_new",label:"ASSIR",callbackFn:()=>navigateToEcapWithoutClosingWithCip("NAVEGACIO_ASSIR")},{icon:"open_in_new",label:"Odontologia",callbackFn:()=>navigateToEcapWithoutClosingWithCip("ODONTOLOGO")},{icon:"open_in_new",label:"Situació d'especial cura",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SIT_ESPEC_CURA_DEV")},{icon:"open_in_new",label:"Valoració social",callbackFn:()=>navigateToEcapWithoutClosingWithCip("VALORACIO_SOCIAL")}]},{id:"unique-petition",icon:"playlist_add",label:"Peticionari",type:"tree",sortHint:"0050",actionMenuItems:[{icon:"open_in_new",label:"Analítiques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("LABORATORI")},{icon:"open_in_new",label:"Ordres Clíniques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("RESULT_OC")},{icon:"open_in_new",label:"OC Exprés",callbackFn:()=>navigateToEcapWithoutClosingWithCip("OC_EXPRES")},{icon:"open_in_new",label:"Sol·licitud de trasllat",callbackFn:()=>navigateToEcapWithoutClosingWithCip("TRANSPORT")}]},{id:"analytics-monitoring",icon:"science",label:"Seguiment analític",type:"item",sortHint:"0060",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SEGUIMENT_ANALITIC")},{id:"results-reports",icon:"folder_shared",label:"Documents",type:"tree",sortHint:"0070",actionMenuItems:[{icon:"open_in_new",label:"Resultats i informes",callbackFn:()=>navigateToEcapWithoutClosingWithCip("RESULTAT_INFORMES")},{icon:"open_in_new",label:"Documents usuari",callbackFn:()=>setTimeout(()=>{navigateToEcapWithoutClosingWithCip("CRIDA_DOCS_USU")},0)},{icon:"open_in_new",label:"Informes clínics",callbackFn:()=>navigateToEcapWithoutClosingWithCip("INFORME_CLINIC_NET")}]},{id:"test-cabinets",icon:"list_alt",label:"Gabinets de proves",type:"item",sortHint:"0080",callbackFn:()=>navigateToEcapWithoutClosingWithCip("GABINETS_PROVES")},{id:"prescriptions",icon:"pill",label:"Prescripció",type:"tree",sortHint:"0090",actionMenuItems:[{icon:"open_in_new",label:"Prescripció",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PRESCRIPCIO_ACTIVA")},{icon:"open_in_new",label:"Ordres de tractament",callbackFn:()=>navigateToEcapWithoutClosingWithCip("ORDRE_TRACTAMENT")},{icon:"open_in_new",label:"Dispensació material sanitari",callbackFn:()=>navigateToEcapWithoutClosingWithCip("DISPENSACIO_MATERIAL_PACIENT")},{icon:"open_in_new",label:"Prescripció social",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PRESCRIPCIO_SOCIAL")}]},{id:"vaccines",icon:"vaccines",label:"Immunitzacions",type:"item",sortHint:"0100",callbackFn:()=>navigateToEcapWithoutClosingWithCip("IMMUNITZACIONS")},{id:"it",icon:"history_toggle_off",label:"Incapacitat temporal",type:"item",sortHint:"0100",callbackFn:()=>navigateToEcapWithoutClosingWithCip("REV_IT")},{id:"visits",icon:"event",label:"Visites",type:"item",sortHint:"0130",callbackFn:()=>navigateToEcapWithoutClosingWithCip("CONSULTA_VISITES")}],registerUpperNavMenuViews=()=>{for(const te of upperNavMenuItems)shellApi.regionManager.registerView(shellApi.regionManager.regions.shell.navigationMenu,{id:te.id,sortHint:te.sortHint,factory:()=>{const J=te.type==="item"?new PrimariaNavItem({icon:te.icon,label:te.label,callbackFn:te.callbackFn}):new PrimariaNavTreeMenu({icon:te.icon,label:te.label,actionMenuItems:te.actionMenuItems});return Promise.resolve(J)}})},registerCommunicationNavMenuItem=()=>{shellApi.regionManager.registerView(shellApi.regionManager.regions.shell.navigationMenu,{id:"communication",sortHint:"0120",factory:()=>{const te=new CommunicationActionMenu("3p","Comunicació");return Promise.resolve(te)}})},registerCommunicationMenuActions=()=>{const te=[{id:"1",sortHint:"0010",icon:"open_in_new",label:"SMS",callbackFn:async()=>{const J=await getPatientCip(shellApi);shellApi.ecapEventManager.publish("MISSATGES_DEV","NO_TANCAR",{CIP:J||"",TipusMissatge:"SMS"})}},{id:"2",sortHint:"0020",icon:"open_in_new",label:"eConsulta",callbackFn:async()=>{const J=await getPatientCip(shellApi),X=await shellApi.broker.send(new GetVisitId);shellApi.ecapEventManager.publish("NAVEGACIO_ECAP_ECONSULTA","NO_TANCAR",{CIP:J||"",VisiID:X||""})}},{id:"3",icon:"open_in_new",label:"Mail",callbackFn:async()=>{const J=await getPatientCip(shellApi);shellApi.ecapEventManager.publish("COMUNICACIO_MISSATGES_CREAR","NO_TANCAR",{CIP:J||"",TipusMissatge:"SMS"})}},{id:"4",sortHint:"0030",icon:"open_in_new",label:"Veu IP",callbackFn:()=>navigateToEcapWithoutClosingWithCip("VOIP")}];for(const J of te)shellApi.regionManager.registerView(shellApi.regionManager.regions.shell.communicationSidenav,{id:J.id,sortHint:J.sortHint,factory:()=>{new PrimariaNavItem({icon:J.icon,label:J.label,callbackFn:J.callbackFn});const X=new QuickActionItem(J.icon,J.label,J.callbackFn);return Promise.resolve(X)}})},registerMainViews=()=>{registerPDFVisorMainView()},useInternalViews=()=>{registerMainViews(),registerCommunicationNavMenuItem(),registerUpperNavMenuViews(),registerCommunicationMenuActions()},useUI=()=>{p$g.registerAdapterFactory("primaria-content-switcher",d$w),useSharedUI(),useComponents(),useInternalViews()},initializeShell=te=>{useLocalization(shellApi),useUI(),useFeatures(shellApi);const J=new PrimariaShell;te.appendChild(J)};class n extends HTMLElement{constructor(J,X,re={}){super(),this.jsx=J,this.styles=X,this.root=this.attachShadow({mode:"open"}),this.reactRoot=null,re&&(this.props=re)}connectedCallback(){const J=document.createElement("div");J.style.minHeight="100%",J.style.width="100%",J.style.height="100%";const X=document.createElement("style");X.innerText=this.styles,this.root.appendChild(J),this.root.appendChild(X),this.reactRoot=r$L.createRoot(J),this.renderReact()}disconnectedCallback(){this.reactRoot&&this.reactRoot.unmount()}renderReact(){this.reactRoot&&this.reactRoot.render(c$s.createElement(this.jsx,{...this.props}))}}customElements.define("ux-react-web-component",n);const h=(te,J)=>(X={})=>Promise.resolve(new n(te,J,X));if(typeof document<"u"){const te=document.createElement("style");te.textContent=fontsCSS+`
|
|
6864
6864
|
`+dssCSS,document.head.appendChild(te)}exports.EcapEventManager=EcapEventManager,exports.PrimariaContentSwitcher=PrimariaContentSwitcher,exports.PrimariaInteractionService=PrimariaInteractionService,exports.PrimariaNavItem=PrimariaNavItem,exports.PrimariaRegionHost=PrimariaRegionHost,exports.bootstrapPlugins=bootstrapPlugins,exports.clinicalMonitoringRegions=clinicalMonitoringRegions,exports.createEcapEventManager=createEcapEventManager,exports.disposePlugins=disposePlugins,exports.disposeShell=disposeShell,exports.initializeShell=initializeShell,exports.primariaApiFactory=primariaApiFactory,exports.raiseCloseEvent=raiseCloseEvent,exports.raiseCustomCloseEvent=raiseCustomCloseEvent,exports.shellApi=shellApi,exports.shellRegions=shellRegions,exports.wrapReactViewFactory=h,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}));
|
|
6865
6865
|
//# sourceMappingURL=index.umd.cjs.map
|