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UjG,SAASmG,WACjB,IAAI5C,OAAS4C,SAAS5C,OAClB6C,SAAW7C,OAAOP,QAAQ,MAC9BkD,SAASG,aAELD,WACE7C,OAAO5B,UAAU2E,SAAS,gBAC5BF,SAASzE,UAAUrB,IAAI,WAEvB8F,SAASzE,UAAUe,OAAO,WAE9B,IAGFwD,SAASK,QAAQP,QAAS,CACxBQ,WAAW,EACXC,SAAS,EACTC,YAAY,EACZC,gBAAiB,CAAC,UAMtB,EAEAC,WAAY,WACV,MAAMZ,QAAU9E,SAAS2F,eAAe,kBAExC,IAAIX,SAAW,IAAIY,kBAAiB,SAAUb,WAKxC/E,SAASmC,cAAc,sCACzBmC,WAAWO,aAAaC,QAASC,UAAWC,SAEhD,IAEAA,SAASK,QAAQP,QAAS,CACxBQ,WAAW,EACXC,SAAS,EACTC,YAAY,EACZC,gBAAiB,CAAC,UAEtB,EAEAI,KAAM,WACUrH,KAER+F,gBAFQ/F,KAGRkH,YACR,GAGFpB,WAAWuB,M","sources":["webpack://build/../usuall/node_modules/mmenu-light/esm/modules/match-media-toggler/index.js","webpack://build/../usuall/node_modules/mmenu-light/esm/modules/helpers.js","webpack://build/../usuall/node_modules/mmenu-light/esm/modules/sliding-panels-navigation/index.js","webpack://build/../usuall/node_modules/mmenu-light/esm/modules/offcanvas-drawer/index.js","webpack://build/../usuall/node_modules/mmenu-light/esm/core/index.js","webpack://build/../usuall/node_modules/mmenu-light/src/mmenu-light.js","webpack://build/../usuall/assets/javascripts/menuMobile.js"],"sourcesContent":["/**\n * Class for a match media toggler.\n */\nvar MmToggler = /** @class */ (function () {\n /**\n * Create the match media.\n *\n * @param {string} mediaquery Media query to use.\n */\n function MmToggler(mediaquery) {\n var _this = this;\n this.listener = function (evnt) {\n (evnt.matches ? _this.matchFns : _this.unmatchFns).forEach(function (listener) {\n listener();\n });\n };\n this.toggler = window.matchMedia(mediaquery);\n this.toggler.addListener(this.listener);\n this.matchFns = [];\n this.unmatchFns = [];\n }\n /**\n * Add a function to the list,\n * also fires the added function.\n *\n * @param {Function} match Function to fire when the media query matches.\n * @param {Function} unmatch Function to fire when the media query does not match.\n */\n MmToggler.prototype.add = function (match, unmatch) {\n this.matchFns.push(match);\n this.unmatchFns.push(unmatch);\n (this.toggler.matches ? match : unmatch)();\n };\n return MmToggler;\n}());\nexport default MmToggler;\n","/**\n * Convert a list to an array.\n *\n * @param \t{NodeList|HTMLCollection} list \tThe list or collection to convert into an array.\n * @return\t{array}\t\t\t\t\t\t\tThe array.\n */\nexport var r = function (list) {\n return Array.prototype.slice.call(list);\n};\n/**\n * Find elements in the given context.\n *\n * @param \t{string}\t\tselector\t\t\tThe query selector to search for.\n * @param \t{HTMLElement}\t[context=document]\tThe context to search in.\n * @return\t{HTMLElement[]}\t\t\t\t\t\tThe found list of elements.\n */\nexport var $ = function (selector, context) {\n return r((context || document).querySelectorAll(selector));\n};\n","import { r, $ } from '../helpers';\nvar prefix = 'mm-spn';\n/**\n * Class for navigating in a mobile menu.\n */\nvar MmSlidingPanelsNavigation = /** @class */ (function () {\n /**\n * Class for navigating in a mobile menu.\n *\n * @param {HTMLElement} node HTMLElement for the menu.\n * @param {string} title The title for the menu.\n * @param {string} selectedClass The class for selected listitems.\n * @param {boolean} slidingSubmenus Whether or not to use sliding submenus.\n * @param {string} theme The color scheme for the menu.\n */\n function MmSlidingPanelsNavigation(node, title, selectedClass, slidingSubmenus, theme) {\n this.node = node;\n this.title = title;\n this.slidingSubmenus = slidingSubmenus;\n this.selectedClass = selectedClass;\n // Add classname.\n this.node.classList.add(prefix);\n this.node.classList.add(prefix + \"--\" + theme);\n this.node.classList.add(prefix + \"--\" + (this.slidingSubmenus ? 'navbar' : 'vertical'));\n this._setSelectedl();\n this._initAnchors();\n }\n Object.defineProperty(MmSlidingPanelsNavigation.prototype, \"prefix\", {\n /** Prefix for the class. */\n get: function () {\n return prefix;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Open the given panel.\n *\n * @param {HTMLElement} panel Panel to open.\n */\n MmSlidingPanelsNavigation.prototype.openPanel = function (panel) {\n /** Parent LI for the panel. */\n var listitem = panel.parentElement;\n // Sliding submenus\n if (this.slidingSubmenus) {\n /** Title above the panel to open. */\n var title_1 = panel.dataset.mmSpnTitle;\n // Opening the main level UL.\n if (listitem === this.node) {\n this.node.classList.add(prefix + \"--main\");\n }\n // Opening a sub level UL.\n else {\n this.node.classList.remove(prefix + \"--main\");\n // Find title from parent LI.\n if (!title_1) {\n r(listitem.children).forEach(function (child) {\n if (child.matches('a, span')) {\n title_1 = child.textContent;\n }\n });\n }\n }\n // Use the default title.\n if (!title_1) {\n title_1 = this.title;\n }\n // Set the title.\n this.node.dataset.mmSpnTitle = title_1;\n // Unset all panels from being opened and parent.\n $(\".\" + prefix + \"--open\", this.node).forEach(function (open) {\n open.classList.remove(prefix + \"--open\");\n open.classList.remove(prefix + \"--parent\");\n });\n // Set the current panel as being opened.\n panel.classList.add(prefix + \"--open\");\n panel.classList.remove(prefix + \"--parent\");\n // Set all parent panels as being parent.\n var parent_1 = panel.parentElement.closest('ul');\n while (parent_1) {\n parent_1.classList.add(prefix + \"--open\");\n parent_1.classList.add(prefix + \"--parent\");\n parent_1 = parent_1.parentElement.closest('ul');\n }\n }\n // Vertical submenus\n else {\n /** Whether or not the panel is currently opened. */\n var isOpened = panel.matches(\".\" + prefix + \"--open\");\n // Unset all panels from being opened and parent.\n $(\".\" + prefix + \"--open\", this.node).forEach(function (open) {\n open.classList.remove(prefix + \"--open\");\n });\n // Toggle the current panel.\n panel.classList[isOpened ? 'remove' : 'add'](prefix + \"--open\");\n // Set all parent panels as being opened.\n var parent_2 = panel.parentElement.closest('ul');\n while (parent_2) {\n parent_2.classList.add(prefix + \"--open\");\n parent_2 = parent_2.parentElement.closest('ul');\n }\n }\n };\n /**\n * Initiate the selected listitem / open the current panel.\n */\n MmSlidingPanelsNavigation.prototype._setSelectedl = function () {\n /** All selected LIs. */\n var listitems = $('.' + this.selectedClass, this.node);\n /** The last selected LI. */\n var listitem = listitems[listitems.length - 1];\n /** The opened UL. */\n var panel = null;\n if (listitem) {\n panel = listitem.closest('ul');\n }\n if (!panel) {\n panel = this.node.querySelector('ul');\n }\n this.openPanel(panel);\n };\n /**\n * Initialize the click event handlers.\n */\n MmSlidingPanelsNavigation.prototype._initAnchors = function () {\n var _this = this;\n /**\n * Clicking an A in the menu: prevent bubbling up to the LI.\n *\n * @param {HTMLElement} target The clicked element.\n * @return {boolean} handled Whether or not the event was handled.\n */\n var clickAnchor = function (target) {\n if (target.matches('a')) {\n return true;\n }\n return false;\n };\n /**\n * Click a LI or SPAN in the menu: open its submenu (if present).\n *\n * @param {HTMLElement} target The clicked element.\n * @return {boolean} Whether or not the event was handled.\n */\n var openSubmenu = function (target) {\n /** Parent listitem for the submenu. */\n var listitem;\n // Find the parent listitem.\n if (target.closest('span')) {\n listitem = target.parentElement;\n }\n else if (target.closest('li')) {\n listitem = target;\n }\n else {\n listitem = false;\n }\n if (listitem) {\n r(listitem.children).forEach(function (panel) {\n if (panel.matches('ul')) {\n _this.openPanel(panel);\n }\n });\n return true;\n }\n return false;\n };\n /**\n * Click the menu (the navbar): close the last opened submenu.\n *\n * @param {HTMLElement} target The clicked element.\n * @return {boolean} Whether or not the event was handled.\n */\n var closeSubmenu = function (target) {\n /** The opened ULs. */\n var panels = $(\".\" + prefix + \"--open\", target);\n /** The last opened UL. */\n var panel = panels[panels.length - 1];\n if (panel) {\n /** The second to last opened UL. */\n var parent_3 = panel.parentElement.closest('ul');\n if (parent_3) {\n _this.openPanel(parent_3);\n return true;\n }\n }\n return false;\n };\n this.node.addEventListener('click', function (evnt) {\n var target = evnt.target;\n var handled = false;\n handled = handled || clickAnchor(target);\n handled = handled || openSubmenu(target);\n handled = handled || closeSubmenu(target);\n if (handled) {\n evnt.stopImmediatePropagation();\n }\n });\n };\n return MmSlidingPanelsNavigation;\n}());\nexport default MmSlidingPanelsNavigation;\n","var prefix = 'mm-ocd';\n/**\n * Class for off-canvas behavior.\n */\nvar MmOffCanvasDrawer = /** @class */ (function () {\n /**\n * Class for off-canvas drawer.\n *\n * @param {HTMLElement} [node] The element to put in the drawer.\n * @param {String} [position=left] The position of the drawer, can be \"left\" or \"right\".\n */\n function MmOffCanvasDrawer(node, position) {\n var _this = this;\n if (node === void 0) { node = null; }\n // Create the wrapper.\n this.wrapper = document.createElement('div');\n this.wrapper.classList.add(\"\" + prefix);\n this.wrapper.classList.add(prefix + \"--\" + position);\n // Create the drawer.\n this.content = document.createElement('div');\n this.content.classList.add(prefix + \"__content\");\n this.wrapper.append(this.content);\n // Create the backdrop.\n this.backdrop = document.createElement('div');\n this.backdrop.classList.add(prefix + \"__backdrop\");\n this.wrapper.append(this.backdrop);\n // Add the nodes to the .\n document.body.append(this.wrapper);\n if (node) {\n this.content.append(node);\n }\n // Click the backdrop.\n var close = function (evnt) {\n _this.close();\n evnt.stopImmediatePropagation();\n };\n this.backdrop.addEventListener('touchstart', close, { passive: true });\n this.backdrop.addEventListener('mousedown', close, { passive: true });\n }\n Object.defineProperty(MmOffCanvasDrawer.prototype, \"prefix\", {\n /** Prefix for the class. */\n get: function () {\n return prefix;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Open the drawer.\n */\n MmOffCanvasDrawer.prototype.open = function () {\n this.wrapper.classList.add(prefix + \"--open\");\n document.body.classList.add(prefix + \"-opened\");\n };\n /**\n * Close the drawer.\n */\n MmOffCanvasDrawer.prototype.close = function () {\n this.wrapper.classList.remove(prefix + \"--open\");\n document.body.classList.remove(prefix + \"-opened\");\n };\n return MmOffCanvasDrawer;\n}());\nexport default MmOffCanvasDrawer;\n","import MmToggler from '../modules/match-media-toggler/index';\nimport MmSlidingPanelsNavigation from '../modules/sliding-panels-navigation/index';\nimport MmOffCanvasDrawer from '../modules/offcanvas-drawer/index';\n/**\n * Class for a lightweight mobile menu.\n */\nvar MmenuLight = /** @class */ (function () {\n /**\n * Create a lightweight mobile menu.\n *\n * @param {HTMLElement} menu HTML element for the menu.\n * @param {string} [mediaQuery='all'] Media queury to match for the menu.\n */\n function MmenuLight(menu, mediaQuery) {\n if (mediaQuery === void 0) { mediaQuery = 'all'; }\n // Store the menu node.\n this.menu = menu;\n // Create the toggler instance.\n this.toggler = new MmToggler(mediaQuery);\n }\n /**\n * Add navigation for the menu.\n *\n * @param {object} options Options for the navigation.\n */\n MmenuLight.prototype.navigation = function (options) {\n var _this = this;\n // Only needs to be done ones.\n if (!this.navigator) {\n options = options || {};\n var _a = options.title, title = _a === void 0 ? 'Menu' : _a, _b = options.selectedClass, selectedClass = _b === void 0 ? 'Selected' : _b, _c = options.slidingSubmenus, slidingSubmenus = _c === void 0 ? true : _c, _d = options.theme, theme = _d === void 0 ? 'light' : _d;\n this.navigator = new MmSlidingPanelsNavigation(this.menu, title, selectedClass, slidingSubmenus, theme);\n // En-/disable\n this.toggler.add(function () { return _this.menu.classList.add(_this.navigator.prefix); }, function () { return _this.menu.classList.remove(_this.navigator.prefix); });\n }\n return this.navigator;\n };\n /**\n * Add off-canvas behavior to the menu.\n *\n * @param {object} options Options for the off-canvas drawer.\n */\n MmenuLight.prototype.offcanvas = function (options) {\n var _this = this;\n // Only needs to be done ones.\n if (!this.drawer) {\n options = options || {};\n var _a = options.position, position = _a === void 0 ? 'left' : _a;\n this.drawer = new MmOffCanvasDrawer(null, position);\n /** Original location in the DOM for the menu. */\n var orgLocation_1 = document.createComment('original menu location');\n this.menu.after(orgLocation_1);\n // En-/disable\n this.toggler.add(function () {\n // Move the menu to the drawer.\n _this.drawer.content.append(_this.menu);\n }, function () {\n // Close the drawer.\n _this.drawer.close();\n // Move the menu to the original position.\n orgLocation_1.after(_this.menu);\n });\n }\n return this.drawer;\n };\n return MmenuLight;\n}());\nexport default MmenuLight;\n","/*!\n * Mmenu Light\n * mmenujs.com/mmenu-light\n *\n * Copyright (c) Fred Heusschen\n * www.frebsite.nl\n *\n * License: CC-BY-4.0\n * http://creativecommons.org/licenses/by/4.0/\n */\n\n//\tThe module\nimport MmenuLight from '../esm/core/index';\n\n// Export module\nexport default MmenuLight;\n\n//\tGlobal namespace\nwindow.MmenuLight = MmenuLight;\n","import MmenuLight from 'mmenu-light';\n\nconst MenuMobile = {\n setMenuMobile: function () {\n const mmenuWrapper = document.querySelector('#mm-menu-mobile');\n const mmenu = new MmenuLight(mmenuWrapper);\n\n //precisa do navigation e do drawer\n const navigator = mmenu.navigation({\n title: 'Menu',\n slidingSubmenus: false,\n selected: '-active',\n });\n\n const drawer = mmenu.offcanvas();\n\n document.querySelector('[data-action=\"open-menu-mobile\"]').addEventListener('click', (e) => {\n e.preventDefault();\n\n drawer.open();\n });\n\n document.querySelector('[data-action=\"close-menu-mobile\"]').addEventListener('click', (e) => {\n e.preventDefault();\n\n drawer.close();\n });\n\n window.mmenu = drawer;\n },\n\n handleArrows: function (mmenuEl, mutations, observer) {\n mutations.forEach((mutation) => {\n let target = mutation.target;\n let listItem = target.closest('li');\n observer.disconnect();\n\n if (listItem) {\n if (target.classList.contains('mm-spn--open')) {\n listItem.classList.add('-active');\n } else {\n listItem.classList.remove('-active');\n }\n }\n });\n\n observer.observe(mmenuEl, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['class'],\n });\n\n // listItems.forEach((listItem) => {\n // let parentListItem = listItem.closest('li').c;\n // });\n },\n\n watchMmenu: function () {\n const mmenuEl = document.getElementById('mm-menu-mobile');\n\n var observer = new MutationObserver(function (mutations) {\n // const targetElement = mutations[0].target;\n // if (targetElement.getAttribute('data-ignore-mutation') == 'true') return;\n\n // Carrinho aberto\n if (document.querySelector('.mm-ocd.mm-ocd--left.mm-ocd--open')) {\n MenuMobile.handleArrows(mmenuEl, mutations, observer);\n }\n });\n\n observer.observe(mmenuEl, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['class'],\n });\n },\n\n init: function () {\n const _this = this;\n\n _this.setMenuMobile();\n _this.watchMmenu();\n },\n};\n\nMenuMobile.init();\n"],"names":["MmToggler","mediaquery","_this","this","listener","evnt","matches","matchFns","unmatchFns","forEach","toggler","window","matchMedia","addListener","prototype","add","match","unmatch","push","r","list","Array","slice","call","$","selector","context","document","querySelectorAll","prefix","MmSlidingPanelsNavigation","node","title","selectedClass","slidingSubmenus","theme","classList","_setSelectedl","_initAnchors","Object","defineProperty","get","enumerable","configurable","openPanel","panel","listitem","parentElement","title_1","dataset","mmSpnTitle","remove","children","child","textContent","open","parent_1","closest","isOpened","parent_2","listitems","length","querySelector","addEventListener","target","handled","clickAnchor","openSubmenu","panels","parent_3","closeSubmenu","stopImmediatePropagation","MmOffCanvasDrawer","position","wrapper","createElement","content","append","backdrop","body","close","passive","MmenuLight","menu","mediaQuery","navigation","options","navigator","_a","_b","_c","_d","offcanvas","drawer","orgLocation_1","createComment","after","MenuMobile","setMenuMobile","mmenuWrapper","mmenu","selected","e","preventDefault","handleArrows","mmenuEl","mutations","observer","mutation","listItem","disconnect","contains","observe","childList","subtree","attributes","attributeFilter","watchMmenu","getElementById","MutationObserver","init"],"sourceRoot":""}