{"version":3,"file":"app-DxovxQz4.js","sources":["../../../app/javascript/entrypoints/site/app.js"],"sourcesContent":["/* Template Name: Jobstack - Job Portal Tailwind CSS Template\n Author: Shreethemes\n Email: support@shreethemes.in\n Website: https://shreethemes.in\n Version: 1.6.0\n Created: March 2023\n File Description: Main JS file of the template\n*/\n\n/*********************************/\n/* INDEX */\n/*================================\n * 01. Loader *\n * 02. Toggle Menus *\n * 03. Active Menu *\n * 04. Clickable Menu *\n * 05. Menu Sticky *\n * 06. Back to top *\n * 07. Active Sidebar Menu *\n * 08. Feather icon *\n * 09. Small Menu *\n * 10. Contact JS *\n * 11. Light & Dark Theme *\n * 12. LTR & RTL Mode *\n ================================*/\n\nwindow.addEventListener(\"load\", fn, false);\n\n// window.onload = function loader() {\nfunction fn() {\n // Preloader\n if (document.getElementById(\"preloader\")) {\n setTimeout(() => {\n document.getElementById(\"preloader\").style.visibility = \"hidden\";\n document.getElementById(\"preloader\").style.opacity = \"0\";\n }, 350);\n }\n // Menus\n activateMenu();\n}\n\n//Menu\n/*********************/\n/* Toggle Menu */\n/*********************/\nfunction toggleMenu() {\n document.getElementById(\"isToggle\").classList.toggle(\"open\");\n var isOpen = document.getElementById(\"navigation\");\n if (isOpen.style.display === \"block\") {\n isOpen.style.display = \"none\";\n } else {\n isOpen.style.display = \"block\";\n }\n}\n/*********************/\n/* Menu Active */\n/*********************/\nfunction getClosest(elem, selector) {\n // Element.matches() polyfill\n if (!Element.prototype.matches) {\n Element.prototype.matches =\n Element.prototype.matchesSelector ||\n Element.prototype.mozMatchesSelector ||\n Element.prototype.msMatchesSelector ||\n Element.prototype.oMatchesSelector ||\n Element.prototype.webkitMatchesSelector ||\n function (s) {\n var matches = (this.document || this.ownerDocument).querySelectorAll(s),\n i = matches.length;\n while (--i >= 0 && matches.item(i) !== this) {}\n return i > -1;\n };\n }\n\n // Get the closest matching element\n for (; elem && elem !== document; elem = elem.parentNode) {\n if (elem.matches(selector)) return elem;\n }\n return null;\n}\n\nfunction activateMenu() {\n var menuItems = document.getElementsByClassName(\"sub-menu-item\");\n if (menuItems) {\n var matchingMenuItem = null;\n for (var idx = 0; idx < menuItems.length; idx++) {\n if (menuItems[idx].href === window.location.href) {\n matchingMenuItem = menuItems[idx];\n }\n }\n\n if (matchingMenuItem) {\n matchingMenuItem.classList.add(\"active\");\n\n var immediateParent = getClosest(matchingMenuItem, \"li\");\n\n if (immediateParent) {\n immediateParent.classList.add(\"active\");\n }\n\n var parent = getClosest(immediateParent, \".child-menu-item\");\n if (parent) {\n parent.classList.add(\"active\");\n }\n\n var parent = getClosest(parent || immediateParent, \".parent-menu-item\");\n\n if (parent) {\n parent.classList.add(\"active\");\n\n var parentMenuitem = parent.querySelector(\".menu-item\");\n if (parentMenuitem) {\n parentMenuitem.classList.add(\"active\");\n }\n\n var parentOfParent = getClosest(parent, \".parent-parent-menu-item\");\n if (parentOfParent) {\n parentOfParent.classList.add(\"active\");\n }\n } else {\n var parentOfParent = getClosest(\n matchingMenuItem,\n \".parent-parent-menu-item\",\n );\n if (parentOfParent) {\n parentOfParent.classList.add(\"active\");\n }\n }\n }\n }\n}\n/*********************/\n/* Clickable manu */\n/*********************/\nif (document.getElementById(\"navigation\")) {\n var elements = document\n .getElementById(\"navigation\")\n .getElementsByTagName(\"a\");\n for (var i = 0, len = elements.length; i < len; i++) {\n elements[i].onclick = function (elem) {\n if (elem.target.getAttribute(\"href\") === \"javascript:void(0)\") {\n var submenu = elem.target.nextElementSibling.nextElementSibling;\n submenu.classList.toggle(\"open\");\n }\n };\n }\n}\n/*********************/\n/* Menu Sticky */\n/*********************/\nfunction windowScroll() {\n const navbar = document.getElementById(\"topnav\");\n if (navbar != null) {\n if (\n document.body.scrollTop >= 50 ||\n document.documentElement.scrollTop >= 50\n ) {\n navbar.classList.add(\"nav-sticky\");\n } else {\n navbar.classList.remove(\"nav-sticky\");\n }\n }\n}\n\nwindow.addEventListener(\"scroll\", (ev) => {\n ev.preventDefault();\n windowScroll();\n});\n/*********************/\n/* Back To TOp */\n/*********************/\n\nwindow.onscroll = function () {\n scrollFunction();\n};\n\nfunction scrollFunction() {\n var mybutton = document.getElementById(\"back-to-top\");\n if (mybutton != null) {\n if (\n document.body.scrollTop > 500 ||\n document.documentElement.scrollTop > 500\n ) {\n mybutton.classList.add(\"flex\");\n mybutton.classList.remove(\"hidden\");\n } else {\n mybutton.classList.add(\"hidden\");\n mybutton.classList.remove(\"flex\");\n }\n }\n}\n\nfunction topFunction() {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n}\n\n/*********************/\n/* Active Sidebar */\n/*********************/\n(function () {\n var current = location.pathname.substring(\n location.pathname.lastIndexOf(\"/\") + 1,\n );\n if (current === \"\") return;\n var menuItems = document.querySelectorAll(\".sidebar-nav a\");\n for (var i = 0, len = menuItems.length; i < len; i++) {\n if (menuItems[i].getAttribute(\"href\").indexOf(current) !== -1) {\n menuItems[i].parentElement.className += \" active\";\n }\n }\n})();\n\n/*********************/\n/* Feather Icons */\n/*********************/\n// feather.replace();\n\n/*********************/\n/* Small Menu */\n/*********************/\ntry {\n var spy = new Gumshoe(\"#navmenu-nav a\");\n} catch (err) {}\n\n/*********************/\n/* Contact Form */\n/*********************/\n\ntry {\n function validateForm() {\n var name = document.forms[\"myForm\"][\"name\"].value;\n var email = document.forms[\"myForm\"][\"email\"].value;\n var subject = document.forms[\"myForm\"][\"subject\"].value;\n var comments = document.forms[\"myForm\"][\"comments\"].value;\n document.getElementById(\"error-msg\").style.opacity = 0;\n document.getElementById(\"error-msg\").innerHTML = \"\";\n if (name == \"\" || name == null) {\n document.getElementById(\"error-msg\").innerHTML =\n \"
\";\n fadeIn();\n return false;\n }\n if (email == \"\" || email == null) {\n document.getElementById(\"error-msg\").innerHTML =\n \" \";\n fadeIn();\n return false;\n }\n if (subject == \"\" || subject == null) {\n document.getElementById(\"error-msg\").innerHTML =\n \" \";\n fadeIn();\n return false;\n }\n if (comments == \"\" || comments == null) {\n document.getElementById(\"error-msg\").innerHTML =\n \" \";\n fadeIn();\n return false;\n }\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n document.getElementById(\"simple-msg\").innerHTML = this.responseText;\n document.forms[\"myForm\"][\"name\"].value = \"\";\n document.forms[\"myForm\"][\"email\"].value = \"\";\n document.forms[\"myForm\"][\"subject\"].value = \"\";\n document.forms[\"myForm\"][\"comments\"].value = \"\";\n }\n };\n xhttp.open(\"POST\", \"php/contact.php\", true);\n xhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xhttp.send(\n \"name=\" +\n name +\n \"&email=\" +\n email +\n \"&subject=\" +\n subject +\n \"&comments=\" +\n comments,\n );\n return false;\n }\n\n function fadeIn() {\n var fade = document.getElementById(\"error-msg\");\n var opacity = 0;\n var intervalID = setInterval(function () {\n if (opacity < 1) {\n opacity = opacity + 0.5;\n fade.style.opacity = opacity;\n } else {\n clearInterval(intervalID);\n }\n }, 200);\n }\n} catch (error) {}\n\n/*********************/\n/* Dark & Light Mode */\n/*********************/\ntry {\n function changeTheme(e) {\n e.preventDefault();\n const htmlTag = document.getElementsByTagName(\"html\")[0];\n\n if (htmlTag.className.includes(\"dark\")) {\n htmlTag.className = \"light\";\n } else {\n htmlTag.className = \"dark\";\n }\n }\n\n const switcher = document.getElementById(\"theme-mode\");\n switcher?.addEventListener(\"click\", changeTheme);\n\n const chk = document.getElementById(\"chk\");\n\n chk.addEventListener(\"change\", changeTheme);\n} catch (err) {}\n\n/*********************/\n/* LTR & RTL Mode */\n/*********************/\ntry {\n const htmlTag = document.getElementsByTagName(\"html\")[0];\n function changeLayout(e) {\n e.preventDefault();\n const switcherRtl = document.getElementById(\"switchRtl\");\n if (switcherRtl.innerText === \"LTR\") {\n htmlTag.dir = \"ltr\";\n } else {\n htmlTag.dir = \"rtl\";\n }\n }\n const switcherRtl = document.getElementById(\"switchRtl\");\n switcherRtl?.addEventListener(\"click\", changeLayout);\n} catch (err) {}\n"],"names":["fn","activateMenu","getClosest","elem","selector","s","matches","i","menuItems","matchingMenuItem","idx","immediateParent","parent","parentMenuitem","parentOfParent","elements","len","submenu","windowScroll","navbar","ev","scrollFunction","mybutton","current","spy","changeTheme","e","htmlTag","switcher","changeLayout","switcherRtl"],"mappings":"AA0BA,OAAO,iBAAiB,OAAQA,EAAI,EAAK,EAGzC,SAASA,GAAK,CAER,SAAS,eAAe,WAAW,GACrC,WAAW,IAAM,CACf,SAAS,eAAe,WAAW,EAAE,MAAM,WAAa,SACxD,SAAS,eAAe,WAAW,EAAE,MAAM,QAAU,GACtD,EAAE,GAAG,EAGRC,EAAc,CAChB,CAkBA,SAASC,EAAWC,EAAMC,EAAU,CAkBlC,IAhBK,QAAQ,UAAU,UACrB,QAAQ,UAAU,QAChB,QAAQ,UAAU,iBAClB,QAAQ,UAAU,oBAClB,QAAQ,UAAU,mBAClB,QAAQ,UAAU,kBAClB,QAAQ,UAAU,uBAClB,SAAUC,EAAG,CAGX,QAFIC,GAAW,KAAK,UAAY,KAAK,eAAe,iBAAiBD,CAAC,EACpEE,EAAID,EAAQ,OACP,EAAEC,GAAK,GAAKD,EAAQ,KAAKC,CAAC,IAAM,MAAM,CAC7C,OAAOA,EAAI,EACZ,GAIEJ,GAAQA,IAAS,SAAUA,EAAOA,EAAK,WAC5C,GAAIA,EAAK,QAAQC,CAAQ,EAAG,OAAOD,EAErC,OAAO,IACT,CAEA,SAASF,GAAe,CACtB,IAAIO,EAAY,SAAS,uBAAuB,eAAe,EAC/D,GAAIA,EAAW,CAEb,QADIC,EAAmB,KACdC,EAAM,EAAGA,EAAMF,EAAU,OAAQE,IACpCF,EAAUE,CAAG,EAAE,OAAS,OAAO,SAAS,OAC1CD,EAAmBD,EAAUE,CAAG,GAIpC,GAAID,EAAkB,CACpBA,EAAiB,UAAU,IAAI,QAAQ,EAEvC,IAAIE,EAAkBT,EAAWO,EAAkB,IAAI,EAEnDE,GACFA,EAAgB,UAAU,IAAI,QAAQ,EAGxC,IAAIC,EA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