@uxland/primary-shell 7.29.7 → 7.29.13

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.
Files changed (25) hide show
  1. package/dist/{component-DVZj1pQR.js → component-D-_nJ0GB.js} +2 -2
  2. package/dist/{component-DVZj1pQR.js.map → component-D-_nJ0GB.js.map} +1 -1
  3. package/dist/{index-CbiH0JOX.js → index-Bij-Dh9n.js} +503 -462
  4. package/dist/index-Bij-Dh9n.js.map +1 -0
  5. package/dist/index.js +1 -1
  6. package/dist/index.umd.cjs +65 -65
  7. package/dist/index.umd.cjs.map +1 -1
  8. package/dist/primary/shell/src/UI/shared-components/primaria-nav-tree-menu/primaria-nav-tree-menu.d.ts +1 -1
  9. package/dist/primary/shell/src/api/pdf-viewer-manager/pdf-viewer-manager.d.ts +11 -5
  10. package/package.json +2 -2
  11. package/src/UI/components/clinical-pathways-action-menu/styles.css +4 -0
  12. package/src/UI/components/communication-action-menu/styles.css +4 -0
  13. package/src/UI/components/navigation-tooltip/navigation-tooltip.ts +3 -3
  14. package/src/UI/components/poc-events-ecap/poc-events-ecap.ts +7 -3
  15. package/src/UI/components/primaria-accordion/primaria-accordion.ts +0 -1
  16. package/src/UI/shared-components/primaria-nav-item/styles.css +4 -0
  17. package/src/UI/shared-components/primaria-nav-item/template.ts +3 -4
  18. package/src/UI/shared-components/primaria-nav-tree-menu/primaria-nav-tree-menu.ts +6 -5
  19. package/src/UI/shared-components/primaria-nav-tree-menu/template.ts +35 -39
  20. package/src/api/pdf-viewer-manager/pdf-viewer-manager.test.ts +15 -15
  21. package/src/api/pdf-viewer-manager/pdf-viewer-manager.ts +34 -14
  22. package/src/api/pdf-viewer-manager/pdf-visor/pdf-selector/styles.css +26 -5
  23. package/src/api/pdf-viewer-manager/pdf-visor/pdf-selector/template.ts +6 -9
  24. package/src/features/visit/finalize-visit/component/template.ts +2 -2
  25. package/dist/index-CbiH0JOX.js.map +0 -1
@@ -7012,6 +7012,242 @@ class PrimariaNotificationServiceImpl extends PrimariaNotificationService {
7012
7012
  this.notify(W, "success", X);
7013
7013
  }
7014
7014
  }
7015
+ let shellLocaleManager;
7016
+ const useLocalization = async (J) => {
7017
+ L$2("ca"), shellLocaleManager = await J.createLocaleManager(locales$1);
7018
+ }, translate$1 = (J) => shellLocaleManager ? shellLocaleManager.translate(J) : J, locales$1 = {
7019
+ ca: {
7020
+ [primariaShellId]: {
7021
+ title: "Estació de Treball Clínica",
7022
+ actions: {
7023
+ create: "Crear",
7024
+ toggleMenuClose: "Tancar menú",
7025
+ toggleMenuOpen: "Expandir menú",
7026
+ askExit: "Atenció, vols sortir igualment?",
7027
+ finalizeVisit: "Finalitzar visita"
7028
+ },
7029
+ errors: {
7030
+ session: "Hi ha hagut un error amb la sessió. Siusplau, tanca i torna a obrir l'aplicació.",
7031
+ invalidPatient: "El pacient actual no és vàlid. Siusplau, tanca i torna a obrir l'aplicació.",
7032
+ exit: "Hi ha hagut un error en sortir de l'ETC"
7033
+ },
7034
+ header: {
7035
+ workCenter: "Centre treball",
7036
+ role: "Tipus de profesional",
7037
+ speciality: "Àmbit treball"
7038
+ },
7039
+ busyManager: {
7040
+ title: "Tasques pendents:"
7041
+ },
7042
+ pdfManager: {
7043
+ uploaded: "Document disponible al visor de resultats",
7044
+ alreadyUploaded: "Ja s'ha carregat un document amb aquest nom",
7045
+ navButtonLabel: "Visor PDF",
7046
+ missingData: "Es necesita un document o URL per enviar al visor de resultats",
7047
+ duplicatedSource: "Només pots envar un document o URL a la vegada",
7048
+ tooltipMessage: "S'ha generat el PDF al visor"
7049
+ },
7050
+ pdfVisor: {
7051
+ noPdfSelected: "No hi ha cap PDF seleccionat"
7052
+ },
7053
+ importDataManager: {
7054
+ title: "Importar dades",
7055
+ actions: {
7056
+ cancel: "Cancel·lar",
7057
+ import: "Importar dades"
7058
+ }
7059
+ }
7060
+ }
7061
+ }
7062
+ }, pdfViwerEvents = {
7063
+ added: "added_pdf",
7064
+ deleted: "deleted_pdf"
7065
+ };
7066
+ function base64ToBlob(J, W = "application/octet-stream") {
7067
+ const X = window.atob(J), te = X.length, re = new Uint8Array(te);
7068
+ for (let oe = 0; oe < te; oe++)
7069
+ re[oe] = X.charCodeAt(oe);
7070
+ return new Blob([re], { type: W });
7071
+ }
7072
+ const createUrlFromBase64 = (J, W) => {
7073
+ if (J) {
7074
+ const X = base64ToBlob(J, "application/pdf");
7075
+ return URL.createObjectURL(X);
7076
+ }
7077
+ }, styles$p = ":host{width:250px;gap:8px}.pdf-item{display:flex;align-items:flex-start;padding:8px;gap:8px;color:#000;border-bottom:1px solid var(--color-neutral-100)}.container{display:flex;flex-direction:column;flex:1;position:relative}.close-button{position:absolute;top:0;right:0}.data{display:flex;flex-direction:column;gap:4px;padding-right:40px}.pdf-name{font-weight:500;font-size:14px;line-height:1.4}.pdf-date{font-size:12px;color:var(--color-neutral-500);line-height:1.3}";
7078
+ /**
7079
+ * @license
7080
+ * Copyright 2017 Google LLC
7081
+ * SPDX-License-Identifier: BSD-3-Clause
7082
+ */
7083
+ const t$q = { ATTRIBUTE: 1, CHILD: 2 }, e$J = (J) => (...W) => ({ _$litDirective$: J, values: W });
7084
+ let i$E = class {
7085
+ constructor(W) {
7086
+ }
7087
+ get _$AU() {
7088
+ return this._$AM._$AU;
7089
+ }
7090
+ _$AT(W, X, te) {
7091
+ this.t = W, this._$AM = X, this.i = te;
7092
+ }
7093
+ _$AS(W, X) {
7094
+ return this.update(W, X);
7095
+ }
7096
+ update(W, X) {
7097
+ return this.render(...X);
7098
+ }
7099
+ };
7100
+ /**
7101
+ * @license
7102
+ * Copyright 2020 Google LLC
7103
+ * SPDX-License-Identifier: BSD-3-Clause
7104
+ */
7105
+ const { I: et } = si, lt = () => document.createComment(""), at = (J, W, X) => {
7106
+ const te = J._$AA.parentNode, re = W === void 0 ? J._$AB : W._$AA;
7107
+ if (X === void 0) {
7108
+ const oe = te.insertBefore(lt(), re), ne = te.insertBefore(lt(), re);
7109
+ X = new et(oe, ne, J, J.options);
7110
+ } else {
7111
+ const oe = X._$AB.nextSibling, ne = X._$AM, de = ne !== J;
7112
+ if (de) {
7113
+ let ce;
7114
+ X._$AQ?.(J), X._$AM = J, X._$AP !== void 0 && (ce = J._$AU) !== ne._$AU && X._$AP(ce);
7115
+ }
7116
+ if (oe !== re || de) {
7117
+ let ce = X._$AA;
7118
+ for (; ce !== oe; ) {
7119
+ const ue = ce.nextSibling;
7120
+ te.insertBefore(ce, re), ce = ue;
7121
+ }
7122
+ }
7123
+ }
7124
+ return X;
7125
+ }, ct = (J, W, X = J) => (J._$AI(W, X), J), ht = {}, dt = (J, W = ht) => J._$AH = W, ut = (J) => J._$AH, pt = (J) => {
7126
+ J._$AP?.(!1, !0);
7127
+ let W = J._$AA;
7128
+ const X = J._$AB.nextSibling;
7129
+ for (; W !== X; ) {
7130
+ const te = W.nextSibling;
7131
+ W.remove(), W = te;
7132
+ }
7133
+ };
7134
+ /**
7135
+ * @license
7136
+ * Copyright 2017 Google LLC
7137
+ * SPDX-License-Identifier: BSD-3-Clause
7138
+ */
7139
+ const Jt = (J, W, X) => {
7140
+ const te = /* @__PURE__ */ new Map();
7141
+ for (let re = W; re <= X; re++) te.set(J[re], re);
7142
+ return te;
7143
+ }, Qt = e$J(class extends i$E {
7144
+ constructor(J) {
7145
+ if (super(J), J.type !== t$q.CHILD) throw Error("repeat() can only be used in text expressions");
7146
+ }
7147
+ dt(J, W, X) {
7148
+ let te;
7149
+ X === void 0 ? X = W : W !== void 0 && (te = W);
7150
+ const re = [], oe = [];
7151
+ let ne = 0;
7152
+ for (const de of J) re[ne] = te ? te(de, ne) : ne, oe[ne] = X(de, ne), ne++;
7153
+ return { values: oe, keys: re };
7154
+ }
7155
+ render(J, W, X) {
7156
+ return this.dt(J, W, X).values;
7157
+ }
7158
+ update(J, [W, X, te]) {
7159
+ const re = ut(J), { values: oe, keys: ne } = this.dt(W, X, te);
7160
+ if (!Array.isArray(re)) return this.ut = ne, oe;
7161
+ const de = this.ut ??= [], ce = [];
7162
+ let ue, he, pe = 0, fe = re.length - 1, be = 0, me = oe.length - 1;
7163
+ for (; pe <= fe && be <= me; ) if (re[pe] === null) pe++;
7164
+ else if (re[fe] === null) fe--;
7165
+ else if (de[pe] === ne[be]) ce[be] = ct(re[pe], oe[be]), pe++, be++;
7166
+ else if (de[fe] === ne[me]) ce[me] = ct(re[fe], oe[me]), fe--, me--;
7167
+ else if (de[pe] === ne[me]) ce[me] = ct(re[pe], oe[me]), at(J, ce[me + 1], re[pe]), pe++, me--;
7168
+ else if (de[fe] === ne[be]) ce[be] = ct(re[fe], oe[be]), at(J, re[pe], re[fe]), fe--, be++;
7169
+ else if (ue === void 0 && (ue = Jt(ne, be, me), he = Jt(de, pe, fe)), ue.has(de[pe])) if (ue.has(de[fe])) {
7170
+ const ge = he.get(ne[be]), ve = ge !== void 0 ? re[ge] : null;
7171
+ if (ve === null) {
7172
+ const _e = at(J, re[pe]);
7173
+ ct(_e, oe[be]), ce[be] = _e;
7174
+ } else ce[be] = ct(ve, oe[be]), at(J, re[pe], ve), re[ge] = null;
7175
+ be++;
7176
+ } else pt(re[fe]), fe--;
7177
+ else pt(re[pe]), pe++;
7178
+ for (; be <= me; ) {
7179
+ const ge = at(J, ce[me + 1]);
7180
+ ct(ge, oe[be]), ce[be++] = ge;
7181
+ }
7182
+ for (; pe <= fe; ) {
7183
+ const ge = re[pe++];
7184
+ ge !== null && pt(ge);
7185
+ }
7186
+ return this.ut = ne, dt(J, ce), R$3;
7187
+ }
7188
+ }), template$p = (J) => {
7189
+ const W = (X) => ke$1`
7190
+ <div class="pdf-item">
7191
+ <dss-checkbox @onChange=${() => J.setActivePdf(X.id)}>
7192
+ <input
7193
+ slot="input"
7194
+ type="checkbox"
7195
+ aria-label="Label"
7196
+ .checked=${J.activePdfs.some((te) => te.id === X.id)}
7197
+ >
7198
+ </dss-checkbox>
7199
+ <div class="container">
7200
+ <dss-icon-button class="close-button" size="md" variant="error" icon="close" @click=${() => J.removePdf(X.id)}></dss-icon-button>
7201
+ <div class="data">
7202
+ <div class="pdf-name">${X.data.name || "Sense nom"}</div>
7203
+ <div class="pdf-date">${X.data.date || " "}</div>
7204
+ </div>
7205
+ </div>
7206
+ </div>
7207
+ `;
7208
+ return ke$1`
7209
+ <div>
7210
+ ${Qt(J.pdfList, (X) => W(X))}
7211
+ </div>
7212
+ `;
7213
+ };
7214
+ var __defProp$r = Object.defineProperty, __decorateClass$y = (J, W, X, te) => {
7215
+ for (var re = void 0, oe = J.length - 1, ne; oe >= 0; oe--)
7216
+ (ne = J[oe]) && (re = ne(W, X, re) || re);
7217
+ return re && __defProp$r(W, X, re), re;
7218
+ };
7219
+ const Fs = class Fs extends h$p {
7220
+ constructor() {
7221
+ super(...arguments), this.activePdfs = [];
7222
+ }
7223
+ render() {
7224
+ return template$p(this);
7225
+ }
7226
+ removePdf(W) {
7227
+ this.dispatchEvent(
7228
+ new CustomEvent("pdf-removed", { detail: W, bubbles: !0, composed: !0 })
7229
+ );
7230
+ }
7231
+ setActivePdf(W) {
7232
+ this.dispatchEvent(
7233
+ new CustomEvent("active-pdf-changed", { detail: W, bubbles: !0, composed: !0 })
7234
+ );
7235
+ }
7236
+ openInNewWindow(W) {
7237
+ const X = W.data.url ? W.data.url : createUrlFromBase64(W.data.b64);
7238
+ X && window.open(X);
7239
+ }
7240
+ };
7241
+ Fs.styles = i$H`
7242
+ ${r$L(styles$p)}
7243
+ `;
7244
+ let PdfSelector = Fs;
7245
+ __decorateClass$y([
7246
+ n$B({ type: Array })
7247
+ ], PdfSelector.prototype, "pdfList");
7248
+ __decorateClass$y([
7249
+ n$B({ type: Array })
7250
+ ], PdfSelector.prototype, "activePdfs");
7015
7251
  var NAMED_TAG = "named", NAME_TAG = "name", UNMANAGED_TAG = "unmanaged", OPTIONAL_TAG = "optional", INJECT_TAG = "inject", MULTI_INJECT_TAG = "multi_inject", TAGGED = "inversify:tagged", TAGGED_PROP = "inversify:tagged_props", PARAM_TYPES = "inversify:paramtypes", DESIGN_PARAM_TYPES = "design:paramtypes", POST_CONSTRUCT = "post_construct", PRE_DESTROY = "pre_destroy";
7016
7252
  function getNonCustomTagKeys() {
7017
7253
  return [
@@ -8942,311 +9178,7 @@ function injectBase(J) {
8942
9178
  };
8943
9179
  };
8944
9180
  }
8945
- var inject = injectBase(INJECT_TAG);
8946
- const registerRequest$1 = (J, W) => (X, te) => {
8947
- W.bind(te).to(te).inTransientScope(), injectable()(te);
8948
- const re = J.broker.registerRequest(X, (oe) => W.get(te).handle(oe));
8949
- return {
8950
- dispose: () => {
8951
- W.isBound(te) && W.unbind(te), re.dispose();
8952
- }
8953
- };
8954
- }, brokerExtensions = (J, W) => ({
8955
- registerRequest: registerRequest$1(J, W)
8956
- }), generateId = () => {
8957
- try {
8958
- if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
8959
- return crypto.randomUUID();
8960
- } catch {
8961
- console.warn("crypto.randomUUID() failed, using fallback");
8962
- }
8963
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (J) => {
8964
- const W = Math.random() * 16 | 0;
8965
- return (J === "x" ? W : W & 3 | 8).toString(16);
8966
- });
8967
- }, mapArrayToLabelValue = (J, W, X) => J.map((te) => {
8968
- const re = te[W], oe = te[X];
8969
- return (re === "" || re == null) && typeof oe == "string" && oe.trim() !== "" ? {
8970
- label: oe,
8971
- value: oe
8972
- } : (re === "" || re == null) && (oe === "" || oe == null) ? null : {
8973
- label: re,
8974
- value: oe
8975
- };
8976
- }).filter((te) => te !== null);
8977
- function createConnectToStoreDecorator(J) {
8978
- return function(X) {
8979
- return (te, re) => {
8980
- Object.defineProperty(te, re, {
8981
- get() {
8982
- return this[`__${re}`];
8983
- },
8984
- set(de) {
8985
- this[`__${re}`] !== de && (this[`__${re}`] = Array.isArray(de) ? [...de] : typeof de == "object" && de !== null ? { ...de } : de, this.requestUpdate(re));
8986
- },
8987
- configurable: !0,
8988
- enumerable: !0
8989
- });
8990
- const oe = te.connectedCallback, ne = te.disconnectedCallback;
8991
- te.connectedCallback = function() {
8992
- oe && oe.call(this), this[re] = X(J.getState()), this[`__unsubscribe__${re}`] = J.subscribe(() => {
8993
- const de = X(J.getState());
8994
- this[re] = Array.isArray(de) ? [...de] : typeof de == "object" && de !== null ? { ...de } : de;
8995
- });
8996
- }, te.disconnectedCallback = function() {
8997
- ne && ne.call(this), this[`__unsubscribe__${re}`] && this[`__unsubscribe__${re}`]();
8998
- };
8999
- };
9000
- };
9001
- }
9002
- function createConnectedProperty(J) {
9003
- return (W, X = {}) => {
9004
- const te = createConnectToStoreDecorator(J);
9005
- return (re, oe) => {
9006
- n$B(X)(re, oe), te(W)(re, oe);
9007
- };
9008
- };
9009
- }
9010
- let shellLocaleManager;
9011
- const useLocalization = async (J) => {
9012
- L$2("ca"), shellLocaleManager = await J.createLocaleManager(locales$1);
9013
- }, translate$1 = (J) => shellLocaleManager ? shellLocaleManager.translate(J) : J, locales$1 = {
9014
- ca: {
9015
- [primariaShellId]: {
9016
- title: "Estació de Treball Clínica",
9017
- actions: {
9018
- create: "Crear",
9019
- toggleMenuClose: "Tancar menú",
9020
- toggleMenuOpen: "Expandir menú",
9021
- askExit: "Atenció, vols sortir igualment?",
9022
- finalizeVisit: "Finalitzar visita"
9023
- },
9024
- errors: {
9025
- session: "Hi ha hagut un error amb la sessió. Siusplau, tanca i torna a obrir l'aplicació.",
9026
- invalidPatient: "El pacient actual no és vàlid. Siusplau, tanca i torna a obrir l'aplicació.",
9027
- exit: "Hi ha hagut un error en sortir de l'ETC"
9028
- },
9029
- header: {
9030
- workCenter: "Centre treball",
9031
- role: "Tipus de profesional",
9032
- speciality: "Àmbit treball"
9033
- },
9034
- busyManager: {
9035
- title: "Tasques pendents:"
9036
- },
9037
- pdfManager: {
9038
- uploaded: "Document disponible al visor de resultats",
9039
- alreadyUploaded: "Ja s'ha carregat un document amb aquest nom",
9040
- navButtonLabel: "Visor PDF",
9041
- missingData: "Es necesita un document o URL per enviar al visor de resultats",
9042
- duplicatedSource: "Només pots envar un document o URL a la vegada",
9043
- tooltipMessage: "S'ha generat el PDF al visor"
9044
- },
9045
- pdfVisor: {
9046
- noPdfSelected: "No hi ha cap PDF seleccionat"
9047
- },
9048
- importDataManager: {
9049
- title: "Importar dades",
9050
- actions: {
9051
- cancel: "Cancel·lar",
9052
- import: "Importar dades"
9053
- }
9054
- }
9055
- }
9056
- }
9057
- }, pdfViwerEvents = {
9058
- added: "added_pdf",
9059
- deleted: "deleted_pdf"
9060
- };
9061
- function base64ToBlob(J, W = "application/octet-stream") {
9062
- const X = window.atob(J), te = X.length, re = new Uint8Array(te);
9063
- for (let oe = 0; oe < te; oe++)
9064
- re[oe] = X.charCodeAt(oe);
9065
- return new Blob([re], { type: W });
9066
- }
9067
- const createUrlFromBase64 = (J, W) => {
9068
- if (J) {
9069
- const X = base64ToBlob(J, "application/pdf");
9070
- return URL.createObjectURL(X);
9071
- }
9072
- }, styles$p = ":host{width:250px;gap:8px}.pdf-item{display:flex;align-items:flex-start;padding:8px;gap:8px;color:#000;border-bottom:1px solid var(--color-neutral-100)}.header-icons{display:flex;gap:8px}.container{gap:8px;display:flex;flex-direction:column}";
9073
- /**
9074
- * @license
9075
- * Copyright 2017 Google LLC
9076
- * SPDX-License-Identifier: BSD-3-Clause
9077
- */
9078
- const t$q = { ATTRIBUTE: 1, CHILD: 2 }, e$J = (J) => (...W) => ({ _$litDirective$: J, values: W });
9079
- let i$E = class {
9080
- constructor(W) {
9081
- }
9082
- get _$AU() {
9083
- return this._$AM._$AU;
9084
- }
9085
- _$AT(W, X, te) {
9086
- this.t = W, this._$AM = X, this.i = te;
9087
- }
9088
- _$AS(W, X) {
9089
- return this.update(W, X);
9090
- }
9091
- update(W, X) {
9092
- return this.render(...X);
9093
- }
9094
- };
9095
- /**
9096
- * @license
9097
- * Copyright 2020 Google LLC
9098
- * SPDX-License-Identifier: BSD-3-Clause
9099
- */
9100
- const { I: et } = si, lt = () => document.createComment(""), at = (J, W, X) => {
9101
- const te = J._$AA.parentNode, re = W === void 0 ? J._$AB : W._$AA;
9102
- if (X === void 0) {
9103
- const oe = te.insertBefore(lt(), re), ne = te.insertBefore(lt(), re);
9104
- X = new et(oe, ne, J, J.options);
9105
- } else {
9106
- const oe = X._$AB.nextSibling, ne = X._$AM, de = ne !== J;
9107
- if (de) {
9108
- let ce;
9109
- X._$AQ?.(J), X._$AM = J, X._$AP !== void 0 && (ce = J._$AU) !== ne._$AU && X._$AP(ce);
9110
- }
9111
- if (oe !== re || de) {
9112
- let ce = X._$AA;
9113
- for (; ce !== oe; ) {
9114
- const ue = ce.nextSibling;
9115
- te.insertBefore(ce, re), ce = ue;
9116
- }
9117
- }
9118
- }
9119
- return X;
9120
- }, ct = (J, W, X = J) => (J._$AI(W, X), J), ht = {}, dt = (J, W = ht) => J._$AH = W, ut = (J) => J._$AH, pt = (J) => {
9121
- J._$AP?.(!1, !0);
9122
- let W = J._$AA;
9123
- const X = J._$AB.nextSibling;
9124
- for (; W !== X; ) {
9125
- const te = W.nextSibling;
9126
- W.remove(), W = te;
9127
- }
9128
- };
9129
- /**
9130
- * @license
9131
- * Copyright 2017 Google LLC
9132
- * SPDX-License-Identifier: BSD-3-Clause
9133
- */
9134
- const Jt = (J, W, X) => {
9135
- const te = /* @__PURE__ */ new Map();
9136
- for (let re = W; re <= X; re++) te.set(J[re], re);
9137
- return te;
9138
- }, Qt = e$J(class extends i$E {
9139
- constructor(J) {
9140
- if (super(J), J.type !== t$q.CHILD) throw Error("repeat() can only be used in text expressions");
9141
- }
9142
- dt(J, W, X) {
9143
- let te;
9144
- X === void 0 ? X = W : W !== void 0 && (te = W);
9145
- const re = [], oe = [];
9146
- let ne = 0;
9147
- for (const de of J) re[ne] = te ? te(de, ne) : ne, oe[ne] = X(de, ne), ne++;
9148
- return { values: oe, keys: re };
9149
- }
9150
- render(J, W, X) {
9151
- return this.dt(J, W, X).values;
9152
- }
9153
- update(J, [W, X, te]) {
9154
- const re = ut(J), { values: oe, keys: ne } = this.dt(W, X, te);
9155
- if (!Array.isArray(re)) return this.ut = ne, oe;
9156
- const de = this.ut ??= [], ce = [];
9157
- let ue, he, pe = 0, fe = re.length - 1, be = 0, me = oe.length - 1;
9158
- for (; pe <= fe && be <= me; ) if (re[pe] === null) pe++;
9159
- else if (re[fe] === null) fe--;
9160
- else if (de[pe] === ne[be]) ce[be] = ct(re[pe], oe[be]), pe++, be++;
9161
- else if (de[fe] === ne[me]) ce[me] = ct(re[fe], oe[me]), fe--, me--;
9162
- else if (de[pe] === ne[me]) ce[me] = ct(re[pe], oe[me]), at(J, ce[me + 1], re[pe]), pe++, me--;
9163
- else if (de[fe] === ne[be]) ce[be] = ct(re[fe], oe[be]), at(J, re[pe], re[fe]), fe--, be++;
9164
- else if (ue === void 0 && (ue = Jt(ne, be, me), he = Jt(de, pe, fe)), ue.has(de[pe])) if (ue.has(de[fe])) {
9165
- const ge = he.get(ne[be]), ve = ge !== void 0 ? re[ge] : null;
9166
- if (ve === null) {
9167
- const _e = at(J, re[pe]);
9168
- ct(_e, oe[be]), ce[be] = _e;
9169
- } else ce[be] = ct(ve, oe[be]), at(J, re[pe], ve), re[ge] = null;
9170
- be++;
9171
- } else pt(re[fe]), fe--;
9172
- else pt(re[pe]), pe++;
9173
- for (; be <= me; ) {
9174
- const ge = at(J, ce[me + 1]);
9175
- ct(ge, oe[be]), ce[be++] = ge;
9176
- }
9177
- for (; pe <= fe; ) {
9178
- const ge = re[pe++];
9179
- ge !== null && pt(ge);
9180
- }
9181
- return this.ut = ne, dt(J, ce), R$3;
9182
- }
9183
- }), template$p = (J) => {
9184
- const W = (X) => ke$1`
9185
- <div class="pdf-item">
9186
- <dss-checkbox @onChange=${() => J.setActivePdf(X.id)}>
9187
- <input
9188
- slot="input"
9189
- type="checkbox"
9190
- aria-label="Label"
9191
- .checked=${J.activePdfs.some((te) => te.id === X.id)}
9192
- >
9193
- </dss-checkbox>
9194
- <div class="container">
9195
- <div class="header-icons">
9196
- <dss-icon-button size="md" variant="error" icon="picture_as_pdf"></dss-icon-button>
9197
- <dss-icon-button size="md" variant="error" icon="close" @click=${() => J.removePdf(X.id)}></dss-icon-button>
9198
- <!-- <dss-icon-button size="md" icon="open_in_new" @click=${() => J.openInNewWindow(X)}></dss-icon-button> -->
9199
- </div>
9200
- <div class="data">
9201
- ${X.pdfName}
9202
- </div>
9203
- </div>
9204
- </div>
9205
- `;
9206
- return ke$1`
9207
- <div>
9208
- ${Qt(J.pdfList, (X) => W(X))}
9209
- </div>
9210
- `;
9211
- };
9212
- var __defProp$r = Object.defineProperty, __decorateClass$y = (J, W, X, te) => {
9213
- for (var re = void 0, oe = J.length - 1, ne; oe >= 0; oe--)
9214
- (ne = J[oe]) && (re = ne(W, X, re) || re);
9215
- return re && __defProp$r(W, X, re), re;
9216
- };
9217
- const Fs = class Fs extends h$p {
9218
- constructor() {
9219
- super(...arguments), this.activePdfs = [];
9220
- }
9221
- render() {
9222
- return template$p(this);
9223
- }
9224
- removePdf(W) {
9225
- this.dispatchEvent(
9226
- new CustomEvent("pdf-removed", { detail: W, bubbles: !0, composed: !0 })
9227
- );
9228
- }
9229
- setActivePdf(W) {
9230
- this.dispatchEvent(
9231
- new CustomEvent("active-pdf-changed", { detail: W, bubbles: !0, composed: !0 })
9232
- );
9233
- }
9234
- openInNewWindow(W) {
9235
- const X = W.data.url ? W.data.url : createUrlFromBase64(W.data.b64);
9236
- X && window.open(X);
9237
- }
9238
- };
9239
- Fs.styles = i$H`
9240
- ${r$L(styles$p)}
9241
- `;
9242
- let PdfSelector = Fs;
9243
- __decorateClass$y([
9244
- n$B({ type: Array })
9245
- ], PdfSelector.prototype, "pdfList");
9246
- __decorateClass$y([
9247
- n$B({ type: Array })
9248
- ], PdfSelector.prototype, "activePdfs");
9249
- var INJECTION = Symbol.for("INJECTION");
9181
+ var inject = injectBase(INJECT_TAG), INJECTION = Symbol.for("INJECTION");
9250
9182
  function _proxyGetter(J, W, X, te) {
9251
9183
  function re() {
9252
9184
  return Reflect.hasMetadata(INJECTION, this, W) ? Reflect.getMetadata(INJECTION, this, W) : X();
@@ -9409,10 +9341,10 @@ const Ns = class Ns extends h$p {
9409
9341
  super(...arguments), this.text = "", this.itemAbsoluteY = 0;
9410
9342
  }
9411
9343
  render() {
9412
- const X = this.itemAbsoluteY + 25.5;
9344
+ const X = this.itemAbsoluteY + 25.5 - 5;
9413
9345
  return ke$1`
9414
9346
  <div class="tooltip-overlay">
9415
- <div class="navigation-tooltip" style="left: 73px; top: ${X}px">
9347
+ <div class="navigation-tooltip" style="left: 88px; top: ${X}px">
9416
9348
  <dss-icon icon="info" size="md"></dss-icon>
9417
9349
  ${this.text}
9418
9350
  <div class="arrow"></div>
@@ -9458,19 +9390,27 @@ class PdfViewerManager {
9458
9390
  this.broker = W, this.notificationService = X, this.pdfs = [], this.activePdf = null, customElements.get("pdf-visor") || t$t("pdf-visor")(PdfVisor), customElements.get("pdf-selector") || t$t("pdf-selector")(PdfSelector);
9459
9391
  }
9460
9392
  add(W, X) {
9461
- const re = { id: generateId(), pdfName: W, data: X };
9462
- if (!X.url && !X.b64) {
9393
+ const te = {
9394
+ id: W.id,
9395
+ pdfName: W.name,
9396
+ data: W
9397
+ };
9398
+ if (!W.url && !W.b64) {
9463
9399
  this.notificationService.error(translate$1("pdfManager.missingData"));
9464
9400
  return;
9465
9401
  }
9466
- if (X.url && X.b64) {
9402
+ if (W.url && W.b64) {
9467
9403
  this.notificationService.error(translate$1("pdfManager.duplicatedSource"));
9468
9404
  return;
9469
9405
  }
9470
- this.pdfs.some((oe) => oe.pdfName === re.pdfName) ? this.notificationService.warning(translate$1("pdfManager.alreadyUploaded")) : (this.pdfs.push(re), this.broker.publish(pdfViwerEvents.added, re), setTimeout(() => {
9471
- const oe = `${primariaShellId}::${pdfViewerId}`;
9472
- showNavItemTooltip(oe, translate$1("pdfManager.tooltipMessage"));
9473
- }, 100));
9406
+ return this.pdfs.some((re) => re.id === te.id) ? this.notificationService.warning(translate$1("pdfManager.alreadyUploaded")) : (this.pdfs.push(te), this.broker.publish(pdfViwerEvents.added, te), X?.autoNavigate ? setTimeout(() => {
9407
+ Promise.resolve().then(() => api).then(({ shellApi: re }) => {
9408
+ re.regionManager.activateMainView(pdfViewerId);
9409
+ });
9410
+ }, 150) : setTimeout(() => {
9411
+ const re = `${primariaShellId}::${pdfViewerId}`;
9412
+ showNavItemTooltip(re, translate$1("pdfManager.tooltipMessage"));
9413
+ }, 100)), te;
9474
9414
  }
9475
9415
  delete(W) {
9476
9416
  this.pdfs = this.pdfs.filter((X) => X.id !== W), this.activePdf?.id === W && (this.activePdf = null), this.broker.publish(pdfViwerEvents.deleted, { id: W });
@@ -9723,7 +9663,7 @@ class ImportDataManagerImpl {
9723
9663
  async import(W) {
9724
9664
  this.currentImporterId = W, this.selectedItems = {}, this.pluginTexts = {};
9725
9665
  try {
9726
- const { ImportDataManagerModal: X } = await import("./component-DVZj1pQR.js"), { confirmed: te } = await this.interactionService.confirm(
9666
+ const { ImportDataManagerModal: X } = await import("./component-D-_nJ0GB.js"), { confirmed: te } = await this.interactionService.confirm(
9727
9667
  void 0,
9728
9668
  { component: X },
9729
9669
  {
@@ -9801,7 +9741,12 @@ const createContextManager = () => contextManager$1 || (contextManager$1 = new P
9801
9741
  pdfViewerManager,
9802
9742
  importDataManager
9803
9743
  };
9804
- }, shellApi = primariaApiFactory({ pluginId: primariaShellId }), registerRequest = (J, W) => (X, te) => {
9744
+ }, shellApi = primariaApiFactory({ pluginId: primariaShellId }), api = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9745
+ __proto__: null,
9746
+ PrimariaRegionHost,
9747
+ primariaApiFactory,
9748
+ shellApi
9749
+ }, Symbol.toStringTag, { value: "Module" })), registerRequest$1 = (J, W) => (X, te) => {
9805
9750
  W.bind(te).to(te).inTransientScope(), injectable()(te);
9806
9751
  const re = J.broker.registerRequest(X, (oe) => W.get(te).handle(oe));
9807
9752
  return {
@@ -9809,7 +9754,71 @@ const createContextManager = () => contextManager$1 || (contextManager$1 = new P
9809
9754
  W.isBound(te) && W.unbind(te), re.dispose();
9810
9755
  }
9811
9756
  };
9812
- }, TYPES = {
9757
+ }, registerRequest = (J, W) => (X, te) => {
9758
+ W.bind(te).to(te).inTransientScope(), injectable()(te);
9759
+ const re = J.broker.registerRequest(X, (oe) => W.get(te).handle(oe));
9760
+ return {
9761
+ dispose: () => {
9762
+ W.isBound(te) && W.unbind(te), re.dispose();
9763
+ }
9764
+ };
9765
+ }, brokerExtensions = (J, W) => ({
9766
+ registerRequest: registerRequest(J, W)
9767
+ }), generateId = () => {
9768
+ try {
9769
+ if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
9770
+ return crypto.randomUUID();
9771
+ } catch {
9772
+ console.warn("crypto.randomUUID() failed, using fallback");
9773
+ }
9774
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (J) => {
9775
+ const W = Math.random() * 16 | 0;
9776
+ return (J === "x" ? W : W & 3 | 8).toString(16);
9777
+ });
9778
+ }, mapArrayToLabelValue = (J, W, X) => J.map((te) => {
9779
+ const re = te[W], oe = te[X];
9780
+ return (re === "" || re == null) && typeof oe == "string" && oe.trim() !== "" ? {
9781
+ label: oe,
9782
+ value: oe
9783
+ } : (re === "" || re == null) && (oe === "" || oe == null) ? null : {
9784
+ label: re,
9785
+ value: oe
9786
+ };
9787
+ }).filter((te) => te !== null);
9788
+ function createConnectToStoreDecorator(J) {
9789
+ return function(X) {
9790
+ return (te, re) => {
9791
+ Object.defineProperty(te, re, {
9792
+ get() {
9793
+ return this[`__${re}`];
9794
+ },
9795
+ set(de) {
9796
+ this[`__${re}`] !== de && (this[`__${re}`] = Array.isArray(de) ? [...de] : typeof de == "object" && de !== null ? { ...de } : de, this.requestUpdate(re));
9797
+ },
9798
+ configurable: !0,
9799
+ enumerable: !0
9800
+ });
9801
+ const oe = te.connectedCallback, ne = te.disconnectedCallback;
9802
+ te.connectedCallback = function() {
9803
+ oe && oe.call(this), this[re] = X(J.getState()), this[`__unsubscribe__${re}`] = J.subscribe(() => {
9804
+ const de = X(J.getState());
9805
+ this[re] = Array.isArray(de) ? [...de] : typeof de == "object" && de !== null ? { ...de } : de;
9806
+ });
9807
+ }, te.disconnectedCallback = function() {
9808
+ ne && ne.call(this), this[`__unsubscribe__${re}`] && this[`__unsubscribe__${re}`]();
9809
+ };
9810
+ };
9811
+ };
9812
+ }
9813
+ function createConnectedProperty(J) {
9814
+ return (W, X = {}) => {
9815
+ const te = createConnectToStoreDecorator(J);
9816
+ return (re, oe) => {
9817
+ n$B(X)(re, oe), te(W)(re, oe);
9818
+ };
9819
+ };
9820
+ }
9821
+ const TYPES = {
9813
9822
  primaryApi: Symbol.for("primaryApi"),
9814
9823
  store: Symbol.for("store")
9815
9824
  };
@@ -11793,6 +11802,26 @@ class CustomFilterSpec extends Spec {
11793
11802
  return W.type === X.id;
11794
11803
  }
11795
11804
  }
11805
+ class DiagnosticCodeSpec extends Spec {
11806
+ constructor(W) {
11807
+ super(), this.diagnosticCodes = this.extractAllCodes(W);
11808
+ }
11809
+ extractAllCodes(W) {
11810
+ const X = /* @__PURE__ */ new Set();
11811
+ for (const te of W) {
11812
+ if (te.codi && X.add(te.codi), te.evolucions && Array.isArray(te.evolucions))
11813
+ for (const re of te.evolucions)
11814
+ re.codi && X.add(re.codi);
11815
+ if (te.relacions && Array.isArray(te.relacions))
11816
+ for (const re of te.relacions)
11817
+ re.codi && X.add(re.codi);
11818
+ }
11819
+ return Array.from(X);
11820
+ }
11821
+ isSatisfiedBy(W) {
11822
+ return this.diagnosticCodes?.length ? (W.diagnostics ?? []).some((te) => this.diagnosticCodes.includes(te.codi)) : !0;
11823
+ }
11824
+ }
11796
11825
  const normalizeStringToNFD = (J) => J == null ? "" : String(J).normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLocaleLowerCase(), propContainsString = (J, W) => {
11797
11826
  const X = normalizeStringToNFD(J), te = normalizeStringToNFD(W);
11798
11827
  return X.toString().toLowerCase().indexOf(te) !== -1 || X.toString().indexOf(te) !== -1;
@@ -11830,6 +11859,17 @@ class ComposedTypeSpec extends Spec {
11830
11859
  return X.length === 0 ? !0 : X.reduce((re, oe) => re.or(new TypeSpec(oe)), new FalseSpec()).isSatisfiedBy(W);
11831
11860
  }
11832
11861
  }
11862
+ class UpFilterSpec extends Spec {
11863
+ constructor(W) {
11864
+ super(), this.upIds = W;
11865
+ }
11866
+ isSatisfiedBy(W) {
11867
+ if (!this.upIds?.length)
11868
+ return !0;
11869
+ const X = W.up ?? null;
11870
+ return this.upIds.some((te) => X.id === te);
11871
+ }
11872
+ }
11833
11873
  const activityHistoryFiltersSelector = (J) => J.activityHistoryFilters.filters, activityHistoryCommonFiltersSelector = createSelector(
11834
11874
  activityHistoryFiltersSelector,
11835
11875
  (J) => J.find(isCommonFilterGroup)?.filters || []
@@ -11858,7 +11898,22 @@ createSelector(
11858
11898
  filters: oe.filter((ne) => ne.enabledValues?.length)
11859
11899
  })).filter((W) => W.filters.length > 0)
11860
11900
  );
11861
- const areSameDiagnostics = (J, W) => {
11901
+ const diagnosticFilterSelector = createSelector(
11902
+ activityHistoryFiltersSelector,
11903
+ (J) => J.find(isDiagnosticFilter)
11904
+ ), diagnosticFilterEnabledValuesSelector = createSelector(
11905
+ diagnosticFilterSelector,
11906
+ (J) => J?.enabledValues || []
11907
+ ), areDiagnosticFiltersActive = createSelector(
11908
+ diagnosticFilterEnabledValuesSelector,
11909
+ (J) => !!J.length
11910
+ ), upFilterSelector = createSelector(
11911
+ activityHistoryFiltersSelector,
11912
+ (J) => J.find(isUpFilter)
11913
+ ), upFilterEnabledValuesSelector = createSelector(
11914
+ upFilterSelector,
11915
+ (J) => J?.enabledValues || []
11916
+ ), areUpFiltersActive = createSelector(upFilterEnabledValuesSelector, (J) => !!J.length), areSameDiagnostics = (J, W) => {
11862
11917
  if (J.length !== W.length)
11863
11918
  return !1;
11864
11919
  const X = J.map((re) => re.codi).sort(), te = W.map((re) => re.codi).sort();
@@ -11897,35 +11952,52 @@ const groupActivityHistoryItems = (J) => {
11897
11952
  if (!J?.length) return [];
11898
11953
  dateStringCache.clear(), dateObjectCache.clear();
11899
11954
  const W = [...J].sort(
11900
- (te, re) => getDateObject(re.date).getTime() - getDateObject(te.date).getTime()
11901
- ), X = [];
11902
- for (const te of W) {
11903
- const re = createVisitKey(te);
11904
- let oe = !1;
11905
- for (const ne of X) {
11906
- if (ne.items.length === 0) continue;
11907
- const de = createVisitKey(ne.items[0]);
11908
- if (de === re) {
11909
- const ce = ne.items[0], ue = ne.items[ne.items.length - 1];
11910
- if (ce && ue && withinEightHours(ce.date, te.date) && withinEightHours(ue.date, te.date) && !X.some((pe) => pe.items.length === 0 || createVisitKey(pe.items[0]) === de ? !1 : pe.items.some((be) => {
11911
- const me = getDateObject(te.date).getTime(), ge = getDateObject(be.date).getTime(), ve = getDateObject(ue.date).getTime(), _e = getDateObject(ce.date).getTime(), we = Math.min(ve, me), Se = Math.max(_e, me);
11912
- return ge > we && ge < Se;
11913
- }))) {
11914
- ne.items.push(te), ne.items.sort((pe, fe) => getDateObject(fe.date).getTime() - getDateObject(pe.date).getTime()), oe = !0;
11955
+ (re, oe) => getDateObject(oe.date).getTime() - getDateObject(re.date).getTime()
11956
+ ), X = /* @__PURE__ */ new Map(), te = [];
11957
+ for (const re of W) {
11958
+ const oe = createVisitKey(re), ne = getDateObject(re.date).getTime();
11959
+ let de = !1;
11960
+ const ce = X.get(oe) || [];
11961
+ for (const ue of ce) {
11962
+ const he = ue.items[0], pe = ue.items[ue.items.length - 1];
11963
+ if (withinEightHours(he.date, re.date) && withinEightHours(pe.date, re.date)) {
11964
+ const fe = getDateObject(pe.date).getTime(), be = getDateObject(he.date).getTime(), me = Math.min(fe, ne), ge = Math.max(be, ne);
11965
+ let ve = !1;
11966
+ for (const [_e, we] of X)
11967
+ if (_e !== oe) {
11968
+ for (const Se of we) {
11969
+ for (const ye of Se.items) {
11970
+ const Ce = getDateObject(ye.date).getTime();
11971
+ if (Ce > me && Ce < ge) {
11972
+ ve = !0;
11973
+ break;
11974
+ }
11975
+ }
11976
+ if (ve) break;
11977
+ }
11978
+ if (ve) break;
11979
+ }
11980
+ if (!ve) {
11981
+ ue.items.push(re), de = !0;
11915
11982
  break;
11916
11983
  }
11917
11984
  }
11918
11985
  }
11919
- oe || X.push({
11920
- idGroup: Math.random().toString(36).substring(2, 11),
11921
- items: [te],
11922
- subGroups: []
11923
- });
11986
+ if (!de) {
11987
+ const ue = {
11988
+ idGroup: Math.random().toString(36).substring(2, 11),
11989
+ items: [re],
11990
+ subGroups: []
11991
+ };
11992
+ te.push(ue);
11993
+ const he = X.get(oe);
11994
+ he ? he.push(ue) : X.set(oe, [ue]);
11995
+ }
11924
11996
  }
11925
- return X.sort((te, re) => {
11926
- const oe = te.items[0], ne = re.items[0];
11927
- return !oe || !ne ? 0 : getDateObject(ne.date).getTime() - getDateObject(oe.date).getTime();
11928
- }), groupByValidDiagnostics(X), X;
11997
+ return te.sort((re, oe) => {
11998
+ const ne = re.items[0], de = oe.items[0];
11999
+ return !ne || !de ? 0 : getDateObject(de.date).getTime() - getDateObject(ne.date).getTime();
12000
+ }), groupByValidDiagnostics(te), te;
11929
12001
  }, sortGroupsByMostRecentDate = (J) => {
11930
12002
  const W = (oe) => oe.reduce((ne, de) => {
11931
12003
  const ce = new Date(de.date);
@@ -11943,55 +12015,7 @@ const groupActivityHistoryItems = (J) => {
11943
12015
  }), J.sort(
11944
12016
  (oe, ne) => re(ne).getTime() - re(oe).getTime()
11945
12017
  );
11946
- }, activityHistorySearchStringSelector = (J) => J.activityHistoryFilters.searchString, diagnosticFilterSelector = createSelector(
11947
- activityHistoryFiltersSelector,
11948
- (J) => J.find(isDiagnosticFilter)
11949
- ), diagnosticFilterEnabledValuesSelector = createSelector(
11950
- diagnosticFilterSelector,
11951
- (J) => J?.enabledValues || []
11952
- ), areDiagnosticFiltersActive = createSelector(
11953
- diagnosticFilterEnabledValuesSelector,
11954
- (J) => !!J.length
11955
- );
11956
- class DiagnosticCodeSpec extends Spec {
11957
- constructor(W) {
11958
- super(), this.diagnosticCodes = this.extractAllCodes(W);
11959
- }
11960
- extractAllCodes(W) {
11961
- const X = /* @__PURE__ */ new Set();
11962
- for (const te of W) {
11963
- if (te.codi && X.add(te.codi), te.evolucions && Array.isArray(te.evolucions))
11964
- for (const re of te.evolucions)
11965
- re.codi && X.add(re.codi);
11966
- if (te.relacions && Array.isArray(te.relacions))
11967
- for (const re of te.relacions)
11968
- re.codi && X.add(re.codi);
11969
- }
11970
- return Array.from(X);
11971
- }
11972
- isSatisfiedBy(W) {
11973
- return this.diagnosticCodes?.length ? (W.diagnostics ?? []).some((te) => this.diagnosticCodes.includes(te.codi)) : !0;
11974
- }
11975
- }
11976
- const upFilterSelector = createSelector(
11977
- activityHistoryFiltersSelector,
11978
- (J) => J.find(isUpFilter)
11979
- ), upFilterEnabledValuesSelector = createSelector(
11980
- upFilterSelector,
11981
- (J) => J?.enabledValues || []
11982
- ), areUpFiltersActive = createSelector(upFilterEnabledValuesSelector, (J) => !!J.length);
11983
- class UpFilterSpec extends Spec {
11984
- constructor(W) {
11985
- super(), this.upIds = W;
11986
- }
11987
- isSatisfiedBy(W) {
11988
- if (!this.upIds?.length)
11989
- return !0;
11990
- const X = W.up ?? null;
11991
- return this.upIds.some((te) => X.id === te);
11992
- }
11993
- }
11994
- const activityHistoryCollectionsSelector = (J) => J.activityHistoryCollections.collections, mapItemsWithMetadata = (J, W, X, te) => J.map(
12018
+ }, activityHistorySearchStringSelector = (J) => J.activityHistoryFilters.searchString, activityHistoryCollectionsSelector = (J) => J.activityHistoryCollections.collections, mapItemsWithMetadata = (J, W, X, te) => J.map(
11995
12019
  (re) => ({
11996
12020
  ...re,
11997
12021
  searchPredicate: te,
@@ -12001,19 +12025,25 @@ const activityHistoryCollectionsSelector = (J) => J.activityHistoryCollections.c
12001
12025
  ), activityHistoryMappedItems = createSelector(
12002
12026
  activityHistoryCollectionsSelector,
12003
12027
  (J) => Object.values(J).flatMap((W) => mapItemsWithMetadata(W.items, W.componentFactory, W.id, W.searchPredicate))
12004
- ), customFilterGroupsWithOptionsSelector = createSelector(
12028
+ );
12029
+ createSelector(
12030
+ activityHistoryCustomFilterGroupsSelector,
12031
+ activityHistoryCollectionsSelector,
12032
+ (J, W) => J.filter((X) => {
12033
+ const te = W[X.id];
12034
+ return te?.items && te.items.length > 0;
12035
+ })
12036
+ );
12037
+ const customFilterGroupsWithOptionsSelector = createSelector(
12005
12038
  activityHistoryCustomFilterGroupsSelector,
12006
12039
  activityHistoryCollectionsSelector,
12007
- (J, W) => J.filter((re) => {
12008
- const oe = W[re.id];
12009
- return oe?.items && oe.items.length > 0;
12010
- }).map((re) => {
12011
- const oe = W[re.id];
12040
+ (J, W) => J.map((te) => {
12041
+ const re = W[te.id];
12012
12042
  return {
12013
- ...re,
12014
- filters: re.filters.map((ne) => ({
12015
- ...ne,
12016
- options: (ne.singleOption ? [] : oe?.items && getUniqueObjects(oe.items, ne.propPathValue, ne.propsPathDescription, ne.title)) || []
12043
+ ...te,
12044
+ filters: te.filters.map((oe) => ({
12045
+ ...oe,
12046
+ options: (oe.singleOption ? [] : re?.items && getUniqueObjects(re.items, oe.propPathValue, oe.propsPathDescription, oe.title)) || []
12017
12047
  }))
12018
12048
  };
12019
12049
  })
@@ -12025,10 +12055,8 @@ const activityHistoryCollectionsSelector = (J) => J.activityHistoryCollections.c
12025
12055
  diagnosticFilterEnabledValuesSelector,
12026
12056
  upFilterEnabledValuesSelector,
12027
12057
  (J, W, X, te, re, oe) => {
12028
- const ne = J.filter(
12029
- (ue) => new SearchStringSpec(W, ue.searchPredicate).and(new CommonFilterSpec(X)).and(new ComposedTypeSpec(te)).and(new CustomFilterSpec(te)).and(new DiagnosticCodeSpec(re)).and(new UpFilterSpec(oe)).isSatisfiedBy(ue)
12030
- ), de = groupActivityHistoryItems(ne);
12031
- return sortGroupsByMostRecentDate(de);
12058
+ const ne = new CommonFilterSpec(X), de = new ComposedTypeSpec(te), ce = new CustomFilterSpec(te), ue = new DiagnosticCodeSpec(re), he = new UpFilterSpec(oe), pe = J.filter((me) => new SearchStringSpec(W, me.searchPredicate).and(ne).and(de).and(ce).and(ue).and(he).isSatisfiedBy(me)), fe = groupActivityHistoryItems(pe);
12059
+ return sortGroupsByMostRecentDate(fe);
12032
12060
  }
12033
12061
  );
12034
12062
  class SetCommonFilter {
@@ -15386,14 +15414,21 @@ class VirtualScroller {
15386
15414
  this._updateVisibleRange(), (Math.abs(oe.start - this._visibleRange.start) > 0 || Math.abs(oe.end - this._visibleRange.end) > 0) && te(this.getState());
15387
15415
  };
15388
15416
  return W.addEventListener("scroll", re), this._resizeObserver = new ResizeObserver(() => {
15389
- this._viewportHeight = W.clientHeight, this._updateVisibleRange(), te(this.getState());
15417
+ const oe = W.clientHeight;
15418
+ oe > 0 && (this._viewportHeight = oe, this._updateVisibleRange(), te(this.getState()));
15390
15419
  }), this._resizeObserver.observe(W), () => {
15391
15420
  W.removeEventListener("scroll", re), this._resizeObserver?.disconnect(), this._scrollTimeout && clearTimeout(this._scrollTimeout);
15392
15421
  };
15393
15422
  }
15394
15423
  // Update items (when data changes)
15395
- updateItems(W) {
15396
- this._options.items = W, this._initializeHeights(), this._content && (this._content.style.height = this._totalHeight + "px"), this._updateVisibleRange();
15424
+ updateItems(W, X) {
15425
+ this._options.items.length;
15426
+ const te = W.length > 0;
15427
+ this._options.items = W, this._initializeHeights(), this._content && (this._content.style.height = this._totalHeight + "px"), this._updateVisibleRange(), te && this._viewport && requestAnimationFrame(() => {
15428
+ if (!this._viewport) return;
15429
+ const re = this._viewport.clientHeight;
15430
+ re > 0 && re !== this._viewportHeight && (this._viewportHeight = re, this._updateVisibleRange(), X && X(this.getState()));
15431
+ });
15397
15432
  }
15398
15433
  // Measure actual heights of rendered items
15399
15434
  _measureActualHeights() {
@@ -15416,7 +15451,8 @@ class VirtualScroller {
15416
15451
  }
15417
15452
  // Calculate visible range based on scroll position
15418
15453
  _updateVisibleRange() {
15419
- if (!this._options.items.length || this._viewportHeight === 0) return;
15454
+ if (!this._options.items.length || this._viewportHeight === 0)
15455
+ return;
15420
15456
  const W = Math.floor(this._viewportHeight * (this._options.bufferSize / 100)), X = Math.max(0, this._scrollTop - W), te = this._scrollTop + this._viewportHeight + W;
15421
15457
  let re = 0, oe = this._options.items.length - 1;
15422
15458
  for (let ne = 0; ne < this._options.items.length; ne++)
@@ -15491,7 +15527,7 @@ let ActivityHistoryTimeline = class extends h$p {
15491
15527
  super.disconnectedCallback(), this._cleanupVirtualScroller?.(), this._noDataMessageTimer && clearTimeout(this._noDataMessageTimer);
15492
15528
  }
15493
15529
  async updated(J) {
15494
- J.has("historyGroups") && this.historyGroups?.length && (await this.prepareComponents(this.historyGroups), this._updateVirtualScroller()), this._viewport && this._content && !this._virtualScroller && setTimeout(() => this._setupVirtualScroller(), 0);
15530
+ J.has("historyGroups") && this.historyGroups?.length && (await this.prepareComponents(this.historyGroups), this._updateVirtualScroller()), this._viewport && this._content && !this._virtualScroller && setTimeout(() => this._setupVirtualScroller(), 0), this._viewport && this._virtualScroller && this._viewport !== this._lastViewportElement && (this._cleanupVirtualScroller?.(), this._virtualScroller = void 0, setTimeout(() => this._setupVirtualScroller(), 0)), this._viewport && (this._lastViewportElement = this._viewport);
15495
15531
  }
15496
15532
  async prepareComponents(J) {
15497
15533
  for (const W of J) {
@@ -15543,7 +15579,9 @@ let ActivityHistoryTimeline = class extends h$p {
15543
15579
  }), this._virtualScrollerState = this._virtualScroller.getState());
15544
15580
  }
15545
15581
  _updateVirtualScroller() {
15546
- !this._virtualScroller || !this.historyGroups?.length || (this._virtualScroller.updateItems(this.historyGroups), this._virtualScrollerState = this._virtualScroller.getState());
15582
+ !this._virtualScroller || !this.historyGroups?.length || (this._virtualScroller.updateItems(this.historyGroups, (J) => {
15583
+ this._virtualScrollerState = J, this.requestUpdate();
15584
+ }), this._virtualScrollerState = this._virtualScroller.getState());
15547
15585
  }
15548
15586
  // Getters for template (maintaining original API)
15549
15587
  get _visibleItems() {
@@ -16246,7 +16284,7 @@ class ExitShell {
16246
16284
  }
16247
16285
  let request$3;
16248
16286
  const useExitShell = (J) => {
16249
- disposeExitShell(), request$3 = registerRequest(J, container$1)(ExitShell, ExitShellHandler);
16287
+ disposeExitShell(), request$3 = registerRequest$1(J, container$1)(ExitShell, ExitShellHandler);
16250
16288
  }, disposeExitShell = () => {
16251
16289
  request$3?.dispose();
16252
16290
  };
@@ -16312,7 +16350,7 @@ class GetUserInfo {
16312
16350
  }
16313
16351
  let request$2;
16314
16352
  const useGetUserInfo = (J) => {
16315
- disposeGetUserInfo(), request$2 = registerRequest(J, container$1)(GetUserInfo, GetUserInfoHandler), registerDep(GetUserInfoBackendAdapter);
16353
+ disposeGetUserInfo(), request$2 = registerRequest$1(J, container$1)(GetUserInfo, GetUserInfoHandler), registerDep(GetUserInfoBackendAdapter);
16316
16354
  }, disposeGetUserInfo = () => {
16317
16355
  request$2?.dispose(), unregisterDep(GetUserInfoBackendAdapter);
16318
16356
  };
@@ -16345,7 +16383,7 @@ class GetVisitId {
16345
16383
  }
16346
16384
  let request$1;
16347
16385
  const useGetVisitId = (J) => {
16348
- disposeGetVisitId(), request$1 = registerRequest(J, container$1)(GetVisitId, GetVisitIdHandler);
16386
+ disposeGetVisitId(), request$1 = registerRequest$1(J, container$1)(GetVisitId, GetVisitIdHandler);
16349
16387
  }, disposeGetVisitId = () => {
16350
16388
  request$1?.dispose();
16351
16389
  };
@@ -16373,8 +16411,8 @@ FinalizeVisitHandler = __decorateClass$e([
16373
16411
  class FinalizeVisit {
16374
16412
  }
16375
16413
  const template$b = (J) => ke$1`
16376
- ${J.visitId ? ke$1`<dss-button @click=${J.finalizeVisitHandler} variant="subtle" size="md" icon="door_front" label=${translate$1("actions.finalizeVisit")}></dss-button>` : D$7}
16377
- `;
16414
+ <dss-button @click=${J.finalizeVisitHandler} variant="subtle" size="md" icon="door_front" label=${translate$1("actions.finalizeVisit")}></dss-button>
16415
+ `;
16378
16416
  class FinalizeVisitButton extends h$p {
16379
16417
  render() {
16380
16418
  return ke$1`${template$b(this)}`;
@@ -16389,7 +16427,7 @@ const useFinalizeVisit = (J) => {
16389
16427
  id: "finalize-visit-button",
16390
16428
  sortHint: "0001",
16391
16429
  factory: () => Promise.resolve(new FinalizeVisitButton())
16392
- }), request = registerRequest(J, container$1)(FinalizeVisit, FinalizeVisitHandler));
16430
+ }), request = registerRequest$1(J, container$1)(FinalizeVisit, FinalizeVisitHandler));
16393
16431
  }, disposeFinalizeVisit = () => {
16394
16432
  request?.dispose();
16395
16433
  }, useFeatures = (J) => {
@@ -40233,8 +40271,12 @@ const Ws = class Ws extends h$p {
40233
40271
  </div>
40234
40272
 
40235
40273
  <form>
40274
+ <label for="pdfId">PDF ID</label>
40275
+ <input type="text" id="pdfId" name="pdfId" placeholder="unique-id">
40236
40276
  <label for="pdfName">PDF Name</label>
40237
40277
  <input type="text" id="pdfName" name="pdfName" placeholder="pdfName">
40278
+ <label for="pdfDate">PDF Date</label>
40279
+ <input type="text" id="pdfDate" name="pdfDate" placeholder="2024-01-15">
40238
40280
  <label for="url">URL</label>
40239
40281
  <input type="text" id="url" name="url" placeholder="url">
40240
40282
 
@@ -40247,8 +40289,8 @@ const Ws = class Ws extends h$p {
40247
40289
  `;
40248
40290
  }
40249
40291
  sendPdfToViewer() {
40250
- const W = this.shadowRoot?.getElementById("pdfName")?.value, te = { url: this.shadowRoot?.getElementById("url")?.value };
40251
- shellApi.pdfViewerManager.add(W, te);
40292
+ const W = this.shadowRoot?.getElementById("pdfId")?.value, X = this.shadowRoot?.getElementById("pdfName")?.value, te = this.shadowRoot?.getElementById("pdfDate")?.value, re = this.shadowRoot?.getElementById("url")?.value;
40293
+ shellApi.pdfViewerManager.add({ id: W, name: X, date: te, url: re });
40252
40294
  }
40253
40295
  getPDFS() {
40254
40296
  return shellApi.pdfViewerManager.getPdfs();
@@ -40324,7 +40366,7 @@ const template$6 = (J) => ke$1`
40324
40366
  </dss-action-menu>
40325
40367
  ${J.showText ? ke$1`<dss-icon icon="chevron_right" size="md"></dss-icon>` : D$7}
40326
40368
  </div>
40327
- `, styles$6 = ".item{display:flex;cursor:pointer;border-radius:8px;padding:8px;justify-content:center;transition:background-color .3s ease}.item[expanded]{justify-content:space-between}.item:hover{background-color:var(--color-primary-900);color:#fff}.item .icon-label{display:flex;gap:8px;transition:background-color .3s}.item.active{outline:2px solid white;outline-offset:-2px}";
40369
+ `, styles$6 = ".item{display:flex;cursor:pointer;border-radius:8px;padding:8px;justify-content:center;transition:background-color .3s ease}.item[expanded]{justify-content:space-between}.item:hover{background-color:var(--color-primary-900);color:#fff}.item .icon-label{display:flex;gap:8px;transition:background-color .3s}.item.active{outline:2px solid white;outline-offset:-2px}dss-tooltip{pointer-events:none}";
40328
40370
  var __defProp$8 = Object.defineProperty, __decorateClass$8 = (J, W, X, te) => {
40329
40371
  for (var re = void 0, oe = J.length - 1, ne; oe >= 0; oe--)
40330
40372
  (ne = J[oe]) && (re = ne(W, X, re) || re);
@@ -40380,7 +40422,7 @@ const template$5 = (J) => ke$1`
40380
40422
  </dss-action-menu>
40381
40423
  ${J.showText ? ke$1`<dss-icon icon="chevron_right" size="md"></dss-icon>` : D$7}
40382
40424
  </div>
40383
- `, styles$5 = ".item{display:flex;cursor:pointer;border-radius:8px;padding:8px;justify-content:center;transition:background-color .3s ease}.item[expanded]{justify-content:space-between}.item:hover{background-color:var(--color-primary-900);color:#fff}.item .icon-label{display:flex;gap:8px;transition:background-color .3s}.item.active{outline:2px solid white;outline-offset:-2px}";
40425
+ `, styles$5 = ".item{display:flex;cursor:pointer;border-radius:8px;padding:8px;justify-content:center;transition:background-color .3s ease}.item[expanded]{justify-content:space-between}.item:hover{background-color:var(--color-primary-900);color:#fff}.item .icon-label{display:flex;gap:8px;transition:background-color .3s}.item.active{outline:2px solid white;outline-offset:-2px}dss-tooltip{pointer-events:none}";
40384
40426
  var __defProp$7 = Object.defineProperty, __decorateClass$7 = (J, W, X, te) => {
40385
40427
  for (var re = void 0, oe = J.length - 1, ne; oe >= 0; oe--)
40386
40428
  (ne = J[oe]) && (re = ne(W, X, re) || re);
@@ -40506,13 +40548,12 @@ __decorateClass$6([
40506
40548
  __decorateClass$6([
40507
40549
  n$B()
40508
40550
  ], PrimariaContentSwitcher.prototype, "animation");
40509
- const styles$3 = ".item{display:flex;cursor:pointer;border-radius:8px;padding:8px;justify-content:center;transition:background-color .3s ease}.item[expanded]{justify-content:space-between}.item:hover{background-color:var(--color-primary-900);color:#fff}.item .icon-label{display:flex;gap:8px;transition:background-color .3s}.item.active{outline:2px solid white;outline-offset:-2px}", template$3 = (J) => ke$1`
40510
- <div
40511
- class=${Rt({ item: !0, active: J.isActive })}
40512
- @click=${J.config.callbackFn}
40551
+ const styles$3 = ".item{display:flex;cursor:pointer;border-radius:8px;padding:8px;justify-content:center;transition:background-color .3s ease}.item[expanded]{justify-content:space-between}.item:hover{background-color:var(--color-primary-900);color:#fff}.item .icon-label{display:flex;gap:8px;transition:background-color .3s}.item.active{outline:2px solid white;outline-offset:-2px}dss-tooltip{pointer-events:none}", template$3 = (J) => ke$1`
40552
+ <div
40553
+ class=${Rt({ item: !0, active: J.isActive })}
40513
40554
  ?expanded=${J.showText}
40514
40555
  >
40515
- <div class="icon-label">
40556
+ <div class="icon-label" @click=${J.config.callbackFn}>
40516
40557
  <dss-icon icon=${J.config.icon} size="md" ?fill=${J.config.fill} style=${J.config.rotateIcon ? "transform: rotate(180deg);" : ""}></dss-icon>
40517
40558
  ${J.showText ? ke$1`<span>${J.config.label}</span>` : ""}
40518
40559
  </div>
@@ -40583,40 +40624,40 @@ const styles$2 = ".wrapper{display:flex;flex-direction:column;gap:8px}.menu-acti
40583
40624
  <div class="wrapper">
40584
40625
  <primaria-nav-item
40585
40626
  .config=${J.primariaNavItemConfig}
40586
- @click=${J.handleItemClick}
40587
40627
  class="${Rt({ "menu-active": J.showActionMenu })}"
40588
40628
  ></primaria-nav-item>
40589
- ${J.showActionMenu ? ke$1`
40590
- <dss-action-menu @onCloseActionMenu=${J.handleCloseMenu}>
40591
- ${J.config.actionMenuItems?.map(
40629
+ <dss-action-menu
40630
+ @onCloseActionMenu=${J.handleCloseMenu}
40631
+ ?hidden=${!J.showActionMenu}
40632
+ >
40633
+ ${J.config.actionMenuItems?.map(
40592
40634
  (W) => W.hasNestedMenu ? ke$1`
40593
- <dss-action-menu-item
40594
- righticon=${W.icon}
40595
- .label=${W.label}
40596
- hasnestedmenu
40597
- >
40598
- <dss-action-menu>
40599
- ${W.nestedMenuItems?.map(
40635
+ <dss-action-menu-item
40636
+ righticon=${W.icon}
40637
+ .label=${W.label}
40638
+ hasnestedmenu
40639
+ >
40640
+ <dss-action-menu>
40641
+ ${W.nestedMenuItems?.map(
40600
40642
  (X) => ke$1`
40601
- <dss-action-menu-item
40602
- righticon=${X.icon}
40603
- .label=${X.label}
40604
- @click=${X.callbackFn}
40605
- ></dss-action-menu-item>
40606
- `
40643
+ <dss-action-menu-item
40644
+ righticon=${X.icon}
40645
+ .label=${X.label}
40646
+ @click=${X.callbackFn}
40647
+ ></dss-action-menu-item>
40648
+ `
40607
40649
  )}
40608
- </dss-action-menu>
40609
- </dss-action-menu-item>
40610
- ` : ke$1`
40611
- <dss-action-menu-item
40612
- righticon=${W.icon}
40613
- .label=${W.label}
40614
- @click=${W.callbackFn}
40615
- ></dss-action-menu-item>
40616
- `
40650
+ </dss-action-menu>
40651
+ </dss-action-menu-item>
40652
+ ` : ke$1`
40653
+ <dss-action-menu-item
40654
+ righticon=${W.icon}
40655
+ .label=${W.label}
40656
+ @click=${W.callbackFn}
40657
+ ></dss-action-menu-item>
40658
+ `
40617
40659
  )}
40618
- </dss-action-menu>
40619
- ` : D$7}
40660
+ </dss-action-menu>
40620
40661
  </div>
40621
40662
  `;
40622
40663
  var __defProp$4 = Object.defineProperty, __decorateClass$4 = (J, W, X, te) => {
@@ -40627,12 +40668,15 @@ var __defProp$4 = Object.defineProperty, __decorateClass$4 = (J, W, X, te) => {
40627
40668
  const Xs = class Xs extends h$p {
40628
40669
  constructor(W) {
40629
40670
  super(), this.showActionMenu = !1, this.handleItemClick = () => {
40630
- this.showActionMenu = !0, this.requestUpdate();
40671
+ this.showActionMenu = !0;
40631
40672
  }, this.handleCloseMenu = () => {
40632
40673
  this.showActionMenu = !1;
40633
- }, this.config = W, this.primariaNavItemConfig = {
40634
- icon: W.icon,
40635
- label: W.label,
40674
+ }, this.config = W;
40675
+ }
40676
+ get primariaNavItemConfig() {
40677
+ return {
40678
+ icon: this.config.icon,
40679
+ label: this.config.label,
40636
40680
  showArrow: !0,
40637
40681
  callbackFn: this.handleItemClick
40638
40682
  };
@@ -40648,9 +40692,6 @@ let PrimariaNavTreeMenu = Xs;
40648
40692
  __decorateClass$4([
40649
40693
  n$B({ type: Object })
40650
40694
  ], PrimariaNavTreeMenu.prototype, "config");
40651
- __decorateClass$4([
40652
- r$I()
40653
- ], PrimariaNavTreeMenu.prototype, "primariaNavItemConfig");
40654
40695
  __decorateClass$4([
40655
40696
  r$I()
40656
40697
  ], PrimariaNavTreeMenu.prototype, "showActionMenu");
@@ -49146,4 +49187,4 @@ export {
49146
49187
  l as x,
49147
49188
  PrimariaInteractionService as y
49148
49189
  };
49149
- //# sourceMappingURL=index-CbiH0JOX.js.map
49190
+ //# sourceMappingURL=index-Bij-Dh9n.js.map