if(void 0===addCsrfToForms)function addCsrfToForms(){let e=document.querySelector('meta[name="csrf-token"]');if(e){let a=e.getAttribute("content");document.querySelectorAll("form").forEach((e=>{let t=(e.getAttribute("method")||"get").toLowerCase();if("get"===t)return;let n=e.getAttribute("action");if(n)try{let o=new URL(n,window.location.href);if(o.origin!==window.location.origin)return}catch(e){}if(e.querySelector('input[name="_token"]'))return;let r=document.createElement("input");r.type="hidden",r.name="_token",r.value=a,e.appendChild(r)}))}}!function(){let e=document.querySelector('meta[name="csrf-token"]');if(e){let a=e.getAttribute("content");$(document).ready((function(){addCsrfToForms(),$.ajaxSetup({headers:{"X-CSRF-TOKEN":a},statusCode:{419:function(e){window.swal?swal("Page Expired","Please refresh the page and try again.","warning"):alert("Page Expired. Please refresh the page and try again.")}}})})),$.ajaxSetup({headers:{"X-CSRF-TOKEN":a},statusCode:{419:function(e){window.swal?swal("Page Expired","Please refresh the page and try again.","warning"):alert("Page Expired. Please refresh the page and try again.")}}}),setTimeout((()=>{$.ajaxSetup({headers:{"X-CSRF-TOKEN":a},statusCode:{419:function(e){window.swal?swal("Page Expired","Please refresh the page and try again.","warning"):alert("Page Expired. Please refresh the page and try again.")}}})}),2e3),$(document).on("ajaxComplete",(function(){addCsrfToForms()}))}}();