"use strict";(globalThis.webpackChunk_openmrs_esm_laboratory_app=globalThis.webpackChunk_openmrs_esm_laboratory_app||[]).push([["7248"],{4659(e,t,r){r.r(t),r.d(t,{default:()=>c});var n=r(2153),l=r.n(n),a=r(3485),o=r(4803),s=r(6045),u=r(4091);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}let c=function(e){var t,r=e.order,c=e.closeModal,p=(0,s.useTranslation)().t,d=function(e){if(Array.isArray(e))return e}(t=(0,n.useState)(!1))||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var l=[],a=!0,o=!1;try{for(n=n.call(e);!(a=(t=n.next()).done)&&(l.push(t.value),2!==l.length);a=!0);}catch(e){o=!0,r=e}finally{try{a||null==n.return||n.return()}finally{if(o)throw r}}return l}}(t)||function(e){if(e){if("string"==typeof e)return i(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),m=d[0],b=d[1],f=(0,o.useAbortController)(),v=(0,u.b5)();return l().createElement("div",null,l().createElement(a.rQ0,{closeModal:c,title:p("approveLabResults","Approve Lab Results")}),l().createElement(a.cwr,null,l().createElement("p",null,p("approveResultsConfirmationText","You are about to approve and finalize these lab results. Once approved, the results will be marked as complete and made available to clinicians. Are you sure you want to proceed?")),l().createElement(l().Fragment,null,l().createElement(o.ExtensionSlot,{state:{order:r},name:"completed-lab-order-results-slot"}))),l().createElement(a.jlY,null,l().createElement(a.$nd,{kind:"secondary",onClick:c},p("cancel","Cancel")),l().createElement(a.$nd,{type:"submit",onClick:function(){b(!0),(0,u.Or)(r.uuid,"COMPLETED",f).then(function(){v(),b(!1),c(),(0,o.showSnackbar)({isLowContrast:!0,title:p("resultsApproved","Results Approved"),kind:"success",subtitle:p("labResultsApprovedSuccessfully","Lab results have been successfully approved and finalized")})},function(e){b(!1),(0,o.showNotification)({title:p("errorApprovingResults","Error approving results"),kind:"error",critical:!0,description:null==e?void 0:e.message})})},disabled:m},p("approveResults","Approve Results"))))}}}]);