function animateSpinner(n,t=null){if("add"===n)return $("button.btn-spin-action").attr("disabled",!0),$("a.btn-spin-action").addClass("disabled").attr("aria-disabled",!0),void setToast("","spinner","",0);if("remove"===n){if($("button.btn-spin-action").removeAttr("disabled"),$("a.btn-spin-action").removeClass("disabled").attr("aria-disabled",!1),$("#messages-toasts .toast-spinner, #messages-toasts .toast-completed").remove(),null===t)return;if(t)return void setToast("","completed","",3e3);setToast("","danger","",0)}}function confirmAction(n,t,e,o,a,d){const i=document.getElementById("dynamicConfirmActionModal");i&&i.remove();const s=`\n    <div class="modal fade" id="dynamicConfirmActionModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="dynamicConfirmActionModalLabel" aria-hidden="true">\n      <div class="modal-dialog">\n        <div class="modal-content">\n          <div class="modal-header">\n            <h5 class="modal-title" id="dynamicConfirmActionModalLabel">${e}</h5>\n            <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>\n          </div>\n          <div class="modal-body">\n            ${o}\n          </div>\n          <div class="modal-footer">\n            <button type="button" class="btn btn-secondary btn-spin-action" data-bs-dismiss="modal">${a}</button>\n            <button type="button" id="saveDynamicConfirmActionModalBtn" class="btn btn-danger btn-spin-action">${d}</button>\n          </div>\n        </div>\n      </div>\n    </div>\n  `;document.body.insertAdjacentHTML("beforeend",s);const c=new bootstrap.Modal(document.getElementById("dynamicConfirmActionModal"));c.show(),document.getElementById("saveDynamicConfirmActionModalBtn").addEventListener("click",(function(){const e=document.getElementById("form"+n),o=e.querySelector('input[name="action"]');o&&(o.value=t),e.submit(),c.hide()})),document.getElementById("dynamicConfirmActionModal").addEventListener("hidden.bs.modal",(function(){document.getElementById("dynamicConfirmActionModal").remove()}))}function setModalParentForm(n,t){if(t.code){let e=document.createElement("input");e.type="hidden",e.name="code",e.value=t.code.value,$("#"+n).parent().append(e)}else if(t.elements["codes[]"]){let t=[];document.querySelectorAll('input[name="codes[]"]:checked').forEach((n=>{t.push(n.value)})),t.forEach((t=>{let e=document.createElement("input");e.type="hidden",e.name="codes[]",e.value=t,$("#"+n).parent().append(e)})),console.log(t)}}$(document).ready((function(){$(".clickableRow").mousedown((function(n){if(1===n.which||2===n.which){var t=$(this).attr("data-href"),e=$(this).attr("data-bs-target");void 0!==t&&!1!==t&&(void 0!==e&&"_blank"===e||2===n.which?window.open($(this).attr("data-href")):parent.document.location=$(this).attr("data-href"))}})),$(".cancelClickable").mousedown((function(n){n.preventDefault(),n.stopPropagation()})),$(document).on("click","nav .dropdown-submenu",(function(n){n.stopPropagation()})),$(document).on("shown.bs.modal",".modal",(function(){$(this).find("[autofocus]").focus()}))}));