@uxland/primary-shell 7.29.12 → 7.29.14

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.
@@ -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-ArjwXoXT.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,20 @@ 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) => {
9750
+ W.bind(te).to(te).inTransientScope(), injectable()(te);
9751
+ const re = J.broker.registerRequest(X, (oe) => W.get(te).handle(oe));
9752
+ return {
9753
+ dispose: () => {
9754
+ W.isBound(te) && W.unbind(te), re.dispose();
9755
+ }
9756
+ };
9757
+ }, registerRequest = (J, W) => (X, te) => {
9805
9758
  W.bind(te).to(te).inTransientScope(), injectable()(te);
9806
9759
  const re = J.broker.registerRequest(X, (oe) => W.get(te).handle(oe));
9807
9760
  return {
@@ -9809,7 +9762,63 @@ const createContextManager = () => contextManager$1 || (contextManager$1 = new P
9809
9762
  W.isBound(te) && W.unbind(te), re.dispose();
9810
9763
  }
9811
9764
  };
9812
- }, TYPES = {
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
  };
@@ -11943,35 +11952,52 @@ const groupActivityHistoryItems = (J) => {
11943
11952
  if (!J?.length) return [];
11944
11953
  dateStringCache.clear(), dateObjectCache.clear();
11945
11954
  const W = [...J].sort(
11946
- (te, re) => getDateObject(re.date).getTime() - getDateObject(te.date).getTime()
11947
- ), X = [];
11948
- for (const te of W) {
11949
- const re = createVisitKey(te);
11950
- let oe = !1;
11951
- for (const ne of X) {
11952
- if (ne.items.length === 0) continue;
11953
- const de = createVisitKey(ne.items[0]);
11954
- if (de === re) {
11955
- const ce = ne.items[0], ue = ne.items[ne.items.length - 1];
11956
- 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) => {
11957
- 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);
11958
- return ge > we && ge < Se;
11959
- }))) {
11960
- 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;
11961
11982
  break;
11962
11983
  }
11963
11984
  }
11964
11985
  }
11965
- oe || X.push({
11966
- idGroup: Math.random().toString(36).substring(2, 11),
11967
- items: [te],
11968
- subGroups: []
11969
- });
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
+ }
11970
11996
  }
11971
- return X.sort((te, re) => {
11972
- const oe = te.items[0], ne = re.items[0];
11973
- return !oe || !ne ? 0 : getDateObject(ne.date).getTime() - getDateObject(oe.date).getTime();
11974
- }), 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;
11975
12001
  }, sortGroupsByMostRecentDate = (J) => {
11976
12002
  const W = (oe) => oe.reduce((ne, de) => {
11977
12003
  const ce = new Date(de.date);
@@ -12029,10 +12055,8 @@ const customFilterGroupsWithOptionsSelector = createSelector(
12029
12055
  diagnosticFilterEnabledValuesSelector,
12030
12056
  upFilterEnabledValuesSelector,
12031
12057
  (J, W, X, te, re, oe) => {
12032
- const ne = J.filter(
12033
- (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)
12034
- ), de = groupActivityHistoryItems(ne);
12035
- 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);
12036
12060
  }
12037
12061
  );
12038
12062
  class SetCommonFilter {
@@ -16260,7 +16284,7 @@ class ExitShell {
16260
16284
  }
16261
16285
  let request$3;
16262
16286
  const useExitShell = (J) => {
16263
- disposeExitShell(), request$3 = registerRequest(J, container$1)(ExitShell, ExitShellHandler);
16287
+ disposeExitShell(), request$3 = registerRequest$1(J, container$1)(ExitShell, ExitShellHandler);
16264
16288
  }, disposeExitShell = () => {
16265
16289
  request$3?.dispose();
16266
16290
  };
@@ -16326,7 +16350,7 @@ class GetUserInfo {
16326
16350
  }
16327
16351
  let request$2;
16328
16352
  const useGetUserInfo = (J) => {
16329
- disposeGetUserInfo(), request$2 = registerRequest(J, container$1)(GetUserInfo, GetUserInfoHandler), registerDep(GetUserInfoBackendAdapter);
16353
+ disposeGetUserInfo(), request$2 = registerRequest$1(J, container$1)(GetUserInfo, GetUserInfoHandler), registerDep(GetUserInfoBackendAdapter);
16330
16354
  }, disposeGetUserInfo = () => {
16331
16355
  request$2?.dispose(), unregisterDep(GetUserInfoBackendAdapter);
16332
16356
  };
@@ -16359,7 +16383,7 @@ class GetVisitId {
16359
16383
  }
16360
16384
  let request$1;
16361
16385
  const useGetVisitId = (J) => {
16362
- disposeGetVisitId(), request$1 = registerRequest(J, container$1)(GetVisitId, GetVisitIdHandler);
16386
+ disposeGetVisitId(), request$1 = registerRequest$1(J, container$1)(GetVisitId, GetVisitIdHandler);
16363
16387
  }, disposeGetVisitId = () => {
16364
16388
  request$1?.dispose();
16365
16389
  };
@@ -16403,7 +16427,7 @@ const useFinalizeVisit = (J) => {
16403
16427
  id: "finalize-visit-button",
16404
16428
  sortHint: "0001",
16405
16429
  factory: () => Promise.resolve(new FinalizeVisitButton())
16406
- }), request = registerRequest(J, container$1)(FinalizeVisit, FinalizeVisitHandler));
16430
+ }), request = registerRequest$1(J, container$1)(FinalizeVisit, FinalizeVisitHandler));
16407
16431
  }, disposeFinalizeVisit = () => {
16408
16432
  request?.dispose();
16409
16433
  }, useFeatures = (J) => {
@@ -40247,8 +40271,12 @@ const Ws = class Ws extends h$p {
40247
40271
  </div>
40248
40272
 
40249
40273
  <form>
40274
+ <label for="pdfId">PDF ID</label>
40275
+ <input type="text" id="pdfId" name="pdfId" placeholder="unique-id">
40250
40276
  <label for="pdfName">PDF Name</label>
40251
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">
40252
40280
  <label for="url">URL</label>
40253
40281
  <input type="text" id="url" name="url" placeholder="url">
40254
40282
 
@@ -40261,8 +40289,8 @@ const Ws = class Ws extends h$p {
40261
40289
  `;
40262
40290
  }
40263
40291
  sendPdfToViewer() {
40264
- const W = this.shadowRoot?.getElementById("pdfName")?.value, te = { url: this.shadowRoot?.getElementById("url")?.value };
40265
- 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 });
40266
40294
  }
40267
40295
  getPDFS() {
40268
40296
  return shellApi.pdfViewerManager.getPdfs();
@@ -49159,4 +49187,4 @@ export {
49159
49187
  l as x,
49160
49188
  PrimariaInteractionService as y
49161
49189
  };
49162
- //# sourceMappingURL=index-CRH7Fdpk.js.map
49190
+ //# sourceMappingURL=index-Bij-Dh9n.js.map