pat-shared-components 1.3.1-beta.33 → 1.3.1-beta.35

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.
@@ -1,22 +1,22 @@
1
- import { defineComponent as T, defineAsyncComponent as A, toRef as f, computed as m, openBlock as o, createElementBlock as _, createBlock as s, Fragment as V, unref as e, createElementVNode as b, createCommentVNode as n, createVNode as l, withCtx as i, renderSlot as y } from "vue";
2
- import I from "../../../Shared/PatientName.vue.mjs";
3
- import D from "../../Shared/ResultReadyV2.vue.mjs";
4
- import P from "../../Shared/RejectedResult.vue.mjs";
5
- import w from "../../Shared/BookAppointment.vue.mjs";
6
- import F from "../../Shared/DoctorNote.vue.mjs";
7
- import j from "../../Shared/DoctorNoteDetail.vue.mjs";
8
- import q from "../../Shared/UpcomingAppointment.vue.mjs";
9
- import z from "../../Shared/CallUsFilledButton.vue.mjs";
10
- import G from "../../Shared/TestResultDetailSkeleton/TestResultDetailSkeleton.vue.mjs";
11
- import H from "../../HealthSummary/HealthSummary.vue.mjs";
12
- import u from "../../Shared/TestResultSection.vue.mjs";
13
- import { useTestResult as J } from "../../../../composables/TestResult.mjs";
14
- import { buildTestResultSurveyContext as S, getSurveySlug as K, isSurveyEnabledForTestResult as L } from "../../../../helpers/SurveyHelper.mjs";
15
- import { useSurveyConfig as M } from "../../../../composables/useSurveyConfig.mjs";
16
- const O = {
1
+ import { defineComponent as V, defineAsyncComponent as A, toRef as _, computed as r, openBlock as o, createElementBlock as y, createBlock as s, Fragment as I, unref as e, createElementVNode as R, createCommentVNode as n, createVNode as l, withCtx as i, renderSlot as v } from "vue";
2
+ import D from "../../../Shared/PatientName.vue.mjs";
3
+ import P from "../../Shared/ResultReadyV2.vue.mjs";
4
+ import w from "../../Shared/RejectedResult.vue.mjs";
5
+ import F from "../../Shared/BookAppointment.vue.mjs";
6
+ import j from "../../Shared/DoctorNote.vue.mjs";
7
+ import q from "../../Shared/DoctorNoteDetail.vue.mjs";
8
+ import z from "../../Shared/UpcomingAppointment.vue.mjs";
9
+ import G from "../../Shared/CallUsFilledButton.vue.mjs";
10
+ import H from "../../Shared/TestResultDetailSkeleton/TestResultDetailSkeleton.vue.mjs";
11
+ import J from "../../HealthSummary/HealthSummary.vue.mjs";
12
+ import a from "../../Shared/TestResultSection.vue.mjs";
13
+ import { useTestResult as K } from "../../../../composables/TestResult.mjs";
14
+ import { buildTestResultSurveyContext as b, getSurveySlug as L, isSurveyEnabledForTestResult as M, isTeledocSurveyEnabled as O } from "../../../../helpers/SurveyHelper.mjs";
15
+ import { useSurveyConfig as Q } from "../../../../composables/useSurveyConfig.mjs";
16
+ const U = {
17
17
  key: 0,
18
18
  class: "consumer-test-result__ready"
19
- }, Q = { class: "psc-px-4" }, mt = /* @__PURE__ */ T({
19
+ }, W = { class: "psc-px-4" }, dt = /* @__PURE__ */ V({
20
20
  __name: "TestResultDetail",
21
21
  props: {
22
22
  testResult: null,
@@ -31,114 +31,119 @@ const O = {
31
31
  "click:appointment-booking"
32
32
  ],
33
33
  setup(k, { emit: d }) {
34
- const t = k, g = A(
34
+ const t = k, S = A(
35
35
  () => import("../../Shared/TakeSurvey.vue2.mjs")
36
- ), { healthSummaryItems: h, hideContent: $, isViewable: C, visible: a } = J({
37
- testResult: f(t, "testResult"),
38
- hidePatientInfo: f(t, "hidePatientInfo"),
39
- hideSummary: f(t, "hideSummary")
40
- }), { surveyConfig: v } = M(), x = m(
41
- () => S(t.testResult, "doctor-note")
42
- ), B = m(
43
- () => K(
36
+ ), { healthSummaryItems: g, hideContent: h, isViewable: $, visible: c } = K({
37
+ testResult: _(t, "testResult"),
38
+ hidePatientInfo: _(t, "hidePatientInfo"),
39
+ hideSummary: _(t, "hideSummary")
40
+ }), { surveyConfig: p } = Q(), C = r(
41
+ () => b(t.testResult, "doctor-note")
42
+ ), x = r(
43
+ () => L(
44
44
  t.testResult.collection_channel,
45
45
  t.testResult.is_free_consultant,
46
- v.value
46
+ p.value
47
47
  )
48
- ), N = m(
49
- () => S(t.testResult)
50
- ), E = m(
48
+ ), B = r(
49
+ () => b(t.testResult)
50
+ ), T = r(
51
51
  () => !!t.testResult.doctor_note_detail && t.testResult.doctor_note_detail.length > 0
52
- ), R = m(
53
- () => L(
54
- t.testResult.enable_survey,
52
+ ), E = r(
53
+ () => M(
54
+ t.testResult.nps_test_result,
55
55
  t.testResult.collection_channel,
56
56
  t.testResult.is_free_consultant,
57
- v.value
57
+ p.value
58
+ )
59
+ ), N = r(
60
+ () => O(
61
+ t.testResult.nps_doctor_consult,
62
+ p.value
58
63
  )
59
64
  );
60
- return (c, r) => (o(), _("div", null, [
61
- t.loading ? (o(), s(G, { key: 0 })) : (o(), _(V, { key: 1 }, [
62
- e(C) ? (o(), _("div", O, [
63
- b("div", null, [
64
- e(a).patientName ? (o(), s(I, {
65
+ return (m, u) => (o(), y("div", null, [
66
+ t.loading ? (o(), s(H, { key: 0 })) : (o(), y(I, { key: 1 }, [
67
+ e($) ? (o(), y("div", U, [
68
+ R("div", null, [
69
+ e(c).patientName ? (o(), s(D, {
65
70
  key: 0,
66
71
  "first-name": t.testResult.first_name,
67
72
  class: "psc-px-4 psc-pb-2"
68
73
  }, null, 8, ["first-name"])) : n("", !0),
69
- l(D, {
74
+ l(P, {
70
75
  "test-result": t.testResult,
71
76
  timeline: t.timeline,
72
77
  "list-action-event": t.listActionEvent,
73
78
  class: "psc-px-4 psc-pb-4"
74
79
  }, null, 8, ["test-result", "timeline", "list-action-event"]),
75
- e(a).healthSummary ? (o(), s(u, { key: 1 }, {
80
+ e(c).healthSummary ? (o(), s(a, { key: 1 }, {
76
81
  default: i(() => [
77
- l(H, {
78
- items: e(h),
82
+ l(J, {
83
+ items: e(g),
79
84
  "cta-button": t.testResult.is_free_consultant,
80
- "onClick:ctaButton": r[0] || (r[0] = (p) => d("click:book-appointment"))
85
+ "onClick:ctaButton": u[0] || (u[0] = (f) => d("click:book-appointment"))
81
86
  }, null, 8, ["items", "cta-button"])
82
87
  ]),
83
88
  _: 1
84
89
  })) : n("", !0),
85
- e(a).bookAppointment ? (o(), s(u, { key: 2 }, {
90
+ e(c).bookAppointment ? (o(), s(a, { key: 2 }, {
86
91
  default: i(() => [
87
- l(w, {
88
- "onClick:book": r[1] || (r[1] = (p) => d("click:book-appointment"))
92
+ l(F, {
93
+ "onClick:book": u[1] || (u[1] = (f) => d("click:book-appointment"))
89
94
  })
90
95
  ]),
91
96
  _: 1
92
97
  })) : n("", !0),
93
- e(a).doctorNote ? (o(), s(u, { key: 3 }, {
98
+ e(c).doctorNote ? (o(), s(a, { key: 3 }, {
94
99
  default: i(() => [
95
- l(F, {
100
+ l(j, {
96
101
  "doctor-note": t.testResult.doctor_note
97
102
  }, null, 8, ["doctor-note"])
98
103
  ]),
99
104
  _: 1
100
105
  })) : n("", !0),
101
- e(E) ? (o(), s(u, { key: 4 }, {
106
+ e(T) ? (o(), s(a, { key: 4 }, {
102
107
  default: i(() => [
103
- l(j, {
108
+ l(q, {
104
109
  "doctor-note-detail": k.testResult.doctor_note_detail,
105
- "survey-context": e(R) ? e(x) : void 0,
106
- "onClick:appointmentBooking": r[2] || (r[2] = (p) => d("click:appointment-booking", p))
110
+ "survey-context": e(N) ? e(C) : void 0,
111
+ "onClick:appointmentBooking": u[2] || (u[2] = (f) => d("click:appointment-booking", f))
107
112
  }, null, 8, ["doctor-note-detail", "survey-context"])
108
113
  ]),
109
114
  _: 1
110
115
  })) : n("", !0),
111
- e(R) ? (o(), s(u, { key: 5 }, {
116
+ e(E) ? (o(), s(a, { key: 5 }, {
112
117
  default: i(() => [
113
- l(e(g), {
118
+ l(e(S), {
114
119
  variant: "bar",
115
- "survey-slug": e(B),
116
- context: e(N),
117
- text: c.$t("psc.test_result_take_survey_button")
120
+ "survey-slug": e(x),
121
+ context: e(B),
122
+ text: m.$t("psc.test_result_take_survey_button")
118
123
  }, null, 8, ["survey-slug", "context", "text"])
119
124
  ]),
120
125
  _: 1
121
126
  })) : n("", !0),
122
- e(a).upcomingAppointment ? (o(), s(u, { key: 6 }, {
127
+ e(c).upcomingAppointment ? (o(), s(a, { key: 6 }, {
123
128
  default: i(() => [
124
- l(q, {
129
+ l(z, {
125
130
  "time-slot": t.testResult.consult_time
126
131
  }, null, 8, ["time-slot"])
127
132
  ]),
128
133
  _: 1
129
134
  })) : n("", !0)
130
135
  ]),
131
- b("div", Q, [
132
- y(c.$slots, "header"),
133
- e($) ? n("", !0) : y(c.$slots, "default", { key: 0 }),
134
- y(c.$slots, "footer")
136
+ R("div", W, [
137
+ v(m.$slots, "header"),
138
+ e(h) ? n("", !0) : v(m.$slots, "default", { key: 0 }),
139
+ v(m.$slots, "footer")
135
140
  ])
136
- ])) : (o(), s(P, {
141
+ ])) : (o(), s(w, {
137
142
  key: 1,
138
143
  class: "psc-px-4"
139
144
  }, {
140
145
  "body-append": i(() => [
141
- l(z, { class: "psc-mt-6" })
146
+ l(G, { class: "psc-mt-6" })
142
147
  ]),
143
148
  _: 1
144
149
  }))
@@ -147,6 +152,6 @@ const O = {
147
152
  }
148
153
  });
149
154
  export {
150
- mt as default
155
+ dt as default
151
156
  };
152
157
  //# sourceMappingURL=TestResultDetail.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TestResultDetail.vue.mjs","sources":["../../../../../../src/components/TestResult/Mobile/ResultTab/TestResultDetail.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, unref as _unref, createVNode as _createVNode, withCtx as _withCtx, createElementVNode as _createElementVNode, renderSlot as _renderSlot, createElementBlock as _createElementBlock, Fragment as _Fragment } from \"vue\"\n\nconst _hoisted_1 = {\n key: 0,\n class: \"consumer-test-result__ready\"\n}\nconst _hoisted_2 = { class: \"psc-px-4\" }\n\nimport { computed, defineAsyncComponent, toRef } from 'vue';\nimport PatientName from '../../../Shared/PatientName.vue';\nimport ResultReadyV2, {\n type TimelineEvent,\n} from '../../Shared/ResultReadyV2.vue';\nimport RejectedResult from '../../Shared/RejectedResult.vue';\nimport BookAppointment from '../../Shared/BookAppointment.vue';\nimport DoctorNote from '../../Shared/DoctorNote.vue';\nimport DoctorNoteDetail from '../../Shared/DoctorNoteDetail.vue';\nimport type { TestResult } from '@/types';\nimport UpcomingAppointment from '../../Shared/UpcomingAppointment.vue';\nimport CallUsFilledButton from '../../Shared/CallUsFilledButton.vue';\nimport TestResultDetailSkeleton from '../../Shared/TestResultDetailSkeleton/TestResultDetailSkeleton.vue';\nimport HealthSummary from '@/components/TestResult/HealthSummary/HealthSummary.vue';\nimport TestResultSection from '../../Shared/TestResultSection.vue';\nimport { useTestResult } from '@/composables/TestResult';\nimport {\n buildTestResultSurveyContext,\n getSurveySlug,\n isSurveyEnabledForTestResult,\n} from '@/helpers/SurveyHelper';\nimport { useSurveyConfig } from '@/composables/useSurveyConfig';\n\n/**\n * Props\n */\nexport interface Props {\n testResult: TestResult;\n loading: boolean;\n hidePatientInfo?: boolean;\n hideSummary?: boolean;\n timeline?: TimelineEvent[];\n listActionEvent?: Record<string, string>;\n}\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'TestResultDetail',\n props: {\n testResult: null,\n loading: { type: Boolean },\n hidePatientInfo: { type: Boolean, default: false },\n hideSummary: { type: Boolean, default: false },\n timeline: { default: undefined },\n listActionEvent: { default: undefined }\n },\n emits: [\n 'click:book-appointment',\n 'click:appointment-booking',\n],\n setup(__props: any, { emit }) {\n\nconst props = __props as { testResult: TestResult, loading: boolean, hidePatientInfo: boolean, hideSummary: boolean, timeline: TimelineEvent[], listActionEvent: Record<string, string> };\n\n\n\nconst TakeSurvey = defineAsyncComponent(\n () => import('../../Shared/TakeSurvey.vue')\n);\n\n/**\n * Events\n */\n\n\n/**\n * Data\n */\nconst { healthSummaryItems, hideContent, isViewable, visible } = useTestResult({\n testResult: toRef(props, 'testResult'),\n hidePatientInfo: toRef(props, 'hidePatientInfo'),\n hideSummary: toRef(props, 'hideSummary'),\n});\n\nconst { surveyConfig } = useSurveyConfig();\n\nconst doctorNoteSurveyContext = computed(() =>\n buildTestResultSurveyContext(props.testResult, 'doctor-note')\n);\n\nconst testSurveySlug = computed(() =>\n getSurveySlug(\n props.testResult.collection_channel,\n props.testResult.is_free_consultant,\n surveyConfig.value\n )\n);\n\nconst testSurveyContext = computed(() =>\n buildTestResultSurveyContext(props.testResult)\n);\n\nconst hasDoctorNoteDetail = computed(\n () =>\n !!props.testResult.doctor_note_detail &&\n props.testResult.doctor_note_detail.length > 0\n);\n\nconst isSurveyEnabled = computed(() =>\n isSurveyEnabledForTestResult(\n props.testResult.enable_survey,\n props.testResult.collection_channel,\n props.testResult.is_free_consultant,\n surveyConfig.value\n )\n);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", null, [\n (props.loading)\n ? (_openBlock(), _createBlock(TestResultDetailSkeleton, { key: 0 }))\n : (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [\n (_unref(isViewable))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", null, [\n (_unref(visible).patientName)\n ? (_openBlock(), _createBlock(PatientName, {\n key: 0,\n \"first-name\": props.testResult.first_name,\n class: \"psc-px-4 psc-pb-2\"\n }, null, 8, [\"first-name\"]))\n : _createCommentVNode(\"\", true),\n _createVNode(ResultReadyV2, {\n \"test-result\": props.testResult,\n timeline: props.timeline,\n \"list-action-event\": props.listActionEvent,\n class: \"psc-px-4 psc-pb-4\"\n }, null, 8, [\"test-result\", \"timeline\", \"list-action-event\"]),\n (_unref(visible).healthSummary)\n ? (_openBlock(), _createBlock(TestResultSection, { key: 1 }, {\n default: _withCtx(() => [\n _createVNode(HealthSummary, {\n items: _unref(healthSummaryItems),\n \"cta-button\": props.testResult.is_free_consultant,\n \"onClick:ctaButton\": _cache[0] || (_cache[0] = ($event: any) => (emit('click:book-appointment')))\n }, null, 8, [\"items\", \"cta-button\"])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (_unref(visible).bookAppointment)\n ? (_openBlock(), _createBlock(TestResultSection, { key: 2 }, {\n default: _withCtx(() => [\n _createVNode(BookAppointment, {\n \"onClick:book\": _cache[1] || (_cache[1] = ($event: any) => (emit('click:book-appointment')))\n })\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (_unref(visible).doctorNote)\n ? (_openBlock(), _createBlock(TestResultSection, { key: 3 }, {\n default: _withCtx(() => [\n _createVNode(DoctorNote, {\n \"doctor-note\": props.testResult.doctor_note\n }, null, 8, [\"doctor-note\"])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (_unref(hasDoctorNoteDetail))\n ? (_openBlock(), _createBlock(TestResultSection, { key: 4 }, {\n default: _withCtx(() => [\n _createVNode(DoctorNoteDetail, {\n \"doctor-note-detail\": __props.testResult.doctor_note_detail!,\n \"survey-context\": \n _unref(isSurveyEnabled) ? _unref(doctorNoteSurveyContext) : undefined\n ,\n \"onClick:appointmentBooking\": _cache[2] || (_cache[2] = ($event: any) => (\n emit('click:appointment-booking', $event)\n ))\n }, null, 8, [\"doctor-note-detail\", \"survey-context\"])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (_unref(isSurveyEnabled))\n ? (_openBlock(), _createBlock(TestResultSection, { key: 5 }, {\n default: _withCtx(() => [\n _createVNode(_unref(TakeSurvey), {\n variant: \"bar\",\n \"survey-slug\": _unref(testSurveySlug),\n context: _unref(testSurveyContext),\n text: _ctx.$t('psc.test_result_take_survey_button')\n }, null, 8, [\"survey-slug\", \"context\", \"text\"])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (_unref(visible).upcomingAppointment)\n ? (_openBlock(), _createBlock(TestResultSection, { key: 6 }, {\n default: _withCtx(() => [\n _createVNode(UpcomingAppointment, {\n \"time-slot\": props.testResult.consult_time!\n }, null, 8, [\"time-slot\"])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"div\", _hoisted_2, [\n _renderSlot(_ctx.$slots, \"header\"),\n (!_unref(hideContent))\n ? _renderSlot(_ctx.$slots, \"default\", { key: 0 })\n : _createCommentVNode(\"\", true),\n _renderSlot(_ctx.$slots, \"footer\")\n ])\n ]))\n : (_openBlock(), _createBlock(RejectedResult, {\n key: 1,\n class: \"psc-px-4\"\n }, {\n \"body-append\": _withCtx(() => [\n _createVNode(CallUsFilledButton, { class: \"psc-mt-6\" })\n ]),\n _: 1\n }))\n ], 64))\n ]))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_sfc_main","_defineComponent","__props","emit","props","TakeSurvey","defineAsyncComponent","healthSummaryItems","hideContent","isViewable","visible","useTestResult","toRef","surveyConfig","useSurveyConfig","doctorNoteSurveyContext","computed","buildTestResultSurveyContext","testSurveySlug","getSurveySlug","testSurveyContext","hasDoctorNoteDetail","isSurveyEnabled","isSurveyEnabledForTestResult","_ctx","_cache","_openBlock","_createElementBlock","_createBlock","TestResultDetailSkeleton","_Fragment","_unref","_createElementVNode","PatientName","_createCommentVNode","_createVNode","ResultReadyV2","TestResultSection","_withCtx","HealthSummary","$event","BookAppointment","DoctorNote","DoctorNoteDetail","UpcomingAppointment","_renderSlot","RejectedResult","CallUsFilledButton"],"mappings":";;;;;;;;;;;;;;;AAGA,MAAMA,IAAa;AAAA,EACjB,KAAK;AAAA,EACL,OAAO;AACT,GACMC,IAAa,EAAE,OAAO,cAqCAC,KAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,YAAY;AAAA,IACZ,SAAS,EAAE,MAAM,QAAQ;AAAA,IACzB,iBAAiB,EAAE,MAAM,SAAS,SAAS,GAAM;AAAA,IACjD,aAAa,EAAE,MAAM,SAAS,SAAS,GAAM;AAAA,IAC7C,UAAU,EAAE,SAAS,OAAU;AAAA,IAC/B,iBAAiB,EAAE,SAAS,OAAU;AAAA,EACxC;AAAA,EACA,OAAO;AAAA,IACP;AA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EAAE,KAAK,KAAK;AAAA,cACzD,SAASC,EAAS,MAAM;AAAA,gBACtBH,EAAaS,GAAqB;AAAA,kBAChC,aAAaxC,EAAM,WAAW;AAAA,gBAC7B,GAAA,MAAM,GAAG,CAAC,WAAW,CAAC;AAAA,cAAA,CAC1B;AAAA,cACD,GAAG;AAAA,YAAA,CACJ,KACD8B,EAAoB,IAAI,EAAI;AAAA,UAAA,CACjC;AAAA,UACDF,EAAoB,OAAOjC,GAAY;AAAA,YACrC8C,EAAYrB,EAAK,QAAQ,QAAQ;AAAA,YAC/BO,EAAOvB,CAAW,IAEhB0B,EAAoB,IAAI,EAAI,IAD5BW,EAAYrB,EAAK,QAAQ,WAAW,EAAE,KAAK,EAAG,CAAA;AAAA,YAElDqB,EAAYrB,EAAK,QAAQ,QAAQ;AAAA,UAAA,CAClC;AAAA,QACF,CAAA,MACAE,EAAW,GAAGE,EAAakB,GAAgB;AAAA,UAC1C,KAAK;AAAA,UACL,OAAO;AAAA,QAAA,GACN;AAAA,UACD,eAAeR,EAAS,MAAM;AAAA,YAC5BH,EAAaY,GAAoB,EAAE,OAAO,YAAY;AAAA,UAAA,CACvD;AAAA,UACD,GAAG;AAAA,QAAA,CACJ;AAAA,SACJ,EAAE;AAAA,IAAA,CACV;AAAA,EAEH;AAEA,CAAC;"}
1
+ {"version":3,"file":"TestResultDetail.vue.mjs","sources":["../../../../../../src/components/TestResult/Mobile/ResultTab/TestResultDetail.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, unref as _unref, createVNode as _createVNode, withCtx as _withCtx, createElementVNode as _createElementVNode, renderSlot as _renderSlot, createElementBlock as _createElementBlock, Fragment as _Fragment } from \"vue\"\n\nconst _hoisted_1 = {\n key: 0,\n class: \"consumer-test-result__ready\"\n}\nconst _hoisted_2 = { class: \"psc-px-4\" }\n\nimport { computed, defineAsyncComponent, toRef } from 'vue';\nimport PatientName from '../../../Shared/PatientName.vue';\nimport ResultReadyV2, {\n type TimelineEvent,\n} from '../../Shared/ResultReadyV2.vue';\nimport RejectedResult from '../../Shared/RejectedResult.vue';\nimport BookAppointment from '../../Shared/BookAppointment.vue';\nimport DoctorNote from '../../Shared/DoctorNote.vue';\nimport DoctorNoteDetail from '../../Shared/DoctorNoteDetail.vue';\nimport type { TestResult } from '@/types';\nimport UpcomingAppointment from '../../Shared/UpcomingAppointment.vue';\nimport CallUsFilledButton from '../../Shared/CallUsFilledButton.vue';\nimport TestResultDetailSkeleton from '../../Shared/TestResultDetailSkeleton/TestResultDetailSkeleton.vue';\nimport HealthSummary from '@/components/TestResult/HealthSummary/HealthSummary.vue';\nimport TestResultSection from '../../Shared/TestResultSection.vue';\nimport { useTestResult } from '@/composables/TestResult';\nimport {\n buildTestResultSurveyContext,\n getSurveySlug,\n isSurveyEnabledForTestResult,\n isTeledocSurveyEnabled,\n} from '@/helpers/SurveyHelper';\nimport { useSurveyConfig } from '@/composables/useSurveyConfig';\n\n/**\n * Props\n */\nexport interface Props {\n testResult: TestResult;\n loading: boolean;\n hidePatientInfo?: boolean;\n hideSummary?: boolean;\n timeline?: TimelineEvent[];\n listActionEvent?: Record<string, string>;\n}\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'TestResultDetail',\n props: {\n testResult: null,\n loading: { type: Boolean },\n hidePatientInfo: { type: Boolean, default: false },\n hideSummary: { type: Boolean, default: false },\n timeline: { default: undefined },\n listActionEvent: { default: undefined }\n },\n emits: [\n 'click:book-appointment',\n 'click:appointment-booking',\n],\n setup(__props: any, { emit }) {\n\nconst props = __props as { testResult: TestResult, loading: boolean, hidePatientInfo: boolean, hideSummary: boolean, timeline: TimelineEvent[], listActionEvent: Record<string, string> };\n\n\n\nconst TakeSurvey = defineAsyncComponent(\n () => import('../../Shared/TakeSurvey.vue')\n);\n\n/**\n * Events\n */\n\n\n/**\n * Data\n */\nconst { healthSummaryItems, hideContent, isViewable, visible } = useTestResult({\n testResult: toRef(props, 'testResult'),\n hidePatientInfo: toRef(props, 'hidePatientInfo'),\n hideSummary: toRef(props, 'hideSummary'),\n});\n\nconst { surveyConfig } = useSurveyConfig();\n\nconst doctorNoteSurveyContext = computed(() =>\n buildTestResultSurveyContext(props.testResult, 'doctor-note')\n);\n\nconst testSurveySlug = computed(() =>\n getSurveySlug(\n props.testResult.collection_channel,\n props.testResult.is_free_consultant,\n surveyConfig.value\n )\n);\n\nconst testSurveyContext = computed(() =>\n buildTestResultSurveyContext(props.testResult)\n);\n\nconst hasDoctorNoteDetail = computed(\n () =>\n !!props.testResult.doctor_note_detail &&\n props.testResult.doctor_note_detail.length > 0\n);\n\nconst isSurveyEnabled = computed(() =>\n isSurveyEnabledForTestResult(\n props.testResult.nps_test_result,\n props.testResult.collection_channel,\n props.testResult.is_free_consultant,\n surveyConfig.value\n )\n);\n\nconst isTeledocSurveyVisible = computed(() =>\n isTeledocSurveyEnabled(\n props.testResult.nps_doctor_consult,\n surveyConfig.value\n )\n);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", null, [\n (props.loading)\n ? (_openBlock(), _createBlock(TestResultDetailSkeleton, { key: 0 }))\n : (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [\n (_unref(isViewable))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", null, [\n (_unref(visible).patientName)\n ? (_openBlock(), _createBlock(PatientName, {\n key: 0,\n \"first-name\": props.testResult.first_name,\n class: \"psc-px-4 psc-pb-2\"\n }, null, 8, [\"first-name\"]))\n : _createCommentVNode(\"\", true),\n _createVNode(ResultReadyV2, {\n \"test-result\": props.testResult,\n timeline: props.timeline,\n \"list-action-event\": props.listActionEvent,\n class: \"psc-px-4 psc-pb-4\"\n }, null, 8, [\"test-result\", \"timeline\", \"list-action-event\"]),\n (_unref(visible).healthSummary)\n ? (_openBlock(), _createBlock(TestResultSection, { key: 1 }, {\n default: _withCtx(() => [\n _createVNode(HealthSummary, {\n items: _unref(healthSummaryItems),\n \"cta-button\": props.testResult.is_free_consultant,\n \"onClick:ctaButton\": _cache[0] || (_cache[0] = ($event: any) => (emit('click:book-appointment')))\n }, null, 8, [\"items\", \"cta-button\"])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (_unref(visible).bookAppointment)\n ? (_openBlock(), _createBlock(TestResultSection, { key: 2 }, {\n default: _withCtx(() => [\n _createVNode(BookAppointment, {\n \"onClick:book\": _cache[1] || (_cache[1] = ($event: any) => (emit('click:book-appointment')))\n })\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (_unref(visible).doctorNote)\n ? (_openBlock(), _createBlock(TestResultSection, { key: 3 }, {\n default: _withCtx(() => [\n _createVNode(DoctorNote, {\n \"doctor-note\": props.testResult.doctor_note\n }, null, 8, [\"doctor-note\"])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (_unref(hasDoctorNoteDetail))\n ? (_openBlock(), _createBlock(TestResultSection, { key: 4 }, {\n default: _withCtx(() => [\n _createVNode(DoctorNoteDetail, {\n \"doctor-note-detail\": __props.testResult.doctor_note_detail!,\n \"survey-context\": \n _unref(isTeledocSurveyVisible) ? _unref(doctorNoteSurveyContext) : undefined\n ,\n \"onClick:appointmentBooking\": _cache[2] || (_cache[2] = ($event: any) => (\n emit('click:appointment-booking', $event)\n ))\n }, null, 8, [\"doctor-note-detail\", \"survey-context\"])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (_unref(isSurveyEnabled))\n ? (_openBlock(), _createBlock(TestResultSection, { key: 5 }, {\n default: _withCtx(() => [\n _createVNode(_unref(TakeSurvey), {\n variant: \"bar\",\n \"survey-slug\": _unref(testSurveySlug),\n context: _unref(testSurveyContext),\n text: _ctx.$t('psc.test_result_take_survey_button')\n }, null, 8, [\"survey-slug\", \"context\", \"text\"])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (_unref(visible).upcomingAppointment)\n ? (_openBlock(), _createBlock(TestResultSection, { key: 6 }, {\n default: _withCtx(() => [\n _createVNode(UpcomingAppointment, {\n \"time-slot\": props.testResult.consult_time!\n }, null, 8, [\"time-slot\"])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"div\", _hoisted_2, [\n _renderSlot(_ctx.$slots, \"header\"),\n (!_unref(hideContent))\n ? _renderSlot(_ctx.$slots, \"default\", { key: 0 })\n : _createCommentVNode(\"\", true),\n _renderSlot(_ctx.$slots, \"footer\")\n ])\n ]))\n : (_openBlock(), _createBlock(RejectedResult, {\n key: 1,\n class: \"psc-px-4\"\n }, {\n \"body-append\": _withCtx(() => [\n _createVNode(CallUsFilledButton, { class: \"psc-mt-6\" })\n ]),\n _: 1\n }))\n ], 64))\n ]))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_sfc_main","_defineComponent","__props","emit","props","TakeSurvey","defineAsyncComponent","healthSummaryItems","hideContent","isViewable","visible","useTestResult","toRef","surveyConfig","useSurveyConfig","doctorNoteSurveyContext","computed","buildTestResultSurveyContext","testSurveySlug","getSurveySlug","testSurveyContext","hasDoctorNoteDetail","isSurveyEnabled","isSurveyEnabledForTestResult","isTeledocSurveyVisible","isTeledocSurveyEnabled","_ctx","_cache","_openBlock","_createElementBlock","_createBlock","TestResultDetailSkeleton","_Fragment","_unref","_createElementVNode","PatientName","_createCommentVNode","_createVNode","ResultReadyV2","TestResultSection","_withCtx","HealthSummary","$event","BookAppointment","DoctorNote","DoctorNoteDetail","UpcomingAppointment","_renderSlot","RejectedResult","CallUsFilledButton"],"mappings":";;;;;;;;;;;;;;;AAGA,MAAMA,IAAa;AAAA,EACjB,KAAK;AAAA,EACL,OAAO;AACT,GACMC,IAAa,EAAE,OAAO,cAsCAC,KAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,YAAY;AAAA,IACZ,SAAS,EAAE,MAAM,QAAQ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\d{2}\/\d{4}$/.test(t))return t;const n=t.match(/^(\d{4})-(\d{2})-(\d{2})/);if(n){const[,e,r,o]=n;return`${o}/${r}/${e}`}return t}const s=t=>{if(!t||!(t instanceof Date||/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})$/.test(t)))return t;const e=t instanceof Date?t:new Date(t);if(Number.isNaN(e.getTime()))return t;const r=o=>String(o).padStart(2,"0");return`${r(e.getDate())}/${r(e.getMonth()+1)}/${String(e.getFullYear()).slice(-2)} ${r(e.getHours())}:${r(e.getMinutes())}`};exports.formatDateTimeShort=s;exports.formatDateToDDMMYYYY=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function g(t){if(!t)return"";if(/^\d{2}\/\d{2}\/\d{4}$/.test(t))return t;const e=t.match(/^(\d{4})-(\d{2})-(\d{2})/);if(e){const[,r,n,o]=e;return`${o}/${n}/${r}`}return t}const l=t=>{if(!t)return t;let e;if(t instanceof Date)e=t;else{const n=t.match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:[.,](\d+))?)?(Z|[+-]\d{2}(?::?\d{2})?)?)?$/);if(!n)return t;const[,o,i,s,m,a,c,f,u]=n,$=Number((f||"").padEnd(3,"0").slice(0,3));if(u){const d=/^[+-]\d{2}$/.test(u)?`${u}:00`:u.replace(/^([+-]\d{2})(\d{2})$/,"$1:$2");e=new Date(`${o}-${i}-${s}T${m}:${a}:${c||"00"}.${String($).padStart(3,"0")}${d}`)}else if(e=new Date(Number(o),Number(i)-1,Number(s),Number(m||0),Number(a||0),Number(c||0),$),e.getFullYear()!==Number(o)||e.getMonth()!==Number(i)-1||e.getDate()!==Number(s)||e.getHours()!==Number(m||0)||e.getMinutes()!==Number(a||0)||e.getSeconds()!==Number(c||0))return t}if(Number.isNaN(e.getTime()))return t;const r=n=>String(n).padStart(2,"0");return`${r(e.getDate())}/${r(e.getMonth()+1)}/${String(e.getFullYear()).slice(-2)} ${r(e.getHours())}:${r(e.getMinutes())}`};exports.formatDateTimeShort=l;exports.formatDateToDDMMYYYY=g;
2
2
  //# sourceMappingURL=DateHelper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateHelper.js","sources":["../../../src/helpers/DateHelper.ts"],"sourcesContent":["/**\n * Normalise a date string from the API to dd/mm/yyyy.\n *\n * Handles:\n * - ISO 8601 with timezone → \"2026-03-22T00:00:00.000000Z\"\n * - Plain date → \"2026-03-22\"\n * - Already formatted → \"22/03/2026\"\n * - Anything else / empty → returns the original value (or '-')\n */\nexport function formatDateToDDMMYYYY(\n dateStr: string | null | undefined\n): string {\n if (!dateStr) return '';\n\n // Already dd/mm/yyyy — return as-is\n if (/^\\d{2}\\/\\d{2}\\/\\d{4}$/.test(dateStr)) return dateStr;\n\n // ISO 8601 (e.g. \"2026-03-22T00:00:00.000000Z\") or plain \"YYYY-MM-DD\"\n const isoMatch = dateStr.match(/^(\\d{4})-(\\d{2})-(\\d{2})/);\n if (isoMatch) {\n const [, year, month, day] = isoMatch;\n return `${day}/${month}/${year}`;\n }\n\n // Unknown format — return as-is so nothing is lost\n return dateStr;\n}\n\nexport const formatDateTimeShort = (date?: string | Date) => {\n if (!date) return date;\n\n const isIsoDate =\n date instanceof Date ||\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d+)?)?(?:Z|[+-]\\d{2}:?\\d{2})$/.test(\n date\n );\n if (!isIsoDate) return date;\n\n const value = date instanceof Date ? date : new Date(date);\n if (Number.isNaN(value.getTime())) return date;\n\n const pad = (part: number) => String(part).padStart(2, '0');\n return `${pad(value.getDate())}/${pad(value.getMonth() + 1)}/${String(\n value.getFullYear()\n ).slice(-2)} ${pad(value.getHours())}:${pad(value.getMinutes())}`;\n};\n"],"names":["formatDateToDDMMYYYY","dateStr","isoMatch","year","month","day","formatDateTimeShort","date","value","pad","part"],"mappings":"gFASO,SAASA,EACdC,EACQ,CACR,GAAI,CAACA,EAAgB,MAAA,GAGjB,GAAA,wBAAwB,KAAKA,CAAO,EAAU,OAAAA,EAG5C,MAAAC,EAAWD,EAAQ,MAAM,0BAA0B,EACzD,GAAIC,EAAU,CACZ,KAAM,CAAG,CAAAC,EAAMC,EAAOC,CAAG,EAAIH,EACtB,MAAA,GAAGG,KAAOD,KAASD,IAIrB,OAAAF,CACT,CAEa,MAAAK,EAAuBC,GAAyB,CAQ3D,GAPI,CAACA,GAOD,EAJFA,aAAgB,MAChB,6EAA6E,KAC3EA,CAAA,GAEmB,OAAAA,EAEvB,MAAMC,EAAQD,aAAgB,KAAOA,EAAO,IAAI,KAAKA,CAAI,EACzD,GAAI,OAAO,MAAMC,EAAM,QAAA,CAAS,EAAU,OAAAD,EAEpC,MAAAE,EAAOC,GAAiB,OAAOA,CAAI,EAAE,SAAS,EAAG,GAAG,EACnD,MAAA,GAAGD,EAAID,EAAM,QAAS,CAAA,KAAKC,EAAID,EAAM,SAAA,EAAa,CAAC,KAAK,OAC7DA,EAAM,YAAY,CAAA,EAClB,MAAM,EAAE,KAAKC,EAAID,EAAM,SAAU,CAAA,KAAKC,EAAID,EAAM,WAAY,CAAA,GAChE"}
1
+ {"version":3,"file":"DateHelper.js","sources":["../../../src/helpers/DateHelper.ts"],"sourcesContent":["/**\n * Normalise a date string from the API to dd/mm/yyyy.\n *\n * Handles:\n * - ISO 8601 with timezone → \"2026-03-22T00:00:00.000000Z\"\n * - Plain date → \"2026-03-22\"\n * - Already formatted → \"22/03/2026\"\n * - Anything else / empty → returns the original value (or '-')\n */\nexport function formatDateToDDMMYYYY(\n dateStr: string | null | undefined\n): string {\n if (!dateStr) return '';\n\n // Already dd/mm/yyyy — return as-is\n if (/^\\d{2}\\/\\d{2}\\/\\d{4}$/.test(dateStr)) return dateStr;\n\n // ISO 8601 (e.g. \"2026-03-22T00:00:00.000000Z\") or plain \"YYYY-MM-DD\"\n const isoMatch = dateStr.match(/^(\\d{4})-(\\d{2})-(\\d{2})/);\n if (isoMatch) {\n const [, year, month, day] = isoMatch;\n return `${day}/${month}/${year}`;\n }\n\n // Unknown format — return as-is so nothing is lost\n return dateStr;\n}\n\nexport const formatDateTimeShort = (date?: string | Date) => {\n if (!date) return date;\n\n let value: Date;\n\n if (date instanceof Date) {\n value = date;\n } else {\n // Keep the ISO inputs accepted by the previous Moment implementation,\n // including the API's space separator and hour-only UTC offset.\n const isoMatch = date.match(\n /^(\\d{4})-(\\d{2})-(\\d{2})(?:[T ](\\d{2}):(\\d{2})(?::(\\d{2})(?:[.,](\\d+))?)?(Z|[+-]\\d{2}(?::?\\d{2})?)?)?$/\n );\n if (!isoMatch) return date;\n\n const [, year, month, day, hour, minute, second, fraction, offset] =\n isoMatch;\n const milliseconds = Number((fraction || '').padEnd(3, '0').slice(0, 3));\n\n if (offset) {\n const normalizedOffset = /^[+-]\\d{2}$/.test(offset)\n ? `${offset}:00`\n : offset.replace(/^([+-]\\d{2})(\\d{2})$/, '$1:$2');\n value = new Date(\n `${year}-${month}-${day}T${hour}:${minute}:${second || '00'}.${String(\n milliseconds\n ).padStart(3, '0')}${normalizedOffset}`\n );\n } else {\n value = new Date(\n Number(year),\n Number(month) - 1,\n Number(day),\n Number(hour || 0),\n Number(minute || 0),\n Number(second || 0),\n milliseconds\n );\n\n // The Date constructor normalises invalid values (for example Feb 30),\n // while Moment's strict ISO check rejected them.\n if (\n value.getFullYear() !== Number(year) ||\n value.getMonth() !== Number(month) - 1 ||\n value.getDate() !== Number(day) ||\n value.getHours() !== Number(hour || 0) ||\n value.getMinutes() !== Number(minute || 0) ||\n value.getSeconds() !== Number(second || 0)\n ) {\n return date;\n }\n }\n }\n\n if (Number.isNaN(value.getTime())) return date;\n\n const pad = (part: number) => String(part).padStart(2, '0');\n return `${pad(value.getDate())}/${pad(value.getMonth() + 1)}/${String(\n value.getFullYear()\n ).slice(-2)} ${pad(value.getHours())}:${pad(value.getMinutes())}`;\n};\n"],"names":["formatDateToDDMMYYYY","dateStr","isoMatch","year","month","day","formatDateTimeShort","date","value","hour","minute","second","fraction","offset","milliseconds","normalizedOffset","pad","part"],"mappings":"gFASO,SAASA,EACdC,EACQ,CACR,GAAI,CAACA,EAAgB,MAAA,GAGjB,GAAA,wBAAwB,KAAKA,CAAO,EAAU,OAAAA,EAG5C,MAAAC,EAAWD,EAAQ,MAAM,0BAA0B,EACzD,GAAIC,EAAU,CACZ,KAAM,CAAG,CAAAC,EAAMC,EAAOC,CAAG,EAAIH,EACtB,MAAA,GAAGG,KAAOD,KAASD,IAIrB,OAAAF,CACT,CAEa,MAAAK,EAAuBC,GAAyB,CAC3D,GAAI,CAACA,EAAa,OAAAA,EAEd,IAAAC,EAEJ,GAAID,aAAgB,KACVC,EAAAD,MACH,CAGL,MAAML,EAAWK,EAAK,MACpB,wGAAA,EAEF,GAAI,CAACL,EAAiB,OAAAK,EAEhB,KAAA,EAAGJ,EAAMC,EAAOC,EAAKI,EAAMC,EAAQC,EAAQC,EAAUC,CAAM,EAC/DX,EACIY,EAAe,QAAQF,GAAY,IAAI,OAAO,EAAG,GAAG,EAAE,MAAM,EAAG,CAAC,CAAC,EAEvE,GAAIC,EAAQ,CACJ,MAAAE,EAAmB,cAAc,KAAKF,CAAM,EAC9C,GAAGA,OACHA,EAAO,QAAQ,uBAAwB,OAAO,EAClDL,EAAY,IAAA,KACV,GAAGL,KAAQC,KAASC,KAAOI,KAAQC,KAAUC,GAAU,QAAQ,OAC7DG,CACA,EAAA,SAAS,EAAG,GAAG,IAAIC,GAAA,UAGvBP,EAAQ,IAAI,KACV,OAAOL,CAAI,EACX,OAAOC,CAAK,EAAI,EAChB,OAAOC,CAAG,EACV,OAAOI,GAAQ,CAAC,EAChB,OAAOC,GAAU,CAAC,EAClB,OAAOC,GAAU,CAAC,EAClBG,CAAA,EAMAN,EAAM,gBAAkB,OAAOL,CAAI,GACnCK,EAAM,SAAe,IAAA,OAAOJ,CAAK,EAAI,GACrCI,EAAM,QAAQ,IAAM,OAAOH,CAAG,GAC9BG,EAAM,aAAe,OAAOC,GAAQ,CAAC,GACrCD,EAAM,eAAiB,OAAOE,GAAU,CAAC,GACzCF,EAAM,WAAA,IAAiB,OAAOG,GAAU,CAAC,EAElC,OAAAJ,EAKb,GAAI,OAAO,MAAMC,EAAM,QAAA,CAAS,EAAU,OAAAD,EAEpC,MAAAS,EAAOC,GAAiB,OAAOA,CAAI,EAAE,SAAS,EAAG,GAAG,EACnD,MAAA,GAAGD,EAAIR,EAAM,QAAS,CAAA,KAAKQ,EAAIR,EAAM,SAAA,EAAa,CAAC,KAAK,OAC7DA,EAAM,YAAY,CAAA,EAClB,MAAM,EAAE,KAAKQ,EAAIR,EAAM,SAAU,CAAA,KAAKQ,EAAIR,EAAM,WAAY,CAAA,GAChE"}
@@ -1,30 +1,55 @@
1
- function i(t) {
1
+ function N(t) {
2
2
  if (!t)
3
3
  return "";
4
4
  if (/^\d{2}\/\d{2}\/\d{4}$/.test(t))
5
5
  return t;
6
- const r = t.match(/^(\d{4})-(\d{2})-(\d{2})/);
7
- if (r) {
8
- const [, n, e, o] = r;
9
- return `${o}/${e}/${n}`;
6
+ const e = t.match(/^(\d{4})-(\d{2})-(\d{2})/);
7
+ if (e) {
8
+ const [, r, n, u] = e;
9
+ return `${u}/${n}/${r}`;
10
10
  }
11
11
  return t;
12
12
  }
13
- const s = (t) => {
14
- if (!t || !(t instanceof Date || /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})$/.test(
15
- t
16
- )))
13
+ const g = (t) => {
14
+ if (!t)
17
15
  return t;
18
- const n = t instanceof Date ? t : new Date(t);
19
- if (Number.isNaN(n.getTime()))
16
+ let e;
17
+ if (t instanceof Date)
18
+ e = t;
19
+ else {
20
+ const n = t.match(
21
+ /^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:[.,](\d+))?)?(Z|[+-]\d{2}(?::?\d{2})?)?)?$/
22
+ );
23
+ if (!n)
24
+ return t;
25
+ const [, u, i, s, m, $, c, d, o] = n, a = Number((d || "").padEnd(3, "0").slice(0, 3));
26
+ if (o) {
27
+ const f = /^[+-]\d{2}$/.test(o) ? `${o}:00` : o.replace(/^([+-]\d{2})(\d{2})$/, "$1:$2");
28
+ e = /* @__PURE__ */ new Date(
29
+ `${u}-${i}-${s}T${m}:${$}:${c || "00"}.${String(
30
+ a
31
+ ).padStart(3, "0")}${f}`
32
+ );
33
+ } else if (e = new Date(
34
+ Number(u),
35
+ Number(i) - 1,
36
+ Number(s),
37
+ Number(m || 0),
38
+ Number($ || 0),
39
+ Number(c || 0),
40
+ a
41
+ ), e.getFullYear() !== Number(u) || e.getMonth() !== Number(i) - 1 || e.getDate() !== Number(s) || e.getHours() !== Number(m || 0) || e.getMinutes() !== Number($ || 0) || e.getSeconds() !== Number(c || 0))
42
+ return t;
43
+ }
44
+ if (Number.isNaN(e.getTime()))
20
45
  return t;
21
- const e = (o) => String(o).padStart(2, "0");
22
- return `${e(n.getDate())}/${e(n.getMonth() + 1)}/${String(
23
- n.getFullYear()
24
- ).slice(-2)} ${e(n.getHours())}:${e(n.getMinutes())}`;
46
+ const r = (n) => String(n).padStart(2, "0");
47
+ return `${r(e.getDate())}/${r(e.getMonth() + 1)}/${String(
48
+ e.getFullYear()
49
+ ).slice(-2)} ${r(e.getHours())}:${r(e.getMinutes())}`;
25
50
  };
26
51
  export {
27
- s as formatDateTimeShort,
28
- i as formatDateToDDMMYYYY
52
+ g as formatDateTimeShort,
53
+ N as formatDateToDDMMYYYY
29
54
  };
30
55
  //# sourceMappingURL=DateHelper.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateHelper.mjs","sources":["../../../src/helpers/DateHelper.ts"],"sourcesContent":["/**\n * Normalise a date string from the API to dd/mm/yyyy.\n *\n * Handles:\n * - ISO 8601 with timezone → \"2026-03-22T00:00:00.000000Z\"\n * - Plain date → \"2026-03-22\"\n * - Already formatted → \"22/03/2026\"\n * - Anything else / empty → returns the original value (or '-')\n */\nexport function formatDateToDDMMYYYY(\n dateStr: string | null | undefined\n): string {\n if (!dateStr) return '';\n\n // Already dd/mm/yyyy — return as-is\n if (/^\\d{2}\\/\\d{2}\\/\\d{4}$/.test(dateStr)) return dateStr;\n\n // ISO 8601 (e.g. \"2026-03-22T00:00:00.000000Z\") or plain \"YYYY-MM-DD\"\n const isoMatch = dateStr.match(/^(\\d{4})-(\\d{2})-(\\d{2})/);\n if (isoMatch) {\n const [, year, month, day] = isoMatch;\n return `${day}/${month}/${year}`;\n }\n\n // Unknown format — return as-is so nothing is lost\n return dateStr;\n}\n\nexport const formatDateTimeShort = (date?: string | Date) => {\n if (!date) return date;\n\n const isIsoDate =\n date instanceof Date ||\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d+)?)?(?:Z|[+-]\\d{2}:?\\d{2})$/.test(\n date\n );\n if (!isIsoDate) return date;\n\n const value = date instanceof Date ? date : new Date(date);\n if (Number.isNaN(value.getTime())) return date;\n\n const pad = (part: number) => String(part).padStart(2, '0');\n return `${pad(value.getDate())}/${pad(value.getMonth() + 1)}/${String(\n value.getFullYear()\n ).slice(-2)} ${pad(value.getHours())}:${pad(value.getMinutes())}`;\n};\n"],"names":["formatDateToDDMMYYYY","dateStr","isoMatch","year","month","day","formatDateTimeShort","date","value","pad","part"],"mappings":"AASO,SAASA,EACdC,GACQ;AACR,MAAI,CAACA;AAAgB,WAAA;AAGjB,MAAA,wBAAwB,KAAKA,CAAO;AAAU,WAAAA;AAG5C,QAAAC,IAAWD,EAAQ,MAAM,0BAA0B;AACzD,MAAIC,GAAU;AACZ,UAAM,CAAG,EAAAC,GAAMC,GAAOC,CAAG,IAAIH;AACtB,WAAA,GAAGG,KAAOD,KAASD;AAAA;AAIrB,SAAAF;AACT;AAEa,MAAAK,IAAsB,CAACC,MAAyB;AAQ3D,MAPI,CAACA,KAOD,EAJFA,aAAgB,QAChB,6EAA6E;AAAA,IAC3EA;AAAA,EAAA;AAEmB,WAAAA;AAEvB,QAAMC,IAAQD,aAAgB,OAAOA,IAAO,IAAI,KAAKA,CAAI;AACzD,MAAI,OAAO,MAAMC,EAAM,QAAA,CAAS;AAAU,WAAAD;AAEpC,QAAAE,IAAM,CAACC,MAAiB,OAAOA,CAAI,EAAE,SAAS,GAAG,GAAG;AACnD,SAAA,GAAGD,EAAID,EAAM,QAAS,CAAA,KAAKC,EAAID,EAAM,SAAA,IAAa,CAAC,KAAK;AAAA,IAC7DA,EAAM,YAAY;AAAA,EAAA,EAClB,MAAM,EAAE,KAAKC,EAAID,EAAM,SAAU,CAAA,KAAKC,EAAID,EAAM,WAAY,CAAA;AAChE;"}
1
+ {"version":3,"file":"DateHelper.mjs","sources":["../../../src/helpers/DateHelper.ts"],"sourcesContent":["/**\n * Normalise a date string from the API to dd/mm/yyyy.\n *\n * Handles:\n * - ISO 8601 with timezone → \"2026-03-22T00:00:00.000000Z\"\n * - Plain date → \"2026-03-22\"\n * - Already formatted → \"22/03/2026\"\n * - Anything else / empty → returns the original value (or '-')\n */\nexport function formatDateToDDMMYYYY(\n dateStr: string | null | undefined\n): string {\n if (!dateStr) return '';\n\n // Already dd/mm/yyyy — return as-is\n if (/^\\d{2}\\/\\d{2}\\/\\d{4}$/.test(dateStr)) return dateStr;\n\n // ISO 8601 (e.g. \"2026-03-22T00:00:00.000000Z\") or plain \"YYYY-MM-DD\"\n const isoMatch = dateStr.match(/^(\\d{4})-(\\d{2})-(\\d{2})/);\n if (isoMatch) {\n const [, year, month, day] = isoMatch;\n return `${day}/${month}/${year}`;\n }\n\n // Unknown format — return as-is so nothing is lost\n return dateStr;\n}\n\nexport const formatDateTimeShort = (date?: string | Date) => {\n if (!date) return date;\n\n let value: Date;\n\n if (date instanceof Date) {\n value = date;\n } else {\n // Keep the ISO inputs accepted by the previous Moment implementation,\n // including the API's space separator and hour-only UTC offset.\n const isoMatch = date.match(\n /^(\\d{4})-(\\d{2})-(\\d{2})(?:[T ](\\d{2}):(\\d{2})(?::(\\d{2})(?:[.,](\\d+))?)?(Z|[+-]\\d{2}(?::?\\d{2})?)?)?$/\n );\n if (!isoMatch) return date;\n\n const [, year, month, day, hour, minute, second, fraction, offset] =\n isoMatch;\n const milliseconds = Number((fraction || '').padEnd(3, '0').slice(0, 3));\n\n if (offset) {\n const normalizedOffset = /^[+-]\\d{2}$/.test(offset)\n ? `${offset}:00`\n : offset.replace(/^([+-]\\d{2})(\\d{2})$/, '$1:$2');\n value = new Date(\n `${year}-${month}-${day}T${hour}:${minute}:${second || '00'}.${String(\n milliseconds\n ).padStart(3, '0')}${normalizedOffset}`\n );\n } else {\n value = new Date(\n Number(year),\n Number(month) - 1,\n Number(day),\n Number(hour || 0),\n Number(minute || 0),\n Number(second || 0),\n milliseconds\n );\n\n // The Date constructor normalises invalid values (for example Feb 30),\n // while Moment's strict ISO check rejected them.\n if (\n value.getFullYear() !== Number(year) ||\n value.getMonth() !== Number(month) - 1 ||\n value.getDate() !== Number(day) ||\n value.getHours() !== Number(hour || 0) ||\n value.getMinutes() !== Number(minute || 0) ||\n value.getSeconds() !== Number(second || 0)\n ) {\n return date;\n }\n }\n }\n\n if (Number.isNaN(value.getTime())) return date;\n\n const pad = (part: number) => String(part).padStart(2, '0');\n return `${pad(value.getDate())}/${pad(value.getMonth() + 1)}/${String(\n value.getFullYear()\n ).slice(-2)} ${pad(value.getHours())}:${pad(value.getMinutes())}`;\n};\n"],"names":["formatDateToDDMMYYYY","dateStr","isoMatch","year","month","day","formatDateTimeShort","date","value","hour","minute","second","fraction","offset","milliseconds","normalizedOffset","pad","part"],"mappings":"AASO,SAASA,EACdC,GACQ;AACR,MAAI,CAACA;AAAgB,WAAA;AAGjB,MAAA,wBAAwB,KAAKA,CAAO;AAAU,WAAAA;AAG5C,QAAAC,IAAWD,EAAQ,MAAM,0BAA0B;AACzD,MAAIC,GAAU;AACZ,UAAM,CAAG,EAAAC,GAA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AAI,OAAO,MAAMC,EAAM,QAAA,CAAS;AAAU,WAAAD;AAEpC,QAAAS,IAAM,CAACC,MAAiB,OAAOA,CAAI,EAAE,SAAS,GAAG,GAAG;AACnD,SAAA,GAAGD,EAAIR,EAAM,QAAS,CAAA,KAAKQ,EAAIR,EAAM,SAAA,IAAa,CAAC,KAAK;AAAA,IAC7DA,EAAM,YAAY;AAAA,EAAA,EAClB,MAAM,EAAE,KAAKQ,EAAIR,EAAM,SAAU,CAAA,KAAKQ,EAAIR,EAAM,WAAY,CAAA;AAChE;"}
@@ -1,2 +1,2 @@
1
- "use strict";var T=Object.defineProperty,b=Object.defineProperties;var v=Object.getOwnPropertyDescriptors;var _=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var d=(e,t,r)=>t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,a=(e,t)=>{for(var r in t||(t={}))E.call(t,r)&&d(e,r,t[r]);if(_)for(var r of _(t))f.call(t,r)&&d(e,r,t[r]);return e},m=(e,t)=>b(e,v(t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../constants/Common.js"),u=require("../constants/SurveyKeys.js");function L(e,t="test-result"){const r={source:t,order_id:e.order_id,template_type:e.template_type,result_status:e.result_status};return e.patient_number&&(r.patient_number=e.patient_number),e.appointment_code&&(r.appointment_code=e.appointment_code),r}function U(e,t){const r=t==null?void 0:t.trim();return r?m(a({},e),{appointment_code:r}):e}function S(e,t){return(e!=null?e:"psc").toLowerCase()==="hbc"?t?u.SurveyKey.HBC_WITH_CONSULT:u.SurveyKey.HBC_NO_CONSULT:t?u.SurveyKey.PSC_WITH_CONSULT:u.SurveyKey.PSC_NO_CONSULT}function O(e,t,r=u.DEFAULT_SURVEY_LIST){var n,i;const o=S(e,t);return(i=(n=r[o])==null?void 0:n.slug)!=null?i:u.DEFAULT_SURVEY_LIST[o].slug}function l(e,t,r,o=u.DEFAULT_SURVEY_LIST){var y,s;const n=S(t,r),i=(s=(y=o[n])==null?void 0:y.enabled)!=null?s:u.DEFAULT_SURVEY_LIST[n].enabled;return(g.SURVEY_FORCE_ENABLE||e===!0)&&i}function p(e){const t=e.replace(/\/$/,"");if(t.endsWith("/surveys"))return t.slice(0,-8);try{return new URL(t).origin}catch(r){return t}}async function w(e,t,r){var s,c;const o=p(e),n=await fetch(`${o}/embed-context`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,context:r,embed:!0})});if(!n.ok)throw new Error("embed-context mint failed");const i=await n.json(),y=(c=(s=i.data)==null?void 0:s.key)!=null?c:i.key;if(!y)throw new Error("embed-context mint missing key");return y}exports.buildTestResultSurveyContext=L;exports.getSurveyKey=S;exports.getSurveySlug=O;exports.isSurveyEnabledForTestResult=l;exports.mintSurveyEmbedKey=w;exports.surveyAppOrigin=p;exports.withAppointmentCode=U;
1
+ "use strict";var m=Object.defineProperty,v=Object.defineProperties;var L=Object.getOwnPropertyDescriptors;var d=Object.getOwnPropertySymbols;var p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var _=(e,r,t)=>r in e?m(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,E=(e,r)=>{for(var t in r||(r={}))p.call(r,t)&&_(e,t,r[t]);if(d)for(var t of d(r))f.call(r,t)&&_(e,t,r[t]);return e},a=(e,r)=>v(e,L(r));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../constants/Common.js"),n=require("../constants/SurveyKeys.js");function U(e,r="test-result"){const t={source:r,order_id:e.order_id,template_type:e.template_type,result_status:e.result_status};return e.patient_number&&(t.patient_number=e.patient_number),e.appointment_code&&(t.appointment_code=e.appointment_code),t}function l(e,r){const t=r==null?void 0:r.trim();return t?a(E({},e),{appointment_code:t}):e}function s(e,r){return(e!=null?e:"psc").toLowerCase()==="hbc"?r?n.SurveyKey.HBC_WITH_CONSULT:n.SurveyKey.HBC_NO_CONSULT:r?n.SurveyKey.PSC_WITH_CONSULT:n.SurveyKey.PSC_NO_CONSULT}function g(e,r,t=n.DEFAULT_SURVEY_LIST){var u,o;const i=s(e,r);return(o=(u=t[i])==null?void 0:u.slug)!=null?o:n.DEFAULT_SURVEY_LIST[i].slug}function O(e,r,t,i=n.DEFAULT_SURVEY_LIST){var y,S;const u=s(r,t),o=(S=(y=i[u])==null?void 0:y.enabled)!=null?S:n.DEFAULT_SURVEY_LIST[u].enabled;return(T.SURVEY_FORCE_ENABLE||e===!0)&&o}function A(e,r=n.DEFAULT_SURVEY_LIST){var i,u;const t=(u=(i=r[n.SurveyKey.TELEDOC])==null?void 0:i.enabled)!=null?u:n.DEFAULT_SURVEY_LIST[n.SurveyKey.TELEDOC].enabled;return(T.SURVEY_FORCE_ENABLE||e===!0)&&t}function b(e){const r=e.replace(/\/$/,"");if(r.endsWith("/surveys"))return r.slice(0,-8);try{return new URL(r).origin}catch(t){return r}}async function K(e,r,t){var S,c;const i=b(e),u=await fetch(`${i}/embed-context`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:r,context:t,embed:!0})});if(!u.ok)throw new Error("embed-context mint failed");const o=await u.json(),y=(c=(S=o.data)==null?void 0:S.key)!=null?c:o.key;if(!y)throw new Error("embed-context mint missing key");return y}exports.buildTestResultSurveyContext=U;exports.getSurveyKey=s;exports.getSurveySlug=g;exports.isSurveyEnabledForTestResult=O;exports.isTeledocSurveyEnabled=A;exports.mintSurveyEmbedKey=K;exports.surveyAppOrigin=b;exports.withAppointmentCode=l;
2
2
  //# sourceMappingURL=SurveyHelper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SurveyHelper.js","sources":["../../../src/helpers/SurveyHelper.ts"],"sourcesContent":["import { SURVEY_FORCE_ENABLE } from '@/constants/Common';\nimport {\n DEFAULT_SURVEY_LIST,\n SurveyKey,\n type SurveyKeyName,\n type SurveyListConfig,\n} from '@/constants/SurveyKeys';\nimport type { SurveyContext } from '@/components/TestResult/Shared/TakeSurvey.vue';\n\nexport interface TestResultSurveyFields {\n order_id: string;\n template_type: string;\n result_status: string;\n patient_number?: string;\n appointment_code?: string;\n}\n\nexport function buildTestResultSurveyContext(\n testResult: TestResultSurveyFields,\n source = 'test-result'\n): SurveyContext {\n const ctx: SurveyContext = {\n source,\n order_id: testResult.order_id,\n template_type: testResult.template_type,\n result_status: testResult.result_status,\n };\n\n if (testResult.patient_number) {\n ctx.patient_number = testResult.patient_number;\n }\n if (testResult.appointment_code) {\n ctx.appointment_code = testResult.appointment_code;\n }\n\n return ctx;\n}\n\nexport function withAppointmentCode(\n context: SurveyContext,\n appointmentCode?: string | null\n): SurveyContext {\n const code = appointmentCode?.trim();\n if (!code) return context;\n return { ...context, appointment_code: code };\n}\n\nexport function getSurveyKey(\n collectionChannel: string | undefined,\n isFreeConsultant: boolean\n): SurveyKeyName {\n const channel = (collectionChannel ?? 'psc').toLowerCase();\n\n if (channel === 'hbc') {\n return isFreeConsultant\n ? SurveyKey.HBC_WITH_CONSULT\n : SurveyKey.HBC_NO_CONSULT;\n }\n\n return isFreeConsultant\n ? SurveyKey.PSC_WITH_CONSULT\n : SurveyKey.PSC_NO_CONSULT;\n}\n\nexport function getSurveySlug(\n collectionChannel: string | undefined,\n isFreeConsultant: boolean,\n config: SurveyListConfig = DEFAULT_SURVEY_LIST\n): string {\n const key = getSurveyKey(collectionChannel, isFreeConsultant);\n return config[key]?.slug ?? DEFAULT_SURVEY_LIST[key].slug;\n}\n\nexport function isSurveyEnabledForTestResult(\n enableSurvey: boolean | undefined,\n collectionChannel: string | undefined,\n isFreeConsultant: boolean,\n config: SurveyListConfig = DEFAULT_SURVEY_LIST\n): boolean {\n const key = getSurveyKey(collectionChannel, isFreeConsultant);\n const cdnEnabled = config[key]?.enabled ?? DEFAULT_SURVEY_LIST[key].enabled;\n return (SURVEY_FORCE_ENABLE || enableSurvey === true) && cdnEnabled;\n}\n\nexport function isTeledocSurveyEnabled(\n config: SurveyListConfig = DEFAULT_SURVEY_LIST\n): boolean {\n return (\n config[SurveyKey.TELEDOC]?.enabled ??\n DEFAULT_SURVEY_LIST[SurveyKey.TELEDOC].enabled\n );\n}\n\n/** Survey app origin from fill base URL (`.../surveys` or host root). */\nexport function surveyAppOrigin(surveyBaseUrl: string): string {\n const trimmed = surveyBaseUrl.replace(/\\/$/, '');\n if (trimmed.endsWith('/surveys')) {\n return trimmed.slice(0, -'/surveys'.length);\n }\n try {\n return new URL(trimmed).origin;\n } catch {\n return trimmed;\n }\n}\n\nexport async function mintSurveyEmbedKey(\n surveyBaseUrl: string,\n slug: string,\n context: SurveyContext\n): Promise<string> {\n const origin = surveyAppOrigin(surveyBaseUrl);\n const res = await fetch(`${origin}/embed-context`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ slug, context, embed: true }),\n });\n if (!res.ok) {\n throw new Error('embed-context mint failed');\n }\n const json = (await res.json()) as {\n key?: string;\n data?: { key?: string };\n };\n const key = json.data?.key ?? json.key;\n if (!key) {\n throw new Error('embed-context mint missing key');\n }\n return key;\n}\n"],"names":["buildTestResultSurveyContext","testResult","source","ctx","withAppointmentCode","context","appointmentCode","code","__spreadProps","__spreadValues","getSurveyKey","collectionChannel","isFreeConsultant","SurveyKey","getSurveySlug","config","DEFAULT_SURVEY_LIST","key","_b","_a","isSurveyEnabledForTestResult","enableSurvey","cdnEnabled","SURVEY_FORCE_ENABLE","surveyAppOrigin","surveyBaseUrl","trimmed","e","mintSurveyEmbedKey","slug","origin","res","json"],"mappings":"+kBAiBgB,SAAAA,EACdC,EACAC,EAAS,cACM,CACf,MAAMC,EAAqB,CACzB,OAAAD,EACA,SAAUD,EAAW,SACrB,cAAeA,EAAW,cAC1B,cAAeA,EAAW,aAAA,EAG5B,OAAIA,EAAW,iBACbE,EAAI,eAAiBF,EAAW,gBAE9BA,EAAW,mBACbE,EAAI,iBAAmBF,EAAW,kBAG7BE,CACT,CAEgB,SAAAC,EACdC,EACAC,EACe,CACT,MAAAC,EAAOD,GAAA,Y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pD,EACG,GAAA,CAAC0B,EAAI,GACD,MAAA,IAAI,MAAM,2BAA2B,EAEvC,MAAAC,EAAQ,MAAMD,EAAI,OAIlBd,GAAMC,GAAAC,EAAAa,EAAK,OAAL,YAAAb,EAAW,MAAX,KAAAD,EAAkBc,EAAK,IACnC,GAAI,CAACf,EACG,MAAA,IAAI,MAAM,gCAAgC,EAE3C,OAAAA,CACT"}
1
+ {"version":3,"file":"SurveyHelper.js","sources":["../../../src/helpers/SurveyHelper.ts"],"sourcesContent":["import { SURVEY_FORCE_ENABLE } from '@/constants/Common';\nimport {\n DEFAULT_SURVEY_LIST,\n SurveyKey,\n type SurveyKeyName,\n type SurveyListConfig,\n} from '@/constants/SurveyKeys';\nimport type { SurveyContext } from '@/components/TestResult/Shared/TakeSurvey.vue';\n\nexport interface TestResultSurveyFields {\n order_id: string;\n template_type: string;\n result_status: string;\n patient_number?: string;\n appointment_code?: string;\n}\n\nexport function buildTestResultSurveyContext(\n testResult: TestResultSurveyFields,\n source = 'test-result'\n): SurveyContext {\n const ctx: SurveyContext = {\n source,\n order_id: testResult.order_id,\n template_type: testResult.template_type,\n result_status: testResult.result_status,\n };\n\n if (testResult.patient_number) {\n ctx.patient_number = testResult.patient_number;\n }\n if (testResult.appointment_code) {\n ctx.appointment_code = testResult.appointment_code;\n }\n\n return ctx;\n}\n\nexport function withAppointmentCode(\n context: SurveyContext,\n appointmentCode?: string | null\n): SurveyContext {\n const code = appointmentCode?.trim();\n if (!code) return context;\n return { ...context, appointment_code: code };\n}\n\nexport function getSurveyKey(\n collectionChannel: string | undefined,\n isFreeConsultant: boolean\n): SurveyKeyName {\n const channel = (collectionChannel ?? 'psc').toLowerCase();\n\n if (channel === 'hbc') {\n return isFreeConsultant\n ? SurveyKey.HBC_WITH_CONSULT\n : SurveyKey.HBC_NO_CONSULT;\n }\n\n return isFreeConsultant\n ? SurveyKey.PSC_WITH_CONSULT\n : SurveyKey.PSC_NO_CONSULT;\n}\n\nexport function getSurveySlug(\n collectionChannel: string | undefined,\n isFreeConsultant: boolean,\n config: SurveyListConfig = DEFAULT_SURVEY_LIST\n): string {\n const key = getSurveyKey(collectionChannel, isFreeConsultant);\n return config[key]?.slug ?? DEFAULT_SURVEY_LIST[key].slug;\n}\n\nexport function isSurveyEnabledForTestResult(\n npsTestResult: boolean | undefined,\n collectionChannel: string | undefined,\n isFreeConsultant: boolean,\n config: SurveyListConfig = DEFAULT_SURVEY_LIST\n): boolean {\n const key = getSurveyKey(collectionChannel, isFreeConsultant);\n const cdnEnabled = config[key]?.enabled ?? DEFAULT_SURVEY_LIST[key].enabled;\n return (SURVEY_FORCE_ENABLE || npsTestResult === true) && cdnEnabled;\n}\n\nexport function isTeledocSurveyEnabled(\n npsDoctorConsult: boolean | undefined,\n config: SurveyListConfig = DEFAULT_SURVEY_LIST\n): boolean {\n const cdnEnabled =\n config[SurveyKey.TELEDOC]?.enabled ??\n DEFAULT_SURVEY_LIST[SurveyKey.TELEDOC].enabled;\n return (SURVEY_FORCE_ENABLE || npsDoctorConsult === true) && cdnEnabled;\n}\n\n/** Survey app origin from fill base URL (`.../surveys` or host root). */\nexport function surveyAppOrigin(surveyBaseUrl: string): string {\n const trimmed = surveyBaseUrl.replace(/\\/$/, '');\n if (trimmed.endsWith('/surveys')) {\n return trimmed.slice(0, -'/surveys'.length);\n }\n try {\n return new URL(trimmed).origin;\n } catch {\n return trimmed;\n }\n}\n\nexport async function mintSurveyEmbedKey(\n surveyBaseUrl: string,\n slug: string,\n context: SurveyContext\n): Promise<string> {\n const origin = surveyAppOrigin(surveyBaseUrl);\n const res = await fetch(`${origin}/embed-context`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ slug, context, embed: true }),\n });\n if (!res.ok) {\n throw new Error('embed-context mint failed');\n }\n const json = (await res.json()) as {\n key?: string;\n data?: { key?: string };\n };\n const key = json.data?.key ?? json.key;\n if (!key) {\n throw new Error('embed-context mint missing key');\n }\n return key;\n}\n"],"names":["buildTestResultSurveyContext","testResult","source","ctx","withAppointmentCode","context","appointmentCode","code","__spreadProps","__spreadValues","getSurveyKey","collectionChannel","isFreeConsultant","SurveyKey","getSurveySlug","config","DEFAULT_SURVEY_LIST","key","_b","_a","isSurveyEnabledForTestResult","npsTestResult","cdnEnabled","SURVEY_FORCE_ENABLE","isTeledocSurveyEnabled","npsDoctorConsult","surveyAppOrigin","surveyBaseUrl","trimmed","e","mintSurveyEmbedKey","slug","origin","res","json"],"mappings":"+kBAiBgB,SAAAA,EACdC,EACAC,EAAS,cACM,CACf,MAAMC,EAAqB,CACzB,OAAAD,EACA,SAAUD,EAAW,SACrB,cAAeA,EAAW,cAC1B,cAAeA,EAAW,aAAA,EAG5B,OAAIA,EAAW,iBACbE,EAAI,eAAiBF,EAAW,gBAE9BA,EAAW,mBACbE,EAAI,iBAAmBF,EAAW,kBAG7BE,CACT,CAEgB,SAAAC,EACdC,EACAC,EACe,CACT,MAAAC,EAAOD,GAAA,YAAAA,EAAiB,OAC9B,OAAKC,EACEC,EAAAC,EAAA,GAAKJ,GAAL,CAAc,iBAAkBE,CAAK,GAD1BF,CAEpB,CAEgB,SAAAK,EACdC,EACAC,EACe,CAGf,OAFiBD,GAAA,KAAAA,EAAqB,OAAO,YAAY,IAEzC,MACPC,EACHC,EAAU,UAAA,iBACVA,EAAAA,UAAU,eAGTD,EACHC,EAAU,UAAA,iBACVA,EAAAA,UAAU,cAChB,CAEO,SAASC,EACdH,EACAC,EACAG,EAA2BC,EAAAA,oBACnB,SACF,MAAAC,EAAMP,EAAaC,EAAmBC,CAAgB,EAC5D,OAAOM,GAAAC,EAAAJ,EAAOE,CAAG,IAAV,YAAAE,EAAa,OAAb,KAAAD,EAAqBF,EAAAA,oBAAoBC,CAAG,EAAE,IACvD,CAEO,SAASG,EACdC,EACAV,EACAC,EACAG,EAA2BC,EAAAA,oBAClB,SACH,MAAAC,EAAMP,EAAaC,EAAmBC,CAAgB,EACtDU,GAAaJ,GAAAC,EAAAJ,EAAOE,CAAG,IAAV,YAAAE,EAAa,UAAb,KAAAD,EAAwBF,sBAAoBC,CAAG,EAAE,QAC5D,OAAAM,EAAA,qBAAuBF,IAAkB,KAASC,CAC5D,CAEgB,SAAAE,EACdC,EACAV,EAA2BC,sBAClB,SACH,MAAAM,GACJJ,GAAAC,EAAAJ,EAAOF,EAAU,UAAA,OAAO,IAAxB,YAAAM,EAA2B,UAA3B,KAAAD,EACAF,EAAAA,oBAAoBH,EAAU,UAAA,OAAO,EAAE,QACjC,OAAAU,EAAA,qBAAuBE,IAAqB,KAASH,CAC/D,CAGO,SAASI,EAAgBC,EAA+B,CAC7D,MAAMC,EAAUD,EAAc,QAAQ,MAAO,EAAE,EAC3C,GAAAC,EAAQ,SAAS,UAAU,EAC7B,OAAOA,EAAQ,MAAM,EAAG,EAAkB,EAExC,GAAA,CACK,OAAA,IAAI,IAAIA,CAAO,EAAE,MAAA,OACxBC,EAAA,CACO,OAAAD,CACT,CACF,CAEsB,eAAAE,EACpBH,EACAI,EACA1B,EACiB,SACX,MAAA2B,EAASN,EAAgBC,CAAa,EACtCM,EAAM,MAAM,MAAM,GAAGD,kBAAwB,CACjD,OAAQ,OACR,QAAS,CAAE,eAAgB,kBAAmB,EAC9C,KAAM,KAAK,UAAU,CAAE,KAAAD,EAAM,QAAA1B,EAAS,MAAO,GAAM,CAAA,CACpD,EACG,GAAA,CAAC4B,EAAI,GACD,MAAA,IAAI,MAAM,2BAA2B,EAEvC,MAAAC,EAAQ,MAAMD,EAAI,OAIlBhB,GAAMC,GAAAC,EAAAe,EAAK,OAAL,YAAAf,EAAW,MAAX,KAAAD,EAAkBgB,EAAK,IACnC,GAAI,CAACjB,EACG,MAAA,IAAI,MAAM,gCAAgC,EAE3C,OAAAA,CACT"}
@@ -1,74 +1,80 @@
1
- var S = Object.defineProperty, b = Object.defineProperties;
1
+ var S = Object.defineProperty, E = Object.defineProperties;
2
2
  var T = Object.getOwnPropertyDescriptors;
3
- var d = Object.getOwnPropertySymbols;
4
- var g = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable;
5
- var m = (e, t, r) => t in e ? S(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, a = (e, t) => {
6
- for (var r in t || (t = {}))
7
- g.call(t, r) && m(e, r, t[r]);
8
- if (d)
9
- for (var r of d(t))
10
- E.call(t, r) && m(e, r, t[r]);
3
+ var y = Object.getOwnPropertySymbols;
4
+ var O = Object.prototype.hasOwnProperty, g = Object.prototype.propertyIsEnumerable;
5
+ var _ = (e, t, n) => t in e ? S(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, m = (e, t) => {
6
+ for (var n in t || (t = {}))
7
+ O.call(t, n) && _(e, n, t[n]);
8
+ if (y)
9
+ for (var n of y(t))
10
+ g.call(t, n) && _(e, n, t[n]);
11
11
  return e;
12
- }, f = (e, t) => b(e, T(t));
13
- import { SURVEY_FORCE_ENABLE as O } from "../constants/Common.mjs";
14
- import { DEFAULT_SURVEY_LIST as y, SurveyKey as s } from "../constants/SurveyKeys.mjs";
15
- function N(e, t = "test-result") {
16
- const r = {
12
+ }, f = (e, t) => E(e, T(t));
13
+ import { SURVEY_FORCE_ENABLE as b } from "../constants/Common.mjs";
14
+ import { DEFAULT_SURVEY_LIST as c, SurveyKey as u } from "../constants/SurveyKeys.mjs";
15
+ function l(e, t = "test-result") {
16
+ const n = {
17
17
  source: t,
18
18
  order_id: e.order_id,
19
19
  template_type: e.template_type,
20
20
  result_status: e.result_status
21
21
  };
22
- return e.patient_number && (r.patient_number = e.patient_number), e.appointment_code && (r.appointment_code = e.appointment_code), r;
22
+ return e.patient_number && (n.patient_number = e.patient_number), e.appointment_code && (n.appointment_code = e.appointment_code), n;
23
23
  }
24
- function U(e, t) {
25
- const r = t == null ? void 0 : t.trim();
26
- return r ? f(a({}, e), { appointment_code: r }) : e;
24
+ function N(e, t) {
25
+ const n = t == null ? void 0 : t.trim();
26
+ return n ? f(m({}, e), { appointment_code: n }) : e;
27
27
  }
28
28
  function p(e, t) {
29
- return (e != null ? e : "psc").toLowerCase() === "hbc" ? t ? s.HBC_WITH_CONSULT : s.HBC_NO_CONSULT : t ? s.PSC_WITH_CONSULT : s.PSC_NO_CONSULT;
29
+ return (e != null ? e : "psc").toLowerCase() === "hbc" ? t ? u.HBC_WITH_CONSULT : u.HBC_NO_CONSULT : t ? u.PSC_WITH_CONSULT : u.PSC_NO_CONSULT;
30
30
  }
31
- function k(e, t, r = y) {
32
- var n, i;
33
- const o = p(e, t);
34
- return (i = (n = r[o]) == null ? void 0 : n.slug) != null ? i : y[o].slug;
31
+ function U(e, t, n = c) {
32
+ var r, o;
33
+ const i = p(e, t);
34
+ return (o = (r = n[i]) == null ? void 0 : r.slug) != null ? o : c[i].slug;
35
35
  }
36
- function x(e, t, r, o = y) {
37
- var u, c;
38
- const n = p(t, r), i = (c = (u = o[n]) == null ? void 0 : u.enabled) != null ? c : y[n].enabled;
39
- return (O || e === !0) && i;
36
+ function k(e, t, n, i = c) {
37
+ var s, d;
38
+ const r = p(t, n), o = (d = (s = i[r]) == null ? void 0 : s.enabled) != null ? d : c[r].enabled;
39
+ return (b || e === !0) && o;
40
40
  }
41
- function v(e) {
41
+ function C(e, t = c) {
42
+ var i, r;
43
+ const n = (r = (i = t[u.TELEDOC]) == null ? void 0 : i.enabled) != null ? r : c[u.TELEDOC].enabled;
44
+ return (b || e === !0) && n;
45
+ }
46
+ function L(e) {
42
47
  const t = e.replace(/\/$/, "");
43
48
  if (t.endsWith("/surveys"))
44
49
  return t.slice(0, -8);
45
50
  try {
46
51
  return new URL(t).origin;
47
- } catch (r) {
52
+ } catch (n) {
48
53
  return t;
49
54
  }
50
55
  }
51
- async function A(e, t, r) {
52
- var c, _;
53
- const o = v(e), n = await fetch(`${o}/embed-context`, {
56
+ async function x(e, t, n) {
57
+ var d, a;
58
+ const i = L(e), r = await fetch(`${i}/embed-context`, {
54
59
  method: "POST",
55
60
  headers: { "Content-Type": "application/json" },
56
- body: JSON.stringify({ slug: t, context: r, embed: !0 })
61
+ body: JSON.stringify({ slug: t, context: n, embed: !0 })
57
62
  });
58
- if (!n.ok)
63
+ if (!r.ok)
59
64
  throw new Error("embed-context mint failed");
60
- const i = await n.json(), u = (_ = (c = i.data) == null ? void 0 : c.key) != null ? _ : i.key;
61
- if (!u)
65
+ const o = await r.json(), s = (a = (d = o.data) == null ? void 0 : d.key) != null ? a : o.key;
66
+ if (!s)
62
67
  throw new Error("embed-context mint missing key");
63
- return u;
68
+ return s;
64
69
  }
65
70
  export {
66
- N as buildTestResultSurveyContext,
71
+ l as buildTestResultSurveyContext,
67
72
  p as getSurveyKey,
68
- k as getSurveySlug,
69
- x as isSurveyEnabledForTestResult,
70
- A as mintSurveyEmbedKey,
71
- v as surveyAppOrigin,
72
- U as withAppointmentCode
73
+ U as getSurveySlug,
74
+ k as isSurveyEnabledForTestResult,
75
+ C as isTeledocSurveyEnabled,
76
+ x as mintSurveyEmbedKey,
77
+ L as surveyAppOrigin,
78
+ N as withAppointmentCode
73
79
  };
74
80
  //# sourceMappingURL=SurveyHelper.mjs.map