{"version":3,"file":"js/mo-archetypes-online.js","sources":["webpack://mo-archetypes-online/js/mo-archetypes-online.js"],"sourcesContent":["!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports[\"mo-archetypes-online\"]=t():e[\"mo-archetypes-online\"]=t()}(window,function(){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=445)}({10:function(e,t,n){var a,r,i={},o=(a=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=a.apply(this,arguments)),r}),l=function(e){var t={};return function(e,n){if(\"function\"==typeof e)return e();if(void 0===t[e]){var a=function(e,t){return t?t.querySelector(e):document.querySelector(e)}.call(this,e,n);if(window.HTMLIFrameElement&&a instanceof window.HTMLIFrameElement)try{a=a.contentDocument.head}catch(e){a=null}t[e]=a}return t[e]}}(),s=null,c=0,u=[],d=n(52);function p(e,t){for(var n=0;n=0&&u.splice(t,1)}function v(e){var t=document.createElement(\"style\");if(void 0===e.attrs.type&&(e.attrs.type=\"text/css\"),void 0===e.attrs.nonce){var a=function(){0;return n.nc}();a&&(e.attrs.nonce=a)}return g(t,e.attrs),h(e,t),t}function g(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function y(e,t){var n,a,r,i;if(t.transform&&e.css){if(!(i=\"function\"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=i}if(t.singleton){var o=c++;n=s||(s=v(t)),a=k.bind(null,n,o,!1),r=k.bind(null,n,o,!0)}else e.sourceMap&&\"function\"==typeof URL&&\"function\"==typeof URL.createObjectURL&&\"function\"==typeof URL.revokeObjectURL&&\"function\"==typeof Blob&&\"function\"==typeof btoa?(n=function(e){var t=document.createElement(\"link\");return void 0===e.attrs.type&&(e.attrs.type=\"text/css\"),e.attrs.rel=\"stylesheet\",g(t,e.attrs),h(e,t),t}(t),a=function(e,t,n){var a=n.css,r=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||i)&&(a=d(a));r&&(a+=\"\\n/*# sourceMappingURL=data:application/json;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+\" */\");var o=new Blob([a],{type:\"text/css\"}),l=e.href;e.href=URL.createObjectURL(o),l&&URL.revokeObjectURL(l)}.bind(null,n,t),r=function(){f(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(t),a=function(e,t){var n=t.css,a=t.media;a&&e.setAttribute(\"media\",a);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){f(n)});return a(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;a(e=t)}else r()}}e.exports=function(e,t){if(\"undefined\"!=typeof DEBUG&&DEBUG&&\"object\"!=typeof document)throw new Error(\"The style-loader cannot be used in a non-browser environment\");(t=t||{}).attrs=\"object\"==typeof t.attrs?t.attrs:{},t.singleton||\"boolean\"==typeof t.singleton||(t.singleton=o()),t.insertInto||(t.insertInto=\"head\"),t.insertAt||(t.insertAt=\"bottom\");var n=m(e,t);return p(n,t),function(e){for(var a=[],r=0;r{{ message }}\\r\\n'},135:function(e,t){e.exports='
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n

\\r\\n \\r\\n {{ $ctrl.templateAlert.title }}:\\r\\n {{ $ctrl.templateAlert.message }}\\r\\n

\\r\\n \\r\\n {{ $ctrl.templateAlert.button.text }}\\r\\n \\r\\n \\r\\n Details\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n \\x3c!--Template--\\x3e\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n\\r\\n \\x3c!--Toolbar--\\x3e\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n {{ $ctrl.pollingEnabled ? \\'Disable\\' : \\'Enable\\' }} Polling\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n \\x3c!--Template busy spinner--\\x3e\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n \\x3c!--Cancel--\\x3e\\r\\n \\r\\n Cancel\\r\\n \\r\\n\\r\\n \\x3c!--Reset--\\x3e\\r\\n
\\r\\n \\r\\n \\r\\n Reset Template\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n Revert Changes\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n \\x3c!--Save--\\x3e\\r\\n
\\r\\n \\r\\n \\r\\n Submit\\r\\n \\r\\n \\r\\n \\r\\n Save Draft\\r\\n
\\r\\n \\x3c!----\\x3e\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n'},136:function(e,t){e.exports='
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n {{ ::$ctrl.label }}\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n'},137:function(e,t){e.exports='
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n {{ ::$ctrl.label }}\\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n Unknown or unsupported component.\\r\\n ({{::$ctrl.formElement.meta.delphiClass}})\\r\\n
\\r\\n \\x3c!--form element inserted here--\\x3e\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n'},138:function(e,t){e.exports='
\\r\\n \\r\\n \\x3c!-- Note ng-required does not work here as it looks like \\'required\\' is needed and not \\'required=required\\' --\\x3e\\r\\n \\r\\n
\\r\\n'},139:function(e,t){e.exports='
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n'},140:function(e,t){e.exports='
\\r\\n \\r\\n \\r\\n {{ $select.selected.attributes.purpose || $select.selected.attributes.name || $select.selected.value }}\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
Loading...
\\r\\n
No choices available for selection.
\\r\\n
\\r\\n \\r\\n\\r\\n'},141:function(e,t){e.exports='\\x3c!--Dropzone--\\x3e\\r\\n
\\r\\n \\r\\n \\r\\n  Select or Drop File\\r\\n
\\r\\n\\r\\n \\x3c!--Progress--\\x3e\\r\\n
\\r\\n = 0\"\\r\\n type=\"success\"\\r\\n animate=\"false\"\\r\\n value=\"$ctrl.media.upload.progress\"\\r\\n >\\r\\n {{ $ctrl.media.upload.progress }}%\\r\\n \\r\\n \\r\\n Loading media...\\r\\n \\r\\n
\\r\\n\\r\\n \\x3c!--Preview--\\x3e\\r\\n
\\r\\n \\x3c!----\\x3e\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n'},142:function(e,t){e.exports='
\\r\\n \\r\\n
\\r\\n'},143:function(e,t){e.exports='
\\r\\n
\\r\\n \\r\\n +\\r\\n
\\r\\n
\\r\\n =\\r\\n \\r\\n
\\r\\n
\\r\\n'},144:function(e,t){e.exports='
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n {{ $select.selected.identifier }}\\r\\n \\r\\n {{ unit.identifier }}\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n'},145:function(e,t){e.exports='
\\n
\\n
\\n
\\n \\x3c!--track by $index is being used to prevent element flicker--\\x3e\\n
\\n \\n\\n {{ ::$ctrl.displayValues.low }}\\n \\n {{ ::$ctrl.displayValues.mid }}\\n \\n {{ ::$ctrl.displayValues.high }}\\n
\\n
\\n\\n
\\n
\\n \\x3c!--track by $index is being used to prevent element flicker--\\x3e\\n
\\n \\n
\\n
\\n\\n \\n \\x3c!--track by $index is being used to prevent element flicker--\\x3e\\n
\\n \\n
\\n
\\n\\n
\\n \\n {{ ::$ctrl.displayValues.low }}\\n \\n \\n {{ ::$ctrl.displayValues.mid }}\\n \\n \\n {{ ::$ctrl.displayValues.high }}\\n \\n
\\n
\\n \\n
\\n\\n
\\n
\\n \\n
\\n \\n \\n \\n
\\n
\\n
\\n\\n'},146:function(e,t){e.exports='
\\r\\n
\\r\\n \\r\\n {{ $select.selected.text }}\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
Loading...
\\r\\n
No choices available for selection.
\\r\\n
\\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n'},147:function(e,t){e.exports='
\\r\\n
\\r\\n \\r\\n\\r\\n \\r\\n
\\r\\n \\r\\n No Results Found\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n'},148:function(e,t){e.exports='
\\r\\n \\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n'},149:function(e,t){e.exports='
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n'},150:function(e,t){e.exports='
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n

Available Clinical Forms

\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n

There are no clinical forms available

\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
{{ archetype.attributes.purpose || archetype.attributes.name }}
\\r\\n
\\r\\n v{{ archetype.attributes.version }}.{{ archetype.attributes.revision }}\\r\\n
\\r\\n \\r\\n
\\r\\n'},151:function(e,t){e.exports='
\\r\\n
\\r\\n
\\r\\n
\\r\\n {{ $ctrl.patientName }}\\r\\n
\\r\\n
\\r\\n
\\r\\n Born:\\r\\n {{ $ctrl.dob | date: \\'dd-MMM-yyyy\\' }} ({{ $ctrl.age }}y)\\r\\n Gender:\\r\\n {{ $ctrl.gender.displayName }}\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n Address:\\r\\n {{ $ctrl.address }}\\r\\n \\r\\n Phone:\\r\\n {{ $ctrl.phone }}\\r\\n \\r\\n Identifier No:\\r\\n {{ $ctrl.medicare.idNumber }}\\r\\n
\\r\\n
\\r\\n
\\r\\n'},152:function(e,t){e.exports='
\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n

Yours

\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n

Theirs

\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n'},157:function(e,t,n){var a=n(158);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},158:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\".aoArchetypeHint {\\n cursor: help !important;\\n border-bottom: 1px dotted rgba(0, 0, 0, 0.4); }\\n\",\"\"])},159:function(e,t,n){var a=n(160);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},160:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\"/*\\r\\n* === ANGULARJS ANIMATIONS ===\\r\\n*/\\n@-webkit-keyframes value-change {\\n 0% {\\n background-color: transparent; }\\n 50% {\\n background-color: #f4ffa1; }\\n 100% {\\n background-color: transparent; } }\\n\\n@-moz-keyframes value-change {\\n 0% {\\n background-color: transparent; }\\n 50% {\\n background-color: #f4ffa1; }\\n 100% {\\n background-color: transparent; } }\\n\\n@-ms-keyframes value-change {\\n 0% {\\n background-color: transparent; }\\n 50% {\\n background-color: #f4ffa1; }\\n 100% {\\n background-color: transparent; } }\\n\\n@keyframes value-change {\\n 0% {\\n background-color: transparent; }\\n 50% {\\n background-color: #f4ffa1; }\\n 100% {\\n background-color: transparent; } }\\n\\n.ao-animate-value-change,\\n.ao-animate-value-change .cluster {\\n -webkit-animation: value-change 2s normal forwards;\\n /* Safari 4+ */\\n -moz-animation: value-change 2s normal forwards;\\n /* Fx 5+ */\\n -o-animation: value-change 2s normal forwards;\\n /* Opera 12+ */\\n animation: value-change 2s normal forwards;\\n /* IE 10+ */ }\\n\",\"\"])},161:function(e,t,n){var a=n(162);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},162:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\"ao-archetype-template {\\n /*\\r\\n * === BOOSTRAP OVERIDES ===\\r\\n */\\n /*\\r\\n * === FINISH BOOSTRAP OVERIDES ===\\r\\n */\\n /*\\r\\n* === Validation ===\\r\\n*/ }\\n ao-archetype-template .has-error .date-button,\\n ao-archetype-template .has-error .uib-time .btn {\\n border-color: #f04124; }\\n ao-archetype-template .tooltip-inner {\\n max-width: none;\\n white-space: nowrap; }\\n ao-archetype-template .form-group {\\n margin-bottom: 8px !important; }\\n ao-archetype-template .form-control[disabled],\\n ao-archetype-template fieldset[disabled] .form-control {\\n cursor: auto; }\\n ao-archetype-template .form-horizontal .control-label,\\n ao-archetype-template .form-horizontal .radio,\\n ao-archetype-template .form-horizontal .checkbox,\\n ao-archetype-template .form-horizontal .radio-inline,\\n ao-archetype-template .form-horizontal .checkbox-inline {\\n padding-top: 3px !important; }\\n ao-archetype-template input[type='file'] {\\n margin-top: 3px !important;\\n margin-bottom: 3px !important; }\\n ao-archetype-template .form-horizontal .control-label {\\n text-align: left !important; }\\n ao-archetype-template .card-body {\\n margin-left: -1px !important;\\n margin-right: -1px !important;\\n padding: 0; }\\n ao-archetype-template .single-archetype {\\n height: calc(100vh - 102px);\\n overflow-y: auto; }\\n ao-archetype-template .send-report .card-body {\\n padding: 15px;\\n margin: 0 !important; }\\n ao-archetype-template .form-horizontal .form-group {\\n margin-left: 0;\\n margin-right: 0; }\\n ao-archetype-template label {\\n -webkit-user-select: none !important; }\\n ao-archetype-template textarea {\\n resize: none;\\n box-sizing: content-box;\\n width: 100%;\\n padding: 1vh; }\\n ao-archetype-template .input-group-addon {\\n padding: 6px 12px !important; }\\n @media all and (max-width: 1025px) and (orientation: portrait) {\\n ao-archetype-template .single-archetype {\\n height: calc(100vh - 220px); } }\\n @media all and (max-width: 1025px) and (orientation: landscape) {\\n ao-archetype-template .single-archetype {\\n height: calc(100vh - 500px); } }\\n @media all and (orientation: portrait) {\\n ao-archetype-template .is-device {\\n height: calc(100vh - 220px); } }\\n @media all and (orientation: landscape) {\\n ao-archetype-template .is-device {\\n height: calc(100vh - 500px); } }\\n @media all and (max-width: 767px) {\\n ao-archetype-template fieldset > div {\\n margin-bottom: 5px;\\n display: block; }\\n ao-archetype-template .inner-label {\\n margin-right: 10px;\\n text-align: right !important; } }\\n ao-archetype-template form.archetypes {\\n margin-top: -1px; }\\n ao-archetype-template .help-block.ng-inactive {\\n display: none; }\\n ao-archetype-template .error-messages {\\n color: #f04124;\\n margin-bottom: 0 !important;\\n margin-left: 2px;\\n font-size: 12px; }\\n ao-archetype-template .template-alert-bar {\\n position: absolute;\\n top: 36px;\\n left: 16px;\\n right: 32px;\\n bottom: 0;\\n z-index: 1010;\\n background-color: rgba(255, 255, 255, 0.4); }\\n ao-archetype-template .template-alert-bar > .alert {\\n position: relative;\\n width: 100%;\\n margin-bottom: 0;\\n border-top: none;\\n -webkit-border-radius: 0;\\n -moz-border-radius: 0;\\n border-radius: 0; }\\n ao-archetype-template .template-alert-bar > .alert p {\\n margin-bottom: 5px; }\\n ao-archetype-template .archetype-template-loading {\\n padding: 10px;\\n font-size: 20px;\\n font-weight: bold;\\n text-align: center; }\\n ao-archetype-template .archetype-template-loading i {\\n font-size: 22px; }\\n ao-archetype-template .card .block-ui-container {\\n margin: -1px; }\\n ao-archetype-template .archetype-template-toolbar {\\n padding: 10px 10px 8px;\\n min-height: 59px; }\\n ao-archetype-template .archetype-template-toolbar .archetype-template-busy {\\n display: inline-block; }\\n ao-archetype-template .archetype-template-toolbar .archetype-template-busy mo-spinner .mo-spinner {\\n margin: 0 5px -11px; }\\n ao-archetype-template .dropdown-menu {\\n margin-bottom: 0 !important;\\n min-width: auto; }\\n ao-archetype-template .dropdown-menu .dropdown-item {\\n padding-top: 0.5rem;\\n padding-bottom: 0.5rem; }\\n ao-archetype-template .dropdown-toggle:focus {\\n box-shadow: none; }\\n ao-archetype-template .ellipsis-container {\\n display: inline-block;\\n height: 100%;\\n padding: 5px;\\n cursor: pointer; }\\n ao-archetype-template ao-form-elements .ellipsis-container {\\n margin: 0 -5px 0 -10px; }\\n ao-archetype-template .cluster-header .ellipsis-container {\\n margin: 0 -13px 0 0; }\\n ao-archetype-template .element-ellipsis {\\n position: relative;\\n z-index: 99;\\n vertical-align: middle;\\n color: #20435c;\\n opacity: 0.4;\\n cursor: pointer; }\\n @media screen and (max-width: 1024px) {\\n ao-archetype-template .archetypes-container {\\n font-weight: 600; } }\\n\",\"\"])},163:function(e,t,n){var a=n(164);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},164:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\"ao-archetype-template {\\n /*\\r\\n * === INDENTING ===\\r\\n */\\n /* Indent 2 or more */ }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster {\\n background-color: #f9f9f9; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster > .form-group {\\n margin-bottom: 0 !important; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster > .cluster-content {\\n border-right: 1px #dddddd solid;\\n border-bottom: 1px #dddddd solid;\\n border-left: 1px #dddddd solid; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster .cluster-content {\\n padding-top: 10px; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster .cluster-content .element-label .control-label {\\n max-width: 100%; }\\n @media (max-width: 768px) {\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster .cluster-content .element-label .control-label {\\n max-width: 90%; } }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster .cluster-header {\\n width: 100%;\\n min-height: 28px;\\n background-color: #3988cd;\\n cursor: pointer;\\n -webkit-user-select: none; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster .cluster-header label.control-label {\\n cursor: default;\\n line-height: 28px;\\n vertical-align: top;\\n margin-left: 9px; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster .cluster-header:hover {\\n background-color: #5ba1de; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster .cluster-chevron {\\n float: right;\\n cursor: pointer;\\n padding-top: 1px !important; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster .cluster-accordion > .cluster-content > ao-cluster > .cluster {\\n margin-bottom: 0 !important; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster .cluster-accordion > .cluster-content > ao-cluster:last-child > .cluster {\\n margin-bottom: 10px !important; }\\n ao-archetype-template form.archetypes\\n> fieldset\\n> div\\n> ao-cluster\\n> .cluster\\n.cluster-header\\nform.archetypes\\n> fieldset\\n> div\\n> ao-cluster\\n> .cluster:first-child\\n.cluster-header {\\n border-top: none; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster > .form-group > .cluster-header label {\\n font-size: 14px !important;\\n color: #f9f9f9;\\n cursor: pointer; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster > .form-group > .cluster-header label.moArchetypeHint {\\n border-bottom: none !important; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster > .form-group > .cluster-header .cluster-chevron {\\n margin-right: 10px;\\n margin-top: 2px; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster > div > .cluster {\\n margin-bottom: 10px;\\n border-bottom: 2px #f1f1f1 solid; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster .cluster {\\n margin: 0 10px 10px;\\n padding: 0;\\n border: 2px #eeeeee solid;\\n background-color: #fff; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster .cluster .cluster {\\n background-color: #f9f9f9; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster .cluster > .form-group {\\n margin-bottom: 0 !important; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster .cluster .cluster-content {\\n padding-bottom: 0; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster .cluster .cluster-content.no-title {\\n padding-top: 0; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster .cluster > .form-group > .cluster-header {\\n background-color: #eeeeee;\\n margin-bottom: 0;\\n cursor: pointer;\\n -webkit-user-select: none;\\n border-top: none; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster .cluster > .form-group > .cluster-header:hover {\\n background-color: #f9f9f9; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster .cluster > .form-group > .cluster-header label {\\n color: #20435c !important;\\n padding: 4px 1px; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster .cluster > .form-group > .cluster-header .cluster-chevron {\\n margin-right: 3px;\\n margin-top: 2px; }\\n ao-archetype-template form.archetypes > fieldset > div > ao-cluster > .cluster .cluster .cluster {\\n margin-bottom: 10px;\\n border-bottom: 2px #eeeeee solid; }\\n\",\"\"])},165:function(e,t,n){var a=n(166);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},166:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\"/*\\r\\n* === DROP REPEATER ADD REMOVE CONTROLS ===\\r\\n*/\\n.add-remove-controls {\\n margin: 0 !important;\\n padding: 0 !important;\\n width: 22px !important;\\n -webkit-user-select: none !important; }\\n .add-remove-controls i {\\n cursor: pointer;\\n padding: 5px !important;\\n margin-bottom: -5px;\\n font-weight: bold; }\\n .add-remove-controls i.fa-plus {\\n color: #3c763d;\\n background-color: #b9df90; }\\n .add-remove-controls i.fa-minus {\\n color: #a94442;\\n background-color: #f2838f; }\\n\\nao-archetype-template #repeatable-overlay {\\n position: absolute;\\n opacity: 0.3;\\n z-index: 10000; }\\n\\nao-archetype-template .repeatable-overlay-add {\\n background-color: #b9df90; }\\n\\nao-archetype-template .repeatable-overlay-remove {\\n background-color: #f2838f; }\\n\",\"\"])},167:function(e,t,n){var a=n(168);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},168:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\"ao-form-elements > .form-group {\\n min-height: 28px;\\n width: 100%; }\\n\\nao-form-elements .alert-unknown-component {\\n margin: 0 0 0 0;\\n padding: 5px 10px; }\\n\\nao-form-elements .element-label {\\n padding-right: 0; }\\n\\n@media (max-width: 767px) {\\n ao-form-elements .element-label {\\n margin-bottom: 5px;\\n padding-top: 0;\\n padding-bottom: 0; }\\n ao-form-elements .input-container {\\n padding: 0;\\n margin-bottom: 10px; } }\\n\\nao-form-elements .uib-time {\\n padding: 0 2px; }\\n ao-form-elements .uib-time:first-child {\\n padding-left: 0; }\\n ao-form-elements .uib-time input,\\n ao-form-elements .uib-time button {\\n height: 27px;\\n padding: 5px 10px;\\n font-size: 12px; }\\n\\nao-form-elements .sub-input-container {\\n min-width: 150px; }\\n\\nao-form-elements .date-button {\\n width: 50px; }\\n\\nao-form-elements .add-remove-btns {\\n font-size: 10px; }\\n\\nao-form-elements .required-red-star::before {\\n content: '*';\\n color: red;\\n position: absolute;\\n top: -4px;\\n left: 2px;\\n font-size: 18px; }\\n\",\"\"])},169:function(e,t,n){var a=n(170);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},170:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\"ao-checkbox .checkbox-inline {\\n line-height: 21px;\\n margin-bottom: -3px; }\\n\\nao-checkbox input[type='checkbox'] {\\n margin-left: 0 !important; }\\n\\nao-checkbox input[type='checkbox']:checked:disabled {\\n filter: invert(100%) hue-rotate(18deg) brightness(3.3); }\\n\",\"\"])},171:function(e,t,n){var a=n(172);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},172:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\".ao-date-input {\\n max-width: 200px; }\\n .ao-date-input:not(:first-child) {\\n padding-left: 10px; }\\n @media all and (max-width: 469px) {\\n .ao-date-input {\\n max-width: none;\\n width: 100%; }\\n .ao-date-input:not(:first-child) {\\n padding-left: 0;\\n margin-top: 10px; }\\n .ao-date-input:not(:first-child) > div {\\n float: right; } }\\n\\n.mo-time-input:not(:first-child) {\\n padding-left: 10px !important; }\\n @media all and (max-width: 469px) {\\n .mo-time-input:not(:first-child) > div {\\n float: right; } }\\n\\n.mo-time-input > div > div {\\n display: inline-block;\\n float: left; }\\n\\n.mo-time-input > div > i {\\n margin: 7px;\\n color: #f04124;\\n cursor: pointer; }\\n\\n@media all and (max-width: 469px) {\\n .mo-time-input {\\n width: 100%;\\n padding-left: 0 !important;\\n margin-top: 10px; } }\\n\\n.no-clear .uib-clear {\\n display: none; }\\n\",\"\"])},173:function(e,t,n){var a=n(174);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},174:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\"ao-embed-archetype .ui-select-refreshing.glyphicon {\\n padding: 8px 25px; }\\n\",\"\"])},175:function(e,t,n){var a=n(176);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},176:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\"ao-multimedia .multimedia-container {\\n position: relative;\\n width: 100%;\\n height: 100%;\\n min-height: 22px; }\\n ao-multimedia .multimedia-container .drop-box {\\n border: 2px dashed #ccc;\\n width: 100%;\\n text-align: center;\\n padding: 10px;\\n cursor: pointer; }\\n ao-multimedia .multimedia-container .drop-box:hover, ao-multimedia .multimedia-container .drop-box.dragover {\\n color: rgba(91, 161, 222, 0.83);\\n border: 2px dashed rgba(91, 161, 222, 0.83); }\\n ao-multimedia .multimedia-container .drop-box.dragover-err {\\n border: 2px dashed #bb0000; }\\n\\nao-multimedia .progress-bar-container {\\n position: absolute;\\n z-index: 2;\\n width: calc(100% - 30px);\\n height: 100%;\\n background-color: rgba(255, 255, 255, 0.7); }\\n ao-multimedia .progress-bar-container > div {\\n position: relative;\\n top: 50%;\\n transform: translateY(-50%); }\\n\\nao-multimedia .progress {\\n margin-bottom: 0; }\\n\\nao-multimedia .media-preview {\\n width: 100%;\\n min-height: 100px;\\n z-index: 1; }\\n ao-multimedia .media-preview .canvas-container {\\n display: inline-block;\\n position: relative;\\n width: calc(100% - 30px);\\n height: 100%; }\\n ao-multimedia .media-preview .canvas-container .image-canvas {\\n width: 100%;\\n height: 150px;\\n background-color: #fff;\\n border: 1px solid #dddddd; }\\n ao-multimedia .media-preview .media-toolbar {\\n display: inline-block;\\n width: 30px;\\n position: absolute;\\n right: 1px;\\n top: 0;\\n background-color: rgba(0, 0, 0, 0.5);\\n border-right: 1px solid rgba(0, 0, 0, 0.2);\\n border-bottom: 1px solid rgba(0, 0, 0, 0.2);\\n font-size: 22px;\\n border-bottom-right-radius: 5px; }\\n ao-multimedia .media-preview .media-toolbar i {\\n cursor: pointer; }\\n ao-multimedia .media-preview .media-toolbar i.fa-times {\\n color: #ff5722; }\\n\",\"\"])},177:function(e,t,n){var a=n(178);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},178:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\".input-ordinal-day {\\n display: inline-block;\\n margin-bottom: 5px; }\\n .input-ordinal-day input {\\n display: inline;\\n width: 25px;\\n padding: 3px;\\n text-align: center; }\\n .input-ordinal-day .ordinal-day-separator {\\n margin: 0 4px 0 0; }\\n .input-ordinal-day input::-webkit-outer-spin-button,\\n .input-ordinal-day input::-webkit-inner-spin-button {\\n /* display: none; <- Crashes Chrome on hover */\\n -webkit-appearance: none;\\n margin: 0;\\n /* <-- Apparently some margin are still there even though it's hidden */ }\\n .input-ordinal-day input[type='number'] {\\n -moz-appearance: textfield; }\\n\\n.input-ordinal-value {\\n display: inline; }\\n .input-ordinal-value input {\\n display: inline;\\n width: 50px;\\n padding: 3px; }\\n\",\"\"])},179:function(e,t,n){var a=n(180);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},180:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\".ref-range {\\n padding: 0; }\\n .ref-range div {\\n padding: 0; }\\n .ref-range label {\\n padding: 0; }\\n\",\"\"])},181:function(e,t,n){var a=n(182);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},182:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\"ao-radio input[type='radio'] {\\n cursor: pointer !important; }\\n\\nao-radio .radio-inline {\\n line-height: 15px;\\n margin-right: 0 !important; }\\n\\nao-radio .valueLabelOffset {\\n position: absolute;\\n top: 100%;\\n left: 33px;\\n transform: translateY(-75%); }\\n\\nao-radio .control-label {\\n overflow-wrap: normal;\\n font-size: 0.6rem !important;\\n max-width: 73px; }\\n\\n@media screen and (max-width: 1024px) {\\n ao-radio .control-label {\\n max-width: 63px;\\n font-size: 0.45rem !important; } }\\n\\n@media screen and (max-width: 768px) {\\n ao-radio .control-label {\\n max-width: 55px;\\n font-size: 0.4rem !important; } }\\n\",\"\"])},183:function(e,t,n){var a=n(184);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},184:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\".ao-select-input {\\n padding-bottom: 10px !important; }\\n @media all and (min-width: 768px) {\\n .ao-select-input {\\n padding-bottom: 0 !important;\\n padding-right: 10px !important; } }\\n\\n.ui-select-match i.fa-times,\\n.ui-select-match i.glyphicon-remove {\\n color: #f04124 !important; }\\n\\n.ui-select-placeholder,\\n.ui-select-match-text,\\n.ui-select-match-item {\\n max-width: 100%;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n padding-right: 30px !important; }\\n\\n.ui-select-choices-row-inner {\\n padding-left: 10px !important; }\\n\\n.ui-select-refreshing.glyphicon {\\n padding: 8px 10px; }\\n\\n.ui-select-no-choice {\\n padding-left: 10px; }\\n\",\"\"])},185:function(e,t,n){var a=n(186);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},186:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\"ao-snomed-lookup > .col-xs-4 {\\n padding-left: 5px !important; }\\n\\nao-snomed-lookup .fa-spinner {\\n font-size: 20px;\\n float: right;\\n margin-top: -24px;\\n margin-right: 8px; }\\n\\nao-snomed-lookup .typeahead-no-results {\\n float: right;\\n margin-top: -24px;\\n margin-right: 8px; }\\n\",\"\"])},187:function(e,t,n){var a=n(188);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},188:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\"ao-text-input {\\n width: 100%;\\n display: block; }\\n ao-text-input div.freeText {\\n padding-right: 17px; }\\n ao-text-input div.freeText textarea {\\n min-height: 18px; }\\n\",\"\"])},189:function(e,t,n){var a=n(190);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},190:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\"\",\"\"])},191:function(e,t,n){var a=n(192);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},192:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\"ao-archetype-list .main-panel {\\n width: 100%;\\n margin-left: auto;\\n margin-right: auto; }\\n\\n@media all and (min-width: 900px) {\\n ao-archetype-list .main-panel {\\n max-width: 900px; } }\\n\\nao-archetype-list .list-group-item.active {\\n background-color: #3988cd; }\\n\\nao-archetype-list .list-group-item-heading {\\n margin-bottom: 0;\\n display: inline-block;\\n width: 75%;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n vertical-align: middle; }\\n\",\"\"])},193:function(e,t,n){var a=n(194);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},194:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\"ao-patient-header {\\n display: block;\\n margin-bottom: 10px; }\\n ao-patient-header .card > .card-header {\\n background-color: #3988cd;\\n color: #f9f9f9;\\n font-size: 14px;\\n border-radius: 0;\\n padding: 4px 10px;\\n border: 0; }\\n ao-patient-header .card-body {\\n font-size: 13px;\\n padding: 0; }\\n ao-patient-header .card-body table {\\n margin: 0; }\\n ao-patient-header label {\\n margin: 0; }\\n\",\"\"])},195:function(e,t,n){var a=n(196);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},196:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\".modal-backdrop {\\n height: 0;\\n width: 0; }\\n\\n.conflict-modal {\\n z-index: 105000 !important; }\\n .conflict-modal .modal-dialog {\\n width: 70%; }\\n .conflict-modal .modal-dialog .modal-header {\\n height: 28px;\\n padding: 4px 10px;\\n background-color: #3988cd;\\n color: #f9f9f9;\\n font-size: 14px; }\\n .conflict-modal .modal-dialog .modal-body {\\n padding: 10px; }\\n .conflict-modal .modal-dialog .modal-body .panel {\\n margin-bottom: 0; }\\n .conflict-modal .modal-dialog .modal-body .panel-body {\\n padding-top: 8px;\\n padding-bottom: 8px; }\\n .conflict-modal .modal-dialog .modal-body .panel-body .form-group {\\n margin-bottom: 0 !important; }\\n @media all and (max-width: 1903px) {\\n .conflict-modal .modal-dialog .modal-body .panel-body .form-elements-container {\\n width: 100%; }\\n .conflict-modal .modal-dialog .modal-body .panel-body .element-label {\\n margin-bottom: 5px;\\n width: 100%; }\\n .conflict-modal .modal-dialog .modal-body .panel-body .element-label label {\\n margin-bottom: 0; } }\\n @media all and (max-width: 1445px) {\\n .conflict-modal .modal-dialog .modal-body .panel-body .form-elements-container div:first-child {\\n width: 100%;\\n padding-right: 0 !important; }\\n .conflict-modal .modal-dialog .modal-body .panel-body .sub-input-container {\\n min-width: 150px;\\n margin-top: 10px;\\n float: right !important; } }\\n .conflict-modal .modal-dialog .modal-body .panel-footer {\\n background-color: #fff; }\\n @media all and (max-width: 767px) {\\n .conflict-modal .modal-dialog .modal-body > .row > .col-sm-6 .sub-input-container {\\n margin-top: 0; } }\\n\",\"\"])},197:function(e,t,n){var a=n(198);\"string\"==typeof a&&(a=[[e.i,a,\"\"]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(10)(a,r);a.locals&&(e.exports=a.locals)},198:function(e,t,n){(e.exports=n(9)(!1)).push([e.i,\".pointer {\\n cursor: pointer !important; }\\n\\n.negate-padding {\\n padding: 0; }\\n\\n@media all and (max-width: 767px) {\\n .negate-padding-sm {\\n padding: 0; } }\\n\\n.drop {\\n z-index: 1; }\\n\\n/*\\n* === Angular ===\\n*/\\n.ng-hide.ng-hide-animate {\\n display: none !important; }\\n\\n/*\\n* === UI Select bug fixes ===\\n*/\\n.ui-select-choices {\\n opacity: 100 !important; }\\n\\n.ui-select-placeholder {\\n height: 0 !important; }\\n\\n.ui-select-toggle {\\n z-index: 1; }\\n .ui-select-toggle .caret {\\n z-index: -1; }\\n\\n.add-remove-btns {\\n font-size: 24px; }\\n .add-remove-btns i {\\n cursor: pointer;\\n padding: 5px;\\n font-weight: bold; }\\n .add-remove-btns i.fa-plus {\\n color: #3c763d;\\n background-color: #b9df90; }\\n .add-remove-btns i.fa-minus {\\n color: #a94442;\\n background-color: #f2838f; }\\n\\n.control-label {\\n font-size: 14px !important;\\n color: #222;\\n text-transform: none;\\n margin-bottom: 0; }\\n\",\"\"])},445:function(e,t,n){\"use strict\";function a(e,t){for(var n=0;n0?this.generateUniqueInternalTemplateID(e+1):e}},{key:\"setPoll\",value:function(){var e=this;this.poll=this.$interval(function(){e.pollingEnabled&&!e.templateAlert&&(e.request||(e.request=!0,e.AOArchetypeTemplateService.getUpdates(e.templateIdentity).then(function(t){e.request=!1})))},1e3)}},{key:\"cancelTemplate\",value:function(){var e=this;this.templateBlockUI.start(),this.AOArchetypeTemplateService.cancelTemplate(this.templateIdentity).then(function(t){e.toolbarOptions.cancel.callback&&e.toolbarOptions.cancel.callback()}).finally(function(){e.templateBlockUI.stop()})}},{key:\"resetTemplate\",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.templateBlockUI.start(),this.AOArchetypeTemplateService.resetTemplate(this.templateIdentity,t).then(function(t){e.archetypeTemplate=angular.copy(t.data.data[0]);var n=e.archetypeTemplate.children;e.AOArchetypeTemplateService.processComponentUpdates(e.templateIdentity,n),e.templateForm.$setPristine()}).finally(function(){e.templateBlockUI.stop()})}},{key:\"saveDraft\",value:function(e){var t=this;this.multimediaEditing?this.AOArchetypeTemplateService.setAlert(this.templateIdentity,{alertClass:\"danger\",dismissable:!0,title:\"Unsaved Data\",message:\"There are unsaved changes to a multimedia component in the template. Save or cancel the changes and try again.\",iconClass:\"fa-exclamation-triangle\"}):(this.templateBlockUI.start(),this.AOArchetypeTemplateService.setDraft(this.templateIdentity).finally(function(){t.templateBlockUI.stop()}))}},{key:\"submitTemplate\",value:function(e){var t=this;if(this.multimediaEditing)this.AOArchetypeTemplateService.setAlert(this.templateIdentity,{alertClass:\"danger\",dismissable:!0,title:\"Unsaved Data\",message:\"There are unsaved changes to a multimedia component in the template. Save or cancel the changes and try again.\",iconClass:\"fa-exclamation-triangle\"});else{if(!this.templateIdentity.purpose){var n={purpose:\"archetypeSubmit\"};return this.templateIdentity.patientID&&(n.patient=\"\".concat(this.templateIdentity.patientID)),this.templateIdentity.templateID&&(n.archetypeId=\"\".concat(this.templateIdentity.templateID)),this.templateIdentity.universalServiceID&&(n.reportTitle=this.templateIdentity.universalServiceID),this.templateIdentity.diagnosticServiceSection&&(n.clinicalArea=\"\".concat(this.templateIdentity.diagnosticServiceSection)),this.templateIdentity.providerID&&(n.orderingProvider=\"\".concat(this.templateIdentity.providerID)),this.toolbarOptions.submit.callback&&(n.sendingCallback=this.toolbarOptions.submit.callback),void this.MOSendDocumentService.showSendDocument(n)}this.templateBlockUI.start(),this.AOArchetypeTemplateService.setTemplate(this.templateIdentity).then(function(e){t.toolbarOptions.submit.callback&&t.toolbarOptions.submit.callback()}).finally(function(){t.templateBlockUI.stop()})}}},{key:\"showHL7\",value:function(e){var t=this;this.AOArchetypeTemplateService.getHL7(this.templateIdentity).then(function(n){if(console.log(\"HL7:\",n),n.meta.success){var a=e?n.data[0].attributes.debugString:n.data[0].attributes.hl7Message,r=t.$window.open();r&&r.document?(r.document.title=\"HL7 - \".concat((new Date).toString()),r.document.body.innerHTML=\"
\".concat(a,\"
\")):alert(\"Popup blocked. Please enable popups for this page.\")}})}},{key:\"hasIdFilter\",value:function(e){return\"\"!==e.id}},{key:\"compileArchetypes\",value:function(e){var t=this;if(e&&0!==e.length){var n=this.$element.find(\".archetypes-container\");angular.forEach(e,function(e){e.id&&\"\"!==e.id&&n&&n.append(t.AOArchetypeTemplateService.compileComponent(t.templateIdentity,e,t.$scope))})}}},{key:\"onAlertSet\",value:function(){var e=this;this.alertSticking=!1;var t=this.$element.find(\".template-alert-bar\");function n(){var e=t[0].getBoundingClientRect(),n=t.find(\".alert\");if(e.top>=0){if(!1===this.alertSticking)return;return this.alertSticking=!1,void n.css({top:\"0\",bottom:\"auto\",position:\"relative\",width:\"100%\"})}if(e.top<0&&e.bottom-n[0].offsetHeight>=0){if(\"top\"===this.alertSticking)return;return this.alertSticking=\"top\",void n.css({top:\"0\",bottom:\"auto\",position:\"fixed\",width:\"\".concat(e.width)})}\"bottom\"!==this.alertSticking&&(this.alertSticking=\"bottom\",n.css({top:\"auto\",bottom:\"0\",position:\"absolute\",width:\"100%\"}))}this.scrollWait=Date.now()+50,this.scrollHandler=function(){e.scrollWait-Date.now()<0&&(n.call(e),e.scrollWait=Date.now()+50)},this.$window.addEventListener(\"scroll\",this.scrollHandler),n.call(this)}},{key:\"clearAlert\",value:function(){delete this.templateAlert,delete this.alertSticking,this.$window.removeEventListener(\"scroll\",this.scrollHandler)}},{key:\"onAlertShowMore\",value:function(){this.MOAlertService.showHTTPError(this.templateAlert.httpException)}},{key:\"updatePendingRequestsCount\",value:function(e){this.pendingRequestsCount+=e}},{key:\"print\",value:function(){var e=[this.templateIdentity.internalTemplateID];this.AOArchetypeTemplateService.printArchetypeResults(e)}}])&&h(t.prototype,n),a&&h(t,a),e}(),v=n(135),g={controller:f,template:n.n(v).a,bindings:{templateIdentity:\"<\",toolbarOptions:\"<\",singleArchetype:\"<\",onArchetypeClose:\"&?\",currentGlifStateAndData:\"<\"}};function y(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e)return null;var r=a&&!n?\"POST\":\"GET\",i=a&&!n?{\"Content-Type\":\"multipart/mixed; boundary=element\"}:null;return this.$stateParams.currentArchetypeId=e.templateID,this.$http({method:r,url:\"\".concat(n||this.MORESTServerConfig.hostname,\"rest/online/archetype/load\"),auth:!0,headers:i,templateIdentity:e,params:{id:e.templateID,patient:e.patientID,purpose:e.purpose,purposeID:e.purposeID,glifid:e.glifID},data:a}).then(function(n){if(n.data&&307===n.data.meta.statusCode)return n;if(200!==n.status||!n.data||n.data.error)return console.error(\"Unhandled exception\",n),t.$stateParams.serverRedirect&&t.MOAuthService.setUser({loggedIn:!0,username:n.data.data[0].userName,sessionKey:n.data.data[0].sessionKey,loginData:{}}),n;var a={viewID:n.data.meta.viewID,universalServiceID:{}};return n.data.meta.instanceIdentifier&&(a.instanceIdentifier=n.data.meta.instanceIdentifier),n.data.data[0].meta.universalServiceID&&(a.universalServiceID.text=n.data.data[0].meta.universalServiceID.text||\"\",a.universalServiceID.identifier=n.data.data[0].meta.universalServiceID.identifier||\"\",a.universalServiceID.nameOfCodingSystem=n.data.data[0].meta.universalServiceID.nameOfCodingSystem||\"\"),n.data.data[0].meta.diagnosticServiceSection&&(a.diagnosticServiceSection=n.data.data[0].meta.diagnosticServiceSection),t.updateTemplateIdentity(e.internalTemplateID,a),n})}},{key:\"setTemplate\",value:function(e){var t=this,n={id:e.templateID,patient:e.patientID,purpose:e.purpose,purposeID:e.purposeID,instanceIdentifier:e.instanceIdentifier};return this.$http({method:\"GET\",url:\"\".concat(this.MORESTServerConfig.hostname,\"rest/online/archetype/submit\"),auth:!0,templateIdentity:e,params:n}).then(function(e){return 200!==e.status||!e.data||e.data.error?(console.error(\"Unhandled exception\",e),e):(e.data.action&&\"redirect\"===e.data.action.action&&(t.$window.location.href=e.data.action.url),e)})}},{key:\"getUpdates\",value:function(e){var t=this,n={id:e.templateID,patient:e.patientID,purpose:e.purpose,purposeID:e.purposeID,instanceIdentifier:e.instanceIdentifier};return this.$http({method:\"POST\",url:\"\".concat(this.MORESTServerConfig.hostname,\"rest/online/archetype/requestUpdate\"),auth:!0,templateIdentity:e,params:n,data:{meta:{viewID:e.viewID}}}).then(function(n){if(200!==n.status||!n.data||n.data.error)return console.error(\"Unhandled exception\",n),n;if(n.data.data&&n.data.data.length>0){console.log(\"/archetype/requestUpdate\",n);var a=t.getComponentUpdatesFromServerResponse(e,n);t.processComponentUpdates(e,a)}return n})}},{key:\"setDraft\",value:function(e){var t=this,n={id:e.templateID,patient:e.patientID,purpose:e.purpose,purposeID:e.purposeID,instanceIdentifier:e.instanceIdentifier};return this.$http({method:\"GET\",url:\"\".concat(this.MORESTServerConfig.hostname,\"rest/online/archetype/save\"),auth:!0,templateIdentity:e,params:n}).then(function(n){return 200!==n.status||!n.data||n.data.error?(console.error(\"Unhandled exception\",n),n):(t.setAlert(e,{alertClass:\"success\",dismissable:!0,title:\"Success\",message:\"The draft has been saved.\",iconClass:\"fa-check\",timeout:1500}),n)})}},{key:\"resetTemplate\",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a={id:e.templateID,patient:e.patientID,purpose:e.purpose,purposeID:e.purposeID,templateInstanceID:e.templateInstanceID,instanceIdentifier:e.instanceIdentifier},r=n?\"clear\":\"reset\";return this.$http({method:\"GET\",url:\"\".concat(this.MORESTServerConfig.hostname,\"rest/online/archetype/\").concat(r),auth:!0,templateIdentity:e,params:a}).then(function(n){return 200!==n.status||!n.data||n.data.error?(console.error(\"Unhandled exception\",n),n):(t.updateTemplateIdentity(e.internalTemplateID,{viewID:n.data.meta.viewID}),n)})}},{key:\"cancelTemplate\",value:function(e){var t={id:e.templateID,patient:e.patientID,instanceIdentifier:e.instanceIdentifier};return this.$http({method:\"GET\",url:\"\".concat(this.MORESTServerConfig.hostname,\"rest/online/archetype/cancel\"),auth:!0,templateIdentity:e,params:t}).then(function(e){return 200!==e.status||!e.data||e.data.error?(console.error(\"Unhandled exception\",e),e):e})}},{key:\"getHL7\",value:function(e){var t={id:e.templateID,patient:e.patientID,purpose:e.purpose,purposeID:e.purposeID,instanceIdentifier:e.instanceIdentifier};return this.$http({method:\"GET\",url:\"\".concat(this.MORESTServerConfig.hostname,\"rest/online/archetype/hl7\"),auth:!0,templateIdentity:e,params:t}).then(function(e){return 200!==e.status||!e.data||e.data.error?(console.error(\"Unhandled exception\",e),e):e.data})}},{key:\"getHL7ArchetypeRender\",value:function(e,t){var n={id:t.templateID,patient:t.patientID,purpose:t.purpose};return this.$http({method:\"GET\",url:\"\".concat(e,\"rest/online/archetype/hl7/preview\"),auth:!0,params:n}).then(function(e){return 200!==e.status||!e.data||e.data.error?(console.error(\"Unhandled exception\",e),e):e.data})}},{key:\"printArchetypeResults\",value:function(e){var t=this,n=\"\",a=0,r=this.MORESTServerConfig.hostname;this.$stateParams.serverRedirect&&(r=this.$stateParams.serverRedirect,this.MOAuthService.setUser({loggedIn:!0,username:this.$stateParams.redirectUserName,sessionKey:this.$stateParams.redirectSessionKey,loginData:{}})),angular.forEach(e,function(i){t.getHL7ArchetypeRender(r,i).then(function(r){r.meta.success&&r.data&&r.data[0].attributes.messages[0].displaySegments&&(n+=r.data[0].attributes.messages[0].displaySegments[0].value)&&(n=(n='
'.concat(n,\"
\")).replace(/<b>/g,\"\").replace(/<\\/b>/g,\"\")),++a===e.length&&t.MODocumentPrinterService.printHTML(n||\"
No Results Found
\",!0,\"Medical-Objects Electronic Health Guideline \".concat(1===e.length&&e[0].universalServiceID.text||\"Archetype\",\" Result\"),0)})})}},{key:\"componentRepeatableChange\",value:function(e,t,n){var a=this,r={id:e.templateID,patient:e.patientID,purpose:e.purpose,purposeID:e.purposeID,instanceIdentifier:e.instanceIdentifier},i=null;return this.$stateParams.serverRedirect&&(i=this.$stateParams.serverRedirect,this.MOAuthService.setUser({loggedIn:!0,username:this.$stateParams.redirectUserName,sessionKey:this.$stateParams.redirectSessionKey,loginData:{}})),this.$http({method:\"POST\",url:\"\".concat(i||this.MORESTServerConfig.hostname,\"rest/online/archetype/repeatable\"),auth:!0,templateIdentity:e,params:r,data:{meta:{viewID:e.viewID},data:[{action:t,id:n}]}}).then(function(t){if(200!==t.status||!t.data||t.data.error)return console.error(\"Unhandled exception\",t),t;if(t.data.data&&t.data.data.length){var n=a.getComponentUpdatesFromServerResponse(e,t);a.processComponentUpdates(e,n)}return t.data.data})}},{key:\"setFormElement\",value:function(e,t){var n=this,a=angular.copy(t);a.meta.version=\"\".concat(Number(a.meta.version)+1),this.updateComponent(e,a,!1),this.getArchetypeTemplateController(e).templateForm.$setDirty();var r={id:e.templateID,patient:e.patientID,purpose:e.purpose,purposeID:e.purposeID,instanceIdentifier:e.instanceIdentifier},i=this.MORESTServerConfig.hostname;return this.$stateParams.serverRedirect&&(i=this.$stateParams.serverRedirect,this.MOAuthService.setUser({loggedIn:!0,username:this.$stateParams.redirectUserName,sessionKey:this.$stateParams.redirectSessionKey,loginData:{}})),this.$http({method:\"POST\",url:\"\".concat(i,\"rest/online/archetype/edit\"),auth:!0,templateIdentity:e,params:r,data:{meta:{viewID:e.viewID},data:[t]}}).then(function(t){if(n.$stateParams.serverRedirect&&n.MOAuthService.setUser({loggedIn:!0,username:n.$stateParams.refererUserName,sessionKey:n.$stateParams.refererSessionKey,loginData:{}}),200!==t.status||!t.data||t.data.error)return console.error(\"Unhandled exception\",t),t;if(t.data.data&&t.data.data.length){var r=n.getComponentUpdatesFromServerResponse(e,t);n.processComponentUpdates(e,r,a)}return t})}},{key:\"getComponentUpdatesFromServerResponse\",value:function(e,t){var n=this;return t.data.meta.viewID&&t.data.meta.viewID!==e.viewID?(console.log(\"viewID changed\",\"was\",e.viewID,\"got\",t.data.meta.viewID),this.setAlert(e,{alertClass:\"warning\",dismissable:!1,title:\"View Reset\",message:\"Your template has been reset.\",iconClass:\"fa-exclamation-triangle\",button:{text:\"OK\",callback:function(){n.clearAlert(e)}}}),this.updateTemplateIdentity(e.internalTemplateID,{viewID:t.data.meta.viewID}),t.data.data[0].children):t.data.data}},{key:\"processComponentUpdates\",value:function(e,t,n){var a=this;this.setDocumentBodyMinHeight(!0),angular.forEach(t,function(t){var r=n&&t.id===n.id,i=\"TAllowArchetypePanel\"===t.meta.delphiClass,o=r&&Number(t.meta.version)!==Number(n.meta.version);!r||o||i?a.updateComponent(e,t,!0):console.log(\"Ignored component update as version did not change.\",t)}),this.$timeout(function(){a.setDocumentBodyMinHeight()})}},{key:\"setDocumentBodyMinHeight\",value:function(e){var t=this.$window.document.body,n=this.getDocumentScrollHeight(this.$window.document);angular.element(t).css(\"min-height\",e?\"\".concat(n,\"px\"):\"\")}},{key:\"getDocumentScrollHeight\",value:function(e){var t=e.body,n=e.documentElement,a=[t.scrollHeight,t.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight];return Math.max.apply(Math,a)}},{key:\"updateComponent\",value:function(e,t,n){var a=this;this.findAndUpdateArchetypeReference(e,t),n&&this.$timeout(function(){a.showComponentUpdateVisual(e,t)})}},{key:\"findAndUpdateArchetypeReference\",value:function(e,t){if(t.id){var n=t.id.split(\".\")[0],a=angular.element(\"#templateChild_\".concat(e.internalTemplateID,\"_\").concat(n)),r=angular.copy(a.controller(\"aoCluster\").cluster),i=function e(t,n){if(t.id===n)return t;if(t.children&&t.children.length>0)for(var a=0;a0){var a=n.children().first();this.$animate.addClass(a,\"ao-animate-value-change\").then(function(){a.removeClass(\"ao-animate-value-change\")})}}},{key:\"compileComponent\",value:function(e,t,n){var a=n.$new(),r=\"TSectionHeaderArchetypeData\"===t.meta.delphiClass||\"TSectionHeaderArchetypePanel\"===t.meta.delphiClass||\"TAccordionArchetypeData\"===t.meta.delphiClass||\"\"===t.meta.delphiClass,i=r?\"cluster\":\"form-element\",o=r?\"ao-cluster\":\"ao-form-elements\",l=angular.element(\"<\".concat(o,\">\"));return l.attr(\"internal-template-id\",e.internalTemplateID).attr(\"id\",\"templateChild_\".concat(e.internalTemplateID,\"_\").concat(t.id.replace(/\\./g,\"-\"))).attr(i,\"child\"),parseInt(t.meta.occurrencesHigh,10)>1&&l.attr(\"ao-repeatable\",i),a.child=t,a.parentCtrl=n.$ctrl,this.$compile(l)(a)}},{key:\"setAlert\",value:function(e,t){var n=this,a=this.getArchetypeTemplateController(e);a.templateAlert=t,this.$timeout(function(){a.onAlertSet()}),t.timeout>0&&this.$timeout(function(){n.clearAlert(e)},t.timeout)}},{key:\"clearAlert\",value:function(e){this.getArchetypeTemplateController(e).clearAlert()}},{key:\"showConflictModal\",value:function(e){var t=this;this.$uibModal.open({component:\"aoConflictModal\",size:\"lg\",windowClass:\"conflict-modal\",appendTo:this.getArchetypeTemplateController(e.templateIdentity).$element,resolve:{conflict:function(){return e}}}).result.then(function(n){var a=angular.copy(n),r=t.getArchetypeTemplateController(e.templateIdentity);r.templateBlockUI.start(),t.setFormElement(e.templateIdentity,a).finally(function(){r.templateBlockUI.stop()}),t.clearAlert(e.templateIdentity)},angular.noop)}}])&&y(t.prototype,n),a&&y(t,a),e}(),$=(n(161),angular.module(\"moArchetypesOnline.components.archetypeTemplate\",[]).component(\"aoArchetypeTemplate\",g).service(\"AOArchetypeTemplateService\",b).name);function k(e,t){for(var n=0;n1,this.templateIdentity=this.AOArchetypeTemplateService.getTemplateIdentity(this.internalTemplateID),this.isAccordion=\"TAccordionArchetypeData\"===this.cluster.meta.delphiClass,this.isAccordionChild=this.parentController.isAccordion||!1,this.childComponents=[],this.setLabel(),this.isAccordion&&(this.activeAccordionChildID=this.cluster.children[0].id),this.isAccordionChild?this.collapsed=!(this.parentController.activeAccordionChildID===this.cluster.id):this.collapsed=this.cluster.meta&&(\"true\"===this.cluster.meta.collapsedAtStart||!0===this.cluster.meta.collapsedAtStart)}},{key:\"$postLink\",value:function(){var e=this;this.cluster.children&&\"false\"===this.cluster.meta.collapsedAtStart&&this.$timeout(function(){e.compileComponents(e.cluster.children)})}},{key:\"$onChanges\",value:function(e){e.cluster&&!e.cluster.isFirstChange()&&(angular.equals(e.cluster.currentValue,e.cluster.previousValue)||(this.updateCluster(this.cluster),this.setLabel()))}},{key:\"updateCluster\",value:function(e){return!!e&&(this.cluster=angular.copy(e),this.childComponents.length!==this.cluster.children.length?(this.destroyComponents(),this.compileComponents(this.cluster.children)):this.updateComponents(this.cluster.children),!0)}},{key:\"setLabel\",value:function(){this.cluster.attributes.value.applicationID?(this.label=this.cluster.attributes.value.applicationID.namespaceID||this.cluster.attributes.archetypeID,this.description=this.cluster.attributes.archetypeID):(this.label=this.cluster.attributes.value.text,this.description=this.cluster.attributes.description||!1)}},{key:\"toggleVisibility\",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.clusterAnimation||(this.isAccordionChild&&!1===t?this.toggleAccordion():(this.collapsed=!this.collapsed,this.collapsed?this.destroyComponents():this.$timeout(function(){e.compileComponents(e.cluster.children)})))}},{key:\"toggleAccordion\",value:function(){this.parentController.onAccordionChildToggle(this.cluster,!this.collapsed)}},{key:\"onAccordionChildToggle\",value:function(e,t){this.childComponents.find(function(e){return e.controller(\"aoCluster\").clusterAnimation})||(angular.forEach(this.childComponents,function(t){var n=t.controller(\"aoCluster\");!1!==n.collapsed&&n.cluster.id!==e.id||n.toggleVisibility(!0)}),t?delete this.activeAccordionChildID:this.activeAccordionChildID=e.id)}},{key:\"updateComponents\",value:function(e){var t=this;e.forEach(function(e){var n=t.childComponents.find(function(t){return!!(t&&t.scope()&&t.scope().child)&&t.scope().child.id===e.id});n&&(\"false\"===e.meta.visible?n.hide():n.show(),n.scope().child=angular.copy(e))})}},{key:\"destroyComponents\",value:function(){var e=this;this.clusterContentElement&&(this.clusterContentElement.children().each(function(e,t){var n=angular.element(t);n.scope()&&n.scope().$destroy()}),this.clusterAnimation=this.$animate.leave(this.clusterContentElement).then(function(){delete e.clusterAnimation}))}},{key:\"compileComponents\",value:function(e){var t=this;if(!this.collapsed){this.clusterContentElement=angular.element('
'),this.childComponents=[];var n=angular.element(this.$element.children()[0]),a=n.children()[0];e.forEach(function(e){var n=t.AOArchetypeTemplateService.compileComponent(t.templateIdentity,e,t.$scope);\"false\"===e.meta.visible&&n.hide(),t.childComponents.push(n)}),this.clusterContentElement.append(this.childComponents),this.clusterAnimation=this.$animate.enter(this.clusterContentElement,n,a).then(function(){delete t.clusterAnimation})}}},{key:\"addClusterSection\",value:function(e){var t=this;this.clusterBlockUI.start(),e.stopPropagation(),this.AOArchetypeTemplateService.componentRepeatableChange(this.templateIdentity,\"add\",this.cluster.id).finally(function(){t.clusterBlockUI.stop()})}},{key:\"removeClusterSection\",value:function(e){var t=this;this.clusterBlockUI.start(),e.stopPropagation(),this.AOArchetypeTemplateService.componentRepeatableChange(this.templateIdentity,\"remove\",this.cluster.id).finally(function(){t.clusterBlockUI.stop()})}}])&&k(t.prototype,n),a&&k(t,a),e}(),x=n(136),E={controller:C,template:n.n(x).a,bindings:{internalTemplateID:\"\\n \\n \\n \\n ',position:\"left top\",constrainToWindow:!0,openOn:void 0,remove:!0,classes:\"drop-theme\",tetherOptions:{offset:\"5px 0\"}}),this.drop.remove(),this.drop.on(\"open\",function(){e.setupOverlayListeners()}),this.drop.on(\"close\",function(){angular.element(\"#repeatable-overlay\").remove()}),this.drop.open()}},{key:\"setupOverlayListeners\",value:function(){var e=this,t=angular.element(\".add-remove-controls .fa-plus\"),n=angular.element(\".add-remove-controls .fa-minus\");t.off(\"mouseenter mouseleave click touchend\"),n.off(\"mouseenter mouseleave click touchend\"),t.hover(function(){e.showRepeatableHelperOverlay(\"repeatable-overlay-add\")},function(){angular.element(\"#repeatable-overlay\").remove()}),n.hover(function(){e.showRepeatableHelperOverlay(\"repeatable-overlay-remove\")},function(){angular.element(\"#repeatable-overlay\").remove()}),t.on(\"click touchend\",function(){e.templateBlockUI.start(),e.AOArchetypeTemplateService.componentRepeatableChange(e.templateIdentity,\"add\",e.child.id).finally(function(){e.templateBlockUI.stop()}),e.drop.close()}),n.on(\"click touchend\",function(){e.templateBlockUI.start(),e.AOArchetypeTemplateService.componentRepeatableChange(e.templateIdentity,\"remove\",e.child.id).finally(function(){e.templateBlockUI.stop()}),e.drop.close()})}},{key:\"showRepeatableHelperOverlay\",value:function(e){angular.element(\"#repeatable-overlay\").remove();var t=this.dropTarget.css(\"height\");this.isCluster&&(t=\"\".concat(this.dropTarget.parent().parent().height(),\"px\"));var n=angular.element('
'));n.css(\"width\",this.dropTarget.css(\"width\")),n.css(\"height\",t),this.dropTarget.hasClass(\"form-group\")&&n.addClass(\"form-group\"),this.dropTarget.before(n)}}])&&I(t.prototype,n),a&&I(t,a),e}();function T(e,t){for(var n=0;n1,this.componentName=this.AOFormElementsService.getComponentNameFromDelphiClass(this.formElement.meta),this.templateIdentity=this.AOArchetypeTemplateService.getTemplateIdentity(this.internalTemplateID),this.isRequired=\"1\"===this.formElement.meta.occurrencesLow,this.debounceSaveUpdateToServer=this.debounce(this.AOArchetypeTemplateService.setFormElement,1e3).bind(this.AOArchetypeTemplateService)}},{key:\"$postLink\",value:function(){var e=this;this.$timeout(function(){e.compileFormElement()})}},{key:\"$onChanges\",value:function(e){e.formElement&&!e.formElement.isFirstChange()&&\"ao-embed-archetype\"===this.componentName&&this.onEmbeddedArchetypeChanges(e.formElement.previousValue,e.formElement.currentValue)}},{key:\"onEmbeddedArchetypeChanges\",value:function(e,t){if(this.embeddedArchetype||!t.children)if(!this.embeddedArchetype||t.children){if(this.embeddedArchetype&&t.children){var n=t.children[0].attributes,a=e.children[0].attributes;if(!angular.equals(n,a))this.destroyEmbeddedArchetype(),this.compileEmbeddedArchetype();else{var r=D(t.children,1);this.embeddedArchetype=r[0]}}}else this.destroyEmbeddedArchetype();else this.compileEmbeddedArchetype()}},{key:\"compileFormElement\",value:function(){if(!this.componentName)return this.isUnknownElement=!0,void console.error(\"ID: \".concat(this.formElement.id,\" - Unknown delphiClass: \").concat(this.formElement.meta.delphiClass));var e=angular.element(\"<\".concat(this.componentName,\">\"));e.attr(\"internal-template-id\",\"$ctrl.internalTemplateID\"),e.attr(\"form-element\",\"$ctrl.formElement\"),e.attr(\"input-change\",\"$ctrl.inputChange({formElement, disableDebounce})\"),e.attr(\"on-error-change\",\"$ctrl.onErrorChange({messages})\");var t=this.$scope.$new(),n=this.$compile(e)(t);this.$element.find(\".form-elements-container\").html(n),this.formElement.children&&this.compileEmbeddedArchetype()}},{key:\"compileEmbeddedArchetype\",value:function(){this.embeddedArchetype=angular.copy(this.formElement.children[0]);var e=angular.element(\"\");e.attr(\"internal-template-id\",\"$ctrl.internalTemplateID\"),e.attr(\"cluster\",\"$ctrl.embeddedArchetype\"),this.embeddedArchetypeElement=this.$compile(e)(this.$scope.$new()),this.$element.append(this.embeddedArchetypeElement)}},{key:\"destroyEmbeddedArchetype\",value:function(){this.embeddedArchetypeElement.scope().$destroy(),this.embeddedArchetypeElement.remove(),delete this.embeddedArchetypeElement,delete this.embeddedArchetype}},{key:\"inputChange\",value:function(e){var t=angular.copy(e.formElement),n=this.AOArchetypeTemplateService.getTemplateIdentity(this.internalTemplateID);t&&(this.AOArchetypeTemplateService.updateComponent(n,t,!1),e.disableDebounce?this.AOArchetypeTemplateService.setFormElement(n,t):this.debounceSaveUpdateToServer(n,t))}},{key:\"onErrorChange\",value:function(e){var t=angular.element(this.$element.children()[0]);if(e&&e.messages&&e.messages.length>0)return this.errorMessages=angular.isArray(e.messages)?e.messages:[e.messages],void t.addClass(\"has-error\");this.errorMessages=[],t.removeClass(\"has-error\")}},{key:\"addElementSection\",value:function(e,t){e.stopPropagation(),this.AOArchetypeTemplateService.componentRepeatableChange(this.templateIdentity,\"add\",this.formElement.id)}},{key:\"removeElementSection\",value:function(e){e.stopPropagation(),this.AOArchetypeTemplateService.componentRepeatableChange(this.templateIdentity,\"remove\",this.formElement.id)}}])&&P(t.prototype,n),a&&P(t,a),e}(),M=n(137),U={controller:R,template:n.n(M).a,bindings:{internalTemplateID:\"0&&void 0!==arguments[0]?arguments[0]:[],n={};return t.forEach(function(t,a){var r=angular.copy(e.VALUE_CODES);Object.keys(r).forEach(function(e){t.identifier!==r[e].identifier&&t.text!==r[e].text||(n[e]=a)})}),n||console.error(\"Unknown choice values for ID: \".concat(this.formElement.id)),n}},{key:\"getInitialChoiceIndex\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;e||console.error(\"No value choices for ID: \".concat(this.formElement.id));var a=e.find(function(e){return e.identifier===t||e.text===n});return a||console.error(\"Unknown value choice for ID: \".concat(this.formElement.id)),e.indexOf(a)}},{key:\"emitChanges\",value:function(e){this.inputChange({formElement:e,disableDebounce:!0})}}])&&V(t.prototype,n),a&&V(t,a),e}(),H=n(138),j={controller:N,template:n.n(H).a,bindings:{formElement:\"<\",inputChange:\"&\",onErrorChange:\"&\"}},B=(n(169),angular.module(\"moArchetypesOnline.components.formElements.checkbox\",[]).component(\"aoCheckbox\",j).name);function q(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=[];if(null===e){if(\"datetime\"===this.inputType||\"time\"===this.inputType){var a=\"* Incorrect \".concat(this.inputType,\" value. If you're trying to clear the value please use the clear button.\");return n.push(a),void this.onErrorChange({messages:n})}this.toggleCalendar(!0,t)}var r=angular.copy(this.formElement),i=this.setUpdatedValue(this.inputType,r.attributes.value,e,t);if(!1===i){var o=\"* Incorrect \".concat(this.inputType,\" format. If you are having difficulties, try using the picker\");n.push(o)}else null!==i&&(r.attributes.value=i,this.emitChanges(r));this.onErrorChange({messages:n})}},{key:\"emitChanges\",value:function(e){var t=\"dateRange\"===this.inputType;this.inputChange({formElement:e,disableDebounce:t})}},{key:\"toggleCalendar\",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(\"boolean\"==typeof e){var n=!0===t?this.endDatepicker:this.datepicker;n.isOpen=!e}}},{key:\"getTimeFromHL7\",value:function(e){var t=\"\".concat(e);if(isNaN(parseInt(t,10))||parseInt(t,10)<0)return\"\";var n=new Date;return n.setHours(t.substring(0,2)),n.setMinutes(t.substring(2,4)),n.setSeconds(\"0\"),n.setMilliseconds(\"0\"),n}},{key:\"setInputType\",value:function(e){switch(e){case\"TTimeArchetypePanel\":return\"time\";case\"TDateArchetypePanel\":return\"date\";case\"TDateTimeArchetypePanel\":return\"datetime\";case\"TDateRangeArchetypePanel\":return\"dateRange\";default:return this.onErrorChange({messages:[\"* Invalid input type provided. Please try refreshing the page\"]}),!1}}},{key:\"setDatepicker\",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=c(),r=this.validateValue(a),i=!1===n?this.datepicker:this.endDatePicker,o=!!i&&i.isOpen,l=!1===r?\"\":new this.MOHL7Date(r).myDate,s=\"time\"===e?this.getTimeFromHL7(t.value):l;return{model:l,timeModel:s,isOpen:o,dateFormat:\"dd/MM/yyyy\"};function c(){return!0===n?t.rangeHigh:\"dateRange\"===e?t.rangeLow:t.value}}},{key:\"validateValue\",value:function(e){return!(!angular.isString(e)||isNaN(parseInt(e,10)))&&e}},{key:\"setUpdatedValue\",value:function(e,t,n,a){var r=null===n?\"\":n;if(!angular.isDate(r)&&\"\"!==r)return!1;var i=this.setUpdateMember(e,r);return!1===i?i:!0===a?t.rangeHigh===i?null:(t.rangeHigh=i,t):\"dateRange\"===e?t.rangeLow===i?null:(t.rangeLow=i,t):t.value===i?null:(t.value=i,t)}},{key:\"setUpdateMember\",value:function(e,t){if(null===t||\"\"===t)return\"\";if(\"time\"===e)return this.$filter(\"date\")(t,\"HHmm\");var n=new this.MOHL7Date(t);return\"date\"===e||\"dateRange\"===e?n.HL7Str.substring(0,8):\"datetime\"===e&&n.HL7Str.split(\".\")[0]}}])&&q(t.prototype,n),a&&q(t,a),e}(),G=n(139),K={controller:z,template:n.n(G).a,bindings:{formElement:\"<\",inputChange:\"&\",onErrorChange:\"&\"}},W=(n(171),angular.module(\"moArchetypesOnline.components.formElements.date\",[]).component(\"aoDate\",K).name);function _(e,t){for(var n=0;nt)||(this.onErrorChange({messages:[\"* File exceeds maximum size of \".concat(t,\"kB\")]}),!1):(this.onErrorChange({messages:[\"* File is the incorrect format. Valid formats are \".concat(n.join(\", \"))]}),!1)}},{key:\"getMedia\",value:function(e){var t=this;this.downloading=!0,this.AOMultimediaService.getMedia(e).then(function(n){0===n.size?t.onErrorChange({messages:[\"* File record does not exist on the server. Please upload another.\"]}):(t.media=n,t.media.upload={fileID:e},t.convertAndDisplayImage(n))}).finally(function(){t.downloading=!1})}},{key:\"convertAndDisplayImage\",value:function(e){var t=this;this.AOMultimediaService.convertToDataUrl(e).then(function(e){t.media.dataUrl=e,t.loadImageToCanvas(e)})}},{key:\"loadImageToCanvas\",value:function(e){var t=this.$element.find(\".image-canvas\"),n=t[0].getContext(\"2d\"),a=angular.element(\"\")[0];a.onload=function(){var e=t.width()/a.width,r=Math.floor(a.height*e);t.height(r),t[0].width=t.width(),t[0].height=t.height(),n.drawImage(a,0,0,t.width(),r)},a.src=e}},{key:\"updateFormElement\",value:function(e){console.log(\"updateFormElementFile\",e);var t=angular.copy(this.formElement);e?(t.meta.action=\"add\",t.meta.fileID=e.upload.fileID):t.meta.action=\"delete\",t.attributes.value.moclass=t.attributes.value.moclass||\"CE\",this.emitChanges(t)}},{key:\"emitChanges\",value:function(e){this.inputChange({formElement:e,disableDebounce:!0})}}])&&Z(t.prototype,n),a&&Z(t,a),e}(),te=n(141),ne={controller:ee,template:n.n(te).a,bindings:{internalTemplateID:\"0&&a.AOArchetypeTemplateService.errorResponse(e.data.error[0]),e})}},{key:\"convertToBlob\",value:function(e){return this.Upload.dataUrltoBlob(e,\"signature.png\")}},{key:\"convertToDataUrl\",value:function(e){return this.Upload.base64DataUrl(e)}},{key:\"getMedia\",value:function(e){var t=\"\".concat(this.MORESTServerConfig.hostname,\"rest/online/file/retrieve?fileID=\").concat(e);return this.Upload.urlToBlob(t)}}])&&ae(t.prototype,n),a&&ae(t,a),e}(),ie=(n(175),angular.module(\"moArchetypesOnline.components.formElements.multimedia\",[]).component(\"aoMultimedia\",ne).service(\"AOMultimediaService\",re).name);function oe(e,t){for(var n=0;nparseInt(n,10)&&e.push(\"* Value must be lower or equal to \".concat(n))),e):e}},{key:\"emitChanges\",value:function(e){this.inputChange({formElement:e,disableDebounce:!0})}}])&&oe(t.prototype,n),a&&oe(t,a),e}(),se=n(142),ce={controller:le,template:n.n(se).a,bindings:{formElement:\"<\",inputChange:\"&\",onErrorChange:\"&\"}},ue=angular.module(\"moArchetypesOnline.components.formElements.numberInput\",[]).component(\"aoNumberInput\",ce).name;function de(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:[],n=[],a=e||t.length,r=0;rparseInt(n,10))&&!(!isNaN(t)&&e0?this.rightPadValueWithZero(e):Number(e):\"\"}},{key:\"rightPadValueWithZero\",value:function(e){var t=Number(this.formElement.meta.decimalPlaces);if(!(e.toString().indexOf(\".\")>-1))return\"\".concat(e,\".\").concat(new Array(t+1).join(\"0\"));var n=e.toString().split(\".\")[1];return n.length-1;if(a&&0===n)t.push(\"* Value may not have decimal places.\");else if(a&&n>0){var r=e.toString().split(\".\");r.length>2?t.push(\"* Value must have only have one decimal.\"):r[1].length>n&&t.push(\"* Value must have \".concat(n,\" decimal places.\"))}return t}},{key:\"emitChanges\",value:function(e){this.inputChange({formElement:e,disableDebounce:!0})}}])&&ve(t.prototype,n),a&&ve(t,a),e}(),ye=n(144),be={controller:ge,template:n.n(ye).a,bindings:{formElement:\"<\",inputChange:\"&\",onErrorChange:\"&\"}},$e=(n(179),angular.module(\"moArchetypesOnline.components.formElements.quantity\",[]).component(\"aoQuantity\",be).name);function ke(e,t){for(var n=0;n=12?1:this.Math.floor(12/t.length),u=t.length%2==0||1===c?0:1,d={itemWidth:c,labelWidth:t.length>=12?\"12\":\"\".concat(c*t.length-u)};return\"\"!==a&&(s++,d.high=a),\"\"!==i&&(s++,d.mid=i),\"\"!==l&&(s++,d.low=l),d.count=s,d}},{key:\"onRadioClick\",value:function(e){this.selectedOption=e,angular.equals(this.selectedOption,this.lastSelectedOption)&&(this.selectedOption={moclass:\"CE\"}),this.lastSelectedOption=angular.copy(this.selectedOption),this.valueChange(this.selectedOption)}},{key:\"valueChange\",value:function(e){var t=angular.copy(this.formElement);t.attributes.value=angular.copy(e),this.emitChanges(t)}},{key:\"emitChanges\",value:function(e){this.inputChange({formElement:e,disableDebounce:!0})}},{key:\"onDateChange\",value:function(e){if(angular.isUndefined(e)){this.onErrorChange({messages:\"* Incorrect date format. Please re-enter in the format dd/mm/yyyy\"})}else{this.onErrorChange({messages:[]}),null===e&&this.toggleCalendar(!0);var t=new this.MOHL7Date(e),n=t.HL7Str?t.HL7Str.substring(0,8):\"\",a=angular.copy(this.formElement);n!==a.attributes.date&&(n||a.attributes.date)&&(a.attributes.date=n,this.emitChanges(a))}}},{key:\"toggleCalendar\",value:function(e){!0!==e&&!1!==e||(this.datepicker.isOpen=!e)}},{key:\"getColLength\",value:function(e){if(e<10){var t=this.Math.floor(12/e);return 0===t?1:t}var n=this.Math.floor(e/12);return 0===n?1:n}},{key:\"indexIsWholeNumber\",value:function(e){return this.Math.floor(this.valueChoices.length/2)%1==0}}])&&ke(t.prototype,n),a&&ke(t,a),e}(),xe=n(145),Ee={controller:Ce,template:n.n(xe).a,bindings:{formElement:\"<\",inputChange:\"&\",onErrorChange:\"&\"}},Ae=(n(181),angular.module(\"moArchetypesOnline.components.formElements.radio\",[]).component(\"aoRadio\",Ee).name);function Ie(e,t){for(var n=0;n\")}}])&&He(t.prototype,n),a&&He(t,a),e}(),Be=n(148),qe={controller:je,template:n.n(Be).a,bindings:{formElement:\"<\",inputChange:\"&\",onErrorChange:\"&\"}},ze=(n(187),angular.module(\"moArchetypesOnline.components.formElements.textInput\",[]).component(\"aoTextInput\",qe).name);function Ge(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2];t.stopPropagation(),t.preventDefault(),this.onArchetypeSelect({archetypeId:e,secondary:n})}}])&&Je(t.prototype,n),a&&Je(t,a),e}(),Ze=n(150),et={controller:Qe,template:n.n(Ze).a,bindings:{dev:\"<\",onArchetypeSelect:\"&\"}};function tt(e,t){for(var n=0;n-1&&(l=!0)}),!0!==l)return e.reject(n);var s=e.defer();switch(n.status){case-1:return o.setAlert(r.templateIdentity,{alertClass:\"danger\",dismissable:!1,title:\"Connection Error\",message:\"Looks like there was a problem contacting the server. Verify you have an active internet connection and try again.\",iconClass:\"fa-plug\",button:{text:\"Retry\",callback:function(){var e=i.getUser();a.retryAll(e),o.clearAlert(r.templateIdentity)}}}),a.append(r,s),s.promise;case 400:return n.data&&n.data.error.length>0&&o.setAlert(r.templateIdentity,{alertClass:\"danger\",dismissable:!1,title:n.data.error[0].title,message:n.data.error[0].description,iconClass:\"fa-exclamation-triangle\",httpException:n,button:{text:\"Reload\",callback:function(e){e.rebuildComponent()}}}),e.reject(n);case 401:return e.reject(n);case 409:var c={client:r.data.data[0],server:n.data.data[0],templateIdentity:r.templateIdentity},u=c.client.attributes,d=c.server.attributes;return angular.equals(u,d)?(o.updateComponent(c.templateIdentity,c.server,!1),console.warn(\"Conflict ignored as values match\"),e.resolve(n)):(o.setAlert(r.templateIdentity,{alertClass:\"warning\",dismissable:!1,title:n.data.error[0].title,message:n.data.error[0].description,iconClass:\"fa-exclamation-triangle\",button:{text:\"Resolve\",callback:function(){o.showConflictModal(c)}}}),e.reject(n));case 500:return o.setAlert(r.templateIdentity,{alertClass:\"danger\",dismissable:!1,title:\"Server Error\",message:\"Sorry, the server was unable to complete your request. You can try the reload button or refreshing the page.\",iconClass:\"fa-exclamation-circle\",httpException:n,button:{text:\"Reload\",callback:function(e){e.rebuildComponent()}}}),e.reject(n);default:return n}}}}function gt(e){e.interceptors.push(ft,vt)}gt.$inject=[\"$httpProvider\"],vt.$inject=[\"$q\",\"$injector\",\"$state\",\"MOHttpBufferService\"],ft.$inject=[\"$injector\"];var yt=gt,bt=(n(197),[\"ngAnimate\",\"ngCookies\",\"ngSanitize\",\"ui.router\",\"ui.bootstrap\",\"ui.bootstrap.datetimepicker\",\"ui.select\",\"rzSlider\",\"webcam\",\"angular-clipboard\",\"uiSwitch\",\"ng.deviceDetector\",\"blockUI\",\"monospaced.elastic\",\"ngFileUpload\",\"ngTasty.service.debounce\",\"moNgCommon\",\"rzSlider\",\"ngDraggable\",p,ht]),$t=angular.module(\"moArchetypesOnline\",bt).config(yt).name;t.default=$t},52:function(e,t){e.exports=function(e){var t=\"undefined\"!=typeof window&&window.location;if(!t)throw new Error(\"fixUrls requires window.location\");if(!e||\"string\"!=typeof e)return e;var n=t.protocol+\"//\"+t.host,a=n+t.pathname.replace(/\\/[^\\/]*$/,\"/\");return e.replace(/url\\s*\\(((?:[^)(]|\\((?:[^)(]+|\\([^)(]*\\))*\\))*)\\)/gi,function(e,t){var r,i=t.trim().replace(/^\"(.*)\"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\\/\\/|https:\\/\\/|file:\\/\\/\\/|\\s*$)/i.test(i)?e:(r=0===i.indexOf(\"//\")?i:0===i.indexOf(\"/\")?n+i:a+i.replace(/^\\.\\//,\"\"),\"url(\"+JSON.stringify(r)+\")\")})}},9:function(e,t,n){\"use strict\";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||\"\",a=e[3];if(!a)return n;if(t&&\"function\"==typeof btoa){var r=(o=a,l=btoa(unescape(encodeURIComponent(JSON.stringify(o)))),s=\"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(l),\"/*# \".concat(s,\" */\")),i=a.sources.map(function(e){return\"/*# sourceURL=\".concat(a.sourceRoot).concat(e,\" */\")});return[n].concat(i).concat([r]).join(\"\\n\")}var o,l,s;return[n].join(\"\\n\")}(t,e);return t[2]?\"@media \".concat(t[2],\"{\").concat(n,\"}\"):n}).join(\"\")},t.i=function(e,n){\"string\"==typeof e&&(e=[[null,e,\"\"]]);for(var a={},r=0;r