@openmrs/esm-patient-registration-app 4.0.1-pre.621 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +33 -32
- package/dist/100.js +1 -1
- package/dist/154.js +1 -0
- package/dist/206.js +1 -1
- package/dist/242.js +1 -1
- package/dist/34.js +2 -0
- package/dist/{290.js.LICENSE.txt → 34.js.LICENSE.txt} +13 -2
- package/dist/375.js +1 -0
- package/dist/430.js +2 -0
- package/dist/{103.js.LICENSE.txt → 430.js.LICENSE.txt} +3 -3
- package/dist/470.js +2 -0
- package/dist/{460.js.LICENSE.txt → 470.js.LICENSE.txt} +0 -0
- package/dist/574.js +1 -1
- package/dist/658.js +1 -0
- package/dist/686.js +1 -1
- package/dist/735.js +1 -1
- package/dist/807.js +1 -0
- package/dist/854.js +1 -1
- package/dist/858.js +1 -1
- package/dist/858.js.LICENSE.txt +2 -0
- package/dist/main.js +1 -1
- package/dist/openmrs-esm-patient-registration-app.js +1 -1
- package/dist/openmrs-esm-patient-registration-app.js.buildmanifest.json +126 -101
- package/dist/openmrs-esm-patient-registration-app.old +1 -1
- package/package.json +2 -2
- package/src/add-patient-link.tsx +1 -0
- package/src/config-schema.ts +71 -6
- package/src/index.ts +25 -14
- package/src/patient-registration/field/address/address-hierarchy.component.tsx +64 -19
- package/src/patient-registration/field/address/address-hierarchy.test.tsx +18 -3
- package/src/patient-registration/field/address/address-search.component.tsx +98 -0
- package/src/patient-registration/field/address/address-search.scss +53 -0
- package/src/patient-registration/field/dob/dob.component.tsx +12 -6
- package/src/patient-registration/field/dob/dob.test.tsx +10 -0
- package/src/patient-registration/field/gender/gender-field.component.tsx +7 -0
- package/src/patient-registration/field/name/name-field.component.tsx +13 -5
- package/src/patient-registration/field/person-attributes/person-attribute-field.component.tsx +1 -0
- package/src/patient-registration/field/person-attributes/text-person-attribute-field.component.tsx +3 -0
- package/src/patient-registration/form-manager.test.ts +8 -6
- package/src/patient-registration/form-manager.ts +1 -15
- package/src/patient-registration/input/combo-input/combo-input.component.tsx +38 -26
- package/src/patient-registration/input/combo-input/combo-input.test.tsx +1 -0
- package/src/patient-registration/input/dummy-data/dummy-data-input.component.tsx +8 -6
- package/src/patient-registration/patient-registration-hooks.ts +3 -8
- package/src/patient-registration/patient-registration-types.tsx +3 -6
- package/src/patient-registration/patient-registration-utils.ts +1 -1
- package/src/patient-registration/patient-registration.resource.tsx +74 -1
- package/src/patient-registration/patient-registration.test.tsx +7 -0
- package/src/patient-registration/section/demographics/demographics-section.test.tsx +3 -0
- package/src/patient-registration/section/section-wrapper.component.tsx +10 -1
- package/src/root.component.tsx +10 -7
- package/translations/en.json +20 -8
- package/translations/km.json +89 -0
- package/dist/103.js +0 -2
- package/dist/290.js +0 -2
- package/dist/460.js +0 -2
- package/dist/553.js +0 -2
- package/dist/553.js.LICENSE.txt +0 -14
- package/dist/859.js +0 -1
- package/dist/896.js +0 -1
- package/src/patient-registration/input/comboinput/comboinput.component.tsx +0 -56
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
Copyright (c) 2018 Jed Watson.
|
|
3
|
+
Licensed under the MIT License (MIT), see
|
|
4
|
+
http://jedwatson.github.io/classnames
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/*! *****************************************************************************
|
package/dist/470.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 470.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.webpackChunk_openmrs_esm_patient_registration_app=self.webpackChunk_openmrs_esm_patient_registration_app||[]).push([[470],{4649:(t,e,r)=>{r.d(e,{Z:()=>i});var n=r(8804);const o=function(t,e){for(var r=t.length;r--;)if((0,n.Z)(t[r][0],e))return r;return-1};var u=Array.prototype.splice;function a(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}a.prototype.clear=function(){this.__data__=[],this.size=0},a.prototype.delete=function(t){var e=this.__data__,r=o(e,t);return!(r<0||(r==e.length-1?e.pop():u.call(e,r,1),--this.size,0))},a.prototype.get=function(t){var e=this.__data__,r=o(e,t);return r<0?void 0:e[r][1]},a.prototype.has=function(t){return o(this.__data__,t)>-1},a.prototype.set=function(t,e){var r=this.__data__,n=o(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};const i=a},8896:(t,e,r)=>{r.d(e,{Z:()=>u});var n=r(5546),o=r(3221);const u=(0,n.Z)(o.Z,"Map")},3703:(t,e,r)=>{r.d(e,{Z:()=>d});const n=(0,r(5546).Z)(Object,"create");var o=Object.prototype.hasOwnProperty;var u=Object.prototype.hasOwnProperty;function a(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}a.prototype.clear=function(){this.__data__=n?n(null):{},this.size=0},a.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},a.prototype.get=function(t){var e=this.__data__;if(n){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(e,t)?e[t]:void 0},a.prototype.has=function(t){var e=this.__data__;return n?void 0!==e[t]:u.call(e,t)},a.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this};const i=a;var c=r(4649),f=r(8896);const s=function(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map};function l(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}l.prototype.clear=function(){this.size=0,this.__data__={hash:new i,map:new(f.Z||c.Z),string:new i}},l.prototype.delete=function(t){var e=s(this,t).delete(t);return this.size-=e?1:0,e},l.prototype.get=function(t){return s(this,t).get(t)},l.prototype.has=function(t){return s(this,t).has(t)},l.prototype.set=function(t,e){var r=s(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};const d=l},6218:(t,e,r)=>{r.d(e,{Z:()=>i});var n=r(4649);var o=r(8896),u=r(3703);function a(t){var e=this.__data__=new n.Z(t);this.size=e.size}a.prototype.clear=function(){this.__data__=new n.Z,this.size=0},a.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},a.prototype.get=function(t){return this.__data__.get(t)},a.prototype.has=function(t){return this.__data__.has(t)},a.prototype.set=function(t,e){var r=this.__data__;if(r instanceof n.Z){var a=r.__data__;if(!o.Z||a.length<199)return a.push([t,e]),this.size=++r.size,this;r=this.__data__=new u.Z(a)}return r.set(t,e),this.size=r.size,this};const i=a},187:(t,e,r)=>{r.d(e,{Z:()=>n});const n=r(3221).Z.Symbol},8282:(t,e,r)=>{r.d(e,{Z:()=>n});const n=r(3221).Z.Uint8Array},848:(t,e,r)=>{r.d(e,{Z:()=>f});var n=r(4248),o=r(7885),u=r(4975),a=r(6401),i=r(8127),c=Object.prototype.hasOwnProperty;const f=function(t,e){var r=(0,o.Z)(t),f=!r&&(0,n.Z)(t),s=!r&&!f&&(0,u.Z)(t),l=!r&&!f&&!s&&(0,i.Z)(t),d=r||f||s||l,v=d?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],p=v.length;for(var h in t)!e&&!c.call(t,h)||d&&("length"==h||s&&("offset"==h||"parent"==h)||l&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||(0,a.Z)(h,p))||v.push(h);return v}},5598:(t,e,r)=>{r.d(e,{Z:()=>n});const n=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}},5810:(t,e,r)=>{r.d(e,{Z:()=>n});const n=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}},2938:(t,e,r)=>{r.d(e,{Z:()=>u});var n=r(5810),o=r(7885);const u=function(t,e,r){var u=e(t);return(0,o.Z)(t)?u:(0,n.Z)(u,r(t))}},9001:(t,e,r)=>{r.d(e,{Z:()=>s});var n=r(187),o=Object.prototype,u=o.hasOwnProperty,a=o.toString,i=n.Z?n.Z.toStringTag:void 0;var c=Object.prototype.toString;var f=n.Z?n.Z.toStringTag:void 0;const s=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":f&&f in Object(t)?function(t){var e=u.call(t,i),r=t[i];try{t[i]=void 0;var n=!0}catch(t){}var o=a.call(t);return n&&(e?t[i]=r:delete t[i]),o}(t):function(t){return c.call(t)}(t)}},2342:(t,e,r)=>{r.d(e,{Z:()=>M});var n=r(6218),o=r(3703);function u(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new o.Z;++e<r;)this.add(t[e])}u.prototype.add=u.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},u.prototype.has=function(t){return this.__data__.has(t)};const a=u,i=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1},c=function(t,e,r,n,o,u){var c=1&r,f=t.length,s=e.length;if(f!=s&&!(c&&s>f))return!1;var l=u.get(t),d=u.get(e);if(l&&d)return l==e&&d==t;var v=-1,p=!0,h=2&r?new a:void 0;for(u.set(t,e),u.set(e,t);++v<f;){var Z=t[v],b=e[v];if(n)var y=c?n(b,Z,v,e,t,u):n(Z,b,v,t,e,u);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!i(e,(function(t,e){if(a=e,!h.has(a)&&(Z===t||o(Z,t,r,n,u)))return h.push(e);var a}))){p=!1;break}}else if(Z!==b&&!o(Z,b,r,n,u)){p=!1;break}}return u.delete(t),u.delete(e),p};var f=r(187),s=r(8282),l=r(8804),d=r(5500),v=r(3249),p=f.Z?f.Z.prototype:void 0,h=p?p.valueOf:void 0;var Z=r(7245),b=Object.prototype.hasOwnProperty;var y=r(8649),g=r(7885),_=r(4975),j=r(8127),w="[object Arguments]",m="[object Array]",O="[object Object]",x=Object.prototype.hasOwnProperty;const A=function(t,e,r,o,u,a){var i=(0,g.Z)(t),f=(0,g.Z)(e),p=i?m:(0,y.Z)(t),A=f?m:(0,y.Z)(e),E=(p=p==w?O:p)==O,S=(A=A==w?O:A)==O,R=p==A;if(R&&(0,_.Z)(t)){if(!(0,_.Z)(e))return!1;i=!0,E=!1}if(R&&!E)return a||(a=new n.Z),i||(0,j.Z)(t)?c(t,e,r,o,u,a):function(t,e,r,n,o,u,a){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!u(new s.Z(t),new s.Z(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return(0,l.Z)(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var i=d.Z;case"[object Set]":var f=1&n;if(i||(i=v.Z),t.size!=e.size&&!f)return!1;var p=a.get(t);if(p)return p==e;n|=2,a.set(t,e);var Z=c(i(t),i(e),n,o,u,a);return a.delete(t),Z;case"[object Symbol]":if(h)return h.call(t)==h.call(e)}return!1}(t,e,p,r,o,u,a);if(!(1&r)){var z=E&&x.call(t,"__wrapped__"),k=S&&x.call(e,"__wrapped__");if(z||k){var T=z?t.value():t,I=k?e.value():e;return a||(a=new n.Z),u(T,I,r,o,a)}}return!!R&&(a||(a=new n.Z),function(t,e,r,n,o,u){var a=1&r,i=(0,Z.Z)(t),c=i.length;if(c!=(0,Z.Z)(e).length&&!a)return!1;for(var f=c;f--;){var s=i[f];if(!(a?s in e:b.call(e,s)))return!1}var l=u.get(t),d=u.get(e);if(l&&d)return l==e&&d==t;var v=!0;u.set(t,e),u.set(e,t);for(var p=a;++f<c;){var h=t[s=i[f]],y=e[s];if(n)var g=a?n(y,h,s,e,t,u):n(h,y,s,t,e,u);if(!(void 0===g?h===y||o(h,y,r,n,u):g)){v=!1;break}p||(p="constructor"==s)}if(v&&!p){var _=t.constructor,j=e.constructor;_==j||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof j&&j instanceof j||(v=!1)}return u.delete(t),u.delete(e),v}(t,e,r,o,u,a))};var E=r(3391);const S=function t(e,r,n,o,u){return e===r||(null==e||null==r||!(0,E.Z)(e)&&!(0,E.Z)(r)?e!=e&&r!=r:A(e,r,n,o,t,u))};var R=r(3122);const z=function(t){return t==t&&!(0,R.Z)(t)};var k=r(649);const T=function(t,e){return function(r){return null!=r&&r[t]===e&&(void 0!==e||t in Object(r))}},I=function(t){var e=function(t){for(var e=(0,k.Z)(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,z(o)]}return e}(t);return 1==e.length&&e[0][2]?T(e[0][0],e[0][1]):function(r){return r===t||function(t,e,r,o){var u=r.length,a=u,i=!o;if(null==t)return!a;for(t=Object(t);u--;){var c=r[u];if(i&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++u<a;){var f=(c=r[u])[0],s=t[f],l=c[1];if(i&&c[2]){if(void 0===s&&!(f in t))return!1}else{var d=new n.Z;if(o)var v=o(s,l,f,t,e,d);if(!(void 0===v?S(l,s,3,o,d):v))return!1}}return!0}(r,t,e)}};var C=r(2082),P=r(7969);const L=function(t,e){for(var r=0,n=(e=(0,C.Z)(e,t)).length;null!=t&&r<n;)t=t[(0,P.Z)(e[r++])];return r&&r==n?t:void 0},D=function(t,e){return null!=t&&e in Object(t)};var V=r(8693);var $=r(3502);const U=function(t,e){return(0,$.Z)(t)&&z(e)?T((0,P.Z)(t),e):function(r){var n=function(t,e,r){var n=null==t?void 0:L(t,e);return void 0===n?r:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&(0,V.Z)(t,e,D)}(r,t):S(e,n,3)}},F=function(t){return t},N=function(t){return(0,$.Z)(t)?(e=(0,P.Z)(t),function(t){return null==t?void 0:t[e]}):function(t){return function(e){return L(e,t)}}(t);var e},M=function(t){return"function"==typeof t?t:null==t?F:"object"==typeof t?(0,g.Z)(t)?U(t[0],t[1]):I(t):N(t)}},3917:(t,e,r)=>{r.d(e,{Z:()=>a});var n=r(5441);const o=(0,r(6048).Z)(Object.keys,Object);var u=Object.prototype.hasOwnProperty;const a=function(t){if(!(0,n.Z)(t))return o(t);var e=[];for(var r in Object(t))u.call(t,r)&&"constructor"!=r&&e.push(r);return e}},3225:(t,e,r)=>{r.d(e,{Z:()=>n});const n=function(t){return function(e){return t(e)}}},2082:(t,e,r)=>{r.d(e,{Z:()=>i});var n=r(7885),o=r(3502),u=r(2540),a=r(3523);const i=function(t,e){return(0,n.Z)(t)?t:(0,o.Z)(t,e)?[t]:(0,u.Z)((0,a.Z)(t))}},4724:(t,e,r)=>{r.d(e,{Z:()=>k});const n=(o={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},function(t){return null==o?void 0:o[t]});var o,u=r(3523),a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,i=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var c=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var f=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var s="a-z\\xdf-\\xf6\\xf8-\\xff",l="A-Z\\xc0-\\xd6\\xd8-\\xde",d="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",v="["+d+"]",p="\\d+",h="["+s+"]",Z="[^\\ud800-\\udfff"+d+p+"\\u2700-\\u27bf"+s+l+"]",b="(?:\\ud83c[\\udde6-\\uddff]){2}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",g="["+l+"]",_="(?:"+h+"|"+Z+")",j="(?:"+g+"|"+Z+")",w="(?:['’](?:d|ll|m|re|s|t|ve))?",m="(?:['’](?:D|LL|M|RE|S|T|VE))?",O="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",x="[\\ufe0e\\ufe0f]?",A=x+O+"(?:\\u200d(?:"+["[^\\ud800-\\udfff]",b,y].join("|")+")"+x+O+")*",E="(?:"+["[\\u2700-\\u27bf]",b,y].join("|")+")"+A,S=RegExp([g+"?"+h+"+"+w+"(?="+[v,g,"$"].join("|")+")",j+"+"+m+"(?="+[v,g+_,"$"].join("|")+")",g+"?"+_+"+"+w,g+"+"+m,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",p,E].join("|"),"g");const R=function(t,e,r){return t=(0,u.Z)(t),void 0===(e=r?void 0:e)?function(t){return f.test(t)}(t)?function(t){return t.match(S)||[]}(t):function(t){return t.match(c)||[]}(t):t.match(e)||[]};var z=RegExp("['’]","g");const k=function(t){return function(e){return function(t,e,r,n){var o=-1,u=null==t?0:t.length;for(n&&u&&(r=t[++o]);++o<u;)r=e(r,t[o],o,t);return r}(R(function(t){return(t=(0,u.Z)(t))&&t.replace(a,n).replace(i,"")}(e).replace(z,"")),t,"")}}},2168:(t,e,r)=>{r.d(e,{Z:()=>n});const n="object"==typeof global&&global&&global.Object===Object&&global},7245:(t,e,r)=>{r.d(e,{Z:()=>a});var n=r(2938),o=r(6808),u=r(649);const a=function(t){return(0,n.Z)(t,u.Z,o.Z)}},5546:(t,e,r)=>{r.d(e,{Z:()=>Z});var n=r(8936);const o=r(3221).Z["__core-js_shared__"];var u,a=(u=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"";var i=r(3122),c=r(6682),f=/^\[object .+?Constructor\]$/,s=Function.prototype,l=Object.prototype,d=s.toString,v=l.hasOwnProperty,p=RegExp("^"+d.call(v).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const h=function(t){return!(!(0,i.Z)(t)||(e=t,a&&a in e))&&((0,n.Z)(t)?p:f).test((0,c.Z)(t));var e},Z=function(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return h(r)?r:void 0}},6808:(t,e,r)=>{r.d(e,{Z:()=>a});var n=r(813),o=Object.prototype.propertyIsEnumerable,u=Object.getOwnPropertySymbols;const a=u?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,u=[];++r<n;){var a=t[r];e(a,r,t)&&(u[o++]=a)}return u}(u(t),(function(e){return o.call(t,e)})))}:n.Z},8649:(t,e,r)=>{r.d(e,{Z:()=>m});var n=r(5546),o=r(3221);const u=(0,n.Z)(o.Z,"DataView");var a=r(8896);const i=(0,n.Z)(o.Z,"Promise"),c=(0,n.Z)(o.Z,"Set"),f=(0,n.Z)(o.Z,"WeakMap");var s=r(9001),l=r(6682),d="[object Map]",v="[object Promise]",p="[object Set]",h="[object WeakMap]",Z="[object DataView]",b=(0,l.Z)(u),y=(0,l.Z)(a.Z),g=(0,l.Z)(i),_=(0,l.Z)(c),j=(0,l.Z)(f),w=s.Z;(u&&w(new u(new ArrayBuffer(1)))!=Z||a.Z&&w(new a.Z)!=d||i&&w(i.resolve())!=v||c&&w(new c)!=p||f&&w(new f)!=h)&&(w=function(t){var e=(0,s.Z)(t),r="[object Object]"==e?t.constructor:void 0,n=r?(0,l.Z)(r):"";if(n)switch(n){case b:return Z;case y:return d;case g:return v;case _:return p;case j:return h}return e});const m=w},8693:(t,e,r)=>{r.d(e,{Z:()=>f});var n=r(2082),o=r(4248),u=r(7885),a=r(6401),i=r(1164),c=r(7969);const f=function(t,e,r){for(var f=-1,s=(e=(0,n.Z)(e,t)).length,l=!1;++f<s;){var d=(0,c.Z)(e[f]);if(!(l=null!=t&&r(t,d)))break;t=t[d]}return l||++f!=s?l:!!(s=null==t?0:t.length)&&(0,i.Z)(s)&&(0,a.Z)(d,s)&&((0,u.Z)(t)||(0,o.Z)(t))}},2690:(t,e,r)=>{r.d(e,{Z:()=>o});var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const o=function(t){return n.test(t)}},6401:(t,e,r)=>{r.d(e,{Z:()=>o});var n=/^(?:0|[1-9]\d*)$/;const o=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&n.test(t))&&t>-1&&t%1==0&&t<e}},3502:(t,e,r)=>{r.d(e,{Z:()=>i});var n=r(7885),o=r(2758),u=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;const i=function(t,e){if((0,n.Z)(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!(0,o.Z)(t))||a.test(t)||!u.test(t)||null!=e&&t in Object(e)}},5441:(t,e,r)=>{r.d(e,{Z:()=>o});var n=Object.prototype;const o=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},5500:(t,e,r)=>{r.d(e,{Z:()=>n});const n=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}},7755:(t,e,r)=>{r.d(e,{Z:()=>i});var n=r(2168),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,u=o&&"object"==typeof module&&module&&!module.nodeType&&module,a=u&&u.exports===o&&n.Z.process;const i=function(){try{return u&&u.require&&u.require("util").types||a&&a.binding&&a.binding("util")}catch(t){}}()},6048:(t,e,r)=>{r.d(e,{Z:()=>n});const n=function(t,e){return function(r){return t(e(r))}}},3221:(t,e,r)=>{r.d(e,{Z:()=>u});var n=r(2168),o="object"==typeof self&&self&&self.Object===Object&&self;const u=n.Z||o||Function("return this")()},3249:(t,e,r)=>{r.d(e,{Z:()=>n});const n=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}},222:(t,e,r)=>{r.d(e,{Z:()=>p});var n=r(2690),o="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",u="\\ud83c[\\udffb-\\udfff]",a="[^\\ud800-\\udfff]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",c="[\\ud800-\\udbff][\\udc00-\\udfff]",f="(?:"+o+"|"+u+")?",s="[\\ufe0e\\ufe0f]?",l=s+f+"(?:\\u200d(?:"+[a,i,c].join("|")+")"+s+f+")*",d="(?:"+[a+o+"?",o,i,c,"[\\ud800-\\udfff]"].join("|")+")",v=RegExp(u+"(?="+u+")|"+d+l,"g");const p=function(t){return(0,n.Z)(t)?function(t){return t.match(v)||[]}(t):function(t){return t.split("")}(t)}},2540:(t,e,r)=>{r.d(e,{Z:()=>i});var n=r(3703);function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],u=r.cache;if(u.has(o))return u.get(o);var a=t.apply(this,n);return r.cache=u.set(o,a)||u,a};return r.cache=new(o.Cache||n.Z),r}o.Cache=n.Z;var u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g;const i=(c=o((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(u,(function(t,r,n,o){e.push(n?o.replace(a,"$1"):r||t)})),e}),(function(t){return 500===f.size&&f.clear(),t})),f=c.cache,c);var c,f},7969:(t,e,r)=>{r.d(e,{Z:()=>o});var n=r(2758);const o=function(t){if("string"==typeof t||(0,n.Z)(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},6682:(t,e,r)=>{r.d(e,{Z:()=>o});var n=Function.prototype.toString;const o=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},2777:(t,e,r)=>{r.d(e,{Z:()=>o});var n=r(1525);const o=(0,r(4724).Z)((function(t,e,r){return e=e.toLowerCase(),t+(r?(0,n.Z)(e):e)}))},1525:(t,e,r)=>{r.d(e,{Z:()=>c});var n=r(3523);const o=function(t,e,r){var n=t.length;return r=void 0===r?n:r,!e&&r>=n?t:function(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var u=Array(o);++n<o;)u[n]=t[n+e];return u}(t,e,r)};var u=r(2690),a=r(222);const i=function(t){t=(0,n.Z)(t);var e=(0,u.Z)(t)?(0,a.Z)(t):void 0,r=e?e[0]:t.charAt(0),i=e?o(e,1).join(""):t.slice(1);return r.toUpperCase()+i},c=function(t){return i((0,n.Z)(t).toLowerCase())}},8804:(t,e,r)=>{r.d(e,{Z:()=>n});const n=function(t,e){return t===e||t!=t&&e!=e}},8407:(t,e,r)=>{r.d(e,{Z:()=>a});var n=r(3523),o=/[\\^$.*+?()[\]{}|]/g,u=RegExp(o.source);const a=function(t){return(t=(0,n.Z)(t))&&u.test(t)?t.replace(o,"\\$&"):t}},3662:(t,e,r)=>{r.d(e,{Z:()=>b});var n=r(2342),o=r(3282),u=r(649);var a=/\s/;var i=/^\s+/;const c=function(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&a.test(t.charAt(e)););return e}(t)+1).replace(i,""):t};var f=r(3122),s=r(2758),l=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,v=/^0o[0-7]+$/i,p=parseInt;const h=function(t){return t?Infinity===(t=function(t){if("number"==typeof t)return t;if((0,s.Z)(t))return NaN;if((0,f.Z)(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=(0,f.Z)(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=c(t);var r=d.test(t);return r||v.test(t)?p(t.slice(2),r?2:8):l.test(t)?NaN:+t}(t))||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0};var Z=Math.max;const b=(y=function(t,e,r){var o=null==t?0:t.length;if(!o)return-1;var u,a,i=null==r?0:(u=h(r),a=u%1,u==u?a?u-a:u:0);return i<0&&(i=Z(o+i,0)),function(t,e,r,n){for(var o=t.length,u=r+(n?1:-1);n?u--:++u<o;)if(e(t[u],u,t))return u;return-1}(t,(0,n.Z)(e,3),i)},function(t,e,r){var a=Object(t);if(!(0,o.Z)(t)){var i=(0,n.Z)(e,3);t=(0,u.Z)(t),e=function(t){return i(a[t],t,a)}}var c=y(t,e,r);return c>-1?a[i?t[c]:c]:void 0});var y},4248:(t,e,r)=>{r.d(e,{Z:()=>f});var n=r(9001),o=r(3391);const u=function(t){return(0,o.Z)(t)&&"[object Arguments]"==(0,n.Z)(t)};var a=Object.prototype,i=a.hasOwnProperty,c=a.propertyIsEnumerable;const f=u(function(){return arguments}())?u:function(t){return(0,o.Z)(t)&&i.call(t,"callee")&&!c.call(t,"callee")}},7885:(t,e,r)=>{r.d(e,{Z:()=>n});const n=Array.isArray},3282:(t,e,r)=>{r.d(e,{Z:()=>u});var n=r(8936),o=r(1164);const u=function(t){return null!=t&&(0,o.Z)(t.length)&&!(0,n.Z)(t)}},4975:(t,e,r)=>{r.d(e,{Z:()=>i});var n=r(3221);var o="object"==typeof exports&&exports&&!exports.nodeType&&exports,u=o&&"object"==typeof module&&module&&!module.nodeType&&module,a=u&&u.exports===o?n.Z.Buffer:void 0;const i=(a?a.isBuffer:void 0)||function(){return!1}},8936:(t,e,r)=>{r.d(e,{Z:()=>u});var n=r(9001),o=r(3122);const u=function(t){if(!(0,o.Z)(t))return!1;var e=(0,n.Z)(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},1164:(t,e,r)=>{r.d(e,{Z:()=>n});const n=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},3122:(t,e,r)=>{r.d(e,{Z:()=>n});const n=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},3391:(t,e,r)=>{r.d(e,{Z:()=>n});const n=function(t){return null!=t&&"object"==typeof t}},2758:(t,e,r)=>{r.d(e,{Z:()=>u});var n=r(9001),o=r(3391);const u=function(t){return"symbol"==typeof t||(0,o.Z)(t)&&"[object Symbol]"==(0,n.Z)(t)}},8127:(t,e,r)=>{r.d(e,{Z:()=>s});var n=r(9001),o=r(1164),u=r(3391),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1;var i=r(3225),c=r(7755),f=c.Z&&c.Z.isTypedArray;const s=f?(0,i.Z)(f):function(t){return(0,u.Z)(t)&&(0,o.Z)(t.length)&&!!a[(0,n.Z)(t)]}},649:(t,e,r)=>{r.d(e,{Z:()=>a});var n=r(848),o=r(3917),u=r(3282);const a=function(t){return(0,u.Z)(t)?(0,n.Z)(t):(0,o.Z)(t)}},813:(t,e,r)=>{r.d(e,{Z:()=>n});const n=function(){return[]}},3523:(t,e,r)=>{r.d(e,{Z:()=>s});var n=r(187),o=r(5598),u=r(7885),a=r(2758),i=n.Z?n.Z.prototype:void 0,c=i?i.toString:void 0;const f=function t(e){if("string"==typeof e)return e;if((0,u.Z)(e))return(0,o.Z)(e,t)+"";if((0,a.Z)(e))return c?c.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r},s=function(t){return null==t?"":f(t)}},9857:(t,e,r)=>{r.d(e,{ZP:()=>J});var n=r(268);function o(t,e,r,n){return new(r||(r=Promise))((function(o,u){function a(t){try{c(n.next(t))}catch(t){u(t)}}function i(t){try{c(n.throw(t))}catch(t){u(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,i)}c((n=n.apply(t,e||[])).next())}))}function u(t,e){var r,n,o,u,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function i(u){return function(i){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,n=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=e.call(t,a)}catch(t){u=[6,t],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,i])}}}var a,i=function(){},c=i(),f=Object,s=function(t){return t===c},l=function(t){return"function"==typeof t},d=function(t,e){return f.assign({},t,e)},v="undefined",p=function(){return typeof window!=v},h=new WeakMap,Z=0,b=function(t){var e,r,n=typeof t,o=t&&t.constructor,u=o==Date;if(f(t)!==t||u||o==RegExp)e=u?t.toJSON():"symbol"==n?t.toString():"string"==n?JSON.stringify(t):""+t;else{if(e=h.get(t))return e;if(e=++Z+"~",h.set(t,e),o==Array){for(e="@",r=0;r<t.length;r++)e+=b(t[r])+",";h.set(t,e)}if(o==f){e="#";for(var a=f.keys(t).sort();!s(r=a.pop());)s(t[r])||(e+=r+":"+b(t[r])+",");h.set(t,e)}}return e},y=!0,g=p(),_=typeof document!=v,j=g&&window.addEventListener?window.addEventListener.bind(window):i,w=_?document.addEventListener.bind(document):i,m=g&&window.removeEventListener?window.removeEventListener.bind(window):i,O=_?document.removeEventListener.bind(document):i,x={isOnline:function(){return y},isVisible:function(){var t=_&&document.visibilityState;return s(t)||"hidden"!==t}},A={initFocus:function(t){return w("visibilitychange",t),j("focus",t),function(){O("visibilitychange",t),m("focus",t)}},initReconnect:function(t){var e=function(){y=!0,t()},r=function(){y=!1};return j("online",e),j("offline",r),function(){m("online",e),m("offline",r)}}},E=!p()||"Deno"in window,S=E?n.useEffect:n.useLayoutEffect,R="undefined"!=typeof navigator&&navigator.connection,z=!E&&R&&(["slow-2g","2g"].includes(R.effectiveType)||R.saveData),k=function(t){if(l(t))try{t=t()}catch(e){t=""}var e=[].concat(t);return[t="string"==typeof t?t:(Array.isArray(t)?t.length:t)?b(t):"",e,t?"$swr$"+t:""]},T=new WeakMap,I=function(t,e,r,n,o,u,a){void 0===a&&(a=!0);var i=T.get(t),c=i[0],f=i[1],s=i[3],l=c[e],d=f[e];if(a&&d)for(var v=0;v<d.length;++v)d[v](r,n,o);return u&&(delete s[e],l&&l[0])?l[0](2).then((function(){return t.get(e)})):t.get(e)},C=0,P=function(){return++C},L=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o(void 0,void 0,void 0,(function(){var e,r,n,o,a,i,f,v,p,h,Z,b,y,g,_,j,w,m,O,x,A;return u(this,(function(u){switch(u.label){case 0:if(e=t[0],r=t[1],n=t[2],o=t[3],i=!!s((a="boolean"==typeof o?{revalidate:o}:o||{}).populateCache)||a.populateCache,f=!1!==a.revalidate,v=!1!==a.rollbackOnError,p=a.optimisticData,h=k(r),Z=h[0],b=h[2],!Z)return[2];if(y=T.get(e),g=y[2],t.length<3)return[2,I(e,Z,e.get(Z),c,c,f,!0)];if(_=n,w=P(),g[Z]=[w,0],m=!s(p),O=e.get(Z),m&&(x=l(p)?p(O):p,e.set(Z,x),I(e,Z,x)),l(_))try{_=_(e.get(Z))}catch(t){j=t}return _&&l(_.then)?[4,_.catch((function(t){j=t}))]:[3,2];case 1:if(_=u.sent(),w!==g[Z][0]){if(j)throw j;return[2,_]}j&&m&&v&&(i=!0,_=O,e.set(Z,O)),u.label=2;case 2:return i&&(j||(l(i)&&(_=i(_,O)),e.set(Z,_)),e.set(b,d(e.get(b),{error:j}))),g[Z][1]=P(),[4,I(e,Z,_,j,c,f,!!i)];case 3:if(A=u.sent(),j)throw j;return[2,i?A:_]}}))}))},D=function(t,e){for(var r in t)t[r][0]&&t[r][0](e)},V=function(t,e){if(!T.has(t)){var r=d(A,e),n={},o=L.bind(c,t),u=i;if(T.set(t,[n,{},{},{},o]),!E){var a=r.initFocus(setTimeout.bind(c,D.bind(c,n,0))),f=r.initReconnect(setTimeout.bind(c,D.bind(c,n,1)));u=function(){a&&a(),f&&f(),T.delete(t)}}return[t,o,u]}return[t,T.get(t)[4]]},$=V(new Map),U=$[0],F=$[1],N=d({onLoadingSlow:i,onSuccess:i,onError:i,onErrorRetry:function(t,e,r,n,o){var u=r.errorRetryCount,a=o.retryCount,i=~~((Math.random()+.5)*(1<<(a<8?a:8)))*r.errorRetryInterval;!s(u)&&a>u||setTimeout(n,i,o)},onDiscarded:i,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:z?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:z?5e3:3e3,compare:function(t,e){return b(t)==b(e)},isPaused:function(){return!1},cache:U,mutate:F,fallback:{}},x),M=function(t,e){var r=d(t,e);if(e){var n=t.use,o=t.fallback,u=e.use,a=e.fallback;n&&u&&(r.use=n.concat(u)),o&&a&&(r.fallback=d(o,a))}return r},W=(0,n.createContext)({}),B=function(t){return l(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(null===t[1]?t[2]:t[1])||{}]},G=function(){return d(N,(0,n.useContext)(W))},q=function(t,e,r){var n=e[t]||(e[t]=[]);return n.push(r),function(){var t=n.indexOf(r);t>=0&&(n[t]=n[n.length-1],n.pop())}},H={dedupe:!0},J=(f.defineProperty((function(t){var e=t.value,r=M((0,n.useContext)(W),e),o=e&&e.provider,u=(0,n.useState)((function(){return o?V(o(r.cache||U),e):c}))[0];return u&&(r.cache=u[0],r.mutate=u[1]),S((function(){return u?u[2]:c}),[]),(0,n.createElement)(W.Provider,d(t,{value:r}))}),"default",{value:N}),a=function(t,e,r){var a=r.cache,i=r.compare,f=r.fallbackData,h=r.suspense,Z=r.revalidateOnMount,b=r.refreshInterval,y=r.refreshWhenHidden,g=r.refreshWhenOffline,_=T.get(a),j=_[0],w=_[1],m=_[2],O=_[3],x=k(t),A=x[0],R=x[1],z=x[2],C=(0,n.useRef)(!1),D=(0,n.useRef)(!1),V=(0,n.useRef)(A),$=(0,n.useRef)(e),U=(0,n.useRef)(r),F=function(){return U.current},N=function(){return F().isVisible()&&F().isOnline()},M=function(t){return a.set(z,d(a.get(z),t))},W=a.get(A),B=s(f)?r.fallback[A]:f,G=s(W)?B:W,J=a.get(z)||{},Y=J.error,K=!C.current,Q=function(){return K&&!s(Z)?Z:!F().isPaused()&&(h?!s(G)&&r.revalidateIfStale:s(G)||r.revalidateIfStale)},X=!(!A||!e)&&(!!J.isValidating||K&&Q()),tt=function(t,e){var r=(0,n.useState)({})[1],o=(0,n.useRef)(t),u=(0,n.useRef)({data:!1,error:!1,isValidating:!1}),a=(0,n.useCallback)((function(t){var n=!1,a=o.current;for(var i in t){var c=i;a[c]!==t[c]&&(a[c]=t[c],u.current[c]&&(n=!0))}n&&!e.current&&r({})}),[]);return S((function(){o.current=t})),[o,u.current,a]}({data:G,error:Y,isValidating:X},D),et=tt[0],rt=tt[1],nt=tt[2],ot=(0,n.useCallback)((function(t){return o(void 0,void 0,void 0,(function(){var e,n,o,f,d,v,p,h,Z,b,y,g,_;return u(this,(function(u){switch(u.label){case 0:if(e=$.current,!A||!e||D.current||F().isPaused())return[2,!1];f=!0,d=t||{},v=!O[A]||!d.dedupe,p=function(){return!D.current&&A===V.current&&C.current},h=function(){var t=O[A];t&&t[1]===o&&delete O[A]},Z={isValidating:!1},b=function(){M({isValidating:!1}),p()&&nt(Z)},M({isValidating:!0}),nt({isValidating:!0}),u.label=1;case 1:return u.trys.push([1,3,,4]),v&&(I(a,A,et.current.data,et.current.error,!0),r.loadingTimeout&&!a.get(A)&&setTimeout((function(){f&&p()&&F().onLoadingSlow(A,r)}),r.loadingTimeout),O[A]=[e.apply(void 0,R),P()]),_=O[A],n=_[0],o=_[1],[4,n];case 2:return n=u.sent(),v&&setTimeout(h,r.dedupingInterval),O[A]&&O[A][1]===o?(M({error:c}),Z.error=c,y=m[A],!s(y)&&(o<=y[0]||o<=y[1]||0===y[1])?(b(),v&&p()&&F().onDiscarded(A),[2,!1]):(i(et.current.data,n)?Z.data=et.current.data:Z.data=n,i(a.get(A),n)||a.set(A,n),v&&p()&&F().onSuccess(n,A,r),[3,4])):(v&&p()&&F().onDiscarded(A),[2,!1]);case 3:return g=u.sent(),h(),F().isPaused()||(M({error:g}),Z.error=g,v&&p()&&(F().onError(g,A,r),("boolean"==typeof r.shouldRetryOnError&&r.shouldRetryOnError||l(r.shouldRetryOnError)&&r.shouldRetryOnError(g))&&N()&&F().onErrorRetry(g,A,r,ot,{retryCount:(d.retryCount||0)+1,dedupe:!0}))),[3,4];case 4:return f=!1,b(),p()&&v&&I(a,A,Z.data,Z.error,!1),[2,!0]}}))}))}),[A]),ut=(0,n.useCallback)(L.bind(c,a,(function(){return V.current})),[]);if(S((function(){$.current=e,U.current=r})),S((function(){if(A){var t=A!==V.current,e=ot.bind(c,H),r=0,n=q(A,w,(function(t,e,r){nt(d({error:e,isValidating:r},i(et.current.data,t)?c:{data:t}))})),o=q(A,j,(function(t){if(0==t){var n=Date.now();F().revalidateOnFocus&&n>r&&N()&&(r=n+F().focusThrottleInterval,e())}else if(1==t)F().revalidateOnReconnect&&N()&&e();else if(2==t)return ot()}));return D.current=!1,V.current=A,C.current=!0,t&&nt({data:G,error:Y,isValidating:X}),Q()&&(s(G)||E?e():(u=e,p()&&typeof window.requestAnimationFrame!=v?window.requestAnimationFrame(u):setTimeout(u,1))),function(){D.current=!0,n(),o()}}var u}),[A,ot]),S((function(){var t;function e(){var e=l(b)?b(G):b;e&&-1!==t&&(t=setTimeout(r,e))}function r(){et.current.error||!y&&!F().isVisible()||!g&&!F().isOnline()?e():ot(H).then(e)}return e(),function(){t&&(clearTimeout(t),t=-1)}}),[b,y,g,ot]),(0,n.useDebugValue)(G),h&&s(G)&&A)throw $.current=e,U.current=r,D.current=!1,s(Y)?ot(H):Y;return{mutate:ut,get data(){return rt.data=!0,G},get error(){return rt.error=!0,Y},get isValidating(){return rt.isValidating=!0,X}}},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=G(),n=B(t),o=n[0],u=n[1],i=n[2],c=M(r,i),f=a,s=c.use;if(s)for(var l=s.length;l-- >0;)f=s[l](f);return f(o,u||c.fetcher,c)})},2303:(t,e,r)=>{r.d(e,{Z:()=>c});var n,o,u=r(9857),a=function(){return a=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},a.apply(this,arguments)},i=function(t){return"function"==typeof t[1]?[t[0],t[1],t[2]||{}]:[t[0],null,(null===t[1]?t[2]:t[1])||{}]},c=(n=u.ZP,o=function(t){return function(e,r,n){return n.revalidateOnFocus=!1,n.revalidateIfStale=!1,n.revalidateOnReconnect=!1,t(e,r,n)}},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=i(t),u=r[0],c=r[1],f=r[2],s=(f.use||[]).concat(o);return n(u,c,a(a({},f),{use:s}))})}}]);
|
|
File without changes
|
package/dist/574.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_openmrs_esm_patient_registration_app=self.webpackChunk_openmrs_esm_patient_registration_app||[]).push([[574],{3574:e=>{e.exports=JSON.parse('{"addRelationshipButtonText":"Add Relationship","address1":"","addressHeader":"Address","allFieldsRequiredText":"All fields are required unless marked optional","autoGeneratedPlaceholderText":"Auto-generated","birthdayNotInTheFuture":"Birthday cannot be in the future","birthdayRequired":"Birthday is required","birthFieldLabelText":"Birth","cancel":"Cancel","causeOfDeathInputLabel":"Cause of Death","cityVillage":"","configure":"Configure","country":"","createNew":"Create New","dateOfBirthLabelText":"Date of Birth","deathDateInputLabel":"Date of Death","deathdayNotInTheFuture":"Death day cannot be in the future","deleteIdentifierTooltip":"Delete","deleteRelationshipTooltipText":"Delete","discard":"Discard","discardModalBody":"The changes you made to this patient\'s details have not been saved. Discard changes?","discardModalHeader":"Confirm Discard Changes","dobToggleLabelText":"Date of Birth Known?","edit":"Edit","editIdentifierTooltip":"Edit","editPatientDetails":"Edit patient details","emailLabelText":"Email","
|
|
1
|
+
"use strict";(self.webpackChunk_openmrs_esm_patient_registration_app=self.webpackChunk_openmrs_esm_patient_registration_app||[]).push([[574],{3574:e=>{e.exports=JSON.parse('{"addRelationshipButtonText":"Add Relationship","address1":"Address line 1","address2":"Address line 2","addressHeader":"Address","allFieldsRequiredText":"All fields are required unless marked optional","autoGeneratedPlaceholderText":"Auto-generated","birthdayNotInTheFuture":"Birthday cannot be in the future","birthdayRequired":"Birthday is required","birthFieldLabelText":"Birth","cancel":"Cancel","causeOfDeathInputLabel":"Cause of Death","cityVillage":"City","configure":"Configure","contactSection":"Contact Details","country":"Country","countyDistrict":"District","createNew":"Create New","dateOfBirthLabelText":"Date of Birth","deathDateInputLabel":"Date of Death","deathdayNotInTheFuture":"Death day cannot be in the future","deathSection":"Death Info","deleteIdentifierTooltip":"Delete","deleteRelationshipTooltipText":"Delete","demographicsSection":"Basic Info","discard":"Discard","discardModalBody":"The changes you made to this patient\'s details have not been saved. Discard changes?","discardModalHeader":"Confirm Discard Changes","dobToggleLabelText":"Date of Birth Known?","edit":"Edit","editIdentifierTooltip":"Edit","editPatientDetails":"Edit patient details","emailLabelText":"Email","estimatedAgeInMonthsLabelText":"Estimated age in months","estimatedAgeInYearsLabelText":"Estimated age in years","familyNameLabelText":"Family Name","familyNameRequired":"Family name is required","female":"Female","fieldErrorTitleMessage":"The following fields have errors:","fullNameLabelText":"Full Name","genderLabelText":"Sex","genderRequired":"Gender is required","genderUnspecified":"Gender is not specified","givenNameLabelText":"First Name","givenNameRequired":"Given name is required","identifierValueRequired":"Identifier value is required","idFieldLabelText":"Identifiers","incompleteForm":"Incomplete form","invalidEmail":"A valid email has to be given","invalidInput":"Invalid Input","isDeadInputLabel":"Is Dead","jumpTo":"Jump to","loadingResults":"Loading results","male":"Male","middleNameLabelText":"Middle Name","months":"Months","negativeMonths":"Negative months","negativeYears":"Negative years","no":"No","noResultsFound":"No results found","numberInNameDubious":"Number in name is dubious","optional":"optional","other":"Other","patient":"Patient","patientNameKnown":"Patient\'s Name is Known?","phoneEmailLabelText":"Phone, Email, etc.","phoneNumberInputLabelText":"Phone number","postalCode":"Postcode","registerPatient":"Register Patient","registrationSuccessToastDescription":"The patient can now be found by searching for them using their name or ID number","registrationSuccessToastTitle":"New Patient Created","relationship":"Relationship","relationshipPlaceholder":"Relationship","relationshipRemovedText":"Relationship removed","relationshipsSection":"Relationships","relationshipToPatient":"Relationship to patient","relativeFullNameLabelText":"Full name","relativeNamePlaceholder":"Firstname Familyname","resetIdentifierTooltip":"Reset","restoreRelationshipActionButton":"Undo","searchAddress":"Search address","sexFieldLabelText":"Sex","stateProvince":"State","stroke":"Stroke","unidentifiedPatient":"Unidentified Patient","unknown":"Unknown","updatePatient":"Update Patient","updationSuccessToastDescription":"The patient\'s information has been successfully updated","updationSuccessToastTitle":"Patient Details Updated","years":"Years","yearsEstimateRequired":"Years estimate required","yes":"Yes"}')}}]);
|
package/dist/658.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_openmrs_esm_patient_registration_app=self.webpackChunk_openmrs_esm_patient_registration_app||[]).push([[658],{5671:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(2609),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-registration__address-search__label01___UPnro{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px)}.-esm-patient-registration__address-search__suggestions___qAiUx{position:relative;border-top-width:0;list-style:none;margin-top:0;max-height:143px;overflow-y:auto;padding-left:0;width:100%;position:absolute;left:0;background-color:#fff;margin-bottom:20px;z-index:99}.-esm-patient-registration__address-search__suggestions___qAiUx li{padding:1rem;line-height:1.29;color:#525252;border-bottom:1px solid #8d8d8d}.-esm-patient-registration__address-search__suggestions___qAiUx li:hover{background-color:#e5e5e5;color:#161616;cursor:pointer}.-esm-patient-registration__address-search__suggestions___qAiUx li:not(:last-of-type){border-bottom:1px solid #999}.-esm-patient-registration__address-search__autocomplete___S4jFy{position:relative}.-esm-patient-registration__address-search__autocompleteSearch___AG-ZP{width:100%}.-esm-patient-registration__address-search__suggestions___qAiUx a{color:inherit;text-decoration:none}",""]),i.locals={label01:"-esm-patient-registration__address-search__label01___UPnro",suggestions:"-esm-patient-registration__address-search__suggestions___qAiUx",autocomplete:"-esm-patient-registration__address-search__autocomplete___S4jFy",autocompleteSearch:"-esm-patient-registration__address-search__autocompleteSearch___AG-ZP"};const a=i},1098:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(2609),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-registration__field__productiveHeading02___0\\+2Gm{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);margin-bottom:1rem}.-esm-patient-registration__field__productiveHeading02Light___bbKeq{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);margin-bottom:1rem;color:#525252}.-esm-patient-registration__field__label01___6YyKZ{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px)}.-esm-patient-registration__field__grid___g21pQ{display:grid;grid-template-columns:1fr 1fr;column-gap:1rem}.-esm-patient-registration__field__halfWidthInDesktopView___J9cO8{width:calc(50% - 1rem)}.-esm-patient-registration__field__patientPhoto___9mWMr{display:flex;justify-content:center}.-esm-patient-registration__field__nameField___uPmod{grid-row:1;grid-column:1}.-esm-patient-registration__field__nameField___uPmod>.cds--content-switcher{display:grid;grid-template-columns:1fr 1fr;width:max-content;justify-content:flex-start}.-esm-patient-registration__field__contentSwitcher___G7dTq{margin-bottom:1rem}.-esm-patient-registration__field__dobField___P6SHd>.cds--content-switcher{display:grid;grid-template-columns:1fr 1fr;width:max-content;justify-content:flex-start}.-esm-patient-registration__field__photoExtension___IqCnX{margin-bottom:1rem;grid-row:1;grid-column:2;justify-self:center}.-esm-patient-registration__field__sexField___F8TIv,.-esm-patient-registration__field__dobField___P6SHd{margin-bottom:1rem}.-esm-patient-registration__field__dobContentSwitcherLabel___vW\\+UB{margin-bottom:.5rem}.-esm-patient-registration__field__identifierLabelText___bdyJF{display:flex;align-items:center}.-esm-patient-registration__field__setIDNumberButton___XziAX{margin-bottom:1rem}.-esm-patient-registration__field__setIDNumberButton___XziAX>svg{margin-left:.5rem}.-esm-patient-registration__field__customField___40yP4{margin-bottom:1rem}.-esm-patient-registration__field__attributeField___qdljB{margin-bottom:1rem}.omrs-breakpoint-lt-desktop .-esm-patient-registration__field__grid___g21pQ{grid-template-columns:1fr;grid-template-rows:auto auto}.omrs-breakpoint-lt-desktop .-esm-patient-registration__field__nameField___uPmod{grid-row:2;grid-column:1}.omrs-breakpoint-lt-desktop .-esm-patient-registration__field__photoExtension___IqCnX{grid-column:1;grid-row:1;justify-self:start}.omrs-breakpoint-lt-desktop .-esm-patient-registration__field__radioButton___d7GuU label{height:3rem !important}.omrs-breakpoint-lt-desktop .-esm-patient-registration__field__halfWidthInDesktopView___J9cO8{width:100%}.-esm-patient-registration__field__radioFieldError___LyxW0{color:#da1e28;display:block;font-weight:400;max-height:12.5rem;overflow:visible;font-size:.75rem;letter-spacing:.32px;line-height:1.34;margin:.25rem 0 0}",""]),i.locals={productiveHeading02:"-esm-patient-registration__field__productiveHeading02___0+2Gm",productiveHeading02Light:"-esm-patient-registration__field__productiveHeading02Light___bbKeq",label01:"-esm-patient-registration__field__label01___6YyKZ",grid:"-esm-patient-registration__field__grid___g21pQ",halfWidthInDesktopView:"-esm-patient-registration__field__halfWidthInDesktopView___J9cO8",patientPhoto:"-esm-patient-registration__field__patientPhoto___9mWMr",nameField:"-esm-patient-registration__field__nameField___uPmod",contentSwitcher:"-esm-patient-registration__field__contentSwitcher___G7dTq",dobField:"-esm-patient-registration__field__dobField___P6SHd",photoExtension:"-esm-patient-registration__field__photoExtension___IqCnX",sexField:"-esm-patient-registration__field__sexField___F8TIv",dobContentSwitcherLabel:"-esm-patient-registration__field__dobContentSwitcherLabel___vW+UB",identifierLabelText:"-esm-patient-registration__field__identifierLabelText___bdyJF",setIDNumberButton:"-esm-patient-registration__field__setIDNumberButton___XziAX",customField:"-esm-patient-registration__field__customField___40yP4",attributeField:"-esm-patient-registration__field__attributeField___qdljB",radioButton:"-esm-patient-registration__field__radioButton___d7GuU",radioFieldError:"-esm-patient-registration__field__radioFieldError___LyxW0"};const a=i},3433:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(2609),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-registration__identifier-selection__title___fPIy3{color:var(--omrs-color-brand-teal)}.-esm-patient-registration__identifier-selection__submit___WgYnV{width:250px}.-esm-patient-registration__identifier-selection__submit___WgYnV:hover{cursor:pointer}.-esm-patient-registration__identifier-selection__cancelButton___ar-za{width:11.688rem}.-esm-patient-registration__identifier-selection__submitButton___mJgTx{margin-bottom:1rem;width:11.688rem;display:block}.-esm-patient-registration__identifier-selection__infoGrid___5ovdR{width:100%;padding-left:2rem;margin-bottom:40vh;margin-top:1rem;max-width:50rem}.-esm-patient-registration__identifier-selection__label01___sm7Rq{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);margin-top:1rem;margin-bottom:1rem;color:#8d8d8d}.-esm-patient-registration__identifier-selection__productiveHeading02___aocJ0{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);color:#8d8d8d;cursor:pointer}.-esm-patient-registration__identifier-selection__space05___pbxiU{margin:1rem 0 1rem 0}.-esm-patient-registration__identifier-selection__formContainer___XacnD{display:flex;width:100%}.-esm-patient-registration__identifier-selection__stickyColumn___H9Wbn{position:sticky;margin-top:1rem;top:4rem}.-esm-patient-registration__identifier-selection__touchTarget___heOv2 a:active{color:#161616}.-esm-patient-registration__identifier-selection__linkName___oKi4d{color:#525252;line-height:1.38;font-size:1rem;font-weight:600}.-esm-patient-registration__identifier-selection__linkName___oKi4d:active{text-decoration:none;color:#161616}.-esm-patient-registration__identifier-selection__linkName___oKi4d:hover{text-decoration:none;color:#161616;cursor:pointer}.-esm-patient-registration__identifier-selection__main___s9KQc{background-color:#fff}.omrs-breakpoint-lt-desktop .-esm-patient-registration__identifier-selection__infoGrid___5ovdR{max-width:unset}.-esm-patient-registration__identifier-selection__button___08VWQ{height:4rem;display:flex;align-content:flex-start;align-items:baseline;min-width:50%}.-esm-patient-registration__identifier-selection__tablet___mHt6H{padding:1.5rem 1rem;background-color:#fff}.-esm-patient-registration__identifier-selection__desktop___VkI9z{padding:0rem}.-esm-patient-registration__identifier-selection__radioGroup___n\\+7PW{background-color:#f4f4f4;padding:1rem}.-esm-patient-registration__identifier-selection__radioButton___yaoFj{margin:0 !important}.-esm-patient-registration__identifier-selection__radioButton___yaoFj label{height:2rem}.omrs-breakpoint-lt-desktop .-esm-patient-registration__identifier-selection__radioButton___yaoFj label{height:3rem !important}",""]),i.locals={title:"-esm-patient-registration__identifier-selection__title___fPIy3",submit:"-esm-patient-registration__identifier-selection__submit___WgYnV",cancelButton:"-esm-patient-registration__identifier-selection__cancelButton___ar-za",submitButton:"-esm-patient-registration__identifier-selection__submitButton___mJgTx",infoGrid:"-esm-patient-registration__identifier-selection__infoGrid___5ovdR",label01:"-esm-patient-registration__identifier-selection__label01___sm7Rq",productiveHeading02:"-esm-patient-registration__identifier-selection__productiveHeading02___aocJ0",space05:"-esm-patient-registration__identifier-selection__space05___pbxiU",formContainer:"-esm-patient-registration__identifier-selection__formContainer___XacnD",stickyColumn:"-esm-patient-registration__identifier-selection__stickyColumn___H9Wbn",touchTarget:"-esm-patient-registration__identifier-selection__touchTarget___heOv2",linkName:"-esm-patient-registration__identifier-selection__linkName___oKi4d",main:"-esm-patient-registration__identifier-selection__main___s9KQc",button:"-esm-patient-registration__identifier-selection__button___08VWQ",tablet:"-esm-patient-registration__identifier-selection__tablet___mHt6H",desktop:"-esm-patient-registration__identifier-selection__desktop___VkI9z",radioGroup:"-esm-patient-registration__identifier-selection__radioGroup___n+7PW",radioButton:"-esm-patient-registration__identifier-selection__radioButton___yaoFj"};const a=i},1662:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(2609),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-registration__autosuggest__label01___f95oj{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px)}.-esm-patient-registration__autosuggest__suggestions___v5o3w{position:relative;border-top-width:0;list-style:none;margin-top:0;max-height:143px;overflow-y:auto;padding-left:0;width:100%;position:absolute;left:0;background-color:#fff;margin-bottom:20px;z-index:99}.-esm-patient-registration__autosuggest__suggestions___v5o3w li{padding:1rem;line-height:1.29;color:#525252;border-bottom:1px solid #8d8d8d}.-esm-patient-registration__autosuggest__suggestions___v5o3w li:hover{background-color:#e5e5e5;color:#161616;cursor:pointer}.-esm-patient-registration__autosuggest__suggestions___v5o3w li:not(:last-of-type){border-bottom:1px solid #999}.-esm-patient-registration__autosuggest__autocomplete___it56z{position:relative}.-esm-patient-registration__autosuggest__autocompleteSearch___sc5fh{width:100%}.-esm-patient-registration__autosuggest__suggestions___v5o3w a{color:inherit;text-decoration:none}",""]),i.locals={label01:"-esm-patient-registration__autosuggest__label01___f95oj",suggestions:"-esm-patient-registration__autosuggest__suggestions___v5o3w",autocomplete:"-esm-patient-registration__autosuggest__autocomplete___it56z",autocompleteSearch:"-esm-patient-registration__autosuggest__autocompleteSearch___sc5fh"};const a=i},4939:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(2609),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-registration__input__title___4PKlg{color:var(--omrs-color-brand-teal)}.-esm-patient-registration__input__submit___mloB4{width:250px}.-esm-patient-registration__input__submit___mloB4:hover{cursor:pointer}.-esm-patient-registration__input__cancelButton___blAcs{width:11.688rem}.-esm-patient-registration__input__submitButton___SofD2{margin-bottom:1rem;width:11.688rem;display:block}.-esm-patient-registration__input__infoGrid___xohlq{width:100%;padding-left:2rem;margin-bottom:40vh;margin-top:1rem;max-width:50rem}.-esm-patient-registration__input__label01___fwQQq{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);margin-top:1rem;margin-bottom:1rem;color:#8d8d8d}.-esm-patient-registration__input__productiveHeading02___7pE9K{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);color:#8d8d8d;cursor:pointer}.-esm-patient-registration__input__space05___9oNC\\+{margin:1rem 0 1rem 0}.-esm-patient-registration__input__formContainer___YE8UP{display:flex;width:100%}.-esm-patient-registration__input__stickyColumn___KQudo{position:sticky;margin-top:1rem;top:4rem}.-esm-patient-registration__input__touchTarget___lFvgc a:active{color:#161616}.-esm-patient-registration__input__linkName___C8vKy{color:#525252;line-height:1.38;font-size:1rem;font-weight:600}.-esm-patient-registration__input__linkName___C8vKy:active{text-decoration:none;color:#161616}.-esm-patient-registration__input__linkName___C8vKy:hover{text-decoration:none;color:#161616;cursor:pointer}.-esm-patient-registration__input__main___rng6t{background-color:#fff}.omrs-breakpoint-lt-desktop .-esm-patient-registration__input__infoGrid___xohlq{max-width:unset}.-esm-patient-registration__input__fieldRow___5TD7U{display:flex;flex-direction:row;justify-content:flex-start;flex-wrap:wrap}.-esm-patient-registration__input__subFieldRow___zGAH4{margin-bottom:5px}.-esm-patient-registration__input__label___65tRW{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);color:#525252}.-esm-patient-registration__input__textID___F\\+F-t{margin-bottom:1rem}.-esm-patient-registration__input__requiredField___x0TVf{color:#da1e28}.-esm-patient-registration__input__input___JYX4d{margin-right:5px}.-esm-patient-registration__input__checkboxField___gmx7u{display:flex;flex-direction:row;justify-content:flex-start;width:400px;margin-left:10px}.-esm-patient-registration__input__textInput___QJYjz{width:250px !important;height:40px !important}.-esm-patient-registration__input__numberInput___IGlx4{width:200px !important;height:40px !important}.-esm-patient-registration__input__checkboxInput___IVRIk{height:1.5rem !important;width:1.5rem !important;margin-top:8px}.-esm-patient-registration__input__selectInput___yrzZ-{width:150px !important;height:40px !important}.-esm-patient-registration__input__dateInput___2shrY{width:200px !important;height:40px !important;font-size:large !important}.-esm-patient-registration__input__telInput___HxQe3{width:250px !important;height:40px !important}.-esm-patient-registration__input__errorInput___aW2qL{border:2px solid #da1e28 !important;padding-left:.875rem !important}.-esm-patient-registration__input__errorMessage___cbdW2{color:#da1e28;align-self:center}.-esm-patient-registration__input__dummyData___GFQGF{cursor:pointer;margin-left:5px}.-esm-patient-registration__input__IDInput___6B3\\+s{display:grid;grid-template-columns:1fr auto;align-items:center;max-width:27rem}.-esm-patient-registration__input__trashCan___usc53{color:#da1e28}.omrs-breakpoint-lt-desktop .-esm-patient-registration__input__IDInput___6B3\\+s{max-width:unset;width:100%}.-esm-patient-registration__input__dangerLabel01___sb6Np{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);color:#da1e28}",""]),i.locals={title:"-esm-patient-registration__input__title___4PKlg",submit:"-esm-patient-registration__input__submit___mloB4",cancelButton:"-esm-patient-registration__input__cancelButton___blAcs",submitButton:"-esm-patient-registration__input__submitButton___SofD2",infoGrid:"-esm-patient-registration__input__infoGrid___xohlq",label01:"-esm-patient-registration__input__label01___fwQQq",productiveHeading02:"-esm-patient-registration__input__productiveHeading02___7pE9K",space05:"-esm-patient-registration__input__space05___9oNC+",formContainer:"-esm-patient-registration__input__formContainer___YE8UP",stickyColumn:"-esm-patient-registration__input__stickyColumn___KQudo",touchTarget:"-esm-patient-registration__input__touchTarget___lFvgc",linkName:"-esm-patient-registration__input__linkName___C8vKy",main:"-esm-patient-registration__input__main___rng6t",fieldRow:"-esm-patient-registration__input__fieldRow___5TD7U",subFieldRow:"-esm-patient-registration__input__subFieldRow___zGAH4",label:"-esm-patient-registration__input__label___65tRW",textID:"-esm-patient-registration__input__textID___F+F-t",requiredField:"-esm-patient-registration__input__requiredField___x0TVf",input:"-esm-patient-registration__input__input___JYX4d",checkboxField:"-esm-patient-registration__input__checkboxField___gmx7u",textInput:"-esm-patient-registration__input__textInput___QJYjz",numberInput:"-esm-patient-registration__input__numberInput___IGlx4",checkboxInput:"-esm-patient-registration__input__checkboxInput___IVRIk",selectInput:"-esm-patient-registration__input__selectInput___yrzZ-",dateInput:"-esm-patient-registration__input__dateInput___2shrY",telInput:"-esm-patient-registration__input__telInput___HxQe3",errorInput:"-esm-patient-registration__input__errorInput___aW2qL",errorMessage:"-esm-patient-registration__input__errorMessage___cbdW2",dummyData:"-esm-patient-registration__input__dummyData___GFQGF",IDInput:"-esm-patient-registration__input__IDInput___6B3+s",trashCan:"-esm-patient-registration__input__trashCan___usc53",dangerLabel01:"-esm-patient-registration__input__dangerLabel01___sb6Np"};const a=i},1093:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(2609),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-registration__patient-registration__title___d6s20{color:var(--omrs-color-brand-teal)}.-esm-patient-registration__patient-registration__submit___S6frc{width:250px}.-esm-patient-registration__patient-registration__submit___S6frc:hover{cursor:pointer}.-esm-patient-registration__patient-registration__cancelButton___2-E\\+5{width:11.688rem}.-esm-patient-registration__patient-registration__submitButton___Ps1do{margin-bottom:1rem;width:11.688rem;display:block}.-esm-patient-registration__patient-registration__infoGrid___2S1kw{width:100%;padding-left:2rem;margin-bottom:40vh;margin-top:1rem;max-width:50rem}.-esm-patient-registration__patient-registration__label01___CxOgi{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);margin-top:1rem;margin-bottom:1rem;color:#8d8d8d}.-esm-patient-registration__patient-registration__productiveHeading02___mBDux{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);color:#8d8d8d;cursor:pointer}.-esm-patient-registration__patient-registration__space05___\\+IJfn{margin:1rem 0 1rem 0}.-esm-patient-registration__patient-registration__formContainer___ydkLz{display:flex;width:100%}.-esm-patient-registration__patient-registration__stickyColumn___2G55G{position:sticky;margin-top:1rem;top:4rem}.-esm-patient-registration__patient-registration__touchTarget___KxfOv a:active{color:#161616}.-esm-patient-registration__patient-registration__linkName___Ukv7z{color:#525252;line-height:1.38;font-size:1rem;font-weight:600}.-esm-patient-registration__patient-registration__linkName___Ukv7z:active{text-decoration:none;color:#161616}.-esm-patient-registration__patient-registration__linkName___Ukv7z:hover{text-decoration:none;color:#161616;cursor:pointer}.-esm-patient-registration__patient-registration__main___eiIwY{background-color:#fff}.omrs-breakpoint-lt-desktop .-esm-patient-registration__patient-registration__infoGrid___2S1kw{max-width:unset}",""]),i.locals={title:"-esm-patient-registration__patient-registration__title___d6s20",submit:"-esm-patient-registration__patient-registration__submit___S6frc",cancelButton:"-esm-patient-registration__patient-registration__cancelButton___2-E+5",submitButton:"-esm-patient-registration__patient-registration__submitButton___Ps1do",infoGrid:"-esm-patient-registration__patient-registration__infoGrid___2S1kw",label01:"-esm-patient-registration__patient-registration__label01___CxOgi",productiveHeading02:"-esm-patient-registration__patient-registration__productiveHeading02___mBDux",space05:"-esm-patient-registration__patient-registration__space05___+IJfn",formContainer:"-esm-patient-registration__patient-registration__formContainer___ydkLz",stickyColumn:"-esm-patient-registration__patient-registration__stickyColumn___2G55G",touchTarget:"-esm-patient-registration__patient-registration__touchTarget___KxfOv",linkName:"-esm-patient-registration__patient-registration__linkName___Ukv7z",main:"-esm-patient-registration__patient-registration__main___eiIwY"};const a=i},138:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(2609),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-registration__relationships__title___zOYZm{color:var(--omrs-color-brand-teal)}.-esm-patient-registration__relationships__submit___kNlmu{width:250px}.-esm-patient-registration__relationships__submit___kNlmu:hover{cursor:pointer}.-esm-patient-registration__relationships__cancelButton___cFt6p{width:11.688rem}.-esm-patient-registration__relationships__submitButton___CW8X\\+{margin-bottom:1rem;width:11.688rem;display:block}.-esm-patient-registration__relationships__infoGrid___9dg84{width:100%;padding-left:2rem;margin-bottom:40vh;margin-top:1rem;max-width:50rem}.-esm-patient-registration__relationships__label01___TYH\\+i{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);margin-top:1rem;margin-bottom:1rem;color:#8d8d8d}.-esm-patient-registration__relationships__productiveHeading02___PuSkg{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);color:#8d8d8d;cursor:pointer}.-esm-patient-registration__relationships__space05___gWnMG{margin:1rem 0 1rem 0}.-esm-patient-registration__relationships__formContainer___U91DX{display:flex;width:100%}.-esm-patient-registration__relationships__stickyColumn___2cbAk{position:sticky;margin-top:1rem;top:4rem}.-esm-patient-registration__relationships__touchTarget___chVrk a:active{color:#161616}.-esm-patient-registration__relationships__linkName___M6KoQ{color:#525252;line-height:1.38;font-size:1rem;font-weight:600}.-esm-patient-registration__relationships__linkName___M6KoQ:active{text-decoration:none;color:#161616}.-esm-patient-registration__relationships__linkName___M6KoQ:hover{text-decoration:none;color:#161616;cursor:pointer}.-esm-patient-registration__relationships__main___G8ux-{background-color:#fff}.omrs-breakpoint-lt-desktop .-esm-patient-registration__relationships__infoGrid___9dg84{max-width:unset}.-esm-patient-registration__relationships__labelText___hTuhj{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px)}.-esm-patient-registration__relationships__bodyShort02___hfBao{font-size:var(--cds-body-compact-02-font-size, 1rem);font-weight:var(--cds-body-compact-02-font-weight, 400);line-height:var(--cds-body-compact-02-line-height, 1.375);letter-spacing:var(--cds-body-compact-02-letter-spacing, 0)}.-esm-patient-registration__relationships__searchBox___xY0Yt{margin-bottom:1rem}.-esm-patient-registration__relationships__relationshipHeader___2w\\+Ew{display:flex;align-items:center}.-esm-patient-registration__relationships__productiveHeading___IiVgd{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);color:#525252}.-esm-patient-registration__relationships__trashCan___nBYrg{color:#da1e28 !important}.omrs-breakpoint-lt-desktop .-esm-patient-registration__relationships__relationshipHeader___2w\\+Ew{justify-content:space-between}",""]),i.locals={title:"-esm-patient-registration__relationships__title___zOYZm",submit:"-esm-patient-registration__relationships__submit___kNlmu",cancelButton:"-esm-patient-registration__relationships__cancelButton___cFt6p",submitButton:"-esm-patient-registration__relationships__submitButton___CW8X+",infoGrid:"-esm-patient-registration__relationships__infoGrid___9dg84",label01:"-esm-patient-registration__relationships__label01___TYH+i",productiveHeading02:"-esm-patient-registration__relationships__productiveHeading02___PuSkg",space05:"-esm-patient-registration__relationships__space05___gWnMG",formContainer:"-esm-patient-registration__relationships__formContainer___U91DX",stickyColumn:"-esm-patient-registration__relationships__stickyColumn___2cbAk",touchTarget:"-esm-patient-registration__relationships__touchTarget___chVrk",linkName:"-esm-patient-registration__relationships__linkName___M6KoQ",main:"-esm-patient-registration__relationships__main___G8ux-",labelText:"-esm-patient-registration__relationships__labelText___hTuhj",bodyShort02:"-esm-patient-registration__relationships__bodyShort02___hfBao",searchBox:"-esm-patient-registration__relationships__searchBox___xY0Yt",relationshipHeader:"-esm-patient-registration__relationships__relationshipHeader___2w+Ew",productiveHeading:"-esm-patient-registration__relationships__productiveHeading___IiVgd",trashCan:"-esm-patient-registration__relationships__trashCan___nBYrg"};const a=i},2936:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(2609),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-registration__section__title___WE522{color:var(--omrs-color-brand-teal)}.-esm-patient-registration__section__submit___ZCyMT{width:250px}.-esm-patient-registration__section__submit___ZCyMT:hover{cursor:pointer}.-esm-patient-registration__section__cancelButton___BtWcr{width:11.688rem}.-esm-patient-registration__section__submitButton___SX3tz{margin-bottom:1rem;width:11.688rem;display:block}.-esm-patient-registration__section__infoGrid___m6EFv{width:100%;padding-left:2rem;margin-bottom:40vh;margin-top:1rem;max-width:50rem}.-esm-patient-registration__section__label01___SB4dO{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);margin-top:1rem;margin-bottom:1rem;color:#8d8d8d}.-esm-patient-registration__section__productiveHeading02___0Qr6X{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);color:#8d8d8d;cursor:pointer}.-esm-patient-registration__section__space05___\\+I97l{margin:1rem 0 1rem 0}.-esm-patient-registration__section__formContainer___bUz8M{display:flex;width:100%}.-esm-patient-registration__section__stickyColumn___e3QEm{position:sticky;margin-top:1rem;top:4rem}.-esm-patient-registration__section__touchTarget___ubpCE a:active{color:#161616}.-esm-patient-registration__section__linkName___NOqjy{color:#525252;line-height:1.38;font-size:1rem;font-weight:600}.-esm-patient-registration__section__linkName___NOqjy:active{text-decoration:none;color:#161616}.-esm-patient-registration__section__linkName___NOqjy:hover{text-decoration:none;color:#161616;cursor:pointer}.-esm-patient-registration__section__main___3eHUo{background-color:#fff}.omrs-breakpoint-lt-desktop .-esm-patient-registration__section__infoGrid___m6EFv{max-width:unset}",""]),i.locals={title:"-esm-patient-registration__section__title___WE522",submit:"-esm-patient-registration__section__submit___ZCyMT",cancelButton:"-esm-patient-registration__section__cancelButton___BtWcr",submitButton:"-esm-patient-registration__section__submitButton___SX3tz",infoGrid:"-esm-patient-registration__section__infoGrid___m6EFv",label01:"-esm-patient-registration__section__label01___SB4dO",productiveHeading02:"-esm-patient-registration__section__productiveHeading02___0Qr6X",space05:"-esm-patient-registration__section__space05___+I97l",formContainer:"-esm-patient-registration__section__formContainer___bUz8M",stickyColumn:"-esm-patient-registration__section__stickyColumn___e3QEm",touchTarget:"-esm-patient-registration__section__touchTarget___ubpCE",linkName:"-esm-patient-registration__section__linkName___NOqjy",main:"-esm-patient-registration__section__main___3eHUo"};const a=i},7857:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(2609),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-patient-registration__overlay__title___ovEFv{color:var(--omrs-color-brand-teal)}.-esm-patient-registration__overlay__submit___MEU04{width:250px}.-esm-patient-registration__overlay__submit___MEU04:hover{cursor:pointer}.-esm-patient-registration__overlay__cancelButton___Kuq8k{width:11.688rem}.-esm-patient-registration__overlay__submitButton___koip2{margin-bottom:1rem;width:11.688rem;display:block}.-esm-patient-registration__overlay__infoGrid___IR-lJ{width:100%;padding-left:2rem;margin-bottom:40vh;margin-top:1rem;max-width:50rem}.-esm-patient-registration__overlay__label01___UFjWe{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);margin-top:1rem;margin-bottom:1rem;color:#8d8d8d}.-esm-patient-registration__overlay__productiveHeading02___0-7g8{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);color:#8d8d8d;cursor:pointer}.-esm-patient-registration__overlay__space05___3-aCf{margin:1rem 0 1rem 0}.-esm-patient-registration__overlay__formContainer___0etfN{display:flex;width:100%}.-esm-patient-registration__overlay__stickyColumn___ZAq3J{position:sticky;margin-top:1rem;top:4rem}.-esm-patient-registration__overlay__touchTarget___eSQ3o a:active{color:#161616}.-esm-patient-registration__overlay__linkName___Kol4j{color:#525252;line-height:1.38;font-size:1rem;font-weight:600}.-esm-patient-registration__overlay__linkName___Kol4j:active{text-decoration:none;color:#161616}.-esm-patient-registration__overlay__linkName___Kol4j:hover{text-decoration:none;color:#161616;cursor:pointer}.-esm-patient-registration__overlay__main___pCgsu{background-color:#fff}.omrs-breakpoint-lt-desktop .-esm-patient-registration__overlay__infoGrid___IR-lJ{max-width:unset}.-esm-patient-registration__overlay__desktopOverlay___pTy0O{position:fixed;top:3rem;right:0;height:calc(100vh - 3rem);min-width:27rem;background-color:#fff;border-left:1px solid #a8a8a8;overflow:hidden;display:grid;grid-template-rows:auto 1fr auto;z-index:999}.-esm-patient-registration__overlay__tabletOverlay___\\+CQze{position:fixed;top:0;bottom:0;left:0;right:0;z-index:9999;background-color:#fff;overflow:hidden;padding-top:3rem;display:grid;grid-template-rows:1fr auto}.-esm-patient-registration__overlay__tabletOverlayHeader___omtl4 button{background-color:#005d5d !important}.-esm-patient-registration__overlay__tabletOverlayHeader___omtl4 .-esm-patient-registration__overlay__headerContent___S7vPL{color:#fff}.-esm-patient-registration__overlay__desktopHeader___X3NCa{display:flex;justify-content:space-between;align-items:center;background-color:#e0e0e0;border-bottom:1px solid #a8a8a8}.-esm-patient-registration__overlay__headerContent___S7vPL{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);padding:0 1rem;color:#161616}.-esm-patient-registration__overlay__closeButton___8Pcw1{background-color:#fff}.-esm-patient-registration__overlay__overlayContent___9V2UN{padding:1rem;overflow-y:auto}",""]),i.locals={title:"-esm-patient-registration__overlay__title___ovEFv",submit:"-esm-patient-registration__overlay__submit___MEU04",cancelButton:"-esm-patient-registration__overlay__cancelButton___Kuq8k",submitButton:"-esm-patient-registration__overlay__submitButton___koip2",infoGrid:"-esm-patient-registration__overlay__infoGrid___IR-lJ",label01:"-esm-patient-registration__overlay__label01___UFjWe",productiveHeading02:"-esm-patient-registration__overlay__productiveHeading02___0-7g8",space05:"-esm-patient-registration__overlay__space05___3-aCf",formContainer:"-esm-patient-registration__overlay__formContainer___0etfN",stickyColumn:"-esm-patient-registration__overlay__stickyColumn___ZAq3J",touchTarget:"-esm-patient-registration__overlay__touchTarget___eSQ3o",linkName:"-esm-patient-registration__overlay__linkName___Kol4j",main:"-esm-patient-registration__overlay__main___pCgsu",desktopOverlay:"-esm-patient-registration__overlay__desktopOverlay___pTy0O",tabletOverlay:"-esm-patient-registration__overlay__tabletOverlay___+CQze",tabletOverlayHeader:"-esm-patient-registration__overlay__tabletOverlayHeader___omtl4",headerContent:"-esm-patient-registration__overlay__headerContent___S7vPL",desktopHeader:"-esm-patient-registration__overlay__desktopHeader___X3NCa",closeButton:"-esm-patient-registration__overlay__closeButton___8Pcw1",overlayContent:"-esm-patient-registration__overlay__overlayContent___9V2UN"};const a=i},4954:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(2609),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,".-esm-patient-registration__root__root___msybz{background-color:#fff}.-esm-patient-registration__root__grid___p9P\\+g{grid-template-columns:repeat(1, minmax(0, 1fr))}",""]),i.locals={root:"-esm-patient-registration__root__root___msybz",grid:"-esm-patient-registration__root__grid___p9P+g"};const a=i},7658:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Tn});var r=n(268),i=n.n(r),a=n(8744),o=n(2430),l=n(906),s=n(6279),c=n(781),u=n(4924),d=n(7065),_=n(73),m=n(4519),p=n.n(m),f=_.Ry({givenName:_.Z_().required("givenNameRequired"),familyName:_.Z_().required("familyNameRequired"),additionalGivenName:_.Z_().when("addNameInLocalLanguage",{is:!0,then:_.Z_().required("givenNameRequired"),otherwise:_.Z_().notRequired()}),additionalFamilyName:_.Z_().when("addNameInLocalLanguage",{is:!0,then:_.Z_().required("familyNameRequired"),otherwise:_.Z_().notRequired()}),gender:_.Z_().oneOf(["Male","Female","Other","Unknown"],"genderUnspecified").required("genderRequired"),birthdate:_.hT().when("birthdateEstimated",{is:!1,then:_.hT().required("birthdayRequired").max(Date(),"birthdayNotInTheFuture").nullable(),otherwise:_.hT().nullable()}),yearsEstimated:_.Rx().when("birthdateEstimated",{is:!0,then:_.Rx().required("yearsEstimateRequired").min(0,"negativeYears"),otherwise:_.Rx().nullable()}),monthsEstimated:_.Rx().min(0,"negativeMonths"),deathDate:_.hT().max(Date(),"deathdayNotInTheFuture").nullable(),email:_.Z_().optional().email("invalidEmail"),identifiers:_.Vo((function(e){return _.Ry(p()(e,(function(){return _.Ry({required:_.Xg(),identifierValue:_.Z_().when("required",{is:!0,then:_.Z_().required("identifierValueRequired"),otherwise:_.Z_().notRequired()})})})))}))}),g=(0,r.createContext)(void 0),h=n(3076),v=n(7117),b=n(9571),y=n(6062),w=n.n(y),E=n(4036),x=n.n(E),k=n(6793),T=n.n(k),S=n(7892),O=n.n(S),N=n(1173),I=n.n(N),C=n(2464),j=n.n(C),A=n(4939),P={};P.styleTagTransform=j(),P.setAttributes=O(),P.insert=T().bind(null,"head"),P.domAPI=x(),P.insertStyleElement=I(),w()(A.Z,P);const D=A.Z&&A.Z.locals?A.Z.locals:void 0;var F={patientUuid:(0,b.Z)(),givenName:"John",middleName:"",familyName:"Smith",unidentifiedPatient:!1,additionalGivenName:"Joey",additionalMiddleName:"",additionalFamilyName:"Smitty",addNameInLocalLanguage:!0,gender:"Male",birthdate:new Date(2020,1,1),yearsEstimated:1,monthsEstimated:2,birthdateEstimated:!0,telephoneNumber:"0800001066",isDead:!1,deathDate:"",deathCause:"",relationships:[],address:{address1:"Bom Jesus Street",address2:"",cityVillage:"Recife",stateProvince:"Pernambuco",country:"Brazil",postalCode:"50030-310"},identifiers:{}},B=function(e){var t=e.setValues;return i().createElement("main",null,i().createElement("button",{onClick:function(){return t(F)},className:"omrs-btn omrs-filled-neutral ".concat(D.dummyData),type:"button","aria-label":"Dummy Data Input"},"Input Dummy Data"))},L=n(2777),U=n(1525);function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function V(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){V(e,t,n[t])}))}return e}function R(e,t,n){var r,i,a;return null!==(a=null===(i=null===(r=n.querySelector(t))||void 0===r?void 0:r.querySelector("[name=".concat(e,"]")))||void 0===i?void 0:i.getAttribute("value"))&&void 0!==a?a:null}function H(){(0,l.navigate)({to:"".concat(window.spaBase,"/home")})}function q(e){var t,n={},r=null===(t=e.address)||void 0===t?void 0:t[0];if(r){var i=!0,a=!1,o=void 0;try{for(var l,s=Object.keys(r)[Symbol.iterator]();!(i=(l=s.next()).done);i=!0){var c=l.value;switch(c){case"city":n.cityVillage=r[c];break;case"state":n.stateProvince=r[c];break;case"district":n.countyDistrict=r[c];break;case"extension":r[c].forEach((function(e){e.extension.forEach((function(e){n[e.url.split("#")[1]]=e.valueString}))}));break;default:"country"!==c&&"postalCode"!==c||(n[c]=r[c])}}}catch(e){a=!0,o=e}finally{try{i||null==s.return||s.return()}finally{if(a)throw o}}}return n}function M(e){var t,n=e.name[0],r=e.name[1],i=null===(t=e.address)||void 0===t?void 0:t[0];return Z({preferredNameUuid:null==n?void 0:n.id,additionalNameUuid:null==r?void 0:r.id,preferredAddressUuid:null==i?void 0:i.id},e.identifier.map((function(e){return V({},(0,L.Z)(e.system||e.type.text),{uuid:e.id,value:e.value})})))}var G=n(9857),W=n(8179);function Y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Q(e,t,n,r,i,a,o){try{var l=e[a](o),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,i)}function K(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){Q(a,r,i,o,l,"next",e)}function l(e){Q(a,r,i,o,l,"throw",e)}o(void 0)}))}}function $(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){$(e,t,n[t])}))}return e}function J(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function ee(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Y(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var te=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};function ne(e){return re.apply(this,arguments)}function re(){return(re=K((function(e){return te(this,(function(t){switch(t.label){case 0:return[4,(0,l.getSynchronizationItems)(W.Kt)];case 1:return[2,t.sent().find((function(t){return t._patientRegistrationData.formValues.patientUuid===e}))]}}))}))).apply(this,arguments)}var ie=n(225),ae=n(1093),oe={};oe.styleTagTransform=j(),oe.setAttributes=O(),oe.insert=T().bind(null,"head"),oe.domAPI=x(),oe.insertStyleElement=I(),w()(ae.Z,oe);const le=ae.Z&&ae.Z.locals?ae.Z.locals:void 0;function se(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ce(){return ce=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ce.apply(this,arguments)}var ue=function(e){var t,n,a=e.checkWarning,l=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,["checkWarning"]),s=(t=(0,d.U$)(l.name),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(t,n)||function(e,t){if(e){if("string"==typeof e)return se(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?se(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=s[0],_=s[1],m=(0,u.useTranslation)().t,p=c.value||"",f=_.error&&m(_.error),g=(0,r.useMemo)((function(){if(!f&&"function"==typeof a){var e=a(p);return e&&m(e)}}),[a,f,p,m]),h=l.required?l.labelText:"".concat(l.labelText," (").concat(m("optional","optional"),")");return i().createElement("div",{style:{marginBottom:"1rem"}},i().createElement(o.mh4,null,i().createElement(o.oil,ce({},l,c,{labelText:h,invalid:!(!_.touched||!_.error),invalidText:f,warn:!!g,warnText:g,value:p}))))},de=function(){var e=(0,u.useTranslation)().t;return i().createElement("div",null,i().createElement(ue,{id:"phone",name:"attributes.14d4f066-15f5-102d-96e4-000c29c2a5d7",labelText:e("phoneNumberInputLabelText","Phone number"),light:!0}))},_e=n(1098),me={};me.styleTagTransform=j(),me.setAttributes=O(),me.insert=T().bind(null,"head"),me.domAPI=x(),me.insertStyleElement=I(),w()(_e.Z,me);const pe=_e.Z&&_e.Z.locals?_e.Z.locals:void 0;var fe=function(){var e=(0,u.useTranslation)().t;return i().createElement("div",null,i().createElement("h4",{className:pe.productiveHeading02Light},e("phoneEmailLabelText","Phone, Email")),i().createElement("div",{className:pe.grid},i().createElement(de,null),i().createElement(ue,{id:"email",name:"attributes.ac7d7773-fe9f-11ec-8b9b-0242ac1b0002",labelText:e("emailLabelText","Email")})))};function ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var he=/^([^0-9]*)$/;function ve(e){if(!he.test(e))return"numberInNameDubious"}var be=function(){var e,t,n=(0,l.useConfig)().fieldConfigurations.name.displayCapturePhoto,a=(0,u.useTranslation)().t,s=(0,r.useContext)(g),c=s.setCapturePhotoProps,_=s.currentPhoto,m=s.setFieldValue,p=(0,l.useConfig)().fieldConfigurations,f=null==p?void 0:p.name,h=!(e=(0,d.U$)("unidentifiedPatient"),t=1,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ge(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ge(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0].value,v=(0,r.useCallback)((function(e,t){c&&c({imageData:e,dateTime:t})}),[c]);return i().createElement("div",null,i().createElement("h4",{className:pe.productiveHeading02Light},a("fullNameLabelText","Full Name")),i().createElement("div",{className:pe.grid},n&&i().createElement(l.ExtensionSlot,{className:pe.photoExtension,extensionSlotName:"capture-patient-photo-slot",state:{onCapturePhoto:v,initialState:_}}),i().createElement("div",{className:pe.nameField},i().createElement("div",{className:pe.dobContentSwitcherLabel},i().createElement("span",{className:pe.label01},a("patientNameKnown","Patient's Name is Known?"))),i().createElement(o.GHR,{className:pe.contentSwitcher,onChange:function(e){"known"===e.name?(m("givenName",""),m("familyName",""),m("unidentifiedPatient",!1)):(m("givenName",f.defaultUnknownGivenName),m("familyName",f.defaultUnknownFamilyName),m("unidentifiedPatient",!0))}},i().createElement(o.rsf,{name:"known",text:a("yes","Yes")}),i().createElement(o.rsf,{name:"unknown",text:a("no","No")})),h&&i().createElement(i().Fragment,null,i().createElement(ue,{id:"givenName",name:"givenName",labelText:a("givenNameLabelText","First Name"),checkWarning:ve,required:!0}),f.displayMiddleName&&i().createElement(ue,{id:"middleName",name:"middleName",labelText:a("middleNameLabelText","Middle Name"),light:!0,checkWarning:ve}),i().createElement(ue,{id:"familyName",name:"familyName",labelText:a("familyNameLabelText","Family Name"),checkWarning:ve,required:!0})))))};function ye(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var we=function(){var e,t,n=(0,l.useConfig)().fieldConfigurations,a=(0,u.useTranslation)().t,s=(e=(0,d.U$)("gender"),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ye(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ye(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=s[0],_=s[1],m=(0,r.useContext)(g).setFieldValue,p=null==n?void 0:n.gender;return i().createElement("div",{className:pe.halfWidthInDesktopView},i().createElement("h4",{className:pe.productiveHeading02Light},a("sexFieldLabelText","Sex")),i().createElement("div",{className:pe.sexField},i().createElement("p",{className:"cds--label"},a("genderLabelText","Sex")),i().createElement(o.SYO,{name:"gender",orientation:"vertical",onChange:function(e){m("gender",e)},valueSelected:c.value},p.map((function(e){return i().createElement(o.EUY,{key:e.label,id:e.id,value:e.value,labelText:a("".concat(e.label),"".concat(e.label))})}))),_.touched&&_.error&&i().createElement("div",{className:pe.radioFieldError},a(_.error,"Gender is required"))))},Ee=n(6759),xe=n(2074),ke=n(7857),Te={};Te.styleTagTransform=j(),Te.setAttributes=O(),Te.insert=T().bind(null,"head"),Te.domAPI=x(),Te.insertStyleElement=I(),w()(ke.Z,Te);const Se=ke.Z&&ke.Z.locals?ke.Z.locals:void 0;function Oe(){return Oe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oe.apply(this,arguments)}const Ne=function(e){var t=e.close,n=e.children,r=e.header,a=e.buttonsGroup,s=(0,u.useTranslation)().t,c=(0,l.useLayoutType)();return i().createElement("div",{className:(0,l.isDesktop)(c)?Se.desktopOverlay:Se.tabletOverlay},(0,l.isDesktop)(c)?i().createElement("div",{className:Se.desktopHeader},i().createElement("div",{className:Se.headerContent},r),i().createElement(o.zxk,{className:Se.closeButton,iconDescription:s("closeOverlay","Close overlay"),onClick:t,kind:"ghost",hasIconOnly:!0,renderIcon:function(e){return i().createElement(xe.x8,Oe({size:16},e))}})):i().createElement(o.h4i,{className:Se.tabletOverlayHeader},i().createElement(o.zxk,{kind:"ghost",onClick:t,hasIconOnly:!0,iconDescription:s("closeOverlay","Close overlay"),renderIcon:function(e){return i().createElement(Ee.Xd,Oe({size:16,onClick:t},e))}}),i().createElement("div",{className:Se.headerContent},r)),i().createElement("div",{className:Se.overlayContent},n),i().createElement("div",null,a))};function Ie(e){return Ce(e)&&!e.identifierSources.some((function(e){var t,n;return!(null===(t=e.autoGenerationOption)||void 0===t?void 0:t.manualEntryEnabled)&&(null===(n=e.autoGenerationOption)||void 0===n?void 0:n.automaticGenerationEnabled)}))}function Ce(e){return"UNIQUE"===e.uniquenessBehavior||"LOCATION"===e.uniquenessBehavior}var je=n(3433),Ae={};Ae.styleTagTransform=j(),Ae.setAttributes=O(),Ae.insert=T().bind(null,"head"),Ae.domAPI=x(),Ae.insertStyleElement=I(),w()(je.Z,Ae);const Pe=je.Z&&je.Z.locals?je.Z.locals:void 0;function De(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Fe(e,t,n[t])}))}return e}function Le(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function Ue(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return De(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?De(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const ze=function(e){var t,n=e.closeOverlay,a=e.setFieldValue,c=(0,l.useLayoutType)(),d=(0,r.useContext)(s.Cg).identifierTypes,_=(0,r.useContext)(g),m=_.isOffline,p=_.values,f=_.initialFormValues,h=Ue((0,r.useState)(p.identifiers),2),v=h[0],b=h[1],y=Ue((0,r.useState)(""),2),w=y[0],E=y[1],x=(0,u.useTranslation)().t,k=(0,l.useConfig)().defaultPatientIdentifierTypes,T=(0,r.useMemo)((function(){var e={};return null==k||k.forEach((function(t){e[t]=!0})),e}),[k]);(0,r.useEffect)((function(){b(p.identifiers)}),[p.identifiers]);var S=(0,r.useCallback)((function(e){var n;return E(null!==(t=null==e||null===(n=e.target)||void 0===n?void 0:n.value)&&void 0!==t?t:"")}),[]),O=(0,r.useMemo)((function(){return null==d?void 0:d.filter((function(e){var t;return null==e||null===(t=e.name)||void 0===t?void 0:t.toLowerCase().includes(w.toLowerCase())}))}),[v,w]),N=function(e,t){return b((function(n){var r,i;return t?Le(Be({},n),Fe({},e.fieldName,et(e,null!==(i=null!==(r=p.identifiers[e.fieldName])&&void 0!==r?r:f.identifiers[e.fieldName])&&void 0!==i?i:{}))):n[e.fieldName]?Object.fromEntries(Object.entries(n).filter((function(t){return Ue(t,1)[0]!==e.fieldName}))):n}))},I=(0,r.useMemo)((function(){return O.map((function(e){var t,n,r=v[e.fieldName],a=e.isPrimary||e.required||T[e.uuid]||p.identifiers[e.fieldName],l=m&&Ie(e);return i().createElement("div",{key:e.uuid,className:Pe.space05},i().createElement(o.XZJ,{id:e.uuid,value:e.uuid,labelText:e.name,onChange:function(t){return N(e,t)},checked:!!r,disabled:a||m&&l}),r&&(null==e||null===(t=e.identifierSources)||void 0===t?void 0:t.length)>0&&(!r.initialValue||(null==r?void 0:r.selectedSource))&&i().createElement("div",{className:Pe.radioGroup},i().createElement(o.SYO,{legendText:x("source","Source"),name:"".concat(null==e?void 0:e.fieldName,"-identifier-sources"),defaultSelected:null==r||null===(n=r.selectedSource)||void 0===n?void 0:n.uuid,onChange:function(t){return function(e,t){return b((function(n){return Le(Be({},n),Fe({},e.fieldName,Be({},n[e.fieldName],Je(e.identifierSources.find((function(e){return e.uuid===t})),n[e.fieldName].identifierValue,n[e.fieldName].initialValue))))}))}(e,t)},orientation:"vertical"},null==e?void 0:e.identifierSources.map((function(t){var n;return i().createElement(o.EUY,{key:t.uuid,labelText:t.name,name:t.uuid,value:t.uuid,className:Pe.radioButton,disabled:m&&Ce(e)&&(null===(n=t.autoGenerationOption)||void 0===n?void 0:n.manualEntryEnabled)})})))))}))}),[O,v,T,p.identifiers,m,N]),C=(0,r.useCallback)((function(){a("identifiers",v),n()}),[v,a]);return i().createElement(Ne,{close:n,header:x("configureIdentifiers","Configure identifiers"),buttonsGroup:i().createElement(o.uVA,{className:(0,l.isDesktop)(c)?Pe.desktop:Pe.tablet},i().createElement(o.zxk,{className:Pe.button,kind:"secondary",onClick:n},x("cancel","Cancel")),i().createElement(o.zxk,{className:Pe.button,kind:"primary",onClick:C},x("configureIdentifiers","Configure identifiers")))},i().createElement("div",null,i().createElement("p",{className:Pe.bodyLong02},x("IDInstructions","Select the identifiers you'd like to add for this patient:")),d.length>7&&i().createElement("div",{className:Pe.space05},i().createElement(o.olm,{labelText:x("searchIdentifierPlaceholder","Search identifier"),placeholder:x("searchIdentifierPlaceholder","Search identifier"),onChange:S,value:w})),i().createElement("fieldset",null,I)))};var Ve=n(7631),Ze=n(3469),Re=n(5508);function He(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Me(){return Me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Me.apply(this,arguments)}function Ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){qe(e,t,n[t])}))}return e}function We(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return He(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?He(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ye=function(e){var t=e.patientIdentifier,n=e.fieldName,a=(0,u.useTranslation)().t,c=(0,l.useConfig)().defaultPatientIdentifierTypes,_=(0,r.useContext)(s.Cg).identifierTypes,m=(0,r.useContext)(g),p=m.isOffline,f=m.values,h=m.setFieldValue,v=(0,r.useMemo)((function(){return _.find((function(e){return e.uuid===t.identifierTypeUuid}))}),[t,_]),b=t.autoGeneration,y=t.initialValue,w=t.identifierValue,E=t.identifierName,x=t.required,k=We((0,r.useState)(b||y===w),2),T=k[0],S=k[1],O="identifiers.".concat(n,".identifierValue"),N=We((0,d.U$)(O),2),I=N[0],C=N[1],j=p&&Ie(v),A=(0,r.useMemo)((function(){var e={};return null==c||c.forEach((function(t){e[t]=!0})),e}),[c]),P=(0,r.useCallback)((function(){var e,r;S(!0),h("identifiers.".concat(n),(e=Ge({},t),r=null!=(r={identifierValue:y,selectedSource:null,autoGeneration:!1})?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e))}),[y,S]);return i().createElement("div",{className:D.IDInput},b||T?i().createElement("div",{className:D.textID},i().createElement("p",{className:D.label},E),i().createElement("p",{className:D.bodyShort02},b?a("autoGeneratedPlaceholderText","Auto-generated"):w),i().createElement("input",Me({type:"hidden"},I,{disabled:!0})),!(!C.touched||!C.error)&&i().createElement("span",{className:D.dangerLabel01},C.error&&a(C.error))):i().createElement(ue,Me({id:O,labelText:E,name:O,disabled:j,required:x,invalid:!(!C.touched||!C.error),invalidText:C.error&&a(C.error)},I)),i().createElement("div",null,!t.required&&t.initialValue&&T&&i().createElement(o.zxk,{kind:"ghost",onClick:function(){var e;S(!1),h("identifiers.".concat(n),Ge({},t,Je(null==v||null===(e=v.identifierSources)||void 0===e?void 0:e[0],y,y)))},iconDescription:a("editIdentifierTooltip","Edit"),disabled:j,hasIconOnly:!0},i().createElement(Ve.I8,{size:16})),y&&y!==w&&i().createElement(o.zxk,{kind:"ghost",onClick:P,iconDescription:a("resetIdentifierTooltip","Reset"),disabled:j,hasIconOnly:!0},i().createElement(Ze.AG,{size:16})),!t.required&&!A[t.identifierTypeUuid]&&i().createElement(l.UserHasAccess,{privilege:"coreapps.systemAdministration"},i().createElement(o.zxk,{kind:"danger--ghost",onClick:function(){if(y)var e=(0,l.showModal)("delete-identifier-confirmation-modal",{deleteIdentifier:function(t){t&&h("identifiers",tt(f.identifiers,n)),e()},identifierName:E,initialValue:y});else h("identifiers",tt(f.identifiers,n))},iconDescription:a("deleteIdentifierTooltip","Delete"),disabled:j,hasIconOnly:!0},i().createElement(Re.ZN,{size:16})))))};function Qe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ke(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $e(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ke(e,t,n[t])}))}return e}function Xe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Qe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qe(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Je(e,t,n){var r,i=null==e||null===(r=e.autoGenerationOption)||void 0===r?void 0:r.automaticGenerationEnabled;return{selectedSource:e,autoGeneration:i,identifierValue:i?"auto-generated":"auto-generated"!==t?t:n}}function et(e,t){var n,r,i;return $e({identifierTypeUuid:e.uuid,identifierName:e.name,preferred:e.isPrimary,initialValue:"",required:e.isPrimary||e.required},t,Je(null!==(r=null==t?void 0:t.selectedSource)&&void 0!==r?r:null===(n=e.identifierSources)||void 0===n?void 0:n[0],null==t?void 0:t.identifierValue,null!==(i=null==t?void 0:t.initialValue)&&void 0!==i?i:""))}function tt(e,t){return Object.fromEntries(Object.entries(e).filter((function(e){return Xe(e,1)[0]!==t})))}var nt=function(){var e=(0,r.useContext)(s.Cg).identifierTypes,t=!e,n=(0,r.useContext)(g),a=n.values,c=n.setFieldValue,d=n.initialFormValues,_=(0,u.useTranslation)().t,m=(0,l.useLayoutType)(),p=Xe((0,r.useState)(!1),2),f=p[0],h=p[1],v=(0,l.useConfig)().defaultPatientIdentifierTypes;return(0,r.useEffect)((function(){if(e){var t={};e.filter((function(e){return e.isPrimary||e.required||!!(null==v?void 0:v.find((function(t){return t===e.uuid})))})).filter((function(e){return!a.identifiers[e.fieldName]})).forEach((function(e){var n,r;t[e.fieldName]=et(e,null!==(r=null!==(n=a.identifiers[e.uuid])&&void 0!==n?n:d.identifiers[e.uuid])&&void 0!==r?r:{})})),Object.keys(t).length&&c("identifiers",$e({},a.identifiers,t))}}),[e,c,et,v,a.identifiers]),t?i().createElement("div",{className:pe.halfWidthInDesktopView},i().createElement("div",{className:pe.identifierLabelText},i().createElement("h4",{className:pe.productiveHeading02Light},_("idFieldLabelText","Identifiers"))),i().createElement(o.N2B,null)):i().createElement("div",{className:pe.halfWidthInDesktopView},i().createElement(l.UserHasAccess,{privilege:"coreapps.systemAdministration"},i().createElement("div",{className:pe.identifierLabelText},i().createElement("h4",{className:pe.productiveHeading02Light},_("idFieldLabelText","Identifiers")),i().createElement(o.zxk,{kind:"ghost",className:pe.setIDNumberButton,onClick:function(){return h(!0)},size:(0,l.isDesktop)(m)?"sm":"md"},_("configure","Configure")," ",i().createElement(Ee.ol,{size:16})))),i().createElement("div",null,Object.entries(a.identifiers).map((function(e){var t=Xe(e,2),n=t[0],r=t[1];return i().createElement(Ye,{key:n,fieldName:n,patientIdentifier:r})})),f&&i().createElement(ze,{setFieldValue:c,closeOverlay:function(){return h(!1)}})))};function rt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function it(){return it=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},it.apply(this,arguments)}function at(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return rt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ot=function(e,t,n){var r=n.useEstimatedDateOfBirth,i=r.enabled,a=r.month,o=r.dayOfMonth,l=new Date,s=new Date(l.getFullYear()-e,l.getMonth()-t,1),c=new Date(s.getFullYear(),s.getMonth()+1,0).getDate(),u=new Date(s.getFullYear(),s.getMonth(),Math.min(l.getDate(),c));return i?new Date(u.getFullYear(),a,o):u},lt=function(){var e,t,n=(0,u.useTranslation)().t,a=(0,l.useConfig)().fieldConfigurations.dateOfBirth,s=!at((0,d.U$)("birthdateEstimated"),1)[0].value,c=at((0,d.U$)("birthdate"),2),_=c[0],m=c[1],p=at((0,d.U$)("yearsEstimated"),2),f=p[0],h=p[1],v=at((0,d.U$)("monthsEstimated"),2),b=v[0],y=v[1],w=(0,r.useContext)(g).setFieldValue,E=(t="/",{parse:function(n){var r=n.split(t),i=new Date(null);return e.forEach((function(e,t){switch(e){case"d":i.setDate(parseInt(r[t]));break;case"m":i.setMonth(parseInt(r[t])-1);break;case"Y":i.setFullYear(parseInt(r[t]))}})),i},format:function(n){if(null===n)return"";if(i=n,null!=(a=Date)&&"undefined"!=typeof Symbol&&a[Symbol.hasInstance]?a[Symbol.hasInstance](i):i instanceof a){var r=[];return e.forEach((function(e,t){switch(e){case"d":r[t]=n.getDate();break;case"m":r[t]=n.getMonth()+1;break;case"Y":r[t]=n.getFullYear()}})),r.join(t)}return n;var i,a},placeHolder:(e=["d","m","Y"]).map((function(e){return"Y"===e?"YYYY":e+e})).join(t),dateFormat:e.join(t)}),x=E.format,k=E.placeHolder,T=E.dateFormat,S=new Date;return i().createElement("div",{className:pe.halfWidthInDesktopView},i().createElement("h4",{className:pe.productiveHeading02Light},n("birthFieldLabelText","Birth")),i().createElement("div",{className:pe.dobField},i().createElement("div",{className:pe.dobContentSwitcherLabel},i().createElement("span",{className:pe.label01},n("dobToggleLabelText","Date of Birth Known?"))),i().createElement(o.GHR,{onChange:function(e){w("birthdateEstimated","unknown"===e.name),w("birthdate",""),w("yearsEstimated",""),w("monthsEstimated","")}},i().createElement(o.rsf,{name:"known",text:n("yes","Yes")}),i().createElement(o.rsf,{name:"unknown",text:n("no","No")}))),s?i().createElement("div",{className:pe.dobField},i().createElement(o.Mtg,{dateFormat:T,datePickerType:"single",onChange:function(e){var t=at(e,1)[0];w("birthdate",t)},maxDate:x(S)},i().createElement(o.aj6,it({id:"birthdate"},_,{placeholder:k,labelText:n("dateOfBirthLabelText","Date of Birth"),invalid:!(!m.touched||!m.error),invalidText:m.error&&n(m.error),value:x(_.value)})))):i().createElement("div",{className:pe.grid},i().createElement(o.oil,{id:"yearsEstimated",type:"number",name:f.name,light:!0,onChange:function(e){var t=+e.target.value;!isNaN(t)&&t<140&&t>=0&&(w("yearsEstimated",t),w("birthdate",ot(t,y.value,a)))},labelText:n("estimatedAgeInYearsLabelText","Estimated age in years"),invalid:!(!h.touched||!h.error),invalidText:h.error&&n(h.error),value:f.value,min:0,required:!0}),i().createElement(o.oil,{id:"monthsEstimated",type:"number",name:b.name,light:!0,onChange:function(e){var t=+e.target.value;!isNaN(t)&&t<=11&&t>=0&&(w("monthsEstimated",t),w("birthdate",ot(h.value,t,a)))},labelText:n("estimatedAgeInMonthsLabelText","Estimated age in months"),invalid:!(!y.touched||!y.error),invalidText:y.error&&n(y.error),value:b.value,min:0})))};function st(){return st=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},st.apply(this,arguments)}var ct=function(e){var t=e.fieldDefinition,n=(0,u.useTranslation)().t;return i().createElement("div",{className:"".concat(pe.customField," ").concat(pe.halfWidthInDesktopView)},i().createElement(d.gN,{name:t.id},(function(e){var r=e.field,a=e.form;return a.touched,a.errors,e.meta,i().createElement(ue,st({id:t.id,labelText:n("".concat(t.label),"".concat(t.label))},r))})))},ut=n(2303);function dt(e){var t,n="string"==typeof e&&""!==e,r=(0,ut.Z)(n?"/ws/rest/v1/concept/".concat(e):null,l.openmrsFetch),i=r.data,a=r.error;return a&&(0,l.showToast)({title:a.name,description:a.message,kind:"error"}),{data:null==i||null===(t=i.data)||void 0===t?void 0:t.answers,isLoading:!i&&!a}}function _t(){return _t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_t.apply(this,arguments)}function mt(e){var t=e.fieldDefinition,n=function(e){var t="string"==typeof e&&""!==e,n=(0,ut.Z)(t?"/ws/rest/v1/concept/".concat(e):null,l.openmrsFetch),r=n.data,i=n.error;return i&&(0,l.showToast)({title:i.name,description:i.message,kind:"error"}),{data:null==r?void 0:r.data,isLoading:!r&&!i}}(t.uuid),r=n.data,a=n.isLoading;if(!(0,l.useConfig)().registrationObs.encounterTypeUuid)return console.error("The registration form has been configured to have obs fields, but no registration encounter type has been configured. Obs fields will not be displayed."),null;if(a)return null;switch(r.datatype.display){case"Text":return i().createElement(pt,{concept:r,validationRegex:t.validation.matches,label:t.label});case"Numeric":return i().createElement(ft,{concept:r,label:t.label});case"Coded":return i().createElement(gt,{concept:r,answerConceptSetUuid:t.answerConceptSetUuid,label:t.label});default:return i().createElement(o.K0D,{kind:"error",title:"Error"},'Concept has unknown datatype "',r.datatype.display,'"')}}function pt(e){var t=e.concept,n=e.validationRegex,r=e.label,a=(0,u.useTranslation)().t,o="obs.".concat(t.uuid);return i().createElement("div",{className:"".concat(pe.customField," ").concat(pe.halfWidthInDesktopView)},i().createElement(d.gN,{name:o,validate:function(e){if(e&&n&&""!==n&&"string"==typeof n&&""!==e)return new RegExp(n).test(e)?void 0:a("invalidInput","Invalid Input")}},(function(e){var n=e.field,a=e.form,l=a.touched,s=a.errors;return e.meta,i().createElement(ue,_t({id:o,labelText:null!=r?r:t.display,invalid:s[o]&&l[o]},n))})))}function ft(e){var t=e.concept,n=e.label,r=((0,u.useTranslation)().t,"obs.".concat(t.uuid));return i().createElement("div",{className:"".concat(pe.customField," ").concat(pe.halfWidthInDesktopView)},i().createElement(d.gN,{name:r},(function(e){var a=e.field,o=e.form,l=o.touched,s=o.errors;return e.meta,i().createElement(ue,_t({id:r,labelText:null!=n?n:t.display,invalid:s[r]&&l[r],type:"number"},a))})))}function gt(e){var t,n=e.concept,r=e.answerConceptSetUuid,a=e.label,s=(0,l.useConfig)(),c=dt(null!=r?r:n.uuid),u=c.data,_=c.isLoading,m="obs.".concat(n.uuid),p=null==s||null===(t=s.fieldDefinitions)||void 0===t?void 0:t.filter((function(e){return"obs"===e.type&&e.uuid===n.uuid}))[0];return i().createElement("div",{className:"".concat(pe.customField," ").concat(pe.halfWidthInDesktopView)},_?null:i().createElement(d.gN,{name:m},(function(e){var t,r=e.field,l=e.form,s=l.touched,c=l.errors;return e.meta,(null==p||null===(t=p.customConceptAnswers)||void 0===t?void 0:t.length)?i().createElement(o.PhF,_t({id:m,name:m,labelText:null!=a?a:null==n?void 0:n.display,light:!0,invalid:c[m]&&s[m]},r),i().createElement(o.QlF,{key:"no-answer-select-item-".concat(m),value:"",text:""}),null==p?void 0:p.customConceptAnswers.map((function(e){return i().createElement(o.QlF,{key:e.uuid,value:e.uuid,text:e.label})}))):i().createElement(o.mh4,null,i().createElement(o.PhF,_t({id:m,name:m,labelText:null!=a?a:null==n?void 0:n.display,invalid:c[m]&&s[m]},r),i().createElement(o.QlF,{key:"no-answer-select-item-".concat(m),value:"",text:""}),u.map((function(e){return i().createElement(o.QlF,{key:e.uuid,value:e.uuid,text:e.display})}))))})))}function ht(e){var t=e.personAttributeType,n=e.answerConceptSetUuid,r=e.label,a=dt(n),l=a.data,s=a.isLoading;return i().createElement("div",{className:"".concat(pe.customField," ").concat(pe.halfWidthInDesktopView)},!s&&(null==l?void 0:l.length)?i().createElement(o.mh4,null,i().createElement(o.PhF,{id:"person-attribute-".concat(t.uuid),name:"attributes.".concat(t.uuid),labelText:null!=r?r:null==t?void 0:t.display},i().createElement(o.QlF,{value:"",text:""}),l.map((function(e){return i().createElement(o.QlF,{key:e.uuid,value:e.uuid,text:e.display})})))):i().createElement(ue,{id:"person-attribute-".concat(t.uuid),labelText:null!=r?r:null==t?void 0:t.display,name:"attributes.".concat(t.uuid)}))}function vt(){return vt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vt.apply(this,arguments)}function bt(e){var t=e.personAttributeType,n=e.validationRegex,r=e.label,a=e.required,o=(0,u.useTranslation)().t,l="attributes.".concat(t.uuid);return i().createElement("div",{className:"".concat(pe.customField," ").concat(pe.halfWidthInDesktopView)},i().createElement(d.gN,{name:l,validate:function(e){if(e&&n&&""!==n&&"string"==typeof n&&""!==e)return new RegExp(n).test(e)?void 0:o("invalidInput","Invalid Input")}},(function(e){var n=e.field,o=e.form,s=o.touched,c=o.errors;return e.meta,i().createElement(ue,vt({id:"person-attribute-".concat(t.uuid),labelText:null!=r?r:null==t?void 0:t.display,invalid:c[l]&&s[l]},n,{required:a}))})))}function yt(e){var t=e.fieldDefinition,n=function(e){var t=(0,ut.Z)("/ws/rest/v1/personattributetype/".concat(e),l.openmrsFetch),n=t.data,r=t.error;return r&&(0,l.showToast)({title:r.name,description:r.message,kind:"error"}),{data:null==n?void 0:n.data,isLoading:!n&&!r}}(t.uuid),r=n.data;if(n.isLoading)return null;switch(r.format){case"java.lang.String":return i().createElement(bt,{personAttributeType:r,validationRegex:t.validation.matches,label:t.label,required:t.validation.required});case"org.openmrs.Concept":return i().createElement(ht,{personAttributeType:r,answerConceptSetUuid:t.answerConceptSetUuid,label:t.label});default:return i().createElement(o.K0D,{kind:"error",title:"Error"},'Patient attribute type has unknown format "',r.format,'"')}}function wt(e){var t=e.name,n=(0,l.useConfig)().fieldDefinitions.filter((function(e){return e.id==t}))[0];return"person attribute"===n.type?i().createElement(yt,{fieldDefinition:n}):"obs"===n.type?i().createElement(mt,{fieldDefinition:n}):"address"===n.type?i().createElement(ct,{fieldDefinition:n}):i().createElement("div",null,"Error: Unknown field type ",n.type)}function Et(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xt(){return xt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xt.apply(this,arguments)}function kt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Et(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Et(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Tt=function(e){var t,n=e.name,a=e.labelText,s=e.placeholder,c=e.setSelectedValue,_=e.selected,m=e.textFieldName,p=(0,u.useTranslation)().t,f=kt((0,d.U$)(n),3),g=f[0],h=(f[1],f[2]),v=kt((0,r.useState)([]),2),b=v[0],y=v[1],w=kt((0,r.useState)(),2),E=w[0],x=w[1],k=h.setValue;return E?i().createElement("span",null,p("".concat(E.message))):i().createElement("div",{style:{marginBottom:"1rem"}},i().createElement(o.mh4,null,i().createElement(o.CtY,xt({id:n,onInputChange:function(e){var t,n,r,i;""==(t=e)||(n=m.replace(" ",""),r=_,i=t,(0,l.openmrsFetch)("".concat("/module/addresshierarchy/ajax/getPossibleAddressHierarchyEntriesWithParents.form","?addressField=").concat(n,"&limit=20&searchString=").concat(i,"&parentUuid=").concat(r),{method:"GET"})).then((function(e){y(e.data.map((function(e){return{id:e.uuid,text:e.name}})))})).catch((function(e){x(e)})),k(e)},items:b,itemToString:function(e){return null!==(t=null==e?void 0:e.text)&&void 0!==t?t:""}},g,{onChange:function(e){Boolean(e.selectedItem)?(c(e.selectedItem.id),k(e.selectedItem.text)):(c(void 0),k(void 0))},placeholder:s,titleText:a,light:!0}))))},St=n(5671),Ot={};Ot.styleTagTransform=j(),Ot.setAttributes=O(),Ot.insert=T().bind(null,"head"),Ot.domAPI=x(),Ot.insertStyleElement=I(),w()(St.Z,Ot);const Nt=St.Z&&St.Z.locals?St.Z.locals:void 0;function It(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ct(e,t){if(e){if("string"==typeof e)return It(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?It(e,t):void 0}}const jt=function(e){var t,n,a=e.addressLayout,l=(0,u.useTranslation)().t,s=" > ",c=(0,r.useRef)(null),_=(0,r.useRef)(null),m=(t=(0,r.useState)(""),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(t,n)||Ct(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=m[0],f=m[1],g=(0,v.f$)(p,s),h=g.addresses,b=g.isLoading,y=g.error,w=(0,r.useMemo)((function(){var e=new Set;return h.forEach((function(t){var n=t.split(s);n.forEach((function(t,r){t.toLowerCase().includes(p.toLowerCase())&&e.add(n.slice(0,r+1).join(s))}))})),function(e){return function(e){if(Array.isArray(e))return It(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ct(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e)}),[h,p]),E=(0,d.u6)().setFieldValue,x=function(e){_.current&&!_.current.contains(e.target)&&f("")};return(0,r.useEffect)((function(){return document.addEventListener("mousedown",x),function(){document.removeEventListener("mousedown",x)}}),[_]),i().createElement("div",{className:Nt.autocomplete,ref:_,style:{marginBottom:"1rem"}},i().createElement(o.olm,{onChange:function(e){f(e.target.value)},labelText:l("searchAddress","Search address"),placeholder:l("searchAddress","Search address"),ref:c,helperText:p?b?l("loadingResults","Loading results"):y?y.message:0===(null==h?void 0:h.length)?l("noResultsFound","No results found"):null:null,value:p}),w.length>0&&i().createElement("ul",{className:Nt.suggestions},w.map((function(e,t){return i().createElement("li",{key:t,onClick:function(t){return function(e){if(e){var t=e.split(s);a.map((function(e,n){var r,i=e.name;E("address.".concat(i),null!==(r=null==t?void 0:t[n])&&void 0!==r?r:"")})),f("")}}(e)}},e)}))))};var At=n(7279);function Pt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Dt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Pt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ft(e){return(new DOMParser).parseFromString(e,"text/xml")}function Bt(e,t){var n=t.getElementsByTagName(e)[0];return Ft(n?n.outerHTML:"")}var Lt=function(){var e=Dt((0,r.useState)(""),2),t=e[0],n=e[1],a=Dt((0,r.useState)([]),2),c=a[0],d=a[1],_=(0,u.useTranslation)().t,m=(0,r.useContext)(s.Cg).addressTemplate,p=null==m?void 0:m.results[0].value,f=function(e){n(e)},g=(0,l.useConfig)(),h=g.fieldConfigurations.address.useAddressHierarchy,v=h.enabled,b=h.useQuickSearch,y=h.searchAddressByLevel;return(0,l.useLayoutType)(),(0,r.useEffect)((function(){var e=Ft(p),t=Bt("elementdefaults",e),n=Bt("nameMappings",e),r=Array.from(n.getElementsByTagName("property")).length>0?n.getElementsByTagName("property"):n.getElementsByTagName("entry"),i=Array.prototype.map.call(r,(function(e){var n,r,i=null!==(n=e.getAttribute("name"))&&void 0!==n?n:e.getElementsByTagName("string")[0].innerHTML,a=(null!==(r=e.getAttribute("value"))&&void 0!==r||e.getElementsByTagName("string")[1].innerHTML,function(e,t){var n=t.getElementsByName(e)[0];return n?n.getAttribute("value"):null}(i,t));return{id:i,name:i,value:a}}));d(i)}),[_,p]),m?i().createElement("div",null,i().createElement("h4",{className:pe.productiveHeading02Light},_("addressHeader","Address")),i().createElement("div",{style:{paddingBottom:"5%"}},v?i().createElement(i().Fragment,null,b&&i().createElement(jt,{addressLayout:c}),c.map((function(e,n){return y?i().createElement(Tt,{key:"combo_input_".concat(n),textFieldName:e.name,name:"address.".concat(e.name),labelText:(0,At.Z)(g.fieldConfigurations.address.useAddressHierarchy.useAddressHierarchyLabel)?_(e.name):g.fieldConfigurations.address.useAddressHierarchy.useAddressHierarchyLabel[e.name],id:e.name,setSelectedValue:f,selected:t}):i().createElement(ue,{key:"combo_input_".concat(n),name:"address.".concat(e.name),labelText:_(e.name),id:e.name,setSelectedValue:f,selected:t})}))):c.map((function(e,n){return i().createElement(ue,{key:"combo_input_".concat(n),name:"address.".concat(e.name),labelText:_(e.name),id:e.name,setSelectedValue:f,selected:t})})))):i().createElement("div",null,i().createElement("h4",{className:pe.productiveHeading02Light},_("addressHeader","Address")),i().createElement(o.N2B,null))};function Ut(e){var t=e.name,n=(0,l.useConfig)();if(!ie.X8.includes(t)&&!n.fieldDefinitions.some((function(e){return e.id==t})))return(0,l.reportError)("Invalid field name '".concat(t,"'. Valid options are '").concat(n.fieldDefinitions.map((function(e){return e.id})).concat(ie.X8).join("', '"),"'.")),null;switch(t){case"name":return i().createElement(be,null);case"gender":return i().createElement(we,null);case"dob":return i().createElement(lt,null);case"address":return i().createElement(Lt,null);case"id":return i().createElement(nt,null);case"phone & email":return i().createElement(fe,null);default:return i().createElement(wt,{name:t})}}var zt=function(e){var t=e.sectionDefinition;return i().createElement("section",{"aria-label":"".concat(t.name," Section")},t.fields.map((function(e){return i().createElement(Ut,{key:"".concat(t.name,"-").concat(e),name:e})})))};function Vt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Zt(){return Zt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zt.apply(this,arguments)}function Rt(e,t){if(e){if("string"==typeof e)return Vt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vt(e,t):void 0}}var Ht=function(e){var t,n,r=e.name,a=e.options,l=e.label,s=e.required,c=(t=(0,d.U$)(r),n=1,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(t,n)||Rt(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],_=(0,u.useTranslation)().t,m=[i().createElement(o.QlF,{disabled:!0,hidden:!0,text:"Select ".concat(l),key:"",value:""})].concat(function(e){return function(e){if(Array.isArray(e))return Vt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Rt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(a.map((function(e,t){return i().createElement(o.QlF,{text:e,value:e,key:t})})))),p=s?l:"".concat(l," (").concat(_("optional","optional"),")");return i().createElement("div",{style:{marginBottom:"1rem"}},i().createElement(o.mh4,null,i().createElement(o.PhF,Zt({id:"identifier"},c,{labelText:p}),m)))},qt=n(2936),Mt={};Mt.styleTagTransform=j(),Mt.setAttributes=O(),Mt.insert=T().bind(null,"head"),Mt.domAPI=x(),Mt.insertStyleElement=I(),w()(qt.Z,Mt);const Gt=qt.Z&&qt.Z.locals?qt.Z.locals:void 0;var Wt=function(){var e=i().useContext(g).values,t=(0,u.useTranslation)().t;return i().createElement("section",{className:Gt.formSection,"aria-label":"Death Info Section"},i().createElement("h5",{className:"omrs-type-title-5 ".concat(Gt.formSectionTitle)},"Death Info"),i().createElement("section",{className:Gt.fieldGroup},i().createElement(ue,{labelText:t("isDeadInputLabel","Is Dead"),name:"isDead",id:"isDead"}),e.isDead&&i().createElement(i().Fragment,null,i().createElement(ue,{labelText:t("deathDateInputLabel","Date of Death"),name:"deathDate",id:"deathDate"}),i().createElement(Ht,{options:[t("unknown","Unknown"),t("stroke","Stroke")],label:t("causeOfDeathInputLabel","Cause of Death"),name:"deathCause"}))))};function Yt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qt=function(e){var t,n,a=e.fields,o=(t=(0,d.U$)("addNameInLocalLanguage"),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(t,n)||function(e,t){if(e){if("string"==typeof e)return Yt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yt(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=o[0],s=o[1],c=(0,r.useContext)(g).setFieldValue;return(0,r.useEffect)((function(){!l.value&&s.touched&&(c("additionalGivenName",""),c("additionalMiddleName",""),c("additionalFamilyName",""))}),[l.value,s.touched]),i().createElement("section",{className:Gt.formSection,"aria-label":"Demographics Section"},a.map((function(e){return i().createElement(Ut,{key:"demographics-".concat(e),name:e})})))},Kt=n(1662),$t={};$t.styleTagTransform=j(),$t.setAttributes=O(),$t.insert=T().bind(null,"head"),$t.domAPI=x(),$t.insertStyleElement=I(),w()(Kt.Z,$t);const Xt=Kt.Z&&Kt.Z.locals?Kt.Z.locals:void 0;function Jt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function en(){return en=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},en.apply(this,arguments)}var tn=function(e){var t,n,a=e.getDisplayValue,l=e.getFieldValue,s=e.getSearchResults,c=e.onSuggestionSelected,d=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,["getDisplayValue","getFieldValue","getSearchResults","onSuggestionSelected"]),_=(t=(0,r.useState)([]),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(t,n)||function(e,t){if(e){if("string"==typeof e)return Jt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jt(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),m=_[0],p=_[1],f=(0,r.useRef)(null),g=(0,r.useRef)(null),h=((0,u.useTranslation)().t,d.name),v=d.labelText;(0,r.useEffect)((function(){return document.addEventListener("mousedown",b),function(){document.removeEventListener("mousedown",b)}}),[g]);var b=function(e){g.current&&!g.current.contains(e.target)&&p([])};return i().createElement("div",{className:Xt.autocomplete,ref:g},i().createElement("label",{className:"cds--label"},v),i().createElement(o.mh4,null,i().createElement(o.olm,en({id:"autosuggest",onChange:function(e){var t=e.target.value;t?s(t).then((function(e){p(e)})):p([])},ref:f,className:Xt.autocompleteSearch},d))),m.length>0&&i().createElement("ul",{className:Xt.suggestions},m.map((function(e,t){return i().createElement("li",{key:t,onClick:function(e){return function(e){var t=a(m[e]),n=l(m[e]);f.current.value=t,c(h,n),p([])}(t)}},a(e))}))))},nn=n(138),rn={};rn.styleTagTransform=j(),rn.setAttributes=O(),rn.insert=T().bind(null,"head"),rn.domAPI=x(),rn.insertStyleElement=I(),w()(nn.Z,rn);const an=nn.Z&&nn.Z.locals?nn.Z.locals:void 0;function on(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ln(e,t,n,r,i,a,o){try{var l=e[a](o),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,i)}function sn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var cn=function(){var e,t,n=(0,r.useContext)(s.Cg).relationshipTypes,a=(e=(0,r.useState)([]),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return on(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?on(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=a[0],c=a[1],_=(0,u.useTranslation)().t;return(0,r.useEffect)((function(){if(n){var e=[];n.results.forEach((function(t){var n={display:t.aIsToB,uuid:t.uuid,direction:"aIsToB"},r={display:t.bIsToA,uuid:t.uuid,direction:"bIsToA"};n.display===r.display?e.push(n):e.push(n,r)})),c(e)}}),[n]),n?i().createElement("section",{"aria-label":"Relationships Section"},i().createElement(d.F2,{name:"relationships"},(function(e){var t=e.push,n=e.remove,r=e.form.values.relationships;return i().createElement("div",null,r&&r.length>0?r.map((function(e,t){return i().createElement("div",{key:t,className:Gt.formSection},i().createElement(un,{relationship:e,index:t,displayRelationshipTypes:l,key:t,remove:n}))})):null,i().createElement("div",{className:an.actions},i().createElement(o.zxk,{kind:"ghost",onClick:function(){return t({relatedPersonUuid:"",action:"ADD"})}},_("addRelationshipButtonText","Add Relationship"))))}))):i().createElement("section",{"aria-label":"Relationships Section"},i().createElement(o.N2B,null))},un=function(e){var t,n,a,l,s=e.relationship,c=e.index,d=e.displayRelationshipTypes,_=e.remove,m=(0,u.useTranslation)().t,p=i().useContext(g).setFieldValue,f=!s.uuid,h=(0,r.useCallback)((function(e){var t=e.target,n=t.name,r=t.options[t.selectedIndex].value;p(n,r),(null==s?void 0:s.action)||p("relationships[".concat(c,"].action"),"UPDATE")}),[]),b=(0,r.useCallback)((function(e,t){p(e,t)}),[]),y=(t=function(e){var t;return function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}(this,(function(n){switch(n.label){case 0:return t=new AbortController,[4,(0,v.M8)(e,t)];case 1:return[2,n.sent().data.results]}}))},n=function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function o(e){ln(a,r,i,o,l,"next",e)}function l(e){ln(a,r,i,o,l,"throw",e)}o(void 0)}))},function(e){return n.apply(this,arguments)}),w=(0,r.useCallback)((function(){"ADD"===s.action?_(c):p("relationships[".concat(c,"].action"),"DELETE")}),[s,c]),E=(0,r.useCallback)((function(){var e,t;p("relationships[".concat(c,"]"),(e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){sn(e,t,n[t])}))}return e}({},s),t=null!=(t={action:void 0,relationshipType:s.initialrelationshipTypeValue})?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e))}),[c]);return"DELETE"!==s.action?i().createElement("div",{className:an.relationship},i().createElement("div",{className:an.searchBox},i().createElement("div",{className:an.relationshipHeader},i().createElement("h4",{className:an.productiveHeading},null!==(a=null==s?void 0:s.relation)&&void 0!==a?a:m("relationshipPlaceholder","Relationship")),i().createElement(o.zxk,{kind:"ghost",iconDescription:m("deleteRelationshipTooltipText","Delete"),hasIconOnly:!0,onClick:w},i().createElement(Re.ZN,{size:16,className:an.trashCan}))),i().createElement("div",null,f?i().createElement(tn,{name:"relationships[".concat(c,"].relatedPersonUuid"),labelText:m("relativeFullNameLabelText","Full name"),placeholder:m("relativeNamePlaceholder","Firstname Familyname"),defaultValue:s.relatedPersonName,onSuggestionSelected:b,getSearchResults:y,getDisplayValue:function(e){return e.display},getFieldValue:function(e){return e.uuid},required:!0}):i().createElement(i().Fragment,null,i().createElement("span",{className:an.labelText},m("relativeFullNameLabelText","Full name")),i().createElement("p",{className:an.bodyShort02},s.relatedPersonName)))),i().createElement("div",{className:"".concat(an.selectRelationshipType),style:{marginBottom:"1rem"}},i().createElement(o.mh4,null,i().createElement(o.PhF,{id:"select",labelText:m("relationship","Relationship"),onChange:h,name:"relationships[".concat(c,"].relationshipType"),defaultValue:null!==(l=null==s?void 0:s.relationshipType)&&void 0!==l?l:"placeholder-item"},i().createElement(o.QlF,{disabled:!0,hidden:!0,value:"placeholder-item",text:m("relationshipToPatient","Relationship to patient")}),d.map((function(e){return i().createElement(o.QlF,{text:e.display,value:"".concat(e.uuid,"/").concat(e.direction),key:e.display})})))))):i().createElement(o.K0D,{kind:"info",title:m("relationshipRemovedText","Relationship removed"),actions:i().createElement(o.xho,{onClick:E},m("restoreRelationshipActionButton","Undo"))})};function dn(e){var t=e.sectionDefinition;switch(t.id){case"demographics":return i().createElement(Qt,{fields:t.fields});case"death":return i().createElement(Wt,null);case"relationships":return i().createElement(cn,null);default:return i().createElement(zt,{sectionDefinition:t})}}var _n=function(e){var t=e.sectionDefinition,n=e.index,r=(0,u.useTranslation)().t;return i().createElement("div",{id:t.id},i().createElement("h3",{className:le.productiveHeading02,style:{color:"#161616"}},n+1,". ",r("".concat(t.id,"Section"),t.name)),i().createElement("span",{className:le.label01},r("allFieldsRequiredText","All fields are required unless marked optional")),i().createElement("div",{style:{margin:"1rem 0 1rem"}},i().createElement(o.n9L,null,i().createElement(dn,{sectionDefinition:t}))))};function mn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pn(e){var t;return null===(t=e.split(window.getOpenmrsSpaBase()))||void 0===t?void 0:t[1]}const fn=function(e){var t,n,i=e.when,a=e.redirect,o=(0,u.useTranslation)().t,s=(0,r.useRef)(!1),c=(t=(0,r.useState)(),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(t,n)||function(e,t){if(e){if("string"==typeof e)return mn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mn(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),d=c[0],_=c[1],m=d||a,p=(0,r.useCallback)((function(e){var t=o("discardModalBody","The changes you made to this patient's details have not been saved. Discard changes?");return e.preventDefault(),e.returnValue=t,t}),[o]),f=(0,r.useCallback)((function(e){if(!e.detail.navigationIsCanceled&&!s.current){s.current=!0,e.detail.cancelNavigation();var t=(0,l.showModal)("cancel-patient-edit-modal",{onConfirm:function(){_(e.detail.newUrl),t()}},(function(){s.current=!1}))}}),[]);return(0,r.useEffect)((function(){if(i&&void 0===m)return window.addEventListener("single-spa:before-routing-event",f),window.addEventListener("beforeunload",p),function(){window.removeEventListener("beforeunload",p),window.removeEventListener("single-spa:before-routing-event",f)}}),[m,i,p,f]),(0,r.useEffect)((function(){"string"==typeof m&&(0,l.navigate)({to:"${openmrsSpaBase}/".concat(pn(m))})}),[m]),null};function gn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hn(e,t,n,r,i,a,o){try{var l=e[a](o),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,i)}function vn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){vn(e,t,n[t])}))}return e}function yn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return gn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var wn=function(e){var t,n,m=e.savePatientForm,p=e.isOffline,y=(0,r.useContext)(s.Cg),w=y.currentSession,E=y.addressTemplate,x=y.identifierTypes,k=(0,a.useLocation)().search,T=(0,l.useConfig)(),S=yn((0,r.useState)(),2),O=S[0],N=S[1],I=yn((0,r.useState)(f),2),C=I[0],j=I[1],A=(0,a.useParams)().patientUuid,P=(0,l.usePatient)(A),D=P.isLoading,F=P.patient,Y=(0,u.useTranslation)().t,Q=yn((0,r.useState)(null),2),$=Q[0],re=Q[1],ae=yn(function(e){var t=(0,l.usePatient)(e),n=t.isLoading,i=t.patient,a=function(e){var t=!!e,n=(0,G.ZP)(t?"/ws/rest/v1/person/".concat(e,"/attribute"):null,l.openmrsFetch),i=n.data,a=n.error,o=(0,r.useMemo)((function(){var e;return{data:null==i||null===(e=i.data)||void 0===e?void 0:e.results,isLoading:!i&&!a}}),[i,a]);return o}(e),o=a.data,s=a.isLoading,c=function(e){var t=!!e,n=(0,G.ZP)(t?"/ws/rest/v1/patient/".concat(e,"/identifier?v=custom:(uuid,identifier,identifierType:(uuid,required,name),preferred)"):null,l.openmrsFetch),i=n.data,a=n.error,o=(0,r.useMemo)((function(){var e,t,n={};return null==i||null===(e=i.data)||void 0===e||null===(t=e.results)||void 0===t||t.forEach((function(e){n[(0,L.Z)(e.identifierType.name)]={identifierUuid:e.uuid,preferred:e.preferred,initialValue:e.identifier,identifierValue:e.identifier,identifierTypeUuid:e.identifierType.uuid,identifierName:e.identifierType.name,required:e.identifierType.required,selectedSource:null,autoGeneration:!1}})),{data:n,isLoading:!i&&!a}}),[i,a]);return o}(e),u=c.data,d=c.isLoading,_=function(e){var t=!!e,n=(0,G.ZP)(t?"/ws/rest/v1/relationship?v=".concat(W.UO,"&person=").concat(e):null,l.openmrsFetch),i=n.data,a=n.error,o=(0,r.useMemo)((function(){var t;return{data:null==i||null===(t=i.data)||void 0===t?void 0:t.results.map((function(t){return t.personA.uuid===e?{relatedPersonName:t.personB.display,relatedPersonUuid:t.personB.uuid,relation:t.relationshipType.bIsToA,relationshipType:"".concat(t.relationshipType.uuid,"/bIsToA"),initialrelationshipTypeValue:"".concat(t.relationshipType.uuid,"/bIsToA"),uuid:t.uuid}:{relatedPersonName:t.personA.display,relatedPersonUuid:t.personA.uuid,relation:t.relationshipType.aIsToB,relationshipType:"".concat(t.relationshipType.uuid,"/aIsToB"),initialrelationshipTypeValue:"".concat(t.relationshipType.uuid,"/aIsToB"),uuid:t.uuid}})),error:a,isLoading:!i&&!a}}),[e,i,a]);return o}(e),m=_.data,p=_.isLoading,f=ee((0,r.useState)({patientUuid:(0,b.Z)(),givenName:"",middleName:"",familyName:"",unidentifiedPatient:!1,additionalGivenName:"",additionalMiddleName:"",additionalFamilyName:"",addNameInLocalLanguage:!1,gender:"",birthdate:null,yearsEstimated:null,monthsEstimated:0,birthdateEstimated:!1,telephoneNumber:"",isDead:!1,deathDate:"",deathCause:"",relationships:[],identifiers:{},address:{}}),2),g=f[0],h=f[1];return(0,r.useEffect)((function(){K((function(){var t;return te(this,(function(r){switch(r.label){case 0:return i?(h(X(J(X({},g,(o={},l=(a=i).name[0],s=a.name[1],o.patientUuid=a.id,o.givenName=null==l?void 0:l.given[0],o.middleName=null==l?void 0:l.given[1],o.familyName=null==l?void 0:l.family,o.unidentifiedPatient="UNKNOWN"===l.given[0]&&"unknown"===l.family||void 0,o.addNameInLocalLanguage=!!s||void 0,o.additionalGivenName=null==s?void 0:s.given[0],o.additionalMiddleName=null==s?void 0:s.given[1],o.additionalFamilyName=null==s?void 0:s.family,o.gender=(0,U.Z)(a.gender),o.birthdate=a.birthDate?new Date(a.birthDate):void 0,o.telephoneNumber=a.telecom?a.telecom[0].value:"",(a.deceasedBoolean||a.deceasedDateTime)&&(o.isDead=!0,o.deathDate=a.deceasedDateTime?a.deceasedDateTime.split("T")[0]:""),Z({},o,a.identifier.map((function(e){return V({},(0,L.Z)(e.system||e.type.text),e.value)}))))),{address:q(i)}),function(e){var t={};return e.telecom&&(t.phone=e.telecom[0].value),t}(i))),[3,3]):[3,1];case 1:return n||!e?[3,3]:[4,ne(e)];case 2:if(!(t=r.sent())._patientRegistrationData.formValues)return console.error("Found a queued offline patient registration for patient ".concat(e,", but without form values. Not using these values.")),[2];h(t._patientRegistrationData.formValues),r.label=3;case 3:return[2]}var a,o,l,s}))}))()}),[n,i,e]),(0,r.useEffect)((function(){!p&&m&&h((function(e){return J(X({},e),{relationships:m})}))}),[p,m,h]),(0,r.useEffect)((function(){!d&&u&&h((function(e){return J(X({},e),{identifiers:u})}))}),[d,u,h]),(0,r.useEffect)((function(){if(!s&&o){var e={};o.forEach((function(t){e[t.attributeType.uuid]=t.value})),h((function(t){return J(X({},t),{attributes:e})}))}}),[o,h,s]),[g,h]}(A),2),oe=ae[0],se=ae[1],ce=yn(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,l.usePatient)(e),i=n.isLoading,a=n.patient,o=ee((0,r.useState)(t),2),s=o[0],c=o[1];return(0,r.useEffect)((function(){K((function(){var n,r;return te(this,(function(o){switch(o.label){case 0:return a?(c(J(X({},s),{address:q(a)})),[3,3]):[3,1];case 1:return i||!e?[3,3]:[4,ne(e)];case 2:n=o.sent(),c(null!==(r=null==n?void 0:n._patientRegistrationData.initialAddressFieldValues)&&void 0!==r?r:t),o.label=3;case 3:return[2]}}))}))()}),[i,a,e]),[s,c]}(A),1),ue=ce[0],de=yn(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,l.usePatient)(e),i=n.isLoading,a=n.patient,o=ee((0,r.useState)(t),2),s=o[0],c=o[1];return(0,r.useEffect)((function(){if(a)c(X({},s,M(a)));else if(!i&&e){var n;ne(e).then((function(e){return c(null!==(n=null==e?void 0:e._patientRegistrationData.initialAddressFieldValues)&&void 0!==n?n:t)}))}}),[i,a,e]),[s,c]}(A),1),_e=de[0],me=null==w||null===(t=w.sessionLocation)||void 0===t?void 0:t.uuid,pe=D?void 0:!(!A||!F),fe=(0,r.useMemo)((function(){return"true"===localStorage.getItem("openmrs:devtools")&&!pe}),[pe]),ge=(0,v.Uu)(null==F?void 0:F.id).data,he=(0,r.useRef)(new h.I),ve=null==T||null===(n=T.fieldDefinitions)||void 0===n?void 0:n.filter((function(e){return"address"===e.type}));(0,r.useEffect)((function(){}),[oe]);var be=(0,r.useMemo)((function(){var e;return T.sections.map((function(t){return null!==(e=T.sectionDefinitions.filter((function(e){return e.id==t}))[0])&&void 0!==e?e:ie.bs.filter((function(e){return e.id==t}))[0]})).filter((function(e){return e}))}),[T.sections,T.sectionDefinitions]);(0,r.useEffect)((function(){if(E){var e=null==E?void 0:E.results[0].value;if(!e)return;var t=function(e){var t=(new DOMParser).parseFromString(e,"text/xml"),n=t.querySelector("nameMappings").getElementsByTagName("entry"),r=Array.prototype.map.call(n,(function(e){var n=e.getElementsByTagName("string")[0].innerHTML;return{name:n,label:e.getElementsByTagName("string")[1].innerHTML,regex:R(n,"elementRegex",t)||".*",regexFormat:R(n,"elementRegexFormats",t)||""}})),i=_.Ry(r.reduce((function(e,t){return e[t.name]=_.Z_().matches(t.regex,t.regexFormat),e}),{}));return{addressFieldValues:Array.prototype.map.call(n,(function(e){return{name:e.getElementsByTagName("string")[0].innerHTML,defaultValue:""}})),addressValidationSchema:i}}(e),n=t.addressFieldValues,r=t.addressValidationSchema;if(j((function(e){return e.concat(r)})),!1===pe){var i=!0,a=!1,o=void 0;try{for(var l,s=n[Symbol.iterator]();!(i=(l=s.next()).done);i=!0){var c=l.value,u=c.name,d=c.defaultValue;ue[u]||(ue[u]=d)}}catch(e){a=!0,o=e}finally{try{i||null==s.return||s.return()}finally{if(a)throw o}}null==ve||ve.map((function(e){return ue[e.id]=""})),se(bn({},oe,ue))}}}),[pe,E,ue]);var ye,we,Ee=(ye=function(e,t){var n,r,i,a,o,s,c,u,d;return function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}(this,(function(_){switch(_.label){case 0:n=new AbortController,t.setSubmitting(!0),r=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}(bn({},e),{identifiers:(p=e.identifiers,Object.fromEntries(Object.entries(p).filter((function(e){var t,n,r=(n=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(t,n)||function(e,t){if(e){if("string"==typeof e)return z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());return r[0],void 0!==r[1].identifierValue}))))}),_.label=1;case 1:return _.trys.push([1,3,,4]),[4,m(!pe,r,_e,ue,$,me,oe.identifiers,w,T,he.current,n)];case 2:return _.sent(),(0,l.showToast)({description:pe?Y("updationSuccessToastDescription","The patient's information has been successfully updated"):Y("registrationSuccessToastDescription","The patient can now be found by searching for them using their name or ID number"),title:pe?Y("updationSuccessToastTitle","Patient Details Updated"):Y("registrationSuccessToastTitle","New Patient Created"),kind:"success"}),i=new URLSearchParams(k).get("afterUrl"),a=(0,l.interpolateUrl)(i||T.links.submitButton,{patientUuid:e.patientUuid}),N(a),[3,4];case 3:return o=_.sent(),(null===(s=o.responseBody)||void 0===s||null===(c=s.error)||void 0===c?void 0:c.globalErrors)?o.responseBody.error.globalErrors.forEach((function(e){(0,l.showToast)({description:e.message})})):(null===(u=o.responseBody)||void 0===u||null===(d=u.error)||void 0===d?void 0:d.message)?(0,l.showToast)({description:o.responseBody.error.message}):(0,l.createErrorHandler)()(o),t.setSubmitting(!1),[3,4];case 4:return[2]}var p}))},we=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=ye.apply(e,t);function a(e){hn(i,n,r,a,o,"next",e)}function o(e){hn(i,n,r,a,o,"throw",e)}a(void 0)}))},function(e,t){return we.apply(this,arguments)}),xe=function(e){return i().createElement("div",null,i().createElement("p",null,Y("fieldErrorTitleMessage","The following fields have errors:")),i().createElement("ul",{style:{listStyle:"inside"}},Object.keys(e).map((function(e,t){return i().createElement("li",{key:t},Y("".concat(e,"LabelText"),e))}))))};return i().createElement(d.J9,{enableReinitialize:!0,initialValues:oe,validationSchema:C,onSubmit:Ee},(function(e){return i().createElement(d.l0,{className:le.form},i().createElement(fn,{when:e.dirty,redirect:O}),i().createElement("div",{className:le.formContainer},i().createElement("div",null,i().createElement("div",{className:le.stickyColumn},i().createElement("h4",null,pe?Y("edit","Edit"):Y("createNew","Create New")," ",Y("patient","Patient")),fe&&i().createElement(B,{setValues:e.setValues}),i().createElement("p",{className:le.label01},Y("jumpTo","Jump to")),be.map((function(e){return i().createElement("div",{className:"".concat(le.space05," ").concat(le.touchTarget),key:e.name},i().createElement(o.rUS,{className:le.linkName,onClick:function(){return t=e.id,void document.getElementById(t).scrollIntoView({behavior:"smooth",block:"center",inline:"center"});var t}},i().createElement(c.Kc,{size:16})," ",e.name))})),i().createElement(o.zxk,{className:le.submitButton,type:"submit",onClick:function(){return e.validateForm().then((function(e){return function(e){e&&"object"==typeof e&&Object.keys(e).length&&(0,l.showToast)({description:xe(e),title:Y("incompleteForm","Incomplete form"),kind:"warning"})}(e)}))},disabled:!w||!x},pe?Y("updatePatient","Update Patient"):Y("registerPatient","Register Patient")),i().createElement(o.zxk,{className:le.cancelButton,kind:"tertiary",onClick:H},Y("cancel","Cancel")))),i().createElement("div",{className:le.infoGrid},i().createElement(g.Provider,{value:{identifierTypes:x,validationSchema:C,setValidationSchema:j,values:e.values,inEditMode:pe,setFieldValue:e.setFieldValue,setCapturePhotoProps:re,currentPhoto:null==ge?void 0:ge.imageSrc,isOffline:p,initialFormValues:e.initialValues}},be.map((function(e,t){return i().createElement(_n,{key:"registration-section-".concat(e.id),sectionDefinition:e,index:t})}))))))}))},En=n(4954),xn={};xn.styleTagTransform=j(),xn.setAttributes=O(),xn.insert=T().bind(null,"head"),xn.domAPI=x(),xn.insertStyleElement=I(),w()(En.Z,xn);const kn=En.Z&&En.Z.locals?En.Z.locals:void 0;function Tn(e){var t=e.savePatientForm,n=e.isOffline,r=(0,l.useSession)(),c=(0,ut.Z)("patientRegistrationAddressTemplate",s.Te).data,u=(0,ut.Z)("patientRegistrationRelationshipTypes",s.mt).data,d=(0,ut.Z)("patientRegistrationPatientIdentifiers",s.St).data;return i().createElement("main",{className:"omrs-main-content ".concat(kn.root)},i().createElement(o.rjZ,{className:kn.grid},i().createElement(o.X2j,null,i().createElement(l.ExtensionSlot,{extensionSlotName:"breadcrumbs-slot"})),i().createElement(s.Cg.Provider,{value:{addressTemplate:c,relationshipTypes:u,identifierTypes:d,currentSession:r}},i().createElement(a.BrowserRouter,{basename:"".concat(window.getOpenmrsSpaBase())},i().createElement(a.Routes,null,i().createElement(a.Route,{path:"patient-registration",element:i().createElement(wn,{savePatientForm:t,isOffline:n})}),i().createElement(a.Route,{path:"patient/:patientUuid/edit",element:i().createElement(wn,{savePatientForm:t,isOffline:n})}))))))}}}]);
|