@openmrs/esm-react-utils 5.3.3-pre.1310 → 5.3.3-pre.1315

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
- @openmrs/esm-react-utils:build: cache hit, replaying output 89b62238ce17c10e
1
+ @openmrs/esm-react-utils:build: cache hit, replaying output 1b01b43a0599cf23
2
2
  @openmrs/esm-react-utils:build: Browserslist: caniuse-lite is outdated. Please run:
3
3
  @openmrs/esm-react-utils:build:  npx update-browserslist-db@latest
4
4
  @openmrs/esm-react-utils:build:  Why you should do it regularly: https://github.com/browserslist/update-db#readme
5
- @openmrs/esm-react-utils:build: asset openmrs-esm-react-utils.js 66.3 KiB [emitted] [minimized] (name: main) 1 related asset
6
- @openmrs/esm-react-utils:build: orphan modules 168 KiB [orphan] 121 modules
5
+ @openmrs/esm-react-utils:build: asset openmrs-esm-react-utils.js 66.7 KiB [emitted] [minimized] (name: main) 1 related asset
6
+ @openmrs/esm-react-utils:build: orphan modules 169 KiB [orphan] 122 modules
7
7
  @openmrs/esm-react-utils:build: runtime modules 937 bytes 4 modules
8
- @openmrs/esm-react-utils:build: built modules 184 KiB [built]
9
- @openmrs/esm-react-utils:build:  cacheable modules 184 KiB
8
+ @openmrs/esm-react-utils:build: built modules 185 KiB [built]
9
+ @openmrs/esm-react-utils:build:  cacheable modules 185 KiB
10
10
  @openmrs/esm-react-utils:build:  modules by path ../../../node_modules/ 984 bytes 2 modules
11
11
  @openmrs/esm-react-utils:build:  + 3 modules
12
12
  @openmrs/esm-react-utils:build:  modules by path external "@openmrs/ 168 bytes
@@ -14,4 +14,4 @@
14
14
  @openmrs/esm-react-utils:build:  external "@openmrs/esm-extensions" 42 bytes [built] [code generated]
15
15
  @openmrs/esm-react-utils:build:  + 2 modules
16
16
  @openmrs/esm-react-utils:build:  + 5 modules
17
- @openmrs/esm-react-utils:build: webpack 5.88.0 compiled successfully in 4714 ms
17
+ @openmrs/esm-react-utils:build: webpack 5.88.0 compiled successfully in 4669 ms
@@ -1,2 +1,2 @@
1
- System.register(["react","@openmrs/esm-config","@openmrs/esm-extensions","@openmrs/esm-globals","@openmrs/esm-api","react-dom","react-i18next","swr","dayjs"],(function(t,e){var n={},r={},o={},u={},i={},a={},c={},l={},s={};return Object.defineProperty(a,"__esModule",{value:!0}),{setters:[function(t){n.Suspense=t.Suspense,n.default=t.default,n.useCallback=t.useCallback,n.useContext=t.useContext,n.useEffect=t.useEffect,n.useMemo=t.useMemo,n.useReducer=t.useReducer,n.useRef=t.useRef,n.useState=t.useState},function(t){r.getConfigStore=t.getConfigStore,r.getExtensionConfigFromStore=t.getExtensionConfigFromStore,r.getExtensionsConfigStore=t.getExtensionsConfigStore,r.interpolateUrl=t.interpolateUrl,r.navigate=t.navigate},function(t){o.getConnectedExtensions=t.getConnectedExtensions,o.getExtensionInternalStore=t.getExtensionInternalStore,o.getExtensionStore=t.getExtensionStore,o.registerExtensionSlot=t.registerExtensionSlot,o.renderExtension=t.renderExtension},function(t){u.subscribeConnectivityChanged=t.subscribeConnectivityChanged},function(t){i.defaultVisitCustomRepresentation=t.defaultVisitCustomRepresentation,i.fetchCurrentPatient=t.fetchCurrentPatient,i.getCurrentUser=t.getCurrentUser,i.getLocations=t.getLocations,i.getSessionStore=t.getSessionStore,i.getVisitStore=t.getVisitStore,i.getVisitTypes=t.getVisitTypes,i.openmrsFetch=t.openmrsFetch,i.userHasAccess=t.userHasAccess},function(t){Object.keys(t).forEach((function(e){a[e]=t[e]}))},function(t){c.I18nextProvider=t.I18nextProvider},function(t){l.default=t.default},function(t){s.default=t.default}],execute:function(){t((()=>{var t={332:function(t){t.exports=function(){"use strict";return function(t,e,n){e.prototype.isToday=function(){var t="YYYY-MM-DD",e=n();return this.format(t)===e.format(t)}}}()},645:(t,e,n)=>{"use strict";var r=n(493);e.createRoot=r.createRoot,e.hydrateRoot=r.hydrateRoot},570:()=>{System.register(["@openmrs/esm-state"],(function(t,e){var n={};return{setters:[function(t){n.getGlobalStore=t.getGlobalStore}],execute:function(){t(function(){"use strict";var t={685:function(t){t.exports=n}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var u=e[n]={exports:{}};return t[n](u,u.exports,r),u.exports}r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return function(){var t=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},e=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},n=function(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),o.forEach((function(n){e(t,n,r[n])}))}return t},u=function(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},i=function(t,r,o){var i;p.setState((function(a){var c;return{flags:u(n({},a.flags),e({},t,{enabled:null!==(i=null===(c=a.flags[t])||void 0===c?void 0:c.enabled)&&void 0!==i&&i,label:r,description:o}))}}))},a=function(t){return p.getState().flags[t].enabled},c=function(t,e){p.subscribe((function(n){e(n.flags[t].enabled)}))},l=function(t,r){p.setState((function(o){return{flags:u(n({},o.flags),e({},t,u(n({},o.flags[t]),{enabled:r})))}}))};r.r(o),r.d(o,{featureFlagsStore:function(){return p},getFeatureFlag:function(){return a},registerFeatureFlag:function(){return i},setFeatureFlag:function(){return l},subscribeToFeatureFlag:function(){return c}});var s=r(685),f={flags:function(){var t={},e=!0,r=!1,o=void 0;try{for(var u,i=Object.keys(localStorage)[Symbol.iterator]();!(e=(u=i.next()).done);e=!0){var a=u.value;if(a.startsWith("openmrs:feature-flag:")){var c=a.replace("openmrs:feature-flag:",""),l=JSON.parse(localStorage.getItem("openmrs:feature-flag-meta:".concat(c))||"{}");t[c]=n({enabled:"true"===localStorage.getItem(a)},l)}}}catch(t){r=!0,o=t}finally{try{e||null==i.return||i.return()}finally{if(r)throw o}}return t}()},p=(0,s.getGlobalStore)("feature-flags",f);p.subscribe((function(e){var n,r=!0,o=!1,u=void 0;try{for(var i,a=Object.entries(e.flags)[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var c=function(t){if(Array.isArray(t))return t}(n=i.value)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),2!==u.length);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(n)||function(e,n){if(e){if("string"==typeof e)return t(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,2):void 0}}(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=c[0],s=c[1];localStorage.setItem("openmrs:feature-flag:".concat(l),s.enabled.toString()),localStorage.setItem("openmrs:feature-flag-meta:".concat(l),JSON.stringify({label:s.label,description:s.description}))}}catch(e){o=!0,u=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw u}}}))}(),o}())}}}))},385:()=>{System.register([],(function(t,e){return{execute:function(){t(function(){"use strict";var t=function(t,e){var n=a[t];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(e,!0),n.active=!0,n.value;var r=i()((function(){return e}));return a[t]={value:r,active:!0},r},e=function(t,e){var n=a[t];if(!n){var r=i()((function(){return null!=e?e:{}}));return a[t]={value:r,active:!1},r}return n.value},n=function(t,e,n){var r=e(t.getState());return t.subscribe((function(t){var o=e(t);o!==r&&(r=o,n(o))}))},r={d:function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};r.r(o),r.d(o,{createGlobalStore:function(){return t},getGlobalStore:function(){return e},subscribeTo:function(){return n}});var u=function(t){var e,n=new Set,r=function(t,r){var o="function"==typeof t?t(e):t;if(!Object.is(o,e)){var u=e;e=(null!=r?r:"object"!=typeof o)?o:Object.assign({},e,o),n.forEach((function(t){return t(e,u)}))}},o=function(){return e},u={setState:r,getState:o,subscribe:function(t){return n.add(t),function(){return n.delete(t)}},destroy:function(){console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return e=t(r,o,u),u},i=function(t){return t?u(t):u},a={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=a)}),1e3),o}())}}}))},766:t=>{"use strict";t.exports=i},824:t=>{"use strict";t.exports=r},45:t=>{"use strict";t.exports=o},728:t=>{"use strict";t.exports=u},688:t=>{"use strict";t.exports=s},954:t=>{"use strict";t.exports=n},493:t=>{"use strict";t.exports=a},281:t=>{"use strict";t.exports=c},725:t=>{"use strict";t.exports=l}},e={};function f(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,f),o.exports}f.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return f.d(e,{a:e}),e},f.d=(t,e)=>{for(var n in e)f.o(e,n)&&!f.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},f.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),f.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var p={};return(()=>{"use strict";f.r(p),f.d(p,{ComponentContext:()=>e,ConfigurableLink:()=>o,Extension:()=>l,ExtensionSlot:()=>Fe,UserHasAccess:()=>ze,createUseStore:()=>Ce,getAsyncExtensionLifecycle:()=>mn,getAsyncLifecycle:()=>yn,getLifecycle:()=>dn,getSyncLifecycle:()=>bn,isDesktop:()=>zn,openmrsComponentDecorator:()=>pn,useAbortController:()=>vn,useAssignedExtensionIds:()=>Sn,useAssignedExtensions:()=>ve,useBodyScrollLock:()=>On,useConfig:()=>Cn,useConnectedExtensions:()=>Te,useConnectivity:()=>y,useDebounce:()=>Mn,useExtensionInternalStore:()=>Rn,useExtensionSlot:()=>ke,useExtensionSlotMeta:()=>Tn,useExtensionStore:()=>kn,useFeatureFlag:()=>Un,useForceUpdate:()=>Nn,useLayoutType:()=>Bn,useLocations:()=>$n,useOnClickOutside:()=>Gn,useOpenmrsSWR:()=>Yn,usePagination:()=>yr,usePatient:()=>rr,useSession:()=>ur,useStore:()=>Ae,useStoreWithActions:()=>_e,useVisit:()=>lr,useVisitTypes:()=>fr});var t=f(954),e=t.default.createContext({moduleName:""}),n=f(824);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(e){var o=e.to,u=e.templateParams,i=e.children,a=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},u=Object.keys(t);for(r=0;r<u.length;r++)n=u[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(r=0;r<u.length;r++)n=u[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(e,["to","templateParams","children"]);return t.default.createElement("a",function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),o.forEach((function(e){r(t,e,n[e])}))}return t}({onClick:function(t){return function(t,e,r){t.metaKey||t.ctrlKey||t.shiftKey||0!=t.button||(t.preventDefault(),(0,n.navigate)({to:e,templateParams:r}))}(t,o,u)},href:(0,n.interpolateUrl)(o,u)},a),i)}var u=f(45);function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){a(t,e,n[e])}))}return t}var l=function(n){var r=n.state,o=n.children,a=n.wrap,l=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},u=Object.keys(t);for(r=0;r<u.length;r++)n=u[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(r=0;r<u.length;r++)n=u[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(n,["state","children","wrap"]),s=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}(t,e)||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,t.useState)(),2),f=s[0],p=s[1],d=(0,t.useContext)(e).extension,y=(0,t.useRef)(null),b=(0,t.useRef)(Promise.resolve()),m=(0,t.useRef)(!1);(0,t.useEffect)((function(){a&&console.warn("'wrap' prop of Extension is being used ".concat((null==d?void 0:d.extensionId)?"by ".concat(d.extensionId," in ").concat(d.extensionSlotName):"",". This will be removed in a future release."))}),[]);var v=(0,t.useCallback)((function(t){p(t)}),[p]);(0,t.useEffect)((function(){if(null!=f&&(null==d?void 0:d.extensionSlotName)&&d.extensionSlotModuleName&&d.extensionSlotModuleName&&!y.current&&!m.current)return m.current=!0,(0,u.renderExtension)(f,d.extensionSlotName,d.extensionSlotModuleName,d.extensionId,void 0,r).then((function(t){y.current=t,m.current=!1})),function(){if(y&&y.current)switch(y.current.getStatus()){case"MOUNTING":y.current.mountPromise.then((function(){var t;"MOUNTED"===(null===(t=y.current)||void 0===t?void 0:t.getStatus())&&y.current.unmount()}));break;case"MOUNTED":y.current.unmount();break;case"UPDATING":b.current&&b.current.then((function(){var t;"MOUNTED"===(null===(t=y.current)||void 0===t?void 0:t.getStatus())&&y.current.unmount()}))}}}),[null==d?void 0:d.extensionSlotName,null==d?void 0:d.extensionId,null==d?void 0:d.extensionSlotModuleName,f]),(0,t.useEffect)((function(){y.current&&y.current.update&&"UNMOUNTING"!==y.current.getStatus()&&Promise.all([y.current.mountPromise,b.current]).then((function(){var t;"MOUNTED"===(null==y||null===(t=y.current)||void 0===t?void 0:t.getStatus())&&y.current.update&&(b.current=y.current.update(c({},r)).catch((function(t){var e,n,r;if(n=t,!(null!=(r=Error)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r)||!t.message.includes("minified message #32")||"MOUNTED"===(null===(e=y.current)||void 0===e?void 0:e.getStatus()))throw t})))}))}),[r]);var g=t.default.createElement("div",c({ref:v,"data-extension-id":null==d?void 0:d.extensionId,style:{position:"relative"}},l));return"function"!=typeof o||t.default.isValidElement(o)?d&&a?a(g,d):g:t.default.createElement(t.default.Fragment,null,o(g,d))},s=f(728);function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function y(){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void 0}}(t,e)||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,t.useState)(window.navigator.onLine),2),n=e[0],r=e[1];return(0,t.useEffect)((function(){return(0,s.subscribeConnectivityChanged)((function(t){var e=t.online;return r(e)}))}),[]),n}const b=function(t,e){return t===e||t!=t&&e!=e},m=function(t,e){for(var n=t.length;n--;)if(b(t[n][0],e))return n;return-1};var v=Array.prototype.splice;function g(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}g.prototype.clear=function(){this.__data__=[],this.size=0},g.prototype.delete=function(t){var e=this.__data__,n=m(e,t);return!(n<0||(n==e.length-1?e.pop():v.call(e,n,1),--this.size,0))},g.prototype.get=function(t){var e=this.__data__,n=m(e,t);return n<0?void 0:e[n][1]},g.prototype.has=function(t){return m(this.__data__,t)>-1},g.prototype.set=function(t,e){var n=this.__data__,r=m(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};const h=g,S="object"==typeof global&&global&&global.Object===Object&&global;var O="object"==typeof self&&self&&self.Object===Object&&self;const w=S||O||Function("return this")(),j=w.Symbol;var E=Object.prototype,x=E.hasOwnProperty,P=E.toString,A=j?j.toStringTag:void 0;var _=Object.prototype.toString;var C=j?j.toStringTag:void 0;const I=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":C&&C in Object(t)?function(t){var e=x.call(t,A),n=t[A];try{t[A]=void 0;var r=!0}catch(t){}var o=P.call(t);return r&&(e?t[A]=n:delete t[A]),o}(t):function(t){return _.call(t)}(t)},M=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},R=function(t){if(!M(t))return!1;var e=I(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},T=w["__core-js_shared__"];var k,U=(k=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"";var D=Function.prototype.toString;const N=function(t){if(null!=t){try{return D.call(t)}catch(t){}try{return t+""}catch(t){}}return""};var F=/^\[object .+?Constructor\]$/,L=Function.prototype,B=Object.prototype,z=L.toString,V=B.hasOwnProperty,$=RegExp("^"+z.call(V).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const G=function(t){return!(!M(t)||(e=t,U&&U in e))&&(R(t)?$:F).test(N(t));var e},W=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return G(n)?n:void 0},H=W(w,"Map"),q=W(Object,"create");var Y=Object.prototype.hasOwnProperty;var K=Object.prototype.hasOwnProperty;function J(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}J.prototype.clear=function(){this.__data__=q?q(null):{},this.size=0},J.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},J.prototype.get=function(t){var e=this.__data__;if(q){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Y.call(e,t)?e[t]:void 0},J.prototype.has=function(t){var e=this.__data__;return q?void 0!==e[t]:K.call(e,t)},J.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=q&&void 0===e?"__lodash_hash_undefined__":e,this};const Z=J,Q=function(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map};function X(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}X.prototype.clear=function(){this.size=0,this.__data__={hash:new Z,map:new(H||h),string:new Z}},X.prototype.delete=function(t){var e=Q(this,t).delete(t);return this.size-=e?1:0,e},X.prototype.get=function(t){return Q(this,t).get(t)},X.prototype.has=function(t){return Q(this,t).has(t)},X.prototype.set=function(t,e){var n=Q(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};const tt=X;function et(t){var e=this.__data__=new h(t);this.size=e.size}et.prototype.clear=function(){this.__data__=new h,this.size=0},et.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},et.prototype.get=function(t){return this.__data__.get(t)},et.prototype.has=function(t){return this.__data__.has(t)},et.prototype.set=function(t,e){var n=this.__data__;if(n instanceof h){var r=n.__data__;if(!H||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new tt(r)}return n.set(t,e),this.size=n.size,this};const nt=et;function rt(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new tt;++e<n;)this.add(t[e])}rt.prototype.add=rt.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},rt.prototype.has=function(t){return this.__data__.has(t)};const ot=rt,ut=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1},it=function(t,e,n,r,o,u){var i=1&n,a=t.length,c=e.length;if(a!=c&&!(i&&c>a))return!1;var l=u.get(t),s=u.get(e);if(l&&s)return l==e&&s==t;var f=-1,p=!0,d=2&n?new ot:void 0;for(u.set(t,e),u.set(e,t);++f<a;){var y=t[f],b=e[f];if(r)var m=i?r(b,y,f,e,t,u):r(y,b,f,t,e,u);if(void 0!==m){if(m)continue;p=!1;break}if(d){if(!ut(e,(function(t,e){if(i=e,!d.has(i)&&(y===t||o(y,t,n,r,u)))return d.push(e);var i}))){p=!1;break}}else if(y!==b&&!o(y,b,n,r,u)){p=!1;break}}return u.delete(t),u.delete(e),p},at=w.Uint8Array,ct=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n},lt=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n};var st=j?j.prototype:void 0,ft=st?st.valueOf:void 0;const pt=Array.isArray;var dt=Object.prototype.propertyIsEnumerable,yt=Object.getOwnPropertySymbols;const bt=yt?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,u=[];++n<r;){var i=t[n];e(i,n,t)&&(u[o++]=i)}return u}(yt(t),(function(e){return dt.call(t,e)})))}:function(){return[]},mt=function(t){return null!=t&&"object"==typeof t},vt=function(t){return mt(t)&&"[object Arguments]"==I(t)};var gt=Object.prototype,ht=gt.hasOwnProperty,St=gt.propertyIsEnumerable,Ot=vt(function(){return arguments}())?vt:function(t){return mt(t)&&ht.call(t,"callee")&&!St.call(t,"callee")};const wt=Ot;var jt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Et=jt&&"object"==typeof module&&module&&!module.nodeType&&module,xt=Et&&Et.exports===jt?w.Buffer:void 0;const Pt=(xt?xt.isBuffer:void 0)||function(){return!1};var At=/^(?:0|[1-9]\d*)$/;const _t=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&At.test(t))&&t>-1&&t%1==0&&t<e},Ct=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var It={};It["[object Float32Array]"]=It["[object Float64Array]"]=It["[object Int8Array]"]=It["[object Int16Array]"]=It["[object Int32Array]"]=It["[object Uint8Array]"]=It["[object Uint8ClampedArray]"]=It["[object Uint16Array]"]=It["[object Uint32Array]"]=!0,It["[object Arguments]"]=It["[object Array]"]=It["[object ArrayBuffer]"]=It["[object Boolean]"]=It["[object DataView]"]=It["[object Date]"]=It["[object Error]"]=It["[object Function]"]=It["[object Map]"]=It["[object Number]"]=It["[object Object]"]=It["[object RegExp]"]=It["[object Set]"]=It["[object String]"]=It["[object WeakMap]"]=!1;var Mt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Rt=Mt&&"object"==typeof module&&module&&!module.nodeType&&module,Tt=Rt&&Rt.exports===Mt&&S.process,kt=function(){try{return Rt&&Rt.require&&Rt.require("util").types||Tt&&Tt.binding&&Tt.binding("util")}catch(t){}}(),Ut=kt&&kt.isTypedArray;const Dt=Ut?(Nt=Ut,function(t){return Nt(t)}):function(t){return mt(t)&&Ct(t.length)&&!!It[I(t)]};var Nt,Ft=Object.prototype.hasOwnProperty;const Lt=function(t,e){var n=pt(t),r=!n&&wt(t),o=!n&&!r&&Pt(t),u=!n&&!r&&!o&&Dt(t),i=n||r||o||u,a=i?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=a.length;for(var l in t)!e&&!Ft.call(t,l)||i&&("length"==l||o&&("offset"==l||"parent"==l)||u&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||_t(l,c))||a.push(l);return a};var Bt=Object.prototype;const zt=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object);var Vt=Object.prototype.hasOwnProperty;const $t=function(t){if(n=(e=t)&&e.constructor,e!==("function"==typeof n&&n.prototype||Bt))return zt(t);var e,n,r=[];for(var o in Object(t))Vt.call(t,o)&&"constructor"!=o&&r.push(o);return r},Gt=function(t){return null!=(e=t)&&Ct(e.length)&&!R(e)?Lt(t):$t(t);var e},Wt=function(t){return function(t,e,n){var r=e(t);return pt(t)?r:function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}(r,n(t))}(t,Gt,bt)};var Ht=Object.prototype.hasOwnProperty;const qt=W(w,"DataView"),Yt=W(w,"Promise"),Kt=W(w,"Set"),Jt=W(w,"WeakMap");var Zt="[object Map]",Qt="[object Promise]",Xt="[object Set]",te="[object WeakMap]",ee="[object DataView]",ne=N(qt),re=N(H),oe=N(Yt),ue=N(Kt),ie=N(Jt),ae=I;(qt&&ae(new qt(new ArrayBuffer(1)))!=ee||H&&ae(new H)!=Zt||Yt&&ae(Yt.resolve())!=Qt||Kt&&ae(new Kt)!=Xt||Jt&&ae(new Jt)!=te)&&(ae=function(t){var e=I(t),n="[object Object]"==e?t.constructor:void 0,r=n?N(n):"";if(r)switch(r){case ne:return ee;case re:return Zt;case oe:return Qt;case ue:return Xt;case ie:return te}return e});const ce=ae;var le="[object Arguments]",se="[object Array]",fe="[object Object]",pe=Object.prototype.hasOwnProperty;const de=function(t,e,n,r,o,u){var i=pt(t),a=pt(e),c=i?se:ce(t),l=a?se:ce(e),s=(c=c==le?fe:c)==fe,f=(l=l==le?fe:l)==fe,p=c==l;if(p&&Pt(t)){if(!Pt(e))return!1;i=!0,s=!1}if(p&&!s)return u||(u=new nt),i||Dt(t)?it(t,e,n,r,o,u):function(t,e,n,r,o,u,i){switch(n){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 at(t),new at(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return b(+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 a=ct;case"[object Set]":var c=1&r;if(a||(a=lt),t.size!=e.size&&!c)return!1;var l=i.get(t);if(l)return l==e;r|=2,i.set(t,e);var s=it(a(t),a(e),r,o,u,i);return i.delete(t),s;case"[object Symbol]":if(ft)return ft.call(t)==ft.call(e)}return!1}(t,e,c,n,r,o,u);if(!(1&n)){var d=s&&pe.call(t,"__wrapped__"),y=f&&pe.call(e,"__wrapped__");if(d||y){var m=d?t.value():t,v=y?e.value():e;return u||(u=new nt),o(m,v,n,r,u)}}return!!p&&(u||(u=new nt),function(t,e,n,r,o,u){var i=1&n,a=Wt(t),c=a.length;if(c!=Wt(e).length&&!i)return!1;for(var l=c;l--;){var s=a[l];if(!(i?s in e:Ht.call(e,s)))return!1}var f=u.get(t),p=u.get(e);if(f&&p)return f==e&&p==t;var d=!0;u.set(t,e),u.set(e,t);for(var y=i;++l<c;){var b=t[s=a[l]],m=e[s];if(r)var v=i?r(m,b,s,e,t,u):r(b,m,s,t,e,u);if(!(void 0===v?b===m||o(b,m,n,r,u):v)){d=!1;break}y||(y="constructor"==s)}if(d&&!y){var g=t.constructor,h=e.constructor;g==h||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof h&&h instanceof h||(d=!1)}return u.delete(t),u.delete(e),d}(t,e,n,r,o,u))},ye=function t(e,n,r,o,u){return e===n||(null==e||null==n||!mt(e)&&!mt(n)?e!=e&&n!=n:de(e,n,r,o,t,u))},be=function(t,e){return ye(t,e)};function me(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ve(e){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return me(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?me(t,e):void 0}}(t,e)||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,t.useState)([]),2),r=n[0],o=n[1];return(0,t.useEffect)((function(){var t=function(t){var n,u,i=null!==(u=null===(n=t.slots[e])||void 0===n?void 0:n.assignedExtensions)&&void 0!==u?u:[];be(i,r)||o(i)};return t((0,u.getExtensionStore)().getState()),(0,u.getExtensionStore)().subscribe(t)}),[e,r]),r}var ge=f(385);function he(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Se(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Oe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){Se(t,e,n[e])}))}return t}function we(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||Ee(t,e)||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(t){return function(t){if(Array.isArray(t))return he(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ee(t)||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.")}()}function Ee(t,e){if(t){if("string"==typeof t)return he(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?he(t,e):void 0}}function xe(t,e){var n=function(n){r[n]=function(){for(var r=arguments.length,o=new Array(r),u=0;u<r;u++)o[u]=arguments[u];t.setState((function(t){var r,u=[t].concat(je(o));return(r=e)[n].apply(r,je(u))}))}};"function"==typeof e&&(e=e(t));var r={};for(var o in e)n(o);return r}var Pe=function(t){return t};function Ae(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Pe,r=arguments.length>2?arguments[2]:void 0,o=we((0,t.useState)((function(){return n(e.getState())})),2),u=o[0],i=o[1];return(0,t.useEffect)((function(){return(0,ge.subscribeTo)(e,n,i)}),[e,n]),Oe({},u,(0,t.useMemo)((function(){return r?xe(e,r):{}}),[e,r]))}function _e(t,e){return Ae(t,Pe,e)}function Ce(e){return function(n){var r=we((0,t.useState)(e.getState()),2),o=r[0],u=r[1];return(0,t.useEffect)((function(){return e.subscribe((function(t){return u(t)}))}),[]),Oe({},o,(0,t.useMemo)((function(){return n?xe(e,n):{}}),[n]))}}var Ie=f(570);function Me(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Re(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Me(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Me(t,e):void 0}}(t,e)||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 Te(e){var n=y(),r=ve(e),o=Ae(Ie.featureFlagsStore),i=(0,t.useMemo)((function(){return Object.entries(o.flags).filter((function(t){return Re(t,2)[1].enabled})).map((function(t){return Re(t,1)[0]}))}),[o.flags]);return(0,t.useMemo)((function(){return(0,u.getConnectedExtensions)(r,n,i)}),[r,n,i])}function ke(n){var r=(0,t.useContext)(e).moduleName;if(!r)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,t.useEffect)((function(){(0,u.registerExtensionSlot)(r,n)}),[]),{extensions:Te(n),extensionSlotName:n,extensionSlotModuleName:r}}function Ue(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function De(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){Ue(t,e,n[e])}))}return t}function Ne(t){return t}function Fe(n){var r=n.name,o=n.extensionSlotName,u=n.select,i=void 0===u?Ne:u,a=n.children,c=n.state,s=n.style,f=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},u=Object.keys(t);for(r=0;r<u.length;r++)n=u[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(r=0;r<u.length;r++)n=u[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(n,["name","extensionSlotName","select","children","state","style"]);if(a&&c)throw new Error("Both children and state have been provided. If children are provided, the state must be passed as a prop to the `Extension` component.");var p,d,y,b,m=null!=r?r:o,v=(0,t.useRef)(null),g=ke(m),h=g.extensions,S=g.extensionSlotModuleName,O=(0,t.useMemo)((function(){return i(h)}),[i,h]),w=(0,t.useMemo)((function(){if("function"==typeof a&&!t.default.isValidElement(a))return O.map((function(t){return a(t)}))}),[a,O]);return t.default.createElement("div",De({ref:v,"data-extension-slot-name":m,"data-extension-slot-module-name":S,style:(y=De({},s),b={position:"relative"},b=null!=b?b:{},Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(b)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(b)).forEach((function(t){Object.defineProperty(y,t,Object.getOwnPropertyDescriptor(b,t))})),y)},f),m&&O.map((function(n,r){return t.default.createElement(e.Provider,{key:n.id,value:{moduleName:S,extension:{extensionId:n.id,extensionSlotName:m,extensionSlotModuleName:S}}},null!==(d=null!==(p=null==w?void 0:w[r])&&void 0!==p?p:"function"!=typeof a?a:null)&&void 0!==d?d:t.default.createElement(l,{state:c}))})))}var Le=f(766);function Be(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ze=function(e){var n=e.privilege,r=e.fallback,o=e.children,u=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Be(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Be(t,e):void 0}}(t,e)||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,t.useState)(null),2),i=u[0],a=u[1];return(0,t.useEffect)((function(){var t=(0,Le.getCurrentUser)({includeAuthStatus:!1}).subscribe(a);return function(){return t.unsubscribe()}}),[]),i&&(0,Le.userHasAccess)(n,i)?t.default.createElement(t.default.Fragment,null,o):r?t.default.createElement(t.default.Fragment,null,r):null},Ve=f(645);function $e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ge(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$e(Object(n),!0).forEach((function(e){He(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function We(t){return(We="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function He(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qe(t){return(qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ye(t,e){var n;if("function"!=typeof(n=e.domElement?function(){return e.domElement}:e.domElementGetter?e.domElementGetter:t.domElementGetter?t.domElementGetter:function(t){var e=t.appName||t.name;if(!e)throw Error("single-spa's dom-element-getter-helpers was not given an application name as a prop, so it can't make a unique dom element container for the react application");var n="single-spa-application:".concat(e);return function(){var t=document.getElementById(n);return t||((t=document.createElement("div")).id=n,document.body.appendChild(t)),t}}(e)))throw Error("single-spa's dom-element-getter-helpers was given an invalid domElementGetter for application or parcel '".concat(e.name,"'. Expected a function, received ").concat(qe(n)));return function(){var t=n(e);if(!(t instanceof HTMLElement))throw Error("single-spa's dom-element-getter-helpers: domElementGetter returned an invalid dom element for application or parcel '".concat(e.name,"'. Expected HTMLElement, received ").concat(qe(t)));return t}}var Ke=null;try{Ke=require("react").createContext()}catch($e){}var Je={React:null,ReactDOM:null,ReactDOMClient:null,rootComponent:null,loadRootComponent:null,renderType:"createRoot",errorBoundary:null,errorBoundaryClass:null,domElementGetter:null,parcelCanUpdate:!0,suppressComponentDidCatchWarning:!1,domElements:{},renderResults:{},updateResolves:{},unmountResolves:{}};function Ze(t){if("object"!==We(t))throw new Error("single-spa-react requires a configuration object");var e=Ge(Ge({},Je),t);if(!e.React)throw new Error("single-spa-react must be passed opts.React");if(!e.ReactDOM&&!e.ReactDOMClient)throw new Error("single-spa-react must be passed opts.ReactDOM or opts.ReactDOMClient");if(!e.rootComponent&&!e.loadRootComponent)throw new Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(e.errorBoundary&&"function"!=typeof e.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!Ke&&e.React.createContext&&(Ke=e.React.createContext()),e.SingleSpaRoot=function(t){function e(t){e.displayName="SingleSpaRoot(".concat(t.name,")")}return e.prototype=Object.create(t.React.Component.prototype),e.prototype.componentDidMount=function(){setTimeout(this.props.mountFinished)},e.prototype.componentWillUnmount=function(){setTimeout(this.props.unmountFinished)},e.prototype.render=function(){return setTimeout(this.props.updateFinished),this.props.children},e}(e);var n={bootstrap:Qe.bind(null,e),mount:Xe.bind(null,e),unmount:tn.bind(null,e)};return e.parcelCanUpdate&&(n.update=en.bind(null,e)),n}function Qe(t,e){return t.rootComponent?Promise.resolve():t.loadRootComponent(e).then((function(e){t.rootComponent=e}))}function Xe(t,e){return new Promise((function(n,r){t.suppressComponentDidCatchWarning||!function(t){if(!(t&&"string"==typeof t.version&&t.version.indexOf(".")>=0))return!1;var e=t.version.slice(0,t.version.indexOf("."));try{return Number(e)>=16}catch(t){return!1}}(t.React)||t.errorBoundary||t.errorBoundaryClass||(t.rootComponent.prototype?t.rootComponent.prototype.componentDidCatch||console.warn("single-spa-react: ".concat(e.name||e.appName||e.childAppName,"'s rootComponent should implement componentDidCatch to avoid accidentally unmounting the entire single-spa application.")):console.warn("single-spa-react: ".concat(e.name||e.appName||e.childAppName,"'s rootComponent does not implement an error boundary. If using a functional component, consider providing an opts.errorBoundary to singleSpaReact(opts).")));var o=on(t,e,(function(){n(this)})),u=Ye(t,e)(),i=function(t){var e=t.renderType,n=t.elementToRender,r=t.domElement,o=t.reactDom[e];if("function"!=typeof o)throw new Error('renderType "'.concat(e,'" did not return a function.'));switch(e){case"createRoot":case"unstable_createRoot":case"createBlockingRoot":case"unstable_createBlockingRoot":var u=o(r);return u.render(n),u;case"hydrateRoot":return o(r,n);default:return o(n,r),null}}({elementToRender:o,domElement:u,reactDom:nn(t),renderType:rn(t)});t.domElements[e.name]=u,t.renderResults[e.name]=i}))}function tn(t,e){return new Promise((function(n){t.unmountResolves[e.name]=n;var r=t.renderResults[e.name];r&&r.unmount?r.unmount():nn(t).unmountComponentAtNode(t.domElements[e.name]),delete t.domElements[e.name],delete t.renderResults[e.name]}))}function en(t,e){return new Promise((function(n){t.updateResolves[e.name]||(t.updateResolves[e.name]=[]),t.updateResolves[e.name].push(n);var r=on(t,e,null),o=t.renderResults[e.name];if(o&&o.render)o.render(r);else{var u=Ye(t,e)();nn(t).render(r,u)}}))}function nn(t){return t.ReactDOMClient||t.ReactDOM}function rn(t){return"function"==typeof t.renderType?t.renderType():t.renderType}function on(t,e,n){var r=t.React.createElement(t.rootComponent,e),o=Ke?t.React.createElement(Ke.Provider,{value:e},r):r;return(t.errorBoundary||e.errorBoundary||t.errorBoundaryClass||e.errorBoundaryClass)&&(t.errorBoundaryClass=t.errorBoundaryClass||e.errorBoundaryClass||function(t,e){function n(e){t.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},n.displayName="SingleSpaReactErrorBoundary(".concat(e.name,")")}return n.prototype=Object.create(t.React.Component.prototype),n.prototype.render=function(){return this.state.caughtError?(t.errorBoundary||e.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},n.prototype.componentDidCatch=function(t,e){this.setState({caughtError:t,caughtErrorInfo:e})},n}(t,e),o=t.React.createElement(t.errorBoundaryClass,e,o)),t.React.createElement(t.SingleSpaRoot,Ge(Ge({},e),{},{mountFinished:n,updateFinished:function(){t.updateResolves[e.name]&&(t.updateResolves[e.name].forEach((function(t){return t()})),delete t.updateResolves[e.name])},unmountFinished:function(){t.unmountResolves[e.name]&&(t.unmountResolves[e.name](),delete t.unmountResolves[e.name])}}),o)}var un=f(281);function an(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function cn(t){return cn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},cn(t)}function ln(t,e){return ln=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},ln(t,e)}function sn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=cn(t);if(e){var o=cn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(t,e){return!e||"object"!=((n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e;var n}(this,n)}}var fn={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1};function pn(n){if("object"!=typeof n||"string"!=typeof n.featureName||"string"!=typeof n.moduleName)throw new Error("Invalid options");var r=Object.assign({},fn,n);return function(n){var o,u,i,a;return u=o=function(o){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ln(t,e)}(c,o);var u,i,a=sn(c);function c(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(e=a.call(this,t)).state={caughtError:null,caughtErrorInfo:null,config:{moduleName:r.moduleName,extension:t._extensionContext}},e}return u=c,(i=[{key:"componentDidCatch",value:function(t,e){e&&e.componentStack&&(t.extra=Object.assign(t.extra||{},{componentStack:e.componentStack})),r.throwErrorsToConsole&&setTimeout((function(){throw t})),this.setState({caughtError:t,caughtErrorInfo:e})}},{key:"render",value:function(){if(this.state.caughtError)return t.default.createElement("div",null,"An error has occurred. Please try reloading the page.");var o=t.default.createElement(t.Suspense,{fallback:null},t.default.createElement(e.Provider,{value:this.state.config},r.disableTranslations?t.default.createElement(n,this.props):t.default.createElement(un.I18nextProvider,{i18n:window.i18next,defaultNS:r.moduleName},t.default.createElement(n,this.props))));return r.strictMode||!t.default.StrictMode?o:t.default.createElement(t.default.StrictMode,null,o)}}])&&an(u.prototype,i),c}(t.default.Component),i="displayName",a="OpenmrsReactComponent(".concat(r.featureName,")"),i in u?Object.defineProperty(u,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[i]=a,o}}function dn(e,n){return Ze({React:t.default,ReactDOMClient:Ve,rootComponent:pn(n)(e)})}function yn(t,e){return function(){return t().then((function(t){return dn(t.default,e)}))}}function bn(t,e){return function(){return Promise.resolve(dn(t,e))}}var mn=yn;function vn(){var e=(0,t.useRef)();return e.current&&!e.current.signal.aborted||(e.current=new AbortController),(0,t.useEffect)((function(){var t=e.current;return function(){return null==t?void 0:t.abort()}}),[]),e.current}const gn=vn;function hn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Sn(e){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return hn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hn(t,e):void 0}}(t,e)||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,t.useState)([]),2),r=n[0],o=n[1];return(0,t.useEffect)((function(){return(0,u.getExtensionStore)().subscribe((function(t){var n,u,i=null!==(u=null===(n=t.slots[e])||void 0===n?void 0:n.assignedExtensions.map((function(t){return t.id})))&&void 0!==u?u:[];be(i,r)||o(i)}))}),[]),r}function On(e){(0,t.useEffect)((function(){if(e){var t=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=t}}}),[e])}function wn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function jn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function En(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){jn(t,e,n[e])}))}return t}function xn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return wn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wn(t,e):void 0}}(t,e)||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 Pn={},An='No ComponentContext has been provided. This should come from "openmrsComponentDecorator".\nUsually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".';function _n(e){var r=(0,t.useMemo)(n.getExtensionsConfigStore,[]),o=function(e,r){var o=xn((0,t.useState)(function(t,e){return e?function(){var r=t.getState(),o=(0,n.getExtensionConfigFromStore)(r,e.extensionSlotName,e.extensionId);if(o.loaded&&o.config)return o.config}:null}(e,r)),2),u=o[0],i=o[1];return(0,t.useEffect)((function(){if(r)return e.subscribe((function(t){var e=(0,n.getExtensionConfigFromStore)(t,r.extensionSlotName,r.extensionId);e.loaded&&e.config&&!be(e.config,u)&&i(e.config)}))}),[e,r,u]),u}(r,e);if(!o&&e){var u="".concat(e.extensionSlotName,"-").concat(e.extensionId);throw!Pn[u]&&r&&(Pn[u]=function(t,e){return new Promise((function(r){var o=t.subscribe((function(t){var u=(0,n.getExtensionConfigFromStore)(t,e.extensionSlotName,e.extensionId);u.loaded&&u.config&&(r(u.config),o())}))}))}(r,e)),Pn[u]}return o||{}}function Cn(r){var o,u=(0,t.useContext)(e),i=u.moduleName,a=u.extension,c=null!==(o=null==r?void 0:r.externalModuleName)&&void 0!==o?o:i;if(!c&&!a)throw Error(An);var l=function(e){var r=(0,t.useMemo)((function(){return(0,n.getConfigStore)(e)}),[e]),o=e,u=function(e){var n=xn((0,t.useState)(function(t){return function(){var e=t.getState();return e.loaded&&e.config?e.config:null}}(e)),2),r=n[0],o=n[1];return(0,t.useEffect)((function(){return null==e?void 0:e.subscribe((function(t){t.loaded&&t.config&&o(t.config)}))}),[e]),r}(r);if(!u)throw Pn[o]||(Pn[o]=function(t){return new Promise((function(e){var n=t.subscribe((function(t){t.loaded&&t.config&&(e(t.config),n())}))}))}(r)),Pn[o];return u}(c),s=_n(a);return(0,t.useMemo)((function(){return(null==r?void 0:r.externalModuleName)&&c===r.externalModuleName?En({},l):En({},l,s)}),[c,null==r?void 0:r.externalModuleName,l,s])}function In(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Mn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,r=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return In(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?In(t,e):void 0}}(t,e)||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,t.useState)(e),2),o=r[0],u=r[1];return(0,t.useEffect)((function(){var t=setTimeout((function(){u(e)}),n);return function(){clearTimeout(t)}}),[e,n]),o}var Rn=Ce((0,u.getExtensionInternalStore)());function Tn(e){var n=Te(e);return(0,t.useMemo)((function(){return Object.fromEntries(n.map((function(t){return[t.name,t.meta]})))}),[n])}var kn=Ce((0,u.getExtensionStore)());function Un(e){var n,r=Ae(Ie.featureFlagsStore).flags;return(0,t.useEffect)((function(){r[e]||console.error('useFeatureFlag: Attempted to get value of non-existent flag "'.concat(e,'". Did you forget to call registerFeatureFlag?'))}),[r[e]]),null===(n=r[e])||void 0===n?void 0:n.enabled}function Dn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Nn(){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Dn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dn(t,e):void 0}}(t,e)||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,t.useState)(0),2)[1];return(0,t.useCallback)((function(){e((function(t){return t+1}))}),[])}function Fn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ln(){var t="tablet";return document.body.classList.forEach((function(e){switch(e){case"omrs-breakpoint-lt-tablet":t="phone";break;case"omrs-breakpoint-gt-small-desktop":t="large-desktop";break;case"omrs-breakpoint-gt-tablet":t="small-desktop"}})),t}function Bn(){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Fn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fn(t,e):void 0}}(t,e)||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,t.useState)(Ln),2),n=e[0],r=e[1];return(0,t.useEffect)((function(){var t=function(){r(Ln())};return window.addEventListener("resize",t),function(){return window.removeEventListener("resize",t)}}),[]),n}var zn=function(t){return"small-desktop"===t||"large-desktop"===t};function Vn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function $n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Vn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vn(t,e):void 0}}(t,e)||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,t.useState)([]),2),r=n[0],o=n[1];return(0,t.useEffect)((function(){var t=(0,Le.getLocations)(e).subscribe((function(t){o(t)}),(function(t){console.error(t)}));return function(){return t.unsubscribe()}}),[]),r}function Gn(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=(0,t.useRef)(null);return(0,t.useEffect)((function(){if(n){var t=function(t){var n;(null==r||null===(n=r.current)||void 0===n?void 0:n.contains(t.target))||e(t)};return window.addEventListener("click",t),function(){return window.removeEventListener("click",t)}}}),[e,n]),r}var Wn,Hn=f(725);function qn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yn(e){var n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=o.abortController,i=o.fetchInit,a=o.url,c=o.swrConfig,l=gn(),s=(0,t.useMemo)((function(){return null!==(r=null!==(n=null==i?void 0:i.signal)&&void 0!==n?n:null==u?void 0:u.signal)&&void 0!==r?r:l.signal}),[null==u?void 0:u.signal,null==i?void 0:i.signal,l.signal]),f=(0,t.useCallback)((function(t){var e,n,r=function(t,e){if(e)return"function"==typeof e?e(t):e;if("string"==typeof t)return t;throw new Error("When using useOpenmrsSWR with a key that is not a string, you must provide a url() function that converts the key to a valid url. The key for this hook is ".concat(t,"."))}(t,a);return(0,Le.openmrsFetch)(r,(e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){qn(t,e,n[e])}))}return t}({},i),n=null!=(n={signal:s})?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})),e))}),[s,i,a]);return(0,Hn.default)(e,f,c)}function Kn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Jn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){Jn(t,e,n[e])}))}return t}function Qn(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t}!function(t){t.loadPatient="loadPatient",t.newPatient="newPatient",t.loadError="patientLoadError"}(Wn||(Wn={}));var Xn,tr={patientUuid:null,patient:null,isPendingUuid:!0,isLoadingPatient:!1,err:null};function er(){var t=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return t&&t[1]}function nr(t,e){switch(e.type){case Wn.loadPatient:return Qn(Zn({},t),{patientUuid:e.patientUuid,patient:null,isPendingUuid:!1,isLoadingPatient:!0,err:null});case Wn.newPatient:return Qn(Zn({},t),{patient:e.patient,isPendingUuid:!1,isLoadingPatient:!1,err:null});case Wn.loadError:return Qn(Zn({},t),{patient:null,isPendingUuid:!1,isLoadingPatient:!1,err:e.err});default:return t}}function rr(e){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Kn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Kn(t,e):void 0}}(t,e)||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,t.useReducer)(nr,Qn(Zn({},tr),{patientUuid:null!=e?e:null,isPendingUuid:!e,isLoadingPatient:!!e})),2),r=n[0],o=n[1];return(0,t.useEffect)((function(){if(r.isPendingUuid){var t=er();o(t?{type:Wn.loadPatient,patientUuid:t}:{type:Wn.newPatient,patient:null})}var e=!0;return r.isLoadingPatient&&r.patientUuid&&(0,Le.fetchCurrentPatient)(r.patientUuid).then((function(t){return e&&o({patient:t,type:Wn.newPatient})}),(function(t){return e&&o({err:t,type:Wn.loadError})})),function(){e=!1}}),[r.isPendingUuid,r.isLoadingPatient,r.patientUuid]),(0,t.useEffect)((function(){var t=function(t){var e=er();e!=r.patientUuid&&o({type:Wn.loadPatient,patientUuid:e})};return window.addEventListener("single-spa:routing-event",t),function(){return window.removeEventListener("single-spa:routing-event",t)}}),[r.patientUuid]),{isLoading:r.isPendingUuid||r.isLoadingPatient,patient:r.patient,patientUuid:null!=e?e:r.patientUuid,error:r.err}}function or(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ur(){var e=(0,t.useRef)(),n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return or(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?or(t,e):void 0}}(t,e)||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,t.useState)(null),2),r=n[0],o=n[1],u=null;if(!r){if(Xn){var i=(0,Le.getSessionStore)().getState();i.loaded&&(u=i.session)}else Xn=new Promise((function(t){var n=function(n){var r=n.loaded,o=n.session;r&&(t(o),u=o,e.current&&e.current(),e.current=void 0)};n((0,Le.getSessionStore)().getState()),u||(e.current=(0,Le.getSessionStore)().subscribe(n))}));if(!u)throw Xn;o(u)}(0,t.useEffect)((function(){return e.current||(e.current=(0,Le.getSessionStore)().subscribe((function(t){var e=t.loaded,n=t.session;e&&(u=n,o(n))}))),function(){e.current&&e.current(),e.current=void 0}}),[]);var a=r||u;if(!a)throw Xn?(console.warn("useSession is in an unexpected state. Attempting to recover."),Xn):Error("useSession is in an invalid state.");return a}var ir=f(688),ar=f(332),cr=f.n(ar);function lr(e){var n,r=Ae((0,Le.getVisitStore)()),o=r.patientUuid,u=r.manuallySetVisitUuid,i=e&&o==e?u:null,a="?patient=".concat(e,"&v=").concat(Le.defaultVisitCustomRepresentation,"&includeInactive=false"),c="/".concat(i),l=(0,Hn.default)(e?"/ws/rest/v1/visit".concat(a):null,Le.openmrsFetch),s=l.data,f=l.error,p=l.mutate,d=l.isValidating,y=(0,Hn.default)(e&&i?"/ws/rest/v1/visit".concat(c):null,Le.openmrsFetch),b=y.data,m=y.error,v=y.mutate,g=y.isValidating,h=(0,t.useMemo)((function(){return null!==(n=null==s?void 0:s.data.results.find((function(t){return null===t.stopDatetime})))&&void 0!==n?n:null}),[s]),S=(0,t.useMemo)((function(){return i?null==b?void 0:b.data:null!=h?h:null}),[b,h,i]);return{error:f||m,mutate:function(){p(),v()},isValidating:d||g,activeVisit:h,currentVisit:S,currentVisitIsRetrospective:Boolean(i),isLoading:Boolean((!s||i&&!b)&&(!f||!m))}}function sr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function fr(){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return sr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sr(t,e):void 0}}(t,e)||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,t.useState)([]),2),n=e[0],r=e[1];return(0,t.useEffect)((function(){var t=(0,Le.getVisitTypes)().subscribe((function(t){r(t)}),(function(t){return console.error(t)}));return function(){return t.unsubscribe()}}),[]),n}function pr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}ir.default.extend(cr());var dr=10;function yr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dr,r=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return pr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pr(t,e):void 0}}(t,e)||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,t.useState)(1),2),o=r[0],u=r[1],i=(0,t.useMemo)((function(){return"number"==typeof n&&n>0?Math.max(1,Math.ceil(e.length/n)):1}),[e.length,n]),a=(0,t.useMemo)((function(){var t=(o-1)*n,r=(o+0)*n;return e.slice(t,r)}),[e,o,n]),c=(0,t.useCallback)((function(t){u(Math.max(1,Math.min(i,t)))}),[u,i]),l=(0,t.useCallback)((function(){o<i&&u(o+1)}),[o,i,u]),s=(0,t.useCallback)((function(){o>1&&u(o-1)}),[o,u]);return(0,t.useMemo)((function(){return{results:a,totalPages:i,currentPage:o,paginated:e.length>n,showNextButton:o<i,showPreviousButton:o>1,goTo:c,goToNext:l,goToPrevious:s}}),[a,i,e.length,n,o,c,l,s])}})(),p})())}}}));
1
+ System.register(["react","@openmrs/esm-config","@openmrs/esm-extensions","@openmrs/esm-globals","@openmrs/esm-api","react-dom","react-i18next","swr","dayjs"],(function(t,e){var n={},r={},o={},u={},i={},a={},c={},l={},s={};return Object.defineProperty(a,"__esModule",{value:!0}),{setters:[function(t){n.Suspense=t.Suspense,n.default=t.default,n.useCallback=t.useCallback,n.useContext=t.useContext,n.useEffect=t.useEffect,n.useMemo=t.useMemo,n.useReducer=t.useReducer,n.useRef=t.useRef,n.useState=t.useState},function(t){r.getConfigStore=t.getConfigStore,r.getExtensionConfigFromStore=t.getExtensionConfigFromStore,r.getExtensionsConfigStore=t.getExtensionsConfigStore,r.interpolateUrl=t.interpolateUrl,r.navigate=t.navigate},function(t){o.getConnectedExtensions=t.getConnectedExtensions,o.getExtensionInternalStore=t.getExtensionInternalStore,o.getExtensionStore=t.getExtensionStore,o.registerExtensionSlot=t.registerExtensionSlot,o.renderExtension=t.renderExtension},function(t){u.subscribeConnectivityChanged=t.subscribeConnectivityChanged},function(t){i.attachmentUrl=t.attachmentUrl,i.defaultVisitCustomRepresentation=t.defaultVisitCustomRepresentation,i.fetchCurrentPatient=t.fetchCurrentPatient,i.getCurrentUser=t.getCurrentUser,i.getLocations=t.getLocations,i.getSessionStore=t.getSessionStore,i.getVisitStore=t.getVisitStore,i.getVisitTypes=t.getVisitTypes,i.openmrsFetch=t.openmrsFetch,i.userHasAccess=t.userHasAccess},function(t){Object.keys(t).forEach((function(e){a[e]=t[e]}))},function(t){c.I18nextProvider=t.I18nextProvider},function(t){l.default=t.default},function(t){s.default=t.default}],execute:function(){t((()=>{var t={332:function(t){t.exports=function(){"use strict";return function(t,e,n){e.prototype.isToday=function(){var t="YYYY-MM-DD",e=n();return this.format(t)===e.format(t)}}}()},645:(t,e,n)=>{"use strict";var r=n(493);e.createRoot=r.createRoot,e.hydrateRoot=r.hydrateRoot},570:()=>{System.register(["@openmrs/esm-state"],(function(t,e){var n={};return{setters:[function(t){n.getGlobalStore=t.getGlobalStore}],execute:function(){t(function(){"use strict";var t={685:function(t){t.exports=n}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var u=e[n]={exports:{}};return t[n](u,u.exports,r),u.exports}r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return function(){var t=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},e=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},n=function(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),o.forEach((function(n){e(t,n,r[n])}))}return t},u=function(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},i=function(t,r,o){var i;p.setState((function(a){var c;return{flags:u(n({},a.flags),e({},t,{enabled:null!==(i=null===(c=a.flags[t])||void 0===c?void 0:c.enabled)&&void 0!==i&&i,label:r,description:o}))}}))},a=function(t){return p.getState().flags[t].enabled},c=function(t,e){p.subscribe((function(n){e(n.flags[t].enabled)}))},l=function(t,r){p.setState((function(o){return{flags:u(n({},o.flags),e({},t,u(n({},o.flags[t]),{enabled:r})))}}))};r.r(o),r.d(o,{featureFlagsStore:function(){return p},getFeatureFlag:function(){return a},registerFeatureFlag:function(){return i},setFeatureFlag:function(){return l},subscribeToFeatureFlag:function(){return c}});var s=r(685),f={flags:function(){var t={},e=!0,r=!1,o=void 0;try{for(var u,i=Object.keys(localStorage)[Symbol.iterator]();!(e=(u=i.next()).done);e=!0){var a=u.value;if(a.startsWith("openmrs:feature-flag:")){var c=a.replace("openmrs:feature-flag:",""),l=JSON.parse(localStorage.getItem("openmrs:feature-flag-meta:".concat(c))||"{}");t[c]=n({enabled:"true"===localStorage.getItem(a)},l)}}}catch(t){r=!0,o=t}finally{try{e||null==i.return||i.return()}finally{if(r)throw o}}return t}()},p=(0,s.getGlobalStore)("feature-flags",f);p.subscribe((function(e){var n,r=!0,o=!1,u=void 0;try{for(var i,a=Object.entries(e.flags)[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var c=function(t){if(Array.isArray(t))return t}(n=i.value)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),2!==u.length);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(n)||function(e,n){if(e){if("string"==typeof e)return t(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,2):void 0}}(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=c[0],s=c[1];localStorage.setItem("openmrs:feature-flag:".concat(l),s.enabled.toString()),localStorage.setItem("openmrs:feature-flag-meta:".concat(l),JSON.stringify({label:s.label,description:s.description}))}}catch(e){o=!0,u=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw u}}}))}(),o}())}}}))},385:()=>{System.register([],(function(t,e){return{execute:function(){t(function(){"use strict";var t=function(t,e){var n=a[t];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(e,!0),n.active=!0,n.value;var r=i()((function(){return e}));return a[t]={value:r,active:!0},r},e=function(t,e){var n=a[t];if(!n){var r=i()((function(){return null!=e?e:{}}));return a[t]={value:r,active:!1},r}return n.value},n=function(t,e,n){var r=e(t.getState());return t.subscribe((function(t){var o=e(t);o!==r&&(r=o,n(o))}))},r={d:function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};r.r(o),r.d(o,{createGlobalStore:function(){return t},getGlobalStore:function(){return e},subscribeTo:function(){return n}});var u=function(t){var e,n=new Set,r=function(t,r){var o="function"==typeof t?t(e):t;if(!Object.is(o,e)){var u=e;e=(null!=r?r:"object"!=typeof o)?o:Object.assign({},e,o),n.forEach((function(t){return t(e,u)}))}},o=function(){return e},u={setState:r,getState:o,subscribe:function(t){return n.add(t),function(){return n.delete(t)}},destroy:function(){console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return e=t(r,o,u),u},i=function(t){return t?u(t):u},a={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=a)}),1e3),o}())}}}))},766:t=>{"use strict";t.exports=i},824:t=>{"use strict";t.exports=r},45:t=>{"use strict";t.exports=o},728:t=>{"use strict";t.exports=u},688:t=>{"use strict";t.exports=s},954:t=>{"use strict";t.exports=n},493:t=>{"use strict";t.exports=a},281:t=>{"use strict";t.exports=c},725:t=>{"use strict";t.exports=l}},e={};function f(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,f),o.exports}f.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return f.d(e,{a:e}),e},f.d=(t,e)=>{for(var n in e)f.o(e,n)&&!f.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},f.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),f.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var p={};return(()=>{"use strict";f.r(p),f.d(p,{ComponentContext:()=>e,ConfigurableLink:()=>o,Extension:()=>l,ExtensionSlot:()=>Fe,UserHasAccess:()=>ze,createUseStore:()=>Ce,getAsyncExtensionLifecycle:()=>bn,getAsyncLifecycle:()=>yn,getLifecycle:()=>dn,getSyncLifecycle:()=>mn,isDesktop:()=>Gn,openmrsComponentDecorator:()=>pn,useAbortController:()=>vn,useAssignedExtensionIds:()=>Sn,useAssignedExtensions:()=>ve,useAttachments:()=>wn,useBodyScrollLock:()=>jn,useConfig:()=>Mn,useConnectedExtensions:()=>Te,useConnectivity:()=>y,useDebounce:()=>Tn,useExtensionInternalStore:()=>kn,useExtensionSlot:()=>ke,useExtensionSlotMeta:()=>Un,useExtensionStore:()=>Dn,useFeatureFlag:()=>Nn,useForceUpdate:()=>Ln,useLayoutType:()=>Vn,useLocations:()=>Hn,useOnClickOutside:()=>qn,useOpenmrsSWR:()=>Kn,usePagination:()=>mr,usePatient:()=>or,useSession:()=>ir,useStore:()=>Ae,useStoreWithActions:()=>_e,useVisit:()=>sr,useVisitTypes:()=>pr});var t=f(954),e=t.default.createContext({moduleName:""}),n=f(824);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(e){var o=e.to,u=e.templateParams,i=e.children,a=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},u=Object.keys(t);for(r=0;r<u.length;r++)n=u[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(r=0;r<u.length;r++)n=u[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(e,["to","templateParams","children"]);return t.default.createElement("a",function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),o.forEach((function(e){r(t,e,n[e])}))}return t}({onClick:function(t){return function(t,e,r){t.metaKey||t.ctrlKey||t.shiftKey||0!=t.button||(t.preventDefault(),(0,n.navigate)({to:e,templateParams:r}))}(t,o,u)},href:(0,n.interpolateUrl)(o,u)},a),i)}var u=f(45);function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){a(t,e,n[e])}))}return t}var l=function(n){var r=n.state,o=n.children,a=n.wrap,l=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},u=Object.keys(t);for(r=0;r<u.length;r++)n=u[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(r=0;r<u.length;r++)n=u[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(n,["state","children","wrap"]),s=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}(t,e)||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,t.useState)(),2),f=s[0],p=s[1],d=(0,t.useContext)(e).extension,y=(0,t.useRef)(null),m=(0,t.useRef)(Promise.resolve()),b=(0,t.useRef)(!1);(0,t.useEffect)((function(){a&&console.warn("'wrap' prop of Extension is being used ".concat((null==d?void 0:d.extensionId)?"by ".concat(d.extensionId," in ").concat(d.extensionSlotName):"",". This will be removed in a future release."))}),[]);var v=(0,t.useCallback)((function(t){p(t)}),[p]);(0,t.useEffect)((function(){if(null!=f&&(null==d?void 0:d.extensionSlotName)&&d.extensionSlotModuleName&&d.extensionSlotModuleName&&!y.current&&!b.current)return b.current=!0,(0,u.renderExtension)(f,d.extensionSlotName,d.extensionSlotModuleName,d.extensionId,void 0,r).then((function(t){y.current=t,b.current=!1})),function(){if(y&&y.current)switch(y.current.getStatus()){case"MOUNTING":y.current.mountPromise.then((function(){var t;"MOUNTED"===(null===(t=y.current)||void 0===t?void 0:t.getStatus())&&y.current.unmount()}));break;case"MOUNTED":y.current.unmount();break;case"UPDATING":m.current&&m.current.then((function(){var t;"MOUNTED"===(null===(t=y.current)||void 0===t?void 0:t.getStatus())&&y.current.unmount()}))}}}),[null==d?void 0:d.extensionSlotName,null==d?void 0:d.extensionId,null==d?void 0:d.extensionSlotModuleName,f]),(0,t.useEffect)((function(){y.current&&y.current.update&&"UNMOUNTING"!==y.current.getStatus()&&Promise.all([y.current.mountPromise,m.current]).then((function(){var t;"MOUNTED"===(null==y||null===(t=y.current)||void 0===t?void 0:t.getStatus())&&y.current.update&&(m.current=y.current.update(c({},r)).catch((function(t){var e,n,r;if(n=t,!(null!=(r=Error)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r)||!t.message.includes("minified message #32")||"MOUNTED"===(null===(e=y.current)||void 0===e?void 0:e.getStatus()))throw t})))}))}),[r]);var g=t.default.createElement("div",c({ref:v,"data-extension-id":null==d?void 0:d.extensionId,style:{position:"relative"}},l));return"function"!=typeof o||t.default.isValidElement(o)?d&&a?a(g,d):g:t.default.createElement(t.default.Fragment,null,o(g,d))},s=f(728);function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function y(){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void 0}}(t,e)||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,t.useState)(window.navigator.onLine),2),n=e[0],r=e[1];return(0,t.useEffect)((function(){return(0,s.subscribeConnectivityChanged)((function(t){var e=t.online;return r(e)}))}),[]),n}const m=function(t,e){return t===e||t!=t&&e!=e},b=function(t,e){for(var n=t.length;n--;)if(m(t[n][0],e))return n;return-1};var v=Array.prototype.splice;function g(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}g.prototype.clear=function(){this.__data__=[],this.size=0},g.prototype.delete=function(t){var e=this.__data__,n=b(e,t);return!(n<0||(n==e.length-1?e.pop():v.call(e,n,1),--this.size,0))},g.prototype.get=function(t){var e=this.__data__,n=b(e,t);return n<0?void 0:e[n][1]},g.prototype.has=function(t){return b(this.__data__,t)>-1},g.prototype.set=function(t,e){var n=this.__data__,r=b(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};const h=g,S="object"==typeof global&&global&&global.Object===Object&&global;var O="object"==typeof self&&self&&self.Object===Object&&self;const w=S||O||Function("return this")(),j=w.Symbol;var E=Object.prototype,x=E.hasOwnProperty,P=E.toString,A=j?j.toStringTag:void 0;var _=Object.prototype.toString;var C=j?j.toStringTag:void 0;const I=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":C&&C in Object(t)?function(t){var e=x.call(t,A),n=t[A];try{t[A]=void 0;var r=!0}catch(t){}var o=P.call(t);return r&&(e?t[A]=n:delete t[A]),o}(t):function(t){return _.call(t)}(t)},M=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},R=function(t){if(!M(t))return!1;var e=I(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},T=w["__core-js_shared__"];var k,U=(k=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"";var D=Function.prototype.toString;const N=function(t){if(null!=t){try{return D.call(t)}catch(t){}try{return t+""}catch(t){}}return""};var F=/^\[object .+?Constructor\]$/,L=Function.prototype,B=Object.prototype,z=L.toString,V=B.hasOwnProperty,$=RegExp("^"+z.call(V).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const G=function(t){return!(!M(t)||(e=t,U&&U in e))&&(R(t)?$:F).test(N(t));var e},W=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return G(n)?n:void 0},H=W(w,"Map"),q=W(Object,"create");var Y=Object.prototype.hasOwnProperty;var K=Object.prototype.hasOwnProperty;function J(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}J.prototype.clear=function(){this.__data__=q?q(null):{},this.size=0},J.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},J.prototype.get=function(t){var e=this.__data__;if(q){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Y.call(e,t)?e[t]:void 0},J.prototype.has=function(t){var e=this.__data__;return q?void 0!==e[t]:K.call(e,t)},J.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=q&&void 0===e?"__lodash_hash_undefined__":e,this};const Z=J,Q=function(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map};function X(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}X.prototype.clear=function(){this.size=0,this.__data__={hash:new Z,map:new(H||h),string:new Z}},X.prototype.delete=function(t){var e=Q(this,t).delete(t);return this.size-=e?1:0,e},X.prototype.get=function(t){return Q(this,t).get(t)},X.prototype.has=function(t){return Q(this,t).has(t)},X.prototype.set=function(t,e){var n=Q(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};const tt=X;function et(t){var e=this.__data__=new h(t);this.size=e.size}et.prototype.clear=function(){this.__data__=new h,this.size=0},et.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},et.prototype.get=function(t){return this.__data__.get(t)},et.prototype.has=function(t){return this.__data__.has(t)},et.prototype.set=function(t,e){var n=this.__data__;if(n instanceof h){var r=n.__data__;if(!H||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new tt(r)}return n.set(t,e),this.size=n.size,this};const nt=et;function rt(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new tt;++e<n;)this.add(t[e])}rt.prototype.add=rt.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},rt.prototype.has=function(t){return this.__data__.has(t)};const ot=rt,ut=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1},it=function(t,e,n,r,o,u){var i=1&n,a=t.length,c=e.length;if(a!=c&&!(i&&c>a))return!1;var l=u.get(t),s=u.get(e);if(l&&s)return l==e&&s==t;var f=-1,p=!0,d=2&n?new ot:void 0;for(u.set(t,e),u.set(e,t);++f<a;){var y=t[f],m=e[f];if(r)var b=i?r(m,y,f,e,t,u):r(y,m,f,t,e,u);if(void 0!==b){if(b)continue;p=!1;break}if(d){if(!ut(e,(function(t,e){if(i=e,!d.has(i)&&(y===t||o(y,t,n,r,u)))return d.push(e);var i}))){p=!1;break}}else if(y!==m&&!o(y,m,n,r,u)){p=!1;break}}return u.delete(t),u.delete(e),p},at=w.Uint8Array,ct=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n},lt=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n};var st=j?j.prototype:void 0,ft=st?st.valueOf:void 0;const pt=Array.isArray;var dt=Object.prototype.propertyIsEnumerable,yt=Object.getOwnPropertySymbols;const mt=yt?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,u=[];++n<r;){var i=t[n];e(i,n,t)&&(u[o++]=i)}return u}(yt(t),(function(e){return dt.call(t,e)})))}:function(){return[]},bt=function(t){return null!=t&&"object"==typeof t},vt=function(t){return bt(t)&&"[object Arguments]"==I(t)};var gt=Object.prototype,ht=gt.hasOwnProperty,St=gt.propertyIsEnumerable,Ot=vt(function(){return arguments}())?vt:function(t){return bt(t)&&ht.call(t,"callee")&&!St.call(t,"callee")};const wt=Ot;var jt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Et=jt&&"object"==typeof module&&module&&!module.nodeType&&module,xt=Et&&Et.exports===jt?w.Buffer:void 0;const Pt=(xt?xt.isBuffer:void 0)||function(){return!1};var At=/^(?:0|[1-9]\d*)$/;const _t=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&At.test(t))&&t>-1&&t%1==0&&t<e},Ct=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var It={};It["[object Float32Array]"]=It["[object Float64Array]"]=It["[object Int8Array]"]=It["[object Int16Array]"]=It["[object Int32Array]"]=It["[object Uint8Array]"]=It["[object Uint8ClampedArray]"]=It["[object Uint16Array]"]=It["[object Uint32Array]"]=!0,It["[object Arguments]"]=It["[object Array]"]=It["[object ArrayBuffer]"]=It["[object Boolean]"]=It["[object DataView]"]=It["[object Date]"]=It["[object Error]"]=It["[object Function]"]=It["[object Map]"]=It["[object Number]"]=It["[object Object]"]=It["[object RegExp]"]=It["[object Set]"]=It["[object String]"]=It["[object WeakMap]"]=!1;var Mt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Rt=Mt&&"object"==typeof module&&module&&!module.nodeType&&module,Tt=Rt&&Rt.exports===Mt&&S.process,kt=function(){try{return Rt&&Rt.require&&Rt.require("util").types||Tt&&Tt.binding&&Tt.binding("util")}catch(t){}}(),Ut=kt&&kt.isTypedArray;const Dt=Ut?(Nt=Ut,function(t){return Nt(t)}):function(t){return bt(t)&&Ct(t.length)&&!!It[I(t)]};var Nt,Ft=Object.prototype.hasOwnProperty;const Lt=function(t,e){var n=pt(t),r=!n&&wt(t),o=!n&&!r&&Pt(t),u=!n&&!r&&!o&&Dt(t),i=n||r||o||u,a=i?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=a.length;for(var l in t)!e&&!Ft.call(t,l)||i&&("length"==l||o&&("offset"==l||"parent"==l)||u&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||_t(l,c))||a.push(l);return a};var Bt=Object.prototype;const zt=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object);var Vt=Object.prototype.hasOwnProperty;const $t=function(t){if(n=(e=t)&&e.constructor,e!==("function"==typeof n&&n.prototype||Bt))return zt(t);var e,n,r=[];for(var o in Object(t))Vt.call(t,o)&&"constructor"!=o&&r.push(o);return r},Gt=function(t){return null!=(e=t)&&Ct(e.length)&&!R(e)?Lt(t):$t(t);var e},Wt=function(t){return function(t,e,n){var r=e(t);return pt(t)?r:function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}(r,n(t))}(t,Gt,mt)};var Ht=Object.prototype.hasOwnProperty;const qt=W(w,"DataView"),Yt=W(w,"Promise"),Kt=W(w,"Set"),Jt=W(w,"WeakMap");var Zt="[object Map]",Qt="[object Promise]",Xt="[object Set]",te="[object WeakMap]",ee="[object DataView]",ne=N(qt),re=N(H),oe=N(Yt),ue=N(Kt),ie=N(Jt),ae=I;(qt&&ae(new qt(new ArrayBuffer(1)))!=ee||H&&ae(new H)!=Zt||Yt&&ae(Yt.resolve())!=Qt||Kt&&ae(new Kt)!=Xt||Jt&&ae(new Jt)!=te)&&(ae=function(t){var e=I(t),n="[object Object]"==e?t.constructor:void 0,r=n?N(n):"";if(r)switch(r){case ne:return ee;case re:return Zt;case oe:return Qt;case ue:return Xt;case ie:return te}return e});const ce=ae;var le="[object Arguments]",se="[object Array]",fe="[object Object]",pe=Object.prototype.hasOwnProperty;const de=function(t,e,n,r,o,u){var i=pt(t),a=pt(e),c=i?se:ce(t),l=a?se:ce(e),s=(c=c==le?fe:c)==fe,f=(l=l==le?fe:l)==fe,p=c==l;if(p&&Pt(t)){if(!Pt(e))return!1;i=!0,s=!1}if(p&&!s)return u||(u=new nt),i||Dt(t)?it(t,e,n,r,o,u):function(t,e,n,r,o,u,i){switch(n){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 at(t),new at(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return m(+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 a=ct;case"[object Set]":var c=1&r;if(a||(a=lt),t.size!=e.size&&!c)return!1;var l=i.get(t);if(l)return l==e;r|=2,i.set(t,e);var s=it(a(t),a(e),r,o,u,i);return i.delete(t),s;case"[object Symbol]":if(ft)return ft.call(t)==ft.call(e)}return!1}(t,e,c,n,r,o,u);if(!(1&n)){var d=s&&pe.call(t,"__wrapped__"),y=f&&pe.call(e,"__wrapped__");if(d||y){var b=d?t.value():t,v=y?e.value():e;return u||(u=new nt),o(b,v,n,r,u)}}return!!p&&(u||(u=new nt),function(t,e,n,r,o,u){var i=1&n,a=Wt(t),c=a.length;if(c!=Wt(e).length&&!i)return!1;for(var l=c;l--;){var s=a[l];if(!(i?s in e:Ht.call(e,s)))return!1}var f=u.get(t),p=u.get(e);if(f&&p)return f==e&&p==t;var d=!0;u.set(t,e),u.set(e,t);for(var y=i;++l<c;){var m=t[s=a[l]],b=e[s];if(r)var v=i?r(b,m,s,e,t,u):r(m,b,s,t,e,u);if(!(void 0===v?m===b||o(m,b,n,r,u):v)){d=!1;break}y||(y="constructor"==s)}if(d&&!y){var g=t.constructor,h=e.constructor;g==h||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof h&&h instanceof h||(d=!1)}return u.delete(t),u.delete(e),d}(t,e,n,r,o,u))},ye=function t(e,n,r,o,u){return e===n||(null==e||null==n||!bt(e)&&!bt(n)?e!=e&&n!=n:de(e,n,r,o,t,u))},me=function(t,e){return ye(t,e)};function be(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ve(e){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return be(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?be(t,e):void 0}}(t,e)||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,t.useState)([]),2),r=n[0],o=n[1];return(0,t.useEffect)((function(){var t=function(t){var n,u,i=null!==(u=null===(n=t.slots[e])||void 0===n?void 0:n.assignedExtensions)&&void 0!==u?u:[];me(i,r)||o(i)};return t((0,u.getExtensionStore)().getState()),(0,u.getExtensionStore)().subscribe(t)}),[e,r]),r}var ge=f(385);function he(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Se(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Oe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){Se(t,e,n[e])}))}return t}function we(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||Ee(t,e)||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(t){return function(t){if(Array.isArray(t))return he(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ee(t)||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.")}()}function Ee(t,e){if(t){if("string"==typeof t)return he(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?he(t,e):void 0}}function xe(t,e){var n=function(n){r[n]=function(){for(var r=arguments.length,o=new Array(r),u=0;u<r;u++)o[u]=arguments[u];t.setState((function(t){var r,u=[t].concat(je(o));return(r=e)[n].apply(r,je(u))}))}};"function"==typeof e&&(e=e(t));var r={};for(var o in e)n(o);return r}var Pe=function(t){return t};function Ae(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Pe,r=arguments.length>2?arguments[2]:void 0,o=we((0,t.useState)((function(){return n(e.getState())})),2),u=o[0],i=o[1];return(0,t.useEffect)((function(){return(0,ge.subscribeTo)(e,n,i)}),[e,n]),Oe({},u,(0,t.useMemo)((function(){return r?xe(e,r):{}}),[e,r]))}function _e(t,e){return Ae(t,Pe,e)}function Ce(e){return function(n){var r=we((0,t.useState)(e.getState()),2),o=r[0],u=r[1];return(0,t.useEffect)((function(){return e.subscribe((function(t){return u(t)}))}),[]),Oe({},o,(0,t.useMemo)((function(){return n?xe(e,n):{}}),[n]))}}var Ie=f(570);function Me(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Re(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Me(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Me(t,e):void 0}}(t,e)||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 Te(e){var n=y(),r=ve(e),o=Ae(Ie.featureFlagsStore),i=(0,t.useMemo)((function(){return Object.entries(o.flags).filter((function(t){return Re(t,2)[1].enabled})).map((function(t){return Re(t,1)[0]}))}),[o.flags]);return(0,t.useMemo)((function(){return(0,u.getConnectedExtensions)(r,n,i)}),[r,n,i])}function ke(n){var r=(0,t.useContext)(e).moduleName;if(!r)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,t.useEffect)((function(){(0,u.registerExtensionSlot)(r,n)}),[]),{extensions:Te(n),extensionSlotName:n,extensionSlotModuleName:r}}function Ue(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function De(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){Ue(t,e,n[e])}))}return t}function Ne(t){return t}function Fe(n){var r=n.name,o=n.extensionSlotName,u=n.select,i=void 0===u?Ne:u,a=n.children,c=n.state,s=n.style,f=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},u=Object.keys(t);for(r=0;r<u.length;r++)n=u[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(r=0;r<u.length;r++)n=u[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(n,["name","extensionSlotName","select","children","state","style"]);if(a&&c)throw new Error("Both children and state have been provided. If children are provided, the state must be passed as a prop to the `Extension` component.");var p,d,y,m,b=null!=r?r:o,v=(0,t.useRef)(null),g=ke(b),h=g.extensions,S=g.extensionSlotModuleName,O=(0,t.useMemo)((function(){return i(h)}),[i,h]),w=(0,t.useMemo)((function(){if("function"==typeof a&&!t.default.isValidElement(a))return O.map((function(t){return a(t)}))}),[a,O]);return t.default.createElement("div",De({ref:v,"data-extension-slot-name":b,"data-extension-slot-module-name":S,style:(y=De({},s),m={position:"relative"},m=null!=m?m:{},Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(m)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(m)).forEach((function(t){Object.defineProperty(y,t,Object.getOwnPropertyDescriptor(m,t))})),y)},f),b&&O.map((function(n,r){return t.default.createElement(e.Provider,{key:n.id,value:{moduleName:S,extension:{extensionId:n.id,extensionSlotName:b,extensionSlotModuleName:S}}},null!==(d=null!==(p=null==w?void 0:w[r])&&void 0!==p?p:"function"!=typeof a?a:null)&&void 0!==d?d:t.default.createElement(l,{state:c}))})))}var Le=f(766);function Be(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ze=function(e){var n=e.privilege,r=e.fallback,o=e.children,u=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Be(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Be(t,e):void 0}}(t,e)||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,t.useState)(null),2),i=u[0],a=u[1];return(0,t.useEffect)((function(){var t=(0,Le.getCurrentUser)({includeAuthStatus:!1}).subscribe(a);return function(){return t.unsubscribe()}}),[]),i&&(0,Le.userHasAccess)(n,i)?t.default.createElement(t.default.Fragment,null,o):r?t.default.createElement(t.default.Fragment,null,r):null},Ve=f(645);function $e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ge(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$e(Object(n),!0).forEach((function(e){He(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function We(t){return(We="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function He(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qe(t){return(qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ye(t,e){var n;if("function"!=typeof(n=e.domElement?function(){return e.domElement}:e.domElementGetter?e.domElementGetter:t.domElementGetter?t.domElementGetter:function(t){var e=t.appName||t.name;if(!e)throw Error("single-spa's dom-element-getter-helpers was not given an application name as a prop, so it can't make a unique dom element container for the react application");var n="single-spa-application:".concat(e);return function(){var t=document.getElementById(n);return t||((t=document.createElement("div")).id=n,document.body.appendChild(t)),t}}(e)))throw Error("single-spa's dom-element-getter-helpers was given an invalid domElementGetter for application or parcel '".concat(e.name,"'. Expected a function, received ").concat(qe(n)));return function(){var t=n(e);if(!(t instanceof HTMLElement))throw Error("single-spa's dom-element-getter-helpers: domElementGetter returned an invalid dom element for application or parcel '".concat(e.name,"'. Expected HTMLElement, received ").concat(qe(t)));return t}}var Ke=null;try{Ke=require("react").createContext()}catch($e){}var Je={React:null,ReactDOM:null,ReactDOMClient:null,rootComponent:null,loadRootComponent:null,renderType:"createRoot",errorBoundary:null,errorBoundaryClass:null,domElementGetter:null,parcelCanUpdate:!0,suppressComponentDidCatchWarning:!1,domElements:{},renderResults:{},updateResolves:{},unmountResolves:{}};function Ze(t){if("object"!==We(t))throw new Error("single-spa-react requires a configuration object");var e=Ge(Ge({},Je),t);if(!e.React)throw new Error("single-spa-react must be passed opts.React");if(!e.ReactDOM&&!e.ReactDOMClient)throw new Error("single-spa-react must be passed opts.ReactDOM or opts.ReactDOMClient");if(!e.rootComponent&&!e.loadRootComponent)throw new Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(e.errorBoundary&&"function"!=typeof e.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!Ke&&e.React.createContext&&(Ke=e.React.createContext()),e.SingleSpaRoot=function(t){function e(t){e.displayName="SingleSpaRoot(".concat(t.name,")")}return e.prototype=Object.create(t.React.Component.prototype),e.prototype.componentDidMount=function(){setTimeout(this.props.mountFinished)},e.prototype.componentWillUnmount=function(){setTimeout(this.props.unmountFinished)},e.prototype.render=function(){return setTimeout(this.props.updateFinished),this.props.children},e}(e);var n={bootstrap:Qe.bind(null,e),mount:Xe.bind(null,e),unmount:tn.bind(null,e)};return e.parcelCanUpdate&&(n.update=en.bind(null,e)),n}function Qe(t,e){return t.rootComponent?Promise.resolve():t.loadRootComponent(e).then((function(e){t.rootComponent=e}))}function Xe(t,e){return new Promise((function(n,r){t.suppressComponentDidCatchWarning||!function(t){if(!(t&&"string"==typeof t.version&&t.version.indexOf(".")>=0))return!1;var e=t.version.slice(0,t.version.indexOf("."));try{return Number(e)>=16}catch(t){return!1}}(t.React)||t.errorBoundary||t.errorBoundaryClass||(t.rootComponent.prototype?t.rootComponent.prototype.componentDidCatch||console.warn("single-spa-react: ".concat(e.name||e.appName||e.childAppName,"'s rootComponent should implement componentDidCatch to avoid accidentally unmounting the entire single-spa application.")):console.warn("single-spa-react: ".concat(e.name||e.appName||e.childAppName,"'s rootComponent does not implement an error boundary. If using a functional component, consider providing an opts.errorBoundary to singleSpaReact(opts).")));var o=on(t,e,(function(){n(this)})),u=Ye(t,e)(),i=function(t){var e=t.renderType,n=t.elementToRender,r=t.domElement,o=t.reactDom[e];if("function"!=typeof o)throw new Error('renderType "'.concat(e,'" did not return a function.'));switch(e){case"createRoot":case"unstable_createRoot":case"createBlockingRoot":case"unstable_createBlockingRoot":var u=o(r);return u.render(n),u;case"hydrateRoot":return o(r,n);default:return o(n,r),null}}({elementToRender:o,domElement:u,reactDom:nn(t),renderType:rn(t)});t.domElements[e.name]=u,t.renderResults[e.name]=i}))}function tn(t,e){return new Promise((function(n){t.unmountResolves[e.name]=n;var r=t.renderResults[e.name];r&&r.unmount?r.unmount():nn(t).unmountComponentAtNode(t.domElements[e.name]),delete t.domElements[e.name],delete t.renderResults[e.name]}))}function en(t,e){return new Promise((function(n){t.updateResolves[e.name]||(t.updateResolves[e.name]=[]),t.updateResolves[e.name].push(n);var r=on(t,e,null),o=t.renderResults[e.name];if(o&&o.render)o.render(r);else{var u=Ye(t,e)();nn(t).render(r,u)}}))}function nn(t){return t.ReactDOMClient||t.ReactDOM}function rn(t){return"function"==typeof t.renderType?t.renderType():t.renderType}function on(t,e,n){var r=t.React.createElement(t.rootComponent,e),o=Ke?t.React.createElement(Ke.Provider,{value:e},r):r;return(t.errorBoundary||e.errorBoundary||t.errorBoundaryClass||e.errorBoundaryClass)&&(t.errorBoundaryClass=t.errorBoundaryClass||e.errorBoundaryClass||function(t,e){function n(e){t.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},n.displayName="SingleSpaReactErrorBoundary(".concat(e.name,")")}return n.prototype=Object.create(t.React.Component.prototype),n.prototype.render=function(){return this.state.caughtError?(t.errorBoundary||e.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},n.prototype.componentDidCatch=function(t,e){this.setState({caughtError:t,caughtErrorInfo:e})},n}(t,e),o=t.React.createElement(t.errorBoundaryClass,e,o)),t.React.createElement(t.SingleSpaRoot,Ge(Ge({},e),{},{mountFinished:n,updateFinished:function(){t.updateResolves[e.name]&&(t.updateResolves[e.name].forEach((function(t){return t()})),delete t.updateResolves[e.name])},unmountFinished:function(){t.unmountResolves[e.name]&&(t.unmountResolves[e.name](),delete t.unmountResolves[e.name])}}),o)}var un=f(281);function an(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function cn(t){return cn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},cn(t)}function ln(t,e){return ln=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},ln(t,e)}function sn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=cn(t);if(e){var o=cn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(t,e){return!e||"object"!=((n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e;var n}(this,n)}}var fn={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1};function pn(n){if("object"!=typeof n||"string"!=typeof n.featureName||"string"!=typeof n.moduleName)throw new Error("Invalid options");var r=Object.assign({},fn,n);return function(n){var o,u,i,a;return u=o=function(o){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ln(t,e)}(c,o);var u,i,a=sn(c);function c(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(e=a.call(this,t)).state={caughtError:null,caughtErrorInfo:null,config:{moduleName:r.moduleName,extension:t._extensionContext}},e}return u=c,(i=[{key:"componentDidCatch",value:function(t,e){e&&e.componentStack&&(t.extra=Object.assign(t.extra||{},{componentStack:e.componentStack})),r.throwErrorsToConsole&&setTimeout((function(){throw t})),this.setState({caughtError:t,caughtErrorInfo:e})}},{key:"render",value:function(){if(this.state.caughtError)return t.default.createElement("div",null,"An error has occurred. Please try reloading the page.");var o=t.default.createElement(t.Suspense,{fallback:null},t.default.createElement(e.Provider,{value:this.state.config},r.disableTranslations?t.default.createElement(n,this.props):t.default.createElement(un.I18nextProvider,{i18n:window.i18next,defaultNS:r.moduleName},t.default.createElement(n,this.props))));return r.strictMode||!t.default.StrictMode?o:t.default.createElement(t.default.StrictMode,null,o)}}])&&an(u.prototype,i),c}(t.default.Component),i="displayName",a="OpenmrsReactComponent(".concat(r.featureName,")"),i in u?Object.defineProperty(u,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[i]=a,o}}function dn(e,n){return Ze({React:t.default,ReactDOMClient:Ve,rootComponent:pn(n)(e)})}function yn(t,e){return function(){return t().then((function(t){return dn(t.default,e)}))}}function mn(t,e){return function(){return Promise.resolve(dn(t,e))}}var bn=yn;function vn(){var e=(0,t.useRef)();return e.current&&!e.current.signal.aborted||(e.current=new AbortController),(0,t.useEffect)((function(){var t=e.current;return function(){return null==t?void 0:t.abort()}}),[]),e.current}const gn=vn;function hn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Sn(e){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return hn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hn(t,e):void 0}}(t,e)||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,t.useState)([]),2),r=n[0],o=n[1];return(0,t.useEffect)((function(){return(0,u.getExtensionStore)().subscribe((function(t){var n,u,i=null!==(u=null===(n=t.slots[e])||void 0===n?void 0:n.assignedExtensions.map((function(t){return t.id})))&&void 0!==u?u:[];me(i,r)||o(i)}))}),[]),r}var On=f(725);function wn(e,n){var r,o=(0,On.default)("".concat(Le.attachmentUrl,"?patient=").concat(e,"&includeEncounterless=").concat(n),Le.openmrsFetch),u=o.data,i=o.error,a=o.mutate,c=o.isLoading,l=o.isValidating;return(0,t.useMemo)((function(){return{isLoading:c,data:null!==(r=null==u?void 0:u.data.results)&&void 0!==r?r:[],error:i,mutate:a,isValidating:l}}),[u,i,c,l,a])}function jn(e){(0,t.useEffect)((function(){if(e){var t=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=t}}}),[e])}function En(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function xn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){xn(t,e,n[e])}))}return t}function An(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return En(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?En(t,e):void 0}}(t,e)||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 _n={},Cn='No ComponentContext has been provided. This should come from "openmrsComponentDecorator".\nUsually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".';function In(e){var r=(0,t.useMemo)(n.getExtensionsConfigStore,[]),o=function(e,r){var o=An((0,t.useState)(function(t,e){return e?function(){var r=t.getState(),o=(0,n.getExtensionConfigFromStore)(r,e.extensionSlotName,e.extensionId);if(o.loaded&&o.config)return o.config}:null}(e,r)),2),u=o[0],i=o[1];return(0,t.useEffect)((function(){if(r)return e.subscribe((function(t){var e=(0,n.getExtensionConfigFromStore)(t,r.extensionSlotName,r.extensionId);e.loaded&&e.config&&!me(e.config,u)&&i(e.config)}))}),[e,r,u]),u}(r,e);if(!o&&e){var u="".concat(e.extensionSlotName,"-").concat(e.extensionId);throw!_n[u]&&r&&(_n[u]=function(t,e){return new Promise((function(r){var o=t.subscribe((function(t){var u=(0,n.getExtensionConfigFromStore)(t,e.extensionSlotName,e.extensionId);u.loaded&&u.config&&(r(u.config),o())}))}))}(r,e)),_n[u]}return o||{}}function Mn(r){var o,u=(0,t.useContext)(e),i=u.moduleName,a=u.extension,c=null!==(o=null==r?void 0:r.externalModuleName)&&void 0!==o?o:i;if(!c&&!a)throw Error(Cn);var l=function(e){var r=(0,t.useMemo)((function(){return(0,n.getConfigStore)(e)}),[e]),o=e,u=function(e){var n=An((0,t.useState)(function(t){return function(){var e=t.getState();return e.loaded&&e.config?e.config:null}}(e)),2),r=n[0],o=n[1];return(0,t.useEffect)((function(){return null==e?void 0:e.subscribe((function(t){t.loaded&&t.config&&o(t.config)}))}),[e]),r}(r);if(!u)throw _n[o]||(_n[o]=function(t){return new Promise((function(e){var n=t.subscribe((function(t){t.loaded&&t.config&&(e(t.config),n())}))}))}(r)),_n[o];return u}(c),s=In(a);return(0,t.useMemo)((function(){return(null==r?void 0:r.externalModuleName)&&c===r.externalModuleName?Pn({},l):Pn({},l,s)}),[c,null==r?void 0:r.externalModuleName,l,s])}function Rn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Tn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,r=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Rn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rn(t,e):void 0}}(t,e)||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,t.useState)(e),2),o=r[0],u=r[1];return(0,t.useEffect)((function(){var t=setTimeout((function(){u(e)}),n);return function(){clearTimeout(t)}}),[e,n]),o}var kn=Ce((0,u.getExtensionInternalStore)());function Un(e){var n=Te(e);return(0,t.useMemo)((function(){return Object.fromEntries(n.map((function(t){return[t.name,t.meta]})))}),[n])}var Dn=Ce((0,u.getExtensionStore)());function Nn(e){var n,r=Ae(Ie.featureFlagsStore).flags;return(0,t.useEffect)((function(){r[e]||console.error('useFeatureFlag: Attempted to get value of non-existent flag "'.concat(e,'". Did you forget to call registerFeatureFlag?'))}),[r[e]]),null===(n=r[e])||void 0===n?void 0:n.enabled}function Fn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ln(){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Fn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fn(t,e):void 0}}(t,e)||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,t.useState)(0),2)[1];return(0,t.useCallback)((function(){e((function(t){return t+1}))}),[])}function Bn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function zn(){var t="tablet";return document.body.classList.forEach((function(e){switch(e){case"omrs-breakpoint-lt-tablet":t="phone";break;case"omrs-breakpoint-gt-small-desktop":t="large-desktop";break;case"omrs-breakpoint-gt-tablet":t="small-desktop"}})),t}function Vn(){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Bn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bn(t,e):void 0}}(t,e)||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,t.useState)(zn),2),n=e[0],r=e[1];return(0,t.useEffect)((function(){var t=function(){r(zn())};return window.addEventListener("resize",t),function(){return window.removeEventListener("resize",t)}}),[]),n}var $n,Gn=function(t){return"small-desktop"===t||"large-desktop"===t};function Wn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Hn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Wn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wn(t,e):void 0}}(t,e)||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,t.useState)([]),2),r=n[0],o=n[1];return(0,t.useEffect)((function(){var t=(0,Le.getLocations)(e).subscribe((function(t){o(t)}),(function(t){console.error(t)}));return function(){return t.unsubscribe()}}),[]),r}function qn(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=(0,t.useRef)(null);return(0,t.useEffect)((function(){if(n){var t=function(t){var n;(null==r||null===(n=r.current)||void 0===n?void 0:n.contains(t.target))||e(t)};return window.addEventListener("click",t),function(){return window.removeEventListener("click",t)}}}),[e,n]),r}function Yn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Kn(e){var n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=o.abortController,i=o.fetchInit,a=o.url,c=o.swrConfig,l=gn(),s=(0,t.useMemo)((function(){return null!==(r=null!==(n=null==i?void 0:i.signal)&&void 0!==n?n:null==u?void 0:u.signal)&&void 0!==r?r:l.signal}),[null==u?void 0:u.signal,null==i?void 0:i.signal,l.signal]),f=(0,t.useCallback)((function(t){var e,n,r=function(t,e){if(e)return"function"==typeof e?e(t):e;if("string"==typeof t)return t;throw new Error("When using useOpenmrsSWR with a key that is not a string, you must provide a url() function that converts the key to a valid url. The key for this hook is ".concat(t,"."))}(t,a);return(0,Le.openmrsFetch)(r,(e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){Yn(t,e,n[e])}))}return t}({},i),n=null!=(n={signal:s})?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})),e))}),[s,i,a]);return(0,On.default)(e,f,c)}function Jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Zn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){Zn(t,e,n[e])}))}return t}function Xn(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t}!function(t){t.loadPatient="loadPatient",t.newPatient="newPatient",t.loadError="patientLoadError"}($n||($n={}));var tr,er={patientUuid:null,patient:null,isPendingUuid:!0,isLoadingPatient:!1,err:null};function nr(){var t=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return t&&t[1]}function rr(t,e){switch(e.type){case $n.loadPatient:return Xn(Qn({},t),{patientUuid:e.patientUuid,patient:null,isPendingUuid:!1,isLoadingPatient:!0,err:null});case $n.newPatient:return Xn(Qn({},t),{patient:e.patient,isPendingUuid:!1,isLoadingPatient:!1,err:null});case $n.loadError:return Xn(Qn({},t),{patient:null,isPendingUuid:!1,isLoadingPatient:!1,err:e.err});default:return t}}function or(e){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Jn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jn(t,e):void 0}}(t,e)||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,t.useReducer)(rr,Xn(Qn({},er),{patientUuid:null!=e?e:null,isPendingUuid:!e,isLoadingPatient:!!e})),2),r=n[0],o=n[1];return(0,t.useEffect)((function(){if(r.isPendingUuid){var t=nr();o(t?{type:$n.loadPatient,patientUuid:t}:{type:$n.newPatient,patient:null})}var e=!0;return r.isLoadingPatient&&r.patientUuid&&(0,Le.fetchCurrentPatient)(r.patientUuid).then((function(t){return e&&o({patient:t,type:$n.newPatient})}),(function(t){return e&&o({err:t,type:$n.loadError})})),function(){e=!1}}),[r.isPendingUuid,r.isLoadingPatient,r.patientUuid]),(0,t.useEffect)((function(){var t=function(t){var e=nr();e!=r.patientUuid&&o({type:$n.loadPatient,patientUuid:e})};return window.addEventListener("single-spa:routing-event",t),function(){return window.removeEventListener("single-spa:routing-event",t)}}),[r.patientUuid]),{isLoading:r.isPendingUuid||r.isLoadingPatient,patient:r.patient,patientUuid:null!=e?e:r.patientUuid,error:r.err}}function ur(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ir(){var e=(0,t.useRef)(),n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ur(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ur(t,e):void 0}}(t,e)||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,t.useState)(null),2),r=n[0],o=n[1],u=null;if(!r){if(tr){var i=(0,Le.getSessionStore)().getState();i.loaded&&(u=i.session)}else tr=new Promise((function(t){var n=function(n){var r=n.loaded,o=n.session;r&&(t(o),u=o,e.current&&e.current(),e.current=void 0)};n((0,Le.getSessionStore)().getState()),u||(e.current=(0,Le.getSessionStore)().subscribe(n))}));if(!u)throw tr;o(u)}(0,t.useEffect)((function(){return e.current||(e.current=(0,Le.getSessionStore)().subscribe((function(t){var e=t.loaded,n=t.session;e&&(u=n,o(n))}))),function(){e.current&&e.current(),e.current=void 0}}),[]);var a=r||u;if(!a)throw tr?(console.warn("useSession is in an unexpected state. Attempting to recover."),tr):Error("useSession is in an invalid state.");return a}var ar=f(688),cr=f(332),lr=f.n(cr);function sr(e){var n,r=Ae((0,Le.getVisitStore)()),o=r.patientUuid,u=r.manuallySetVisitUuid,i=e&&o==e?u:null,a="?patient=".concat(e,"&v=").concat(Le.defaultVisitCustomRepresentation,"&includeInactive=false"),c="/".concat(i),l=(0,On.default)(e?"/ws/rest/v1/visit".concat(a):null,Le.openmrsFetch),s=l.data,f=l.error,p=l.mutate,d=l.isValidating,y=(0,On.default)(e&&i?"/ws/rest/v1/visit".concat(c):null,Le.openmrsFetch),m=y.data,b=y.error,v=y.mutate,g=y.isValidating,h=(0,t.useMemo)((function(){return null!==(n=null==s?void 0:s.data.results.find((function(t){return null===t.stopDatetime})))&&void 0!==n?n:null}),[s]),S=(0,t.useMemo)((function(){return i?null==m?void 0:m.data:null!=h?h:null}),[m,h,i]);return{error:f||b,mutate:function(){p(),v()},isValidating:d||g,activeVisit:h,currentVisit:S,currentVisitIsRetrospective:Boolean(i),isLoading:Boolean((!s||i&&!m)&&(!f||!b))}}function fr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function pr(){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return fr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fr(t,e):void 0}}(t,e)||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,t.useState)([]),2),n=e[0],r=e[1];return(0,t.useEffect)((function(){var t=(0,Le.getVisitTypes)().subscribe((function(t){r(t)}),(function(t){return console.error(t)}));return function(){return t.unsubscribe()}}),[]),n}function dr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}ar.default.extend(lr());var yr=10;function mr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yr,r=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,u=[],i=!0,a=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(u.push(r.value),!e||u.length!==e);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return dr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dr(t,e):void 0}}(t,e)||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,t.useState)(1),2),o=r[0],u=r[1],i=(0,t.useMemo)((function(){return"number"==typeof n&&n>0?Math.max(1,Math.ceil(e.length/n)):1}),[e.length,n]),a=(0,t.useMemo)((function(){var t=(o-1)*n,r=(o+0)*n;return e.slice(t,r)}),[e,o,n]),c=(0,t.useCallback)((function(t){u(Math.max(1,Math.min(i,t)))}),[u,i]),l=(0,t.useCallback)((function(){o<i&&u(o+1)}),[o,i,u]),s=(0,t.useCallback)((function(){o>1&&u(o-1)}),[o,u]);return(0,t.useMemo)((function(){return{results:a,totalPages:i,currentPage:o,paginated:e.length>n,showNextButton:o<i,showPreviousButton:o>1,goTo:c,goToNext:l,goToPrevious:s}}),[a,i,e.length,n,o,c,l,s])}})(),p})())}}}));
2
2
  //# sourceMappingURL=openmrs-esm-react-utils.js.map