@openmrs/esm-form-engine-lib 3.1.3-pre.1738 → 3.1.3-pre.1744

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 +1 @@
1
- var _openmrs_esm_form_engine_lib;(()=>{"use strict";var e,r,t,n,o,i,a,l,s,u,f,p,d,c,h,m,v,g,b,y,w,_={8008:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(991),t.e(782),t.e(72),t.e(465),t.e(299),t.e(929)]).then((()=>()=>t(2929)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),i=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>i})}},P={};function S(e){var r=P[e];if(void 0!==r)return r.exports;var t=P[e]={id:e,loaded:!1,exports:{}};return _[e].call(t.exports,t,t.exports,S),t.loaded=!0,t.exports}S.m=_,S.c=P,S.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return S.d(r,{a:r}),r},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,S.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var o=Object.create(null);S.r(o);var i={};e=e||[null,r({}),r([]),r(r)];for(var a=2&n&&t;"object"==typeof a&&!~e.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach((e=>i[e]=()=>t[e]));return i.default=()=>t,S.d(o,i),o},S.d=(e,r)=>{for(var t in r)S.o(r,t)&&!S.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},S.f={},S.e=e=>Promise.all(Object.keys(S.f).reduce(((r,t)=>(S.f[t](e,r),r)),[])),S.u=e=>e+".js",S.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),S.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="@openmrs/esm-form-engine-lib:",S.l=(e,r,o,i)=>{if(t[e])t[e].push(r);else{var a,l;if(void 0!==o)for(var s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var f=s[u];if(f.getAttribute("src")==e||f.getAttribute("data-webpack")==n+o){a=f;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,S.nc&&a.setAttribute("nonce",S.nc),a.setAttribute("data-webpack",n+o),a.src=e),t[e]=[r];var p=(r,n)=>{a.onerror=a.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(n))),r)return r(n)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),l&&document.head.appendChild(a)}},S.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},S.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{S.S={};var e={},r={};S.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];S.o(S.S,t)||(S.S[t]={});var i=S.S[t],a="@openmrs/esm-form-engine-lib",l=(e,r,t,n)=>{var o=i[e]=i[e]||{},l=o[r];(!l||!l.loaded&&(!n!=!l.eager?n:a>l.from))&&(o[r]={get:t,from:a,eager:!!n})},s=[];return"default"===t&&(l("@openmrs/esm-framework","6.0.3-pre.2587",(()=>Promise.all([S.e(151),S.e(72),S.e(766)]).then((()=>()=>S(5151))))),l("@openmrs/esm-patient-common-lib","9.0.1-pre.6367",(()=>Promise.all([S.e(505),S.e(991),S.e(72),S.e(465),S.e(299),S.e(499)]).then((()=>()=>S(5505))))),l("dayjs","1.11.13",(()=>S.e(353).then((()=>()=>S(4353))))),l("i18next","23.16.0",(()=>S.e(635).then((()=>()=>S(2635))))),l("react-i18next","11.18.6",(()=>Promise.all([S.e(184),S.e(72)]).then((()=>()=>S(4422))))),l("react","18.3.1",(()=>S.e(540).then((()=>()=>S(6540))))),l("swr/_internal","2.2.5",(()=>Promise.all([S.e(993),S.e(72)]).then((()=>()=>S(4993))))),l("swr/immutable","2.2.5",(()=>Promise.all([S.e(72),S.e(465),S.e(225)]).then((()=>()=>S(4225))))),l("swr/infinite","2.2.5",(()=>Promise.all([S.e(72),S.e(465),S.e(41)]).then((()=>()=>S(3041)))))),e[t]=s.length?Promise.all(s).then((()=>e[t]=1)):1}}})(),(()=>{var e;S.g.importScripts&&(e=S.g.location+"");var r=S.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),S.p=e})(),o=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},i=(e,r)=>{e=o(e),r=o(r);for(var t=0;;){if(t>=e.length)return t<r.length&&"u"!=(typeof r[t])[0];var n=e[t],i=(typeof n)[0];if(t>=r.length)return"u"==i;var a=r[t],l=(typeof a)[0];if(i!=l)return"o"==i&&"n"==l||"s"==l||"u"==i;if("o"!=i&&"u"!=i&&n!=a)return n<a;t++}},a=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,o=1;o<e.length;o++)n--,t+="u"==(typeof(l=e[o]))[0]?"-":(n>0?".":"")+(n=2,l);return t}var i=[];for(o=1;o<e.length;o++){var l=e[o];i.push(0===l?"not("+s()+")":1===l?"("+s()+" || "+s()+")":2===l?i.pop()+" "+i.pop():a(l))}return s();function s(){return i.pop().replace(/^\((.+)\)$/,"$1")}},l=(e,r)=>{if(0 in e){r=o(r);var t=e[0],n=t<0;n&&(t=-t-1);for(var i=0,a=1,s=!0;;a++,i++){var u,f,p=a<e.length?(typeof e[a])[0]:"";if(i>=r.length||"o"==(f=(typeof(u=r[i]))[0]))return!s||("u"==p?a>t&&!n:""==p!=n);if("u"==f){if(!s||"u"!=p)return!1}else if(s)if(p==f)if(a<=t){if(u!=e[a])return!1}else{if(n?u>e[a]:u<e[a])return!1;u!=e[a]&&(s=!1)}else if("s"!=p&&"n"!=p){if(n||a<=t)return!1;s=!1,a--}else{if(a<=t||f<p!=n)return!1;s=!1}else"s"!=p&&"n"!=p&&(s=!1,a--)}}var d=[],c=d.pop.bind(d);for(i=1;i<e.length;i++){var h=e[i];d.push(1==h?c()|c():2==h?c()&c():h?l(h,r):!c())}return!!c()},s=(e,r)=>e&&S.o(e,r),u=e=>(e.loaded=1,e.get()),f=e=>Object.keys(e).reduce(((r,t)=>(e[t].eager&&(r[t]=e[t]),r)),{}),p=(e,r,t)=>{var n=t?f(e[r]):e[r];return Object.keys(n).reduce(((e,r)=>!e||!n[e].loaded&&i(e,r)?r:e),0)},d=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+a(n)+")",c=e=>{throw new Error(e)},h=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},m=(e,r,t)=>t?t():((e,r)=>c("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),v=(e=>function(r,t,n,o,i){var a=S.I(r);return a&&a.then&&!n?a.then(e.bind(e,r,S.S[r],t,!1,o,i)):e(r,S.S[r],t,n,o,i)})(((e,r,t,n,o,i)=>{if(!s(r,t))return m(e,t,i);var a=p(r,t,n);return l(o,a)||h(d(r,t,a,o)),u(r[t][a])})),g={},b={6072:()=>v("default","react",!1,[1,18],(()=>S.e(540).then((()=>()=>S(6540))))),6766:()=>v("default","i18next",!1,[1,23],(()=>S.e(635).then((()=>()=>S(2635))))),8465:()=>v("default","swr/_internal",!1,[1,2],(()=>S.e(993).then((()=>()=>S(4993))))),2731:()=>v("default","@openmrs/esm-patient-common-lib",!1,[1,9],(()=>S.e(505).then((()=>()=>S(5505))))),3941:()=>v("default","react-i18next",!1,[1,11],(()=>S.e(184).then((()=>()=>S(4422))))),9197:()=>v("default","@openmrs/esm-framework",!1,[1,6],(()=>Promise.all([S.e(151),S.e(766)]).then((()=>()=>S(5151))))),4209:()=>v("default","swr/immutable",!1,[1,2],(()=>S.e(606).then((()=>()=>S(4225))))),231:()=>v("default","dayjs",!1,[1,1],(()=>S.e(353).then((()=>()=>S(4353))))),6339:()=>v("default","swr/infinite",!1,[1,2],(()=>S.e(422).then((()=>()=>S(3041)))))},y={72:[6072],299:[2731,3941,9197],465:[8465],499:[4209],766:[6766],929:[231,4209,6339]},w={},S.f.consumes=(e,r)=>{S.o(y,e)&&y[e].forEach((e=>{if(S.o(g,e))return r.push(g[e]);if(!w[e]){var t=r=>{g[e]=0,S.m[e]=t=>{delete S.c[e],t.exports=r()}};w[e]=!0;var n=r=>{delete g[e],S.m[e]=t=>{throw delete S.c[e],r}};try{var o=b[e]();o.then?r.push(g[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}}))},(()=>{var e={719:0};S.f.j=(r,t)=>{var n=S.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(/^(299|465|72|766)$/.test(r))e[r]=0;else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var i=S.p+S.u(r),a=new Error;S.l(i,(t=>{if(S.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;a.message="Loading chunk "+r+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,n[1](a)}}),"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[i,a,l]=t,s=0;if(i.some((r=>0!==e[r]))){for(n in a)S.o(a,n)&&(S.m[n]=a[n]);l&&l(S)}for(r&&r(t);s<i.length;s++)o=i[s],S.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=globalThis.webpackChunk_openmrs_esm_form_engine_lib=globalThis.webpackChunk_openmrs_esm_form_engine_lib||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),S.nc=void 0;var j=S(8008);_openmrs_esm_form_engine_lib=j})();
1
+ var _openmrs_esm_form_engine_lib;(()=>{"use strict";var e,r,t,n,o,i,a,l,s,u,f,p,d,c,h,m,v,g,b,y,w,_={8008:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(187),t.e(782),t.e(72),t.e(465),t.e(299),t.e(929)]).then((()=>()=>t(2929)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),i=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>i})}},P={};function S(e){var r=P[e];if(void 0!==r)return r.exports;var t=P[e]={id:e,loaded:!1,exports:{}};return _[e].call(t.exports,t,t.exports,S),t.loaded=!0,t.exports}S.m=_,S.c=P,S.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return S.d(r,{a:r}),r},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,S.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var o=Object.create(null);S.r(o);var i={};e=e||[null,r({}),r([]),r(r)];for(var a=2&n&&t;"object"==typeof a&&!~e.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach((e=>i[e]=()=>t[e]));return i.default=()=>t,S.d(o,i),o},S.d=(e,r)=>{for(var t in r)S.o(r,t)&&!S.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},S.f={},S.e=e=>Promise.all(Object.keys(S.f).reduce(((r,t)=>(S.f[t](e,r),r)),[])),S.u=e=>e+".js",S.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),S.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="@openmrs/esm-form-engine-lib:",S.l=(e,r,o,i)=>{if(t[e])t[e].push(r);else{var a,l;if(void 0!==o)for(var s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var f=s[u];if(f.getAttribute("src")==e||f.getAttribute("data-webpack")==n+o){a=f;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,S.nc&&a.setAttribute("nonce",S.nc),a.setAttribute("data-webpack",n+o),a.src=e),t[e]=[r];var p=(r,n)=>{a.onerror=a.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(n))),r)return r(n)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),l&&document.head.appendChild(a)}},S.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},S.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{S.S={};var e={},r={};S.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];S.o(S.S,t)||(S.S[t]={});var i=S.S[t],a="@openmrs/esm-form-engine-lib",l=(e,r,t,n)=>{var o=i[e]=i[e]||{},l=o[r];(!l||!l.loaded&&(!n!=!l.eager?n:a>l.from))&&(o[r]={get:t,from:a,eager:!!n})},s=[];return"default"===t&&(l("@openmrs/esm-framework","6.2.1-pre.2794",(()=>Promise.all([S.e(151),S.e(72),S.e(766)]).then((()=>()=>S(5151))))),l("@openmrs/esm-patient-common-lib","9.2.3-pre.7022",(()=>Promise.all([S.e(560),S.e(187),S.e(72),S.e(465),S.e(299),S.e(499)]).then((()=>()=>S(9560))))),l("dayjs","1.11.13",(()=>S.e(353).then((()=>()=>S(4353))))),l("i18next","23.16.0",(()=>S.e(635).then((()=>()=>S(2635))))),l("react-i18next","11.18.6",(()=>Promise.all([S.e(184),S.e(72)]).then((()=>()=>S(4422))))),l("react","18.3.1",(()=>S.e(540).then((()=>()=>S(6540))))),l("swr/_internal","2.2.5",(()=>Promise.all([S.e(993),S.e(72)]).then((()=>()=>S(4993))))),l("swr/immutable","2.2.5",(()=>Promise.all([S.e(72),S.e(465),S.e(225)]).then((()=>()=>S(4225))))),l("swr/infinite","2.2.5",(()=>Promise.all([S.e(72),S.e(465),S.e(422)]).then((()=>()=>S(3041)))))),e[t]=s.length?Promise.all(s).then((()=>e[t]=1)):1}}})(),(()=>{var e;S.g.importScripts&&(e=S.g.location+"");var r=S.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),S.p=e})(),o=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},i=(e,r)=>{e=o(e),r=o(r);for(var t=0;;){if(t>=e.length)return t<r.length&&"u"!=(typeof r[t])[0];var n=e[t],i=(typeof n)[0];if(t>=r.length)return"u"==i;var a=r[t],l=(typeof a)[0];if(i!=l)return"o"==i&&"n"==l||"s"==l||"u"==i;if("o"!=i&&"u"!=i&&n!=a)return n<a;t++}},a=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,o=1;o<e.length;o++)n--,t+="u"==(typeof(l=e[o]))[0]?"-":(n>0?".":"")+(n=2,l);return t}var i=[];for(o=1;o<e.length;o++){var l=e[o];i.push(0===l?"not("+s()+")":1===l?"("+s()+" || "+s()+")":2===l?i.pop()+" "+i.pop():a(l))}return s();function s(){return i.pop().replace(/^\((.+)\)$/,"$1")}},l=(e,r)=>{if(0 in e){r=o(r);var t=e[0],n=t<0;n&&(t=-t-1);for(var i=0,a=1,s=!0;;a++,i++){var u,f,p=a<e.length?(typeof e[a])[0]:"";if(i>=r.length||"o"==(f=(typeof(u=r[i]))[0]))return!s||("u"==p?a>t&&!n:""==p!=n);if("u"==f){if(!s||"u"!=p)return!1}else if(s)if(p==f)if(a<=t){if(u!=e[a])return!1}else{if(n?u>e[a]:u<e[a])return!1;u!=e[a]&&(s=!1)}else if("s"!=p&&"n"!=p){if(n||a<=t)return!1;s=!1,a--}else{if(a<=t||f<p!=n)return!1;s=!1}else"s"!=p&&"n"!=p&&(s=!1,a--)}}var d=[],c=d.pop.bind(d);for(i=1;i<e.length;i++){var h=e[i];d.push(1==h?c()|c():2==h?c()&c():h?l(h,r):!c())}return!!c()},s=(e,r)=>e&&S.o(e,r),u=e=>(e.loaded=1,e.get()),f=e=>Object.keys(e).reduce(((r,t)=>(e[t].eager&&(r[t]=e[t]),r)),{}),p=(e,r,t)=>{var n=t?f(e[r]):e[r];return Object.keys(n).reduce(((e,r)=>!e||!n[e].loaded&&i(e,r)?r:e),0)},d=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+a(n)+")",c=e=>{throw new Error(e)},h=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},m=(e,r,t)=>t?t():((e,r)=>c("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),v=(e=>function(r,t,n,o,i){var a=S.I(r);return a&&a.then&&!n?a.then(e.bind(e,r,S.S[r],t,!1,o,i)):e(r,S.S[r],t,n,o,i)})(((e,r,t,n,o,i)=>{if(!s(r,t))return m(e,t,i);var a=p(r,t,n);return l(o,a)||h(d(r,t,a,o)),u(r[t][a])})),g={},b={6072:()=>v("default","react",!1,[1,18],(()=>S.e(540).then((()=>()=>S(6540))))),6766:()=>v("default","i18next",!1,[1,23],(()=>S.e(635).then((()=>()=>S(2635))))),8465:()=>v("default","swr/_internal",!1,[1,2],(()=>S.e(993).then((()=>()=>S(4993))))),2731:()=>v("default","@openmrs/esm-patient-common-lib",!1,[1,9],(()=>S.e(560).then((()=>()=>S(9560))))),3941:()=>v("default","react-i18next",!1,[1,11],(()=>S.e(184).then((()=>()=>S(4422))))),9197:()=>v("default","@openmrs/esm-framework",!1,[1,6],(()=>Promise.all([S.e(151),S.e(766)]).then((()=>()=>S(5151))))),4209:()=>v("default","swr/immutable",!1,[1,2],(()=>S.e(606).then((()=>()=>S(4225))))),231:()=>v("default","dayjs",!1,[1,1],(()=>S.e(353).then((()=>()=>S(4353))))),6339:()=>v("default","swr/infinite",!1,[1,2],(()=>S.e(41).then((()=>()=>S(3041)))))},y={72:[6072],299:[2731,3941,9197],465:[8465],499:[4209],766:[6766],929:[231,4209,6339]},w={},S.f.consumes=(e,r)=>{S.o(y,e)&&y[e].forEach((e=>{if(S.o(g,e))return r.push(g[e]);if(!w[e]){var t=r=>{g[e]=0,S.m[e]=t=>{delete S.c[e],t.exports=r()}};w[e]=!0;var n=r=>{delete g[e],S.m[e]=t=>{throw delete S.c[e],r}};try{var o=b[e]();o.then?r.push(g[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}}))},(()=>{var e={719:0};S.f.j=(r,t)=>{var n=S.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(/^(299|465|72|766)$/.test(r))e[r]=0;else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var i=S.p+S.u(r),a=new Error;S.l(i,(t=>{if(S.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;a.message="Loading chunk "+r+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,n[1](a)}}),"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[i,a,l]=t,s=0;if(i.some((r=>0!==e[r]))){for(n in a)S.o(a,n)&&(S.m[n]=a[n]);l&&l(S)}for(r&&r(t);s<i.length;s++)o=i[s],S.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=globalThis.webpackChunk_openmrs_esm_form_engine_lib=globalThis.webpackChunk_openmrs_esm_form_engine_lib||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),S.nc=void 0;var j=S(8008);_openmrs_esm_form_engine_lib=j})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-form-engine-lib",
3
- "version": "3.1.3-pre.1738",
3
+ "version": "3.1.3-pre.1744",
4
4
  "description": "React Form Engine for O3",
5
5
  "browser": "dist/openmrs-esm-form-engine-lib.js",
6
6
  "main": "src/index.ts",
@@ -16,7 +16,7 @@
16
16
  "coverage": "yarn test --coverage",
17
17
  "analyze": "webpack --mode=production --env.analyze=true",
18
18
  "prepare": "husky install",
19
- "extract-translations": "i18next 'src/**/*.component.tsx' --config './tools/i18next-parser.config.js'"
19
+ "extract-translations": "i18next 'src/**/*.component.tsx' 'src/**/*.ts' --config './tools/i18next-parser.config.js'"
20
20
  },
21
21
  "browserslist": [
22
22
  "extends browserslist-config-openmrs"
@@ -1,4 +1,4 @@
1
- import { openmrsFetch, OpenmrsResource, restBaseUrl } from '@openmrs/esm-framework';
1
+ import { openmrsFetch, type OpenmrsResource, restBaseUrl } from '@openmrs/esm-framework';
2
2
  import { BaseOpenMRSDataSource } from './data-source';
3
3
 
4
4
  export class SelectConceptAnswersDatasource extends BaseOpenMRSDataSource {
@@ -1,4 +1,3 @@
1
1
  declare module '@carbon/react';
2
2
  declare module '*.css';
3
3
  declare module '*.scss';
4
- declare type SideNavProps = {};
@@ -4,12 +4,14 @@ import { getPatientEnrolledPrograms, saveProgramEnrollment } from '../api';
4
4
  import { type PostSubmissionAction, type PatientProgramPayload } from '../types';
5
5
  import { formEngineAppName } from '../globals';
6
6
  import { extractErrorMessagesFromResponse } from '../utils/error-utils';
7
+ import { type TOptions } from 'i18next';
7
8
 
8
9
  export const ProgramEnrollmentSubmissionAction: PostSubmissionAction = {
9
10
  applyAction: async function ({ patient, encounters, sessionMode }, config) {
10
11
  const encounter = encounters[0];
11
12
  const encounterLocation = encounter.location['uuid'];
12
- const translateFn = (key, defaultValue?) => translateFrom(formEngineAppName, key, defaultValue);
13
+ const t = (key: string, defaultValue: string, options?: Omit<TOptions, 'ns' | 'defaultValue'>) =>
14
+ translateFrom(formEngineAppName, key, defaultValue, options);
13
15
  const programUuid = config.programUuid;
14
16
 
15
17
  if (sessionMode === 'view') {
@@ -49,8 +51,8 @@ export const ProgramEnrollmentSubmissionAction: PostSubmissionAction = {
49
51
  };
50
52
  } else {
51
53
  showSnackbar({
52
- title: translateFn('enrollmentDiscontinuationNotAllowed', 'Enrollment discontinuation not allowed'),
53
- subtitle: translateFn('cannotDiscontinueEnrollment', 'Cannot discontinue an enrollment that does not exist'),
54
+ title: t('enrollmentDiscontinuationNotAllowed', 'Enrollment discontinuation not allowed'),
55
+ subtitle: t('cannotDiscontinueEnrollment', 'Cannot discontinue an enrollment that does not exist'),
54
56
  kind: 'error',
55
57
  isLowContrast: false,
56
58
  });
@@ -63,8 +65,8 @@ export const ProgramEnrollmentSubmissionAction: PostSubmissionAction = {
63
65
  // The patient is already enrolled in the program and there is no completion date provided.
64
66
  if (sessionMode === 'enter') {
65
67
  showSnackbar({
66
- title: translateFn('enrollmentNotAllowed', 'Enrollment not allowed'),
67
- subtitle: translateFn(
68
+ title: t('enrollmentNotAllowed', 'Enrollment not allowed'),
69
+ subtitle: t(
68
70
  'alreadyEnrolledDescription',
69
71
  'This patient is already enrolled in the selected program and cannot be enrolled again.',
70
72
  ),
@@ -77,8 +79,8 @@ export const ProgramEnrollmentSubmissionAction: PostSubmissionAction = {
77
79
  // The enrollment has already been completed
78
80
  if (sessionMode === 'enter') {
79
81
  showSnackbar({
80
- title: translateFn('enrollmentAlreadyDiscontinued', 'Enrollment already discontinued'),
81
- subtitle: translateFn(
82
+ title: t('enrollmentAlreadyDiscontinued', 'Enrollment already discontinued'),
83
+ subtitle: t(
82
84
  'alreadyDiscontinuedDescription',
83
85
  'This patient is already enrolled in the selected program and has already been discontinued.',
84
86
  ),
@@ -93,13 +95,13 @@ export const ProgramEnrollmentSubmissionAction: PostSubmissionAction = {
93
95
  (response) => {
94
96
  showSnackbar({
95
97
  kind: 'success',
96
- title: getSnackTitle(translateFn, response),
98
+ title: getSnackTitle(t, response),
97
99
  isLowContrast: true,
98
100
  });
99
101
  },
100
102
  (err) => {
101
103
  showSnackbar({
102
- title: translateFn('errorSavingEnrollment', 'Error saving enrollment'),
104
+ title: t('errorSavingEnrollment', 'Error saving enrollment'),
103
105
  subtitle: extractErrorMessagesFromResponse(err).join(', '),
104
106
  kind: 'error',
105
107
  isLowContrast: false,
@@ -109,14 +111,11 @@ export const ProgramEnrollmentSubmissionAction: PostSubmissionAction = {
109
111
  },
110
112
  };
111
113
 
112
- function getSnackTitle(translateFn, response) {
114
+ function getSnackTitle(t, response) {
113
115
  if (response.data.dateCompleted) {
114
- return translateFn(
115
- 'enrollmentDiscontinued',
116
- "The patient's program enrollment has been successfully discontinued.",
117
- );
116
+ return t('enrollmentDiscontinued', "The patient's program enrollment has been successfully discontinued.");
118
117
  }
119
- return translateFn('enrolledToProgram', 'The patient has been successfully enrolled in the program.');
118
+ return t('enrolledToProgram', 'The patient has been successfully enrolled in the program.');
120
119
  }
121
120
 
122
121
  function updateTimeToNow(dateString) {
@@ -31,6 +31,7 @@ import { type FormContextProps } from '../../provider/form-provider';
31
31
  import { useEncounter } from '../../hooks/useEncounter';
32
32
  import { useEncounterRole } from '../../hooks/useEncounterRole';
33
33
  import { usePatientPrograms } from '../../hooks/usePatientPrograms';
34
+ import { type TOptions } from 'i18next';
34
35
 
35
36
  function useCustomHooks(context: Partial<FormProcessorContextProps>) {
36
37
  const [isLoading, setIsLoading] = useState(true);
@@ -110,7 +111,8 @@ export class EncounterFormProcessor extends FormProcessor {
110
111
 
111
112
  async processSubmission(context: FormContextProps, abortController: AbortController) {
112
113
  const { encounterRole, encounterProvider, encounterDate, encounterLocation } = getMutableSessionProps(context);
113
- const translateFn = (key, defaultValue?) => translateFrom(formEngineAppName, key, defaultValue);
114
+ const t = (key: string, defaultValue: string, options?: Omit<TOptions, 'ns' | 'defaultValue'>) =>
115
+ translateFrom(formEngineAppName, key, defaultValue, options);
114
116
  const patientIdentifiers = preparePatientIdentifiers(context.formFields, encounterLocation);
115
117
  const encounter = prepareEncounter(context, encounterDate, encounterRole, encounterProvider, encounterLocation);
116
118
 
@@ -119,7 +121,7 @@ export class EncounterFormProcessor extends FormProcessor {
119
121
  await Promise.all(savePatientIdentifiers(context.patient, patientIdentifiers));
120
122
  if (patientIdentifiers?.length) {
121
123
  showSnackbar({
122
- title: translateFn('patientIdentifiersSaved', 'Patient identifier(s) saved successfully'),
124
+ title: t('patientIdentifiersSaved', 'Patient identifier(s) saved successfully'),
123
125
  kind: 'success',
124
126
  isLowContrast: true,
125
127
  });
@@ -127,7 +129,7 @@ export class EncounterFormProcessor extends FormProcessor {
127
129
  } catch (error) {
128
130
  const errorMessages = extractErrorMessagesFromResponse(error);
129
131
  return Promise.reject({
130
- title: translateFn('errorSavingPatientIdentifiers', 'Error saving patient identifiers'),
132
+ title: t('errorSavingPatientIdentifiers', 'Error saving patient identifiers'),
131
133
  description: errorMessages.join(', '),
132
134
  kind: 'error',
133
135
  critical: true,
@@ -144,7 +146,7 @@ export class EncounterFormProcessor extends FormProcessor {
144
146
  const savedPrograms = await await savePatientPrograms(programs);
145
147
  if (savedPrograms?.length) {
146
148
  showSnackbar({
147
- title: translateFn('patientProgramsSaved', 'Patient program(s) saved successfully'),
149
+ title: t('patientProgramsSaved', 'Patient program(s) saved successfully'),
148
150
  kind: 'success',
149
151
  isLowContrast: true,
150
152
  });
@@ -152,7 +154,7 @@ export class EncounterFormProcessor extends FormProcessor {
152
154
  } catch (error) {
153
155
  const errorMessages = extractErrorMessagesFromResponse(error);
154
156
  return Promise.reject({
155
- title: translateFn('errorSavingPatientPrograms', 'Error saving patient program(s)'),
157
+ title: t('errorSavingPatientPrograms', 'Error saving patient program(s)'),
156
158
  description: errorMessages.join(', '),
157
159
  kind: 'error',
158
160
  critical: true,
@@ -166,7 +168,7 @@ export class EncounterFormProcessor extends FormProcessor {
166
168
  const savedDiagnoses = savedEncounter.diagnoses.map((diagnosis) => diagnosis.display);
167
169
  if (savedOrders.length) {
168
170
  showSnackbar({
169
- title: translateFn('ordersSaved', 'Order(s) saved successfully'),
171
+ title: t('ordersSaved', 'Order(s) saved successfully'),
170
172
  subtitle: savedOrders.join(', '),
171
173
  kind: 'success',
172
174
  isLowContrast: true,
@@ -175,7 +177,7 @@ export class EncounterFormProcessor extends FormProcessor {
175
177
  // handle diagnoses
176
178
  if (savedDiagnoses.length) {
177
179
  showSnackbar({
178
- title: translateFn('diagnosisSaved', 'Diagnosis(es) saved successfully'),
180
+ title: t('diagnosisSaved', 'Diagnosis(es) saved successfully'),
179
181
  subtitle: savedDiagnoses.join(', '),
180
182
  kind: 'success',
181
183
  isLowContrast: true,
@@ -188,7 +190,7 @@ export class EncounterFormProcessor extends FormProcessor {
188
190
  );
189
191
  if (attachmentsResponse?.length) {
190
192
  showSnackbar({
191
- title: translateFn('attachmentsSaved', 'Attachment(s) saved successfully'),
193
+ title: t('attachmentsSaved', 'Attachment(s) saved successfully'),
192
194
  kind: 'success',
193
195
  isLowContrast: true,
194
196
  });
@@ -196,7 +198,7 @@ export class EncounterFormProcessor extends FormProcessor {
196
198
  } catch (error) {
197
199
  const errorMessages = extractErrorMessagesFromResponse(error);
198
200
  return Promise.reject({
199
- title: translateFn('errorSavingAttachments', 'Error saving attachment(s)'),
201
+ title: t('errorSavingAttachments', 'Error saving attachment(s)'),
200
202
  description: errorMessages.join(', '),
201
203
  kind: 'error',
202
204
  critical: true,
@@ -206,7 +208,7 @@ export class EncounterFormProcessor extends FormProcessor {
206
208
  } catch (error) {
207
209
  const errorMessages = extractErrorMessagesFromResponse(error);
208
210
  return Promise.reject({
209
- title: translateFn('errorSavingEncounter', 'Error saving encounter'),
211
+ title: t('errorSavingEncounter', 'Error saving encounter'),
210
212
  description: errorMessages.join(', '),
211
213
  kind: 'error',
212
214
  critical: true,