@openmrs/esm-cohort-builder-app 3.0.1-pre.102

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.
Files changed (99) hide show
  1. package/LICENSE +401 -0
  2. package/README.md +16 -0
  3. package/dist/241.js +2 -0
  4. package/dist/241.js.LICENSE.txt +27 -0
  5. package/dist/247.js +1 -0
  6. package/dist/255.js +1 -0
  7. package/dist/285.js +1 -0
  8. package/dist/294.js +2 -0
  9. package/dist/294.js.LICENSE.txt +9 -0
  10. package/dist/374.js +1 -0
  11. package/dist/484.js +1 -0
  12. package/dist/508.js +2 -0
  13. package/dist/508.js.LICENSE.txt +14 -0
  14. package/dist/574.js +1 -0
  15. package/dist/595.js +2 -0
  16. package/dist/595.js.LICENSE.txt +3 -0
  17. package/dist/935.js +2 -0
  18. package/dist/935.js.LICENSE.txt +19 -0
  19. package/dist/main.js +1 -0
  20. package/dist/openmrs-esm-cohort-builder-app.js +1 -0
  21. package/dist/openmrs-esm-cohort-builder-app.js.buildmanifest.json +376 -0
  22. package/dist/openmrs-esm-cohort-builder-app.old +1 -0
  23. package/package.json +93 -0
  24. package/src/cohort-builder-app-menu-link.tsx +14 -0
  25. package/src/cohort-builder.resources.ts +84 -0
  26. package/src/cohort-builder.scss +126 -0
  27. package/src/cohort-builder.test.tsx +12 -0
  28. package/src/cohort-builder.tsx +213 -0
  29. package/src/cohort-builder.utils.ts +197 -0
  30. package/src/components/composition/composition.component.tsx +109 -0
  31. package/src/components/composition/composition.style.css +3 -0
  32. package/src/components/composition/composition.test.tsx +112 -0
  33. package/src/components/composition/composition.utils.ts +53 -0
  34. package/src/components/empty-data/empty-data.component.tsx +25 -0
  35. package/src/components/empty-data/empty-data.style.scss +20 -0
  36. package/src/components/saved-cohorts/saved-cohorts-options/saved-cohort-options.test.tsx +49 -0
  37. package/src/components/saved-cohorts/saved-cohorts-options/saved-cohorts-options.component.tsx +112 -0
  38. package/src/components/saved-cohorts/saved-cohorts.component.tsx +139 -0
  39. package/src/components/saved-cohorts/saved-cohorts.resources.ts +39 -0
  40. package/src/components/saved-cohorts/saved-cohorts.scss +15 -0
  41. package/src/components/saved-cohorts/saved-cohorts.test.tsx +51 -0
  42. package/src/components/saved-queries/saved-queries-options/saved-queries-options.component.tsx +112 -0
  43. package/src/components/saved-queries/saved-queries-options/saved-queries-options.test.tsx +47 -0
  44. package/src/components/saved-queries/saved-queries.component.tsx +139 -0
  45. package/src/components/saved-queries/saved-queries.resources.ts +39 -0
  46. package/src/components/saved-queries/saved-queries.scss +23 -0
  47. package/src/components/saved-queries/saved-queries.test.tsx +50 -0
  48. package/src/components/search-button-set/search-button-set.css +9 -0
  49. package/src/components/search-button-set/search-button-set.test.tsx +26 -0
  50. package/src/components/search-button-set/search-button-set.tsx +47 -0
  51. package/src/components/search-by-concepts/search-by-concepts.component.tsx +344 -0
  52. package/src/components/search-by-concepts/search-by-concepts.style.scss +48 -0
  53. package/src/components/search-by-concepts/search-by-concepts.test.tsx +129 -0
  54. package/src/components/search-by-concepts/search-concept/search-concept.component.tsx +130 -0
  55. package/src/components/search-by-concepts/search-concept/search-concept.resource.ts +53 -0
  56. package/src/components/search-by-concepts/search-concept/search-concept.style.css +25 -0
  57. package/src/components/search-by-concepts/search-concept/search-concept.test.tsx +89 -0
  58. package/src/components/search-by-demographics/search-by-demographics.component.tsx +209 -0
  59. package/src/components/search-by-demographics/search-by-demographics.style.scss +42 -0
  60. package/src/components/search-by-demographics/search-by-demographics.test.tsx +92 -0
  61. package/src/components/search-by-demographics/search-by-demographics.utils.ts +129 -0
  62. package/src/components/search-by-drug-orders/search-by-drug-orders.component.tsx +185 -0
  63. package/src/components/search-by-drug-orders/search-by-drug-orders.resources.ts +60 -0
  64. package/src/components/search-by-drug-orders/search-by-drug-orders.style.scss +4 -0
  65. package/src/components/search-by-drug-orders/search-by-drug-orders.test.tsx +159 -0
  66. package/src/components/search-by-drug-orders/search-by-drug-orders.utils.ts +118 -0
  67. package/src/components/search-by-encounters/search-by-encounters.component.tsx +188 -0
  68. package/src/components/search-by-encounters/search-by-encounters.resources.ts +51 -0
  69. package/src/components/search-by-encounters/search-by-encounters.style.scss +12 -0
  70. package/src/components/search-by-encounters/search-by-encounters.test.tsx +202 -0
  71. package/src/components/search-by-encounters/search-by-encounters.utils.ts +113 -0
  72. package/src/components/search-by-enrollments/search-by-enrollments.component.tsx +183 -0
  73. package/src/components/search-by-enrollments/search-by-enrollments.resources.ts +31 -0
  74. package/src/components/search-by-enrollments/search-by-enrollments.style.scss +4 -0
  75. package/src/components/search-by-enrollments/search-by-enrollments.test.tsx +158 -0
  76. package/src/components/search-by-enrollments/search-by-enrollments.utils.ts +69 -0
  77. package/src/components/search-by-location/search-by-location.component.tsx +97 -0
  78. package/src/components/search-by-location/search-by-location.style.scss +4 -0
  79. package/src/components/search-by-location/search-by-location.test.tsx +110 -0
  80. package/src/components/search-by-location/search-by-location.utils.ts +40 -0
  81. package/src/components/search-by-person-attributes/search-by-person-attributes.component.tsx +90 -0
  82. package/src/components/search-by-person-attributes/search-by-person-attributes.resource.ts +27 -0
  83. package/src/components/search-by-person-attributes/search-by-person-attributes.style.scss +4 -0
  84. package/src/components/search-by-person-attributes/search-by-person-attributes.test.tsx +133 -0
  85. package/src/components/search-by-person-attributes/search-by-person-attributes.utils.ts +42 -0
  86. package/src/components/search-history/search-history-options/search-history-options.component.tsx +290 -0
  87. package/src/components/search-history/search-history-options/search-history-options.resources.ts +29 -0
  88. package/src/components/search-history/search-history-options/search-history-options.test.tsx +144 -0
  89. package/src/components/search-history/search-history.component.tsx +174 -0
  90. package/src/components/search-history/search-history.style.scss +12 -0
  91. package/src/components/search-history/search-history.test.tsx +106 -0
  92. package/src/components/search-history/search-history.utils.ts +14 -0
  93. package/src/components/search-results-table/search-results-table.component.tsx +105 -0
  94. package/src/components/search-results-table/search-results-table.scss +4 -0
  95. package/src/components/search-results-table/search-results-table.test.tsx +47 -0
  96. package/src/declarations.d.tsx +2 -0
  97. package/src/index.ts +47 -0
  98. package/src/setup-tests.ts +1 -0
  99. package/src/types/index.ts +120 -0
@@ -0,0 +1,27 @@
1
+ /*!
2
+ Copyright (c) 2018 Jed Watson.
3
+ Licensed under the MIT License (MIT), see
4
+ http://jedwatson.github.io/classnames
5
+ */
6
+
7
+ /*! *****************************************************************************
8
+ Copyright (c) Microsoft Corporation.
9
+ Permission to use, copy, modify, and/or distribute this software for any
10
+ purpose with or without fee is hereby granted.
11
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17
+ PERFORMANCE OF THIS SOFTWARE.
18
+ ***************************************************************************** */
19
+
20
+ /** @license React v16.13.1
21
+ * react-is.production.min.js
22
+ *
23
+ * Copyright (c) Facebook, Inc. and its affiliates.
24
+ *
25
+ * This source code is licensed under the MIT license found in the
26
+ * LICENSE file in the root directory of this source tree.
27
+ */
package/dist/247.js ADDED
@@ -0,0 +1 @@
1
+ (self.webpackChunk_openmrs_esm_cohort_builder_app=self.webpackChunk_openmrs_esm_cohort_builder_app||[]).push([[247],{8247:(e,n,t)=>{"use strict";t.r(n),t.d(n,{I18nContext:()=>S,I18nextProvider:()=>ue,Trans:()=>J,Translation:()=>se,composeInitialProps:()=>T,date:()=>ge,getDefaults:()=>N,getI18n:()=>D,getInitialProps:()=>A,initReactI18next:()=>R,number:()=>me,plural:()=>be,select:()=>he,selectOrdinal:()=>ve,setDefaults:()=>k,setI18n:()=>C,time:()=>ye,useSSR:()=>le,useTranslation:()=>te,withSSR:()=>de,withTranslation:()=>ae});var r=t(3366);function o(e,n){if(null==e)return{};var t,o,i=(0,r.Z)(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)t=a[o],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var c=t(1672),s=t(1739),u=t.n(s),l=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function p(e){var n={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},t=e.match(/<\/?([^\s]+?)[/\s>]/);if(t&&(n.name=t[1],(u()[t[1]]||"/"===e.charAt(e.length-2))&&(n.voidElement=!0),n.name.startsWith("!--"))){var r=e.indexOf("--\x3e");return{type:"comment",comment:-1!==r?e.slice(4,r):""}}for(var o=new RegExp(l),i=null;null!==(i=o.exec(e));)if(i[0].trim())if(i[1]){var a=i[1].trim(),c=[a,""];a.indexOf("=")>-1&&(c=a.split("=")),n.attrs[c[0]]=c[1],o.lastIndex--}else i[2]&&(n.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return n}var f=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,d=/^\s*$/,g=Object.create(null);function y(e,n){switch(n.type){case"text":return e+n.content;case"tag":return e+="<"+n.name+(n.attrs?function(e){var n=[];for(var t in e)n.push(t+'="'+e[t]+'"');return n.length?" "+n.join(" "):""}(n.attrs):"")+(n.voidElement?"/>":">"),n.voidElement?e:e+n.children.reduce(y,"")+"</"+n.name+">";case"comment":return e+"\x3c!--"+n.comment+"--\x3e"}}var m={parse:function(e,n){n||(n={}),n.components||(n.components=g);var t,r=[],o=[],i=-1,a=!1;if(0!==e.indexOf("<")){var c=e.indexOf("<");r.push({type:"text",content:-1===c?e:e.substring(0,c)})}return e.replace(f,(function(c,s){if(a){if(c!=="</"+t.name+">")return;a=!1}var u,l="/"!==c.charAt(1),f=c.startsWith("\x3c!--"),g=s+c.length,y=e.charAt(g);if(f){var m=p(c);return i<0?(r.push(m),r):((u=o[i]).children.push(m),r)}if(l&&(i++,"tag"===(t=p(c)).type&&n.components[t.name]&&(t.type="component",a=!0),t.voidElement||a||!y||"<"===y||t.children.push({type:"text",content:e.slice(g,e.indexOf("<",g))}),0===i&&r.push(t),(u=o[i-1])&&u.children.push(t),o[i]=t),(!l||t.voidElement)&&(i>-1&&(t.voidElement||t.name===c.slice(2,-1))&&(i--,t=-1===i?r:o[i]),!a&&"<"!==y&&y)){u=-1===i?r:o[i].children;var h=e.indexOf("<",g),b=e.slice(g,-1===h?void 0:h);d.test(b)&&(b=" "),(h>-1&&i+u.length>=0||" "!==b)&&u.push({type:"text",content:b})}})),r},stringify:function(e){return e.reduce((function(e,n){return e+y("",n)}),"")}};const h=m;function b(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var v=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230);/g,O={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…"},j=function(e){return O[e]};function w(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function P(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?w(Object(t),!0).forEach((function(n){a(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var E,x={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(v,j)}},S=(0,c.createContext)();function k(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};x=P(P({},x),e)}function N(){return x}var I=function(){function e(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),this.usedNamespaces={}}var n,t;return n=e,(t=[{key:"addUsedNamespaces",value:function(e){var n=this;e.forEach((function(e){n.usedNamespaces[e]||(n.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}])&&b(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),e}();function C(e){E=e}function D(){return E}var R={type:"3rdParty",init:function(e){k(e.options.react),C(e)}};function T(e){return function(n){return new Promise((function(t){var r=A();e.getInitialProps?e.getInitialProps(n).then((function(e){t(P(P({},e),r))})):t(r)}))}}function A(){var e=D(),n=e.reportNamespaces?e.reportNamespaces.getUsedNamespaces():[],t={},r={};return e.languages.forEach((function(t){r[t]={},n.forEach((function(n){r[t][n]=e.getResourceBundle(t,n)||{}}))})),t.initialI18nStore=r,t.initialLanguage=e.language,t}function L(){if(console&&console.warn){for(var e,n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];"string"==typeof t[0]&&(t[0]="react-i18next:: ".concat(t[0])),(e=console).warn.apply(e,t)}}var z={};function B(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];"string"==typeof n[0]&&z[n[0]]||("string"==typeof n[0]&&(z[n[0]]=new Date),L.apply(void 0,n))}function _(e,n,t){e.loadNamespaces(n,(function(){e.isInitialized?t():e.on("initialized",(function n(){setTimeout((function(){e.off("initialized",n)}),0),t()}))}))}function U(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.languages[0],o=!!n.options&&n.options.fallbackLng,i=n.languages[n.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,t){var r=n.services.backendConnector.state["".concat(e,"|").concat(t)];return-1===r||2===r};return!(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!a(n.isLanguageChangingTo,e)||!n.hasResourceBundle(r,e)&&n.services.backendConnector.backend&&(!n.options.resources||n.options.partialBundledLanguages)&&(!a(r,e)||o&&!a(i,e)))}function H(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n.languages||!n.languages.length)return B("i18n.languages were undefined or empty",n.languages),!0;var r=void 0!==n.options.ignoreJSONStructure;return r?n.hasLoadedNamespace(e,{precheck:function(n,r){if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!r(n.isLanguageChangingTo,e))return!1}}):U(e,n,t)}function K(e){return e.displayName||e.name||("string"==typeof e&&e.length>0?e:"Unknown")}var V=["format"],F=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function W(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function M(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?W(Object(t),!0).forEach((function(n){a(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):W(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function $(e,n){if(!e)return!1;var t=e.props?e.props.children:e.children;return n?t.length>0:!!t}function Z(e){return e?e.props?e.props.children:e.children:[]}function q(e){return Array.isArray(e)?e:[e]}function Y(e,n){if(!e)return"";var t="",r=q(e),a=n.transSupportBasicHtmlNodes&&n.transKeepBasicHtmlNodesFor?n.transKeepBasicHtmlNodesFor:[];return r.forEach((function(e,r){if("string"==typeof e)t+="".concat(e);else if((0,c.isValidElement)(e)){var s=Object.keys(e.props).length,u=a.indexOf(e.type)>-1,l=e.props.children;if(!l&&u&&0===s)t+="<".concat(e.type,"/>");else if(l||u&&0===s)if(e.props.i18nIsDynamicList)t+="<".concat(r,"></").concat(r,">");else if(u&&1===s&&"string"==typeof l)t+="<".concat(e.type,">").concat(l,"</").concat(e.type,">");else{var p=Y(l,n);t+="<".concat(r,">").concat(p,"</").concat(r,">")}else t+="<".concat(r,"></").concat(r,">")}else if(null===e)L("Trans: the passed in value is invalid - seems you passed in a null child.");else if("object"===i(e)){var f=e.format,d=o(e,V),g=Object.keys(d);if(1===g.length){var y=f?"".concat(g[0],", ").concat(f):g[0];t+="{{".concat(y,"}}")}else L("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",e)}else L("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",e)})),t}function J(e){var n=e.children,t=e.count,r=e.parent,a=e.i18nKey,s=e.context,u=e.tOptions,l=void 0===u?{}:u,p=e.values,f=e.defaults,d=e.components,g=e.ns,y=e.i18n,m=e.t,b=e.shouldUnescape,v=o(e,F),O=(0,c.useContext)(S)||{},j=O.i18n,w=O.defaultNS,P=y||j||D();if(!P)return B("You will need to pass in an i18next instance by using i18nextReactModule"),n;var E=m||P.t.bind(P)||function(e){return e};s&&(l.context=s);var x=M(M({},N()),P.options&&P.options.react),k=g||E.ns||w||P.options&&P.options.defaultNS;k="string"==typeof k?[k]:k||["translation"];var I=f||Y(n,x)||x.transEmptyNodeValue||a,C=x.hashTransKey,R=a||(C?C(I):I),T=p?l.interpolation:{interpolation:M(M({},l.interpolation),{},{prefix:"#$?",suffix:"?$#"})},A=M(M(M(M({},l),{},{count:t},p),T),{},{defaultValue:I,ns:k}),L=function(e,n,t,r,o,a){if(""===n)return[];var s=r.transKeepBasicHtmlNodesFor||[],u=n&&new RegExp(s.join("|")).test(n);if(!e&&!u)return[n];var l={};!function e(n){q(n).forEach((function(n){"string"!=typeof n&&($(n)?e(Z(n)):"object"!==i(n)||(0,c.isValidElement)(n)||Object.assign(l,n))}))}(e);var p=h.parse("<0>".concat(n,"</0>")),f=M(M({},l),o);function d(e,n,t){var r=Z(e),o=y(r,n.children,t);return function(e){return"[object Array]"===Object.prototype.toString.call(e)&&e.every((function(e){return(0,c.isValidElement)(e)}))}(r)&&0===o.length?r:o}function g(e,n,t,r,o){e.dummy&&(e.children=n),t.push((0,c.cloneElement)(e,M(M({},e.props),{},{key:r}),o?void 0:n))}function y(n,o,l){var p=q(n);return q(o).reduce((function(n,o,m){var h,b,v,O=o.children&&o.children[0]&&o.children[0].content&&t.services.interpolator.interpolate(o.children[0].content,f,t.language);if("tag"===o.type){var j=p[parseInt(o.name,10)];!j&&1===l.length&&l[0][o.name]&&(j=l[0][o.name]),j||(j={});var w=0!==Object.keys(o.attrs).length?(h={props:o.attrs},(v=M({},b=j)).props=Object.assign(h.props,b.props),v):j,P=(0,c.isValidElement)(w),E=P&&$(o,!0)&&!o.voidElement,x=u&&"object"===i(w)&&w.dummy&&!P,S="object"===i(e)&&null!==e&&Object.hasOwnProperty.call(e,o.name);if("string"==typeof w){var k=t.services.interpolator.interpolate(w,f,t.language);n.push(k)}else if($(w)||E)g(w,d(w,o,l),n,m);else if(x){var N=y(p,o.children,l);n.push((0,c.cloneElement)(w,M(M({},w.props),{},{key:m}),N))}else if(Number.isNaN(parseFloat(o.name)))if(S)g(w,d(w,o,l),n,m,o.voidElement);else if(r.transSupportBasicHtmlNodes&&s.indexOf(o.name)>-1)if(o.voidElement)n.push((0,c.createElement)(o.name,{key:"".concat(o.name,"-").concat(m)}));else{var I=y(p,o.children,l);n.push((0,c.createElement)(o.name,{key:"".concat(o.name,"-").concat(m)},I))}else if(o.voidElement)n.push("<".concat(o.name," />"));else{var C=y(p,o.children,l);n.push("<".concat(o.name,">").concat(C,"</").concat(o.name,">"))}else if("object"!==i(w)||P)1===o.children.length&&O?n.push((0,c.cloneElement)(w,M(M({},w.props),{},{key:m}),O)):n.push((0,c.cloneElement)(w,M(M({},w.props),{},{key:m})));else{var D=o.children[0]?O:null;D&&n.push(D)}}else if("text"===o.type){var R=r.transWrapTextNodes,T=a?r.unescape(t.services.interpolator.interpolate(o.content,f,t.language)):t.services.interpolator.interpolate(o.content,f,t.language);R?n.push((0,c.createElement)(R,{key:"".concat(o.name,"-").concat(m)},T)):n.push(T)}return n}),[])}return Z(y([{dummy:!0,children:e||[]}],p,q(e||[]))[0])}(d||n,R?E(R,A):I,P,x,A,b),z=void 0!==r?r:x.defaultTransParent;return z?(0,c.createElement)(z,v,L):L}function G(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function Q(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i=[],a=!0,c=!1;try{for(t=t.call(e);!(a=(r=t.next()).done)&&(i.push(r.value),!n||i.length!==n);a=!0);}catch(e){c=!0,o=e}finally{try{a||null==t.return||t.return()}finally{if(c)throw o}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return G(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?G(e,n):void 0}}(e,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.")}()}function X(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function ee(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?X(Object(t),!0).forEach((function(n){a(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):X(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ne=function(e,n){var t=(0,c.useRef)();return(0,c.useEffect)((function(){t.current=n?t.current:e}),[e,n]),t.current};function te(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.i18n,r=(0,c.useContext)(S)||{},o=r.i18n,i=r.defaultNS,a=t||o||D();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new I),!a){B("You will need to pass in an i18next instance by using initReactI18next");var s=function(e){return Array.isArray(e)?e[e.length-1]:e},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}a.options.react&&void 0!==a.options.react.wait&&B("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var l=ee(ee(ee({},N()),a.options.react),n),p=l.useSuspense,f=l.keyPrefix,d=e||i||a.options&&a.options.defaultNS;d="string"==typeof d?[d]:d||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(d);var g=(a.isInitialized||a.initializedStoreOnce)&&d.every((function(e){return H(e,a,l)}));function y(){return a.getFixedT(null,"fallback"===l.nsMode?d:d[0],f)}var m=(0,c.useState)(y),h=Q(m,2),b=h[0],v=h[1],O=d.join(),j=ne(O),w=(0,c.useRef)(!0);(0,c.useEffect)((function(){var e=l.bindI18n,n=l.bindI18nStore;function t(){w.current&&v(y)}return w.current=!0,g||p||_(a,d,(function(){w.current&&v(y)})),g&&j&&j!==O&&w.current&&v(y),e&&a&&a.on(e,t),n&&a&&a.store.on(n,t),function(){w.current=!1,e&&a&&e.split(" ").forEach((function(e){return a.off(e,t)})),n&&a&&n.split(" ").forEach((function(e){return a.store.off(e,t)}))}}),[a,O]);var P=(0,c.useRef)(!0);(0,c.useEffect)((function(){w.current&&!P.current&&v(y),P.current=!1}),[a,f]);var E=[b,a,g];if(E.t=b,E.i18n=a,E.ready=g,g)return E;if(!g&&!p)return E;throw new Promise((function(e){_(a,d,(function(){e()}))}))}var re=["forwardedRef"];function oe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function ie(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?oe(Object(t),!0).forEach((function(n){a(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):oe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function ae(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t){function r(r){var i=r.forwardedRef,a=o(r,re),s=Q(te(e,ie(ie({},a),{},{keyPrefix:n.keyPrefix})),3),u=s[0],l=s[1],p=s[2],f=ie(ie({},a),{},{t:u,i18n:l,tReady:p});return n.withRef&&i?f.ref=i:!n.withRef&&i&&(f.forwardedRef=i),(0,c.createElement)(t,f)}return r.displayName="withI18nextTranslation(".concat(K(t),")"),r.WrappedComponent=t,n.withRef?(0,c.forwardRef)((function(e,n){return(0,c.createElement)(r,Object.assign({},e,{forwardedRef:n}))})):r}}var ce=["ns","children"];function se(e){var n=e.ns,t=e.children,r=Q(te(n,o(e,ce)),3),i=r[0],a=r[1],c=r[2];return t(i,{i18n:a,lng:a.language},c)}function ue(e){var n=e.i18n,t=e.defaultNS,r=e.children,o=(0,c.useMemo)((function(){return{i18n:n,defaultNS:t}}),[n,t]);return(0,c.createElement)(S.Provider,{value:o},r)}function le(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.i18n,o=(0,c.useContext)(S)||{},i=o.i18n,a=r||i||D();a.options&&a.options.isClone||(e&&!a.initializedStoreOnce&&(a.services.resourceStore.data=e,a.options.ns=Object.values(e).reduce((function(e,n){return Object.keys(n).forEach((function(n){e.indexOf(n)<0&&e.push(n)})),e}),a.options.ns),a.initializedStoreOnce=!0,a.isInitialized=!0),n&&!a.initializedLanguageOnce&&(a.changeLanguage(n),a.initializedLanguageOnce=!0))}var pe=["initialI18nStore","initialLanguage"];function fe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function de(){return function(e){function n(n){var t=n.initialI18nStore,r=n.initialLanguage,i=o(n,pe);return le(t,r),(0,c.createElement)(e,function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?fe(Object(t),!0).forEach((function(n){a(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}({},i))}return n.getInitialProps=T(e),n.displayName="withI18nextSSR(".concat(K(e),")"),n.WrappedComponent=e,n}}var ge=function(){return""},ye=function(){return""},me=function(){return""},he=function(){return""},be=function(){return""},ve=function(){return""}},1739:e=>{e.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}},3366:(e,n,t)=>{"use strict";function r(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}t.d(n,{Z:()=>r})}}]);
package/dist/255.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_openmrs_esm_cohort_builder_app=self.webpackChunk_openmrs_esm_cohort_builder_app||[]).push([[255],{255:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Gr});var n=r(5666),a=r.n(n),o=r(1672),i=r.n(o),l=r(7187),c=r(311),s=r(3397),u=r(6452);function d(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function m(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){d(o,n,a,i,l,"next",e)}function l(e){d(o,n,a,i,l,"throw",e)}i(void 0)}))}}var p,f=(p=m(a().mark((function e(t){var r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,c.openmrsFetch)("/ws/rest/v1/reportingrest/adhocquery?v=full",{method:"POST",headers:{"Content-Type":"application/json"},body:t.query});case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)}))),function(e){return p.apply(this,arguments)}),h=function(){var e=(0,u.Z)("/ws/rest/v1/location",c.openmrsFetch),t=e.data,r=e.error,n=[];return null==t||t.data.results.map((function(e,t){n.push({id:t,label:e.display,value:e.uuid})})),{isLoading:!t&&!r,locations:n,locationsError:r}},v=function(){var e=m(a().mark((function e(t){var r,n;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,c.openmrsFetch)("/ws/rest/v1/reportingrest/dataSet/".concat(t),{method:"GET"});case 2:return r=e.sent,n=r.data.rows.map((function(e){return e.id=e.patientId.toString(),e.name="".concat(e.firstname," ").concat(e.lastname),e})),e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),b=function(){var e=m(a().mark((function e(t){var r,n;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,c.openmrsFetch)("/ws/rest/v1/cohort/".concat(t,"/member?v=full"),{method:"GET"});case 2:return r=e.sent,n=r.data.rows.map((function(e){return e.id=e.patientId.toString(),e.name="".concat(e.firstname," ").concat(e.lastname),e})),e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),_=r(3379),y=r.n(_),g=r(7795),w=r.n(g),E=r(569),S=r.n(E),T=r(3565),x=r.n(T),A=r(9216),C=r.n(A),k=r(4589),O=r.n(k),I=r(3059),D={};D.styleTagTransform=O(),D.setAttributes=x(),D.insert=S().bind(null,"head"),D.domAPI=w(),D.insertStyleElement=C(),y()(I.Z,D);const P=I.Z&&I.Z.locals?I.Z.locals:void 0;function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var N=function(e){var t={type:"org.openmrs.module.reporting.dataset.definition.PatientDataSetDefinition",columns:[],rowFilters:[],customRowFilterCombination:""};t.columns=L();var r=0;for(var n in t.rowFilters=[],e)Y(e[n])?delete e[n]:("all"!=e[n]&&""!=e&&(t.rowFilters[r]={},t.rowFilters[r].key=j(n,e[n])),Array.isArray(e[n])&&(t.rowFilters[r].parameterValues=R(e[n])),e[n].length>=1&&"alive"===e[n][0].livingStatus&&(t.rowFilters[r].livingStatus="alive"),t.rowFilters[r].type="org.openmrs.module.reporting.dataset.definition.PatientDataSetDefinition",r+=1);return t.customRowFilterCombination=Z(t.rowFilters),{query:t}},Y=function(e){return Array.isArray(e)&&e.length>=1?!e[0].value:"all"===e||!e},j=function(e,t){var r="reporting.library.cohortDefinition.builtIn";return r+=".".concat("gender"===e?t:e)},R=function(e){var t={};return e.forEach((function(e){t[e.name]=e.value})),t},Z=function(e){for(var t="",r=e.length,n=1;n<=r;n++)"alive"===e[n-1].livingStatus?(t+="NOT ".concat(n),delete e[n-1].livingStatus):t+="".concat(n),t+=n<r?" AND ":"";return t},L=function(){return[{name:"firstname",key:"preferredName.givenName"},{name:"lastname",key:"preferredName.familyName"},{name:"gender",key:"gender"},{name:"age",key:"ageOnDate.fullYears"},{name:"patientId",key:"patientId"}].map((function(e){return e.type="org.openmrs.module.reporting.data.patient.definition.PatientDataDefinition",e.key="reporting.library.patientDataDefinition.builtIn.".concat(e.key),e}))},B=function(e,t,r){var n,a,o=JSON.parse(window.sessionStorage.getItem("openmrsHistory"));n=o?(a=o,function(e){if(Array.isArray(e))return M(e)}(a)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return M(e,t);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)?M(e,t):void 0}}(a)||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.")}()).concat([{description:e,patients:t,parameters:r}]):[{description:e,patients:t,parameters:r}],window.sessionStorage.setItem("openmrsHistory",JSON.stringify(n))},q=function(e){var t=new Date(e),r=t.getDate(),n=t.getMonth()+1,a=t.getFullYear();return"".concat(r,"/").concat(n,"/").concat(a)},z=function(e,t){var r=e.timeModifier,n=e.onOrAfter,a=e.onOrBefore,o=n?"since ".concat(q(n)):"",i=a?"until ".concat(q(a)):"";return"Patients with ".concat(r," ").concat(t," ").concat(o," ").concat(i).trim()},H=function(e,t){var r,n=new Blob([(r=e,"patient_id, full_name, age, gender\n"+r.map((function(e){var t={patientId:e.patientId,name:e.name,age:e.age,gender:e.gender};return Object.keys(t).map((function(t){return'"'.concat(e[t],'"')})).join(",")})).join("\n"))],{type:"text/csv;charset=utf-8;"}),a=URL.createObjectURL(n),o=document.createElement("a");o.href=a,o.setAttribute("download",t),o.click()},F=r(6794),V={};V.styleTagTransform=O(),V.setAttributes=x(),V.insert=S().bind(null,"head"),V.domAPI=w(),V.insertStyleElement=C(),y()(F.Z,V);const U=F.Z&&F.Z.locals?F.Z.locals:void 0,X=function(e){var t=e.isLoading,r=e.onHandleSubmit,n=e.onHandleReset,a=(0,s.useTranslation)().t;return i().createElement(l.Column,{sm:2,md:{offset:4},className:U.container},i().createElement(l.ButtonSet,{className:U.buttonSet},i().createElement(l.Button,{kind:"secondary",onClick:n,"data-testid":"reset-btn"},a("reset","Reset")),i().createElement(l.Button,{kind:"primary",onClick:r,"data-testid":"search-btn"},t?i().createElement(l.InlineLoading,{description:a("loading","Loading")}):a("search","Search"))))};var W=r(7503),Q={};Q.styleTagTransform=O(),Q.setAttributes=x(),Q.insert=S().bind(null,"head"),Q.domAPI=w(),Q.insertStyleElement=C(),y()(W.Z,Q);const $=W.Z&&W.Z.locals?W.Z.locals:void 0;var G=function(e){return e.match(/and|or|not|\d+|\)|\(|union|intersection|\!|\+/gi).length===e.split(/\s+/g).length},J=function(e){var t=e.replace(/(\(|\))+/g,(function(e){return"("===e?"( ":" )"})),r={type:"org.openmrs.module.reporting.dataset.definition.PatientDataSetDefinition",columns:L(),rowFilters:[],customRowFilterCombination:""};return t.split(/\s+/).forEach((function(e){if(e.match(/\d/)){var t=JSON.parse(window.sessionStorage.getItem("openmrsHistory"))[parseInt(e)-1].parameters;t.customRowFilterCombination=(n=t.customRowFilterCombination,a=r.rowFilters.length,n.replace(/\d/,(function(e){return(parseInt(e)+a).toString()}))),r.customRowFilterCombination+="(".concat(t.customRowFilterCombination,")"),r.rowFilters=r.rowFilters.concat(t.rowFilters)}else r.customRowFilterCombination+=" ".concat(e," ");var n,a})),{query:r}};function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ee(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function te(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return K(e,t);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)?K(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const re=function(e){var t=e.onSubmit,r=te((0,o.useState)(!1),2),n=r[0],u=r[1],d=te((0,o.useState)(""),2),m=d[0],p=d[1],f=te((0,o.useState)(""),2),h=f[0],v=f[1],b=(0,s.useTranslation)().t,_=function(){var e,r=(e=a().mark((function e(){var r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u(!0),e.prev=1,!G(m)){e.next=8;break}return r=J(m),e.next=6,t(r,h);case 6:e.next=9;break;case 8:(0,c.showNotification)({title:b("error","Error!"),kind:"error",critical:!0,description:b("invalidComposition","Composition is not valid")});case 9:u(!1),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(1),u(!1),(0,c.showNotification)({title:b("error","Error!"),kind:"error",critical:!0,description:b("invalidComposition","Composition is not valid")});case 16:case"end":return e.stop()}}),e,null,[[1,12]])})),function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){ee(o,n,a,i,l,"next",e)}function l(e){ee(o,n,a,i,l,"throw",e)}i(void 0)}))});return function(){return r.apply(this,arguments)}}();return i().createElement(i().Fragment,null,i().createElement(l.TextInput,{"data-modal-primary-focus":!0,required:!0,labelText:b("composition","Composition"),"data-testid":"composition-query",id:"composition-query",onChange:function(e){return t=e.target.value,p(t),void v("Composition of "+t);var t},value:m}),i().createElement("br",null),i().createElement(l.TextInput,{"data-modal-primary-focus":!0,required:!0,labelText:b("description","Description"),"data-testid":"composition-description",id:"composition-description",onChange:function(e){return v(e.target.value)},value:h}),i().createElement("br",null),i().createElement("p",{className:$.text},b("compositionExplanationOne","A composition query combines together the results of multiple cohorts using the logical operators: AND, OR and NOT.")),i().createElement("br",null),i().createElement("p",{className:$.text},b("compositionExplanationTwo","To use this query you need to already have query results in your search history. Those existing query results can then be combined to yield the results of the composition query.")),i().createElement("br",null),i().createElement("p",{className:$.text},b("compositionExplanationThree","Example: if the search history #1 is a cohort of patients who are males, and if the search history #2 is a cohort of patients with ages between 23 and 35 years; then '1 AND 2' will result in a cohort of patients who are males with ages between 23 and 35 years.")),i().createElement("br",null),i().createElement(X,{onHandleReset:function(){v(""),p("")},onHandleSubmit:_,isLoading:n}))};var ne=r(7041),ae=r(5014),oe={};oe.styleTagTransform=O(),oe.setAttributes=x(),oe.insert=S().bind(null,"head"),oe.domAPI=w(),oe.insertStyleElement=C(),y()(ae.Z,oe);const ie=ae.Z&&ae.Z.locals?ae.Z.locals:void 0,le=function(e){return i().createElement(l.Layer,null,i().createElement(l.Tile,{className:ie.tile},i().createElement(ne.N,null),i().createElement("p",{className:ie.content},"There are no ",e.displayText.toLowerCase()," to display")))};function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function se(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function ue(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){se(o,n,a,i,l,"next",e)}function l(e){se(o,n,a,i,l,"throw",e)}i(void 0)}))}}var de;!function(e){e[e.VIEW=0]="VIEW",e[e.DELETE=1]="DELETE"}(de||(de={}));const me=function(e){var t,r,n=e.cohort,u=e.onViewCohort,d=e.onDeleteCohort,m=(0,s.useTranslation)().t,p=(t=(0,o.useState)(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(t,r)||function(e,t){if(e){if("string"==typeof e)return ce(e,t);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)?ce(e,t):void 0}}(t,r)||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.")}()),f=p[0],h=p[1],v=function(){var e=ue(a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u(n.id);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),(0,c.showToast)({title:m("cohortViewError","Error viewing the cohort"),kind:"error",critical:!0,description:null===e.t0||void 0===e.t0?void 0:e.t0.message});case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),b=function(){var e=ue(a().mark((function e(t){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t,e.next=e.t0===de.VIEW?3:e.t0===de.DELETE?5:7;break;case 3:return v(),e.abrupt("break",7);case 5:return h(!0),e.abrupt("break",7);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),_=function(){var e=ue(a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d(n.id);case 2:h(!1);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return i().createElement(i().Fragment,null,i().createElement(l.OverflowMenu,{ariaLabel:"overflow-menu",size:"md",flipped:!0,direction:"bottom","data-testid":"options"},i().createElement(l.OverflowMenuItem,{"data-testid":"view",itemText:m("view","View"),onClick:function(){return b(de.VIEW)}}),i().createElement(l.OverflowMenuItem,{"data-testid":"delete",itemText:m("delete","Delete"),onClick:function(){return b(de.DELETE)}})),i().createElement(l.ComposedModal,{size:"sm",open:f,onClose:function(){return h(!1)}},i().createElement(l.ModalHeader,null,i().createElement("p",null,m("deleteItem","Are you sure you want to delete ".concat(null==n?void 0:n.name,"?"),{itemName:null==n?void 0:n.name}))),i().createElement(l.ModalFooter,{danger:!0,onRequestSubmit:_,primaryButtonText:m("delete","Delete"),secondaryButtonText:m("cancel","Cancel")})))};function pe(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function fe(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){pe(o,n,a,i,l,"next",e)}function l(e){pe(o,n,a,i,l,"throw",e)}i(void 0)}))}}function he(){return ve.apply(this,arguments)}function ve(){return(ve=fe(a().mark((function e(){var t,r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,c.openmrsFetch)("/ws/rest/v1/cohort?v=full",{method:"GET"});case 2:return t=e.sent,r=[],t.data.results.length>0&&t.data.results.map((function(e){var t={id:e.uuid,name:e.name,description:e.description};r.push(t)})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var be=function(){var e=fe(a().mark((function e(t){var r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,c.openmrsFetch)("/ws/rest/v1/cohort/".concat(t),{method:"DELETE"});case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),_e=r(7735),ye={};ye.styleTagTransform=O(),ye.setAttributes=x(),ye.insert=S().bind(null,"head"),ye.domAPI=w(),ye.insertStyleElement=C(),y()(_e.Z,ye);const ge=_e.Z&&_e.Z.locals?_e.Z.locals:void 0;function we(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ee(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function Se(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){Ee(o,n,a,i,l,"next",e)}function l(e){Ee(o,n,a,i,l,"throw",e)}i(void 0)}))}}function Te(){return Te=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Te.apply(this,arguments)}function xe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return we(e,t);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)?we(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const Ae=function(e){var t=e.onViewCohort,r=xe((0,o.useState)(1),2),n=r[0],u=r[1],d=xe((0,o.useState)(10),2),m=d[0],p=d[1],f=xe((0,o.useState)([]),2),h=f[0],v=f[1],b=(0,s.useTranslation)().t,_=function(){var e=Se(a().mark((function e(){var t;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,he();case 2:t=e.sent,v(t);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),y=[{key:"name",header:b("name","Name")},{key:"description",header:b("description","Description")}],g=function(){var e=Se(a().mark((function e(t){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,be(t);case 3:(0,c.showToast)({title:b("success","Success"),kind:"success",critical:!0,description:b("cohortIsDeleted","the cohort is deleted")}),_(),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),(0,c.showToast)({title:b("cohortDeleteError","Error deleting the cohort"),kind:"error",critical:!0,description:null===e.t0||void 0===e.t0?void 0:e.t0.message});case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}();return(0,o.useEffect)((function(){_()}),[]),i().createElement("div",{className:ge.container},i().createElement("p",{className:P.text},b("savedCohortDescription","You can only search for Cohort Definitions that you have saved using a Name.")),i().createElement(l.DataTable,{rows:h,headers:y,useZebraStyles:!0},(function(e){var r=e.rows,a=e.headers,o=e.getTableProps,c=e.getHeaderProps,s=e.getRowProps;return i().createElement(l.Table,Te({},o()),i().createElement(l.TableHead,null,i().createElement(l.TableRow,null,a.map((function(e){return i().createElement(l.TableHeader,Te({},c({header:e})),e.header)})),i().createElement(l.TableHeader,{className:P.optionHeader}))),i().createElement(l.TableBody,null,r.slice((n-1)*m).slice(0,m).map((function(e,r){return i().createElement(l.TableRow,Te({},s({row:e}),{key:r}),e.cells.map((function(e,t){return i().createElement(l.TableCell,{key:t},e.value)})),i().createElement(l.TableCell,{className:P.optionCell},i().createElement(me,{cohort:h[r],onViewCohort:t,onDeleteCohort:g})))}))))})),h.length>10&&i().createElement(l.Pagination,{backwardText:b("previousPage","Previous page"),forwardText:b("nextPage","Next page"),itemsPerPageText:b("itemsPerPage:","Items per page:"),onChange:function(e){var t=e.page,r=e.pageSize;u(t),p(r)},page:1,pageSize:10,pageSizes:[10,20,30,40,50],size:"md",totalItems:h.length}),!h.length&&i().createElement(le,{displayText:b("cohorts","cohorts")}))};function Ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ke(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function Oe(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){ke(o,n,a,i,l,"next",e)}function l(e){ke(o,n,a,i,l,"throw",e)}i(void 0)}))}}var Ie;!function(e){e[e.VIEW=0]="VIEW",e[e.DELETE=1]="DELETE"}(Ie||(Ie={}));const De=function(e){var t,r,n=e.query,u=e.onViewQuery,d=e.deleteQuery,m=(0,s.useTranslation)().t,p=(t=(0,o.useState)(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(t,r)||function(e,t){if(e){if("string"==typeof e)return Ce(e,t);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)?Ce(e,t):void 0}}(t,r)||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.")}()),f=p[0],h=p[1],v=function(){var e=Oe(a().mark((function e(t){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t,e.next=e.t0===Ie.VIEW?3:e.t0===Ie.DELETE?5:7;break;case 3:return b(),e.abrupt("break",7);case 5:return h(!0),e.abrupt("break",7);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),b=function(){var e=Oe(a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u(n.id);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),(0,c.showToast)({title:m("QueryDeleteError","Something went wrong"),kind:"error",critical:!0,description:null===e.t0||void 0===e.t0?void 0:e.t0.message});case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),_=function(){var e=Oe(a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d(n.id);case 2:h(!1);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return i().createElement(i().Fragment,null,i().createElement(l.OverflowMenu,{ariaLabel:"overflow-menu",size:"md",flipped:!0,direction:"bottom","data-testid":"options"},i().createElement(l.OverflowMenuItem,{"data-testid":"view",itemText:m("view","View"),onClick:function(){return v(Ie.VIEW)}}),i().createElement(l.OverflowMenuItem,{"data-testid":"delete",itemText:m("delete","Delete"),onClick:function(){return v(Ie.DELETE)}})),i().createElement(l.ComposedModal,{size:"sm",open:f,onClose:function(){return h(!1)}},i().createElement(l.ModalHeader,null,i().createElement("p",null,m("deleteItem","Are you sure you want to delete ".concat(null==n?void 0:n.name,"?"),{item:null==n?void 0:n.name}))),i().createElement(l.ModalFooter,{danger:!0,onRequestSubmit:_,primaryButtonText:m("delete","Delete"),secondaryButtonText:m("cancel","Cancel")})))};function Pe(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function Me(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){Pe(o,n,a,i,l,"next",e)}function l(e){Pe(o,n,a,i,l,"throw",e)}i(void 0)}))}}function Ne(){return Ye.apply(this,arguments)}function Ye(){return(Ye=Me(a().mark((function e(){var t,r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,c.openmrsFetch)("/ws/rest/v1/reportingrest/dataSetDefinition?v=full",{method:"GET"});case 2:return t=e.sent,r=[],t.data.results.length>0&&t.data.results.map((function(e){var t={id:e.uuid,name:e.name.replace("[AdHocDataExport]",""),description:e.description};r.push(t)})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var je=function(){var e=Me(a().mark((function e(t){var r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,c.openmrsFetch)("/ws/rest/v1/reportingrest/adhocdataset/".concat(t,"?purge=true"),{method:"DELETE"});case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Re=r(8199),Ze={};Ze.styleTagTransform=O(),Ze.setAttributes=x(),Ze.insert=S().bind(null,"head"),Ze.domAPI=w(),Ze.insertStyleElement=C(),y()(Re.Z,Ze);const Le=Re.Z&&Re.Z.locals?Re.Z.locals:void 0;function Be(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function qe(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function ze(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){qe(o,n,a,i,l,"next",e)}function l(e){qe(o,n,a,i,l,"throw",e)}i(void 0)}))}}function He(){return He=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},He.apply(this,arguments)}function Fe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Be(e,t);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)?Be(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const Ve=function(e){var t=e.onViewQuery,r=Fe((0,o.useState)(1),2),n=r[0],u=r[1],d=Fe((0,o.useState)(10),2),m=d[0],p=d[1],f=(0,s.useTranslation)().t,h=Fe((0,o.useState)([]),2),v=h[0],b=h[1],_=function(){var e=ze(a().mark((function e(){var t;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ne();case 2:t=e.sent,b(t);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),y=function(){var e=ze(a().mark((function e(t){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,je(t);case 3:(0,c.showToast)({title:f("success","Success"),kind:"success",critical:!0,description:f("queryIsDeleted","the query is deleted")}),_(),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),(0,c.showToast)({title:f("queryDeleteError","Error saving the query"),kind:"error",critical:!0,description:null===e.t0||void 0===e.t0?void 0:e.t0.message});case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}();(0,o.useEffect)((function(){_()}),[]);var g=[{key:"name",header:f("name","Name")},{key:"description",header:f("description","Description")}];return i().createElement("div",{className:Le.container},i().createElement("p",{className:P.text},f("savedQueryDescription","You can only search for Query Definitions that you have saved using a Name.")),i().createElement(l.DataTable,{rows:v,headers:g,useZebraStyles:!0},(function(e){var r=e.rows,a=e.headers,o=e.getTableProps,c=e.getHeaderProps,s=e.getRowProps;return i().createElement(l.Table,He({},o()),i().createElement(l.TableHead,null,i().createElement(l.TableRow,null,a.map((function(e){return i().createElement(l.TableHeader,He({},c({header:e})),e.header)})),i().createElement(l.TableHeader,{className:P.optionHeader}))),i().createElement(l.TableBody,null,r.slice((n-1)*m).slice(0,m).map((function(e,r){return i().createElement(l.TableRow,He({},s({row:e}),{key:r}),e.cells.map((function(e,t){return i().createElement(l.TableCell,{key:t},e.value)})),i().createElement(l.TableCell,{className:P.optionCell},i().createElement(De,{query:v[r],onViewQuery:t,deleteQuery:y})))}))))})),v.length>10&&i().createElement(l.Pagination,{backwardText:f("previousPage","Previous page"),forwardText:f("nextPage","Next page"),itemsPerPageText:f("itemsPerPage:","Items per page:"),onChange:function(e){var t=e.page,r=e.pageSize;u(t),p(r)},page:1,pageSize:10,pageSizes:[10,20,30,40,50],size:"md",totalItems:v.length}),!v.length&&i().createElement(le,{displayText:f("queries","queries")}))};var Ue=r(3119),Xe=r.n(Ue),We=r(4675),Qe={};Qe.styleTagTransform=O(),Qe.setAttributes=x(),Qe.insert=S().bind(null,"head"),Qe.domAPI=w(),Qe.insertStyleElement=C(),y()(We.Z,Qe);const $e=We.Z&&We.Z.locals?We.Z.locals:void 0;var Ge=r(3279),Je=r.n(Ge);function Ke(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function et(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){Ke(o,n,a,i,l,"next",e)}function l(e){Ke(o,n,a,i,l,"throw",e)}i(void 0)}))}}function tt(e){return rt.apply(this,arguments)}function rt(){return(rt=et(a().mark((function e(t){var r,n;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,c.openmrsFetch)("/ws/rest/v1/concept?v=full&q=".concat(t),{method:"GET"});case 2:return r=e.sent,n=[],r.data.results.length>0&&(n=r.data.results.map((function(e){var t=e.descriptions.filter((function(e){return"en"==e.locale?e.description:""}));return{uuid:e.uuid,units:e.units||"",answers:e.answers,hl7Abbrev:e.datatype.hl7Abbreviation,name:e.name.name,description:t.length>0?t[0].description:"no description available",datatype:e.datatype}}))),e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var nt=r(1229),at={};at.styleTagTransform=O(),at.setAttributes=x(),at.insert=S().bind(null,"head"),at.domAPI=w(),at.insertStyleElement=C(),y()(nt.Z,at);const ot=nt.Z&&nt.Z.locals?nt.Z.locals:void 0;function it(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function lt(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function ct(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){lt(o,n,a,i,l,"next",e)}function l(e){lt(o,n,a,i,l,"throw",e)}i(void 0)}))}}function st(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return it(e,t);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)?it(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ut=function(e){var t=e.concept,r=e.searchText,n=e.setConcept,c=e.setSearchText,u=(0,s.useTranslation)().t,d=st((0,o.useState)([]),2),m=d[0],p=d[1],f=st((0,o.useState)(""),2),h=f[0],v=f[1],b=st((0,o.useState)(!1),2),_=b[0],y=b[1],g=st((0,o.useState)(!1),2),w=g[0],E=g[1],S=function(){var e=ct(a().mark((function e(t){var r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p([]),n(null),y(!0),E(!1),e.prev=4,e.next=7,tt(t);case 7:(r=e.sent).length?p(r):E(!0),y(!1),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(4),v(e.t0.toString()),y(!1);case 16:case"end":return e.stop()}}),e,null,[[4,12]])})));return function(t){return e.apply(this,arguments)}}(),T=(0,o.useRef)(Je()(function(){var e=ct(a().mark((function e(t){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=3;break}return e.next=3,S(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),500)).current;return(0,o.useEffect)((function(){return function(){T.cancel()}}),[T]),i().createElement("div",null,i().createElement(l.Column,{className:ot.column},i().createElement(l.Search,{closeButtonLabelText:u("clearSearch","Clear search"),id:"concept-search",labelText:u("searchConcepts","Search Concepts"),placeholder:u("searchConcepts","Search Concepts"),onChange:function(e){c(e.target.value),T(e.target.value)},onClear:function(){E(!1),p([])},size:"lg",value:r}),i().createElement("div",{className:ot.search},_?i().createElement(l.CodeSnippetSkeleton,{type:"multi"}):m.map((function(e){return i().createElement("div",{key:e.uuid},i().createElement(l.Button,{kind:"ghost",onClick:function(){return function(e){n(e),p([]),E(!1)}(e)}},e.name),i().createElement("br",null))}))),t&&i().createElement("p",{className:ot.text},u("whoseAnswer","Patients with observations whose answer is "),i().createElement("span",{className:ot.concept},t.name)),w&&i().createElement("p",{className:ot.text},u("noSearchItems","There are no search items")),h&&i().createElement("span",null,h)))};function dt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mt(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function pt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return dt(e,t);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)?dt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ft=[{id:0,label:"<",value:"LESS_THAN"},{id:1,label:"<=",value:"LESS_EQUAL"},{id:2,label:"=",value:"EQUAL"},{id:3,label:">=",value:"GREATER_EQUAL"},{id:4,label:">",value:"GREATER_THAN"}],ht={CWE:"codedObsSearchAdvanced",NM:"numericObsSearchAdvanced",DT:"dateObsSearchAdvanced",ST:"dateObsSearchAdvanced",TS:"textObsSearchAdvanced",ZZ:"codedObsSearchAdvanced",BIT:"codedObsSearchAdvanced"};const vt=function(e){var t=e.onSubmit,r=(0,s.useTranslation)().t,n=pt((0,o.useState)(null),2),c=n[0],u=n[1],d=pt((0,o.useState)(0),2),m=d[0],p=d[1],f=pt((0,o.useState)(0),2),h=f[0],v=f[1],b=pt((0,o.useState)(0),2),_=b[0],y=b[1],g=pt((0,o.useState)("LESS_THAN"),2),w=g[0],E=g[1],S=pt((0,o.useState)("ANY"),2),T=S[0],x=S[1],A=pt((0,o.useState)(""),2),C=A[0],k=A[1],O=pt((0,o.useState)(""),2),I=O[0],D=O[1],P=pt((0,o.useState)(""),2),M=P[0],Y=P[1],j=pt((0,o.useState)(!1),2),R=j[0],Z=j[1],L=[{id:"option-0",label:r("haveObservations","Patients who have these observations"),value:"ANY"},{id:"option-1",label:r("haveNoObservations","Patients who do not have these observations"),value:"NO"}],B=[{id:"option-0",label:r("any","Any"),value:"ANY"},{id:"option-1",label:r("none","None"),value:"NO"},{id:"option-2",label:r("earliest","Earliest"),value:"FIRST"},{id:"option-3",label:r("recent","Most Recent"),value:"LAST"},{id:"option-4",label:r("lowest","Lowest"),value:"MIN"},{id:"option-5",label:r("highest","Highest"),value:"MAX"},{id:"option-6",label:r("average","Average"),value:"AVG"}],q=function(){if(m>0||h>0)return Xe()().subtract(m,"days").subtract(h,"months").format()},H=function(){var e,r=(e=a().mark((function e(){var r,n,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Z(!0),r={modifier:"",operator1:w,value1:_>0?_.toString():"",question:c.uuid,onOrBefore:q()||I,onOrAfter:C,timeModifier:T},l=[],(i=n=ht[c.hl7Abbrev])in(a={})?Object.defineProperty(a,i,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[i]=l,o=a,Object.keys(r).forEach((function(e){""!==r[e]&&o[n].push({name:"modifier"===e?["CWE","TS"].includes(c.hl7Abbrev)?"values":"value1":e,value:"modifier"===e&&["CWE","TS"].includes(c.hl7Abbrev)?[r[e]]:r[e]})})),e.next=7,t(N(o),z(r,c.name));case 7:Z(!1);case 8:case"end":return e.stop()}var a,i,l}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){mt(o,n,a,i,l,"next",e)}function l(e){mt(o,n,a,i,l,"throw",e)}i(void 0)}))});return function(){return r.apply(this,arguments)}}();return i().createElement(i().Fragment,null,i().createElement("div",null,i().createElement(ut,{setConcept:u,concept:c,searchText:M,setSearchText:Y}),"NM"===(null==c?void 0:c.hl7Abbrev)?i().createElement(i().Fragment,null,i().createElement(l.Column,{className:$e.column},i().createElement("div",{style:{display:"flex"}},i().createElement("div",{className:$e.multipleInputs},i().createElement("p",{style:{paddingRight:20}},r("whatObservations","What observations")),i().createElement(l.Dropdown,{id:"timeModifier",onChange:function(e){return x(e.selectedItem.value)},initialSelectedItem:B[0],items:B,className:$e.timeModifier,label:""})))),i().createElement(l.Column,{className:$e.column},i().createElement("p",{className:$e.value},r("whatValues","What values")),i().createElement("div",{className:$e.whatValuesInputs},i().createElement("div",{className:$e.operators},i().createElement(l.ContentSwitcher,{selectedIndex:ft[0].id,className:$e.contentSwitcher,size:"lg",onChange:function(e){var t=e.index;return E(ft[t].value)}},ft.map((function(e){return i().createElement(l.Switch,{key:e.id,name:e.value,text:e.label})})))),i().createElement("div",{className:$e.multipleInputs},i().createElement(l.NumberInput,{hideSteppers:!0,id:"operator-value",invalidText:r("numberIsNotValid","Number is not valid"),label:r("valueIn","Enter a value in ")+c.units,min:0,size:"sm",value:_,onChange:function(e,t){var r=t.value;return y(r)}}))))):i().createElement(l.Column,{className:$e.column},i().createElement(l.Dropdown,{id:"timeModifier","data-testid":"timeModifier",onChange:function(e){return x(e.selectedItem.value)},initialSelectedItem:L[0],items:L,label:""})),i().createElement(l.Column,{className:$e.dateRange},i().createElement(l.Column,null,i().createElement(l.NumberInput,{hideSteppers:!0,id:"last-months","data-testid":"last-months",label:r("withinTheLast","Within the last months"),invalidText:r("numberIsNotValid","Number is not valid"),min:0,size:"sm",value:h,onChange:function(e,t){var r=t.value;return v(r)}})),i().createElement(l.Column,null,i().createElement(l.NumberInput,{hideSteppers:!0,label:r("lastDays","and / or days"),id:"last-days","data-testid":"last-days",invalidText:r("numberIsNotValid","Number is not valid"),min:0,size:"sm",value:m,onChange:function(e,t){var r=t.value;return p(r)}}))),i().createElement("div",{className:$e.dateRange},i().createElement(l.Column,null,i().createElement(l.DatePicker,{datePickerType:"single",allowInput:!1,onChange:function(e){return k(Xe()(e[0]).format())}},i().createElement(l.DatePickerInput,{id:"startDate",value:C&&Xe()(C).format("DD-MM-YYYY"),labelText:r("dateRange","Date range start date"),placeholder:"DD-MM-YYYY",size:"md"}))),i().createElement(l.Column,null,i().createElement(l.DatePicker,{datePickerType:"single",allowInput:!1,onChange:function(e){return D(Xe()(e[0]).format())}},i().createElement(l.DatePickerInput,{id:"endDate",value:I&&Xe()(I).format("DD-MM-YYYY"),labelText:r("endDate","End date"),placeholder:"DD-MM-YYYY",size:"md"}))))),i().createElement(X,{isLoading:R,onHandleSubmit:H,onHandleReset:function(){u(null),p(0),Y(""),k(""),D(""),v(0),y(0),E("LESS_THAN"),x("ANY")}}))};var bt=r(9579),_t={};_t.styleTagTransform=O(),_t.setAttributes=x(),_t.insert=S().bind(null,"head"),_t.domAPI=w(),_t.insertStyleElement=C(),y()(bt.Z,_t);const yt=bt.Z&&bt.Z.locals?bt.Z.locals:void 0;function gt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function wt(e){return function(e){if(Array.isArray(e))return gt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return gt(e,t);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)?gt(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Et=function(e){var t=e.gender,r=e.minAge,n=e.maxAge,a=e.birthDayStartDate,o=e.birthDayEndDate,i=e.livingStatus,l="all"!=t?"".concat("males"===t?"Male":"Female"," Patients"):"All Patients";return(r||n)&&(l+=r&&n?" with ages between ".concat(r," and ").concat(n):r?" with minimum age of ".concat(r):" with maximum age of ".concat(n),l+=" years"),""==a&&""==o||(l+=a&&o?" and birthdate between ".concat(a," and ").concat(o):" and born before ".concat(r?a:o)),i&&(l+=" that are ".concat(i)),l},St=function(e){var t=e.gender,r=e.minAge,n=e.maxAge,a=e.birthDayStartDate,o=e.birthDayEndDate,i=e.livingStatus,l={gender:t};r&&n?l.ageRangeOnDate=[{name:"minAge",value:r},{name:"maxAge",value:n}]:r?l.atLeastAgeOnDate=[{name:"minAge",value:r}]:l.upToAgeOnDate=[{name:"maxAge",value:n}],a&&o&&(l.bornDuringPeriod=[{name:"startDate",dataType:"date",value:a},{name:"endDate",dataType:"date",value:o}]);var c=Xe()().format();l.diedDuringPeriod=[{name:"endDate",dataType:"date",value:c,livingStatus:i}];var s=N(l);if("all"===l.gender){var u=["males","females","unknownGender"].map((function(e){return{type:"org.openmrs.module.reporting.dataset.definition.PatientDataSetDefinition",key:"reporting.library.cohortDefinition.builtIn.".concat(e)}})),d=s.query,m=d.rowFilters,p=d.customRowFilterCombination,f=m=m.length>0?wt(m).concat(wt(u)):u,h=p;p=h?"(".concat(f.length-2," OR ").concat(f.length-1," OR ").concat(f.length,") AND ").concat(h):"(1 OR 2 OR 3)"}return s};function Tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xt(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function At(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Tt(e,t);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)?Tt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const Ct=function(e){var t=e.onSubmit,r=(0,s.useTranslation)().t,n=At((0,o.useState)("alive"),2),c=n[0],u=n[1],d=At((0,o.useState)("all"),2),m=d[0],p=d[1],f=At((0,o.useState)(""),2),h=f[0],v=f[1],b=At((0,o.useState)(""),2),_=b[0],y=b[1],g=At((0,o.useState)(0),2),w=g[0],E=g[1],S=At((0,o.useState)(0),2),T=S[0],x=S[1],A=At((0,o.useState)(!1),2),C=A[0],k=A[1],O=[{id:0,label:r("all","All"),value:"all"},{id:1,label:r("males","Male"),value:"males"},{id:3,label:r("females","Female"),value:"females"}],I=[{id:0,label:r("alive","Alive"),value:"alive"},{id:1,label:r("dead","Dead"),value:"dead"}],D=function(){var e,r=(e=a().mark((function e(){var r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k(!0),r={gender:m,minAge:w,maxAge:T,birthDayStartDate:h,birthDayEndDate:_,livingStatus:c},e.next=4,t(St(r),Et(r));case 4:k(!1);case 5:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){xt(o,n,a,i,l,"next",e)}function l(e){xt(o,n,a,i,l,"throw",e)}i(void 0)}))});return function(){return r.apply(this,arguments)}}();return i().createElement(i().Fragment,null,i().createElement(l.Column,null,i().createElement("p",{className:"".concat(yt.text," ").concat(yt.genderTitle)},r("gender","Gender")),i().createElement("div",{className:yt.genderContainer},i().createElement("div",{className:yt.switch},i().createElement(l.ContentSwitcher,{selectedIndex:O[0].id,className:yt.contentSwitcher,size:"lg",onChange:function(e){var t=e.index;return p(O[t].value)}},O.map((function(e){return i().createElement(l.Switch,{"data-testid":e.label,key:e.id,name:e.value,text:e.label})})))),i().createElement("div",{className:yt.switch},i().createElement(l.ContentSwitcher,{selectedIndex:I[0].id,className:yt.contentSwitcher,size:"lg",onChange:function(e){var t=e.index;return u(I[t].value)}},I.map((function(e){return i().createElement(l.Switch,{key:e.id,name:e.value,text:e.label})})))))),i().createElement("div",{className:yt.column},i().createElement(l.Column,{className:yt.age},i().createElement(l.Column,null,i().createElement(l.NumberInput,{hideSteppers:!0,id:"minAge","data-testid":"minAge",label:r("ageBetween","Age between"),invalidText:r("minAgeIsNotValid","The age must be greater than 0"),min:0,value:w,onChange:function(e,t){var r=t.value;return E(r)}})),i().createElement(l.Column,null,i().createElement(l.NumberInput,{id:"maxAge",hideSteppers:!0,"data-testid":"maxAge",label:r("and","and"),invalidText:r("maxAgeIsNotValid","The age must be less than 200"),min:0,max:200,value:T,onChange:function(e,t){var r=t.value;return x(r)}})))),i().createElement("div",{className:yt.column},i().createElement(l.Column,null,i().createElement(l.DatePicker,{datePickerType:"single",allowInput:!1,onChange:function(e){return v(Xe()(e[0]).format())}},i().createElement(l.DatePickerInput,{id:"startDate",labelText:r("birthDate","Birth date between"),value:h&&Xe()(h).format("DD-MM-YYYY"),placeholder:"DD-MM-YYYY",size:"md"}))),i().createElement(l.Column,null,i().createElement(l.DatePicker,{datePickerType:"single",allowInput:!1,onChange:function(e){return y(Xe()(e[0]).format())}},i().createElement(l.DatePickerInput,{id:"endDate",labelText:r("and","and"),value:_&&Xe()(_).format("DD-MM-YYYY"),placeholder:"DD-MM-YYYY",size:"md"})))),i().createElement(X,{isLoading:C,onHandleSubmit:D,onHandleReset:function(){x(0),E(0),y(""),v("")}}))};var kt=r(1050),Ot={};Ot.styleTagTransform=O(),Ot.setAttributes=x(),Ot.insert=S().bind(null,"head"),Ot.domAPI=w(),Ot.insertStyleElement=C(),y()(kt.Z,Ot);const It=kt.Z&&kt.Z.locals?kt.Z.locals:void 0;var Dt=function(e){var t=e.selectedDrugs,r=e.selectedCareSetting,n=e.activeOnOrBefore,a=e.activeOnOrAfter,o=e.activatedOnOrBefore,i=e.activatedOnOrAfter,l="Patients who taking "+t.map((function(e){return e.label})).join(", ").replace(/,(?=[^,]*$)/," and");if(r&&(l+=" from ".concat(r.label)),a){var s=(0,c.formatDate)(new Date(a),{mode:"standard"});l+=n?" from ".concat(s):" on or after ".concat(s)}if(n){var u=(0,c.formatDate)(new Date(n),{mode:"standard"});l+=a?" to ".concat(u):" on or before ".concat(u)}if(i){var d=(0,c.formatDate)(new Date(i),{mode:"standard"});l+=o?" from ".concat(d):" on or after ".concat(d)}if(o){var m=(0,c.formatDate)(new Date(o),{mode:"standard"});l+=i?" to ".concat(m):" on or before ".concat(m)}return l},Pt=function(e){var t=e.selectedDrugs,r=e.selectedCareSetting,n=e.activeOnOrBefore,a=e.activeOnOrAfter,o=e.activatedOnOrBefore,i=e.activatedOnOrAfter,l={drugOrderSearch:[]};return a&&l.drugOrderSearch.push({name:"activeOnOrAfter",value:a}),i&&l.drugOrderSearch.push({name:"activatedOnOrAfter",value:i}),o&&l.drugOrderSearch.push({name:"activatedOnOrBefore",value:o}),r&&l.drugOrderSearch.push({name:"careSetting",value:r.value}),t.length&&l.drugOrderSearch.push({name:"drugs",value:t.map((function(e){return e.value}))}),n&&l.drugOrderSearch.push({name:"activeOnOrBefore",value:n}),N(l)};function Mt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Nt(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function Yt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Mt(e,t);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)?Mt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const jt=function(e){var t=e.onSubmit,r=(0,s.useTranslation)().t,n=function(){var e=(0,u.Z)("/ws/rest/v1/drug",c.openmrsFetch),t=e.data,r=e.error;return(0,o.useMemo)((function(){var e=[];return null==t||t.data.results.map((function(t,r){e.push({id:r,label:t.display,value:t.uuid})})),{isLoading:!t&&!r,drugs:e,drugsError:r}}),[t,r])}(),d=n.drugs,m=n.drugsError,p=function(){var e=(0,u.Z)("/ws/rest/v1/caresetting",c.openmrsFetch),t=e.data,r=e.error;return(0,o.useMemo)((function(){var e=[];return null==t||t.data.results.map((function(t,r){e.push({id:r,label:t.display,value:t.uuid})})),{isLoading:!t&&!r,careSettings:e,careSettingsError:r}}),[t,r])}(),f=p.careSettings,h=p.careSettingsError,v=Yt((0,o.useState)(""),2),b=v[0],_=v[1],y=Yt((0,o.useState)(""),2),g=y[0],w=y[1],E=Yt((0,o.useState)(""),2),S=E[0],T=E[1],x=Yt((0,o.useState)(""),2),A=x[0],C=x[1],k=Yt((0,o.useState)(null),2),O=k[0],I=k[1],D=Yt((0,o.useState)(null),2),P=D[0],M=D[1],N=Yt((0,o.useState)(!1),2),Y=N[0],j=N[1];m&&(0,c.showToast)({title:r("error","Error"),kind:"error",critical:!0,description:null==m?void 0:m.message}),h&&(0,c.showToast)({title:r("error","Error"),kind:"error",critical:!0,description:null==h?void 0:h.message});var R=function(){var e,r=(e=a().mark((function e(){var r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return j(!0),r={selectedDrugs:O,selectedCareSetting:P,activeOnOrAfter:b,activeOnOrBefore:g,activatedOnOrAfter:S,activatedOnOrBefore:A},e.next=4,t(Pt(r),Dt(r));case 4:j(!1);case 5:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){Nt(o,n,a,i,l,"next",e)}function l(e){Nt(o,n,a,i,l,"throw",e)}i(void 0)}))});return function(){return r.apply(this,arguments)}}();return i().createElement(i().Fragment,null,i().createElement(l.Column,null,i().createElement("div",null,i().createElement(l.MultiSelect,{id:"drugs","data-testid":"drugs",onChange:function(e){return I(e.selectedItems)},items:d,label:r("selectDrugs","Select drugs")}))),i().createElement("div",{className:It.column},i().createElement(l.Column,null,i().createElement(l.Dropdown,{id:"careSettings","data-testid":"careSettings",onChange:function(e){return M(e.selectedItem)},initialSelectedItem:f[0],items:f,label:r("selectCareSettings","Select a care setting")}))),i().createElement("div",{className:It.column},i().createElement(l.Column,null,i().createElement(l.DatePicker,{datePickerType:"single",allowInput:!1,onChange:function(e){return _(Xe()(e[0]).format())}},i().createElement(l.DatePickerInput,{id:"activeOnOrAfter",labelText:r("using","Using between"),value:b&&Xe()(b).format("DD-MM-YYYY"),placeholder:"DD-MM-YYYY",size:"md"}))),i().createElement(l.Column,null,i().createElement(l.DatePicker,{datePickerType:"single",allowInput:!1,onChange:function(e){return w(Xe()(e[0]).format())}},i().createElement(l.DatePickerInput,{id:"activeOnOrBefore",value:g&&Xe()(g).format("DD-MM-YYYY"),labelText:r("to","to"),placeholder:"DD-MM-YYYY",size:"md"})))),i().createElement("div",{className:It.column},i().createElement(l.Column,null,i().createElement(l.DatePicker,{datePickerType:"single",allowInput:!1,onChange:function(e){return T(Xe()(e[0]).format())}},i().createElement(l.DatePickerInput,{id:"activatedOnOrAfter",labelText:r("used","Used between"),value:S&&Xe()(S).format("DD-MM-YYYY"),placeholder:"DD-MM-YYYY",size:"md"}))),i().createElement(l.Column,null,i().createElement(l.DatePicker,{datePickerType:"single",allowInput:!1,onChange:function(e){return C(Xe()(e[0]).format())}},i().createElement(l.DatePickerInput,{id:"activatedOnOrBefore",value:A&&Xe()(A).format("DD-MM-YYYY"),labelText:r("and","and"),placeholder:"DD-MM-YYYY",size:"md"})))),i().createElement(X,{onHandleReset:function(){I(null),M(null),_(""),w(""),T(""),C("")},onHandleSubmit:R,isLoading:Y}))};var Rt=r(3424),Zt={};Zt.styleTagTransform=O(),Zt.setAttributes=x(),Zt.insert=S().bind(null,"head"),Zt.domAPI=w(),Zt.insertStyleElement=C(),y()(Rt.Z,Zt);const Lt=Rt.Z&&Rt.Z.locals?Rt.Z.locals:void 0;var Bt=function(e){var t=e.selectedEncounterTypes,r=e.encounterLocations,n=e.encounterForms,a=e.atLeastCount,o=e.atMostCount,i=e.onOrAfter,l=e.onOrBefore,c="Patients with Encounter of",s=t.map((function(e){return e.label})).join(", ").replace(/,(?=[^,]*$)/," and ");return c+=s?" Type".concat(s.length>1?"s":""," ").concat(s):" any Type",r.length&&(c+=" at ".concat(r.map((function(e){return e.label})).join(", "))),n.length&&(c+=" from ".concat(n.map((function(e){return e.label})).join(", "))),a&&(c+=" at least ".concat(a," ").concat(a>1?"times":"time")),o&&(c+=" ".concat(a?" and":""," at most ").concat(o," ").concat(o>1?"times":"time")),i&&(c+=l?" from ".concat(i):" on or after ".concat(i)),l&&(c+=i?" to ".concat(l):" on or before ".concat(l)),c},qt=function(e){var t=e.onOrAfter,r=e.atLeastCount,n=e.atMostCount,a=e.encounterForms,o=e.encounterLocations,i=e.onOrBefore,l=e.selectedEncounterTypes,c={encounterSearchAdvanced:[]};return t&&c.encounterSearchAdvanced.push({name:"onOrAfter",value:t}),r&&c.encounterSearchAdvanced.push({name:"atLeastCount",value:r}),n&&c.encounterSearchAdvanced.push({name:"atMostCount",value:n}),a.length&&c.encounterSearchAdvanced.push({name:"formList",value:a.map((function(e){return e.value}))}),o.length&&c.encounterSearchAdvanced.push({name:"locationList",value:o.map((function(e){return e.value}))}),i&&c.encounterSearchAdvanced.push({name:"onOrBefore",value:i}),l.length>0&&c.encounterSearchAdvanced.push({name:"encounterTypeList",value:l.map((function(e){return e.value}))}),N(c)};function zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ht(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function Ft(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return zt(e,t);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)?zt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const Vt=function(e){var t=e.onSubmit,r=(0,s.useTranslation)().t,n=Ft((0,o.useState)(0),2),d=n[0],m=n[1],p=Ft((0,o.useState)(0),2),f=p[0],v=p[1],b=function(){var e=(0,u.Z)("/ws/rest/v1/encountertype",c.openmrsFetch),t=e.data,r=e.error,n=[];return null==t||t.data.results.map((function(e,t){n.push({id:t,label:e.display,value:e.uuid})})),{isLoading:!t&&!r,encounterTypes:n,encounterTypesError:r}}(),_=b.encounterTypes,y=b.encounterTypesError,g=Ft((0,o.useState)([]),2),w=g[0],E=g[1],S=Ft((0,o.useState)([]),2),T=S[0],x=S[1],A=Ft((0,o.useState)([]),2),C=A[0],k=A[1],O=h(),I=O.locations,D=O.locationsError,P=function(){var e=(0,u.Z)("/ws/rest/v1/form",c.openmrsFetch),t=e.data,r=e.error,n=[];return null==t||t.data.results.map((function(e,t){n.push({id:t,label:e.display,value:e.uuid})})),{isLoading:!t&&!r,forms:n,formsError:r}}(),M=P.forms,N=P.formsError,Y=Ft((0,o.useState)(""),2),j=Y[0],R=Y[1],Z=Ft((0,o.useState)(""),2),L=Z[0],B=Z[1],q=Ft((0,o.useState)(!1),2),z=q[0],H=q[1];D&&(0,c.showToast)({title:r("error","Error"),kind:"error",critical:!0,description:null==D?void 0:D.message}),N&&(0,c.showToast)({title:r("error","Error"),kind:"error",critical:!0,description:null==N?void 0:N.message}),y&&(0,c.showToast)({title:r("error","Error"),kind:"error",critical:!0,description:null==y?void 0:y.message});var F=function(){var e,r=(e=a().mark((function e(){var r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return H(!0),r={onOrAfter:L,atLeastCount:d,atMostCount:f,encounterForms:C,encounterLocations:T,onOrBefore:j,selectedEncounterTypes:w},e.next=4,t(qt(r),Bt(r));case 4:H(!1);case 5:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){Ht(o,n,a,i,l,"next",e)}function l(e){Ht(o,n,a,i,l,"throw",e)}i(void 0)}))});return function(){return r.apply(this,arguments)}}();return i().createElement(i().Fragment,null,i().createElement(l.Column,null,i().createElement("div",null,i().createElement(l.MultiSelect,{id:"encounters","data-testid":"encounters",onChange:function(e){return E(e.selectedItems)},items:_,label:r("selectEncounterTypes","Select encounter types")}))),i().createElement(l.MultiSelect,{id:"forms","data-testid":"forms",onChange:function(e){return k(e.selectedItems)},items:M,label:r("selectForms","Select forms")}),i().createElement(l.MultiSelect,{id:"locations","data-testid":"locations",onChange:function(e){return x(e.selectedItems)},items:I,label:r("selectLocations","Select locations")}),i().createElement("div",{className:Lt.column},i().createElement(l.Column,{className:Lt.encounterRange},i().createElement("div",{className:Lt.multipleInputs},i().createElement(l.NumberInput,{hideSteppers:!0,id:"atLeastCount","data-testid":"atLeastCount",label:r("atLeast","at least"),min:0,size:"sm",value:d,onChange:function(e,t){var r=t.value;return m(r)}})),i().createElement("div",{className:Lt.multipleInputs},i().createElement(l.NumberInput,{hideSteppers:!0,id:"atMostCount","data-testid":"atMostCount",label:r("upto","upto this many"),min:0,size:"sm",value:f,onChange:function(e,t){var r=t.value;return v(r)}})))),i().createElement("div",{className:Lt.column},i().createElement(l.Column,null,i().createElement(l.DatePicker,{datePickerType:"single",allowInput:!1,onChange:function(e){return B(Xe()(e[0]).format())}},i().createElement(l.DatePickerInput,{id:"onOrAfter",labelText:r("from","From"),value:L&&Xe()(L).format("DD-MM-YYYY"),placeholder:"DD-MM-YYYY",size:"md"}))),i().createElement(l.Column,null,i().createElement(l.DatePicker,{datePickerType:"single",allowInput:!1,onChange:function(e){return R(Xe()(e[0]).format())}},i().createElement(l.DatePickerInput,{id:"onOrBefore",value:j&&Xe()(j).format("DD-MM-YYYY"),labelText:r("to","to"),placeholder:"DD-MM-YYYY",size:"md"})))),i().createElement(X,{isLoading:z,onHandleSubmit:F,onHandleReset:function(){m(0),v(0),R(""),B("")}}))};var Ut=r(2632),Xt={};Xt.styleTagTransform=O(),Xt.setAttributes=x(),Xt.insert=S().bind(null,"head"),Xt.domAPI=w(),Xt.insertStyleElement=C(),y()(Ut.Z,Xt);const Wt=Ut.Z&&Ut.Z.locals?Ut.Z.locals:void 0;var Qt=function(e){var t=e.enrolledOnOrAfter,r=e.enrolledOnOrBefore,n=e.completedOnOrAfter,a=e.completedOnOrBefore,o=e.selectedPrograms,i=e.selectedLocations,l={patientsWithEnrollment:[{name:"programs",value:null==o?void 0:o.map((function(e){return e.value}))},t&&{name:"enrolledOnOrAfter",value:t},r&&{name:"enrolledOnOrBefore",value:r},n&&{name:"completedOnOrAfter",value:n},a&&{name:"completedOnOrBefore",value:a},{name:"locationList",value:null==i?void 0:i.map((function(e){return e.value}))}]};return N(l)},$t=function(e){var t=e.selectedPrograms,r=e.selectedLocations,n="Patients enrolled in ".concat(null==t?void 0:t.map((function(e){return e.label})).join(", "));return(null==r?void 0:r.length)&&(n+=" at ".concat(null==r?void 0:r.map((function(e){return e.label})).join(", "))),n};function Gt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Jt(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function Kt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Gt(e,t);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)?Gt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const er=function(e){var t=e.onSubmit,r=(0,s.useTranslation)().t,n=function(){var e=(0,u.Z)("/ws/rest/v1/program",c.openmrsFetch),t=e.data,r=e.error,n=[];return null==t||t.data.results.map((function(e,t){n.push({id:t,label:e.name,value:e.uuid})})),{isLoading:!t&&!r,programs:n,programsError:r}}(),d=n.programs,m=n.programsError,p=h(),f=p.locations,v=p.locationsError,b=Kt((0,o.useState)(""),2),_=b[0],y=b[1],g=Kt((0,o.useState)(""),2),w=g[0],E=g[1],S=Kt((0,o.useState)(""),2),T=S[0],x=S[1],A=Kt((0,o.useState)(""),2),C=A[0],k=A[1],O=Kt((0,o.useState)(null),2),I=O[0],D=O[1],P=Kt((0,o.useState)(null),2),M=P[0],N=P[1],Y=Kt((0,o.useState)(!1),2),j=Y[0],R=Y[1];m&&(0,c.showToast)({title:r("error","Error"),kind:"error",critical:!0,description:null==m?void 0:m.message}),v&&(0,c.showToast)({title:r("error","Error"),kind:"error",critical:!0,description:null==v?void 0:v.message});var Z=function(){var e,r=(e=a().mark((function e(){var r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return R(!0),r={enrolledOnOrAfter:_,enrolledOnOrBefore:w,completedOnOrAfter:T,completedOnOrBefore:C,selectedPrograms:M,selectedLocations:I},e.next=4,t(Qt(r),$t(r));case 4:R(!1);case 5:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){Jt(o,n,a,i,l,"next",e)}function l(e){Jt(o,n,a,i,l,"throw",e)}i(void 0)}))});return function(){return r.apply(this,arguments)}}();return i().createElement(i().Fragment,null,i().createElement(l.Column,null,i().createElement("div",null,i().createElement(l.MultiSelect,{id:"programs","data-testid":"programs",onChange:function(e){return N(e.selectedItems)},items:d,label:r("selectPrograms","Select programs")}))),i().createElement(l.Column,null,i().createElement("div",null,i().createElement(l.MultiSelect,{id:"locations","data-testid":"locations",onChange:function(e){return D(e.selectedItems)},items:f,label:r("selectLocations","Select locations")}))),i().createElement("div",{className:Wt.column},i().createElement(l.Column,null,i().createElement(l.DatePicker,{datePickerType:"single",allowInput:!1,onChange:function(e){return y(Xe()(e[0]).format())}},i().createElement(l.DatePickerInput,{id:"enrolledOnOrAfter",labelText:r("enrolledBetween","Enrolled between"),value:_&&Xe()(_).format("DD-MM-YYYY"),placeholder:"DD-MM-YYYY",size:"md"}))),i().createElement(l.Column,null,i().createElement(l.DatePicker,{datePickerType:"single",allowInput:!1,onChange:function(e){return E(Xe()(e[0]).format())}},i().createElement(l.DatePickerInput,{id:"enrolledOnOrBefore",labelText:r("and","and"),value:w&&Xe()(w).format("DD-MM-YYYY"),placeholder:"DD-MM-YYYY",size:"md"})))),i().createElement("div",{className:Wt.column},i().createElement(l.Column,null,i().createElement(l.DatePicker,{datePickerType:"single",allowInput:!1,onChange:function(e){return x(Xe()(e[0]).format())}},i().createElement(l.DatePickerInput,{id:"completedOnOrAfter",labelText:r("completedBetween","Completed between"),value:T&&Xe()(T).format("DD-MM-YYYY"),placeholder:"DD-MM-YYYY",size:"md"}))),i().createElement(l.Column,null,i().createElement(l.DatePicker,{datePickerType:"single",allowInput:!1,onChange:function(e){return k(Xe()(e[0]).format())}},i().createElement(l.DatePickerInput,{id:"completedOnOrBefore",labelText:r("and","and"),value:C&&Xe()(C).format("DD-MM-YYYY"),placeholder:"DD-MM-YYYY",size:"md"})))),i().createElement(X,{onHandleReset:function(){N(null),y(""),E(""),x(""),k("")},onHandleSubmit:Z,isLoading:j}))};var tr=r(9060),rr={};rr.styleTagTransform=O(),rr.setAttributes=x(),rr.insert=S().bind(null,"head"),rr.domAPI=w(),rr.insertStyleElement=C(),y()(tr.Z,rr);const nr=tr.Z&&tr.Z.locals?tr.Z.locals:void 0;var ar=function(e,t){var r=[];return null==t||t.map((function(e){return r.push(e.value)})),N({encounterSearchAdvanced:[{name:"locationList",value:r},{name:"timeQualifier",value:e}]})},or=function(e,t){var r="Patients in ".concat(null==t?void 0:t.map((function(e){return e.label})).join(", "));switch(e){case"FIRST":r+=" (by method EARLIEST_ENCOUNTER).";break;case"LAST":r+=" (by method LATEST_ENCOUNTER).";break;default:r+=" (by method ANY_ENCOUNTER)."}return r};function ir(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function lr(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function cr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ir(e,t);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)?ir(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const sr=function(e){var t=e.onSubmit,r=(0,s.useTranslation)().t,n=[{id:0,label:r("anyEncounter","Any Encounter"),value:"ANY"},{id:1,label:r("mostRecentEncounter","Most Recent Encounter"),value:"LAST"},{id:2,label:r("earliestEncounter","Earliest Encounter"),value:"FIRST"}],u=h(),d=u.locations,m=u.locationsError,p=cr((0,o.useState)(null),2),f=p[0],v=p[1],b=cr((0,o.useState)(n[0]),2),_=b[0],y=b[1],g=cr((0,o.useState)(!1),2),w=g[0],E=g[1];m&&(0,c.showToast)({title:r("error","Error"),kind:"error",critical:!0,description:null==m?void 0:m.message});var S=function(){var e,r=(e=a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return E(!0),e.next=3,t(ar(_.value,f),or(_.label,f));case 3:E(!1);case 4:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){lr(o,n,a,i,l,"next",e)}function l(e){lr(o,n,a,i,l,"throw",e)}i(void 0)}))});return function(){return r.apply(this,arguments)}}();return i().createElement(i().Fragment,null,i().createElement(l.Column,null,i().createElement("div",null,i().createElement(l.MultiSelect,{id:"locations","data-testid":"locations",onChange:function(e){return v(e.selectedItems)},items:d,label:r("selectLocations","Select locations")}))),i().createElement("div",{className:nr.column},i().createElement(l.Column,null,i().createElement(l.Dropdown,{id:"methods","data-testid":"methods",onChange:function(e){return y(e.selectedItem)},initialSelectedItem:n[0],items:n,label:r("selectMethod","Select a method")}))),i().createElement(X,{onHandleReset:function(){v(null),y(null)},onHandleSubmit:S,isLoading:w}))};var ur=r(4584),dr={};dr.styleTagTransform=O(),dr.setAttributes=x(),dr.insert=S().bind(null,"head"),dr.domAPI=w(),dr.insertStyleElement=C(),y()(ur.Z,dr);const mr=ur.Z&&ur.Z.locals?ur.Z.locals:void 0;var pr=function(e,t){var r="Patients",n=t.length>0?t.join(", ").replace(/,(?=[^,]*$)/," or"):"";return(r+=e?" with".concat(n?"":" any"," ").concat(e):e)+(n?" equal to ".concat(n.length>1&&"either"," ").concat(n):"")};function fr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function hr(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function vr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return fr(e,t);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)?fr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const br=function(e){var t=e.onSubmit,r=(0,s.useTranslation)().t,n=function(){var e=(0,u.Z)("/ws/rest/v1/personattributetype",c.openmrsFetch),t=e.data,r=e.error,n=[];return null==t||t.data.results.map((function(e,t){n.push({id:t,label:e.display,value:e.uuid})})),{isLoading:!t&&!r,personAttributes:n,personAttributesError:r}}(),d=n.personAttributes,m=n.personAttributesError,p=vr((0,o.useState)([]),2),f=p[0],h=p[1],v=vr((0,o.useState)(null),2),b=v[0],_=v[1],y=vr((0,o.useState)(!1),2),g=y[0],w=y[1];m&&(0,c.showToast)({title:r("error","Error"),kind:"error",critical:!0,description:null==m?void 0:m.message});var E=function(){var e,r=(e=a().mark((function e(){var r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(!0),r=null==d?void 0:d.find((function(e){return e.value==b})),e.next=4,t(N({personWithAttribute:[{name:"attributeType",value:b},{name:"values",value:f}]}),pr(null==r?void 0:r.label,f));case 4:w(!1);case 5:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){hr(o,n,a,i,l,"next",e)}function l(e){hr(o,n,a,i,l,"throw",e)}i(void 0)}))});return function(){return r.apply(this,arguments)}}();return i().createElement(i().Fragment,null,i().createElement(l.Column,null,i().createElement("div",null,i().createElement(l.Dropdown,{id:"personAttributes","data-testid":"personAttributes",onChange:function(e){return _(e.selectedItem.value)},items:d,label:r("selectAttribute","Select a person attribute")}))),i().createElement("div",{className:mr.column},i().createElement(l.Column,null,i().createElement(l.TextInput,{id:"selectedAttributeValues","data-testid":"selectedAttributeValues",disabled:!b,labelText:r("selectedAttributeValues","Enter Comma Delimited Values"),onChange:function(e){return h(e.target.value.trim().split(","))}}))),i().createElement(X,{onHandleReset:function(){_(null),h([])},onHandleSubmit:E,isLoading:g}))};function _r(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function yr(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){_r(o,n,a,i,l,"next",e)}function l(e){_r(o,n,a,i,l,"throw",e)}i(void 0)}))}}function gr(e){return wr.apply(this,arguments)}function wr(){return(wr=yr(a().mark((function e(t){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,c.openmrsFetch)("/ws/rest/v1/cohort",{method:"POST",headers:{"Content-Type":"application/json"},body:t});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Er(e){return Sr.apply(this,arguments)}function Sr(){return(Sr=yr(a().mark((function e(t){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,c.openmrsFetch)("/ws/rest/v1/reportingrest/adhocdataset",{method:"POST",headers:{"Content-Type":"application/json"},body:t});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Tr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xr(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function Ar(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){xr(o,n,a,i,l,"next",e)}function l(e){xr(o,n,a,i,l,"throw",e)}i(void 0)}))}}function Cr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Tr(e,t);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)?Tr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var kr;!function(e){e[e.SAVE_COHORT=0]="SAVE_COHORT",e[e.SAVE_QUERY=1]="SAVE_QUERY",e[e.DOWNLOAD=2]="DOWNLOAD",e[e.DELETE=3]="DELETE"}(kr||(kr={}));const Or=function(e){var t=e.searchItem,r=e.updateSearchHistory,n=(0,s.useTranslation)().t,u=Cr((0,o.useState)(""),2),d=u[0],m=u[1],p=Cr((0,o.useState)(""),2),f=p[0],h=p[1],v=Cr((0,o.useState)(""),2),b=v[0],_=v[1],y=Cr((0,o.useState)(""),2),g=y[0],w=y[1],E=Cr((0,o.useState)(!1),2),S=E[0],T=E[1],x=Cr((0,o.useState)(!1),2),A=x[0],C=x[1],k=Cr((0,o.useState)(!1),2),O=k[0],I=k[1],D=function(){var e=Ar(a().mark((function e(r){var n,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.patients,o=t.description,e.t0=r,e.next=e.t0===kr.SAVE_COHORT?4:e.t0===kr.SAVE_QUERY?7:e.t0===kr.DOWNLOAD?10:e.t0===kr.DELETE?12:14;break;case 4:return h(o),C(!0),e.abrupt("break",14);case 7:return w(o),I(!0),e.abrupt("break",14);case 10:return H(n,o),e.abrupt("break",14);case 12:return T(!0),e.abrupt("break",14);case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),P=function(){var e=Ar(a().mark((function e(){var r,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=[],t.patients.forEach((function(e){return r.push(parseInt(e.id))})),o={display:d,memberIds:r,description:f,name:d},e.prev=4,e.next=7,gr(o);case 7:m(""),h(""),C(!1),(0,c.showToast)({title:n("success","Success"),kind:"success",critical:!0,description:"the cohort is saved"}),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(4),(0,c.showToast)({title:n("cohortCreateError","Error creating the cohort"),kind:"error",critical:!0,description:null===e.t0||void 0===e.t0?void 0:e.t0.message});case 16:case"end":return e.stop()}}),e,null,[[4,13]])})));return function(){return e.apply(this,arguments)}}(),M=function(){var e=Ar(a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{r(t),T(!1),(0,c.showToast)({title:n("success","Success"),kind:"success",critical:!0,description:"the search item is deleted"})}catch(e){(0,c.showToast)({title:n("searchItemDeleteError","Error deleting the cohort"),kind:"error",critical:!0,description:null==e?void 0:e.message})}case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=function(){var e=Ar(a().mark((function e(){var r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(r=t.parameters).name=b,r.description=g,e.next=6,Er(r);case 6:_(""),w(""),I(!1),(0,c.showToast)({title:n("success","Success"),kind:"success",critical:!0,description:"the query is saved"}),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),(0,c.showToast)({title:n("queryDeleteError","Error saving the query"),kind:"error",critical:!0,description:null===e.t0||void 0===e.t0?void 0:e.t0.message});case 15:case"end":return e.stop()}}),e,null,[[0,12]])})));return function(){return e.apply(this,arguments)}}();return i().createElement(i().Fragment,null,i().createElement(l.OverflowMenu,{ariaLabel:"overflow-menu",size:"md",flipped:!0,direction:"top","data-testid":"options"},i().createElement(l.OverflowMenuItem,{"data-testid":"save-cohort",itemText:n("saveCohort","Save Cohort"),onClick:function(){return D(kr.SAVE_COHORT)}}),i().createElement(l.OverflowMenuItem,{"data-testid":"save-query",itemText:n("saveQuery","Save Query"),onClick:function(){return D(kr.SAVE_QUERY)}}),i().createElement(l.OverflowMenuItem,{itemText:n("downloadResults","Download Results"),onClick:function(){return D(kr.DOWNLOAD)}}),i().createElement(l.OverflowMenuItem,{"data-testid":"deleteFromHistory",itemText:n("deleteFromHistory","Delete from history"),onClick:function(){return D(kr.DELETE)}})),i().createElement(l.ComposedModal,{size:"sm",open:A,onClose:function(){return C(!1)}},i().createElement(l.ModalHeader,null,i().createElement("p",null,"Save Cohort")),i().createElement(l.ModalBody,{hasForm:!0},i().createElement(l.TextInput,{"data-modal-primary-focus":!0,required:!0,labelText:n("saveName","Enter a name"),"data-testid":"cohort-name",id:"cohort-name",onChange:function(e){return m(e.target.value)},value:d}),i().createElement("br",null),i().createElement(l.TextInput,{"data-modal-primary-focus":!0,required:!0,labelText:n("saveDescription","Enter a description"),"data-testid":"cohort-description",id:"cohort-description",onChange:function(e){return h(e.target.value)},value:f})),i().createElement(l.ModalFooter,null,i().createElement(l.Button,{kind:"secondary",onClick:function(){return C(!1)}},n("cancel","Cancel")),i().createElement(l.Button,{"data-testid":"cohort-save-button",kind:"primary",onClick:P},n("save","Save")))),i().createElement(l.ComposedModal,{size:"sm",open:O,onClose:function(){return I(!1)}},i().createElement(l.ModalHeader,null,i().createElement("p",null,"Save Query")),i().createElement(l.ModalBody,{hasForm:!0},i().createElement(l.TextInput,{required:!0,labelText:n("saveName","Enter a name"),id:"query-name","data-testid":"query-name",onChange:function(e){return _(e.target.value)},value:b}),i().createElement("br",null),i().createElement(l.TextInput,{required:!0,labelText:n("saveDescription","Enter a description"),id:"query-description",onChange:function(e){return w(e.target.value)},value:g})),i().createElement(l.ModalFooter,null,i().createElement(l.Button,{kind:"secondary",onClick:function(){return I(!1)}},n("cancel","Cancel")),i().createElement(l.Button,{"data-testid":"query-save-button",kind:"primary",onClick:N},n("save","Save")))),i().createElement(l.ComposedModal,{size:"sm",open:S,onClose:function(){return T(!1)}},i().createElement(l.ModalHeader,null,i().createElement("p",null,n("deleteHistoryItem","Are you sure you want to delete ".concat(null==t?void 0:t.description," from the search history?"),{searchItemName:null==t?void 0:t.description}))),i().createElement(l.ModalFooter,{danger:!0,onRequestSubmit:M,primaryButtonText:n("delete","Delete"),secondaryButtonText:n("cancel","Cancel")})))};var Ir=r(4345),Dr={};Dr.styleTagTransform=O(),Dr.setAttributes=x(),Dr.insert=S().bind(null,"head"),Dr.domAPI=w(),Dr.insertStyleElement=C(),y()(Ir.Z,Dr);const Pr=Ir.Z&&Ir.Z.locals?Ir.Z.locals:void 0;function Mr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Nr=function(){var e=JSON.parse(window.sessionStorage.getItem("openmrsHistory")),t=[];return null==e||e.map((function(e,r){return t.push((n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Mr(e,t,r[t])}))}return e}({},e),a=null!=(a={id:(r+1).toString(),results:e.patients.length})?a:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(a)):function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}(Object(a)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(a,e))})),n));var n,a})),t};function Yr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function jr(){return jr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jr.apply(this,arguments)}function Rr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||Zr(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zr(e,t){if(e){if("string"==typeof e)return Yr(e,t);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)?Yr(e,t):void 0}}const Lr=function(e){var t=e.isHistoryUpdated,r=e.setIsHistoryUpdated,n=(0,s.useTranslation)().t,a=Rr((0,o.useState)([]),2),c=a[0],u=a[1],d=Rr((0,o.useState)(1),2),m=d[0],p=d[1],f=Rr((0,o.useState)(10),2),h=f[0],v=f[1],b=Rr((0,o.useState)(!1),2),_=b[0],y=b[1];(0,o.useEffect)((function(){t&&(u(Nr()),r(!1))}),[t,r]);var g=[{key:"id",header:"#"},{key:"description",header:n("query","Query")},{key:"results",header:n("results","Results")}],w=function(e){var t,r=(t=c,function(e){if(Array.isArray(e))return Yr(e)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||Zr(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.")}()).filter((function(t,r){return r!=c.indexOf(e)}));u(r),window.sessionStorage.setItem("openmrsHistory",JSON.stringify(r))};return i().createElement("div",{className:Pr.container},i().createElement("div",{className:Pr.header},i().createElement("p",{className:P.heading},n("searchHistory","Search History")),c.length>0&&i().createElement(l.Button,{kind:"danger--tertiary",onClick:function(){return y(!0)}},n("clearHistory","Clear Search History"))),i().createElement(l.DataTable,{rows:c,headers:g,useZebraStyles:!0},(function(e){var t=e.rows,r=e.headers,n=e.getTableProps,a=e.getHeaderProps,o=e.getRowProps;return i().createElement(l.Table,jr({},n()),i().createElement(l.TableHead,null,i().createElement(l.TableRow,null,r.map((function(e){return i().createElement(l.TableHeader,jr({},a({header:e})),e.header)})),i().createElement(l.TableHeader,{className:P.optionHeader}))),i().createElement(l.TableBody,null,t.slice((m-1)*h).slice(0,h).map((function(e,t){return i().createElement(l.TableRow,jr({},o({row:e})),e.cells.map((function(e){return i().createElement(l.TableCell,{key:e.id},e.value)})),i().createElement(l.TableCell,{className:P.optionCell},i().createElement(Or,{searchItem:c[t],updateSearchHistory:w})))}))))})),c.length>10&&i().createElement(l.Pagination,{backwardText:n("previousPage","Previous page"),forwardText:n("nextPage","Next page"),itemsPerPageText:n("itemsPerPage:","Items per page:"),onChange:function(e){var t=e.page,r=e.pageSize;p(t),v(r)},page:1,pageSize:10,pageSizes:[10,20,30,40,50],size:"md",totalItems:c.length}),!c.length&&i().createElement(le,{displayText:n("data","data")}),i().createElement(l.ComposedModal,{size:"sm",open:_,onClose:function(){return y(!1)}},i().createElement(l.ModalHeader,null,i().createElement("p",null,n("clearHistoryMsg","Are you sure you want to clear the search history?"))),i().createElement(l.ModalFooter,{danger:!0,onRequestSubmit:function(){window.sessionStorage.removeItem("openmrsHistory"),u([]),y(!1)},primaryButtonText:n("clear","Clear"),secondaryButtonText:n("cancel","Cancel")})))};var Br=r(8836),qr={};qr.styleTagTransform=O(),qr.setAttributes=x(),qr.insert=S().bind(null,"head"),qr.domAPI=w(),qr.insertStyleElement=C(),y()(Br.Z,qr);const zr=Br.Z&&Br.Z.locals?Br.Z.locals:void 0;function Hr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Fr(){return Fr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fr.apply(this,arguments)}function Vr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Hr(e,t);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)?Hr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const Ur=function(e){var t=e.patients,r=Vr((0,o.useState)(1),2),n=r[0],a=r[1],c=Vr((0,o.useState)(10),2),u=c[0],d=c[1],m=(0,s.useTranslation)().t,p=[{key:"id",header:m("openmrsId","OpenMRS ID")},{key:"name",header:m("name","Name")},{key:"age",header:m("age","Age")},{key:"gender",header:m("gender","Gender")}];return i().createElement("div",{className:zr.container},i().createElement("p",{className:P.heading},m("searchResults","Search Results")),i().createElement(l.DataTable,{rows:t,headers:p,useZebraStyles:!0},(function(e){var t=e.rows,r=e.headers,a=e.getTableProps,o=e.getHeaderProps,c=e.getRowProps;return i().createElement(l.Table,Fr({},a()),i().createElement(l.TableHead,null,i().createElement(l.TableRow,null,r.map((function(e){return i().createElement(l.TableHeader,Fr({},o({header:e})),e.header)})))),i().createElement(l.TableBody,null,t.slice((n-1)*u).slice(0,u).map((function(e,t){return i().createElement(l.TableRow,Fr({},c({row:e}),{key:t}),e.cells.map((function(e,t){return i().createElement(l.TableCell,{key:t},e.value)})))}))))})),t.length>10&&i().createElement(l.Pagination,{backwardText:m("previousPage","Previous page"),forwardText:m("nextPage","Next page"),itemsPerPageText:m("itemsPerPage:","Items per page:"),onChange:function(e){var t=e.page,r=e.pageSize;a(t),d(r)},page:1,pageSize:10,pageSizes:[10,20,30,40,50],size:"md",totalItems:t.length}),!t.length&&i().createElement(le,{displayText:m("data","data")}))};function Xr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Wr(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function Qr(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){Wr(o,n,a,i,l,"next",e)}function l(e){Wr(o,n,a,i,l,"throw",e)}i(void 0)}))}}function $r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Xr(e,t);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)?Xr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const Gr=function(){var e=(0,s.useTranslation)().t,t=$r((0,o.useState)([]),2),r=t[0],n=t[1],u=$r((0,o.useState)(!0),2),d=u[0],m=u[1],p="tablet"===(0,c.useLayoutType)(),h=function(t,r){return new Promise(function(){var o=Qr(a().mark((function o(i){var l,s;return a().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n([]),a.prev=1,a.next=4,f(t);case 4:l=a.sent,(s=l.data.rows).map((function(e){e.id=e.patientId.toString(),e.name="".concat(e.firstname," ").concat(e.lastname)})),n(s),B(r,s,t.query),(0,c.showToast)({title:e("success","Success!"),kind:"success",critical:!0,description:e("searchIsCompleted","Search is completed with ".concat(s.length," result(s)"),{numOfResults:s.length})}),m(!0),i(!0),a.next=18;break;case 14:a.prev=14,a.t0=a.catch(1),(0,c.showToast)({title:e("error","Error"),kind:"error",critical:!0,description:null===a.t0||void 0===a.t0?void 0:a.t0.message}),i(!0);case 18:case"end":return a.stop()}}),o,null,[[1,14]])})));return function(e){return o.apply(this,arguments)}}())},_=function(){var t=Qr(a().mark((function t(r){var o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,v(r);case 3:o=t.sent,n(o),(0,c.showToast)({title:e("success","Success!"),kind:"success",critical:!0,description:e("searchIsCompleted","Search is completed with ".concat(o.length," result(s)"),{numOfResults:o.length})}),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),(0,c.showToast)({title:e("error","Error"),kind:"error",critical:!0,description:null===t.t0||void 0===t.t0?void 0:t.t0.message});case 11:case"end":return t.stop()}}),t,null,[[0,8]])})));return function(e){return t.apply(this,arguments)}}(),y=function(){var t=Qr(a().mark((function t(r){var o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,b(r);case 3:o=t.sent,n(o),(0,c.showToast)({title:e("success","Success!"),kind:"success",critical:!0,description:e("searchIsCompleted","Search is completed with ".concat(o.length," result(s)"),{numOfResults:o.length})}),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),(0,c.showToast)({title:e("error","Error"),kind:"error",critical:!0,description:null===t.t0||void 0===t.t0?void 0:t.t0.message});case 11:case"end":return t.stop()}}),t,null,[[0,8]])})));return function(e){return t.apply(this,arguments)}}(),g=[{name:e("concepts","Concepts"),component:i().createElement(vt,{onSubmit:h})},{name:e("demographics","Demographics"),component:i().createElement(Ct,{onSubmit:h})},{name:e("personAttributes","Person Attributes"),component:i().createElement(br,{onSubmit:h})},{name:e("encounters","Encounters"),component:i().createElement(Vt,{onSubmit:h})},{name:e("location","Location"),component:i().createElement(sr,{onSubmit:h})},{name:e("enrollments","Enrollments"),component:i().createElement(er,{onSubmit:h})},{name:e("drugOrder","Drug Order"),component:i().createElement(jt,{onSubmit:h})},{name:e("composition","Composition"),component:i().createElement(re,{onSubmit:h})},{name:e("savedDefinitions","Saved Cohorts"),component:i().createElement(Ae,{onViewCohort:y})},{name:e("savedDefinitions","Saved Queries"),component:i().createElement(Ve,{onViewQuery:_})}];return i().createElement("div",{className:"omrs-main-content ".concat(P.mainContainer," ").concat(P.cohortBuilder)},i().createElement("div",{className:p?P.tabletContainer:P.desktopContainer},i().createElement("p",{className:P.title},e("cohortBuilder","Cohort Builder")),i().createElement("div",{className:P.tabContainer},i().createElement("p",{className:P.heading},e("searchCriteria","Search Criteria")),i().createElement("div",{className:P.tab},i().createElement(l.Tabs,{className:"".concat(P.verticalTabs," ").concat(p?P.tabletTab:P.desktopTab)},i().createElement(l.TabList,{"aria-label":"navigation"},g.map((function(e,t){return i().createElement(l.Tab,{key:t},e.name)}))),i().createElement(l.TabPanels,null,g.map((function(e,t){return i().createElement(l.TabPanel,{key:t},e.component)})))))),i().createElement(Ur,{patients:r}),i().createElement(Lr,{isHistoryUpdated:d,setIsHistoryUpdated:m})))}},7503:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(8081),a=r.n(n),o=r(3645),i=r.n(o)()(a());i.push([e.id,".-esm-cohort-builder__composition-style__text____ADAb {\n font-size: 0.85rem;\n}\n",""]),i.locals={text:"-esm-cohort-builder__composition-style__text____ADAb"};const l=i},6794:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(8081),a=r.n(n),o=r(3645),i=r.n(o)()(a());i.push([e.id,".-esm-cohort-builder__search-button-set__container___F_25r {\n padding-bottom: 0.5rem;\n padding-top: 1rem;\n}\n\n.-esm-cohort-builder__search-button-set__buttonSet___c6nzV {\n justify-content: end;\n}\n\n",""]),i.locals={container:"-esm-cohort-builder__search-button-set__container___F_25r",buttonSet:"-esm-cohort-builder__search-button-set__buttonSet___c6nzV"};const l=i},1229:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(8081),a=r.n(n),o=r(3645),i=r.n(o)()(a());i.push([e.id,".-esm-cohort-builder__search-concept-style__search___sLfGj {\n max-height: 400px;\n overflow: scroll;\n position: absolute;\n z-index: 2;\n width: 33%;\n background: #f0eeee;\n}\n\n.-esm-cohort-builder__search-concept-style__concept___eXXiX {\n font-weight: bold;\n}\n\n.-esm-cohort-builder__search-concept-style__text___oXP1o {\n padding-top: 1.5rem;\n}\n\n.-esm-cohort-builder__search-concept-style__notification___ObL9P {\n position: fixed;\n left: 50%;\n bottom: 20px;\n transform: translate(-50%, -50%);\n margin: 0 auto;\n z-index: 1;\n}\n",""]),i.locals={search:"-esm-cohort-builder__search-concept-style__search___sLfGj",concept:"-esm-cohort-builder__search-concept-style__concept___eXXiX",text:"-esm-cohort-builder__search-concept-style__text___oXP1o",notification:"-esm-cohort-builder__search-concept-style__notification___ObL9P"};const l=i},3059:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(8081),a=r.n(n),o=r(3645),i=r.n(o)()(a());i.push([e.id,':root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-cohort-builder__cohort-builder__heading___otYR5{font-size:var(--cds-productive-heading-02-font-size, 1rem);font-weight:var(--cds-productive-heading-02-font-weight, 600);line-height:var(--cds-productive-heading-02-line-height, 1.375);letter-spacing:var(--cds-productive-heading-02-letter-spacing, 0);color:#525252;margin-bottom:1rem}.-esm-cohort-builder__cohort-builder__heading___otYR5:after{content:"";display:block;width:2rem;padding-top:.188rem;border-bottom:.375rem solid var(--brand-03)}.-esm-cohort-builder__cohort-builder__mainContainer___xMxRR{padding-bottom:1.5rem;background:#f4f4f4;display:flex;justify-content:center}.-esm-cohort-builder__cohort-builder__title___Yjwtl{padding:1rem;font-size:1.2rem}.-esm-cohort-builder__cohort-builder__desktopContainer___OyeBq{width:50%}.-esm-cohort-builder__cohort-builder__tabletContainer___JTNVc{width:90%}.-esm-cohort-builder__cohort-builder__cohortBuilder___Rr96n .cds--date-picker.cds--date-picker--single .cds--date-picker__input{width:auto}.-esm-cohort-builder__cohort-builder__cohortBuilder___Rr96n .cds--tab-content{width:80%;padding:0}.-esm-cohort-builder__cohort-builder__cohortBuilder___Rr96n .cds--inline-loading__text{color:#fff}.-esm-cohort-builder__cohort-builder__cohortBuilder___Rr96n .cds--tab--list{flex-direction:column;margin:1rem}.-esm-cohort-builder__cohort-builder__cohortBuilder___Rr96n .cds--tabs{width:auto;max-height:100%}.-esm-cohort-builder__cohort-builder__cohortBuilder___Rr96n .cds--tabs .cds--tabs__nav-link{border-bottom:0;border-left:3px solid #e0e0e0}.-esm-cohort-builder__cohort-builder__cohortBuilder___Rr96n .cds--tabs .cds--tabs__nav-item--selected{border-left:3px solid var(--brand-03);border-bottom:0;font-weight:600}.-esm-cohort-builder__cohort-builder__cohortBuilder___Rr96n .cds--number{width:68%}.-esm-cohort-builder__cohort-builder__cohortBuilder___Rr96n .cds--tabs__nav-link:active,.-esm-cohort-builder__cohort-builder__cohortBuilder___Rr96n .cds--tabs__nav-link:focus{outline:0 !important;outline-offset:0 !important}.-esm-cohort-builder__cohort-builder__cohortBuilder___Rr96n .cds--multi-select__wrapper .cds--list-box__wrapper{width:90% !important}.-esm-cohort-builder__cohort-builder__cohortBuilder___Rr96n .cds--col{padding-left:0;width:100%}.-esm-cohort-builder__cohort-builder__tabletTab___fZbR8{width:25%}.-esm-cohort-builder__cohort-builder__desktopTab___Sv4Cx{width:20%}.-esm-cohort-builder__cohort-builder__tab___nvwB9{display:flex}.-esm-cohort-builder__cohort-builder__tabContainer___C02tj{background:#fff;padding-left:1.5rem;padding-right:1rem;padding-top:1rem;margin-bottom:1rem}.-esm-cohort-builder__cohort-builder__optionCell___RXDE6{padding:0 !important}.-esm-cohort-builder__cohort-builder__optionHeader___mtjt_{width:1.5rem !important}.-esm-cohort-builder__cohort-builder__text___uI8jH{font-size:.9rem;padding:.5rem}',""]),i.locals={heading:"-esm-cohort-builder__cohort-builder__heading___otYR5",mainContainer:"-esm-cohort-builder__cohort-builder__mainContainer___xMxRR",title:"-esm-cohort-builder__cohort-builder__title___Yjwtl",desktopContainer:"-esm-cohort-builder__cohort-builder__desktopContainer___OyeBq",tabletContainer:"-esm-cohort-builder__cohort-builder__tabletContainer___JTNVc",cohortBuilder:"-esm-cohort-builder__cohort-builder__cohortBuilder___Rr96n",tabletTab:"-esm-cohort-builder__cohort-builder__tabletTab___fZbR8",desktopTab:"-esm-cohort-builder__cohort-builder__desktopTab___Sv4Cx",tab:"-esm-cohort-builder__cohort-builder__tab___nvwB9",tabContainer:"-esm-cohort-builder__cohort-builder__tabContainer___C02tj",optionCell:"-esm-cohort-builder__cohort-builder__optionCell___RXDE6",optionHeader:"-esm-cohort-builder__cohort-builder__optionHeader___mtjt_",text:"-esm-cohort-builder__cohort-builder__text___uI8jH"};const l=i},5014:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(8081),a=r.n(n),o=r(3645),i=r.n(o)()(a());i.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-cohort-builder__empty-data-style__action___DgAh1{margin-bottom:.5rem}.-esm-cohort-builder__empty-data-style__content___TqPkA{font-size:var(--cds-productive-heading-01-font-size, 0.875rem);font-weight:var(--cds-productive-heading-01-font-weight, 600);line-height:var(--cds-productive-heading-01-line-height, 1.28572);letter-spacing:var(--cds-productive-heading-01-letter-spacing, 0.16px);color:#525252;margin-top:1rem;margin-bottom:.5rem}.-esm-cohort-builder__empty-data-style__tile___ZNJVK{text-align:center;border:1px solid #e0e0e0}",""]),i.locals={action:"-esm-cohort-builder__empty-data-style__action___DgAh1",content:"-esm-cohort-builder__empty-data-style__content___TqPkA",tile:"-esm-cohort-builder__empty-data-style__tile___ZNJVK"};const l=i},7735:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(8081),a=r.n(n),o=r(3645),i=r.n(o)()(a());i.push([e.id,".-esm-cohort-builder__saved-cohorts__container___VnBfi{background:#fff;padding:1rem}.-esm-cohort-builder__saved-cohorts__searchContainer___J85ly{display:flex;margin-bottom:2rem}.-esm-cohort-builder__saved-cohorts__searchBtn___tBqPw .cds--btn{min-height:1rem}",""]),i.locals={container:"-esm-cohort-builder__saved-cohorts__container___VnBfi",searchContainer:"-esm-cohort-builder__saved-cohorts__searchContainer___J85ly",searchBtn:"-esm-cohort-builder__saved-cohorts__searchBtn___tBqPw"};const l=i},8199:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(8081),a=r.n(n),o=r(3645),i=r.n(o)()(a());i.push([e.id,".-esm-cohort-builder__saved-queries__container___xXNUy{background:#fff;padding:1rem}.-esm-cohort-builder__saved-queries__searchContainer____r94H{display:flex;margin-bottom:2rem}.-esm-cohort-builder__saved-queries__searchBtn___fSjSZ .cds--btn{min-height:1rem}.-esm-cohort-builder__saved-queries__optionCell___Yd5V1{padding:0 !important}.-esm-cohort-builder__saved-queries__optionHeader___iiD9c{width:1.5rem !important}",""]),i.locals={container:"-esm-cohort-builder__saved-queries__container___xXNUy",searchContainer:"-esm-cohort-builder__saved-queries__searchContainer____r94H",searchBtn:"-esm-cohort-builder__saved-queries__searchBtn___fSjSZ",optionCell:"-esm-cohort-builder__saved-queries__optionCell___Yd5V1",optionHeader:"-esm-cohort-builder__saved-queries__optionHeader___iiD9c"};const l=i},4675:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(8081),a=r.n(n),o=r(3645),i=r.n(o)()(a());i.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{padding:0;border:0;margin:0;font:inherit;font-size:100%;vertical-align:baseline}button,select,input,textarea{border-radius:0;font-family:inherit}input[type=text]::-ms-clear{display:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section{display:block}body{line-height:1}sup{vertical-align:super}sub{vertical-align:sub}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote::before,blockquote::after,q::before,q::after{content:\"\"}table{border-collapse:collapse;border-spacing:0}*{box-sizing:border-box}button{margin:0}html{font-size:100%}body{font-weight:400;font-family:'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}code{font-family:'IBM Plex Mono', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace}strong{font-weight:600}@media screen and (-ms-high-contrast: active){svg{fill:ButtonText}}h1{font-size:2.625rem;font-weight:300;line-height:1.199;letter-spacing:0}h2{font-size:2rem;font-weight:400;line-height:1.25;letter-spacing:0}h3{font-size:1.75rem;font-weight:400;line-height:1.28572;letter-spacing:0}h4{font-size:1.25rem;font-weight:400;line-height:1.4;letter-spacing:0}h5{font-size:1rem;font-weight:600;line-height:1.375;letter-spacing:0}h6{font-size:.875rem;font-weight:600;line-height:1.28572;letter-spacing:.16px}p{font-size:1rem;font-weight:400;line-height:1.5;letter-spacing:0}a{color:#0f62fe}em{font-style:italic}@keyframes -esm-cohort-builder__search-by-concepts-style__skeleton___bw7HP{0%{opacity:.3;transform:scaleX(0);transform-origin:left}20%{opacity:1;transform:scaleX(1);transform-origin:left}28%{transform:scaleX(1);transform-origin:right}51%{transform:scaleX(0);transform-origin:right}58%{transform:scaleX(0);transform-origin:right}82%{transform:scaleX(1);transform-origin:right}83%{transform:scaleX(1);transform-origin:left}96%{transform:scaleX(0);transform-origin:left}100%{opacity:.3;transform:scaleX(0);transform-origin:left}}.-esm-cohort-builder__search-by-concepts-style__contentSwitcher___L8_pG{height:2.5rem}.-esm-cohort-builder__search-by-concepts-style__column___g5X8T{padding-top:1.5rem}.-esm-cohort-builder__search-by-concepts-style__dateRange___Sw46O{padding-top:1.5rem;display:flex}.-esm-cohort-builder__search-by-concepts-style__text___uq45L{padding-top:1.5rem}.-esm-cohort-builder__search-by-concepts-style__multipleInputs___HqfvW{display:flex;align-items:center}.-esm-cohort-builder__search-by-concepts-style__timeModifier___fvlst{width:300px}.-esm-cohort-builder__search-by-concepts-style__lastTime___wwDLD{padding-left:1rem;padding-right:1rem}.-esm-cohort-builder__search-by-concepts-style__operators___XXEjN{width:60%;padding-right:1rem}.-esm-cohort-builder__search-by-concepts-style__value___MukvW{padding-right:2rem}.-esm-cohort-builder__search-by-concepts-style__whatValuesInputs___puC4Q{display:flex;align-items:end}",""]),i.locals={contentSwitcher:"-esm-cohort-builder__search-by-concepts-style__contentSwitcher___L8_pG",column:"-esm-cohort-builder__search-by-concepts-style__column___g5X8T",dateRange:"-esm-cohort-builder__search-by-concepts-style__dateRange___Sw46O",text:"-esm-cohort-builder__search-by-concepts-style__text___uq45L",multipleInputs:"-esm-cohort-builder__search-by-concepts-style__multipleInputs___HqfvW",timeModifier:"-esm-cohort-builder__search-by-concepts-style__timeModifier___fvlst",lastTime:"-esm-cohort-builder__search-by-concepts-style__lastTime___wwDLD",operators:"-esm-cohort-builder__search-by-concepts-style__operators___XXEjN",value:"-esm-cohort-builder__search-by-concepts-style__value___MukvW",whatValuesInputs:"-esm-cohort-builder__search-by-concepts-style__whatValuesInputs___puC4Q",skeleton:"-esm-cohort-builder__search-by-concepts-style__skeleton___bw7HP"};const l=i},9579:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(8081),a=r.n(n),o=r(3645),i=r.n(o)()(a());i.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{padding:0;border:0;margin:0;font:inherit;font-size:100%;vertical-align:baseline}button,select,input,textarea{border-radius:0;font-family:inherit}input[type=text]::-ms-clear{display:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section{display:block}body{line-height:1}sup{vertical-align:super}sub{vertical-align:sub}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote::before,blockquote::after,q::before,q::after{content:\"\"}table{border-collapse:collapse;border-spacing:0}*{box-sizing:border-box}button{margin:0}html{font-size:100%}body{font-weight:400;font-family:'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}code{font-family:'IBM Plex Mono', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace}strong{font-weight:600}@media screen and (-ms-high-contrast: active){svg{fill:ButtonText}}h1{font-size:2.625rem;font-weight:300;line-height:1.199;letter-spacing:0}h2{font-size:2rem;font-weight:400;line-height:1.25;letter-spacing:0}h3{font-size:1.75rem;font-weight:400;line-height:1.28572;letter-spacing:0}h4{font-size:1.25rem;font-weight:400;line-height:1.4;letter-spacing:0}h5{font-size:1rem;font-weight:600;line-height:1.375;letter-spacing:0}h6{font-size:.875rem;font-weight:600;line-height:1.28572;letter-spacing:.16px}p{font-size:1rem;font-weight:400;line-height:1.5;letter-spacing:0}a{color:#0f62fe}em{font-style:italic}@keyframes -esm-cohort-builder__search-by-demographics-style__skeleton___srOtj{0%{opacity:.3;transform:scaleX(0);transform-origin:left}20%{opacity:1;transform:scaleX(1);transform-origin:left}28%{transform:scaleX(1);transform-origin:right}51%{transform:scaleX(0);transform-origin:right}58%{transform:scaleX(0);transform-origin:right}82%{transform:scaleX(1);transform-origin:right}83%{transform:scaleX(1);transform-origin:left}96%{transform:scaleX(0);transform-origin:left}100%{opacity:.3;transform:scaleX(0);transform-origin:left}}.-esm-cohort-builder__search-by-demographics-style__contentSwitcher___wCxtI{height:2.5rem}.-esm-cohort-builder__search-by-demographics-style__column___L5yG5{padding-top:1.5rem;display:flex}.-esm-cohort-builder__search-by-demographics-style__text___h50g8{padding-right:1rem;font-size:.75rem;color:#525252}.-esm-cohort-builder__search-by-demographics-style__switch___CC_jK{width:60%;padding-right:1rem}.-esm-cohort-builder__search-by-demographics-style__genderContainer___zy67v{display:flex;align-items:end}.-esm-cohort-builder__search-by-demographics-style__ageContainer___WkThl{display:flex;justify-content:space-between;width:34%}.-esm-cohort-builder__search-by-demographics-style__age___RRZrJ{display:flex}.-esm-cohort-builder__search-by-demographics-style__genderTitle___q_qFQ{padding-bottom:.5rem}",""]),i.locals={contentSwitcher:"-esm-cohort-builder__search-by-demographics-style__contentSwitcher___wCxtI",column:"-esm-cohort-builder__search-by-demographics-style__column___L5yG5",text:"-esm-cohort-builder__search-by-demographics-style__text___h50g8",switch:"-esm-cohort-builder__search-by-demographics-style__switch___CC_jK",genderContainer:"-esm-cohort-builder__search-by-demographics-style__genderContainer___zy67v",ageContainer:"-esm-cohort-builder__search-by-demographics-style__ageContainer___WkThl",age:"-esm-cohort-builder__search-by-demographics-style__age___RRZrJ",genderTitle:"-esm-cohort-builder__search-by-demographics-style__genderTitle___q_qFQ",skeleton:"-esm-cohort-builder__search-by-demographics-style__skeleton___srOtj"};const l=i},1050:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(8081),a=r.n(n),o=r(3645),i=r.n(o)()(a());i.push([e.id,".-esm-cohort-builder__search-by-drug-orders-style__column___RQ5K3{padding-top:1.5rem;display:flex}",""]),i.locals={column:"-esm-cohort-builder__search-by-drug-orders-style__column___RQ5K3"};const l=i},3424:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(8081),a=r.n(n),o=r(3645),i=r.n(o)()(a());i.push([e.id,".-esm-cohort-builder__search-by-encounters-style__column___lzqvv{padding-top:1.5rem;display:flex}.-esm-cohort-builder__search-by-encounters-style__multipleInputs___ItdZt{margin-right:.2rem}.-esm-cohort-builder__search-by-encounters-style__encounterRange___WdM2R{display:flex}",""]),i.locals={column:"-esm-cohort-builder__search-by-encounters-style__column___lzqvv",multipleInputs:"-esm-cohort-builder__search-by-encounters-style__multipleInputs___ItdZt",encounterRange:"-esm-cohort-builder__search-by-encounters-style__encounterRange___WdM2R"};const l=i},2632:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(8081),a=r.n(n),o=r(3645),i=r.n(o)()(a());i.push([e.id,".-esm-cohort-builder__search-by-enrollments-style__column___bq2Kv{padding-top:1.5rem;display:flex}",""]),i.locals={column:"-esm-cohort-builder__search-by-enrollments-style__column___bq2Kv"};const l=i},9060:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(8081),a=r.n(n),o=r(3645),i=r.n(o)()(a());i.push([e.id,".-esm-cohort-builder__search-by-location-style__column___ZmakV{padding-top:1.5rem;display:flex}",""]),i.locals={column:"-esm-cohort-builder__search-by-location-style__column___ZmakV"};const l=i},4584:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(8081),a=r.n(n),o=r(3645),i=r.n(o)()(a());i.push([e.id,".-esm-cohort-builder__search-by-person-attributes-style__column___iJiIw{padding-top:1.5rem;display:flex}",""]),i.locals={column:"-esm-cohort-builder__search-by-person-attributes-style__column___iJiIw"};const l=i},4345:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(8081),a=r.n(n),o=r(3645),i=r.n(o)()(a());i.push([e.id,".-esm-cohort-builder__search-history-style__header___X0Ke4{display:flex;align-items:center;justify-content:space-between;padding:.5rem}.-esm-cohort-builder__search-history-style__container___IxW73{margin-top:1rem;background:#fff;padding:1rem}",""]),i.locals={header:"-esm-cohort-builder__search-history-style__header___X0Ke4",container:"-esm-cohort-builder__search-history-style__container___IxW73"};const l=i},8836:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(8081),a=r.n(n),o=r(3645),i=r.n(o)()(a());i.push([e.id,".-esm-cohort-builder__search-results-table__container___zndqL{background:#fff;padding:1rem}",""]),i.locals={container:"-esm-cohort-builder__search-results-table__container___zndqL"};const l=i}}]);
package/dist/285.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_openmrs_esm_cohort_builder_app=self.webpackChunk_openmrs_esm_cohort_builder_app||[]).push([[285],{6285:(e,r,o)=>{o.r(r),o.d(r,{default:()=>s});var t=o(1672),n=o.n(t),u=o(311),a=o(3397);function s(){var e=(0,a.useTranslation)().t;return n().createElement(u.ConfigurableLink,{to:"${openmrsSpaBase}/cohort-builder"},e("cohortBuilder","Cohort Builder"))}}}]);
package/dist/294.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 294.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_openmrs_esm_cohort_builder_app=self.webpackChunk_openmrs_esm_cohort_builder_app||[]).push([[294],{2408:(e,t)=>{var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),i=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),y=Symbol.iterator,d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,h={};function m(e,t,r){this.props=e,this.context=t,this.refs=h,this.updater=r||d}function b(){}function v(e,t,r){this.props=e,this.context=t,this.refs=h,this.updater=r||d}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=m.prototype;var S=v.prototype=new b;S.constructor=v,_(S,m.prototype),S.isPureReactComponent=!0;var k=Array.isArray,w=Object.prototype.hasOwnProperty,E={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function R(e,t,n){var o,u={},c=null,a=null;if(null!=t)for(o in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(c=""+t.key),t)w.call(t,o)&&!$.hasOwnProperty(o)&&(u[o]=t[o]);var i=arguments.length-2;if(1===i)u.children=n;else if(1<i){for(var f=Array(i),s=0;s<i;s++)f[s]=arguments[s+2];u.children=f}if(e&&e.defaultProps)for(o in i=e.defaultProps)void 0===u[o]&&(u[o]=i[o]);return{$$typeof:r,type:e,key:c,ref:a,props:u,_owner:E.current}}function C(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var g=/\/+/g;function j(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function O(e,t,o,u,c){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var i=!1;if(null===e)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case r:case n:i=!0}}if(i)return c=c(i=e),e=""===u?"."+j(i,0):u,k(c)?(o="",null!=e&&(o=e.replace(g,"$&/")+"/"),O(c,t,o,"",(function(e){return e}))):null!=c&&(C(c)&&(c=function(e,t){return{$$typeof:r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(c,o+(!c.key||i&&i.key===c.key?"":(""+c.key).replace(g,"$&/")+"/")+e)),t.push(c)),1;if(i=0,u=""===u?".":u+":",k(e))for(var f=0;f<e.length;f++){var s=u+j(a=e[f],f);i+=O(a,t,o,s,c)}else if(s=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=y&&e[y]||e["@@iterator"])?e:null}(e),"function"==typeof s)for(e=s.call(e),f=0;!(a=e.next()).done;)i+=O(a=a.value,t,o,s=u+j(a,f++),c);else if("object"===a)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function x(e,t,r){if(null==e)return e;var n=[],o=0;return O(e,n,"","",(function(e){return t.call(r,e,o++)})),n}function P(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var I={current:null},T={transition:null},V={ReactCurrentDispatcher:I,ReactCurrentBatchConfig:T,ReactCurrentOwner:E};t.Children={map:x,forEach:function(e,t,r){x(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return x(e,(function(){t++})),t},toArray:function(e){return x(e,(function(e){return e}))||[]},only:function(e){if(!C(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=m,t.Fragment=o,t.Profiler=c,t.PureComponent=v,t.StrictMode=u,t.Suspense=s,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V,t.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=_({},e.props),u=e.key,c=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(c=t.ref,a=E.current),void 0!==t.key&&(u=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(f in t)w.call(t,f)&&!$.hasOwnProperty(f)&&(o[f]=void 0===t[f]&&void 0!==i?i[f]:t[f])}var f=arguments.length-2;if(1===f)o.children=n;else if(1<f){i=Array(f);for(var s=0;s<f;s++)i[s]=arguments[s+2];o.children=i}return{$$typeof:r,type:e.type,key:u,ref:c,props:o,_owner:a}},t.createContext=function(e){return(e={$$typeof:i,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},t.createElement=R,t.createFactory=function(e){var t=R.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:f,render:e}},t.isValidElement=C,t.lazy=function(e){return{$$typeof:p,_payload:{_status:-1,_result:e},_init:P}},t.memo=function(e,t){return{$$typeof:l,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=T.transition;T.transition={};try{e()}finally{T.transition=t}},t.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},t.useCallback=function(e,t){return I.current.useCallback(e,t)},t.useContext=function(e){return I.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return I.current.useDeferredValue(e)},t.useEffect=function(e,t){return I.current.useEffect(e,t)},t.useId=function(){return I.current.useId()},t.useImperativeHandle=function(e,t,r){return I.current.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return I.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return I.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return I.current.useMemo(e,t)},t.useReducer=function(e,t,r){return I.current.useReducer(e,t,r)},t.useRef=function(e){return I.current.useRef(e)},t.useState=function(e){return I.current.useState(e)},t.useSyncExternalStore=function(e,t,r){return I.current.useSyncExternalStore(e,t,r)},t.useTransition=function(){return I.current.useTransition()},t.version="18.2.0"},7294:(e,t,r)=>{e.exports=r(2408)}}]);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */
package/dist/374.js ADDED
@@ -0,0 +1 @@
1
+ (self.webpackChunk_openmrs_esm_cohort_builder_app=self.webpackChunk_openmrs_esm_cohort_builder_app||[]).push([[374],{9374:(e,r,n)=>{"use strict";n.r(r),n.d(r,{backendDependencies:()=>i,importTranslation:()=>t,setupOpenMRS:()=>s});var o=n(311),t=n(3979),i={fhir2:"^1.2.0","webservices.rest":"^2.2.0",reportingrest:"^1.0.0",reporting:"^1.0.0"};function s(){var e={featureName:"cohort-builder",moduleName:"@openmrs/esm-cohort-builder"};return{pages:[{load:(0,o.getAsyncLifecycle)((function(){return Promise.all([n.e(508),n.e(672),n.e(397),n.e(255)]).then(n.bind(n,255))}),e),route:"cohort-builder"}],extensions:[{id:"cohort-builder-app-link",slot:"app-menu-slot",load:(0,o.getAsyncLifecycle)((function(){return Promise.all([n.e(672),n.e(397),n.e(285)]).then(n.bind(n,6285))}),e),online:!0,offline:!1}]}}},3979:(e,r,n)=>{var o={"./en.json":[3574,574]};function t(e){if(!n.o(o,e))return Promise.resolve().then((()=>{var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}));var r=o[e],t=r[0];return n.e(r[1]).then((()=>n(t)))}t.keys=()=>Object.keys(o),t.id=3979,e.exports=t}}]);
package/dist/484.js ADDED
@@ -0,0 +1 @@
1
+ (self.webpackChunk_openmrs_esm_cohort_builder_app=self.webpackChunk_openmrs_esm_cohort_builder_app||[]).push([[484],{7484:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,n="millisecond",r="second",i="minute",s="hour",u="day",a="week",o="month",h="quarter",f="year",c="date",d="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,l=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},M=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},y={s:M,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+M(r,2,"0")+":"+M(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,o),s=n-i<0,u=e.clone().add(r+(s?-1:1),o);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:o,y:f,w:a,d:u,D:c,h:s,m:i,s:r,ms:n,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},p="en",v={};v[p]=m;var D=function(t){return t instanceof w},g=function t(e,n,r){var i;if(!e)return p;if("string"==typeof e){var s=e.toLowerCase();v[s]&&(i=s),n&&(v[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;v[a]=e,i=a}return!r&&i&&(p=i),i||!r&&p},S=function(t,e){if(D(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new w(n)},_=y;_.l=g,_.i=D,_.w=function(t,e){return S(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var w=function(){function m(t){this.$L=g(t.locale,null,!0),this.parse(t)}var M=m.prototype;return M.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(_.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},M.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},M.$utils=function(){return _},M.isValid=function(){return!(this.$d.toString()===d)},M.isSame=function(t,e){var n=S(t);return this.startOf(e)<=n&&n<=this.endOf(e)},M.isAfter=function(t,e){return S(t)<this.startOf(e)},M.isBefore=function(t,e){return this.endOf(e)<S(t)},M.$g=function(t,e,n){return _.u(t)?this[e]:this.set(n,t)},M.unix=function(){return Math.floor(this.valueOf()/1e3)},M.valueOf=function(){return this.$d.getTime()},M.startOf=function(t,e){var n=this,h=!!_.u(e)||e,d=_.p(t),$=function(t,e){var r=_.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return h?r:r.endOf(u)},l=function(t,e){return _.w(n.toDate()[t].apply(n.toDate("s"),(h?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},m=this.$W,M=this.$M,y=this.$D,p="set"+(this.$u?"UTC":"");switch(d){case f:return h?$(1,0):$(31,11);case o:return h?$(1,M):$(0,M+1);case a:var v=this.$locale().weekStart||0,D=(m<v?m+7:m)-v;return $(h?y-D:y+(6-D),M);case u:case c:return l(p+"Hours",0);case s:return l(p+"Minutes",1);case i:return l(p+"Seconds",2);case r:return l(p+"Milliseconds",3);default:return this.clone()}},M.endOf=function(t){return this.startOf(t,!1)},M.$set=function(t,e){var a,h=_.p(t),d="set"+(this.$u?"UTC":""),$=(a={},a[u]=d+"Date",a[c]=d+"Date",a[o]=d+"Month",a[f]=d+"FullYear",a[s]=d+"Hours",a[i]=d+"Minutes",a[r]=d+"Seconds",a[n]=d+"Milliseconds",a)[h],l=h===u?this.$D+(e-this.$W):e;if(h===o||h===f){var m=this.clone().set(c,1);m.$d[$](l),m.init(),this.$d=m.set(c,Math.min(this.$D,m.daysInMonth())).$d}else $&&this.$d[$](l);return this.init(),this},M.set=function(t,e){return this.clone().$set(t,e)},M.get=function(t){return this[_.p(t)]()},M.add=function(n,h){var c,d=this;n=Number(n);var $=_.p(h),l=function(t){var e=S(d);return _.w(e.date(e.date()+Math.round(t*n)),d)};if($===o)return this.set(o,this.$M+n);if($===f)return this.set(f,this.$y+n);if($===u)return l(1);if($===a)return l(7);var m=(c={},c[i]=t,c[s]=e,c[r]=1e3,c)[$]||1,M=this.$d.getTime()+n*m;return _.w(M,this)},M.subtract=function(t,e){return this.add(-1*t,e)},M.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||d;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=_.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,h=n.months,f=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return _.s(s%12||12,t,"0")},$=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},m={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:_.s(a+1,2,"0"),MMM:f(n.monthsShort,a,h,3),MMMM:f(h,a),D:this.$D,DD:_.s(this.$D,2,"0"),d:String(this.$W),dd:f(n.weekdaysMin,this.$W,o,2),ddd:f(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:_.s(s,2,"0"),h:c(1),hh:c(2),a:$(s,u,!0),A:$(s,u,!1),m:String(u),mm:_.s(u,2,"0"),s:String(this.$s),ss:_.s(this.$s,2,"0"),SSS:_.s(this.$ms,3,"0"),Z:i};return r.replace(l,(function(t,e){return e||m[t]||i.replace(":","")}))},M.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},M.diff=function(n,c,d){var $,l=_.p(c),m=S(n),M=(m.utcOffset()-this.utcOffset())*t,y=this-m,p=_.m(this,m);return p=($={},$[f]=p/12,$[o]=p,$[h]=p/3,$[a]=(y-M)/6048e5,$[u]=(y-M)/864e5,$[s]=y/e,$[i]=y/t,$[r]=y/1e3,$)[l]||y,d?p:_.a(p)},M.daysInMonth=function(){return this.endOf(o).$D},M.$locale=function(){return v[this.$L]},M.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=g(t,e,!0);return r&&(n.$L=r),n},M.clone=function(){return _.w(this.$d,this)},M.toDate=function(){return new Date(this.valueOf())},M.toJSON=function(){return this.isValid()?this.toISOString():null},M.toISOString=function(){return this.$d.toISOString()},M.toString=function(){return this.$d.toUTCString()},m}(),O=w.prototype;return S.prototype=O,[["$ms",n],["$s",r],["$m",i],["$H",s],["$W",u],["$M",o],["$y",f],["$D",c]].forEach((function(t){O[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),S.extend=function(t,e){return t.$i||(t(e,w,S),t.$i=!0),S},S.locale=g,S.isDayjs=D,S.unix=function(t){return S(1e3*t)},S.en=v[p],S.Ls=v,S.p={},S}()}}]);
package/dist/508.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 508.js.LICENSE.txt */
2
+ (self.webpackChunk_openmrs_esm_cohort_builder_app=self.webpackChunk_openmrs_esm_cohort_builder_app||[]).push([[508],{7041:(t,e,r)=>{"use strict";r.d(e,{N:()=>i});var n=r(1672),o=r.n(n),i=(r(7187),r(3397),function(t){var e=t.width,r=void 0===e?"64":e,n=t.height,i=void 0===n?"64":n;return o().createElement("svg",{width:r,height:i,viewBox:"0 0 64 64"},o().createElement("title",null,"Empty data illustration"),o().createElement("g",{fill:"none",fillRule:"evenodd"},o().createElement("path",{d:"M38.133 13.186H21.947c-.768.001-1.39.623-1.39 1.391V50.55l-.186.057-3.97 1.216a.743.743 0 01-.927-.493L3.664 12.751a.742.742 0 01.492-.926l6.118-1.874 17.738-5.43 6.119-1.873a.741.741 0 01.926.492L38.076 13l.057.186z",fill:"#F4F4F4"}),o().createElement("path",{d:"M41.664 13L38.026 1.117A1.576 1.576 0 0036.056.07l-8.601 2.633-17.737 5.43-8.603 2.634a1.578 1.578 0 00-1.046 1.97l12.436 40.616a1.58 1.58 0 001.969 1.046l5.897-1.805.185-.057v-.194l-.185.057-5.952 1.822a1.393 1.393 0 01-1.737-.923L.247 12.682a1.39 1.39 0 01.923-1.738L9.772 8.31 27.51 2.881 36.112.247a1.393 1.393 0 011.737.923L41.47 13l.057.186h.193l-.057-.185z",fill:"#8D8D8D"}),o().createElement("path",{d:"M11.378 11.855a.836.836 0 01-.798-.59L9.385 7.361a.835.835 0 01.554-1.042l16.318-4.996a.836.836 0 011.042.554l1.195 3.902a.836.836 0 01-.554 1.043l-16.318 4.995a.831.831 0 01-.244.037z",fill:"#C6C6C6"}),o().createElement("circle",{fill:"#C6C6C6",cx:17.636,cy:2.314,r:1.855}),o().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:17.636,cy:2.314,r:1.175}),o().createElement("path",{d:"M55.893 53.995H24.544a.79.79 0 01-.788-.789V15.644a.79.79 0 01.788-.788h31.349a.79.79 0 01.788.788v37.562a.79.79 0 01-.788.789z",fill:"#F4F4F4"}),o().createElement("path",{d:"M41.47 13H21.948a1.579 1.579 0 00-1.576 1.577V52.4l.185-.057V14.577c.001-.768.623-1.39 1.391-1.39h19.581L41.471 13zm17.02 0H21.947a1.579 1.579 0 00-1.576 1.577v42.478c0 .87.706 1.576 1.576 1.577H58.49a1.579 1.579 0 001.576-1.577V14.577a1.579 1.579 0 00-1.576-1.576zm1.39 44.055c0 .768-.622 1.39-1.39 1.392H21.947c-.768-.001-1.39-.624-1.39-1.392V14.577c0-.768.622-1.39 1.39-1.39H58.49c.768 0 1.39.622 1.39 1.39v42.478z",fill:"#8D8D8D"}),o().createElement("path",{d:"M48.751 17.082H31.686a.836.836 0 01-.835-.835v-4.081c0-.46.374-.834.835-.835H48.75c.461 0 .834.374.835.835v4.08c0 .462-.374.835-.835.836z",fill:"#C6C6C6"}),o().createElement("circle",{fill:"#C6C6C6",cx:40.218,cy:9.755,r:1.855}),o().createElement("circle",{fill:"#FFF",fillRule:"nonzero",cx:40.218,cy:9.755,r:1.13})))}),a=(r(311),r(3379)),c=r.n(a),u=r(7795),s=r.n(u),l=r(569),f=r.n(l),d=r(3565),h=r.n(d),p=r(9216),v=r.n(p),g=r(4589),m=r.n(g),y=r(4985),b={};b.styleTagTransform=m(),b.setAttributes=h(),b.insert=f().bind(null,"head"),b.domAPI=s(),b.insertStyleElement=v(),c()(y.Z,b),y.Z&&y.Z.locals&&y.Z.locals},4985:(t,e,r)=>{"use strict";r.d(e,{Z:()=>c});var n=r(8081),o=r.n(n),i=r(3645),a=r.n(i)()(o());a.push([t.id,':root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-cohort-builder__empty-state__action___F0DqZ{margin-bottom:.5rem}.-esm-cohort-builder__empty-state__content___HEyeM{font-size:var(--cds-heading-compact-01-font-size, 0.875rem);font-weight:var(--cds-heading-compact-01-font-weight, 600);line-height:var(--cds-heading-compact-01-line-height, 1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing, 0.16px);color:#525252;margin-top:1rem;margin-bottom:.5rem}.-esm-cohort-builder__empty-state__desktopHeading___wyJXT h4{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);color:#525252}.-esm-cohort-builder__empty-state__tabletHeading___TgFCd h4{font-size:var(--cds-heading-03-font-size, 1.25rem);font-weight:var(--cds-heading-03-font-weight, 400);line-height:var(--cds-heading-03-line-height, 1.4);letter-spacing:var(--cds-heading-03-letter-spacing, 0);color:#525252}.-esm-cohort-builder__empty-state__desktopHeading___wyJXT,.-esm-cohort-builder__empty-state__tabletHeading___TgFCd{text-align:left;text-transform:capitalize;margin-bottom:1rem}.-esm-cohort-builder__empty-state__desktopHeading___wyJXT h4:after,.-esm-cohort-builder__empty-state__tabletHeading___TgFCd h4:after{content:"";display:block;width:2rem;padding-top:.188rem;border-bottom:.375rem solid var(--brand-03)}.-esm-cohort-builder__empty-state__heading___bhp8A:after{content:"";display:block;width:2rem;padding-top:.188rem;border-bottom:.375rem solid var(--brand-03)}.-esm-cohort-builder__empty-state__tile___nAz1I{text-align:center;border:1px solid #e0e0e0}',""]),a.locals={action:"-esm-cohort-builder__empty-state__action___F0DqZ",content:"-esm-cohort-builder__empty-state__content___HEyeM",desktopHeading:"-esm-cohort-builder__empty-state__desktopHeading___wyJXT",tabletHeading:"-esm-cohort-builder__empty-state__tabletHeading___TgFCd",heading:"-esm-cohort-builder__empty-state__heading___bhp8A",tile:"-esm-cohort-builder__empty-state__tile___nAz1I"};const c=a},3645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r="",n=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),n&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),n&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,n,o,i){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(n)for(var c=0;c<this.length;c++){var u=this[c][0];null!=u&&(a[u]=!0)}for(var s=0;s<t.length;s++){var l=[].concat(t[s]);n&&a[l[0]]||(void 0!==i&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=i),r&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=r):l[2]=r),o&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=o):l[4]="".concat(o)),e.push(l))}},e}},8081:t=>{"use strict";t.exports=function(t){return t[1]}},2705:(t,e,r)=>{var n=r(5639).Symbol;t.exports=n},4239:(t,e,r)=>{var n=r(2705),o=r(9607),i=r(2333),a=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?o(t):i(t)}},7561:(t,e,r)=>{var n=r(7990),o=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(o,""):t}},1957:(t,e,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;t.exports=n},9607:(t,e,r)=>{var n=r(2705),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,c=n?n.toStringTag:void 0;t.exports=function(t){var e=i.call(t,c),r=t[c];try{t[c]=void 0;var n=!0}catch(t){}var o=a.call(t);return n&&(e?t[c]=r:delete t[c]),o}},2333:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},5639:(t,e,r)=>{var n=r(1957),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},7990:t=>{var e=/\s/;t.exports=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}},3279:(t,e,r)=>{var n=r(3218),o=r(7771),i=r(4841),a=Math.max,c=Math.min;t.exports=function(t,e,r){var u,s,l,f,d,h,p=0,v=!1,g=!1,m=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function y(e){var r=u,n=s;return u=s=void 0,p=e,f=t.apply(n,r)}function b(t){return p=t,d=setTimeout(w,e),v?y(t):f}function _(t){var r=t-h;return void 0===h||r>=e||r<0||g&&t-p>=l}function w(){var t=o();if(_(t))return x(t);d=setTimeout(w,function(t){var r=e-(t-h);return g?c(r,l-(t-p)):r}(t))}function x(t){return d=void 0,m&&u?y(t):(u=s=void 0,f)}function E(){var t=o(),r=_(t);if(u=arguments,s=this,h=t,r){if(void 0===d)return b(h);if(g)return clearTimeout(d),d=setTimeout(w,e),y(h)}return void 0===d&&(d=setTimeout(w,e)),f}return e=i(e)||0,n(r)&&(v=!!r.leading,l=(g="maxWait"in r)?a(i(r.maxWait)||0,e):l,m="trailing"in r?!!r.trailing:m),E.cancel=function(){void 0!==d&&clearTimeout(d),p=0,u=h=s=d=void 0},E.flush=function(){return void 0===d?f:x(o())},E}},3218:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},7005:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},3448:(t,e,r)=>{var n=r(4239),o=r(7005);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==n(t)}},7771:(t,e,r)=>{var n=r(5639);t.exports=function(){return n.Date.now()}},4841:(t,e,r)=>{var n=r(7561),o=r(3218),i=r(3448),a=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,u=/^0o[0-7]+$/i,s=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var r=c.test(t);return r||u.test(t)?s(t.slice(2),r?2:8):a.test(t)?NaN:+t}},5666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(t,e,r){var n=f;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return F()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=T(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var u=l(t,e,r);if("normal"===u.type){if(n=r.done?p:d,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f="suspendedStart",d="suspendedYield",h="executing",p="completed",v={};function g(){}function m(){}function y(){}var b={};u(b,i,(function(){return this}));var _=Object.getPrototypeOf,w=_&&_(_(S([])));w&&w!==r&&n.call(w,i)&&(b=w);var x=y.prototype=g.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,i,a,c){var u=l(t[o],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function T(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function S(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:F}}function F(){return{value:e,done:!0}}return m.prototype=y,u(x,"constructor",y),u(y,"constructor",m),m.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},E(L.prototype),u(L.prototype,a,(function(){return this})),t.AsyncIterator=L,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new L(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(x),u(x,c,"Generator"),u(x,i,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=S,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:S(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},3379:t=>{"use strict";var e=[];function r(t){for(var r=-1,n=0;n<e.length;n++)if(e[n].identifier===t){r=n;break}return r}function n(t,n){for(var i={},a=[],c=0;c<t.length;c++){var u=t[c],s=n.base?u[0]+n.base:u[0],l=i[s]||0,f="".concat(s," ").concat(l);i[s]=l+1;var d=r(f),h={css:u[1],media:u[2],sourceMap:u[3],supports:u[4],layer:u[5]};if(-1!==d)e[d].references++,e[d].updater(h);else{var p=o(h,n);n.byIndex=c,e.splice(c,0,{identifier:f,updater:p,references:1})}a.push(f)}return a}function o(t,e){var r=e.domAPI(e);return r.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;r.update(t=e)}else r.remove()}}t.exports=function(t,o){var i=n(t=t||[],o=o||{});return function(t){t=t||[];for(var a=0;a<i.length;a++){var c=r(i[a]);e[c].references--}for(var u=n(t,o),s=0;s<i.length;s++){var l=r(i[s]);0===e[l].references&&(e[l].updater(),e.splice(l,1))}i=u}}},569:t=>{"use strict";var e={};t.exports=function(t,r){var n=function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(r)}},9216:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},3565:(t,e,r)=>{"use strict";t.exports=function(t){var e=r.nc;e&&t.setAttribute("nonce",e)}},7795:t=>{"use strict";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(r){!function(t,e,r){var n="";r.supports&&(n+="@supports (".concat(r.supports,") {")),r.media&&(n+="@media ".concat(r.media," {"));var o=void 0!==r.layer;o&&(n+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),n+=r.css,o&&(n+="}"),r.media&&(n+="}"),r.supports&&(n+="}");var i=r.sourceMap;i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(n,t,e.options)}(e,t,r)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},4589:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},6452:(t,e,r)=>{"use strict";r.d(e,{Z:()=>K});var n=r(1672);function o(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function c(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,c)}u((n=n.apply(t,e||[])).next())}))}function i(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var a,c=function(){},u=c(),s=Object,l=function(t){return t===u},f=function(t){return"function"==typeof t},d=function(t,e){return s.assign({},t,e)},h="undefined",p=function(){return typeof window!=h},v=new WeakMap,g=0,m=function(t){var e,r,n=typeof t,o=t&&t.constructor,i=o==Date;if(s(t)!==t||i||o==RegExp)e=i?t.toJSON():"symbol"==n?t.toString():"string"==n?JSON.stringify(t):""+t;else{if(e=v.get(t))return e;if(e=++g+"~",v.set(t,e),o==Array){for(e="@",r=0;r<t.length;r++)e+=m(t[r])+",";v.set(t,e)}if(o==s){e="#";for(var a=s.keys(t).sort();!l(r=a.pop());)l(t[r])||(e+=r+":"+m(t[r])+",");v.set(t,e)}}return e},y=!0,b=p(),_=typeof document!=h,w=b&&window.addEventListener?window.addEventListener.bind(window):c,x=_?document.addEventListener.bind(document):c,E=b&&window.removeEventListener?window.removeEventListener.bind(window):c,L=_?document.removeEventListener.bind(document):c,T={isOnline:function(){return y},isVisible:function(){var t=_&&document.visibilityState;return l(t)||"hidden"!==t}},O={initFocus:function(t){return x("visibilitychange",t),w("focus",t),function(){L("visibilitychange",t),E("focus",t)}},initReconnect:function(t){var e=function(){y=!0,t()},r=function(){y=!1};return w("online",e),w("offline",r),function(){E("online",e),E("offline",r)}}},C=!p()||"Deno"in window,k=C?n.useEffect:n.useLayoutEffect,S="undefined"!=typeof navigator&&navigator.connection,F=!C&&S&&(["slow-2g","2g"].includes(S.effectiveType)||S.saveData),j=function(t){if(f(t))try{t=t()}catch(e){t=""}var e=[].concat(t);return[t="string"==typeof t?t:(Array.isArray(t)?t.length:t)?m(t):"",e,t?"$swr$"+t:""]},R=new WeakMap,H=function(t,e,r,n,o,i,a){void 0===a&&(a=!0);var c=R.get(t),u=c[0],s=c[1],l=c[3],f=u[e],d=s[e];if(a&&d)for(var h=0;h<d.length;++h)d[h](r,n,o);return i&&(delete l[e],f&&f[0])?f[0](2).then((function(){return t.get(e)})):t.get(e)},I=0,M=function(){return++I},V=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o(void 0,void 0,void 0,(function(){var e,r,n,o,a,c,s,h,p,v,g,m,y,b,_,w,x,E,L,T,O;return i(this,(function(i){switch(i.label){case 0:if(e=t[0],r=t[1],n=t[2],o=t[3],c=!!l((a="boolean"==typeof o?{revalidate:o}:o||{}).populateCache)||a.populateCache,s=!1!==a.revalidate,h=!1!==a.rollbackOnError,p=a.optimisticData,v=j(r),g=v[0],m=v[2],!g)return[2];if(y=R.get(e),b=y[2],t.length<3)return[2,H(e,g,e.get(g),u,u,s,!0)];if(_=n,x=M(),b[g]=[x,0],E=!l(p),L=e.get(g),E&&(T=f(p)?p(L):p,e.set(g,T),H(e,g,T)),f(_))try{_=_(e.get(g))}catch(t){w=t}return _&&f(_.then)?[4,_.catch((function(t){w=t}))]:[3,2];case 1:if(_=i.sent(),x!==b[g][0]){if(w)throw w;return[2,_]}w&&E&&h&&(c=!0,_=L,e.set(g,L)),i.label=2;case 2:return c&&(w||(f(c)&&(_=c(_,L)),e.set(g,_)),e.set(m,d(e.get(m),{error:w}))),b[g][1]=M(),[4,H(e,g,_,w,u,s,!!c)];case 3:if(O=i.sent(),w)throw w;return[2,c?O:_]}}))}))},D=function(t,e){for(var r in t)t[r][0]&&t[r][0](e)},N=function(t,e){if(!R.has(t)){var r=d(O,e),n={},o=V.bind(u,t),i=c;if(R.set(t,[n,{},{},{},o]),!C){var a=r.initFocus(setTimeout.bind(u,D.bind(u,n,0))),s=r.initReconnect(setTimeout.bind(u,D.bind(u,n,1)));i=function(){a&&a(),s&&s(),R.delete(t)}}return[t,o,i]}return[t,R.get(t)[4]]},z=N(new Map),A=z[0],P=z[1],G=d({onLoadingSlow:c,onSuccess:c,onError:c,onErrorRetry:function(t,e,r,n,o){var i=r.errorRetryCount,a=o.retryCount,c=~~((Math.random()+.5)*(1<<(a<8?a:8)))*r.errorRetryInterval;!l(i)&&a>i||setTimeout(n,c,o)},onDiscarded:c,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:F?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:F?5e3:3e3,compare:function(t,e){return m(t)==m(e)},isPaused:function(){return!1},cache:A,mutate:P,fallback:{}},T),Z=function(t,e){var r=d(t,e);if(e){var n=t.use,o=t.fallback,i=e.use,a=e.fallback;n&&i&&(r.use=n.concat(i)),o&&a&&(r.fallback=d(o,a))}return r},J=(0,n.createContext)({}),W=function(t){return f(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(null===t[1]?t[2]:t[1])||{}]},q=function(){return d(G,(0,n.useContext)(J))},$=function(t,e,r){var n=e[t]||(e[t]=[]);return n.push(r),function(){var t=n.indexOf(r);t>=0&&(n[t]=n[n.length-1],n.pop())}},X={dedupe:!0},U=(s.defineProperty((function(t){var e=t.value,r=Z((0,n.useContext)(J),e),o=e&&e.provider,i=(0,n.useState)((function(){return o?N(o(r.cache||A),e):u}))[0];return i&&(r.cache=i[0],r.mutate=i[1]),k((function(){return i?i[2]:u}),[]),(0,n.createElement)(J.Provider,d(t,{value:r}))}),"default",{value:G}),a=function(t,e,r){var a=r.cache,c=r.compare,s=r.fallbackData,v=r.suspense,g=r.revalidateOnMount,m=r.refreshInterval,y=r.refreshWhenHidden,b=r.refreshWhenOffline,_=R.get(a),w=_[0],x=_[1],E=_[2],L=_[3],T=j(t),O=T[0],S=T[1],F=T[2],I=(0,n.useRef)(!1),D=(0,n.useRef)(!1),N=(0,n.useRef)(O),z=(0,n.useRef)(e),A=(0,n.useRef)(r),P=function(){return A.current},G=function(){return P().isVisible()&&P().isOnline()},Z=function(t){return a.set(F,d(a.get(F),t))},J=a.get(O),W=l(s)?r.fallback[O]:s,q=l(J)?W:J,U=a.get(F)||{},Y=U.error,B=!I.current,K=function(){return B&&!l(g)?g:!P().isPaused()&&(v?!l(q)&&r.revalidateIfStale:l(q)||r.revalidateIfStale)},Q=!(!O||!e)&&(!!U.isValidating||B&&K()),tt=function(t,e){var r=(0,n.useState)({})[1],o=(0,n.useRef)(t),i=(0,n.useRef)({data:!1,error:!1,isValidating:!1}),a=(0,n.useCallback)((function(t){var n=!1,a=o.current;for(var c in t){var u=c;a[u]!==t[u]&&(a[u]=t[u],i.current[u]&&(n=!0))}n&&!e.current&&r({})}),[]);return k((function(){o.current=t})),[o,i.current,a]}({data:q,error:Y,isValidating:Q},D),et=tt[0],rt=tt[1],nt=tt[2],ot=(0,n.useCallback)((function(t){return o(void 0,void 0,void 0,(function(){var e,n,o,s,d,h,p,v,g,m,y,b,_;return i(this,(function(i){switch(i.label){case 0:if(e=z.current,!O||!e||D.current||P().isPaused())return[2,!1];s=!0,d=t||{},h=!L[O]||!d.dedupe,p=function(){return!D.current&&O===N.current&&I.current},v=function(){var t=L[O];t&&t[1]===o&&delete L[O]},g={isValidating:!1},m=function(){Z({isValidating:!1}),p()&&nt(g)},Z({isValidating:!0}),nt({isValidating:!0}),i.label=1;case 1:return i.trys.push([1,3,,4]),h&&(H(a,O,et.current.data,et.current.error,!0),r.loadingTimeout&&!a.get(O)&&setTimeout((function(){s&&p()&&P().onLoadingSlow(O,r)}),r.loadingTimeout),L[O]=[e.apply(void 0,S),M()]),_=L[O],n=_[0],o=_[1],[4,n];case 2:return n=i.sent(),h&&setTimeout(v,r.dedupingInterval),L[O]&&L[O][1]===o?(Z({error:u}),g.error=u,y=E[O],!l(y)&&(o<=y[0]||o<=y[1]||0===y[1])?(m(),h&&p()&&P().onDiscarded(O),[2,!1]):(c(et.current.data,n)?g.data=et.current.data:g.data=n,c(a.get(O),n)||a.set(O,n),h&&p()&&P().onSuccess(n,O,r),[3,4])):(h&&p()&&P().onDiscarded(O),[2,!1]);case 3:return b=i.sent(),v(),P().isPaused()||(Z({error:b}),g.error=b,h&&p()&&(P().onError(b,O,r),("boolean"==typeof r.shouldRetryOnError&&r.shouldRetryOnError||f(r.shouldRetryOnError)&&r.shouldRetryOnError(b))&&G()&&P().onErrorRetry(b,O,r,ot,{retryCount:(d.retryCount||0)+1,dedupe:!0}))),[3,4];case 4:return s=!1,m(),p()&&h&&H(a,O,g.data,g.error,!1),[2,!0]}}))}))}),[O]),it=(0,n.useCallback)(V.bind(u,a,(function(){return N.current})),[]);if(k((function(){z.current=e,A.current=r})),k((function(){if(O){var t=O!==N.current,e=ot.bind(u,X),r=0,n=$(O,x,(function(t,e,r){nt(d({error:e,isValidating:r},c(et.current.data,t)?u:{data:t}))})),o=$(O,w,(function(t){if(0==t){var n=Date.now();P().revalidateOnFocus&&n>r&&G()&&(r=n+P().focusThrottleInterval,e())}else if(1==t)P().revalidateOnReconnect&&G()&&e();else if(2==t)return ot()}));return D.current=!1,N.current=O,I.current=!0,t&&nt({data:q,error:Y,isValidating:Q}),K()&&(l(q)||C?e():(i=e,p()&&typeof window.requestAnimationFrame!=h?window.requestAnimationFrame(i):setTimeout(i,1))),function(){D.current=!0,n(),o()}}var i}),[O,ot]),k((function(){var t;function e(){var e=f(m)?m(q):m;e&&-1!==t&&(t=setTimeout(r,e))}function r(){et.current.error||!y&&!P().isVisible()||!b&&!P().isOnline()?e():ot(X).then(e)}return e(),function(){t&&(clearTimeout(t),t=-1)}}),[m,y,b,ot]),(0,n.useDebugValue)(q),v&&l(q)&&O)throw z.current=e,A.current=r,D.current=!1,l(Y)?ot(X):Y;return{mutate:it,get data(){return rt.data=!0,q},get error(){return rt.error=!0,Y},get isValidating(){return rt.isValidating=!0,Q}}},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=q(),n=W(t),o=n[0],i=n[1],c=n[2],u=Z(r,c),s=a,l=u.use;if(l)for(var f=l.length;f-- >0;)s=l[f](s);return s(o,i||u.fetcher,u)}),Y=function(){return Y=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Y.apply(this,arguments)},B=function(t){return"function"==typeof t[1]?[t[0],t[1],t[2]||{}]:[t[0],null,(null===t[1]?t[2]:t[1])||{}]},K=function(t,e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=B(r),i=o[0],a=o[1],c=o[2],u=(c.use||[]).concat(e);return t(i,a,Y(Y({},c),{use:u}))}}(U,(function(t){return function(e,r,n){return n.revalidateOnFocus=!1,n.revalidateIfStale=!1,n.revalidateOnReconnect=!1,t(e,r,n)}}))}}]);
@@ -0,0 +1,14 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */
package/dist/574.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_openmrs_esm_cohort_builder_app=self.webpackChunk_openmrs_esm_cohort_builder_app||[]).push([[574],{3574:e=>{e.exports=JSON.parse('{"searchResults":"Search Results","searchHistory":"Search History","clearHistory":"Clear Search History","concepts":"Concepts","demographics":"Demographics","encounters":"Encounters","enrollments":"Enrollments","drugOrder":"Drug Order","composition":"Composition","savedDefinitions":"Saved Definitions","reset":"Reset","search":"Search","loading":"Loading","dateRange":"Date Range","searchByConcepts":"Search By Concepts","whatObservations":"What observations","whatValues":"What values","lastDays":"and / or days","previousPage":"Previous page","nextPage":"Next page","itemsPerPage:":"Items per page:","clearSearch":"Clear search","searchConcepts":"Search Concepts","noSearchItems":"There are no search items","whoseAnswer":"Patients with observations whose answer is ","name":"Name","age":"Age","ageBetween":"Age between","gender":"Gender","openmrsId":"OpenMRS ID","numberIsNotValid":"Number is not valid","startDate":"Start date","endDate":"End date","query":"Query","results":"Results","haveObservations":"Patients who have these observations","haveNoObservations":"Patients who do not have these observations","any":"Any","none":"None","earliest":"Earliest","recent":"Most Recent","lowest":"Lowest","highest":"Highest","average":"Average","withinTheLast":"Within the last","valueIn":"Enter a value in ","searchItemDeleteError":"Error deleting the search item","cohortCreateSuccess":"Successfully created the cohort","cohortCreateError":"Error creating the cohort","delete":"Delete","deleteFromHistory":"Delete from history","save":"Save","view":"View","clear":"Clear","cancel":"Cancel","saveCohort":"Save Cohort","saveQuery":"Save Query","downloadResults":"Download Results","saveName":"Enter a name","saveDescription":"Enter a description","clearHistoryMsg":"Are you sure you want to clear the search history?","deleteHistoryItem":"Are you sure you want to delete {{searchItemName}} from the search history?","searchIsCompleted":"Search is completed with {{numOfResults}} result(s)","cohortBuilder":"Cohort Builder","searchCriteria":"Search Criteria","all":"All","males":"Male","females":"Female","dead":"Dead","alive":"Alive","minAgeIsNotValid":"The age must be greater than 0","maxAgeIsNotValid":"The age must be less than 200","between":"Between","and":"and","birthDate":"Birth date","selectedAttributeValues":"Enter Comma Delimited Values","selectAttribute":"Select a person attribute","location":"Location","personAttributes":"Person Attributes","selectEncounterTypes":"Select encounter types","selectForms":"Select forms","selectLocations":"Select locations","atLeast":"at least many","upto":"upto this many","from":"From","to":"to","anyEncounter":"Any Encounter","mostRecentEncounter":"Most Recent Encounter","earliestEncounter":"Earliest Encounter","selectMethod":"Select a method","selectPrograms":"Select programs","enrolledBetween":"Enrolled between","completedBetween":"Completed between","success":"Success","cohortIsDeleted":"the cohort is deleted","queryIsDeleted":"the query is deleted","querySavingError":"Error saving the query","cohortViewError":"Error viewing the cohort","cohortDeleteError":"Error deleting the cohort","queryDeleteError":"Error deleting the query","deleteItem":"Are you sure you want to delete {{itemName}}?","id":"id","searchCohorts":"Search Cohorts","searchCompleted":"Search is completed","savedCohortDescription":"You can only search for Cohort Definitions that you have saved using a Name.","savedQueryDescription":"You can only search for Query Definitions that you have saved using a Name.","somethingWentWrong":"Something went wrong","selectDrugs":"Select drugs","selectCareSettings":"Select a care setting","using":"Using between","used":"Used between","searchQueries":"Search Queries","description":"Description","compositionExplanationOne":"This query combines multiple cohorts using the logical operators:- AND,OR and NOT.","compositionExplanationTwo":"To use this query you need to already have query results in your search history. Those existing query results can then be combined to yield the results of the composition query.","compositionExplanationThree":"Example: if the search history #1 is a cohort of patients who are males, and if the search history #2 is a cohort of patients with ages between 23 and 35 years; then \'1 AND 2\' will result in a cohort of patients who are males with ages between 23 and 35 years.","invalidComposition":"Composition is not valid"}')}}]);