diff --git a/build/bundle.dev.js b/build/bundle.dev.js index 96e54db..52bee49 100644 --- a/build/bundle.dev.js +++ b/build/bundle.dev.js @@ -10190,7 +10190,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Render\": () => (/* binding */ Render),\n/* harmony export */ \"decode\": () => (/* binding */ decode),\n/* harmony export */ \"encode\": () => (/* binding */ encode),\n/* harmony export */ \"greenOrWhite\": () => (/* binding */ greenOrWhite),\n/* harmony export */ \"remove_undefined\": () => (/* binding */ remove_undefined),\n/* harmony export */ \"round4\": () => (/* binding */ round4),\n/* harmony export */ \"unpackGrid\": () => (/* binding */ unpackGrid)\n/* harmony export */ });\n/* harmony import */ var sha1__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! sha1 */ \"./node_modules/.pnpm/sha1@1.1.1/node_modules/sha1/sha1.js\");\n/* harmony import */ var sha1__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sha1__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./state */ \"./state.js\");\n/* harmony import */ var _clipboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clipboard */ \"./clipboard.js\");\n/* harmony import */ var _infovis__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./infovis */ \"./infovis.js\");\n\n\n\n\n\n\n// Round to one decimal place\nconst round1 = function(n) {\n return Math.round(n * 10) / 10;\n};\n\n// Round to four decimal places\nconst round4 = function(n) {\n const N = Math.pow(10, 4);\n return Math.round(n * N) / N;\n};\n\n// Remove keys with undefined values\nconst remove_undefined = function(o) {\n Object.keys(o).forEach(k => {\n o[k] == undefined && delete o[k]\n });\n return o;\n};\n\n// Encode arbitrary string in url\nconst encode = function(txt) {\n return btoa(encodeURIComponent(txt));\n};\n\n// Decode arbitrary string from url\nconst decode = function(txt) {\n try {\n return decodeURIComponent(atob(txt));\n }\n catch (e) {\n return '';\n }\n};\n\n// Remove all children of a DOM node\nconst clearChildren = function(node) {\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n};\n\n// Return object with form values\nconst parseForm = function(elem) {\n const formArray = $(elem).serializeArray();\n return formArray.reduce(function(d, i) {\n d[i.name] = i.value;\n return d;\n }, {});\n};\n\n// Add or remove a class based on a condition\nconst classOrNot = function(selector, condition, cls) {\n if (condition) {\n return $(selector).addClass(cls);\n }\n return $(selector).removeClass(cls);\n};\n\n// Toggle display of none based on condition\nconst displayOrNot = function(selector, condition) {\n classOrNot(selector, !condition, 'd-none');\n};\n\n// Set to green or white based on condition\nconst greenOrWhite = function(selector, condition) {\n classOrNot(selector, condition, 'minerva-green');\n classOrNot(selector, !condition, 'minerva-white');\n};\n\n// Toggle cursor style based on condition\nconst toggleCursor = function(selector, cursor, condition) {\n if (condition) {\n $(selector).css('cursor', cursor);\n }\n else {\n $(selector).css('cursor', 'default');\n }\n};\n\n// encode a polygon as a URL-safe string\nvar toPolygonURL = function(polygon){\n pointString='';\n polygon.forEach(function(d){\n pointString += d.x.toFixed(5) + \",\" + d.y.toFixed(5) + \",\";\n })\n pointString = pointString.slice(0, -1); //removes \",\" at the end\n var result = LZString.compressToEncodedURIComponent(pointString);\n return result;\n}\n\n// decode a URL-safe string as a polygon\nvar fromPolygonURL = function(polygonString){\n var decompressed = LZString.decompressFromEncodedURIComponent(polygonString);\n if (!decompressed){\n return [];\n }\n\n var xArray = [], yArray = [];\n\n //get all values out of the string\n decompressed.split(',').forEach(function(d,i){\n if (i % 2 == 0){ xArray.push(parseFloat(d)); }\n else{ yArray.push(parseFloat(d)); }\n });\n\n //recreate polygon data structure\n var newPolygon = [];\n if (xArray.length == yArray.length) {\n xArray.forEach(function(d, i){\n newPolygon.push({x: d, y: yArray[i]});\n });\n }\n return newPolygon;\n}\n\n// Download a text file\nconst download = function(filename, text) {\n var element = document.createElement('a');\n element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));\n element.setAttribute('download', filename);\n\n element.style.display = 'none';\n document.body.appendChild(element);\n\n element.click();\n\n document.body.removeChild(element);\n};\n\n// Copy string to clipboard\nconst ctrlC = function(str) {\n _clipboard__WEBPACK_IMPORTED_MODULE_2__.Clipboard.copy(str);\n};\n\n// return a list of image objects from a flattened layout\nconst unpackGrid = function(layout, images, key) {\n const image_map = images.reduce(function(o, i) {\n\n i.TileSize = i.TileSize || [1024, 1024];\n i.maxLevel = i.maxLevel || 0;\n\n // Add to dictionary by Name\n o[i.Name] = i;\n\n return o;\n }, {});\n\n return layout[key].map(function(row) {\n return row.map(function(image_name) {\n return this.image_map[image_name];\n }, {image_map: image_map});\n }, {image_map: image_map});\n};\n\n// Create a button to copy hash state yaml to clipboard\nconst newCopyYamlButton = function(THIS) {\n const copy_pre = 'Copy to Clipboard';\n const copy_post = 'Copied';\n $(this).tooltip({\n title: copy_pre\n });\n\n $(this).on('relabel', function(event, message) {\n $(this).attr('data-original-title', message).tooltip('show');\n });\n\n $(this).click(function() {\n $(this).trigger('relabel', [copy_post]);\n ctrlC(THIS.hashstate.bufferYaml);\n setTimeout((function() {\n $(this).trigger('relabel', [copy_pre]);\n }).bind(this), 1000);\n return false;\n });\n};\n\n// Create a button to copy form data to clipboard\nconst newCopyButton = function() {\n const copy_pre = 'Copy to Clipboard';\n const copy_post = 'Copied';\n $(this).tooltip({\n title: copy_pre\n });\n\n $(this).on('relabel', function(event, message) {\n $(this).attr('data-original-title', message).tooltip('show');\n });\n\n $(this).on('click', function() {\n const form = $(this).closest('form');\n const formData = parseForm(form);\n $(this).trigger('relabel', [copy_post]);\n ctrlC(formData.copy_content);\n setTimeout(function() {\n $(this).trigger('relabel', [copy_pre]);\n }, 1000);\n return false;\n });\n};\n\nconst updateColor = (group, color, c) => {\n group.Colors = group.Colors.map((col, i) => {\n return [col, color][+(c === i)];\n });\n return group;\n}\n\nconst addChannel = (group, subgroup) => {\n return {\n ...group,\n Shown: [...group.Shown, true],\n Channels: [...group.Channels, subgroup.Name],\n Colors: [...group.Colors, subgroup.Colors[0]],\n Descriptions: [...group.Descriptions, subgroup.Description]\n };\n}\n\nconst toggleChannelShown = (group, c) => {\n group.Shown = group.Shown.map((show, i) => {\n return [show, !show][+(c === i)];\n });\n return group;\n}\n\n// Render the non-openseadragon UI\nconst Render = function(hashstate, osd) {\n\n this.trackers = hashstate.trackers;\n this.pollycache = hashstate.pollycache;\n this.showdown = new showdown.Converter({tables: true});\n\n this.osd = osd;\n this.hashstate = hashstate;\n};\n\nRender.prototype = {\n\n init: function() {\n\n const isMobile = () => {\n const fixed_el = document.querySelector('.minerva-fixed');\n return (fixed_el?.clientWidth || 0) <= 750;\n }\n\n // Set mobile view\n if (isMobile()) {\n $(\".minerva-legend\").addClass(\"toggled\");\n $(\".minerva-sidebar-menu\").addClass(\"toggled\");\n }\n\n const HS = this.hashstate;\n // Go to true center\n HS.newExhibit();\n\n // Read hash\n window.onpopstate = (function(e) {\n HS.popState(e);\n this.loadPolly(HS.waypoint.Description, HS.speech_bucket);\n this.newView(true);\n }).bind(this);\n\n window.onpopstate();\n if (this.edit) {\n HS.startEditing();\n }\n HS.pushState();\n window.onpopstate();\n\n // Exhibit name\n $('#exhibit-name').text(HS.exhibit.Name);\n // Copy buttons\n $('.minerva-modal_copy_button').each(newCopyButton);\n\n // Define button tooltips\n $('.minerva-zoom-in').tooltip({\n title: 'Zoom in'\n });\n $('.minerva-zoom-out').tooltip({\n title: 'Zoom out'\n });\n $('.minerva-arrow-switch').tooltip({\n title: 'Share Arrow'\n });\n $('.minerva-lasso-switch').tooltip({\n title: 'Share Region'\n });\n $('.minerva-draw-switch').tooltip({\n title: 'Share Box'\n });\n $('.minerva-duplicate-view').tooltip({\n title: 'Clone linked view'\n });\n\n // Toggle legend info\n ((k) => {\n const el = document.getElementsByClassName(k).item(0);\n el.addEventListener('click', () => this.toggleInfo());\n })('minerva-channel-legend-info-icon');\n \n const toggleAdding = () => {\n HS.toggleAdding();\n this.newView(true);\n }\n const openAdding = () => {\n if (HS.infoOpen && !HS.addingOpen) {\n toggleAdding();\n }\n }\n // Toggle channel selection\n ((k) => {\n const el = document.getElementsByClassName(k).item(0);\n el.addEventListener('click', toggleAdding);\n })('minerva-channel-legend-add-panel');\n\n ((k) => {\n var el = HS.el.getElementsByClassName(k).item(0);\n el.addEventListener(\"click\", openAdding);\n })('minerva-channel-legend-adding-info-panel');\n\n ((k) => {\n var el = HS.el.getElementsByClassName(k).item(0);\n el.addEventListener(\"click\", openAdding);\n })('minerva-channel-legend-adding-panel');\n\n\n // Modals to copy shareable link and edit description\n $('#copy_link_modal').on('hidden.bs.modal', HS.cancelDrawing.bind(HS));\n $('.minerva-edit_description_modal').on('hidden.bs.modal', HS.cancelDrawing.bind(HS));\n\n // Button to toggle sidebar\n $('.minerva-toggle-sidebar').click((e) => {\n e.preventDefault();\n $(\".minerva-sidebar-menu\").toggleClass(\"toggled\");\n if (isMobile()) {\n if (HS.infoOpen) this.toggleInfo();\n $(\".minerva-legend\").addClass(\"toggled\");\n }\n });\n\n // Button to toggle legend\n $('.minerva-toggle-legend').click((e) => {\n e.preventDefault();\n $(\".minerva-legend\").toggleClass(\"toggled\");\n const closed = $(\".minerva-legend\").hasClass(\"toggled\");\n if (closed && HS.infoOpen) this.toggleInfo();\n if (isMobile()) {\n $(\".minerva-sidebar-menu\").addClass(\"toggled\");\n }\n });\n\n // Left arrow decreases waypoint by 1\n $('.minerva-leftArrow').click(this, function(e) {\n const HS = e.data.hashstate;\n if (HS.w == 0) {\n HS.s = HS.s - 1;\n HS.w = HS.waypoints.length - 1;\n }\n else {\n HS.w = HS.w - 1;\n }\n HS.pushState();\n window.onpopstate();\n });\n\n // Right arrow increases waypoint by 1\n $('.minerva-rightArrow').click(this, function(e) {\n const HS = e.data.hashstate;\n const last_w = HS.w == (HS.waypoints.length - 1);\n if (last_w) {\n HS.s = HS.s + 1;\n HS.w = 0;\n }\n else {\n HS.w = HS.w + 1;\n }\n HS.pushState();\n window.onpopstate();\n });\n\n // Show table of contents\n $('.minerva-toc-button').click(this, function(e) {\n const HS = e.data.hashstate;\n if (HS.waypoint.Mode != 'outline') {\n HS.s = 0; \n HS.pushState();\n window.onpopstate();\n }\n });\n\n // Clear current editor buffer\n $('.clear-switch').click(this, function(e) {\n const HS = e.data.hashstate;\n HS.bufferWaypoint = undefined;\n HS.startEditing();\n HS.pushState();\n window.onpopstate();\n });\n \n // Toggle arrow drawing mode\n $('.minerva-arrow-switch').click(this, function(e) {\n const HS = e.data.hashstate;\n const THIS = e.data;\n HS.drawType = \"arrow\";\n if (HS.drawing) {\n HS.cancelDrawing(HS);\n }\n else {\n HS.startDrawing(HS);\n }\n HS.pushState();\n THIS.newView(false);\n });\n\n // Toggle lasso drawing mode\n $('.minerva-lasso-switch').click(this, function(e) {\n const HS = e.data.hashstate;\n const THIS = e.data;\n HS.drawType = \"lasso\";\n if (HS.drawing) {\n HS.cancelDrawing(HS);\n }\n else {\n HS.startDrawing(HS);\n }\n HS.pushState();\n THIS.newView(false);\n });\n\n // Toggle box drawing mode\n $('.minerva-draw-switch').click(this, function(e) {\n const HS = e.data.hashstate;\n const THIS = e.data;\n HS.drawType = \"box\";\n if (HS.drawing) {\n HS.cancelDrawing(HS);\n }\n else {\n HS.startDrawing(HS);\n }\n HS.pushState();\n THIS.newView(false);\n });\n\n // Handle Z-slider when in 3D mode\n var z_legend = HS.el.getElementsByClassName('minerva-depth-legend')[0];\n var z_slider = HS.el.getElementsByClassName('minerva-z-slider')[0];\n z_slider.max = HS.cgs.length - 1;\n z_slider.value = HS.g;\n z_slider.min = 0;\n\n // Show z scale bar when in 3D mode\n if (HS.design.is3d && HS.design.z_scale) {\n z_legend.innerText = round1(HS.g / HS.design.z_scale) + ' μm';\n }\n else if (HS.design.is3d){\n z_legend.innerText = HS.group.Name; \n }\n\n // Handle z-slider change when in 3D mode\n const THIS = this;\n z_slider.addEventListener('input', function() {\n HS.g = z_slider.value;\n if (HS.design.z_scale) {\n z_legend.innerText = round1(HS.g / HS.design.z_scale) + ' μm';\n }\n else {\n z_legend.innerText = HS.group.Name; \n }\n THIS.newView(true)\n }, false);\n\n // Handle submission of description for sharable link\n $('.minerva-edit_description_modal form').submit(this, function(e){\n const HS = e.data.hashstate;\n const formData = parseForm(e.target);\n $(this).closest('.modal').modal('hide');\n\n // Get description from form\n HS.d = encode(formData.d);\n $('.minerva-copy_link_modal').modal('show');\n\n const root = HS.location('host') + HS.location('pathname');\n const hash = HS.makeHash(['d', 'g', 'm', 'a', 'v', 'o', 'p']);\n const link = HS.el.getElementsByClassName('minerva-copy_link')[0];\n link.value = root + hash;\n\n return false;\n });\n },\n\n toggleInfo() {\n const HS = this.hashstate;\n HS.toggleInfo();\n if (!HS.infoOpen) {\n HS.addingOpen = false;\n HS.activeChannel = -1;\n }\n this.newView(true);\n },\n\n // Rerender only openseadragon UI or all UI if redraw is true\n newView: function(redraw) {\n\n const HS = this.hashstate;\n this.osd.newView(redraw);\n // Redraw design\n if(redraw) {\n\n // redrawLensUI\n HS.updateLensUI(null);\n\n // Redraw HTML Menus\n this.addChannelLegends();\n\n // Hide group menu if in 3D mode\n if (HS.design.is3d) {\n $('.minerva-channel-label').hide()\n }\n // Add group menu if not in 3D mode\n else {\n this.addGroups();\n }\n // Add segmentation mask menu\n this.addMasks();\n // Add stories navigation menu\n this.newStories();\n\n // Render editor if edit\n if (HS.edit) {\n this.fillWaypointEdit();\n }\n // Render viewer if not edit\n else {\n this.fillWaypointView();\n }\n // back and forward buttons\n $('.step-back').click(this, function(e) {\n const HS = e.data.hashstate;\n HS.w -= 1;\n HS.pushState();\n window.onpopstate();\n });\n $('.step-next').click(this, function(e) {\n const HS = e.data.hashstate;\n HS.w += 1;\n HS.pushState();\n window.onpopstate();\n });\n\n // Waypoint-specific Copy Buttons\n const THIS = this;\n $('.minerva-edit_copy_button').each(function() {\n newCopyYamlButton.call(this, THIS);\n });\n $('.minerva-edit_toggle_arrow').click(this, function(e) {\n const HS = e.data.hashstate;\n const THIS = e.data;\n const arrow_0 = HS.waypoint.Arrows[0];\n const hide_arrow = arrow_0.HideArrow;\n arrow_0.HideArrow = hide_arrow ? false : true;\n THIS.newView(true);\n });\n\n const logo_svg = this.getLogoImage();\n logo_svg.style = \"width: 85px\";\n const logo_link = \"https://minerva.im\";\n const logo_class = \"minerva-logo-anchor\";\n const menu_class = 'minerva-sidebar-menu';\n const side_menu = document.getElementsByClassName(menu_class)[0];\n const logos = side_menu.getElementsByClassName(logo_class);\n [...logos].forEach((d) => {\n side_menu.removeChild(d);\n })\n const logo_root = document.createElement('a');\n const info_div = document.createElement('div');\n logo_root.className = `position-fixed ${logo_class}`;\n logo_root.style.cssText = `\n left: 0.5em;\n bottom: 0.5em;\n display: block;\n color: inherit;\n line-height: 0.9em;\n text-decoration: none;\n padding: 0.4em 0.3em 0.2em;\n background-color: rgba(0,0,0,0.8);\n `;\n logo_root.setAttribute('href', logo_link);\n info_div.innerText = 'Made with';\n logo_root.appendChild(info_div);\n logo_root.appendChild(logo_svg);\n side_menu.appendChild(logo_root);\n }\n\n // In editor mode\n if (HS.edit) {\n const THIS = this;\n\n // Set all mask options\n const mask_picker = HS.el.getElementsByClassName('minerva-mask-picker')[0];\n mask_picker.innerHTML = \"\";\n HS.masks.forEach(function(mask){\n const mask_option = document.createElement(\"option\");\n mask_option.innerText = mask.Name;\n mask_picker.appendChild(mask_option);\n })\n\n // Enale selection of active mask indices\n $(\".minerva-mask-picker\").off(\"changed.bs.select\");\n $(\".minerva-mask-picker\").on(\"changed.bs.select\", function(e, idx, isSelected, oldValues) {\n const newValue = $(this).find('option').eq(idx).text();\n HS.waypoint.Masks = HS.masks.map(mask => mask.Name).filter(function(name) {\n if (isSelected) {\n return oldValues.includes(name) || name == newValue;\n }\n return oldValues.includes(name) && name != newValue;\n });\n const active_names = HS.active_masks.map(mask => mask.Name).filter(function(name) {\n return HS.waypoint.Masks.includes(name)\n })\n HS.waypoint.ActiveMasks = active_names;\n HS.m = active_names.map(name => (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_name)(HS.masks, name));\n THIS.newView(true);\n });\n\n // Set all group options\n const group_picker = HS.el.getElementsByClassName('minerva-group-picker')[0];\n group_picker.innerHTML = \"\";\n HS.cgs.forEach(function(group){\n const group_option = document.createElement(\"option\");\n group_option.innerText = group.Name;\n group_picker.appendChild(group_option);\n })\n\n // Enale selection of active group index\n $(\".minerva-group-picker\").off(\"changed.bs.select\");\n $(\".minerva-group-picker\").on(\"changed.bs.select\", function(e, idx, isSelected, oldValues) {\n const newValue = $(this).find('option').eq(idx).text();\n HS.waypoint.Groups = HS.cgs.map(group => group.Name).filter(function(name) {\n if (isSelected) {\n return oldValues.includes(name) || name == newValue;\n }\n return oldValues.includes(name) && name != newValue;\n });\n const group_names = HS.waypoint.Groups;\n const current_name = HS.cgs[HS.g].Name;\n if (group_names.length > 0 && !group_names.includes(current_name)) {\n HS.g = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_name)(HS.cgs, group_names[0]);\n }\n THIS.newView(true);\n });\n\n }\n\n // Based on control keys\n const edit = HS.edit;\n const noHome = HS.noHome;\n const drawing = HS.drawing;\n const drawType = HS.drawType;\n const prefix = '#' + HS.id + ' ';\n\n // Enable home button if in outline mode, otherwise enable table of contents button\n displayOrNot(prefix+'.minerva-home-button', !noHome && !edit && HS.waypoint.Mode == 'outline');\n displayOrNot(prefix+'.minerva-toc-button', !edit && HS.waypoint.Mode != 'outline');\n // Enable 3D UI if in 3D mode\n displayOrNot(prefix+'.minerva-channel-groups-legend', !HS.design.is3d);\n displayOrNot(prefix+'.minerva-z-slider-legend', HS.design.is3d);\n displayOrNot(prefix+'.minerva-toggle-legend', !HS.design.is3d);\n displayOrNot(prefix+'.minerva-only-3d', HS.design.is3d);\n // Enable edit UI if in edit mode\n displayOrNot(prefix+'.minerva-editControls', edit);\n // Enable standard UI if not in edit mode\n displayOrNot(prefix+'.minerva-waypointControls', !edit && HS.totalCount > 1);\n displayOrNot(prefix+'.minerva-waypointCount', !edit && HS.totalCount > 1);\n displayOrNot(prefix+'.minerva-waypointName', !edit);\n \n // Show crosshair cursor if drawing\n toggleCursor(prefix+'.minerva-openseadragon > div', 'crosshair', drawing);\n // Show correct switch state based on drawing mode\n greenOrWhite(prefix+'.minerva-draw-switch *', drawing && (drawType == \"box\"));\n greenOrWhite(prefix+'.minerva-lasso-switch *', drawing && (drawType == \"lasso\"));\n greenOrWhite(prefix+'.minerva-arrow-switch *', drawing && (drawType == \"arrow\"));\n\n // Special minmial nav if no text\n const minimal_sidebar = !edit && HS.totalCount == 1 && !decode(HS.d);\n classOrNot(prefix+'.minerva-sidebar-menu', minimal_sidebar, 'minimal');\n displayOrNot(prefix+'.minerva-welcome-nav', !minimal_sidebar);\n // Disable sidebar if no content\n if (minimal_sidebar && noHome) {\n classOrNot(prefix+'.minerva-sidebar-menu', true, 'toggled');\n displayOrNot(prefix+'.minerva-toggle-sidebar', false);\n }\n\n // Toggle additional info features\n const { infoOpen, addingOpen } = HS;\n const hasInfo = HS.allowInfoIcon;\n const canAdd = HS.singleChannelInfoOpen;\n ((k) => {\n const bar = \"minerva-settings-bar\";\n const settings = \"minerva-settings-icon\";\n const bar_line = 'border-right: 2px solid grey;';\n const root = HS.el.getElementsByClassName(k)[0];\n const bar_el = root.getElementsByClassName(bar)[0];\n const el = root.getElementsByClassName(settings)[0];\n bar_el.style.cssText = ['',bar_line][+infoOpen];\n el.innerText = ['⚙\\uFE0E','⨂'][+infoOpen];\n })(\"minerva-channel-legend-info-icon\");\n ((k) => {\n const add = \"minerva-add-icon\";\n const root = HS.el.getElementsByClassName(k)[0];\n const el = root.getElementsByClassName(add)[0];\n el.innerText = ['⊕','⨂'][+addingOpen];\n })(\"minerva-channel-legend-add-panel\");\n classOrNot(\".minerva-legend-grid\", !hasInfo, \"disabled\");\n classOrNot(\".minerva-channel-legend-2\", canAdd, 'toggled');\n classOrNot(\".minerva-channel-legend-info\", infoOpen, 'toggled');\n classOrNot(\".minerva-channel-legend-info-icon\", !hasInfo, 'disabled');\n classOrNot(\".minerva-channel-legend-add-panel\", canAdd, 'toggled');\n classOrNot(\".minerva-channel-legend-adding\", addingOpen, \"toggled\");\n classOrNot(\".minerva-channel-legend-adding-info\", addingOpen, \"toggled\");\n classOrNot(\".minerva-channel-legend-adding-info\", !canAdd, \"disabled\");\n classOrNot(\".minerva-channel-legend-adding\", !canAdd, \"disabled\");\n\n // H&E should not display number of cycif markers\n const is_h_e = HS.group.Name == 'H&E';\n displayOrNot(prefix+'.minerva-welcome-markers', !is_h_e);\n },\n\n // Load speech-synthesis from AWS Polly\n loadPolly: function(txt, speech_bucket) {\n const hash = sha1__WEBPACK_IMPORTED_MODULE_0___default()(txt);\n const HS = this.hashstate;\n const prefix = '#' + HS.id + ' ';\n displayOrNot(prefix+'.minerva-audioControls', !!speech_bucket);\n if (!!speech_bucket) {\n const polly_url = 'https://s3.amazonaws.com/'+ speech_bucket +'/speech/' + hash + '.mp3';\n HS.el.getElementsByClassName('minerva-audioSource')[0].src = polly_url;\n HS.el.getElementsByClassName('minerva-audioPlayback')[0].load();\n }\n },\n\n /*\n * User intercation\n */\n // Draw lower bounds of box overlay\n drawLowerBounds: function(position) {\n const HS = this.hashstate;\n const wh = [0, 0];\n const new_xy = [\n position.x, position.y\n ];\n HS.o = new_xy.concat(wh);\n this.newView(false);\n },\n // Compute new bounds in x or y\n computeBounds: function(value, start, len) {\n const center = start + (len / 2);\n const end = start + len;\n // Below center\n if (value < center) {\n return {\n start: value,\n range: end - value,\n };\n }\n // Above center\n return {\n start: start,\n range: value - start,\n };\n },\n // Draw upper bounds of box overlay\n drawUpperBounds: function(position) {\n const HS = this.hashstate;\n const xy = HS.o.slice(0, 2);\n const wh = HS.o.slice(2);\n\n // Set actual bounds\n const x = this.computeBounds(position.x, xy[0], wh[0]);\n const y = this.computeBounds(position.y, xy[1], wh[1]);\n\n const o = [x.start, y.start, x.range, y.range];\n HS.o = o.map(round4);\n this.newView(false);\n },\n\n /*\n * Display manaagement\n */\n\n // Add list of mask layers\n addMasks: function() {\n const HS = this.hashstate;\n $('.minerva-mask-layers').empty();\n if (HS.edit || HS.waypoint.Mode == 'explore') {\n // Show as a multi-column\n $('.minerva-mask-layers').addClass('flex');\n $('.minerva-mask-layers').removeClass('flex-column');\n }\n else {\n // Show as a single column\n $('.minerva-mask-layers').addClass('flex-column');\n $('.minerva-mask-layers').removeClass('flex');\n }\n const mask_names = HS.waypoint.Masks || [];\n const masks = HS.masks.filter(mask => {\n return mask_names.includes(mask.Name);\n });\n if (masks.length || HS.edit) {\n $('.minerva-mask-label').show()\n }\n else {\n $('.minerva-mask-label').hide()\n }\n // Add masks with indices\n masks.forEach(function(mask) {\n const m = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_name)(HS.masks, mask.Name);\n this.addMask(mask, m);\n }, this);\n },\n\n // Add mask with index\n addMask: function(mask, m) {\n const HS = this.hashstate;\n // Create an anchor element with empty href\n var aEl = document.createElement('a');\n aEl = Object.assign(aEl, {\n className: HS.m.includes(m) ? 'nav-link active' : 'nav-link',\n href: 'javascript:;',\n innerText: mask.Name,\n title: mask.Path\n });\n var ariaSelected = HS.m.includes(m) ? true : false;\n aEl.setAttribute('aria-selected', ariaSelected);\n\n // Append mask layer to mask layers\n HS.el.getElementsByClassName('minerva-mask-layers')[0].appendChild(aEl);\n \n // Activate or deactivate Mask Layer\n $(aEl).click(this, function(e) {\n const HS = e.data.hashstate;\n // Set group to default group\n const group = HS.design.default_group;\n const g = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_name)(HS.cgs, group);\n if ( g != -1 ) {\n HS.g = g;\n }\n // Remove mask index from m\n if (HS.m.includes(m)){\n HS.m = HS.m.filter(i => i != m);\n }\n // Add mask index to m\n else {\n HS.m.push(m);\n }\n HS.pushState();\n window.onpopstate();\n });\n },\n\n // Add list of channel groups\n addGroups: function() {\n const HS = this.hashstate;\n $('.minerva-channel-groups').empty();\n $('.minerva-channel-groups-legend').empty();\n const cgs_names = HS.waypoint.Groups || [];\n const cgs = HS.cgs.filter(group => {\n return cgs_names.includes(group.Name);\n });\n if (cgs.length || HS.edit) {\n $('.minerva-channel-label').show()\n }\n else {\n $('.minerva-channel-label').hide()\n }\n const cg_el = HS.el.getElementsByClassName('minerva-channel-groups')[0];\n\n // Add filtered channel groups to waypoint\n cgs.forEach(function(group) {\n const g = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_name)(HS.cgs, group.Name);\n this.addGroup(group, g, cg_el, false);\n }, this);\n\n const cgs_multi = HS.cgs.filter(group => {\n return group.Channels.length > 1;\n });\n const cgs_single = HS.cgs.filter(group => {\n return group.Channels.length == 1;\n });\n const cg_legend = HS.el.getElementsByClassName('minerva-channel-groups-legend')[0];\n if (cgs_multi.length > 0) {\n var h = document.createElement('h6');\n h.innerText = 'Channel Groups:'\n h.className = 'm-1'\n cg_legend.appendChild(h);\n }\n // Add all channel groups to legend\n cgs_multi.forEach(function(group) {\n const g = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_name)(HS.cgs, group.Name);\n this.addGroup(group, g, cg_legend, true);\n }, this);\n if (cgs_single.length > 0) {\n var h = document.createElement('h6');\n h.innerText = 'Channels:'\n h.className = 'm-1'\n cg_legend.appendChild(h);\n }\n cgs_single.forEach(function(group) {\n const g = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_name)(HS.cgs, group.Name);\n this.addGroup(group, g, cg_legend, true);\n }, this);\n },\n // Add a single channel group to an element\n addGroup: function(group, g, el, show_more) {\n const HS = this.hashstate;\n var aEl = document.createElement('a');\n var selected = HS.g === g ? true : false;\n aEl = Object.assign(aEl, {\n className: selected ? 'nav-link active' : 'nav-link',\n style: 'padding-right: 40px; position: relative;',\n href: 'javascript:;',\n innerText: group.Name\n });\n aEl.setAttribute('data-toggle', 'pill');\n\n // Set story and waypoint for this marker\n var s_w = undefined;\n for (var s in HS.stories) {\n for (var w in HS.stories[s].Waypoints) {\n var waypoint = HS.stories[s].Waypoints[w]; \n if (waypoint.Group == group.Name) {\n // Select the first waypoint or the definitive\n if (s_w == undefined || waypoint.DefineGroup) {\n s_w = [s, w];\n }\n }\n }\n }\n \n var moreEl = document.createElement('a');\n if (selected && show_more && s_w) {\n const opacity = 'opacity: ' + + ';';\n moreEl = Object.assign(moreEl, {\n className : 'text-white',\n style: 'position: absolute; right: 5px;',\n href: 'javascript:;',\n innerText: 'MORE',\n });\n aEl.appendChild(moreEl);\n\n // Update Waypoint\n $(moreEl).click(this, function(e) {\n HS.s = s_w[0];\n HS.w = s_w[1];\n HS.pushState();\n window.onpopstate();\n });\n }\n\n // Append channel group to element\n el.appendChild(aEl);\n \n // Update Channel Group\n $(aEl).click(this, function(e) {\n HS.g = g;\n HS.pushState();\n window.onpopstate();\n });\n\n },\n\n // Add channel legend labels\n addChannelLegends: function() {\n const HS = this.hashstate;\n const { group, activeChannel } = HS;\n var label = '';\n var picked = new RegExp(\"^$\");\n if (activeChannel >= 0) {\n label = group.Channels[activeChannel]; \n const color = group.Colors[activeChannel]; \n if (color) picked = new RegExp(color, \"i\");\n }\n $('.minerva-channel-legend-1').empty();\n $('.minerva-channel-legend-2').empty();\n $('.minerva-channel-legend-3').empty();\n $('.minerva-channel-legend-info').empty();\n $('.minerva-channel-legend-adding').empty();\n $('.minerva-channel-legend-adding-info').empty();\n $('.minerva-channel-legend-color-picker').empty();\n if (activeChannel < 0) {\n $('.minerva-channel-legend-color-picker').removeClass('toggled');\n }\n const legend_lines = HS.channel_legend_lines;\n legend_lines.forEach(this.addChannelLegend, this);\n // Add all channels not present in legend\n const defaults = HS.subpath_defaults;\n const to_hex = (k) => defaults.get(k).Colors[0];\n const missing_names = [...defaults.keys()].filter((key) => {\n return !legend_lines.find(({ name }) => key === name);\n });\n\n // Allow channel choices\n missing_names.forEach(this.addChannelChoice, this);\n\n // Add color selection\n const COLORS = [\n 'FF00FF',\n '8000FF',\n '0000FF',\n '00FFFF',\n '008040',\n '00FF00',\n 'FFFF00',\n 'FF8000',\n 'FF0000',\n 'FFFFFF'\n ];\n\n ((cls) => {\n const picker = HS.el.getElementsByClassName(cls)[0];\n var header = document.createElement('div');\n header.className = \"all-columns\";\n header.innerText = label;\n picker.appendChild(header);\n COLORS.forEach(color => {\n var colorize = document.createElement('div');\n $(colorize).css('background-color', '#'+color);\n colorize.addEventListener(\"click\", () => {\n HS.group = updateColor(group, color, activeChannel);\n this.newView(true);\n });\n if (picked.test(color)) {\n colorize.className = \"glowing\";\n }\n picker.appendChild(colorize);\n });\n var submit = document.createElement('a');\n submit.className = \"nav-link active\";\n submit.innerText = \"Update\";\n picker.appendChild(submit);\n submit.addEventListener(\"click\", () => {\n $(\".\"+cls).removeClass(\"toggled\");\n HS.activeChannel = -1;\n this.newView(true);\n })\n })(\"minerva-channel-legend-color-picker\");\n },\n\n // Add channel legend label\n addChannelLegend: function(legend_line) {\n const HS = this.hashstate;\n const color = legend_line.color;\n const mask_index = legend_line.mask_index;\n const group_index = legend_line.group_index;\n const shown_idx = (() => {\n if (legend_line.rendered) return 2;\n return +legend_line.shown;\n })();\n\n const onClick = () => {\n if (group_index != -1) {\n HS.group = toggleChannelShown(HS.group, group_index);\n }\n if (mask_index != -1) {\n if (shown_idx > 0) {\n HS.m = HS.m.filter(m => m != mask_index);\n }\n else if (!HS.m.includes(mask_index)){\n HS.m = [...HS.m, mask_index];\n }\n }\n HS.pushState();\n window.onpopstate();\n }\n\n var visible = document.createElement('li');\n var colorize = document.createElement('li');\n var label = document.createElement('li');\n label.innerText = legend_line.name;\n colorize.className = \"glowing\";\n\n // Opacities\n label.style.cssText = 'opacity:'+[0.5,1,1][shown_idx];\n visible.style.cssText = 'opacity:'+[0.5,1,0][shown_idx];\n colorize.style.cssText = 'opacity:'+[0.5,1,1][shown_idx];\n $(colorize).css('background-color', '#'+color);\n\n // If features are active\n if (HS.singleChannelInfoOpen) {\n label.addEventListener(\"click\", onClick);\n visible.addEventListener(\"click\", onClick);\n colorize.addEventListener(\"click\", (e) => {\n if (!shown_idx && group_index != -1) {\n HS.group = toggleChannelShown(HS.group, group_index);\n }\n $(\".minerva-channel-legend-color-picker\").addClass(\"toggled\");\n if (group_index != -1) {\n HS.activeChannel = group_index;\n }\n this.newView(true);\n e.stopPropagation();\n });\n const text_hide = 'color: transparent';\n const colorize_ico = document.createElement('i');\n let text_col = ['text-dark', 'text-dark', ''][shown_idx];\n if (group_index === -1) text_col = '';\n colorize_ico.style.cssText = ['', '', text_hide][shown_idx];\n colorize_ico.className = `fa fa-eye-dropper ${text_col}`;\n colorize.appendChild(colorize_ico);\n\n var visible_ico = document.createElement('i');\n visible_ico.className = 'fa fa-eye' + ['-slash', '', ''][shown_idx];\n visible.appendChild(visible_ico);\n }\n else {\n label.addEventListener(\"click\", () => this.toggleInfo());\n colorize.addEventListener(\"click\", () => this.toggleInfo());\n }\n\n // Append channel legend to list\n (() => {\n var c1 = HS.el.getElementsByClassName('minerva-channel-legend-1')[0];\n var c2 = HS.el.getElementsByClassName('minerva-channel-legend-2')[0];\n var c3 = HS.el.getElementsByClassName('minerva-channel-legend-3')[0];\n c1.appendChild(colorize);\n c2.appendChild(visible);\n c3.appendChild(label);\n })();\n\n if (!HS.allowInfoLegend) return;\n\n // Add legend description\n ((k) => {\n const { description } = legend_line;\n var ul = HS.el.getElementsByClassName(k).item(0);\n var li = document.createElement('li');\n const styles = [\n 'opacity:'+[0.5,1,1][shown_idx]\n ].concat((group_index === HS.activeChannel) ? [\n 'border-bottom: '+ '2px solid #' + color\n ] : []);\n const empty = '---';\n li.style.cssText = styles.join('; ');\n li.addEventListener(\"click\", onClick);\n li.innerText = description || empty;\n if (!description) {\n li.style.color = 'transparent';\n }\n ul.appendChild(li);\n })('minerva-channel-legend-info');\n\n },\n\n // Add new single channel possibility\n addChannelChoice: function(name) {\n const HS = this.hashstate;\n const defaults = HS.subpath_defaults;\n const subgroup = defaults.get(name);\n const onClick = () => {\n HS.group = addChannel(HS.group, subgroup);\n HS.pushState();\n window.onpopstate();\n }\n const empty = '---';\n ((k) => {\n var ul = HS.el.getElementsByClassName(k).item(0);\n var li = document.createElement('li');\n li.addEventListener(\"click\", onClick);\n li.innerText = name || empty;\n ul.appendChild(li);\n })('minerva-channel-legend-adding');\n\n ((k) => {\n var ul = HS.el.getElementsByClassName(k).item(0);\n var li = document.createElement('li');\n li.addEventListener(\"click\", onClick);\n li.innerText = subgroup.Description || empty;\n if (!subgroup.Description) {\n li.style.color = 'transparent';\n }\n ul.appendChild(li);\n })('minerva-channel-legend-adding-info');\n },\n\n // Return map of channels to indices\n channelOrders: function(channels) {\n return channels.reduce(function(map, c, i){\n map[c] = i;\n return map;\n }, {});\n },\n\n // Lookup a color by index\n indexColor: function(i, empty) {\n const HS = this.hashstate;\n const colors = HS.colors;\n if (i === undefined) {\n return empty;\n }\n return colors[i % colors.length];\n },\n\n // Render all stories\n newStories: function() {\n\n const HS = this.hashstate;\n const items = HS.el.getElementsByClassName('minerva-story-container')[0];\n // Remove existing stories\n clearChildren(items);\n\n if (HS.waypoint.Mode == 'outline' && HS.totalCount > 1) {\n var toc_label = document.createElement('p');\n toc_label.innerText = 'Table of Contents';\n items.appendChild(toc_label);\n // Add configured stories\n\n var sid_item = document.createElement('div');\n var sid_list = document.createElement('ol');\n HS.stories.forEach(function(story, sid) {\n if (story.Mode != 'explore') {\n this.addStory(story, sid, sid_list);\n }\n }, this);\n sid_item.appendChild(sid_list);\n items.appendChild(sid_item);\n }\n\n const footer = document.createElement('p')\n const md = HS.design.footer;\n footer.innerHTML = this.showdown.makeHtml(md);\n items.appendChild(footer);\n },\n\n // Generate svg logo element\n getLogoImage: function() {\n\t\tconst parser = new DOMParser();\n\t\tconst styleStr = '';\n const wordStr = '';\n const iconStr = '';\n const svgStart = '';\n const xmlV1 = '';\n const wrapSVG = (a) => {\n return xmlV1 + svgStart + a.join('') + '';\n }\n const fullStr = wrapSVG([styleStr, wordStr, iconStr]);\n const doc = parser.parseFromString(fullStr, \"image/svg+xml\");\n return doc.children[0];\n },\n\n // Render one story\n addStory: function(story, sid, sid_list) {\n\n\n // Add configured waypoints\n story.Waypoints.forEach(function(waypoint, wid) {\n this.addWaypoint(waypoint, wid, sid, sid_list);\n }, this);\n\n },\n\n // Render one waypoint\n addWaypoint: function(waypoint, wid, sid, sid_list) {\n\n var wid_item = document.createElement('li');\n var wid_link = document.createElement('a');\n wid_link = Object.assign(wid_link, {\n className: '',\n href: 'javascript:;',\n innerText: waypoint.Name\n });\n\n // Update Waypoint\n $(wid_link).click(this, function(e) {\n const HS = e.data.hashstate;\n HS.s = sid;\n HS.w = wid;\n HS.pushState();\n window.onpopstate();\n });\n\n wid_item.appendChild(wid_link);\n sid_list.appendChild(wid_item);\n },\n\n // Render contents of waypoing during viewer mode\n fillWaypointView: function() {\n\n const HS = this.hashstate;\n const waypoint = HS.waypoint;\n const wid_waypoint = HS.el.getElementsByClassName('minerva-viewer-waypoint')[0];\n const waypointName = HS.el.getElementsByClassName(\"minerva-waypointName\")[0];\n const waypointCount = HS.el.getElementsByClassName(\"minerva-waypointCount\")[0];\n\n waypointCount.innerText = HS.currentCount + '/' + HS.totalCount;\n\n // Show waypoint name if in outline mode\n if (waypoint.Mode !== 'outline') {\n waypointName.innerText = waypoint.Name;\n }\n else {\n waypointName.innerText = '';\n }\n\n const scroll_dist = $('.minerva-waypoint-content').scrollTop();\n $(wid_waypoint).css('height', $(wid_waypoint).height());\n\n // Waypoint description markdown\n var md = waypoint.Description;\n\n // Create links for cell types\n HS.cell_type_links_map.forEach(function(link, type){\n var escaped_type = type.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n var re = RegExp(escaped_type+'s?', 'gi');\n md = md.replace(re, function(m) {\n return '['+m+']('+link+')';\n });\n });\n\n // Create code blocks for protein markers\n HS.marker_links_map.forEach(function(link, marker){\n var escaped_marker = marker.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n var re = RegExp('(^|[^0-9A-Za-z`])\\('+escaped_marker+'\\)([^0-9A-Za-z`]|$)', 'gi');\n md = md.replace(re, function(m, pre, m1, post) {\n return m.replace(m1, '`'+m1+'`', 'gi');\n });\n });\n\n // Create links for protein markers\n HS.marker_links_map.forEach(function(link, marker){\n var escaped_marker = marker.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n var re = RegExp('`'+escaped_marker+'`', 'gi');\n md = md.replace(re, function(m) {\n return '['+m+']('+link+')';\n });\n });\n\n // All categories of possible visualization types\n const allVis = ['VisMatrix', 'VisBarChart', 'VisScatterplot', \"VisCanvasScatterplot\"];\n \n const waypointVis = new Set(allVis.filter(v => waypoint[v]));\n const renderedVis = new Set();\n\n const THIS = this;\n // Scroll to a given scroll distance when waypoint is fully rendered\n const finish_waypoint = function(visType) {\n renderedVis.add(visType);\n if ([...waypointVis].every(v => renderedVis.has(v))) {\n $('.minerva-waypoint-content').scrollTop(scroll_dist);\n $(wid_waypoint).css('height', '');\n THIS.colorMarkerText(wid_waypoint);\n }\n }\n\n // Handle click from plot that selects a mask\n const maskHandler = function(d) {\n var name = d.type;\n var escaped_name = name.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const re = RegExp(escaped_name,'gi');\n const m = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_regex)(HS.masks, re);\n if (m >= 0) {\n HS.m = [m];\n }\n THIS.newView(true);\n }\n\n // Handle click from plot that selects a mask and channel\n const chanAndMaskHandler = function(d) {\n var chan = d.channel\n var mask = d.type\n var escaped_mask = mask.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const re_mask = RegExp(escaped_mask,'gi');\n const m = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_regex)(HS.masks, re_mask);\n if (m >= 0) {\n HS.m = [m];\n }\n \n const c = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_name)(HS.cgs, chan);\n if (c >= 0) {\n HS.g = c;\n }\n else {\n var escaped_chan = chan.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const re_chan = RegExp(escaped_chan,'gi');\n const r_c = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_regex)(HS.cgs, re_chan);\n if (r_c >= 0) {\n HS.g = r_c;\n }\n }\n THIS.newView(true);\n }\n\n // Handle click from plot that selects a cell position\n const arrowHandler = function(d){\n var cellPosition = [parseInt(d['X_position']), parseInt(d['Y_position'])]\n var viewportCoordinates = THIS.osd.viewer.viewport.imageToViewportCoordinates(cellPosition[0], cellPosition[1]);\n //change hashstate vars\n HS.v = [ 10, viewportCoordinates.x, viewportCoordinates.y]\n //render without menu redraw\n THIS.osd.newView(true);\n //delay visible arrow until animation end\n HS.a = [viewportCoordinates.x,viewportCoordinates.y];\n }\n\n\n // Visualization code\n const renderVis = function(visType, el, id) {\n // Select infovis renderer based on renderer given in markdown\n const renderer = {\n 'VisMatrix': _infovis__WEBPACK_IMPORTED_MODULE_3__[\"default\"].renderMatrix,\n 'VisBarChart': _infovis__WEBPACK_IMPORTED_MODULE_3__[\"default\"].renderBarChart,\n 'VisScatterplot': _infovis__WEBPACK_IMPORTED_MODULE_3__[\"default\"].renderScatterplot,\n 'VisCanvasScatterplot': _infovis__WEBPACK_IMPORTED_MODULE_3__[\"default\"].renderCanvasScatterplot\n }[visType]\n // Select click handler based on renderer given in markdown\n const clickHandler = {\n 'VisMatrix': chanAndMaskHandler,\n 'VisBarChart': maskHandler,\n 'VisScatterplot': arrowHandler,\n 'VisCanvasScatterplot': arrowHandler\n }[visType]\n // Run infovis renderer\n const tmp = renderer(el, id, waypoint[visType], {\n 'clickHandler': clickHandler\n });\n // Finish wayoint after renderer runs\n tmp.then(() => finish_waypoint(visType));\n }\n\n // Cache the waypoint visualizations\n var cache = document.createElement('div');\n Array.from(waypointVis).forEach(function(visType) {\n var className = visType + '-' + HS.s + '-' + HS.w;\n var visElems = wid_waypoint.getElementsByClassName(className);\n if (visElems[0]) {\n cache.appendChild(visElems[0]);\n }\n })\n\n // Set the HTML from the Markdown\n wid_waypoint.innerHTML = this.showdown.makeHtml(md);\n\n // Add a static image to the waypoint HTML\n if (waypoint.Image) {\n var img = document.createElement(\"img\");\n img.src = waypoint.Image;\n wid_waypoint.appendChild(img);\n }\n\n // Allow text in between visualizations\n Array.from(waypointVis).forEach(function(visType) {\n const wid_code = Array.from(wid_waypoint.getElementsByTagName('code'));\n const el = wid_code.filter(code => code.innerText == visType)[0];\n const new_div = document.createElement('div');\n new_div.style.cssText = 'width:100%';\n new_div.className = visType + '-' + HS.s + '-' + HS.w;\n new_div.id = visType + '-' + HS.id + '-' + HS.s + '-' + HS.w;\n\n const cache_divs = cache.getElementsByClassName(new_div.className);\n if (cache_divs[0] && el) {\n $(el).replaceWith(cache_divs[0]);\n finish_waypoint(visType)\n }\n else if (el) {\n $(el).replaceWith(new_div);\n renderVis(visType, wid_waypoint, new_div.id);\n }\n else {\n wid_waypoint.appendChild(new_div);\n renderVis(visType, wid_waypoint, new_div.id);\n }\n })\n\n finish_waypoint('');\n\n },\n // Color all the remaining HTML Code elements\n colorMarkerText: function (wid_waypoint) {\n const HS = this.hashstate;\n const channelOrders = this.channelOrders(HS.channel_names);\n const wid_code = wid_waypoint.getElementsByTagName('code');\n for (var i = 0; i < wid_code.length; i ++) {\n var code = wid_code[i];\n var index = channelOrders[code.innerText];\n if (!index) {\n Object.keys(channelOrders).forEach(function (marker) {\n const c_text = code.innerText;\n const code_marker = HS.marker_alias_map.get(c_text) || c_text;\n const key_marker = HS.marker_alias_map.get(marker) || marker;\n var escaped_code_marker = code_marker.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const re = RegExp('^'+escaped_code_marker+'$','gi');\n if (key_marker != undefined && key_marker.match(re)) {\n index = channelOrders[marker];\n }\n });\n }\n var color = this.indexColor(index);\n var border = color? '2px solid #' + color: 'inherit';\n $(code).css('border-bottom', border);\n }\n },\n // Fill the waypoint if in editor mode\n fillWaypointEdit: function() {\n const HS = this.hashstate;\n const wid_waypoint = HS.el.getElementsByClassName('minerva-viewer-waypoint')[0];\n $(wid_waypoint).empty();\n const form_proto = HS.el.getElementsByClassName('minerva-save_edits_form')[0]\n const form = form_proto.cloneNode(true);\n wid_waypoint.appendChild(form);\n\n const arrow_0 = HS.waypoint.Arrows[0];\n if (arrow_0.HideArrow == true) {\n $('.minerva-edit_toggle_arrow').css('opacity', '0.5');\n }\n else {\n $('.minerva-edit_toggle_arrow').css('opacity', '1');\n }\n\n const wid_txt = $(wid_waypoint).find('.minerva-edit_text')[0];\n const wid_txt_name = $(wid_waypoint).find('.minerva-edit_name')[0];\n const wid_txt_arrow = $(wid_waypoint).find('.minerva-edit_arrow_text')[0];\n const wid_describe = decode(HS.d);\n const wid_name = decode(HS.n);\n\n $(wid_txt_arrow).on('input', this, function(e) {\n const HS = e.data.hashstate;\n const THIS = e.data;\n HS.waypoint.Arrows[0].Text = this.value;\n THIS.newView(false);\n });\n wid_txt_arrow.value = HS.waypoint.Arrows[0].Text || '';\n\n $(wid_txt_name).on('input', this, function(e) {\n const HS = e.data.hashstate;\n HS.n = encode(this.value);\n HS.waypoint.Name = this.value;\n });\n wid_txt_name.value = wid_name;\n\n $(wid_txt).on('input', this, function(e) {\n const HS = e.data.hashstate;\n HS.d = encode(this.value);\n HS.waypoint.Description = this.value;\n });\n wid_txt.value = wid_describe;\n }\n};\n\n\n//# sourceURL=webpack://MinervaStory/./render.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Render\": () => (/* binding */ Render),\n/* harmony export */ \"decode\": () => (/* binding */ decode),\n/* harmony export */ \"encode\": () => (/* binding */ encode),\n/* harmony export */ \"greenOrWhite\": () => (/* binding */ greenOrWhite),\n/* harmony export */ \"remove_undefined\": () => (/* binding */ remove_undefined),\n/* harmony export */ \"round4\": () => (/* binding */ round4),\n/* harmony export */ \"unpackGrid\": () => (/* binding */ unpackGrid)\n/* harmony export */ });\n/* harmony import */ var sha1__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! sha1 */ \"./node_modules/.pnpm/sha1@1.1.1/node_modules/sha1/sha1.js\");\n/* harmony import */ var sha1__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sha1__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./state */ \"./state.js\");\n/* harmony import */ var _clipboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clipboard */ \"./clipboard.js\");\n/* harmony import */ var _infovis__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./infovis */ \"./infovis.js\");\n\n\n\n\n\n\n// Round to one decimal place\nconst round1 = function(n) {\n return Math.round(n * 10) / 10;\n};\n\n// Round to four decimal places\nconst round4 = function(n) {\n const N = Math.pow(10, 4);\n return Math.round(n * N) / N;\n};\n\n// Remove keys with undefined values\nconst remove_undefined = function(o) {\n Object.keys(o).forEach(k => {\n o[k] == undefined && delete o[k]\n });\n return o;\n};\n\n// Encode arbitrary string in url\nconst encode = function(txt) {\n return btoa(encodeURIComponent(txt));\n};\n\n// Decode arbitrary string from url\nconst decode = function(txt) {\n try {\n return decodeURIComponent(atob(txt));\n }\n catch (e) {\n return '';\n }\n};\n\n// Remove all children of a DOM node\nconst clearChildren = function(node) {\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n};\n\n// Return object with form values\nconst parseForm = function(elem) {\n const formArray = $(elem).serializeArray();\n return formArray.reduce(function(d, i) {\n d[i.name] = i.value;\n return d;\n }, {});\n};\n\n// Add or remove a class based on a condition\nconst classOrNot = function(selector, condition, cls) {\n if (condition) {\n return $(selector).addClass(cls);\n }\n return $(selector).removeClass(cls);\n};\n\n// Toggle display of none based on condition\nconst displayOrNot = function(selector, condition) {\n classOrNot(selector, !condition, 'd-none');\n};\n\n// Set to green or white based on condition\nconst greenOrWhite = function(selector, condition) {\n classOrNot(selector, condition, 'minerva-green');\n classOrNot(selector, !condition, 'minerva-white');\n};\n\n// Toggle cursor style based on condition\nconst toggleCursor = function(selector, cursor, condition) {\n if (condition) {\n $(selector).css('cursor', cursor);\n }\n else {\n $(selector).css('cursor', 'default');\n }\n};\n\n// encode a polygon as a URL-safe string\nvar toPolygonURL = function(polygon){\n pointString='';\n polygon.forEach(function(d){\n pointString += d.x.toFixed(5) + \",\" + d.y.toFixed(5) + \",\";\n })\n pointString = pointString.slice(0, -1); //removes \",\" at the end\n var result = LZString.compressToEncodedURIComponent(pointString);\n return result;\n}\n\n// decode a URL-safe string as a polygon\nvar fromPolygonURL = function(polygonString){\n var decompressed = LZString.decompressFromEncodedURIComponent(polygonString);\n if (!decompressed){\n return [];\n }\n\n var xArray = [], yArray = [];\n\n //get all values out of the string\n decompressed.split(',').forEach(function(d,i){\n if (i % 2 == 0){ xArray.push(parseFloat(d)); }\n else{ yArray.push(parseFloat(d)); }\n });\n\n //recreate polygon data structure\n var newPolygon = [];\n if (xArray.length == yArray.length) {\n xArray.forEach(function(d, i){\n newPolygon.push({x: d, y: yArray[i]});\n });\n }\n return newPolygon;\n}\n\n// Download a text file\nconst download = function(filename, text) {\n var element = document.createElement('a');\n element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));\n element.setAttribute('download', filename);\n\n element.style.display = 'none';\n document.body.appendChild(element);\n\n element.click();\n\n document.body.removeChild(element);\n};\n\n// Copy string to clipboard\nconst ctrlC = function(str) {\n _clipboard__WEBPACK_IMPORTED_MODULE_2__.Clipboard.copy(str);\n};\n\n// return a list of image objects from a flattened layout\nconst unpackGrid = function(layout, images, key) {\n const image_map = images.reduce(function(o, i) {\n\n i.TileSize = i.TileSize || [1024, 1024];\n i.maxLevel = i.maxLevel || 0;\n\n // Add to dictionary by Name\n o[i.Name] = i;\n\n return o;\n }, {});\n\n return layout[key].map(function(row) {\n return row.map(function(image_name) {\n return this.image_map[image_name];\n }, {image_map: image_map});\n }, {image_map: image_map});\n};\n\n// Create a button to copy hash state yaml to clipboard\nconst newCopyYamlButton = function(THIS) {\n const copy_pre = 'Copy to Clipboard';\n const copy_post = 'Copied';\n $(this).tooltip({\n title: copy_pre\n });\n\n $(this).on('relabel', function(event, message) {\n $(this).attr('data-original-title', message).tooltip('show');\n });\n\n $(this).click(function() {\n $(this).trigger('relabel', [copy_post]);\n ctrlC(THIS.hashstate.bufferYaml);\n setTimeout((function() {\n $(this).trigger('relabel', [copy_pre]);\n }).bind(this), 1000);\n return false;\n });\n};\n\n// Create a button to copy form data to clipboard\nconst newCopyButton = function() {\n const copy_pre = 'Copy to Clipboard';\n const copy_post = 'Copied';\n $(this).tooltip({\n title: copy_pre\n });\n\n $(this).on('relabel', function(event, message) {\n $(this).attr('data-original-title', message).tooltip('show');\n });\n\n $(this).on('click', function() {\n const form = $(this).closest('form');\n const formData = parseForm(form);\n $(this).trigger('relabel', [copy_post]);\n ctrlC(formData.copy_content);\n setTimeout(function() {\n $(this).trigger('relabel', [copy_pre]);\n }, 1000);\n return false;\n });\n};\n\nconst updateColor = (group, color, c) => {\n group.Colors = group.Colors.map((col, i) => {\n return [col, color][+(c === i)];\n });\n return group;\n}\n\nconst addChannel = (group, subgroup) => {\n return {\n ...group,\n Shown: [...group.Shown, true],\n Channels: [...group.Channels, subgroup.Name],\n Colors: [...group.Colors, subgroup.Colors[0]],\n Descriptions: [...group.Descriptions, subgroup.Description]\n };\n}\n\nconst toggleChannelShown = (group, c) => {\n group.Shown = group.Shown.map((show, i) => {\n return [show, !show][+(c === i)];\n });\n return group;\n}\n\n// Render the non-openseadragon UI\nconst Render = function(hashstate, osd) {\n\n this.trackers = hashstate.trackers;\n this.pollycache = hashstate.pollycache;\n this.showdown = new showdown.Converter({tables: true});\n\n this.osd = osd;\n this.hashstate = hashstate;\n};\n\nRender.prototype = {\n\n init: function() {\n\n const isMobile = () => {\n const fixed_el = document.querySelector('.minerva-fixed');\n return (fixed_el?.clientWidth || 0) <= 750;\n }\n\n // Set mobile view\n if (isMobile()) {\n $(\".minerva-legend\").addClass(\"toggled\");\n $(\".minerva-sidebar-menu\").addClass(\"toggled\");\n }\n\n const HS = this.hashstate;\n // Go to true center\n HS.newExhibit();\n\n // Read hash\n window.onpopstate = (function(e) {\n HS.popState(e);\n this.loadPolly(HS.waypoint.Description, HS.speech_bucket);\n this.newView(true);\n }).bind(this);\n\n window.onpopstate();\n if (this.edit) {\n HS.startEditing();\n }\n HS.pushState();\n window.onpopstate();\n\n // Exhibit name\n $('#exhibit-name').text(HS.exhibit.Name);\n // Copy buttons\n $('.minerva-modal_copy_button').each(newCopyButton);\n\n // Define button tooltips\n $('.minerva-zoom-in').tooltip({\n title: 'Zoom in'\n });\n $('.minerva-zoom-out').tooltip({\n title: 'Zoom out'\n });\n $('.minerva-arrow-switch').tooltip({\n title: 'Share Arrow'\n });\n $('.minerva-lasso-switch').tooltip({\n title: 'Share Region'\n });\n $('.minerva-draw-switch').tooltip({\n title: 'Share Box'\n });\n $('.minerva-duplicate-view').tooltip({\n title: 'Clone linked view'\n });\n\n // Toggle legend info\n ((k) => {\n const el = document.getElementsByClassName(k).item(0);\n el.addEventListener('click', () => this.toggleInfo());\n })('minerva-channel-legend-info-icon');\n \n const toggleAdding = () => {\n HS.toggleAdding();\n this.newView(true);\n }\n const openAdding = () => {\n if (HS.infoOpen && !HS.addingOpen) {\n toggleAdding();\n }\n }\n // Toggle channel selection\n ((k) => {\n const el = document.getElementsByClassName(k).item(0);\n el.addEventListener('click', toggleAdding);\n })('minerva-channel-legend-add-panel');\n\n ((k) => {\n var el = HS.el.getElementsByClassName(k).item(0);\n el.addEventListener(\"click\", openAdding);\n })('minerva-channel-legend-adding-info-panel');\n\n ((k) => {\n var el = HS.el.getElementsByClassName(k).item(0);\n el.addEventListener(\"click\", openAdding);\n })('minerva-channel-legend-adding-panel');\n\n\n // Modals to copy shareable link and edit description\n $('#copy_link_modal').on('hidden.bs.modal', HS.cancelDrawing.bind(HS));\n $('.minerva-edit_description_modal').on('hidden.bs.modal', HS.cancelDrawing.bind(HS));\n\n // Button to toggle sidebar\n $('.minerva-toggle-sidebar').click((e) => {\n e.preventDefault();\n $(\".minerva-sidebar-menu\").toggleClass(\"toggled\");\n if (isMobile()) {\n if (HS.infoOpen) this.toggleInfo();\n $(\".minerva-legend\").addClass(\"toggled\");\n }\n });\n\n // Button to toggle legend\n $('.minerva-toggle-legend').click((e) => {\n e.preventDefault();\n $(\".minerva-legend\").toggleClass(\"toggled\");\n const closed = $(\".minerva-legend\").hasClass(\"toggled\");\n if (closed && HS.infoOpen) this.toggleInfo();\n if (isMobile()) {\n $(\".minerva-sidebar-menu\").addClass(\"toggled\");\n }\n });\n\n // Left arrow decreases waypoint by 1\n $('.minerva-leftArrow').click(this, function(e) {\n const HS = e.data.hashstate;\n if (HS.w == 0) {\n HS.s = HS.s - 1;\n HS.w = HS.waypoints.length - 1;\n }\n else {\n HS.w = HS.w - 1;\n }\n HS.pushState();\n window.onpopstate();\n });\n\n // Right arrow increases waypoint by 1\n $('.minerva-rightArrow').click(this, function(e) {\n const HS = e.data.hashstate;\n const last_w = HS.w == (HS.waypoints.length - 1);\n if (last_w) {\n HS.s = HS.s + 1;\n HS.w = 0;\n }\n else {\n HS.w = HS.w + 1;\n }\n HS.pushState();\n window.onpopstate();\n });\n\n // Show table of contents\n $('.minerva-toc-button').click(this, function(e) {\n const HS = e.data.hashstate;\n if (HS.waypoint.Mode != 'outline') {\n HS.s = 0; \n HS.pushState();\n window.onpopstate();\n }\n });\n\n // Clear current editor buffer\n $('.clear-switch').click(this, function(e) {\n const HS = e.data.hashstate;\n HS.bufferWaypoint = undefined;\n HS.startEditing();\n HS.pushState();\n window.onpopstate();\n });\n \n // Toggle arrow drawing mode\n $('.minerva-arrow-switch').click(this, function(e) {\n const HS = e.data.hashstate;\n const THIS = e.data;\n HS.drawType = \"arrow\";\n if (HS.drawing) {\n HS.cancelDrawing(HS);\n }\n else {\n HS.startDrawing(HS);\n }\n HS.pushState();\n THIS.newView(false);\n });\n\n // Toggle lasso drawing mode\n $('.minerva-lasso-switch').click(this, function(e) {\n const HS = e.data.hashstate;\n const THIS = e.data;\n HS.drawType = \"lasso\";\n if (HS.drawing) {\n HS.cancelDrawing(HS);\n }\n else {\n HS.startDrawing(HS);\n }\n HS.pushState();\n THIS.newView(false);\n });\n\n // Toggle box drawing mode\n $('.minerva-draw-switch').click(this, function(e) {\n const HS = e.data.hashstate;\n const THIS = e.data;\n HS.drawType = \"box\";\n if (HS.drawing) {\n HS.cancelDrawing(HS);\n }\n else {\n HS.startDrawing(HS);\n }\n HS.pushState();\n THIS.newView(false);\n });\n\n // Handle Z-slider when in 3D mode\n var z_legend = HS.el.getElementsByClassName('minerva-depth-legend')[0];\n var z_slider = HS.el.getElementsByClassName('minerva-z-slider')[0];\n z_slider.max = HS.cgs.length - 1;\n z_slider.value = HS.g;\n z_slider.min = 0;\n\n // Show z scale bar when in 3D mode\n if (HS.design.is3d && HS.design.z_scale) {\n z_legend.innerText = round1(HS.g / HS.design.z_scale) + ' μm';\n }\n else if (HS.design.is3d){\n z_legend.innerText = HS.group.Name; \n }\n\n // Handle z-slider change when in 3D mode\n const THIS = this;\n z_slider.addEventListener('input', function() {\n HS.g = z_slider.value;\n if (HS.design.z_scale) {\n z_legend.innerText = round1(HS.g / HS.design.z_scale) + ' μm';\n }\n else {\n z_legend.innerText = HS.group.Name; \n }\n THIS.newView(true)\n }, false);\n\n // Handle submission of description for sharable link\n $('.minerva-edit_description_modal form').submit(this, function(e){\n const HS = e.data.hashstate;\n const formData = parseForm(e.target);\n $(this).closest('.modal').modal('hide');\n\n // Get description from form\n HS.d = encode(formData.d);\n $('.minerva-copy_link_modal').modal('show');\n\n const root = HS.location('host') + HS.location('pathname');\n const hash = HS.makeHash(['d', 'g', 'm', 'a', 'v', 'o', 'p']);\n const link = HS.el.getElementsByClassName('minerva-copy_link')[0];\n link.value = root + hash;\n\n return false;\n });\n },\n\n toggleInfo() {\n const HS = this.hashstate;\n HS.toggleInfo();\n if (!HS.infoOpen) {\n HS.addingOpen = false;\n HS.activeChannel = -1;\n }\n this.newView(true);\n },\n\n // Rerender only openseadragon UI or all UI if redraw is true\n newView: function(redraw) {\n\n const HS = this.hashstate;\n this.osd.newView(redraw);\n // Redraw design\n if(redraw) {\n\n // redrawLensUI\n HS.updateLensUI(null);\n\n // Redraw HTML Menus\n this.addChannelLegends();\n\n // Hide group menu if in 3D mode\n if (HS.design.is3d) {\n $('.minerva-channel-label').hide()\n }\n // Add group menu if not in 3D mode\n else {\n this.addGroups();\n }\n // Add segmentation mask menu\n this.addMasks();\n // Add stories navigation menu\n this.newStories();\n\n // Render editor if edit\n if (HS.edit) {\n this.fillWaypointEdit();\n }\n // Render viewer if not edit\n else {\n this.fillWaypointView();\n }\n // back and forward buttons\n $('.step-back').click(this, function(e) {\n const HS = e.data.hashstate;\n HS.w -= 1;\n HS.pushState();\n window.onpopstate();\n });\n $('.step-next').click(this, function(e) {\n const HS = e.data.hashstate;\n HS.w += 1;\n HS.pushState();\n window.onpopstate();\n });\n\n // Waypoint-specific Copy Buttons\n const THIS = this;\n $('.minerva-edit_copy_button').each(function() {\n newCopyYamlButton.call(this, THIS);\n });\n $('.minerva-edit_toggle_arrow').click(this, function(e) {\n const HS = e.data.hashstate;\n const THIS = e.data;\n const arrow_0 = HS.waypoint.Arrows[0];\n const hide_arrow = arrow_0.HideArrow;\n arrow_0.HideArrow = hide_arrow ? false : true;\n THIS.newView(true);\n });\n\n const logo_svg = this.getLogoImage();\n logo_svg.style = \"width: 85px\";\n const logo_link = \"https://minerva.im\";\n const logo_class = \"minerva-logo-anchor\";\n const menu_class = 'minerva-sidebar-menu';\n const side_menu = document.getElementsByClassName(menu_class)[0];\n const logos = side_menu.getElementsByClassName(logo_class);\n [...logos].forEach((d) => {\n side_menu.removeChild(d);\n })\n const logo_root = document.createElement('a');\n const info_div = document.createElement('div');\n logo_root.className = `position-fixed ${logo_class}`;\n logo_root.style.cssText = `\n left: 0.5em;\n bottom: 0.5em;\n display: block;\n color: inherit;\n line-height: 0.9em;\n text-decoration: none;\n padding: 0.4em 0.3em 0.2em;\n background-color: rgba(0,0,0,0.8);\n `;\n logo_root.setAttribute('href', logo_link);\n info_div.innerText = 'Made with';\n logo_root.appendChild(info_div);\n logo_root.appendChild(logo_svg);\n side_menu.appendChild(logo_root);\n }\n\n // In editor mode\n if (HS.edit) {\n const THIS = this;\n\n // Set all mask options\n const mask_picker = HS.el.getElementsByClassName('minerva-mask-picker')[0];\n mask_picker.innerHTML = \"\";\n HS.masks.forEach(function(mask){\n const mask_option = document.createElement(\"option\");\n mask_option.innerText = mask.Name;\n mask_picker.appendChild(mask_option);\n })\n\n // Enale selection of active mask indices\n $(\".minerva-mask-picker\").off(\"changed.bs.select\");\n $(\".minerva-mask-picker\").on(\"changed.bs.select\", function(e, idx, isSelected, oldValues) {\n const newValue = $(this).find('option').eq(idx).text();\n HS.waypoint.Masks = HS.masks.map(mask => mask.Name).filter(function(name) {\n if (isSelected) {\n return oldValues.includes(name) || name == newValue;\n }\n return oldValues.includes(name) && name != newValue;\n });\n const active_names = HS.active_masks.map(mask => mask.Name).filter(function(name) {\n return HS.waypoint.Masks.includes(name)\n })\n HS.waypoint.ActiveMasks = active_names;\n HS.m = active_names.map(name => (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_name)(HS.masks, name));\n THIS.newView(true);\n });\n\n // Set all group options\n const group_picker = HS.el.getElementsByClassName('minerva-group-picker')[0];\n group_picker.innerHTML = \"\";\n HS.cgs.forEach(function(group){\n const group_option = document.createElement(\"option\");\n group_option.innerText = group.Name;\n group_picker.appendChild(group_option);\n })\n\n // Enale selection of active group index\n $(\".minerva-group-picker\").off(\"changed.bs.select\");\n $(\".minerva-group-picker\").on(\"changed.bs.select\", function(e, idx, isSelected, oldValues) {\n const newValue = $(this).find('option').eq(idx).text();\n HS.waypoint.Groups = HS.cgs.map(group => group.Name).filter(function(name) {\n if (isSelected) {\n return oldValues.includes(name) || name == newValue;\n }\n return oldValues.includes(name) && name != newValue;\n });\n const group_names = HS.waypoint.Groups;\n const current_name = HS.cgs[HS.g].Name;\n if (group_names.length > 0 && !group_names.includes(current_name)) {\n HS.g = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_name)(HS.cgs, group_names[0]);\n }\n THIS.newView(true);\n });\n\n }\n\n // Based on control keys\n const edit = HS.edit;\n const noHome = HS.noHome;\n const drawing = HS.drawing;\n const drawType = HS.drawType;\n const prefix = '#' + HS.id + ' ';\n\n // Enable home button if in outline mode, otherwise enable table of contents button\n displayOrNot(prefix+'.minerva-home-button', !noHome && !edit && HS.waypoint.Mode == 'outline');\n displayOrNot(prefix+'.minerva-toc-button', !edit && HS.waypoint.Mode != 'outline');\n // Enable 3D UI if in 3D mode\n displayOrNot(prefix+'.minerva-channel-groups-legend', !HS.design.is3d);\n displayOrNot(prefix+'.minerva-z-slider-legend', HS.design.is3d);\n displayOrNot(prefix+'.minerva-toggle-legend', !HS.design.is3d);\n displayOrNot(prefix+'.minerva-only-3d', HS.design.is3d);\n // Enable edit UI if in edit mode\n displayOrNot(prefix+'.minerva-editControls', edit);\n // Enable standard UI if not in edit mode\n displayOrNot(prefix+'.minerva-waypointControls', !edit && HS.totalCount > 1);\n displayOrNot(prefix+'.minerva-waypointCount', !edit && HS.totalCount > 1);\n displayOrNot(prefix+'.minerva-waypointName', !edit);\n \n // Show crosshair cursor if drawing\n toggleCursor(prefix+'.minerva-openseadragon > div', 'crosshair', drawing);\n // Show correct switch state based on drawing mode\n greenOrWhite(prefix+'.minerva-draw-switch *', drawing && (drawType == \"box\"));\n greenOrWhite(prefix+'.minerva-lasso-switch *', drawing && (drawType == \"lasso\"));\n greenOrWhite(prefix+'.minerva-arrow-switch *', drawing && (drawType == \"arrow\"));\n\n // Special minmial nav if no text\n const minimal_sidebar = !edit && HS.totalCount == 1 && !decode(HS.d);\n classOrNot(prefix+'.minerva-sidebar-menu', minimal_sidebar, 'minimal');\n displayOrNot(prefix+'.minerva-welcome-nav', !minimal_sidebar);\n // Disable sidebar if no content\n if (minimal_sidebar && noHome) {\n classOrNot(prefix+'.minerva-sidebar-menu', true, 'toggled');\n displayOrNot(prefix+'.minerva-toggle-sidebar', false);\n }\n\n // Toggle additional info features\n const { infoOpen, addingOpen } = HS;\n const hasInfo = HS.allowInfoIcon;\n const canAdd = HS.singleChannelInfoOpen;\n ((k) => {\n const bar = \"minerva-settings-bar\";\n const settings = \"minerva-settings-icon\";\n const bar_line = 'border-right: 2px solid grey;';\n const root = HS.el.getElementsByClassName(k)[0];\n const bar_el = root.getElementsByClassName(bar)[0];\n const el = root.getElementsByClassName(settings)[0];\n bar_el.style.cssText = ['',bar_line][+infoOpen];\n el.innerText = ['⚙\\uFE0E','⨂'][+infoOpen];\n })(\"minerva-channel-legend-info-icon\");\n ((k) => {\n const add = \"minerva-add-icon\";\n const root = HS.el.getElementsByClassName(k)[0];\n const el = root.getElementsByClassName(add)[0];\n el.innerText = ['⊕','⨂'][+addingOpen];\n })(\"minerva-channel-legend-add-panel\");\n classOrNot(\".minerva-legend-grid\", !hasInfo, \"disabled\");\n classOrNot(\".minerva-channel-legend-2\", canAdd, 'toggled');\n classOrNot(\".minerva-channel-legend-info\", infoOpen, 'toggled');\n classOrNot(\".minerva-channel-legend-info-icon\", !hasInfo, 'disabled');\n classOrNot(\".minerva-channel-legend-add-panel\", canAdd, 'toggled');\n classOrNot(\".minerva-channel-legend-adding\", addingOpen, \"toggled\");\n classOrNot(\".minerva-channel-legend-adding-info\", addingOpen, \"toggled\");\n classOrNot(\".minerva-channel-legend-adding-info\", !canAdd, \"disabled\");\n classOrNot(\".minerva-channel-legend-adding\", !canAdd, \"disabled\");\n\n // H&E should not display number of cycif markers\n const is_h_e = HS.group.Name == 'H&E';\n displayOrNot(prefix+'.minerva-welcome-markers', !is_h_e);\n },\n\n // Load speech-synthesis from AWS Polly\n loadPolly: function(txt, speech_bucket) {\n const hash = sha1__WEBPACK_IMPORTED_MODULE_0___default()(txt);\n const HS = this.hashstate;\n const prefix = '#' + HS.id + ' ';\n displayOrNot(prefix+'.minerva-audioControls', !!speech_bucket);\n if (!!speech_bucket) {\n const polly_url = 'https://s3.amazonaws.com/'+ speech_bucket +'/speech/' + hash + '.mp3';\n HS.el.getElementsByClassName('minerva-audioSource')[0].src = polly_url;\n HS.el.getElementsByClassName('minerva-audioPlayback')[0].load();\n }\n },\n\n /*\n * User intercation\n */\n // Draw lower bounds of box overlay\n drawLowerBounds: function(position) {\n const HS = this.hashstate;\n const wh = [0, 0];\n const new_xy = [\n position.x, position.y\n ];\n HS.o = new_xy.concat(wh);\n this.newView(false);\n },\n // Compute new bounds in x or y\n computeBounds: function(value, start, len) {\n const center = start + (len / 2);\n const end = start + len;\n // Below center\n if (value < center) {\n return {\n start: value,\n range: end - value,\n };\n }\n // Above center\n return {\n start: start,\n range: value - start,\n };\n },\n // Draw upper bounds of box overlay\n drawUpperBounds: function(position) {\n const HS = this.hashstate;\n const xy = HS.o.slice(0, 2);\n const wh = HS.o.slice(2);\n\n // Set actual bounds\n const x = this.computeBounds(position.x, xy[0], wh[0]);\n const y = this.computeBounds(position.y, xy[1], wh[1]);\n\n const o = [x.start, y.start, x.range, y.range];\n HS.o = o.map(round4);\n this.newView(false);\n },\n\n /*\n * Display manaagement\n */\n\n // Add list of mask layers\n addMasks: function() {\n const HS = this.hashstate;\n $('.minerva-mask-layers').empty();\n if (HS.edit || HS.waypoint.Mode == 'explore') {\n // Show as a multi-column\n $('.minerva-mask-layers').addClass('flex');\n $('.minerva-mask-layers').removeClass('flex-column');\n }\n else {\n // Show as a single column\n $('.minerva-mask-layers').addClass('flex-column');\n $('.minerva-mask-layers').removeClass('flex');\n }\n const mask_names = HS.waypoint.Masks || [];\n const masks = HS.masks.filter(mask => {\n return mask_names.includes(mask.Name);\n });\n if (masks.length || HS.edit) {\n $('.minerva-mask-label').show()\n }\n else {\n $('.minerva-mask-label').hide()\n }\n // Add masks with indices\n masks.forEach(function(mask) {\n const m = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_name)(HS.masks, mask.Name);\n this.addMask(mask, m);\n }, this);\n },\n\n // Add mask with index\n addMask: function(mask, m) {\n const HS = this.hashstate;\n // Create an anchor element with empty href\n var aEl = document.createElement('a');\n aEl = Object.assign(aEl, {\n className: HS.m.includes(m) ? 'nav-link active' : 'nav-link',\n href: 'javascript:;',\n innerText: mask.Name,\n title: mask.Path\n });\n var ariaSelected = HS.m.includes(m) ? true : false;\n aEl.setAttribute('aria-selected', ariaSelected);\n\n // Append mask layer to mask layers\n HS.el.getElementsByClassName('minerva-mask-layers')[0].appendChild(aEl);\n \n // Activate or deactivate Mask Layer\n $(aEl).click(this, function(e) {\n const HS = e.data.hashstate;\n // Set group to default group\n const group = HS.design.default_group;\n const g = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_name)(HS.cgs, group);\n if ( g != -1 ) {\n HS.g = g;\n }\n // Remove mask index from m\n if (HS.m.includes(m)){\n HS.m = HS.m.filter(i => i != m);\n }\n // Add mask index to m\n else {\n HS.m.push(m);\n }\n HS.pushState();\n window.onpopstate();\n });\n },\n\n // Add list of channel groups\n addGroups: function() {\n const HS = this.hashstate;\n $('.minerva-channel-groups').empty();\n $('.minerva-channel-groups-legend').empty();\n const cgs_names = HS.waypoint.Groups || [];\n const cgs = HS.cgs.filter(group => {\n return cgs_names.includes(group.Name);\n });\n if (cgs.length || HS.edit) {\n $('.minerva-channel-label').show()\n }\n else {\n $('.minerva-channel-label').hide()\n }\n const cg_el = HS.el.getElementsByClassName('minerva-channel-groups')[0];\n\n // Add filtered channel groups to waypoint\n cgs.forEach(function(group) {\n const g = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_name)(HS.cgs, group.Name);\n this.addGroup(group, g, cg_el, false);\n }, this);\n\n const cgs_multi = HS.cgs.filter(group => {\n return group.Channels.length > 1;\n });\n const cgs_single = HS.cgs.filter(group => {\n return group.Channels.length == 1;\n });\n const cg_legend = HS.el.getElementsByClassName('minerva-channel-groups-legend')[0];\n if (cgs_multi.length > 0) {\n var h = document.createElement('h6');\n h.innerText = 'Channel Groups:'\n h.className = 'm-1'\n cg_legend.appendChild(h);\n }\n // Add all channel groups to legend\n cgs_multi.forEach(function(group) {\n const g = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_name)(HS.cgs, group.Name);\n this.addGroup(group, g, cg_legend, true);\n }, this);\n if (cgs_single.length > 0) {\n var h = document.createElement('h6');\n h.innerText = 'Channels:'\n h.className = 'm-1'\n cg_legend.appendChild(h);\n }\n cgs_single.forEach(function(group) {\n const g = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_name)(HS.cgs, group.Name);\n this.addGroup(group, g, cg_legend, true);\n }, this);\n },\n // Add a single channel group to an element\n addGroup: function(group, g, el, show_more) {\n const HS = this.hashstate;\n var aEl = document.createElement('a');\n var selected = HS.g === g ? true : false;\n aEl = Object.assign(aEl, {\n className: selected ? 'nav-link active' : 'nav-link',\n style: 'padding-right: 40px; position: relative;',\n href: 'javascript:;',\n innerText: group.Name\n });\n aEl.setAttribute('data-toggle', 'pill');\n\n // Set story and waypoint for this marker\n var s_w = undefined;\n for (var s in HS.stories) {\n for (var w in HS.stories[s].Waypoints) {\n var waypoint = HS.stories[s].Waypoints[w]; \n if (waypoint.Group == group.Name) {\n // Select the first waypoint or the definitive\n if (s_w == undefined || waypoint.DefineGroup) {\n s_w = [s, w];\n }\n }\n }\n }\n \n var moreEl = document.createElement('a');\n if (selected && show_more && s_w) {\n const opacity = 'opacity: ' + + ';';\n moreEl = Object.assign(moreEl, {\n className : 'text-white',\n style: 'position: absolute; right: 5px;',\n href: 'javascript:;',\n innerText: 'MORE',\n });\n aEl.appendChild(moreEl);\n\n // Update Waypoint\n $(moreEl).click(this, function(e) {\n HS.s = s_w[0];\n HS.w = s_w[1];\n HS.pushState();\n window.onpopstate();\n });\n }\n\n // Append channel group to element\n el.appendChild(aEl);\n \n // Update Channel Group\n $(aEl).click(this, function(e) {\n HS.g = g;\n HS.pushState();\n window.onpopstate();\n });\n\n },\n\n // Add channel legend labels\n addChannelLegends: function() {\n const HS = this.hashstate;\n const { group, activeChannel } = HS;\n var label = '';\n var picked = new RegExp(\"^$\");\n if (activeChannel >= 0) {\n label = group.Channels[activeChannel]; \n const color = group.Colors[activeChannel]; \n if (color) picked = new RegExp(color, \"i\");\n }\n $('.minerva-channel-legend-1').empty();\n $('.minerva-channel-legend-2').empty();\n $('.minerva-channel-legend-3').empty();\n $('.minerva-channel-legend-info').empty();\n $('.minerva-channel-legend-adding').empty();\n $('.minerva-channel-legend-adding-info').empty();\n $('.minerva-channel-legend-color-picker').empty();\n if (activeChannel < 0) {\n $('.minerva-channel-legend-color-picker').removeClass('toggled');\n }\n const legend_lines = HS.channel_legend_lines;\n legend_lines.forEach(this.addChannelLegend, this);\n // Add all channels not present in legend\n const defaults = HS.subpath_defaults;\n const to_hex = (k) => defaults.get(k).Colors[0];\n const missing_names = [...defaults.keys()].filter((key) => {\n return !legend_lines.find(({ name }) => key === name);\n });\n\n // Allow channel choices\n missing_names.forEach(this.addChannelChoice, this);\n\n // Add color selection\n const COLORS = [\n 'FF00FF',\n '8000FF',\n '0000FF',\n '00FFFF',\n '008040',\n '00FF00',\n 'FFFF00',\n 'FF8000',\n 'FF0000',\n 'FFFFFF'\n ];\n\n ((cls) => {\n const picker = HS.el.getElementsByClassName(cls)[0];\n var header = document.createElement('div');\n header.className = \"all-columns\";\n header.innerText = label;\n picker.appendChild(header);\n COLORS.forEach(color => {\n var colorize = document.createElement('div');\n $(colorize).css('background-color', '#'+color);\n colorize.addEventListener(\"click\", () => {\n HS.group = updateColor(group, color, activeChannel);\n this.newView(true);\n });\n if (picked.test(color)) {\n colorize.className = \"glowing\";\n }\n picker.appendChild(colorize);\n });\n var submit = document.createElement('a');\n submit.className = \"nav-link active\";\n submit.innerText = \"Update\";\n picker.appendChild(submit);\n submit.addEventListener(\"click\", () => {\n $(\".\"+cls).removeClass(\"toggled\");\n HS.activeChannel = -1;\n this.newView(true);\n })\n })(\"minerva-channel-legend-color-picker\");\n },\n\n // Add channel legend label\n addChannelLegend: function(legend_line) {\n const HS = this.hashstate;\n const color = legend_line.color;\n const mask_index = legend_line.mask_index;\n const group_index = legend_line.group_index;\n const shown_idx = (() => {\n if (legend_line.rendered) return 2;\n return +legend_line.shown;\n })();\n\n const onClick = () => {\n if (group_index != -1) {\n HS.group = toggleChannelShown(HS.group, group_index);\n }\n if (mask_index != -1) {\n if (shown_idx > 0) {\n HS.m = HS.m.filter(m => m != mask_index);\n }\n else if (!HS.m.includes(mask_index)){\n HS.m = [...HS.m, mask_index];\n }\n }\n HS.pushState();\n window.onpopstate();\n }\n\n var visible = document.createElement('li');\n var colorize = document.createElement('li');\n var label = document.createElement('li');\n label.innerText = legend_line.name;\n colorize.className = \"glowing\";\n\n // Opacities\n label.style.cssText = 'opacity:'+[0.5,1,1][shown_idx];\n visible.style.cssText = 'opacity:'+[0.5,1,0][shown_idx];\n colorize.style.cssText = 'opacity:'+[0.5,1,1][shown_idx];\n $(colorize).css('background-color', '#'+color);\n\n // If features are active\n if (HS.singleChannelInfoOpen) {\n label.addEventListener(\"click\", onClick);\n visible.addEventListener(\"click\", onClick);\n colorize.addEventListener(\"click\", (e) => {\n if (!shown_idx && group_index != -1) {\n HS.group = toggleChannelShown(HS.group, group_index);\n }\n $(\".minerva-channel-legend-color-picker\").addClass(\"toggled\");\n if (group_index != -1) {\n HS.activeChannel = group_index;\n }\n this.newView(true);\n e.stopPropagation();\n });\n const text_hide = 'color: transparent';\n const colorize_ico = document.createElement('i');\n let text_col = ['text-dark', 'text-dark', ''][shown_idx];\n if (group_index === -1) text_col = '';\n colorize_ico.style.cssText = ['', '', text_hide][shown_idx];\n if (mask_index != -1) {\n colorize_ico.style.cssText = text_hide;\n }\n colorize_ico.className = `fa fa-eye-dropper ${text_col}`;\n colorize.appendChild(colorize_ico);\n\n var visible_ico = document.createElement('i');\n visible_ico.className = 'fa fa-eye' + ['-slash', '', ''][shown_idx];\n visible.appendChild(visible_ico);\n }\n else {\n label.addEventListener(\"click\", () => this.toggleInfo());\n colorize.addEventListener(\"click\", () => this.toggleInfo());\n }\n\n // Append channel legend to list\n (() => {\n var c1 = HS.el.getElementsByClassName('minerva-channel-legend-1')[0];\n var c2 = HS.el.getElementsByClassName('minerva-channel-legend-2')[0];\n var c3 = HS.el.getElementsByClassName('minerva-channel-legend-3')[0];\n c1.appendChild(colorize);\n c2.appendChild(visible);\n c3.appendChild(label);\n })();\n\n if (!HS.allowInfoLegend) return;\n\n // Add legend description\n ((k) => {\n const { description } = legend_line;\n var ul = HS.el.getElementsByClassName(k).item(0);\n var li = document.createElement('li');\n const styles = [\n 'opacity:'+[0.5,1,1][shown_idx]\n ].concat((group_index === HS.activeChannel) ? [\n 'border-bottom: '+ '2px solid #' + color\n ] : []);\n const empty = '---';\n li.style.cssText = styles.join('; ');\n li.addEventListener(\"click\", onClick);\n li.innerText = description || empty;\n if (!description) {\n li.style.color = 'transparent';\n }\n ul.appendChild(li);\n })('minerva-channel-legend-info');\n\n },\n\n // Add new single channel possibility\n addChannelChoice: function(name) {\n const HS = this.hashstate;\n const defaults = HS.subpath_defaults;\n const subgroup = defaults.get(name);\n const onClick = () => {\n HS.group = addChannel(HS.group, subgroup);\n HS.pushState();\n window.onpopstate();\n }\n const empty = '---';\n ((k) => {\n var ul = HS.el.getElementsByClassName(k).item(0);\n var li = document.createElement('li');\n li.addEventListener(\"click\", onClick);\n li.innerText = name || empty;\n ul.appendChild(li);\n })('minerva-channel-legend-adding');\n\n ((k) => {\n var ul = HS.el.getElementsByClassName(k).item(0);\n var li = document.createElement('li');\n li.addEventListener(\"click\", onClick);\n li.innerText = subgroup.Description || empty;\n if (!subgroup.Description) {\n li.style.color = 'transparent';\n }\n ul.appendChild(li);\n })('minerva-channel-legend-adding-info');\n },\n\n // Return map of channels to indices\n channelOrders: function(channels) {\n return channels.reduce(function(map, c, i){\n map[c] = i;\n return map;\n }, {});\n },\n\n // Lookup a color by index\n indexColor: function(i, empty) {\n const HS = this.hashstate;\n const colors = HS.colors;\n if (i === undefined) {\n return empty;\n }\n return colors[i % colors.length];\n },\n\n // Render all stories\n newStories: function() {\n\n const HS = this.hashstate;\n const items = HS.el.getElementsByClassName('minerva-story-container')[0];\n // Remove existing stories\n clearChildren(items);\n\n if (HS.waypoint.Mode == 'outline' && HS.totalCount > 1) {\n var toc_label = document.createElement('p');\n toc_label.innerText = 'Table of Contents';\n items.appendChild(toc_label);\n // Add configured stories\n\n var sid_item = document.createElement('div');\n var sid_list = document.createElement('ol');\n HS.stories.forEach(function(story, sid) {\n if (story.Mode != 'explore') {\n this.addStory(story, sid, sid_list);\n }\n }, this);\n sid_item.appendChild(sid_list);\n items.appendChild(sid_item);\n }\n\n const footer = document.createElement('p')\n const md = HS.design.footer;\n footer.innerHTML = this.showdown.makeHtml(md);\n items.appendChild(footer);\n },\n\n // Generate svg logo element\n getLogoImage: function() {\n\t\tconst parser = new DOMParser();\n\t\tconst styleStr = '';\n const wordStr = '';\n const iconStr = '';\n const svgStart = '';\n const xmlV1 = '';\n const wrapSVG = (a) => {\n return xmlV1 + svgStart + a.join('') + '';\n }\n const fullStr = wrapSVG([styleStr, wordStr, iconStr]);\n const doc = parser.parseFromString(fullStr, \"image/svg+xml\");\n return doc.children[0];\n },\n\n // Render one story\n addStory: function(story, sid, sid_list) {\n\n\n // Add configured waypoints\n story.Waypoints.forEach(function(waypoint, wid) {\n this.addWaypoint(waypoint, wid, sid, sid_list);\n }, this);\n\n },\n\n // Render one waypoint\n addWaypoint: function(waypoint, wid, sid, sid_list) {\n\n var wid_item = document.createElement('li');\n var wid_link = document.createElement('a');\n wid_link = Object.assign(wid_link, {\n className: '',\n href: 'javascript:;',\n innerText: waypoint.Name\n });\n\n // Update Waypoint\n $(wid_link).click(this, function(e) {\n const HS = e.data.hashstate;\n HS.s = sid;\n HS.w = wid;\n HS.pushState();\n window.onpopstate();\n });\n\n wid_item.appendChild(wid_link);\n sid_list.appendChild(wid_item);\n },\n\n // Render contents of waypoing during viewer mode\n fillWaypointView: function() {\n\n const HS = this.hashstate;\n const waypoint = HS.waypoint;\n const wid_waypoint = HS.el.getElementsByClassName('minerva-viewer-waypoint')[0];\n const waypointName = HS.el.getElementsByClassName(\"minerva-waypointName\")[0];\n const waypointCount = HS.el.getElementsByClassName(\"minerva-waypointCount\")[0];\n\n waypointCount.innerText = HS.currentCount + '/' + HS.totalCount;\n\n // Show waypoint name if in outline mode\n if (waypoint.Mode !== 'outline') {\n waypointName.innerText = waypoint.Name;\n }\n else {\n waypointName.innerText = '';\n }\n\n const scroll_dist = $('.minerva-waypoint-content').scrollTop();\n $(wid_waypoint).css('height', $(wid_waypoint).height());\n\n // Waypoint description markdown\n var md = waypoint.Description;\n\n // Create links for cell types\n HS.cell_type_links_map.forEach(function(link, type){\n var escaped_type = type.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n var re = RegExp(escaped_type+'s?', 'gi');\n md = md.replace(re, function(m) {\n return '['+m+']('+link+')';\n });\n });\n\n // Create code blocks for protein markers\n HS.marker_links_map.forEach(function(link, marker){\n var escaped_marker = marker.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n var re = RegExp('(^|[^0-9A-Za-z`])\\('+escaped_marker+'\\)([^0-9A-Za-z`]|$)', 'gi');\n md = md.replace(re, function(m, pre, m1, post) {\n return m.replace(m1, '`'+m1+'`', 'gi');\n });\n });\n\n // Create links for protein markers\n HS.marker_links_map.forEach(function(link, marker){\n var escaped_marker = marker.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n var re = RegExp('`'+escaped_marker+'`', 'gi');\n md = md.replace(re, function(m) {\n return '['+m+']('+link+')';\n });\n });\n\n // All categories of possible visualization types\n const allVis = ['VisMatrix', 'VisBarChart', 'VisScatterplot', \"VisCanvasScatterplot\"];\n \n const waypointVis = new Set(allVis.filter(v => waypoint[v]));\n const renderedVis = new Set();\n\n const THIS = this;\n // Scroll to a given scroll distance when waypoint is fully rendered\n const finish_waypoint = function(visType) {\n renderedVis.add(visType);\n if ([...waypointVis].every(v => renderedVis.has(v))) {\n $('.minerva-waypoint-content').scrollTop(scroll_dist);\n $(wid_waypoint).css('height', '');\n THIS.colorMarkerText(wid_waypoint);\n }\n }\n\n // Handle click from plot that selects a mask\n const maskHandler = function(d) {\n var name = d.type;\n var escaped_name = name.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const re = RegExp(escaped_name,'gi');\n const m = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_regex)(HS.masks, re);\n if (m >= 0) {\n HS.m = [m];\n }\n THIS.newView(true);\n }\n\n // Handle click from plot that selects a mask and channel\n const chanAndMaskHandler = function(d) {\n var chan = d.channel\n var mask = d.type\n var escaped_mask = mask.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const re_mask = RegExp(escaped_mask,'gi');\n const m = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_regex)(HS.masks, re_mask);\n if (m >= 0) {\n HS.m = [m];\n }\n \n const c = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_name)(HS.cgs, chan);\n if (c >= 0) {\n HS.g = c;\n }\n else {\n var escaped_chan = chan.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const re_chan = RegExp(escaped_chan,'gi');\n const r_c = (0,_state__WEBPACK_IMPORTED_MODULE_1__.index_regex)(HS.cgs, re_chan);\n if (r_c >= 0) {\n HS.g = r_c;\n }\n }\n THIS.newView(true);\n }\n\n // Handle click from plot that selects a cell position\n const arrowHandler = function(d){\n var cellPosition = [parseInt(d['X_position']), parseInt(d['Y_position'])]\n var viewportCoordinates = THIS.osd.viewer.viewport.imageToViewportCoordinates(cellPosition[0], cellPosition[1]);\n //change hashstate vars\n HS.v = [ 10, viewportCoordinates.x, viewportCoordinates.y]\n //render without menu redraw\n THIS.osd.newView(true);\n //delay visible arrow until animation end\n HS.a = [viewportCoordinates.x,viewportCoordinates.y];\n }\n\n\n // Visualization code\n const renderVis = function(visType, el, id) {\n // Select infovis renderer based on renderer given in markdown\n const renderer = {\n 'VisMatrix': _infovis__WEBPACK_IMPORTED_MODULE_3__[\"default\"].renderMatrix,\n 'VisBarChart': _infovis__WEBPACK_IMPORTED_MODULE_3__[\"default\"].renderBarChart,\n 'VisScatterplot': _infovis__WEBPACK_IMPORTED_MODULE_3__[\"default\"].renderScatterplot,\n 'VisCanvasScatterplot': _infovis__WEBPACK_IMPORTED_MODULE_3__[\"default\"].renderCanvasScatterplot\n }[visType]\n // Select click handler based on renderer given in markdown\n const clickHandler = {\n 'VisMatrix': chanAndMaskHandler,\n 'VisBarChart': maskHandler,\n 'VisScatterplot': arrowHandler,\n 'VisCanvasScatterplot': arrowHandler\n }[visType]\n // Run infovis renderer\n const tmp = renderer(el, id, waypoint[visType], {\n 'clickHandler': clickHandler\n });\n // Finish wayoint after renderer runs\n tmp.then(() => finish_waypoint(visType));\n }\n\n // Cache the waypoint visualizations\n var cache = document.createElement('div');\n Array.from(waypointVis).forEach(function(visType) {\n var className = visType + '-' + HS.s + '-' + HS.w;\n var visElems = wid_waypoint.getElementsByClassName(className);\n if (visElems[0]) {\n cache.appendChild(visElems[0]);\n }\n })\n\n // Set the HTML from the Markdown\n wid_waypoint.innerHTML = this.showdown.makeHtml(md);\n\n // Add a static image to the waypoint HTML\n if (waypoint.Image) {\n var img = document.createElement(\"img\");\n img.src = waypoint.Image;\n wid_waypoint.appendChild(img);\n }\n\n // Allow text in between visualizations\n Array.from(waypointVis).forEach(function(visType) {\n const wid_code = Array.from(wid_waypoint.getElementsByTagName('code'));\n const el = wid_code.filter(code => code.innerText == visType)[0];\n const new_div = document.createElement('div');\n new_div.style.cssText = 'width:100%';\n new_div.className = visType + '-' + HS.s + '-' + HS.w;\n new_div.id = visType + '-' + HS.id + '-' + HS.s + '-' + HS.w;\n\n const cache_divs = cache.getElementsByClassName(new_div.className);\n if (cache_divs[0] && el) {\n $(el).replaceWith(cache_divs[0]);\n finish_waypoint(visType)\n }\n else if (el) {\n $(el).replaceWith(new_div);\n renderVis(visType, wid_waypoint, new_div.id);\n }\n else {\n wid_waypoint.appendChild(new_div);\n renderVis(visType, wid_waypoint, new_div.id);\n }\n })\n\n finish_waypoint('');\n\n },\n // Color all the remaining HTML Code elements\n colorMarkerText: function (wid_waypoint) {\n const HS = this.hashstate;\n const channelOrders = this.channelOrders(HS.channel_names);\n const wid_code = wid_waypoint.getElementsByTagName('code');\n for (var i = 0; i < wid_code.length; i ++) {\n var code = wid_code[i];\n var index = channelOrders[code.innerText];\n if (!index) {\n Object.keys(channelOrders).forEach(function (marker) {\n const c_text = code.innerText;\n const code_marker = HS.marker_alias_map.get(c_text) || c_text;\n const key_marker = HS.marker_alias_map.get(marker) || marker;\n var escaped_code_marker = code_marker.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const re = RegExp('^'+escaped_code_marker+'$','gi');\n if (key_marker != undefined && key_marker.match(re)) {\n index = channelOrders[marker];\n }\n });\n }\n var color = this.indexColor(index);\n var border = color? '2px solid #' + color: 'inherit';\n $(code).css('border-bottom', border);\n }\n },\n // Fill the waypoint if in editor mode\n fillWaypointEdit: function() {\n const HS = this.hashstate;\n const wid_waypoint = HS.el.getElementsByClassName('minerva-viewer-waypoint')[0];\n $(wid_waypoint).empty();\n const form_proto = HS.el.getElementsByClassName('minerva-save_edits_form')[0]\n const form = form_proto.cloneNode(true);\n wid_waypoint.appendChild(form);\n\n const arrow_0 = HS.waypoint.Arrows[0];\n if (arrow_0.HideArrow == true) {\n $('.minerva-edit_toggle_arrow').css('opacity', '0.5');\n }\n else {\n $('.minerva-edit_toggle_arrow').css('opacity', '1');\n }\n\n const wid_txt = $(wid_waypoint).find('.minerva-edit_text')[0];\n const wid_txt_name = $(wid_waypoint).find('.minerva-edit_name')[0];\n const wid_txt_arrow = $(wid_waypoint).find('.minerva-edit_arrow_text')[0];\n const wid_describe = decode(HS.d);\n const wid_name = decode(HS.n);\n\n $(wid_txt_arrow).on('input', this, function(e) {\n const HS = e.data.hashstate;\n const THIS = e.data;\n HS.waypoint.Arrows[0].Text = this.value;\n THIS.newView(false);\n });\n wid_txt_arrow.value = HS.waypoint.Arrows[0].Text || '';\n\n $(wid_txt_name).on('input', this, function(e) {\n const HS = e.data.hashstate;\n HS.n = encode(this.value);\n HS.waypoint.Name = this.value;\n });\n wid_txt_name.value = wid_name;\n\n $(wid_txt).on('input', this, function(e) {\n const HS = e.data.hashstate;\n HS.d = encode(this.value);\n HS.waypoint.Description = this.value;\n });\n wid_txt.value = wid_describe;\n }\n};\n\n\n//# sourceURL=webpack://MinervaStory/./render.js?"); /***/ }), diff --git a/build/bundle.js b/build/bundle.js index 2b92012..c6958c1 100644 --- a/build/bundle.js +++ b/build/bundle.js @@ -1,2 +1,2 @@ /*! For license information please see bundle.js.LICENSE.txt */ -var MinervaStory;(()=>{var e={415:(e,t)=>{"use strict";t.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,o=l(e),a=o[0],s=o[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),u=0,d=s>0?a-4:a;for(n=0;n>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t),1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=16383,s=0,l=r-i;sl?l:s+a));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,r){for(var i,o,a=[],s=t;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},264:function(e,t,n){var r,i;void 0===this&&void 0!==window&&window,r=[n(427)],i=function(e){!function(e){"use strict";var t=["sanitize","whiteList","sanitizeFn"],n=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,i=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function o(t,o){var a=t.nodeName.toLowerCase();if(-1!==e.inArray(a,o))return-1===e.inArray(a,n)||Boolean(t.nodeValue.match(r)||t.nodeValue.match(i));for(var s=e(o).filter((function(e,t){return t instanceof RegExp})),l=0,c=s.length;l1?arguments[1]:void 0,a=o?Number(o):0;a!=a&&(a=0);var s=Math.min(Math.max(a,0),n);if(i+s>n)return!1;for(var c=-1;++c]+>/g,"")),r&&(l=S(l)),l=l.toUpperCase(),o="contains"===n?l.indexOf(t)>=0:l.startsWith(t)))break}return o}function x(e){return parseInt(e,10)||0}e.fn.triggerNative=function(e){var t,n=this[0];n.dispatchEvent?(y?t=new Event(e,{bubbles:!0}):(t=document.createEvent("Event")).initEvent(e,!0,!1),n.dispatchEvent(t)):n.fireEvent?((t=document.createEventObject()).eventType=e,n.fireEvent("on"+e,t)):this.trigger(e)};var w={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},_=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,k=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]","g");function E(e){return w[e]}function S(e){return(e=e.toString())&&e.replace(_,E).replace(k,"")}var C,D,A,T,O,F=(C={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},D=function(e){return C[e]},A="(?:"+Object.keys(C).join("|")+")",T=RegExp(A),O=RegExp(A,"g"),function(e){return e=null==e?"":""+e,T.test(e)?e.replace(O,D):e}),M={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},P=27,N=13,I=32,R=9,j=38,L=40,z={success:!1,major:"3"};try{z.full=(e.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split("."),z.major=z.full[0],z.success=!0}catch(e){}var B=0,$=".bs.select",H={DISABLED:"disabled",DIVIDER:"divider",SHOW:"open",DROPUP:"dropup",MENU:"dropdown-menu",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left",BUTTONCLASS:"btn-default",POPOVERHEADER:"popover-title",ICONBASE:"glyphicon",TICKICON:"glyphicon-ok"},U={MENU:"."+H.MENU},W={div:document.createElement("div"),span:document.createElement("span"),i:document.createElement("i"),subtext:document.createElement("small"),a:document.createElement("a"),li:document.createElement("li"),whitespace:document.createTextNode(" "),fragment:document.createDocumentFragment()};W.noResults=W.li.cloneNode(!1),W.noResults.className="no-results",W.a.setAttribute("role","option"),W.a.className="dropdown-item",W.subtext.className="text-muted",W.text=W.span.cloneNode(!1),W.text.className="text",W.checkMark=W.span.cloneNode(!1);var q=new RegExp(j+"|"+L),V=new RegExp("^"+R+"$|"+P),G={li:function(e,t,n){var r=W.li.cloneNode(!1);return e&&(1===e.nodeType||11===e.nodeType?r.appendChild(e):r.innerHTML=e),void 0!==t&&""!==t&&(r.className=t),null!=n&&r.classList.add("optgroup-"+n),r},a:function(e,t,n){var r=W.a.cloneNode(!0);return e&&(11===e.nodeType?r.appendChild(e):r.insertAdjacentHTML("beforeend",e)),void 0!==t&&""!==t&&r.classList.add.apply(r.classList,t.split(/\s+/)),n&&r.setAttribute("style",n),r},text:function(e,t){var n,r,i=W.text.cloneNode(!1);if(e.content)i.innerHTML=e.content;else{if(i.textContent=e.text,e.icon){var o=W.whitespace.cloneNode(!1);(r=(!0===t?W.i:W.span).cloneNode(!1)).className=this.options.iconBase+" "+e.icon,W.fragment.appendChild(r),W.fragment.appendChild(o)}e.subtext&&((n=W.subtext.cloneNode(!1)).textContent=e.subtext,i.appendChild(n))}if(!0===t)for(;i.childNodes.length>0;)W.fragment.appendChild(i.childNodes[0]);else W.fragment.appendChild(i);return W.fragment},label:function(e){var t,n,r=W.text.cloneNode(!1);if(r.innerHTML=e.display,e.icon){var i=W.whitespace.cloneNode(!1);(n=W.span.cloneNode(!1)).className=this.options.iconBase+" "+e.icon,W.fragment.appendChild(n),W.fragment.appendChild(i)}return e.subtext&&((t=W.subtext.cloneNode(!1)).textContent=e.subtext,r.appendChild(t)),W.fragment.appendChild(r),W.fragment}};function X(e,t){e.length||(W.noResults.innerHTML=this.options.noneResultsText.replace("{0}",'"'+F(t)+'"'),this.$menuInner[0].firstChild.appendChild(W.noResults))}var Y=function(t,n){var r=this;g.useDefault||(e.valHooks.select.set=g._set,g.useDefault=!0),this.$element=e(t),this.$newElement=null,this.$button=null,this.$menu=null,this.options=n,this.selectpicker={main:{},search:{},current:{},view:{},isSearching:!1,keydown:{keyHistory:"",resetKeyHistory:{start:function(){return setTimeout((function(){r.selectpicker.keydown.keyHistory=""}),800)}}}},this.sizeInfo={},null===this.options.title&&(this.options.title=this.$element.attr("title"));var i=this.options.windowPadding;"number"==typeof i&&(this.options.windowPadding=[i,i,i,i]),this.val=Y.prototype.val,this.render=Y.prototype.render,this.refresh=Y.prototype.refresh,this.setStyle=Y.prototype.setStyle,this.selectAll=Y.prototype.selectAll,this.deselectAll=Y.prototype.deselectAll,this.destroy=Y.prototype.destroy,this.remove=Y.prototype.remove,this.show=Y.prototype.show,this.hide=Y.prototype.hide,this.init()};function J(n){var r,i=arguments,o=n;if([].shift.apply(i),!z.success){try{z.full=(e.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split(".")}catch(e){Y.BootstrapVersion?z.full=Y.BootstrapVersion.split(" ")[0].split("."):(z.full=[z.major,"0","0"],console.warn("There was an issue retrieving Bootstrap's version. Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision. If loading Bootstrap asynchronously, the version may need to be manually specified via $.fn.selectpicker.Constructor.BootstrapVersion.",e))}z.major=z.full[0],z.success=!0}if("4"===z.major){var a=[];Y.DEFAULTS.style===H.BUTTONCLASS&&a.push({name:"style",className:"BUTTONCLASS"}),Y.DEFAULTS.iconBase===H.ICONBASE&&a.push({name:"iconBase",className:"ICONBASE"}),Y.DEFAULTS.tickIcon===H.TICKICON&&a.push({name:"tickIcon",className:"TICKICON"}),H.DIVIDER="dropdown-divider",H.SHOW="show",H.BUTTONCLASS="btn-light",H.POPOVERHEADER="popover-header",H.ICONBASE="",H.TICKICON="bs-ok-default";for(var s=0;s'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,windowPadding:0,virtualScroll:600,display:!1,sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role","tabindex","style",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]}},Y.prototype={constructor:Y,init:function(){var e=this,t=this.$element.attr("id"),n=this.$element[0],r=n.form;B++,this.selectId="bs-select-"+B,n.classList.add("bs-select-hidden"),this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),n.classList.contains("show-tick")&&(this.options.showTick=!0),this.$newElement=this.createDropdown(),this.buildData(),this.$element.after(this.$newElement).prependTo(this.$newElement),r&&null===n.form&&(r.id||(r.id="form-"+this.selectId),n.setAttribute("form",r.id)),this.$button=this.$newElement.children("button"),this.$menu=this.$newElement.children(U.MENU),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),n.classList.remove("bs-select-hidden"),!0===this.options.dropdownAlignRight&&this.$menu[0].classList.add(H.MENURIGHT),void 0!==t&&this.$button.attr("data-id",t),this.checkDisabled(),this.clickListener(),this.options.liveSearch?(this.liveSearchListener(),this.focusedParent=this.$searchbox[0]):this.focusedParent=this.$menuInner[0],this.setStyle(),this.render(),this.setWidth(),this.options.container?this.selectPosition():this.$element.on("hide"+$,(function(){if(e.isVirtual()){var t=e.$menuInner[0],n=t.firstChild.cloneNode(!1);t.replaceChild(n,t.firstChild),t.scrollTop=0}})),this.$menu.data("this",this),this.$newElement.data("this",this),this.options.mobile&&this.mobile(),this.$newElement.on({"hide.bs.dropdown":function(t){e.$element.trigger("hide"+$,t)},"hidden.bs.dropdown":function(t){e.$element.trigger("hidden"+$,t)},"show.bs.dropdown":function(t){e.$element.trigger("show"+$,t)},"shown.bs.dropdown":function(t){e.$element.trigger("shown"+$,t)}}),n.hasAttribute("required")&&this.$element.on("invalid"+$,(function(){e.$button[0].classList.add("bs-invalid"),e.$element.on("shown"+$+".invalid",(function(){e.$element.val(e.$element.val()).off("shown"+$+".invalid")})).on("rendered"+$,(function(){this.validity.valid&&e.$button[0].classList.remove("bs-invalid"),e.$element.off("rendered"+$)})),e.$button.on("blur"+$,(function(){e.$element.trigger("focus").trigger("blur"),e.$button.off("blur"+$)}))})),setTimeout((function(){e.buildList(),e.$element.trigger("loaded"+$)}))},createDropdown:function(){var t=this.multiple||this.options.showTick?" show-tick":"",n=this.multiple?' aria-multiselectable="true"':"",r="",i=this.autofocus?" autofocus":"";z.major<4&&this.$element.parent().hasClass("input-group")&&(r=" input-group-btn");var o,a="",s="",l="",c="";return this.options.header&&(a='
'+this.options.header+"
"),this.options.liveSearch&&(s=''),this.multiple&&this.options.actionsBox&&(l='
"),this.multiple&&this.options.doneButton&&(c='
"),o='",e(o)},setPositionData:function(){this.selectpicker.view.canHighlight=[],this.selectpicker.view.size=0,this.selectpicker.view.firstHighlightIndex=!1;for(var e=0;e=this.options.virtualScroll||!0===this.options.virtualScroll},createView:function(t,n,r){var i,o,s=this,l=0,c=[];if(this.selectpicker.isSearching=t,this.selectpicker.current=t?this.selectpicker.search:this.selectpicker.main,this.setPositionData(),n)if(r)l=this.$menuInner[0].scrollTop;else if(!s.multiple){var u=s.$element[0],d=(u.options[u.selectedIndex]||{}).liIndex;if("number"==typeof d&&!1!==s.options.size){var h=s.selectpicker.main.data[d],f=h&&h.position;f&&(l=f-(s.sizeInfo.menuInnerHeight+s.sizeInfo.liHeight)/2)}}function p(e,n){var r,l,u,d,h,f,p,m,g,v,y=s.selectpicker.current.elements.length,b=[],x=!0,w=s.isVirtual();s.selectpicker.view.scrollTop=e,r=Math.ceil(s.sizeInfo.menuInnerHeight/s.sizeInfo.liHeight*1.5),l=Math.round(y/r)||1;for(var _=0;_y-1?0:s.selectpicker.current.data[y-1].position-s.selectpicker.current.data[s.selectpicker.view.position1-1].position,C.firstChild.style.marginTop=E+"px",C.firstChild.style.marginBottom=S+"px"):(C.firstChild.style.marginTop=0,C.firstChild.style.marginBottom=0),C.firstChild.appendChild(D),!0===w&&s.sizeInfo.hasScrollBar){var I=C.firstChild.offsetWidth;if(n&&Is.sizeInfo.selectWidth)C.firstChild.style.minWidth=s.sizeInfo.menuInnerInnerWidth+"px";else if(I>s.sizeInfo.menuInnerInnerWidth){s.$menu[0].style.minWidth=0;var R=C.firstChild.offsetWidth;R>s.sizeInfo.menuInnerInnerWidth&&(s.sizeInfo.menuInnerInnerWidth=R,C.firstChild.style.minWidth=s.sizeInfo.menuInnerInnerWidth+"px"),s.$menu[0].style.minWidth=""}}}if(s.prevActiveIndex=s.activeIndex,s.options.liveSearch){if(t&&n){var j,L=0;s.selectpicker.view.canHighlight[L]||(L=1+s.selectpicker.view.canHighlight.slice(1).indexOf(!0)),j=s.selectpicker.view.visibleElements[L],s.defocusItem(s.selectpicker.view.currentActive),s.activeIndex=(s.selectpicker.current.data[L]||{}).index,s.focusItem(j)}}else s.$menuInner.trigger("focus")}p(l,!0),this.$menuInner.off("scroll.createView").on("scroll.createView",(function(e,t){s.noScroll||p(this.scrollTop,t),s.noScroll=!1})),e(window).off("resize"+$+"."+this.selectId+".createView").on("resize"+$+"."+this.selectId+".createView",(function(){s.$newElement.hasClass(H.SHOW)&&p(s.$menuInner[0].scrollTop)}))},focusItem:function(e,t,n){if(e){t=t||this.selectpicker.main.data[this.activeIndex];var r=e.firstChild;r&&(r.setAttribute("aria-setsize",this.selectpicker.view.size),r.setAttribute("aria-posinset",t.posinset),!0!==n&&(this.focusedParent.setAttribute("aria-activedescendant",r.id),e.classList.add("active"),r.classList.add("active")))}},defocusItem:function(e){e&&(e.classList.remove("active"),e.firstChild&&e.firstChild.classList.remove("active"))},setPlaceholder:function(){var e=this,t=!1;if(this.options.title&&!this.multiple){this.selectpicker.view.titleOption||(this.selectpicker.view.titleOption=document.createElement("option")),t=!0;var n=this.$element[0],r=!1,i=!this.selectpicker.view.titleOption.parentNode,o=n.selectedIndex,a=n.options[o],s=window.performance&&window.performance.getEntriesByType("navigation"),l=s&&s.length?"back_forward"!==s[0].type:2!==window.performance.navigation.type;i&&(this.selectpicker.view.titleOption.className="bs-title-option",this.selectpicker.view.titleOption.value="",r=!a||0===o&&!1===a.defaultSelected&&void 0===this.$element.data("selected")),(i||0!==this.selectpicker.view.titleOption.index)&&n.insertBefore(this.selectpicker.view.titleOption,n.firstChild),r&&l?n.selectedIndex=0:"complete"!==document.readyState&&window.addEventListener("pageshow",(function(){e.selectpicker.view.displayedValue!==n.value&&e.render()}))}return t},buildData:function(){var e=':not([hidden]):not([data-hidden="true"])',t=[],n=0,r=this.setPlaceholder()?1:0;this.options.hideDisabled&&(e+=":not(:disabled)");var i=this.$element[0].querySelectorAll("select > *"+e);function o(e){var n=t[t.length-1];n&&"divider"===n.type&&(n.optID||e.optID)||((e=e||{}).type="divider",t.push(e))}function a(e,n){if((n=n||{}).divider="true"===e.getAttribute("data-divider"),n.divider)o({optID:n.optID});else{var r=t.length,i=e.style.cssText,a=i?F(i):"",s=(e.className||"")+(n.optgroupClass||"");n.optID&&(s="opt "+s),n.optionClass=s.trim(),n.inlineStyle=a,n.text=e.textContent,n.content=e.getAttribute("data-content"),n.tokens=e.getAttribute("data-tokens"),n.subtext=e.getAttribute("data-subtext"),n.icon=e.getAttribute("data-icon"),e.liIndex=r,n.display=n.content||n.text,n.type="option",n.index=r,n.option=e,n.selected=!!e.selected,n.disabled=n.disabled||!!e.disabled,t.push(n)}}function s(i,s){var l=s[i],c=!(i-1r&&(r=o,e.selectpicker.view.widestOption=n[n.length-1])}!e.options.showTick&&!e.multiple||W.checkMark.parentNode||(W.checkMark.className=this.options.iconBase+" "+e.options.tickIcon+" check-mark",W.a.appendChild(W.checkMark));for(var o=t.length,a=0;a li")},render:function(){var e,t,n=this,r=this.$element[0],i=this.setPlaceholder()&&0===r.selectedIndex,o=p(r,this.options.hideDisabled),s=o.length,l=this.$button[0],c=l.querySelector(".filter-option-inner-inner"),u=document.createTextNode(this.options.multipleSeparator),d=W.fragment.cloneNode(!1),h=!1;if(l.classList.toggle("bs-placeholder",n.multiple?!s:!m(r,o)),n.multiple||1!==o.length||(n.selectpicker.view.displayedValue=m(r,o)),"static"===this.options.selectedTextFormat)d=G.text.call(this,{text:this.options.title},!0);else if((e=this.multiple&&-1!==this.options.selectedTextFormat.indexOf("count")&&s>1)&&(e=(t=this.options.selectedTextFormat.split(">")).length>1&&s>t[1]||1===t.length&&s>=2),!1===e){if(!i){for(var f=0;f0&&d.appendChild(u.cloneNode(!1)),g.title?y.text=g.title:v&&(v.content&&n.options.showContent?(y.content=v.content.toString(),h=!0):(n.options.showIcon&&(y.icon=v.icon),n.options.showSubtext&&!n.multiple&&v.subtext&&(y.subtext=" "+v.subtext),y.text=g.textContent.trim())),d.appendChild(G.text.call(this,y,!0))}s>49&&d.appendChild(document.createTextNode("..."))}}else{var b=':not([hidden]):not([data-hidden="true"]):not([data-divider="true"])';this.options.hideDisabled&&(b+=":not(:disabled)");var x=this.$element[0].querySelectorAll("select > option"+b+", optgroup"+b+" option"+b).length,w="function"==typeof this.options.countSelectedText?this.options.countSelectedText(s,x):this.options.countSelectedText;d=G.text.call(this,{text:w.replace("{0}",s.toString()).replace("{1}",x.toString())},!0)}if(null==this.options.title&&(this.options.title=this.$element.attr("title")),d.childNodes.length||(d=G.text.call(this,{text:void 0!==this.options.title?this.options.title:this.options.noneSelectedText},!0)),l.title=d.textContent.replace(/<[^>]*>?/g,"").trim(),this.options.sanitize&&h&&a([d],n.options.whiteList,n.options.sanitizeFn),c.innerHTML="",c.appendChild(d),z.major<4&&this.$newElement[0].classList.contains("bs3-has-addon")){var _=l.querySelector(".filter-expand"),k=c.cloneNode(!0);k.className="filter-expand",_?l.replaceChild(k,_):l.appendChild(k)}this.$element.trigger("rendered"+$)},setStyle:function(e,t){var n,r=this.$button[0],i=this.$newElement[0],o=this.options.style.trim();this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,"")),z.major<4&&(i.classList.add("bs3"),i.parentNode.classList&&i.parentNode.classList.contains("input-group")&&(i.previousElementSibling||i.nextElementSibling)&&(i.previousElementSibling||i.nextElementSibling).classList.contains("input-group-addon")&&i.classList.add("bs3-has-addon")),n=e?e.trim():o,"add"==t?n&&r.classList.add.apply(r.classList,n.split(" ")):"remove"==t?n&&r.classList.remove.apply(r.classList,n.split(" ")):(o&&r.classList.remove.apply(r.classList,o.split(" ")),n&&r.classList.add.apply(r.classList,n.split(" ")))},liHeight:function(t){if(t||!1!==this.options.size&&!Object.keys(this.sizeInfo).length){var n,r=W.div.cloneNode(!1),i=W.div.cloneNode(!1),o=W.div.cloneNode(!1),a=document.createElement("ul"),s=W.li.cloneNode(!1),l=W.li.cloneNode(!1),c=W.a.cloneNode(!1),u=W.span.cloneNode(!1),d=this.options.header&&this.$menu.find("."+H.POPOVERHEADER).length>0?this.$menu.find("."+H.POPOVERHEADER)[0].cloneNode(!0):null,h=this.options.liveSearch?W.div.cloneNode(!1):null,f=this.options.actionsBox&&this.multiple&&this.$menu.find(".bs-actionsbox").length>0?this.$menu.find(".bs-actionsbox")[0].cloneNode(!0):null,p=this.options.doneButton&&this.multiple&&this.$menu.find(".bs-donebutton").length>0?this.$menu.find(".bs-donebutton")[0].cloneNode(!0):null,m=this.$element.find("option")[0];if(this.sizeInfo.selectWidth=this.$newElement[0].offsetWidth,u.className="text",c.className="dropdown-item "+(m?m.className:""),r.className=this.$menu[0].parentNode.className+" "+H.SHOW,r.style.width=0,"auto"===this.options.width&&(i.style.minWidth=0),i.className=H.MENU+" "+H.SHOW,o.className="inner "+H.SHOW,a.className=H.MENU+" inner "+("4"===z.major?H.SHOW:""),s.className=H.DIVIDER,l.className="dropdown-header",u.appendChild(document.createTextNode("​")),this.selectpicker.current.data.length)for(var g=0;gthis.sizeInfo.menuExtras.vert&&s+this.sizeInfo.menuExtras.vert+50>this.sizeInfo.selectOffsetBot,!0===this.selectpicker.isSearching&&(l=this.selectpicker.dropup),this.$newElement.toggleClass(H.DROPUP,l),this.selectpicker.dropup=l),"auto"===this.options.size)i=this.selectpicker.current.elements.length>3?3*this.sizeInfo.liHeight+this.sizeInfo.menuExtras.vert-2:0,n=this.sizeInfo.selectOffsetBot-this.sizeInfo.menuExtras.vert,r=i+d+h+f+p,a=Math.max(i-g.vert,0),this.$newElement.hasClass(H.DROPUP)&&(n=this.sizeInfo.selectOffsetTop-this.sizeInfo.menuExtras.vert),o=n,t=n-d-h-f-p-g.vert;else if(this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size){for(var y=0;ythis.sizeInfo.menuInnerHeight&&(this.sizeInfo.hasScrollBar=!0,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth+this.sizeInfo.scrollBarWidth),"auto"===this.options.dropdownAlignRight&&this.$menu.toggleClass(H.MENURIGHT,this.sizeInfo.selectOffsetLeft>this.sizeInfo.selectOffsetRight&&this.sizeInfo.selectOffsetRightthis.options.size&&r.off("resize"+$+"."+this.selectId+".setMenuSize scroll"+$+"."+this.selectId+".setMenuSize")}this.createView(!1,!0,t)},setWidth:function(){var e=this;"auto"===this.options.width?requestAnimationFrame((function(){e.$menu.css("min-width","0"),e.$element.on("loaded"+$,(function(){e.liHeight(),e.setMenuSize();var t=e.$newElement.clone().appendTo("body"),n=t.css("width","auto").children("button").outerWidth();t.remove(),e.sizeInfo.selectWidth=Math.max(e.sizeInfo.totalMenuWidth,n),e.$newElement.css("width",e.sizeInfo.selectWidth+"px")}))})):"fit"===this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width","")),this.$newElement.hasClass("fit-width")&&"fit"!==this.options.width&&this.$newElement[0].classList.remove("fit-width")},selectPosition:function(){this.$bsContainer=e('
');var t,n,r,i=this,o=e(this.options.container),a=function(a){var s={},l=i.options.display||!!e.fn.dropdown.Constructor.Default&&e.fn.dropdown.Constructor.Default.display;i.$bsContainer.addClass(a.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(H.DROPUP,a.hasClass(H.DROPUP)),t=a.offset(),o.is("body")?n={top:0,left:0}:((n=o.offset()).top+=parseInt(o.css("borderTopWidth"))-o.scrollTop(),n.left+=parseInt(o.css("borderLeftWidth"))-o.scrollLeft()),r=a.hasClass(H.DROPUP)?0:a[0].offsetHeight,(z.major<4||"static"===l)&&(s.top=t.top-n.top+r,s.left=t.left-n.left),s.width=a[0].offsetWidth,i.$bsContainer.css(s)};this.$button.on("click.bs.dropdown.data-api",(function(){i.isDisabled()||(a(i.$newElement),i.$bsContainer.appendTo(i.options.container).toggleClass(H.SHOW,!i.$button.hasClass(H.SHOW)).append(i.$menu))})),e(window).off("resize"+$+"."+this.selectId+" scroll"+$+"."+this.selectId).on("resize"+$+"."+this.selectId+" scroll"+$+"."+this.selectId,(function(){i.$newElement.hasClass(H.SHOW)&&a(i.$newElement)})),this.$element.on("hide"+$,(function(){i.$menu.data("height",i.$menu.height()),i.$bsContainer.detach()}))},setOptionStatus:function(e){var t=this;if(t.noScroll=!1,t.selectpicker.view.visibleElements&&t.selectpicker.view.visibleElements.length)for(var n=0;n3&&!t.dropdown&&(t.dropdown=t.$button.data("bs.dropdown"),t.dropdown._menu=t.$menu[0])})),this.$button.on("click.bs.dropdown.data-api",(function(){t.$newElement.hasClass(H.SHOW)||t.setSize()})),this.$element.on("shown"+$,(function(){t.$menuInner[0].scrollTop!==t.selectpicker.view.scrollTop&&(t.$menuInner[0].scrollTop=t.selectpicker.view.scrollTop),z.major>3?requestAnimationFrame(i):r()})),this.$menuInner.on("mouseenter","li a",(function(e){var n=this.parentElement,r=t.isVirtual()?t.selectpicker.view.position0:0,i=Array.prototype.indexOf.call(n.parentElement.children,n),o=t.selectpicker.current.data[i+r];t.focusItem(n,o,!0)})),this.$menuInner.on("click","li a",(function(n,r){var i=e(this),o=t.$element[0],a=t.isVirtual()?t.selectpicker.view.position0:0,s=t.selectpicker.current.data[i.parent().index()+a],l=s.index,c=m(o),u=o.selectedIndex,d=o.options[u],h=!0;if(t.multiple&&1!==t.options.maxOptions&&n.stopPropagation(),n.preventDefault(),!t.isDisabled()&&!i.parent().hasClass(H.DISABLED)){var f=s.option,g=e(f),y=f.selected,b=g.parent("optgroup"),x=b.find("option"),w=t.options.maxOptions,_=b.data("maxOptions")||!1;if(l===t.activeIndex&&(r=!0),r||(t.prevActiveIndex=t.activeIndex,t.activeIndex=void 0),t.multiple){if(f.selected=!y,t.setSelected(l,!y),t.focusedParent.focus(),!1!==w||!1!==_){var k=w
');A[2]&&(T=T.replace("{var}",A[2][w>1?0:1]),O=O.replace("{var}",A[2][_>1?0:1])),f.selected=!1,t.$menu.append(F),w&&k&&(F.append(e("
"+T+"
")),h=!1,t.$element.trigger("maxReached"+$)),_&&E&&(F.append(e("
"+O+"
")),h=!1,t.$element.trigger("maxReachedGrp"+$)),setTimeout((function(){t.setSelected(l,!1)}),10),F[0].classList.add("fadeOut"),setTimeout((function(){F.remove()}),1050)}}}else d&&(d.selected=!1),f.selected=!0,t.setSelected(l,!0);!t.multiple||t.multiple&&1===t.options.maxOptions?t.$button.trigger("focus"):t.options.liveSearch&&t.$searchbox.trigger("focus"),h&&(t.multiple||u!==o.selectedIndex)&&(v=[f.index,g.prop("selected"),c],t.$element.triggerNative("change"))}})),this.$menu.on("click","li."+H.DISABLED+" a, ."+H.POPOVERHEADER+", ."+H.POPOVERHEADER+" :not(.close)",(function(n){n.currentTarget==this&&(n.preventDefault(),n.stopPropagation(),t.options.liveSearch&&!e(n.target).hasClass("close")?t.$searchbox.trigger("focus"):t.$button.trigger("focus"))})),this.$menuInner.on("click",".divider, .dropdown-header",(function(e){e.preventDefault(),e.stopPropagation(),t.options.liveSearch?t.$searchbox.trigger("focus"):t.$button.trigger("focus")})),this.$menu.on("click","."+H.POPOVERHEADER+" .close",(function(){t.$button.trigger("click")})),this.$searchbox.on("click",(function(e){e.stopPropagation()})),this.$menu.on("click",".actions-btn",(function(n){t.options.liveSearch?t.$searchbox.trigger("focus"):t.$button.trigger("focus"),n.preventDefault(),n.stopPropagation(),e(this).hasClass("bs-select-all")?t.selectAll():t.deselectAll()})),this.$button.on("focus"+$,(function(e){var n=t.$element[0].getAttribute("tabindex");void 0!==n&&e.originalEvent&&e.originalEvent.isTrusted&&(this.setAttribute("tabindex",n),t.$element[0].setAttribute("tabindex",-1),t.selectpicker.view.tabindex=n)})).on("blur"+$,(function(e){void 0!==t.selectpicker.view.tabindex&&e.originalEvent&&e.originalEvent.isTrusted&&(t.$element[0].setAttribute("tabindex",t.selectpicker.view.tabindex),this.setAttribute("tabindex",-1),t.selectpicker.view.tabindex=void 0)})),this.$element.on("change"+$,(function(){t.render(),t.$element.trigger("changed"+$,v),v=null})).on("focus"+$,(function(){t.options.mobile||t.$button[0].focus()}))},liveSearchListener:function(){var e=this;this.$button.on("click.bs.dropdown.data-api",(function(){e.$searchbox.val()&&(e.$searchbox.val(""),e.selectpicker.search.previousValue=void 0)})),this.$searchbox.on("click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api",(function(e){e.stopPropagation()})),this.$searchbox.on("input propertychange",(function(){var t=e.$searchbox[0].value;if(e.selectpicker.search.elements=[],e.selectpicker.search.data=[],t){var n=[],r=t.toUpperCase(),i={},o=[],a=e._searchStyle(),s=e.options.liveSearchNormalize;s&&(r=S(r));for(var l=0;l0&&(i[c.headerIndex-1]=!0,o.push(c.headerIndex-1)),i[c.headerIndex]=!0,o.push(c.headerIndex),i[c.lastIndex+1]=!0),i[l]&&"optgroup-label"!==c.type&&o.push(l)}l=0;for(var u=o.length;l=112&&t.which<=123))if(!(r=c.$newElement.hasClass(H.SHOW))&&(f||t.which>=48&&t.which<=57||t.which>=96&&t.which<=105||t.which>=65&&t.which<=90)&&(c.$button.trigger("click.bs.dropdown.data-api"),c.options.liveSearch))c.$searchbox.trigger("focus");else{if(t.which===P&&r&&(t.preventDefault(),c.$button.trigger("click.bs.dropdown.data-api").trigger("focus")),f){if(!u.length)return;-1!==(n=(i=c.selectpicker.main.elements[c.activeIndex])?Array.prototype.indexOf.call(i.parentElement.children,i):-1)&&c.defocusItem(i),t.which===j?(-1!==n&&n--,n+m<0&&(n+=u.length),c.selectpicker.view.canHighlight[n+m]||-1==(n=c.selectpicker.view.canHighlight.slice(0,n+m).lastIndexOf(!0)-m)&&(n=u.length-1)):(t.which===L||h)&&(++n+m>=c.selectpicker.view.canHighlight.length&&(n=c.selectpicker.view.firstHighlightIndex),c.selectpicker.view.canHighlight[n+m]||(n=n+1+c.selectpicker.view.canHighlight.slice(n+m+1).indexOf(!0))),t.preventDefault();var g=m+n;t.which===j?0===m&&n===u.length-1?(c.$menuInner[0].scrollTop=c.$menuInner[0].scrollHeight,g=c.selectpicker.current.elements.length-1):d=(a=(o=c.selectpicker.current.data[g]).position-o.height)p),i=c.selectpicker.current.elements[g],c.activeIndex=c.selectpicker.current.data[g].index,c.focusItem(i),c.selectpicker.view.currentActive=i,d&&(c.$menuInner[0].scrollTop=a),c.options.liveSearch?c.$searchbox.trigger("focus"):s.trigger("focus")}else if(!s.is("input")&&!V.test(t.which)||t.which===I&&c.selectpicker.keydown.keyHistory){var v,y,x=[];t.preventDefault(),c.selectpicker.keydown.keyHistory+=M[t.which],c.selectpicker.keydown.resetKeyHistory.cancel&&clearTimeout(c.selectpicker.keydown.resetKeyHistory.cancel),c.selectpicker.keydown.resetKeyHistory.cancel=c.selectpicker.keydown.resetKeyHistory.start(),y=c.selectpicker.keydown.keyHistory,/^(.)\1+$/.test(y)&&(y=y.charAt(0));for(var w=0;w0?(a=o.position-o.height,d=!0):(a=o.position-c.sizeInfo.menuInnerHeight,d=o.position>p+c.sizeInfo.menuInnerHeight),i=c.selectpicker.main.elements[v],c.activeIndex=x[k],c.focusItem(i),i&&i.firstChild.focus(),d&&(c.$menuInner[0].scrollTop=a),s.trigger("focus")}}r&&(t.which===I&&!c.selectpicker.keydown.keyHistory||t.which===N||t.which===R&&c.options.selectOnTab)&&(t.which!==I&&t.preventDefault(),c.options.liveSearch&&t.which===I||(c.$menuInner.find(".active a").trigger("click",!0),s.trigger("focus"),c.options.liveSearch||(t.preventDefault(),e(document).data("spaceSelect",!0))))}},mobile:function(){this.options.mobile=!0,this.$element[0].classList.add("mobile-device")},refresh:function(){var t=e.extend({},this.options,this.$element.data());this.options=t,this.checkDisabled(),this.buildData(),this.setStyle(),this.render(),this.buildList(),this.setWidth(),this.setSize(!0),this.$element.trigger("refreshed"+$)},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove(),this.$element.remove()},destroy:function(){this.$newElement.before(this.$element).remove(),this.$bsContainer?this.$bsContainer.remove():this.$menu.remove(),this.selectpicker.view.titleOption&&this.selectpicker.view.titleOption.parentNode&&this.selectpicker.view.titleOption.parentNode.removeChild(this.selectpicker.view.titleOption),this.$element.off($).removeData("selectpicker").removeClass("bs-select-hidden selectpicker"),e(window).off($+"."+this.selectId)}};var K=e.fn.selectpicker;function Z(){if(e.fn.dropdown)return(e.fn.dropdown.Constructor._dataApiKeydownHandler||e.fn.dropdown.Constructor.prototype.keydown).apply(this,arguments)}e.fn.selectpicker=J,e.fn.selectpicker.Constructor=Y,e.fn.selectpicker.noConflict=function(){return e.fn.selectpicker=K,this},e(document).off("keydown.bs.dropdown.data-api").on("keydown.bs.dropdown.data-api",':not(.bootstrap-select) > [data-toggle="dropdown"]',Z).on("keydown.bs.dropdown.data-api",":not(.bootstrap-select) > .dropdown-menu",Z).on("keydown"+$,'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',Y.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',(function(e){e.stopPropagation()})),e(window).on("load"+$+".data-api",(function(){e(".selectpicker").each((function(){var t=e(this);J.call(t,t.data())}))}))}(e)}.apply(t,r),void 0===i||(e.exports=i)},643:function(e,t,n){!function(e,t,n){"use strict";function r(e,t){for(var n=0;n=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};u.jQueryDetection(),t.fn.emulateTransitionEnd=c,t.event.special[u.TRANSITION_END]={bindType:l,delegateType:l,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}};var d="alert",h="bs.alert",f="."+h,p=t.fn[d],m={CLOSE:"close"+f,CLOSED:"closed"+f,CLICK_DATA_API:"click"+f+".data-api"},g="alert",v="fade",y="show",b=function(){function e(e){this._element=e}var n=e.prototype;return n.close=function(e){var t=this._element;e&&(t=this._getRootElement(e)),this._triggerCloseEvent(t).isDefaultPrevented()||this._removeElement(t)},n.dispose=function(){t.removeData(this._element,h),this._element=null},n._getRootElement=function(e){var n=u.getSelectorFromElement(e),r=!1;return n&&(r=document.querySelector(n)),r||(r=t(e).closest("."+g)[0]),r},n._triggerCloseEvent=function(e){var n=t.Event(m.CLOSE);return t(e).trigger(n),n},n._removeElement=function(e){var n=this;if(t(e).removeClass(y),t(e).hasClass(v)){var r=u.getTransitionDurationFromElement(e);t(e).one(u.TRANSITION_END,(function(t){return n._destroyElement(e,t)})).emulateTransitionEnd(r)}else this._destroyElement(e)},n._destroyElement=function(e){t(e).detach().trigger(m.CLOSED).remove()},e._jQueryInterface=function(n){return this.each((function(){var r=t(this),i=r.data(h);i||(i=new e(this),r.data(h,i)),"close"===n&&i[n](this)}))},e._handleDismiss=function(e){return function(t){t&&t.preventDefault(),e.close(this)}},i(e,null,[{key:"VERSION",get:function(){return"4.4.1"}}]),e}();t(document).on(m.CLICK_DATA_API,'[data-dismiss="alert"]',b._handleDismiss(new b)),t.fn[d]=b._jQueryInterface,t.fn[d].Constructor=b,t.fn[d].noConflict=function(){return t.fn[d]=p,b._jQueryInterface};var x="button",w="bs.button",_="."+w,k=".data-api",E=t.fn[x],S="active",C="btn",D="focus",A='[data-toggle^="button"]',T='[data-toggle="buttons"]',O='[data-toggle="button"]',F='[data-toggle="buttons"] .btn',M='input:not([type="hidden"])',P=".active",N=".btn",I={CLICK_DATA_API:"click"+_+k,FOCUS_BLUR_DATA_API:"focus"+_+k+" blur"+_+k,LOAD_DATA_API:"load"+_+k},R=function(){function e(e){this._element=e}var n=e.prototype;return n.toggle=function(){var e=!0,n=!0,r=t(this._element).closest(T)[0];if(r){var i=this._element.querySelector(M);if(i){if("radio"===i.type)if(i.checked&&this._element.classList.contains(S))e=!1;else{var o=r.querySelector(P);o&&t(o).removeClass(S)}else"checkbox"===i.type?"LABEL"===this._element.tagName&&i.checked===this._element.classList.contains(S)&&(e=!1):e=!1;e&&(i.checked=!this._element.classList.contains(S),t(i).trigger("change")),i.focus(),n=!1}}this._element.hasAttribute("disabled")||this._element.classList.contains("disabled")||(n&&this._element.setAttribute("aria-pressed",!this._element.classList.contains(S)),e&&t(this._element).toggleClass(S))},n.dispose=function(){t.removeData(this._element,w),this._element=null},e._jQueryInterface=function(n){return this.each((function(){var r=t(this).data(w);r||(r=new e(this),t(this).data(w,r)),"toggle"===n&&r[n]()}))},i(e,null,[{key:"VERSION",get:function(){return"4.4.1"}}]),e}();t(document).on(I.CLICK_DATA_API,A,(function(e){var n=e.target;if(t(n).hasClass(C)||(n=t(n).closest(N)[0]),!n||n.hasAttribute("disabled")||n.classList.contains("disabled"))e.preventDefault();else{var r=n.querySelector(M);if(r&&(r.hasAttribute("disabled")||r.classList.contains("disabled")))return void e.preventDefault();R._jQueryInterface.call(t(n),"toggle")}})).on(I.FOCUS_BLUR_DATA_API,A,(function(e){var n=t(e.target).closest(N)[0];t(n).toggleClass(D,/^focus(in)?$/.test(e.type))})),t(window).on(I.LOAD_DATA_API,(function(){for(var e=[].slice.call(document.querySelectorAll(F)),t=0,n=e.length;t0,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var n=e.prototype;return n.next=function(){this._isSliding||this._slide(W)},n.nextWhenVisible=function(){!document.hidden&&t(this._element).is(":visible")&&"hidden"!==t(this._element).css("visibility")&&this.next()},n.prev=function(){this._isSliding||this._slide(q)},n.pause=function(e){e||(this._isPaused=!0),this._element.querySelector(re.NEXT_PREV)&&(u.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},n.cycle=function(e){e||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},n.to=function(e){var n=this;this._activeElement=this._element.querySelector(re.ACTIVE_ITEM);var r=this._getItemIndex(this._activeElement);if(!(e>this._items.length-1||e<0))if(this._isSliding)t(this._element).one(X.SLID,(function(){return n.to(e)}));else{if(r===e)return this.pause(),void this.cycle();var i=e>r?W:q;this._slide(i,this._items[e])}},n.dispose=function(){t(this._element).off(z),t.removeData(this._element,L),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},n._getConfig=function(e){return e=s({},H,{},e),u.typeCheckConfig(j,e,U),e},n._handleSwipe=function(){var e=Math.abs(this.touchDeltaX);if(!(e<=40)){var t=e/this.touchDeltaX;this.touchDeltaX=0,t>0&&this.prev(),t<0&&this.next()}},n._addEventListeners=function(){var e=this;this._config.keyboard&&t(this._element).on(X.KEYDOWN,(function(t){return e._keydown(t)})),"hover"===this._config.pause&&t(this._element).on(X.MOUSEENTER,(function(t){return e.pause(t)})).on(X.MOUSELEAVE,(function(t){return e.cycle(t)})),this._config.touch&&this._addTouchEventListeners()},n._addTouchEventListeners=function(){var e=this;if(this._touchSupported){var n=function(t){e._pointerEvent&&ie[t.originalEvent.pointerType.toUpperCase()]?e.touchStartX=t.originalEvent.clientX:e._pointerEvent||(e.touchStartX=t.originalEvent.touches[0].clientX)},r=function(t){e._pointerEvent&&ie[t.originalEvent.pointerType.toUpperCase()]&&(e.touchDeltaX=t.originalEvent.clientX-e.touchStartX),e._handleSwipe(),"hover"===e._config.pause&&(e.pause(),e.touchTimeout&&clearTimeout(e.touchTimeout),e.touchTimeout=setTimeout((function(t){return e.cycle(t)}),500+e._config.interval))};t(this._element.querySelectorAll(re.ITEM_IMG)).on(X.DRAG_START,(function(e){return e.preventDefault()})),this._pointerEvent?(t(this._element).on(X.POINTERDOWN,(function(e){return n(e)})),t(this._element).on(X.POINTERUP,(function(e){return r(e)})),this._element.classList.add(ne)):(t(this._element).on(X.TOUCHSTART,(function(e){return n(e)})),t(this._element).on(X.TOUCHMOVE,(function(t){return function(t){t.originalEvent.touches&&t.originalEvent.touches.length>1?e.touchDeltaX=0:e.touchDeltaX=t.originalEvent.touches[0].clientX-e.touchStartX}(t)})),t(this._element).on(X.TOUCHEND,(function(e){return r(e)})))}},n._keydown=function(e){if(!/input|textarea/i.test(e.target.tagName))switch(e.which){case 37:e.preventDefault(),this.prev();break;case 39:e.preventDefault(),this.next()}},n._getItemIndex=function(e){return this._items=e&&e.parentNode?[].slice.call(e.parentNode.querySelectorAll(re.ITEM)):[],this._items.indexOf(e)},n._getItemByDirection=function(e,t){var n=e===W,r=e===q,i=this._getItemIndex(t),o=this._items.length-1;if((r&&0===i||n&&i===o)&&!this._config.wrap)return t;var a=(i+(e===q?-1:1))%this._items.length;return-1===a?this._items[this._items.length-1]:this._items[a]},n._triggerSlideEvent=function(e,n){var r=this._getItemIndex(e),i=this._getItemIndex(this._element.querySelector(re.ACTIVE_ITEM)),o=t.Event(X.SLIDE,{relatedTarget:e,direction:n,from:i,to:r});return t(this._element).trigger(o),o},n._setActiveIndicatorElement=function(e){if(this._indicatorsElement){var n=[].slice.call(this._indicatorsElement.querySelectorAll(re.ACTIVE));t(n).removeClass(J);var r=this._indicatorsElement.children[this._getItemIndex(e)];r&&t(r).addClass(J)}},n._slide=function(e,n){var r,i,o,a=this,s=this._element.querySelector(re.ACTIVE_ITEM),l=this._getItemIndex(s),c=n||s&&this._getItemByDirection(e,s),d=this._getItemIndex(c),h=Boolean(this._interval);if(e===W?(r=Q,i=ee,o=V):(r=Z,i=te,o=G),c&&t(c).hasClass(J))this._isSliding=!1;else if(!this._triggerSlideEvent(c,o).isDefaultPrevented()&&s&&c){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(c);var f=t.Event(X.SLID,{relatedTarget:c,direction:o,from:l,to:d});if(t(this._element).hasClass(K)){t(c).addClass(i),u.reflow(c),t(s).addClass(r),t(c).addClass(r);var p=parseInt(c.getAttribute("data-interval"),10);p?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=p):this._config.interval=this._config.defaultInterval||this._config.interval;var m=u.getTransitionDurationFromElement(s);t(s).one(u.TRANSITION_END,(function(){t(c).removeClass(r+" "+i).addClass(J),t(s).removeClass(J+" "+i+" "+r),a._isSliding=!1,setTimeout((function(){return t(a._element).trigger(f)}),0)})).emulateTransitionEnd(m)}else t(s).removeClass(J),t(c).addClass(J),this._isSliding=!1,t(this._element).trigger(f);h&&this.cycle()}},e._jQueryInterface=function(n){return this.each((function(){var r=t(this).data(L),i=s({},H,{},t(this).data());"object"==typeof n&&(i=s({},i,{},n));var o="string"==typeof n?n:i.slide;if(r||(r=new e(this,i),t(this).data(L,r)),"number"==typeof n)r.to(n);else if("string"==typeof o){if(void 0===r[o])throw new TypeError('No method named "'+o+'"');r[o]()}else i.interval&&i.ride&&(r.pause(),r.cycle())}))},e._dataApiClickHandler=function(n){var r=u.getSelectorFromElement(this);if(r){var i=t(r)[0];if(i&&t(i).hasClass(Y)){var o=s({},t(i).data(),{},t(this).data()),a=this.getAttribute("data-slide-to");a&&(o.interval=!1),e._jQueryInterface.call(t(i),o),a&&t(i).data(L).to(a),n.preventDefault()}}},i(e,null,[{key:"VERSION",get:function(){return"4.4.1"}},{key:"Default",get:function(){return H}}]),e}();t(document).on(X.CLICK_DATA_API,re.DATA_SLIDE,oe._dataApiClickHandler),t(window).on(X.LOAD_DATA_API,(function(){for(var e=[].slice.call(document.querySelectorAll(re.DATA_RIDE)),n=0,r=e.length;n0&&(this._selector=a,this._triggerArray.push(o))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var n=e.prototype;return n.toggle=function(){t(this._element).hasClass(fe)?this.hide():this.show()},n.show=function(){var n,r,i=this;if(!(this._isTransitioning||t(this._element).hasClass(fe)||(this._parent&&0===(n=[].slice.call(this._parent.querySelectorAll(be.ACTIVES)).filter((function(e){return"string"==typeof i._config.parent?e.getAttribute("data-parent")===i._config.parent:e.classList.contains(pe)}))).length&&(n=null),n&&(r=t(n).not(this._selector).data(se))&&r._isTransitioning))){var o=t.Event(he.SHOW);if(t(this._element).trigger(o),!o.isDefaultPrevented()){n&&(e._jQueryInterface.call(t(n).not(this._selector),"hide"),r||t(n).data(se,null));var a=this._getDimension();t(this._element).removeClass(pe).addClass(me),this._element.style[a]=0,this._triggerArray.length&&t(this._triggerArray).removeClass(ge).attr("aria-expanded",!0),this.setTransitioning(!0);var s="scroll"+(a[0].toUpperCase()+a.slice(1)),l=u.getTransitionDurationFromElement(this._element);t(this._element).one(u.TRANSITION_END,(function(){t(i._element).removeClass(me).addClass(pe).addClass(fe),i._element.style[a]="",i.setTransitioning(!1),t(i._element).trigger(he.SHOWN)})).emulateTransitionEnd(l),this._element.style[a]=this._element[s]+"px"}}},n.hide=function(){var e=this;if(!this._isTransitioning&&t(this._element).hasClass(fe)){var n=t.Event(he.HIDE);if(t(this._element).trigger(n),!n.isDefaultPrevented()){var r=this._getDimension();this._element.style[r]=this._element.getBoundingClientRect()[r]+"px",u.reflow(this._element),t(this._element).addClass(me).removeClass(pe).removeClass(fe);var i=this._triggerArray.length;if(i>0)for(var o=0;o0},r._getOffset=function(){var e=this,t={};return"function"==typeof this._config.offset?t.fn=function(t){return t.offsets=s({},t.offsets,{},e._config.offset(t.offsets,e._element)||{}),t}:t.offset=this._config.offset,t},r._getPopperConfig=function(){var e={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(e.modifiers.applyStyle={enabled:!1}),s({},e,{},this._config.popperConfig)},e._jQueryInterface=function(n){return this.each((function(){var r=t(this).data(_e);if(r||(r=new e(this,"object"==typeof n?n:null),t(this).data(_e,r)),"string"==typeof n){if(void 0===r[n])throw new TypeError('No method named "'+n+'"');r[n]()}}))},e._clearMenus=function(n){if(!n||3!==n.which&&("keyup"!==n.type||9===n.which))for(var r=[].slice.call(document.querySelectorAll(Ie)),i=0,o=r.length;i0&&a--,40===n.which&&adocument.documentElement.clientHeight;!this._isBodyOverflowing&&e&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!e&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},n._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},n._checkScrollbar=function(){var e=document.body.getBoundingClientRect();this._isBodyOverflowing=e.left+e.right
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},popperConfig:null},St="show",Ct="out",Dt={HIDE:"hide"+vt,HIDDEN:"hidden"+vt,SHOW:"show"+vt,SHOWN:"shown"+vt,INSERTED:"inserted"+vt,CLICK:"click"+vt,FOCUSIN:"focusin"+vt,FOCUSOUT:"focusout"+vt,MOUSEENTER:"mouseenter"+vt,MOUSELEAVE:"mouseleave"+vt},At="fade",Tt="show",Ot=".tooltip-inner",Ft=".arrow",Mt="hover",Pt="focus",Nt="click",It="manual",Rt=function(){function e(e,t){if(void 0===n)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=e,this.config=this._getConfig(t),this.tip=null,this._setListeners()}var r=e.prototype;return r.enable=function(){this._isEnabled=!0},r.disable=function(){this._isEnabled=!1},r.toggleEnabled=function(){this._isEnabled=!this._isEnabled},r.toggle=function(e){if(this._isEnabled)if(e){var n=this.constructor.DATA_KEY,r=t(e.currentTarget).data(n);r||(r=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(n,r)),r._activeTrigger.click=!r._activeTrigger.click,r._isWithActiveTrigger()?r._enter(null,r):r._leave(null,r)}else{if(t(this.getTipElement()).hasClass(Tt))return void this._leave(null,this);this._enter(null,this)}},r.dispose=function(){clearTimeout(this._timeout),t.removeData(this.element,this.constructor.DATA_KEY),t(this.element).off(this.constructor.EVENT_KEY),t(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler),this.tip&&t(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},r.show=function(){var e=this;if("none"===t(this.element).css("display"))throw new Error("Please use show on visible elements");var r=t.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){t(this.element).trigger(r);var i=u.findShadowRoot(this.element),o=t.contains(null!==i?i:this.element.ownerDocument.documentElement,this.element);if(r.isDefaultPrevented()||!o)return;var a=this.getTipElement(),s=u.getUID(this.constructor.NAME);a.setAttribute("id",s),this.element.setAttribute("aria-describedby",s),this.setContent(),this.config.animation&&t(a).addClass(At);var l="function"==typeof this.config.placement?this.config.placement.call(this,a,this.element):this.config.placement,c=this._getAttachment(l);this.addAttachmentClass(c);var d=this._getContainer();t(a).data(this.constructor.DATA_KEY,this),t.contains(this.element.ownerDocument.documentElement,this.tip)||t(a).appendTo(d),t(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new n(this.element,a,this._getPopperConfig(c)),t(a).addClass(Tt),"ontouchstart"in document.documentElement&&t(document.body).children().on("mouseover",null,t.noop);var h=function(){e.config.animation&&e._fixTransition();var n=e._hoverState;e._hoverState=null,t(e.element).trigger(e.constructor.Event.SHOWN),n===Ct&&e._leave(null,e)};if(t(this.tip).hasClass(At)){var f=u.getTransitionDurationFromElement(this.tip);t(this.tip).one(u.TRANSITION_END,h).emulateTransitionEnd(f)}else h()}},r.hide=function(e){var n=this,r=this.getTipElement(),i=t.Event(this.constructor.Event.HIDE),o=function(){n._hoverState!==St&&r.parentNode&&r.parentNode.removeChild(r),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),t(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),e&&e()};if(t(this.element).trigger(i),!i.isDefaultPrevented()){if(t(r).removeClass(Tt),"ontouchstart"in document.documentElement&&t(document.body).children().off("mouseover",null,t.noop),this._activeTrigger[Nt]=!1,this._activeTrigger[Pt]=!1,this._activeTrigger[Mt]=!1,t(this.tip).hasClass(At)){var a=u.getTransitionDurationFromElement(r);t(r).one(u.TRANSITION_END,o).emulateTransitionEnd(a)}else o();this._hoverState=""}},r.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},r.isWithContent=function(){return Boolean(this.getTitle())},r.addAttachmentClass=function(e){t(this.getTipElement()).addClass(bt+"-"+e)},r.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0],this.tip},r.setContent=function(){var e=this.getTipElement();this.setElementContent(t(e.querySelectorAll(Ot)),this.getTitle()),t(e).removeClass(At+" "+Tt)},r.setElementContent=function(e,n){"object"!=typeof n||!n.nodeType&&!n.jquery?this.config.html?(this.config.sanitize&&(n=pt(n,this.config.whiteList,this.config.sanitizeFn)),e.html(n)):e.text(n):this.config.html?t(n).parent().is(e)||e.empty().append(n):e.text(t(n).text())},r.getTitle=function(){var e=this.element.getAttribute("data-original-title");return e||(e="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),e},r._getPopperConfig=function(e){var t=this;return s({},{placement:e,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:Ft},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(e){e.originalPlacement!==e.placement&&t._handlePopperPlacementChange(e)},onUpdate:function(e){return t._handlePopperPlacementChange(e)}},{},this.config.popperConfig)},r._getOffset=function(){var e=this,t={};return"function"==typeof this.config.offset?t.fn=function(t){return t.offsets=s({},t.offsets,{},e.config.offset(t.offsets,e.element)||{}),t}:t.offset=this.config.offset,t},r._getContainer=function(){return!1===this.config.container?document.body:u.isElement(this.config.container)?t(this.config.container):t(document).find(this.config.container)},r._getAttachment=function(e){return kt[e.toUpperCase()]},r._setListeners=function(){var e=this;this.config.trigger.split(" ").forEach((function(n){if("click"===n)t(e.element).on(e.constructor.Event.CLICK,e.config.selector,(function(t){return e.toggle(t)}));else if(n!==It){var r=n===Mt?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,i=n===Mt?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;t(e.element).on(r,e.config.selector,(function(t){return e._enter(t)})).on(i,e.config.selector,(function(t){return e._leave(t)}))}})),this._hideModalHandler=function(){e.element&&e.hide()},t(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=s({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},r._fixTitle=function(){var e=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==e)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},r._enter=function(e,n){var r=this.constructor.DATA_KEY;(n=n||t(e.currentTarget).data(r))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(r,n)),e&&(n._activeTrigger["focusin"===e.type?Pt:Mt]=!0),t(n.getTipElement()).hasClass(Tt)||n._hoverState===St?n._hoverState=St:(clearTimeout(n._timeout),n._hoverState=St,n.config.delay&&n.config.delay.show?n._timeout=setTimeout((function(){n._hoverState===St&&n.show()}),n.config.delay.show):n.show())},r._leave=function(e,n){var r=this.constructor.DATA_KEY;(n=n||t(e.currentTarget).data(r))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(r,n)),e&&(n._activeTrigger["focusout"===e.type?Pt:Mt]=!1),n._isWithActiveTrigger()||(clearTimeout(n._timeout),n._hoverState=Ct,n.config.delay&&n.config.delay.hide?n._timeout=setTimeout((function(){n._hoverState===Ct&&n.hide()}),n.config.delay.hide):n.hide())},r._isWithActiveTrigger=function(){for(var e in this._activeTrigger)if(this._activeTrigger[e])return!0;return!1},r._getConfig=function(e){var n=t(this.element).data();return Object.keys(n).forEach((function(e){-1!==wt.indexOf(e)&&delete n[e]})),"number"==typeof(e=s({},this.constructor.Default,{},n,{},"object"==typeof e&&e?e:{})).delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),u.typeCheckConfig(mt,e,this.constructor.DefaultType),e.sanitize&&(e.template=pt(e.template,e.whiteList,e.sanitizeFn)),e},r._getDelegateConfig=function(){var e={};if(this.config)for(var t in this.config)this.constructor.Default[t]!==this.config[t]&&(e[t]=this.config[t]);return e},r._cleanTipClass=function(){var e=t(this.getTipElement()),n=e.attr("class").match(xt);null!==n&&n.length&&e.removeClass(n.join(""))},r._handlePopperPlacementChange=function(e){var t=e.instance;this.tip=t.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(e.placement))},r._fixTransition=function(){var e=this.getTipElement(),n=this.config.animation;null===e.getAttribute("x-placement")&&(t(e).removeClass(At),this.config.animation=!1,this.hide(),this.show(),this.config.animation=n)},e._jQueryInterface=function(n){return this.each((function(){var r=t(this).data(gt),i="object"==typeof n&&n;if((r||!/dispose|hide/.test(n))&&(r||(r=new e(this,i),t(this).data(gt,r)),"string"==typeof n)){if(void 0===r[n])throw new TypeError('No method named "'+n+'"');r[n]()}}))},i(e,null,[{key:"VERSION",get:function(){return"4.4.1"}},{key:"Default",get:function(){return Et}},{key:"NAME",get:function(){return mt}},{key:"DATA_KEY",get:function(){return gt}},{key:"Event",get:function(){return Dt}},{key:"EVENT_KEY",get:function(){return vt}},{key:"DefaultType",get:function(){return _t}}]),e}();t.fn[mt]=Rt._jQueryInterface,t.fn[mt].Constructor=Rt,t.fn[mt].noConflict=function(){return t.fn[mt]=yt,Rt._jQueryInterface};var jt="popover",Lt="bs.popover",zt="."+Lt,Bt=t.fn[jt],$t="bs-popover",Ht=new RegExp("(^|\\s)"+$t+"\\S+","g"),Ut=s({},Rt.Default,{placement:"right",trigger:"click",content:"",template:''}),Wt=s({},Rt.DefaultType,{content:"(string|element|function)"}),qt="fade",Vt="show",Gt=".popover-header",Xt=".popover-body",Yt={HIDE:"hide"+zt,HIDDEN:"hidden"+zt,SHOW:"show"+zt,SHOWN:"shown"+zt,INSERTED:"inserted"+zt,CLICK:"click"+zt,FOCUSIN:"focusin"+zt,FOCUSOUT:"focusout"+zt,MOUSEENTER:"mouseenter"+zt,MOUSELEAVE:"mouseleave"+zt},Jt=function(e){function n(){return e.apply(this,arguments)||this}var r,o;o=e,(r=n).prototype=Object.create(o.prototype),r.prototype.constructor=r,r.__proto__=o;var a=n.prototype;return a.isWithContent=function(){return this.getTitle()||this._getContent()},a.addAttachmentClass=function(e){t(this.getTipElement()).addClass($t+"-"+e)},a.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0],this.tip},a.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(Gt),this.getTitle());var n=this._getContent();"function"==typeof n&&(n=n.call(this.element)),this.setElementContent(e.find(Xt),n),e.removeClass(qt+" "+Vt)},a._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},a._cleanTipClass=function(){var e=t(this.getTipElement()),n=e.attr("class").match(Ht);null!==n&&n.length>0&&e.removeClass(n.join(""))},n._jQueryInterface=function(e){return this.each((function(){var r=t(this).data(Lt),i="object"==typeof e?e:null;if((r||!/dispose|hide/.test(e))&&(r||(r=new n(this,i),t(this).data(Lt,r)),"string"==typeof e)){if(void 0===r[e])throw new TypeError('No method named "'+e+'"');r[e]()}}))},i(n,null,[{key:"VERSION",get:function(){return"4.4.1"}},{key:"Default",get:function(){return Ut}},{key:"NAME",get:function(){return jt}},{key:"DATA_KEY",get:function(){return Lt}},{key:"Event",get:function(){return Yt}},{key:"EVENT_KEY",get:function(){return zt}},{key:"DefaultType",get:function(){return Wt}}]),n}(Rt);t.fn[jt]=Jt._jQueryInterface,t.fn[jt].Constructor=Jt,t.fn[jt].noConflict=function(){return t.fn[jt]=Bt,Jt._jQueryInterface};var Kt="scrollspy",Zt="bs.scrollspy",Qt="."+Zt,en=t.fn[Kt],tn={offset:10,method:"auto",target:""},nn={offset:"number",method:"string",target:"(string|element)"},rn={ACTIVATE:"activate"+Qt,SCROLL:"scroll"+Qt,LOAD_DATA_API:"load"+Qt+".data-api"},on="dropdown-item",an="active",sn={DATA_SPY:'[data-spy="scroll"]',ACTIVE:".active",NAV_LIST_GROUP:".nav, .list-group",NAV_LINKS:".nav-link",NAV_ITEMS:".nav-item",LIST_ITEMS:".list-group-item",DROPDOWN:".dropdown",DROPDOWN_ITEMS:".dropdown-item",DROPDOWN_TOGGLE:".dropdown-toggle"},ln="offset",cn="position",un=function(){function e(e,n){var r=this;this._element=e,this._scrollElement="BODY"===e.tagName?window:e,this._config=this._getConfig(n),this._selector=this._config.target+" "+sn.NAV_LINKS+","+this._config.target+" "+sn.LIST_ITEMS+","+this._config.target+" "+sn.DROPDOWN_ITEMS,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,t(this._scrollElement).on(rn.SCROLL,(function(e){return r._process(e)})),this.refresh(),this._process()}var n=e.prototype;return n.refresh=function(){var e=this,n=this._scrollElement===this._scrollElement.window?ln:cn,r="auto"===this._config.method?n:this._config.method,i=r===cn?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map((function(e){var n,o=u.getSelectorFromElement(e);if(o&&(n=document.querySelector(o)),n){var a=n.getBoundingClientRect();if(a.width||a.height)return[t(n)[r]().top+i,o]}return null})).filter((function(e){return e})).sort((function(e,t){return e[0]-t[0]})).forEach((function(t){e._offsets.push(t[0]),e._targets.push(t[1])}))},n.dispose=function(){t.removeData(this._element,Zt),t(this._scrollElement).off(Qt),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},n._getConfig=function(e){if("string"!=typeof(e=s({},tn,{},"object"==typeof e&&e?e:{})).target){var n=t(e.target).attr("id");n||(n=u.getUID(Kt),t(e.target).attr("id",n)),e.target="#"+n}return u.typeCheckConfig(Kt,e,nn),e},n._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},n._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},n._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},n._process=function(){var e=this._getScrollTop()+this._config.offset,t=this._getScrollHeight(),n=this._config.offset+t-this._getOffsetHeight();if(this._scrollHeight!==t&&this.refresh(),e>=n){var r=this._targets[this._targets.length-1];this._activeTarget!==r&&this._activate(r)}else{if(this._activeTarget&&e0)return this._activeTarget=null,void this._clear();for(var i=this._offsets.length;i--;)this._activeTarget!==this._targets[i]&&e>=this._offsets[i]&&(void 0===this._offsets[i+1]||e{"use strict";const r=n(415),i=n(551),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=l,t.h2=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return c(e,t,n)}function c(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|m(e,t);let r=s(n);const i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Y(e,Uint8Array)){const t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Y(e,ArrayBuffer)||e&&Y(e.buffer,ArrayBuffer))return f(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(Y(e,SharedArrayBuffer)||e&&Y(e.buffer,SharedArrayBuffer)))return f(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return l.from(r,t,n);const i=function(e){if(l.isBuffer(e)){const t=0|p(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?s(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return u(e),s(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),n=s(t);for(let r=0;r=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function m(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Y(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return G(e).length;default:if(i)return r?-1:V(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return A(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),J(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){let o,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let r=-1;for(o=n;os&&(n=s-l),o=n;o>=0;o--){let n=!0;for(let r=0;ri&&(r=i):r=i;const o=t.length;let a;for(r>o/2&&(r=o/2),a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function S(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+a<=n){let n,r,s,l;switch(a){case 1:t<128&&(o=t);break;case 2:n=e[i+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(o=l));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(l=(15&t)<<12|(63&n)<<6|63&r,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(l=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return function(e){const t=e.length;if(t<=D)return String.fromCharCode.apply(String,e);let n="",r=0;for(;rr.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tn&&(e+=" ... "),""},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(e,t,n,r,i){if(Y(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0);const s=Math.min(o,a),c=this.slice(r,i),u=e.slice(t,n);for(let e=0;e>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return x(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":case"latin1":case"binary":return _(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const D=4096;function A(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;ir)&&(n=r);let i="";for(let r=t;rn)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function N(e,t,n,r,i){H(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function I(e,t,n,r,i){H(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function R(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function j(e,t,n,r,o){return t=+t,n>>>=0,o||R(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,o){return t=+t,n>>>=0,o||R(e,0,n,8),i.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||M(e,t,this.length);let r=this[e],i=1,o=0;for(;++o>>=0,t>>>=0,n||M(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=Z((function(e){U(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<>>=0,t>>>=0,n||M(e,t,this.length);let r=this[e],i=1,o=0;for(;++o=i&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);let r=t,i=1,o=this[e+--r];for(;r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||M(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||M(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=Z((function(e){U(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||M(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||M(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||M(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||M(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||P(this,e,t,n,Math.pow(2,8*n)-1,0);let i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,r||P(this,e,t,n,Math.pow(2,8*n)-1,0);let i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=Z((function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=Z((function(e,t=0){return I(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}let i=0,o=1,a=0;for(this[t]=255&e;++i>0)-a&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}let i=n-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=Z((function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=Z((function(e,t=0){return I(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(e,t,n){return j(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return j(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function H(e,t,n,r,i,o){if(e>n||e3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new z.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){U(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||W(t,e.length-(n+1))}(r,i,o)}function U(e,t){if("number"!=typeof e)throw new z.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,n){if(Math.floor(e)!==e)throw U(e,n),new z.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new z.ERR_BUFFER_OUT_OF_BOUNDS;throw new z.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=$(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=$(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r}),RangeError);const q=/[^+/0-9A-Za-z-_]/g;function V(e,t){let n;t=t||1/0;const r=e.length;let i=null;const o=[];for(let a=0;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function G(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function X(e,t,n,r){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const K=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function Z(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},636:e=>{var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n{var r=n(872).lW,i=function(){"use strict";function e(e,t){return null!=t&&e instanceof t}var t,n,i;try{t=Map}catch(e){t=function(){}}try{n=Set}catch(e){n=function(){}}try{i=Promise}catch(e){i=function(){}}function o(a,l,c,u,d){"object"==typeof l&&(c=l.depth,u=l.prototype,d=l.includeNonEnumerable,l=l.circular);var h=[],f=[],p=void 0!==r;return void 0===l&&(l=!0),void 0===c&&(c=1/0),function a(c,m){if(null===c)return null;if(0===m)return c;var g,v;if("object"!=typeof c)return c;if(e(c,t))g=new t;else if(e(c,n))g=new n;else if(e(c,i))g=new i((function(e,t){c.then((function(t){e(a(t,m-1))}),(function(e){t(a(e,m-1))}))}));else if(o.__isArray(c))g=[];else if(o.__isRegExp(c))g=new RegExp(c.source,s(c)),c.lastIndex&&(g.lastIndex=c.lastIndex);else if(o.__isDate(c))g=new Date(c.getTime());else{if(p&&r.isBuffer(c))return g=r.allocUnsafe?r.allocUnsafe(c.length):new r(c.length),c.copy(g),g;e(c,Error)?g=Object.create(c):void 0===u?(v=Object.getPrototypeOf(c),g=Object.create(v)):(g=Object.create(u),v=u)}if(l){var y=h.indexOf(c);if(-1!=y)return f[y];h.push(c),f.push(g)}for(var b in e(c,t)&&c.forEach((function(e,t){var n=a(t,m-1),r=a(e,m-1);g.set(n,r)})),e(c,n)&&c.forEach((function(e){var t=a(e,m-1);g.add(t)})),c){var x;v&&(x=Object.getOwnPropertyDescriptor(v,b)),x&&null==x.set||(g[b]=a(c[b],m-1))}if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(c);for(b=0;b{var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,i=0;r>>6-2*i);return n}},e.exports=n},645:function(e){var t;t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n(3),o=n(8),a=n(15);function s(e,t,n){var a=null,s=function(e,t){n&&n(e,t),a&&a.visit(e,t)},l="function"==typeof n?s:null,c=!1;if(t){c="boolean"==typeof t.comment&&t.comment;var u="boolean"==typeof t.attachComment&&t.attachComment;(c||u)&&((a=new r.CommentHandler).attach=u,t.comment=!0,l=s)}var d,h=!1;t&&"string"==typeof t.sourceType&&(h="module"===t.sourceType),d=t&&"boolean"==typeof t.jsx&&t.jsx?new i.JSXParser(e,t,l):new o.Parser(e,t,l);var f=h?d.parseModule():d.parseScript();return c&&a&&(f.comments=a.comments),d.config.tokens&&(f.tokens=d.tokens),d.config.tolerant&&(f.errors=d.errorHandler.errors),f}t.parse=s,t.parseModule=function(e,t,n){var r=t||{};return r.sourceType="module",s(e,r,n)},t.parseScript=function(e,t,n){var r=t||{};return r.sourceType="script",s(e,r,n)},t.tokenize=function(e,t,n){var r,i=new a.Tokenizer(e,t);r=[];try{for(;;){var o=i.getNextToken();if(!o)break;n&&(o=n(o)),r.push(o)}}catch(e){i.errorHandler.tolerate(e)}return i.errorHandler.tolerant&&(r.errors=i.errors()),r};var l=n(2);t.Syntax=l.Syntax,t.version="4.0.1"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(){function e(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return e.prototype.insertInnerComments=function(e,t){if(e.type===r.Syntax.BlockStatement&&0===e.body.length){for(var n=[],i=this.leading.length-1;i>=0;--i){var o=this.leading[i];t.end.offset>=o.start&&(n.unshift(o.comment),this.leading.splice(i,1),this.trailing.splice(i,1))}n.length&&(e.innerComments=n)}},e.prototype.findTrailingComments=function(e){var t=[];if(this.trailing.length>0){for(var n=this.trailing.length-1;n>=0;--n){var r=this.trailing[n];r.start>=e.end.offset&&t.unshift(r.comment)}return this.trailing.length=0,t}var i=this.stack[this.stack.length-1];if(i&&i.node.trailingComments){var o=i.node.trailingComments[0];o&&o.range[0]>=e.end.offset&&(t=i.node.trailingComments,delete i.node.trailingComments)}return t},e.prototype.findLeadingComments=function(e){for(var t,n=[];this.stack.length>0&&(o=this.stack[this.stack.length-1])&&o.start>=e.start.offset;)t=o.node,this.stack.pop();if(t){for(var r=(t.leadingComments?t.leadingComments.length:0)-1;r>=0;--r){var i=t.leadingComments[r];i.range[1]<=e.start.offset&&(n.unshift(i),t.leadingComments.splice(r,1))}return t.leadingComments&&0===t.leadingComments.length&&delete t.leadingComments,n}for(r=this.leading.length-1;r>=0;--r){var o;(o=this.leading[r]).start<=e.start.offset&&(n.unshift(o.comment),this.leading.splice(r,1))}return n},e.prototype.visitNode=function(e,t){if(!(e.type===r.Syntax.Program&&e.body.length>0)){this.insertInnerComments(e,t);var n=this.findTrailingComments(t),i=this.findLeadingComments(t);i.length>0&&(e.leadingComments=i),n.length>0&&(e.trailingComments=n),this.stack.push({node:e,start:t.start.offset})}},e.prototype.visitComment=function(e,t){var n="L"===e.type[0]?"Line":"Block",r={type:n,value:e.value};if(e.range&&(r.range=e.range),e.loc&&(r.loc=e.loc),this.comments.push(r),this.attach){var i={comment:{type:n,value:e.value,range:[t.start.offset,t.end.offset]},start:t.start.offset};e.loc&&(i.comment.loc=e.loc),e.type=n,this.leading.push(i),this.trailing.push(i)}},e.prototype.visit=function(e,t){"LineComment"===e.type||"BlockComment"===e.type?this.visitComment(e,t):this.attach&&this.visitNode(e,t)},e}();t.CommentHandler=i},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),a=n(5),s=n(6),l=n(7),c=n(8),u=n(13),d=n(14);function h(e){var t;switch(e.type){case s.JSXSyntax.JSXIdentifier:t=e.name;break;case s.JSXSyntax.JSXNamespacedName:var n=e;t=h(n.namespace)+":"+h(n.name);break;case s.JSXSyntax.JSXMemberExpression:var r=e;t=h(r.object)+"."+h(r.property)}return t}u.TokenName[100]="JSXIdentifier",u.TokenName[101]="JSXText";var f=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}return i(t,e),t.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():e.prototype.parsePrimaryExpression.call(this)},t.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},t.prototype.finishJSX=function(){this.nextToken()},t.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},t.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.scanXHTMLEntity=function(e){for(var t="&",n=!0,r=!1,i=!1,a=!1;!this.scanner.eof()&&n&&!r;){var s=this.scanner.source[this.scanner.index];if(s===e)break;if(r=";"===s,t+=s,++this.scanner.index,!r)switch(t.length){case 2:i="#"===s;break;case 3:i&&(n=(a="x"===s)||o.Character.isDecimalDigit(s.charCodeAt(0)),i=i&&!a);break;default:n=(n=n&&!(i&&!o.Character.isDecimalDigit(s.charCodeAt(0))))&&!(a&&!o.Character.isHexDigit(s.charCodeAt(0)))}}if(n&&r&&t.length>2){var l=t.substr(1,t.length-2);i&&l.length>1?t=String.fromCharCode(parseInt(l.substr(1),10)):a&&l.length>2?t=String.fromCharCode(parseInt("0"+l.substr(1),16)):i||a||!d.XHTMLEntities[l]||(t=d.XHTMLEntities[l])}return t},t.prototype.lexJSX=function(){var e=this.scanner.source.charCodeAt(this.scanner.index);if(60===e||62===e||47===e||58===e||61===e||123===e||125===e)return{type:7,value:s=this.scanner.source[this.scanner.index++],lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index};if(34===e||39===e){for(var t=this.scanner.index,n=this.scanner.source[this.scanner.index++],r="";!this.scanner.eof()&&(l=this.scanner.source[this.scanner.index++])!==n;)r+="&"===l?this.scanXHTMLEntity(n):l;return{type:8,value:r,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index}}if(46===e){var i=this.scanner.source.charCodeAt(this.scanner.index+1),a=this.scanner.source.charCodeAt(this.scanner.index+2),s=46===i&&46===a?"...":".";return t=this.scanner.index,this.scanner.index+=s.length,{type:7,value:s,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index}}if(96===e)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(o.Character.isIdentifierStart(e)&&92!==e){for(t=this.scanner.index,++this.scanner.index;!this.scanner.eof();){var l=this.scanner.source.charCodeAt(this.scanner.index);if(o.Character.isIdentifierPart(l)&&92!==l)++this.scanner.index;else{if(45!==l)break;++this.scanner.index}}return{type:100,value:this.scanner.source.slice(t,this.scanner.index),lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index}}return this.scanner.lex()},t.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var e=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(e)),e},t.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var e=this.scanner.index,t="";!this.scanner.eof();){var n=this.scanner.source[this.scanner.index];if("{"===n||"<"===n)break;++this.scanner.index,t+=n,o.Character.isLineTerminator(n.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===n&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var r={type:101,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index};return t.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(r)),r},t.prototype.peekJSXToken=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.lexJSX();return this.scanner.restoreState(e),t},t.prototype.expectJSX=function(e){var t=this.nextJSXToken();7===t.type&&t.value===e||this.throwUnexpectedToken(t)},t.prototype.matchJSX=function(e){var t=this.peekJSXToken();return 7===t.type&&t.value===e},t.prototype.parseJSXIdentifier=function(){var e=this.createJSXNode(),t=this.nextJSXToken();return 100!==t.type&&this.throwUnexpectedToken(t),this.finalize(e,new a.JSXIdentifier(t.value))},t.prototype.parseJSXElementName=function(){var e=this.createJSXNode(),t=this.parseJSXIdentifier();if(this.matchJSX(":")){var n=t;this.expectJSX(":");var r=this.parseJSXIdentifier();t=this.finalize(e,new a.JSXNamespacedName(n,r))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var i=t;this.expectJSX(".");var o=this.parseJSXIdentifier();t=this.finalize(e,new a.JSXMemberExpression(i,o))}return t},t.prototype.parseJSXAttributeName=function(){var e,t=this.createJSXNode(),n=this.parseJSXIdentifier();if(this.matchJSX(":")){var r=n;this.expectJSX(":");var i=this.parseJSXIdentifier();e=this.finalize(t,new a.JSXNamespacedName(r,i))}else e=n;return e},t.prototype.parseJSXStringLiteralAttribute=function(){var e=this.createJSXNode(),t=this.nextJSXToken();8!==t.type&&this.throwUnexpectedToken(t);var n=this.getTokenRaw(t);return this.finalize(e,new l.Literal(t.value,n))},t.prototype.parseJSXExpressionAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new a.JSXExpressionContainer(t))},t.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},t.prototype.parseJSXNameValueAttribute=function(){var e=this.createJSXNode(),t=this.parseJSXAttributeName(),n=null;return this.matchJSX("=")&&(this.expectJSX("="),n=this.parseJSXAttributeValue()),this.finalize(e,new a.JSXAttribute(t,n))},t.prototype.parseJSXSpreadAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new a.JSXSpreadAttribute(t))},t.prototype.parseJSXAttributes=function(){for(var e=[];!this.matchJSX("/")&&!this.matchJSX(">");){var t=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();e.push(t)}return e},t.prototype.parseJSXOpeningElement=function(){var e=this.createJSXNode();this.expectJSX("<");var t=this.parseJSXElementName(),n=this.parseJSXAttributes(),r=this.matchJSX("/");return r&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new a.JSXOpeningElement(t,r,n))},t.prototype.parseJSXBoundaryElement=function(){var e=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var t=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(e,new a.JSXClosingElement(t))}var n=this.parseJSXElementName(),r=this.parseJSXAttributes(),i=this.matchJSX("/");return i&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new a.JSXOpeningElement(n,i,r))},t.prototype.parseJSXEmptyExpression=function(){var e=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(e,new a.JSXEmptyExpression)},t.prototype.parseJSXExpressionContainer=function(){var e,t=this.createJSXNode();return this.expectJSX("{"),this.matchJSX("}")?(e=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),e=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(t,new a.JSXExpressionContainer(e))},t.prototype.parseJSXChildren=function(){for(var e=[];!this.scanner.eof();){var t=this.createJSXChildNode(),n=this.nextJSXText();if(n.start0))break;o=this.finalize(e.node,new a.JSXElement(e.opening,e.children,e.closing)),(e=t[t.length-1]).children.push(o),t.pop()}}return e},t.prototype.parseJSXElement=function(){var e=this.createJSXNode(),t=this.parseJSXOpeningElement(),n=[],r=null;if(!t.selfClosing){var i=this.parseComplexJSXElement({node:e,opening:t,closing:r,children:n});n=i.children,r=i.closing}return this.finalize(e,new a.JSXElement(t,n,r))},t.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var e=this.parseJSXElement();return this.finishJSX(),e},t.prototype.isStartOfExpression=function(){return e.prototype.isStartOfExpression.call(this)||this.match("<")},t}(c.Parser);t.JSXParser=f},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};t.Character={fromCodePoint:function(e){return e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023))},isWhiteSpace:function(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0},isLineTerminator:function(e){return 10===e||13===e||8232===e||8233===e},isIdentifierStart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&n.NonAsciiIdentifierStart.test(t.Character.fromCodePoint(e))},isIdentifierPart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&n.NonAsciiIdentifierPart.test(t.Character.fromCodePoint(e))},isDecimalDigit:function(e){return e>=48&&e<=57},isHexDigit:function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},isOctalDigit:function(e){return e>=48&&e<=55}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6);t.JSXClosingElement=function(e){this.type=r.JSXSyntax.JSXClosingElement,this.name=e};t.JSXElement=function(e,t,n){this.type=r.JSXSyntax.JSXElement,this.openingElement=e,this.children=t,this.closingElement=n};t.JSXEmptyExpression=function(){this.type=r.JSXSyntax.JSXEmptyExpression};t.JSXExpressionContainer=function(e){this.type=r.JSXSyntax.JSXExpressionContainer,this.expression=e};t.JSXIdentifier=function(e){this.type=r.JSXSyntax.JSXIdentifier,this.name=e};t.JSXMemberExpression=function(e,t){this.type=r.JSXSyntax.JSXMemberExpression,this.object=e,this.property=t};t.JSXAttribute=function(e,t){this.type=r.JSXSyntax.JSXAttribute,this.name=e,this.value=t};t.JSXNamespacedName=function(e,t){this.type=r.JSXSyntax.JSXNamespacedName,this.namespace=e,this.name=t};t.JSXOpeningElement=function(e,t,n){this.type=r.JSXSyntax.JSXOpeningElement,this.name=e,this.selfClosing=t,this.attributes=n};t.JSXSpreadAttribute=function(e){this.type=r.JSXSyntax.JSXSpreadAttribute,this.argument=e};t.JSXText=function(e,t){this.type=r.JSXSyntax.JSXText,this.value=e,this.raw=t}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.ArrayExpression=function(e){this.type=r.Syntax.ArrayExpression,this.elements=e};t.ArrayPattern=function(e){this.type=r.Syntax.ArrayPattern,this.elements=e};t.ArrowFunctionExpression=function(e,t,n){this.type=r.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n,this.async=!1};t.AssignmentExpression=function(e,t,n){this.type=r.Syntax.AssignmentExpression,this.operator=e,this.left=t,this.right=n};t.AssignmentPattern=function(e,t){this.type=r.Syntax.AssignmentPattern,this.left=e,this.right=t};t.AsyncArrowFunctionExpression=function(e,t,n){this.type=r.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n,this.async=!0};t.AsyncFunctionDeclaration=function(e,t,n){this.type=r.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=!1,this.expression=!1,this.async=!0};t.AsyncFunctionExpression=function(e,t,n){this.type=r.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=!1,this.expression=!1,this.async=!0};t.AwaitExpression=function(e){this.type=r.Syntax.AwaitExpression,this.argument=e};t.BinaryExpression=function(e,t,n){var i="||"===e||"&&"===e;this.type=i?r.Syntax.LogicalExpression:r.Syntax.BinaryExpression,this.operator=e,this.left=t,this.right=n};t.BlockStatement=function(e){this.type=r.Syntax.BlockStatement,this.body=e};t.BreakStatement=function(e){this.type=r.Syntax.BreakStatement,this.label=e};t.CallExpression=function(e,t){this.type=r.Syntax.CallExpression,this.callee=e,this.arguments=t};t.CatchClause=function(e,t){this.type=r.Syntax.CatchClause,this.param=e,this.body=t};t.ClassBody=function(e){this.type=r.Syntax.ClassBody,this.body=e};t.ClassDeclaration=function(e,t,n){this.type=r.Syntax.ClassDeclaration,this.id=e,this.superClass=t,this.body=n};t.ClassExpression=function(e,t,n){this.type=r.Syntax.ClassExpression,this.id=e,this.superClass=t,this.body=n};t.ComputedMemberExpression=function(e,t){this.type=r.Syntax.MemberExpression,this.computed=!0,this.object=e,this.property=t};t.ConditionalExpression=function(e,t,n){this.type=r.Syntax.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=n};t.ContinueStatement=function(e){this.type=r.Syntax.ContinueStatement,this.label=e};t.DebuggerStatement=function(){this.type=r.Syntax.DebuggerStatement};t.Directive=function(e,t){this.type=r.Syntax.ExpressionStatement,this.expression=e,this.directive=t};t.DoWhileStatement=function(e,t){this.type=r.Syntax.DoWhileStatement,this.body=e,this.test=t};t.EmptyStatement=function(){this.type=r.Syntax.EmptyStatement};t.ExportAllDeclaration=function(e){this.type=r.Syntax.ExportAllDeclaration,this.source=e};t.ExportDefaultDeclaration=function(e){this.type=r.Syntax.ExportDefaultDeclaration,this.declaration=e};t.ExportNamedDeclaration=function(e,t,n){this.type=r.Syntax.ExportNamedDeclaration,this.declaration=e,this.specifiers=t,this.source=n};t.ExportSpecifier=function(e,t){this.type=r.Syntax.ExportSpecifier,this.exported=t,this.local=e};t.ExpressionStatement=function(e){this.type=r.Syntax.ExpressionStatement,this.expression=e};t.ForInStatement=function(e,t,n){this.type=r.Syntax.ForInStatement,this.left=e,this.right=t,this.body=n,this.each=!1};t.ForOfStatement=function(e,t,n){this.type=r.Syntax.ForOfStatement,this.left=e,this.right=t,this.body=n};t.ForStatement=function(e,t,n,i){this.type=r.Syntax.ForStatement,this.init=e,this.test=t,this.update=n,this.body=i};t.FunctionDeclaration=function(e,t,n,i){this.type=r.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=i,this.expression=!1,this.async=!1};t.FunctionExpression=function(e,t,n,i){this.type=r.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=i,this.expression=!1,this.async=!1};t.Identifier=function(e){this.type=r.Syntax.Identifier,this.name=e};t.IfStatement=function(e,t,n){this.type=r.Syntax.IfStatement,this.test=e,this.consequent=t,this.alternate=n};t.ImportDeclaration=function(e,t){this.type=r.Syntax.ImportDeclaration,this.specifiers=e,this.source=t};t.ImportDefaultSpecifier=function(e){this.type=r.Syntax.ImportDefaultSpecifier,this.local=e};t.ImportNamespaceSpecifier=function(e){this.type=r.Syntax.ImportNamespaceSpecifier,this.local=e};t.ImportSpecifier=function(e,t){this.type=r.Syntax.ImportSpecifier,this.local=e,this.imported=t};t.LabeledStatement=function(e,t){this.type=r.Syntax.LabeledStatement,this.label=e,this.body=t};t.Literal=function(e,t){this.type=r.Syntax.Literal,this.value=e,this.raw=t};t.MetaProperty=function(e,t){this.type=r.Syntax.MetaProperty,this.meta=e,this.property=t};t.MethodDefinition=function(e,t,n,i,o){this.type=r.Syntax.MethodDefinition,this.key=e,this.computed=t,this.value=n,this.kind=i,this.static=o};t.Module=function(e){this.type=r.Syntax.Program,this.body=e,this.sourceType="module"};t.NewExpression=function(e,t){this.type=r.Syntax.NewExpression,this.callee=e,this.arguments=t};t.ObjectExpression=function(e){this.type=r.Syntax.ObjectExpression,this.properties=e};t.ObjectPattern=function(e){this.type=r.Syntax.ObjectPattern,this.properties=e};t.Property=function(e,t,n,i,o,a){this.type=r.Syntax.Property,this.key=t,this.computed=n,this.value=i,this.kind=e,this.method=o,this.shorthand=a};t.RegexLiteral=function(e,t,n,i){this.type=r.Syntax.Literal,this.value=e,this.raw=t,this.regex={pattern:n,flags:i}};t.RestElement=function(e){this.type=r.Syntax.RestElement,this.argument=e};t.ReturnStatement=function(e){this.type=r.Syntax.ReturnStatement,this.argument=e};t.Script=function(e){this.type=r.Syntax.Program,this.body=e,this.sourceType="script"};t.SequenceExpression=function(e){this.type=r.Syntax.SequenceExpression,this.expressions=e};t.SpreadElement=function(e){this.type=r.Syntax.SpreadElement,this.argument=e};t.StaticMemberExpression=function(e,t){this.type=r.Syntax.MemberExpression,this.computed=!1,this.object=e,this.property=t};t.Super=function(){this.type=r.Syntax.Super};t.SwitchCase=function(e,t){this.type=r.Syntax.SwitchCase,this.test=e,this.consequent=t};t.SwitchStatement=function(e,t){this.type=r.Syntax.SwitchStatement,this.discriminant=e,this.cases=t};t.TaggedTemplateExpression=function(e,t){this.type=r.Syntax.TaggedTemplateExpression,this.tag=e,this.quasi=t};t.TemplateElement=function(e,t){this.type=r.Syntax.TemplateElement,this.value=e,this.tail=t};t.TemplateLiteral=function(e,t){this.type=r.Syntax.TemplateLiteral,this.quasis=e,this.expressions=t};t.ThisExpression=function(){this.type=r.Syntax.ThisExpression};t.ThrowStatement=function(e){this.type=r.Syntax.ThrowStatement,this.argument=e};t.TryStatement=function(e,t,n){this.type=r.Syntax.TryStatement,this.block=e,this.handler=t,this.finalizer=n};t.UnaryExpression=function(e,t){this.type=r.Syntax.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0};t.UpdateExpression=function(e,t,n){this.type=r.Syntax.UpdateExpression,this.operator=e,this.argument=t,this.prefix=n};t.VariableDeclaration=function(e,t){this.type=r.Syntax.VariableDeclaration,this.declarations=e,this.kind=t};t.VariableDeclarator=function(e,t){this.type=r.Syntax.VariableDeclarator,this.id=e,this.init=t};t.WhileStatement=function(e,t){this.type=r.Syntax.WhileStatement,this.test=e,this.body=t};t.WithStatement=function(e,t){this.type=r.Syntax.WithStatement,this.object=e,this.body=t};t.YieldExpression=function(e,t){this.type=r.Syntax.YieldExpression,this.argument=e,this.delegate=t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),i=n(10),o=n(11),a=n(7),s=n(12),l=n(2),c=n(13),u="ArrowParameterPlaceHolder",d=function(){function e(e,t,n){void 0===t&&(t={}),this.config={range:"boolean"==typeof t.range&&t.range,loc:"boolean"==typeof t.loc&&t.loc,source:null,tokens:"boolean"==typeof t.tokens&&t.tokens,comment:"boolean"==typeof t.comment&&t.comment,tolerant:"boolean"==typeof t.tolerant&&t.tolerant},this.config.loc&&t.source&&null!==t.source&&(this.config.source=String(t.source)),this.delegate=n,this.errorHandler=new i.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new s.Scanner(e,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return e.prototype.throwError=function(e){for(var t=[],n=1;n0&&this.delegate)for(var t=0;t>="===e||">>>="===e||"&="===e||"^="===e||"|="===e},e.prototype.isolateCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,r=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=e.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=t,this.context.isAssignmentTarget=n,this.context.firstCoverInitializedNameError=r,i},e.prototype.inheritCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,r=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=e.call(this);return this.context.isBindingElement=this.context.isBindingElement&&t,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,this.context.firstCoverInitializedNameError=r||this.context.firstCoverInitializedNameError,i},e.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(2===this.lookahead.type||this.match("}")||this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},e.prototype.parsePrimaryExpression=function(){var e,t,n,r=this.createNode();switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),e=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(r,new a.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,o.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new a.Literal(t.value,n));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new a.Literal("true"===t.value,n));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new a.Literal(null,n));break;case 10:e=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,e=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":e=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":e=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,t=this.nextRegexToken(),n=this.getTokenRaw(t),e=this.finalize(r,new a.RegexLiteral(t.regex,n,t.pattern,t.flags));break;default:e=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?e=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?e=this.finalize(r,new a.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?e=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),e=this.finalize(r,new a.ThisExpression)):e=this.matchKeyword("class")?this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:e=this.throwUnexpectedToken(this.nextToken())}return e},e.prototype.parseSpreadElement=function(){var e=this.createNode();this.expect("...");var t=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(e,new a.SpreadElement(t))},e.prototype.parseArrayInitializer=function(){var e=this.createNode(),t=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),t.push(null);else if(this.match("...")){var n=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),t.push(n)}else t.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(e,new a.ArrayExpression(t))},e.prototype.parsePropertyMethod=function(e){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var t=this.context.strict,n=this.context.allowStrictDirective;this.context.allowStrictDirective=e.simple;var r=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&e.firstRestricted&&this.tolerateUnexpectedToken(e.firstRestricted,e.message),this.context.strict&&e.stricted&&this.tolerateUnexpectedToken(e.stricted,e.message),this.context.strict=t,this.context.allowStrictDirective=n,r},e.prototype.parsePropertyMethodFunction=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters(),r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new a.FunctionExpression(null,n.params,r,!1))},e.prototype.parsePropertyMethodAsyncFunction=function(){var e=this.createNode(),t=this.context.allowYield,n=this.context.await;this.context.allowYield=!1,this.context.await=!0;var r=this.parseFormalParameters(),i=this.parsePropertyMethod(r);return this.context.allowYield=t,this.context.await=n,this.finalize(e,new a.AsyncFunctionExpression(null,r.params,i))},e.prototype.parseObjectPropertyKey=function(){var e,t=this.createNode(),n=this.nextToken();switch(n.type){case 8:case 6:this.context.strict&&n.octal&&this.tolerateUnexpectedToken(n,o.Messages.StrictOctalLiteral);var r=this.getTokenRaw(n);e=this.finalize(t,new a.Literal(n.value,r));break;case 3:case 1:case 5:case 4:e=this.finalize(t,new a.Identifier(n.value));break;case 7:"["===n.value?(e=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):e=this.throwUnexpectedToken(n);break;default:e=this.throwUnexpectedToken(n)}return e},e.prototype.isPropertyKey=function(e,t){return e.type===l.Syntax.Identifier&&e.name===t||e.type===l.Syntax.Literal&&e.value===t},e.prototype.parseObjectProperty=function(e){var t,n=this.createNode(),r=this.lookahead,i=null,s=null,l=!1,c=!1,u=!1,d=!1;if(3===r.type){var h=r.value;this.nextToken(),l=this.match("["),i=(d=!(this.hasLineTerminator||"async"!==h||this.match(":")||this.match("(")||this.match("*")||this.match(",")))?this.parseObjectPropertyKey():this.finalize(n,new a.Identifier(h))}else this.match("*")?this.nextToken():(l=this.match("["),i=this.parseObjectPropertyKey());var f=this.qualifiedPropertyName(this.lookahead);if(3===r.type&&!d&&"get"===r.value&&f)t="get",l=this.match("["),i=this.parseObjectPropertyKey(),this.context.allowYield=!1,s=this.parseGetterMethod();else if(3===r.type&&!d&&"set"===r.value&&f)t="set",l=this.match("["),i=this.parseObjectPropertyKey(),s=this.parseSetterMethod();else if(7===r.type&&"*"===r.value&&f)t="init",l=this.match("["),i=this.parseObjectPropertyKey(),s=this.parseGeneratorMethod(),c=!0;else if(i||this.throwUnexpectedToken(this.lookahead),t="init",this.match(":")&&!d)!l&&this.isPropertyKey(i,"__proto__")&&(e.value&&this.tolerateError(o.Messages.DuplicateProtoProperty),e.value=!0),this.nextToken(),s=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))s=d?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0;else if(3===r.type)if(h=this.finalize(n,new a.Identifier(r.value)),this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),u=!0;var p=this.isolateCoverGrammar(this.parseAssignmentExpression);s=this.finalize(n,new a.AssignmentPattern(h,p))}else u=!0,s=h;else this.throwUnexpectedToken(this.nextToken());return this.finalize(n,new a.Property(t,i,l,s,c,u))},e.prototype.parseObjectInitializer=function(){var e=this.createNode();this.expect("{");for(var t=[],n={value:!1};!this.match("}");)t.push(this.parseObjectProperty(n)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(e,new a.ObjectExpression(t))},e.prototype.parseTemplateHead=function(){r.assert(this.lookahead.head,"Template literal must start with a template head");var e=this.createNode(),t=this.nextToken(),n=t.value,i=t.cooked;return this.finalize(e,new a.TemplateElement({raw:n,cooked:i},t.tail))},e.prototype.parseTemplateElement=function(){10!==this.lookahead.type&&this.throwUnexpectedToken();var e=this.createNode(),t=this.nextToken(),n=t.value,r=t.cooked;return this.finalize(e,new a.TemplateElement({raw:n,cooked:r},t.tail))},e.prototype.parseTemplateLiteral=function(){var e=this.createNode(),t=[],n=[],r=this.parseTemplateHead();for(n.push(r);!r.tail;)t.push(this.parseExpression()),r=this.parseTemplateElement(),n.push(r);return this.finalize(e,new a.TemplateLiteral(n,t))},e.prototype.reinterpretExpressionAsPattern=function(e){switch(e.type){case l.Syntax.Identifier:case l.Syntax.MemberExpression:case l.Syntax.RestElement:case l.Syntax.AssignmentPattern:break;case l.Syntax.SpreadElement:e.type=l.Syntax.RestElement,this.reinterpretExpressionAsPattern(e.argument);break;case l.Syntax.ArrayExpression:e.type=l.Syntax.ArrayPattern;for(var t=0;t")||this.expect("=>"),e={type:u,params:[],async:!1};else{var t=this.lookahead,n=[];if(this.match("..."))e=this.parseRestElement(n),this.expect(")"),this.match("=>")||this.expect("=>"),e={type:u,params:[e],async:!1};else{var r=!1;if(this.context.isBindingElement=!0,e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var i=[];for(this.context.isAssignmentTarget=!1,i.push(e);2!==this.lookahead.type&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var o=0;o")||this.expect("=>"),this.context.isBindingElement=!1,o=0;o")&&(e.type===l.Syntax.Identifier&&"yield"===e.name&&(r=!0,e={type:u,params:[e],async:!1}),!r)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),e.type===l.Syntax.SequenceExpression)for(o=0;o")){for(var l=0;l0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var i=[e,this.lookahead],o=t,s=this.isolateCoverGrammar(this.parseExponentiationExpression),l=[o,n.value,s],c=[r];!((r=this.binaryPrecedence(this.lookahead))<=0);){for(;l.length>2&&r<=c[c.length-1];){s=l.pop();var u=l.pop();c.pop(),o=l.pop(),i.pop();var d=this.startNode(i[i.length-1]);l.push(this.finalize(d,new a.BinaryExpression(u,o,s)))}l.push(this.nextToken().value),c.push(r),i.push(this.lookahead),l.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var h=l.length-1;t=l[h];for(var f=i.pop();h>1;){var p=i.pop(),m=f&&f.lineStart;d=this.startNode(p,m),u=l[h-1],t=this.finalize(d,new a.BinaryExpression(u,l[h-2],t)),h-=2,f=p}}return t},e.prototype.parseConditionalExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var n=this.context.allowIn;this.context.allowIn=!0;var r=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=n,this.expect(":");var i=this.isolateCoverGrammar(this.parseAssignmentExpression);t=this.finalize(this.startNode(e),new a.ConditionalExpression(t,r,i)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return t},e.prototype.checkPatternParam=function(e,t){switch(t.type){case l.Syntax.Identifier:this.validateParam(e,t,t.name);break;case l.Syntax.RestElement:this.checkPatternParam(e,t.argument);break;case l.Syntax.AssignmentPattern:this.checkPatternParam(e,t.left);break;case l.Syntax.ArrayPattern:for(var n=0;n")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var i=e.async,s=this.reinterpretAsCoverFormalsList(e);if(s){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var c=this.context.strict,d=this.context.allowStrictDirective;this.context.allowStrictDirective=s.simple;var h=this.context.allowYield,f=this.context.await;this.context.allowYield=!0,this.context.await=i;var p=this.startNode(t);this.expect("=>");var m=void 0;if(this.match("{")){var g=this.context.allowIn;this.context.allowIn=!0,m=this.parseFunctionSourceElements(),this.context.allowIn=g}else m=this.isolateCoverGrammar(this.parseAssignmentExpression);var v=m.type!==l.Syntax.BlockStatement;this.context.strict&&s.firstRestricted&&this.throwUnexpectedToken(s.firstRestricted,s.message),this.context.strict&&s.stricted&&this.tolerateUnexpectedToken(s.stricted,s.message),e=i?this.finalize(p,new a.AsyncArrowFunctionExpression(s.params,m,v)):this.finalize(p,new a.ArrowFunctionExpression(s.params,m,v)),this.context.strict=c,this.context.allowStrictDirective=d,this.context.allowYield=h,this.context.await=f}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(o.Messages.InvalidLHSInAssignment),this.context.strict&&e.type===l.Syntax.Identifier){var y=e;this.scanner.isRestrictedWord(y.name)&&this.tolerateUnexpectedToken(n,o.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(y.name)&&this.tolerateUnexpectedToken(n,o.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(e):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1);var b=(n=this.nextToken()).value,x=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new a.AssignmentExpression(b,e,x)),this.context.firstCoverInitializedNameError=null}}return e},e.prototype.parseExpression=function(){var e=this.lookahead,t=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var n=[];for(n.push(t);2!==this.lookahead.type&&this.match(",");)this.nextToken(),n.push(this.isolateCoverGrammar(this.parseAssignmentExpression));t=this.finalize(this.startNode(e),new a.SequenceExpression(n))}return t},e.prototype.parseStatementListItem=function(){var e;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,4===this.lookahead.type)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,o.Messages.IllegalExportDeclaration),e=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,o.Messages.IllegalImportDeclaration),e=this.parseImportDeclaration();break;case"const":e=this.parseLexicalDeclaration({inFor:!1});break;case"function":e=this.parseFunctionDeclaration();break;case"class":e=this.parseClassDeclaration();break;case"let":e=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:e=this.parseStatement()}else e=this.parseStatement();return e},e.prototype.parseBlock=function(){var e=this.createNode();this.expect("{");for(var t=[];!this.match("}");)t.push(this.parseStatementListItem());return this.expect("}"),this.finalize(e,new a.BlockStatement(t))},e.prototype.parseLexicalBinding=function(e,t){var n=this.createNode(),r=this.parsePattern([],e);this.context.strict&&r.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(r.name)&&this.tolerateError(o.Messages.StrictVarName);var i=null;return"const"===e?this.matchKeyword("in")||this.matchContextualKeyword("of")||(this.match("=")?(this.nextToken(),i=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(o.Messages.DeclarationMissingInitializer,"const")):(!t.inFor&&r.type!==l.Syntax.Identifier||this.match("="))&&(this.expect("="),i=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(n,new a.VariableDeclarator(r,i))},e.prototype.parseBindingList=function(e,t){for(var n=[this.parseLexicalBinding(e,t)];this.match(",");)this.nextToken(),n.push(this.parseLexicalBinding(e,t));return n},e.prototype.isLexicalDeclaration=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.scanner.lex();return this.scanner.restoreState(e),3===t.type||7===t.type&&"["===t.value||7===t.type&&"{"===t.value||4===t.type&&"let"===t.value||4===t.type&&"yield"===t.value},e.prototype.parseLexicalDeclaration=function(e){var t=this.createNode(),n=this.nextToken().value;r.assert("let"===n||"const"===n,"Lexical declaration must be either let or const");var i=this.parseBindingList(n,e);return this.consumeSemicolon(),this.finalize(t,new a.VariableDeclaration(i,n))},e.prototype.parseBindingRestElement=function(e,t){var n=this.createNode();this.expect("...");var r=this.parsePattern(e,t);return this.finalize(n,new a.RestElement(r))},e.prototype.parseArrayPattern=function(e,t){var n=this.createNode();this.expect("[");for(var r=[];!this.match("]");)if(this.match(","))this.nextToken(),r.push(null);else{if(this.match("...")){r.push(this.parseBindingRestElement(e,t));break}r.push(this.parsePatternWithDefault(e,t)),this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(n,new a.ArrayPattern(r))},e.prototype.parsePropertyPattern=function(e,t){var n,r,i=this.createNode(),o=!1,s=!1;if(3===this.lookahead.type){var l=this.lookahead;n=this.parseVariableIdentifier();var c=this.finalize(i,new a.Identifier(l.value));if(this.match("=")){e.push(l),s=!0,this.nextToken();var u=this.parseAssignmentExpression();r=this.finalize(this.startNode(l),new a.AssignmentPattern(c,u))}else this.match(":")?(this.expect(":"),r=this.parsePatternWithDefault(e,t)):(e.push(l),s=!0,r=c)}else o=this.match("["),n=this.parseObjectPropertyKey(),this.expect(":"),r=this.parsePatternWithDefault(e,t);return this.finalize(i,new a.Property("init",n,o,r,!1,s))},e.prototype.parseObjectPattern=function(e,t){var n=this.createNode(),r=[];for(this.expect("{");!this.match("}");)r.push(this.parsePropertyPattern(e,t)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(n,new a.ObjectPattern(r))},e.prototype.parsePattern=function(e,t){var n;return this.match("[")?n=this.parseArrayPattern(e,t):this.match("{")?n=this.parseObjectPattern(e,t):(!this.matchKeyword("let")||"const"!==t&&"let"!==t||this.tolerateUnexpectedToken(this.lookahead,o.Messages.LetInLexicalBinding),e.push(this.lookahead),n=this.parseVariableIdentifier(t)),n},e.prototype.parsePatternWithDefault=function(e,t){var n=this.lookahead,r=this.parsePattern(e,t);if(this.match("=")){this.nextToken();var i=this.context.allowYield;this.context.allowYield=!0;var o=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=i,r=this.finalize(this.startNode(n),new a.AssignmentPattern(r,o))}return r},e.prototype.parseVariableIdentifier=function(e){var t=this.createNode(),n=this.nextToken();return 4===n.type&&"yield"===n.value?this.context.strict?this.tolerateUnexpectedToken(n,o.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(n):3!==n.type?this.context.strict&&4===n.type&&this.scanner.isStrictModeReservedWord(n.value)?this.tolerateUnexpectedToken(n,o.Messages.StrictReservedWord):(this.context.strict||"let"!==n.value||"var"!==e)&&this.throwUnexpectedToken(n):(this.context.isModule||this.context.await)&&3===n.type&&"await"===n.value&&this.tolerateUnexpectedToken(n),this.finalize(t,new a.Identifier(n.value))},e.prototype.parseVariableDeclaration=function(e){var t=this.createNode(),n=this.parsePattern([],"var");this.context.strict&&n.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(o.Messages.StrictVarName);var r=null;return this.match("=")?(this.nextToken(),r=this.isolateCoverGrammar(this.parseAssignmentExpression)):n.type===l.Syntax.Identifier||e.inFor||this.expect("="),this.finalize(t,new a.VariableDeclarator(n,r))},e.prototype.parseVariableDeclarationList=function(e){var t={inFor:e.inFor},n=[];for(n.push(this.parseVariableDeclaration(t));this.match(",");)this.nextToken(),n.push(this.parseVariableDeclaration(t));return n},e.prototype.parseVariableStatement=function(){var e=this.createNode();this.expectKeyword("var");var t=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(e,new a.VariableDeclaration(t,"var"))},e.prototype.parseEmptyStatement=function(){var e=this.createNode();return this.expect(";"),this.finalize(e,new a.EmptyStatement)},e.prototype.parseExpressionStatement=function(){var e=this.createNode(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new a.ExpressionStatement(t))},e.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(o.Messages.StrictFunction),this.parseStatement()},e.prototype.parseIfStatement=function(){var e,t=this.createNode(),n=null;this.expectKeyword("if"),this.expect("(");var r=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new a.EmptyStatement)):(this.expect(")"),e=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),n=this.parseIfClause())),this.finalize(t,new a.IfStatement(r,e,n))},e.prototype.parseDoWhileStatement=function(){var e=this.createNode();this.expectKeyword("do");var t=this.context.inIteration;this.context.inIteration=!0;var n=this.parseStatement();this.context.inIteration=t,this.expectKeyword("while"),this.expect("(");var r=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(e,new a.DoWhileStatement(n,r))},e.prototype.parseWhileStatement=function(){var e,t=this.createNode();this.expectKeyword("while"),this.expect("(");var n=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new a.EmptyStatement);else{this.expect(")");var r=this.context.inIteration;this.context.inIteration=!0,e=this.parseStatement(),this.context.inIteration=r}return this.finalize(t,new a.WhileStatement(n,e))},e.prototype.parseForStatement=function(){var e,t,n,r=null,i=null,s=null,c=!0,u=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){r=this.createNode(),this.nextToken();var d=this.context.allowIn;this.context.allowIn=!1;var h=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=d,1===h.length&&this.matchKeyword("in")){var f=h[0];f.init&&(f.id.type===l.Syntax.ArrayPattern||f.id.type===l.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(o.Messages.ForInOfLoopInitializer,"for-in"),r=this.finalize(r,new a.VariableDeclaration(h,"var")),this.nextToken(),e=r,t=this.parseExpression(),r=null}else 1===h.length&&null===h[0].init&&this.matchContextualKeyword("of")?(r=this.finalize(r,new a.VariableDeclaration(h,"var")),this.nextToken(),e=r,t=this.parseAssignmentExpression(),r=null,c=!1):(r=this.finalize(r,new a.VariableDeclaration(h,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){r=this.createNode();var p=this.nextToken().value;this.context.strict||"in"!==this.lookahead.value?(d=this.context.allowIn,this.context.allowIn=!1,h=this.parseBindingList(p,{inFor:!0}),this.context.allowIn=d,1===h.length&&null===h[0].init&&this.matchKeyword("in")?(r=this.finalize(r,new a.VariableDeclaration(h,p)),this.nextToken(),e=r,t=this.parseExpression(),r=null):1===h.length&&null===h[0].init&&this.matchContextualKeyword("of")?(r=this.finalize(r,new a.VariableDeclaration(h,p)),this.nextToken(),e=r,t=this.parseAssignmentExpression(),r=null,c=!1):(this.consumeSemicolon(),r=this.finalize(r,new a.VariableDeclaration(h,p)))):(r=this.finalize(r,new a.Identifier(p)),this.nextToken(),e=r,t=this.parseExpression(),r=null)}else{var m=this.lookahead;if(d=this.context.allowIn,this.context.allowIn=!1,r=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=d,this.matchKeyword("in"))this.context.isAssignmentTarget&&r.type!==l.Syntax.AssignmentExpression||this.tolerateError(o.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(r),e=r,t=this.parseExpression(),r=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&r.type!==l.Syntax.AssignmentExpression||this.tolerateError(o.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(r),e=r,t=this.parseAssignmentExpression(),r=null,c=!1;else{if(this.match(",")){for(var g=[r];this.match(",");)this.nextToken(),g.push(this.isolateCoverGrammar(this.parseAssignmentExpression));r=this.finalize(this.startNode(m),new a.SequenceExpression(g))}this.expect(";")}}if(void 0===e&&(this.match(";")||(i=this.parseExpression()),this.expect(";"),this.match(")")||(s=this.parseExpression())),!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),n=this.finalize(this.createNode(),new a.EmptyStatement);else{this.expect(")");var v=this.context.inIteration;this.context.inIteration=!0,n=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=v}return void 0===e?this.finalize(u,new a.ForStatement(r,i,s,n)):c?this.finalize(u,new a.ForInStatement(e,t,n)):this.finalize(u,new a.ForOfStatement(e,t,n))},e.prototype.parseContinueStatement=function(){var e=this.createNode();this.expectKeyword("continue");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier();t=n;var r="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)||this.throwError(o.Messages.UnknownLabel,n.name)}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.throwError(o.Messages.IllegalContinue),this.finalize(e,new a.ContinueStatement(t))},e.prototype.parseBreakStatement=function(){var e=this.createNode();this.expectKeyword("break");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier(),r="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)||this.throwError(o.Messages.UnknownLabel,n.name),t=n}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.context.inSwitch||this.throwError(o.Messages.IllegalBreak),this.finalize(e,new a.BreakStatement(t))},e.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(o.Messages.IllegalReturn);var e=this.createNode();this.expectKeyword("return");var t=(this.match(";")||this.match("}")||this.hasLineTerminator||2===this.lookahead.type)&&8!==this.lookahead.type&&10!==this.lookahead.type?null:this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new a.ReturnStatement(t))},e.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(o.Messages.StrictModeWith);var e,t=this.createNode();this.expectKeyword("with"),this.expect("(");var n=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new a.EmptyStatement)):(this.expect(")"),e=this.parseStatement()),this.finalize(t,new a.WithStatement(n,e))},e.prototype.parseSwitchCase=function(){var e,t=this.createNode();this.matchKeyword("default")?(this.nextToken(),e=null):(this.expectKeyword("case"),e=this.parseExpression()),this.expect(":");for(var n=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)n.push(this.parseStatementListItem());return this.finalize(t,new a.SwitchCase(e,n))},e.prototype.parseSwitchStatement=function(){var e=this.createNode();this.expectKeyword("switch"),this.expect("(");var t=this.parseExpression();this.expect(")");var n=this.context.inSwitch;this.context.inSwitch=!0;var r=[],i=!1;for(this.expect("{");!this.match("}");){var s=this.parseSwitchCase();null===s.test&&(i&&this.throwError(o.Messages.MultipleDefaultsInSwitch),i=!0),r.push(s)}return this.expect("}"),this.context.inSwitch=n,this.finalize(e,new a.SwitchStatement(t,r))},e.prototype.parseLabelledStatement=function(){var e,t=this.createNode(),n=this.parseExpression();if(n.type===l.Syntax.Identifier&&this.match(":")){this.nextToken();var r=n,i="$"+r.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,i)&&this.throwError(o.Messages.Redeclaration,"Label",r.name),this.context.labelSet[i]=!0;var s=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),s=this.parseClassDeclaration();else if(this.matchKeyword("function")){var c=this.lookahead,u=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(c,o.Messages.StrictFunction):u.generator&&this.tolerateUnexpectedToken(c,o.Messages.GeneratorInLegacyContext),s=u}else s=this.parseStatement();delete this.context.labelSet[i],e=new a.LabeledStatement(r,s)}else this.consumeSemicolon(),e=new a.ExpressionStatement(n);return this.finalize(t,e)},e.prototype.parseThrowStatement=function(){var e=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(o.Messages.NewlineAfterThrow);var t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new a.ThrowStatement(t))},e.prototype.parseCatchClause=function(){var e=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var t=[],n=this.parsePattern(t),r={},i=0;i0&&this.tolerateError(o.Messages.BadGetterArity);var r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new a.FunctionExpression(null,n.params,r,!1))},e.prototype.parseSetterMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();1!==n.params.length?this.tolerateError(o.Messages.BadSetterArity):n.params[0]instanceof a.RestElement&&this.tolerateError(o.Messages.BadSetterRestParameter);var r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new a.FunctionExpression(null,n.params,r,!1))},e.prototype.parseGeneratorMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();this.context.allowYield=!1;var r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new a.FunctionExpression(null,n.params,r,!0))},e.prototype.isStartOfExpression=function(){var e=!0,t=this.lookahead.value;switch(this.lookahead.type){case 7:e="["===t||"("===t||"{"===t||"+"===t||"-"===t||"!"===t||"~"===t||"++"===t||"--"===t||"/"===t||"/="===t;break;case 4:e="class"===t||"delete"===t||"function"===t||"let"===t||"new"===t||"super"===t||"this"===t||"typeof"===t||"void"===t||"yield"===t}return e},e.prototype.parseYieldExpression=function(){var e=this.createNode();this.expectKeyword("yield");var t=null,n=!1;if(!this.hasLineTerminator){var r=this.context.allowYield;this.context.allowYield=!1,(n=this.match("*"))?(this.nextToken(),t=this.parseAssignmentExpression()):this.isStartOfExpression()&&(t=this.parseAssignmentExpression()),this.context.allowYield=r}return this.finalize(e,new a.YieldExpression(t,n))},e.prototype.parseClassElement=function(e){var t=this.lookahead,n=this.createNode(),r="",i=null,s=null,l=!1,c=!1,u=!1,d=!1;if(this.match("*"))this.nextToken();else if(l=this.match("["),"static"===(i=this.parseObjectPropertyKey()).name&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(t=this.lookahead,u=!0,l=this.match("["),this.match("*")?this.nextToken():i=this.parseObjectPropertyKey()),3===t.type&&!this.hasLineTerminator&&"async"===t.value){var h=this.lookahead.value;":"!==h&&"("!==h&&"*"!==h&&(d=!0,t=this.lookahead,i=this.parseObjectPropertyKey(),3===t.type&&"constructor"===t.value&&this.tolerateUnexpectedToken(t,o.Messages.ConstructorIsAsync))}var f=this.qualifiedPropertyName(this.lookahead);return 3===t.type?"get"===t.value&&f?(r="get",l=this.match("["),i=this.parseObjectPropertyKey(),this.context.allowYield=!1,s=this.parseGetterMethod()):"set"===t.value&&f&&(r="set",l=this.match("["),i=this.parseObjectPropertyKey(),s=this.parseSetterMethod()):7===t.type&&"*"===t.value&&f&&(r="init",l=this.match("["),i=this.parseObjectPropertyKey(),s=this.parseGeneratorMethod(),c=!0),!r&&i&&this.match("(")&&(r="init",s=d?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0),r||this.throwUnexpectedToken(this.lookahead),"init"===r&&(r="method"),l||(u&&this.isPropertyKey(i,"prototype")&&this.throwUnexpectedToken(t,o.Messages.StaticPrototype),!u&&this.isPropertyKey(i,"constructor")&&(("method"!==r||!c||s&&s.generator)&&this.throwUnexpectedToken(t,o.Messages.ConstructorSpecialMethod),e.value?this.throwUnexpectedToken(t,o.Messages.DuplicateConstructor):e.value=!0,r="constructor")),this.finalize(n,new a.MethodDefinition(i,l,s,r,u))},e.prototype.parseClassElementList=function(){var e=[],t={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():e.push(this.parseClassElement(t));return this.expect("}"),e},e.prototype.parseClassBody=function(){var e=this.createNode(),t=this.parseClassElementList();return this.finalize(e,new a.ClassBody(t))},e.prototype.parseClassDeclaration=function(e){var t=this.createNode(),n=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var r=e&&3!==this.lookahead.type?null:this.parseVariableIdentifier(),i=null;this.matchKeyword("extends")&&(this.nextToken(),i=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var o=this.parseClassBody();return this.context.strict=n,this.finalize(t,new a.ClassDeclaration(r,i,o))},e.prototype.parseClassExpression=function(){var e=this.createNode(),t=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var n=3===this.lookahead.type?this.parseVariableIdentifier():null,r=null;this.matchKeyword("extends")&&(this.nextToken(),r=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var i=this.parseClassBody();return this.context.strict=t,this.finalize(e,new a.ClassExpression(n,r,i))},e.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;for(var e=this.createNode(),t=this.parseDirectivePrologues();2!==this.lookahead.type;)t.push(this.parseStatementListItem());return this.finalize(e,new a.Module(t))},e.prototype.parseScript=function(){for(var e=this.createNode(),t=this.parseDirectivePrologues();2!==this.lookahead.type;)t.push(this.parseStatementListItem());return this.finalize(e,new a.Script(t))},e.prototype.parseModuleSpecifier=function(){var e=this.createNode();8!==this.lookahead.type&&this.throwError(o.Messages.InvalidModuleSpecifier);var t=this.nextToken(),n=this.getTokenRaw(t);return this.finalize(e,new a.Literal(t.value,n))},e.prototype.parseImportSpecifier=function(){var e,t,n=this.createNode();return 3===this.lookahead.type?(t=e=this.parseVariableIdentifier(),this.matchContextualKeyword("as")&&(this.nextToken(),t=this.parseVariableIdentifier())):(t=e=this.parseIdentifierName(),this.matchContextualKeyword("as")?(this.nextToken(),t=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(n,new a.ImportSpecifier(t,e))},e.prototype.parseNamedImports=function(){this.expect("{");for(var e=[];!this.match("}");)e.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),e},e.prototype.parseImportDefaultSpecifier=function(){var e=this.createNode(),t=this.parseIdentifierName();return this.finalize(e,new a.ImportDefaultSpecifier(t))},e.prototype.parseImportNamespaceSpecifier=function(){var e=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(o.Messages.NoAsAfterImportNamespace),this.nextToken();var t=this.parseIdentifierName();return this.finalize(e,new a.ImportNamespaceSpecifier(t))},e.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(o.Messages.IllegalImportDeclaration);var e,t=this.createNode();this.expectKeyword("import");var n=[];if(8===this.lookahead.type)e=this.parseModuleSpecifier();else{if(this.match("{")?n=n.concat(this.parseNamedImports()):this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(n.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.match("{")?n=n.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var r=this.lookahead.value?o.Messages.UnexpectedToken:o.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}this.nextToken(),e=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(t,new a.ImportDeclaration(n,e))},e.prototype.parseExportSpecifier=function(){var e=this.createNode(),t=this.parseIdentifierName(),n=t;return this.matchContextualKeyword("as")&&(this.nextToken(),n=this.parseIdentifierName()),this.finalize(e,new a.ExportSpecifier(t,n))},e.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(o.Messages.IllegalExportDeclaration);var e,t=this.createNode();if(this.expectKeyword("export"),this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var n=this.parseFunctionDeclaration(!0);e=this.finalize(t,new a.ExportDefaultDeclaration(n))}else this.matchKeyword("class")?(n=this.parseClassDeclaration(!0),e=this.finalize(t,new a.ExportDefaultDeclaration(n))):this.matchContextualKeyword("async")?(n=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression(),e=this.finalize(t,new a.ExportDefaultDeclaration(n))):(this.matchContextualKeyword("from")&&this.throwError(o.Messages.UnexpectedToken,this.lookahead.value),n=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression(),this.consumeSemicolon(),e=this.finalize(t,new a.ExportDefaultDeclaration(n)));else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var r=this.lookahead.value?o.Messages.UnexpectedToken:o.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}this.nextToken();var i=this.parseModuleSpecifier();this.consumeSemicolon(),e=this.finalize(t,new a.ExportAllDeclaration(i))}else if(4===this.lookahead.type){switch(n=void 0,this.lookahead.value){case"let":case"const":n=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":n=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}e=this.finalize(t,new a.ExportNamedDeclaration(n,[],null))}else if(this.matchAsyncFunction())n=this.parseFunctionDeclaration(),e=this.finalize(t,new a.ExportNamedDeclaration(n,[],null));else{var s=[],l=null,c=!1;for(this.expect("{");!this.match("}");)c=c||this.matchKeyword("default"),s.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");this.expect("}"),this.matchContextualKeyword("from")?(this.nextToken(),l=this.parseModuleSpecifier(),this.consumeSemicolon()):c?(r=this.lookahead.value?o.Messages.UnexpectedToken:o.Messages.MissingFromClause,this.throwError(r,this.lookahead.value)):this.consumeSemicolon(),e=this.finalize(t,new a.ExportNamedDeclaration(null,s,l))}return e},e}();t.Parser=d},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assert=function(e,t){if(!e)throw new Error("ASSERT: "+t)}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this.errors=[],this.tolerant=!1}return e.prototype.recordError=function(e){this.errors.push(e)},e.prototype.tolerate=function(e){if(!this.tolerant)throw e;this.recordError(e)},e.prototype.constructError=function(e,t){var n=new Error(e);try{throw n}catch(e){Object.create&&Object.defineProperty&&(n=Object.create(e),Object.defineProperty(n,"column",{value:t}))}return n},e.prototype.createError=function(e,t,n,r){var i="Line "+t+": "+r,o=this.constructError(i,n);return o.index=e,o.lineNumber=t,o.description=r,o},e.prototype.throwError=function(e,t,n,r){throw this.createError(e,t,n,r)},e.prototype.tolerateError=function(e,t,n,r){var i=this.createError(e,t,n,r);if(!this.tolerant)throw i;this.recordError(i)},e}();t.ErrorHandler=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),i=n(4),o=n(11);function a(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function s(e){return"01234567".indexOf(e)}var l=function(){function e(e,t){this.source=e,this.errorHandler=t,this.trackComment=!1,this.isModule=!1,this.length=e.length,this.index=0,this.lineNumber=e.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return e.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},e.prototype.restoreState=function(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart},e.prototype.eof=function(){return this.index>=this.length},e.prototype.throwUnexpectedToken=function(e){return void 0===e&&(e=o.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.tolerateUnexpectedToken=function(e){void 0===e&&(e=o.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.skipSingleLineComment=function(e){var t,n,r=[];for(this.trackComment&&(r=[],t=this.index-e,n={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{}});!this.eof();){var o=this.source.charCodeAt(this.index);if(++this.index,i.Character.isLineTerminator(o)){if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart-1};var a={multiLine:!1,slice:[t+e,this.index-1],range:[t,this.index-1],loc:n};r.push(a)}return 13===o&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,r}}return this.trackComment&&(n.end={line:this.lineNumber,column:this.index-this.lineStart},a={multiLine:!1,slice:[t+e,this.index],range:[t,this.index],loc:n},r.push(a)),r},e.prototype.skipMultiLineComment=function(){var e,t,n=[];for(this.trackComment&&(n=[],e=this.index-2,t={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var r=this.source.charCodeAt(this.index);if(i.Character.isLineTerminator(r))13===r&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===r){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,this.trackComment){t.end={line:this.lineNumber,column:this.index-this.lineStart};var o={multiLine:!0,slice:[e+2,this.index-2],range:[e,this.index],loc:t};n.push(o)}return n}++this.index}else++this.index}return this.trackComment&&(t.end={line:this.lineNumber,column:this.index-this.lineStart},o={multiLine:!0,slice:[e+2,this.index],range:[e,this.index],loc:t},n.push(o)),this.tolerateUnexpectedToken(),n},e.prototype.scanComments=function(){var e;this.trackComment&&(e=[]);for(var t=0===this.index;!this.eof();){var n=this.source.charCodeAt(this.index);if(i.Character.isWhiteSpace(n))++this.index;else if(i.Character.isLineTerminator(n))++this.index,13===n&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t=!0;else if(47===n)if(47===(n=this.source.charCodeAt(this.index+1))){this.index+=2;var r=this.skipSingleLineComment(2);this.trackComment&&(e=e.concat(r)),t=!0}else{if(42!==n)break;this.index+=2,r=this.skipMultiLineComment(),this.trackComment&&(e=e.concat(r))}else if(t&&45===n){if(45!==this.source.charCodeAt(this.index+1)||62!==this.source.charCodeAt(this.index+2))break;this.index+=3,r=this.skipSingleLineComment(3),this.trackComment&&(e=e.concat(r))}else{if(60!==n||this.isModule)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;this.index+=4,r=this.skipSingleLineComment(4),this.trackComment&&(e=e.concat(r))}}return e},e.prototype.isFutureReservedWord=function(e){switch(e){case"enum":case"export":case"import":case"super":return!0;default:return!1}},e.prototype.isStrictModeReservedWord=function(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},e.prototype.isRestrictedWord=function(e){return"eval"===e||"arguments"===e},e.prototype.isKeyword=function(e){switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}},e.prototype.codePointAt=function(e){var t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){var n=this.source.charCodeAt(e+1);n>=56320&&n<=57343&&(t=1024*(t-55296)+n-56320+65536)}return t},e.prototype.scanHexEscape=function(e){for(var t="u"===e?4:2,n=0,r=0;r1114111||"}"!==e)&&this.throwUnexpectedToken(),i.Character.fromCodePoint(t)},e.prototype.getIdentifier=function(){for(var e=this.index++;!this.eof();){var t=this.source.charCodeAt(this.index);if(92===t)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!i.Character.isIdentifierPart(t))break;++this.index}return this.source.slice(e,this.index)},e.prototype.getComplexIdentifier=function(){var e,t=this.codePointAt(this.index),n=i.Character.fromCodePoint(t);for(this.index+=n.length,92===t&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,e=this.scanUnicodeCodePointEscape()):null!==(e=this.scanHexEscape("u"))&&"\\"!==e&&i.Character.isIdentifierStart(e.charCodeAt(0))||this.throwUnexpectedToken(),n=e);!this.eof()&&(t=this.codePointAt(this.index),i.Character.isIdentifierPart(t));)n+=e=i.Character.fromCodePoint(t),this.index+=e.length,92===t&&(n=n.substr(0,n.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,e=this.scanUnicodeCodePointEscape()):null!==(e=this.scanHexEscape("u"))&&"\\"!==e&&i.Character.isIdentifierPart(e.charCodeAt(0))||this.throwUnexpectedToken(),n+=e);return n},e.prototype.octalToDecimal=function(e){var t="0"!==e,n=s(e);return!this.eof()&&i.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,n=8*n+s(this.source[this.index++]),"0123".indexOf(e)>=0&&!this.eof()&&i.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+s(this.source[this.index++]))),{code:n,octal:t}},e.prototype.scanIdentifier=function(){var e,t=this.index,n=92===this.source.charCodeAt(t)?this.getComplexIdentifier():this.getIdentifier();if(3!=(e=1===n.length?3:this.isKeyword(n)?4:"null"===n?5:"true"===n||"false"===n?1:3)&&t+n.length!==this.index){var r=this.index;this.index=t,this.tolerateUnexpectedToken(o.Messages.InvalidEscapedReservedWord),this.index=r}return{type:e,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.scanPunctuator=function(){var e=this.index,t=this.source[this.index];switch(t){case"(":case"{":"{"===t&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,t="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:">>>="===(t=this.source.substr(this.index,4))?this.index+=4:"==="===(t=t.substr(0,3))||"!=="===t||">>>"===t||"<<="===t||">>="===t||"**="===t?this.index+=3:"&&"===(t=t.substr(0,2))||"||"===t||"=="===t||"!="===t||"+="===t||"-="===t||"*="===t||"/="===t||"++"===t||"--"===t||"<<"===t||">>"===t||"&="===t||"|="===t||"^="===t||"%="===t||"<="===t||">="===t||"=>"===t||"**"===t?this.index+=2:(t=this.source[this.index],"<>=!+-*%&|^/".indexOf(t)>=0&&++this.index)}return this.index===e&&this.throwUnexpectedToken(),{type:7,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanHexLiteral=function(e){for(var t="";!this.eof()&&i.Character.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),i.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+t,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanBinaryLiteral=function(e){for(var t,n="";!this.eof()&&("0"===(t=this.source[this.index])||"1"===t);)n+=this.source[this.index++];return 0===n.length&&this.throwUnexpectedToken(),this.eof()||(t=this.source.charCodeAt(this.index),(i.Character.isIdentifierStart(t)||i.Character.isDecimalDigit(t))&&this.throwUnexpectedToken()),{type:6,value:parseInt(n,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanOctalLiteral=function(e,t){var n="",r=!1;for(i.Character.isOctalDigit(e.charCodeAt(0))?(r=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&i.Character.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return r||0!==n.length||this.throwUnexpectedToken(),(i.Character.isIdentifierStart(this.source.charCodeAt(this.index))||i.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(n,8),octal:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.isImplicitOctalLiteral=function(){for(var e=this.index+1;e=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,(function(e,t,n){var i=parseInt(t||n,16);return i>1114111&&r.throwUnexpectedToken(o.Messages.InvalidRegExp),i<=65535?String.fromCharCode(i):"￿"})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"￿"));try{RegExp(n)}catch(e){this.throwUnexpectedToken(o.Messages.InvalidRegExp)}try{return new RegExp(e,t)}catch(e){return null}},e.prototype.scanRegExpBody=function(){var e=this.source[this.index];r.assert("/"===e,"Regular expression literal must start with a slash");for(var t=this.source[this.index++],n=!1,a=!1;!this.eof();)if(t+=e=this.source[this.index++],"\\"===e)e=this.source[this.index++],i.Character.isLineTerminator(e.charCodeAt(0))&&this.throwUnexpectedToken(o.Messages.UnterminatedRegExp),t+=e;else if(i.Character.isLineTerminator(e.charCodeAt(0)))this.throwUnexpectedToken(o.Messages.UnterminatedRegExp);else if(n)"]"===e&&(n=!1);else{if("/"===e){a=!0;break}"["===e&&(n=!0)}return a||this.throwUnexpectedToken(o.Messages.UnterminatedRegExp),t.substr(1,t.length-2)},e.prototype.scanRegExpFlags=function(){for(var e="";!this.eof();){var t=this.source[this.index];if(!i.Character.isIdentifierPart(t.charCodeAt(0)))break;if(++this.index,"\\"!==t||this.eof())e+=t;else if("u"===(t=this.source[this.index])){++this.index;var n=this.index,r=this.scanHexEscape("u");if(null!==r)for(e+=r;n=55296&&e<57343&&i.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},e}();t.Scanner=l},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenName={},t.TokenName[1]="Boolean",t.TokenName[2]="",t.TokenName[3]="Identifier",t.TokenName[4]="Keyword",t.TokenName[5]="Null",t.TokenName[6]="Numeric",t.TokenName[7]="Punctuator",t.TokenName[8]="String",t.TokenName[9]="RegularExpression",t.TokenName[10]="Template"},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",lang:"⟨",rang:"⟩"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(12),o=n(13),a=function(){function e(){this.values=[],this.curly=this.paren=-1}return e.prototype.beforeFunctionExpression=function(e){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(e)>=0},e.prototype.isRegexStart=function(){var e=this.values[this.values.length-1],t=null!==e;switch(e){case"this":case"]":t=!1;break;case")":var n=this.values[this.paren-1];t="if"===n||"while"===n||"for"===n||"with"===n;break;case"}":if(t=!1,"function"===this.values[this.curly-3])t=!!(r=this.values[this.curly-4])&&!this.beforeFunctionExpression(r);else if("function"===this.values[this.curly-4]){var r;t=!(r=this.values[this.curly-5])||!this.beforeFunctionExpression(r)}}return t},e.prototype.push=function(e){7===e.type||4===e.type?("{"===e.value?this.curly=this.values.length:"("===e.value&&(this.paren=this.values.length),this.values.push(e.value)):this.values.push(null)},e}(),s=function(){function e(e,t){this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=!!t&&"boolean"==typeof t.tolerant&&t.tolerant,this.scanner=new i.Scanner(e,this.errorHandler),this.scanner.trackComment=!!t&&"boolean"==typeof t.comment&&t.comment,this.trackRange=!!t&&"boolean"==typeof t.range&&t.range,this.trackLoc=!!t&&"boolean"==typeof t.loc&&t.loc,this.buffer=[],this.reader=new a}return e.prototype.errors=function(){return this.errorHandler.errors},e.prototype.getNextToken=function(){if(0===this.buffer.length){var e=this.scanner.scanComments();if(this.scanner.trackComment)for(var t=0;t{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){var a=o[i];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}},362:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n,r="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(n=t.cmp,function(e){return function(t,r){var i={key:t,value:e[t]},o={key:r,value:e[r]};return n(i,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var n,a;if(Array.isArray(t)){for(a="[",n=0;n{t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<>1,u=-7,d=n?i-1:0,h=n?-1:1,f=e[t+d];for(d+=h,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=256*o+e[t+d],d+=h,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+d],d+=h,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,l,c=8*o-i-1,u=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(t*l-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<0;e[n+f]=255&a,f+=p,a/=256,c-=8);e[n+f-p]|=128*m}},427:function(e,t){var n;!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,(function(r,i){"use strict";var o=[],a=Object.getPrototypeOf,s=o.slice,l=o.flat?function(e){return o.flat.call(e)}:function(e){return o.concat.apply([],e)},c=o.push,u=o.indexOf,d={},h=d.toString,f=d.hasOwnProperty,p=f.toString,m=p.call(Object),g={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},y=function(e){return null!=e&&e===e.window},b=r.document,x={type:!0,src:!0,nonce:!0,noModule:!0};function w(e,t,n){var r,i,o=(n=n||b).createElement("script");if(o.text=e,t)for(r in x)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function _(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?d[h.call(e)]||"object":typeof e}var k="3.5.1",E=function(e,t){return new E.fn.init(e,t)};function S(e){var t=!!e&&"length"in e&&e.length,n=_(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}E.fn=E.prototype={jquery:k,constructor:E,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=E.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return E.each(this,e)},map:function(e){return this.pushStack(E.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(E.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(E.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|"+j+")"+j+"*"),q=new RegExp(j+"|>"),V=new RegExp(B),G=new RegExp("^"+L+"$"),X={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+z),PSEUDO:new RegExp("^"+B),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+j+"*(even|odd|(([+-]|)(\\d*)n|)"+j+"*(?:([+-]|)"+j+"*(\\d+)|))"+j+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+j+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+j+"*((?:-\\d)?\\d*)"+j+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,J=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+j+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){h()},ae=xe((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{P.apply(O=N.call(w.childNodes),w.childNodes),O[w.childNodes.length].nodeType}catch(e){P={apply:O.length?function(e,t){M.apply(e,N.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(e,t,r,i){var o,s,c,u,d,p,v,y=t&&t.ownerDocument,w=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return r;if(!i&&(h(t),t=t||f,m)){if(11!==w&&(d=Q.exec(e)))if(o=d[1]){if(9===w){if(!(c=t.getElementById(o)))return r;if(c.id===o)return r.push(c),r}else if(y&&(c=y.getElementById(o))&&b(t,c)&&c.id===o)return r.push(c),r}else{if(d[2])return P.apply(r,t.getElementsByTagName(e)),r;if((o=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return P.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!D[e+" "]&&(!g||!g.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(v=e,y=t,1===w&&(q.test(e)||W.test(e))){for((y=ee.test(e)&&ve(t.parentNode)||t)===t&&n.scope||((u=t.getAttribute("id"))?u=u.replace(re,ie):t.setAttribute("id",u=x)),s=(p=a(e)).length;s--;)p[s]=(u?"#"+u:":scope")+" "+be(p[s]);v=p.join(",")}try{return P.apply(r,y.querySelectorAll(v)),r}catch(t){D(e,!0)}finally{u===x&&t.removeAttribute("id")}}}return l(e.replace(H,"$1"),t,r,i)}function le(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function ce(e){return e[x]=!0,e}function ue(e){var t=f.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function he(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return ce((function(t){return t=+t,ce((function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function ve(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},o=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},h=se.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!=f&&9===a.nodeType&&a.documentElement?(p=(f=a).documentElement,m=!o(f),w!=f&&(i=f.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ue((function(e){return p.appendChild(e).appendChild(f.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.attributes=ue((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ue((function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=Z.test(f.getElementsByClassName),n.getById=ue((function(e){return p.appendChild(e).id=x,!f.getElementsByName||!f.getElementsByName(x).length})),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},v=[],g=[],(n.qsa=Z.test(f.querySelectorAll))&&(ue((function(e){var t;p.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+j+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+j+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+x+"-]").length||g.push("~="),(t=f.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\["+j+"*name"+j+"*="+j+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),ue((function(e){e.innerHTML="";var t=f.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+j+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),p.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=Z.test(y=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ue((function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),v.push("!=",B)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),t=Z.test(p.compareDocumentPosition),b=t||Z.test(p.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},A=t?function(e,t){if(e===t)return d=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==f||e.ownerDocument==w&&b(w,e)?-1:t==f||t.ownerDocument==w&&b(w,t)?1:u?I(u,e)-I(u,t):0:4&r?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==f?-1:t==f?1:i?-1:o?1:u?I(u,e)-I(u,t):0;if(i===o)return he(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?he(a[r],s[r]):a[r]==w?-1:s[r]==w?1:0},f):f},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(h(e),n.matchesSelector&&m&&!D[t+" "]&&(!v||!v.test(t))&&(!g||!g.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){D(t,!0)}return se(t,f,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!=f&&h(e),b(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=f&&h(e);var i=r.attrHandle[t.toLowerCase()],o=i&&T.call(r.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,r=[],i=0,o=0;if(d=!n.detectDuplicates,u=!n.sortStable&&e.slice(0),e.sort(A),d){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return u=null,e},i=se.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},r=se.selectors={cacheLength:50,createPseudo:ce,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return X.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+j+")"+e+"("+j+"|$)"))&&E(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=se.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,h,f,p,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s,b=!1;if(g){if(o){for(;m;){for(h=t;h=h[m];)if(s?h.nodeName.toLowerCase()===v:1===h.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&y){for(b=(f=(c=(u=(d=(h=g)[x]||(h[x]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]||[])[0]===_&&c[1])&&c[2],h=f&&g.childNodes[f];h=++f&&h&&h[m]||(b=f=0)||p.pop();)if(1===h.nodeType&&++b&&h===t){u[e]=[_,f,b];break}}else if(y&&(b=f=(c=(u=(d=(h=t)[x]||(h[x]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]||[])[0]===_&&c[1]),!1===b)for(;(h=++f&&h&&h[m]||(b=f=0)||p.pop())&&((s?h.nodeName.toLowerCase()!==v:1!==h.nodeType)||!++b||(y&&((u=(d=h[x]||(h[x]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]=[_,b]),h!==t)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return i[x]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ce((function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=I(e,o[a])]=!(n[r]=o[a])})):function(e){return i(e,0,n)}):i}},pseudos:{not:ce((function(e){var t=[],n=[],r=s(e.replace(H,"$1"));return r[x]?ce((function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}})),has:ce((function(e){return function(t){return se(e,t).length>0}})),contains:ce((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||i(t)).indexOf(e)>-1}})),lang:ce((function(e){return G.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return K.test(e.nodeName)},input:function(e){return J.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ge((function(){return[0]})),last:ge((function(e,t){return[t-1]})),eq:ge((function(e,t,n){return[n<0?n+t:n]})),even:ge((function(e,t){for(var n=0;nt?t:n;--r>=0;)e.push(r);return e})),gt:ge((function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function _e(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;s-1&&(o[c]=!(a[c]=d))}}else v=_e(v===a?v.splice(p,v.length):v),i?i(null,a,v,l):P.apply(a,v)}))}function Ee(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],l=a?1:0,u=xe((function(e){return e===t}),s,!0),d=xe((function(e){return I(t,e)>-1}),s,!0),h=[function(e,n,r){var i=!a&&(r||n!==c)||((t=n).nodeType?u(e,n,r):d(e,n,r));return t=null,i}];l1&&we(h),l>1&&be(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(H,"$1"),n,l0,i=e.length>0,o=function(o,a,s,l,u){var d,p,g,v=0,y="0",b=o&&[],x=[],w=c,k=o||i&&r.find.TAG("*",u),E=_+=null==w?1:Math.random()||.1,S=k.length;for(u&&(c=a==f||a||u);y!==S&&null!=(d=k[y]);y++){if(i&&d){for(p=0,a||d.ownerDocument==f||(h(d),s=!m);g=e[p++];)if(g(d,a||f,s)){l.push(d);break}u&&(_=E)}n&&((d=!g&&d)&&v--,o&&b.push(d))}if(v+=y,n&&y!==v){for(p=0;g=t[p++];)g(b,x,a,s);if(o){if(v>0)for(;y--;)b[y]||x[y]||(x[y]=F.call(l));x=_e(x)}P.apply(l,x),u&&!o&&x.length>0&&v+t.length>1&&se.uniqueSort(l)}return u&&(_=E,c=w),b};return n?ce(o):o}(o,i)),s.selector=e}return s},l=se.select=function(e,t,n,i){var o,l,c,u,d,h="function"==typeof e&&e,f=!i&&a(e=h.selector||e);if(n=n||[],1===f.length){if((l=f[0]=f[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&9===t.nodeType&&m&&r.relative[l[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(te,ne),t)||[])[0]))return n;h&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(o=X.needsContext.test(e)?0:l.length;o--&&(c=l[o],!r.relative[u=c.type]);)if((d=r.find[u])&&(i=d(c.matches[0].replace(te,ne),ee.test(l[0].type)&&ve(t.parentNode)||t))){if(l.splice(o,1),!(e=i.length&&be(l)))return P.apply(n,i),n;break}}return(h||s(e,f))(i,t,!m,n,!t||ee.test(e)&&ve(t.parentNode)||t),n},n.sortStable=x.split("").sort(A).join("")===x,n.detectDuplicates=!!d,h(),n.sortDetached=ue((function(e){return 1&e.compareDocumentPosition(f.createElement("fieldset"))})),ue((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||de("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ue((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||de("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ue((function(e){return null==e.getAttribute("disabled")}))||de(R,(function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null})),se}(r);E.find=C,E.expr=C.selectors,E.expr[":"]=E.expr.pseudos,E.uniqueSort=E.unique=C.uniqueSort,E.text=C.getText,E.isXMLDoc=C.isXML,E.contains=C.contains,E.escapeSelector=C.escape;var D=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&E(e).is(n))break;r.push(e)}return r},A=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},T=E.expr.match.needsContext;function O(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var F=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function M(e,t,n){return v(t)?E.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?E.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?E.grep(e,(function(e){return u.call(t,e)>-1!==n})):E.filter(t,e,n)}E.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?E.find.matchesSelector(r,e)?[r]:[]:E.find.matches(e,E.grep(t,(function(e){return 1===e.nodeType})))},E.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(E(e).filter((function(){for(t=0;t1?E.uniqueSort(n):n},filter:function(e){return this.pushStack(M(this,e||[],!1))},not:function(e){return this.pushStack(M(this,e||[],!0))},is:function(e){return!!M(this,"string"==typeof e&&T.test(e)?E(e):e||[],!1).length}});var P,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(E.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||P,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:N.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof E?t[0]:t,E.merge(this,E.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:b,!0)),F.test(r[1])&&E.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=b.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(E):E.makeArray(e,this)}).prototype=E.fn,P=E(b);var I=/^(?:parents|prev(?:Until|All))/,R={children:!0,contents:!0,next:!0,prev:!0};function j(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}E.fn.extend({has:function(e){var t=E(e,this),n=t.length;return this.filter((function(){for(var e=0;e-1:1===n.nodeType&&E.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?E.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(E(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(E.uniqueSort(E.merge(this.get(),E(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),E.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return D(e,"parentNode")},parentsUntil:function(e,t,n){return D(e,"parentNode",n)},next:function(e){return j(e,"nextSibling")},prev:function(e){return j(e,"previousSibling")},nextAll:function(e){return D(e,"nextSibling")},prevAll:function(e){return D(e,"previousSibling")},nextUntil:function(e,t,n){return D(e,"nextSibling",n)},prevUntil:function(e,t,n){return D(e,"previousSibling",n)},siblings:function(e){return A((e.parentNode||{}).firstChild,e)},children:function(e){return A(e.firstChild)},contents:function(e){return null!=e.contentDocument&&a(e.contentDocument)?e.contentDocument:(O(e,"template")&&(e=e.content||e),E.merge([],e.childNodes))}},(function(e,t){E.fn[e]=function(n,r){var i=E.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=E.filter(r,i)),this.length>1&&(R[e]||E.uniqueSort(i),I.test(e)&&i.reverse()),this.pushStack(i)}}));var L=/[^\x20\t\r\n\f]+/g;function z(e){return e}function B(e){throw e}function $(e,t,n,r){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}E.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return E.each(e.match(L)||[],(function(e,n){t[n]=!0})),t}(e):E.extend({},e);var t,n,r,i,o=[],a=[],s=-1,l=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s-1;)o.splice(n,1),n<=s&&s--})),this},has:function(e){return e?E.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},E.extend({Deferred:function(e){var t=[["notify","progress",E.Callbacks("memory"),E.Callbacks("memory"),2],["resolve","done",E.Callbacks("once memory"),E.Callbacks("once memory"),0,"resolved"],["reject","fail",E.Callbacks("once memory"),E.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return E.Deferred((function(n){E.each(t,(function(t,r){var i=v(e[r[4]])&&e[r[4]];o[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&v(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(e,n,i){var o=0;function a(e,t,n,i){return function(){var s=this,l=arguments,c=function(){var r,c;if(!(e=o&&(n!==B&&(s=void 0,l=[r]),t.rejectWith(s,l))}};e?u():(E.Deferred.getStackHook&&(u.stackTrace=E.Deferred.getStackHook()),r.setTimeout(u))}}return E.Deferred((function(r){t[0][3].add(a(0,r,v(i)?i:z,r.notifyWith)),t[1][3].add(a(0,r,v(e)?e:z)),t[2][3].add(a(0,r,v(n)?n:B))})).promise()},promise:function(e){return null!=e?E.extend(e,i):i}},o={};return E.each(t,(function(e,r){var a=r[2],s=r[5];i[r[1]]=a.add,s&&a.add((function(){n=s}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(r[3].fire),o[r[0]]=function(){return o[r[0]+"With"](this===o?void 0:this,arguments),this},o[r[0]+"With"]=a.fireWith})),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=s.call(arguments),o=E.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?s.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&($(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||v(i[n]&&i[n].then)))return o.then();for(;n--;)$(i[n],a(n),o.reject);return o.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;E.Deferred.exceptionHook=function(e,t){r.console&&r.console.warn&&e&&H.test(e.name)&&r.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},E.readyException=function(e){r.setTimeout((function(){throw e}))};var U=E.Deferred();function W(){b.removeEventListener("DOMContentLoaded",W),r.removeEventListener("load",W),E.ready()}E.fn.ready=function(e){return U.then(e).catch((function(e){E.readyException(e)})),this},E.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--E.readyWait:E.isReady)||(E.isReady=!0,!0!==e&&--E.readyWait>0||U.resolveWith(b,[E]))}}),E.ready.then=U.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?r.setTimeout(E.ready):(b.addEventListener("DOMContentLoaded",W),r.addEventListener("load",W));var q=function(e,t,n,r,i,o,a){var s=0,l=e.length,c=null==n;if("object"===_(n))for(s in i=!0,n)q(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,v(r)||(a=!0),c&&(a?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(E(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each((function(){Q.remove(this,e)}))}}),E.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Z.get(e,t),n&&(!r||Array.isArray(n)?r=Z.access(e,t,E.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=E.queue(e,t),r=n.length,i=n.shift(),o=E._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){E.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Z.get(e,n)||Z.access(e,n,{empty:E.Callbacks("once memory").add((function(){Z.remove(e,[t+"queue",n])}))})}}),E.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,ye=/^$|^module$|\/(?:java|ecma)script/i;pe=b.createDocumentFragment().appendChild(b.createElement("div")),(me=b.createElement("input")).setAttribute("type","radio"),me.setAttribute("checked","checked"),me.setAttribute("name","t"),pe.appendChild(me),g.checkClone=pe.cloneNode(!0).cloneNode(!0).lastChild.checked,pe.innerHTML="",g.noCloneChecked=!!pe.cloneNode(!0).lastChild.defaultValue,pe.innerHTML="",g.option=!!pe.lastChild;var be={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function xe(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&O(e,t)?E.merge([e],n):n}function we(e,t){for(var n=0,r=e.length;n",""]);var _e=/<|&#?\w+;/;function ke(e,t,n,r,i){for(var o,a,s,l,c,u,d=t.createDocumentFragment(),h=[],f=0,p=e.length;f-1)i&&i.push(o);else if(c=se(o),a=xe(d.appendChild(o),"script"),c&&we(a),n)for(u=0;o=a[u++];)ye.test(o.type||"")&&n.push(o);return d}var Ee=/^key/,Se=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function De(){return!0}function Ae(){return!1}function Te(e,t){return e===function(){try{return b.activeElement}catch(e){}}()==("focus"===t)}function Oe(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Oe(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ae;else if(!i)return e;return 1===o&&(a=i,i=function(e){return E().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=E.guid++)),e.each((function(){E.event.add(this,t,i,r,n)}))}function Fe(e,t,n){n?(Z.set(e,t,!1),E.event.add(e,t,{namespace:!1,handler:function(e){var r,i,o=Z.get(this,t);if(1&e.isTrigger&&this[t]){if(o.length)(E.event.special[t]||{}).delegateType&&e.stopPropagation();else if(o=s.call(arguments),Z.set(this,t,o),r=n(this,t),this[t](),o!==(i=Z.get(this,t))||r?Z.set(this,t,!1):i={},o!==i)return e.stopImmediatePropagation(),e.preventDefault(),i.value}else o.length&&(Z.set(this,t,{value:E.event.trigger(E.extend(o[0],E.Event.prototype),o.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Z.get(e,t)&&E.event.add(e,t,De)}E.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,c,u,d,h,f,p,m,g=Z.get(e);if(J(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&E.find.matchesSelector(ae,i),n.guid||(n.guid=E.guid++),(l=g.events)||(l=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(t){return void 0!==E&&E.event.triggered!==t.type?E.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(L)||[""]).length;c--;)f=m=(s=Ce.exec(t[c])||[])[1],p=(s[2]||"").split(".").sort(),f&&(d=E.event.special[f]||{},f=(i?d.delegateType:d.bindType)||f,d=E.event.special[f]||{},u=E.extend({type:f,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&E.expr.match.needsContext.test(i),namespace:p.join(".")},o),(h=l[f])||((h=l[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,p,a)||e.addEventListener&&e.addEventListener(f,a)),d.add&&(d.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),i?h.splice(h.delegateCount++,0,u):h.push(u),E.event.global[f]=!0)},remove:function(e,t,n,r,i){var o,a,s,l,c,u,d,h,f,p,m,g=Z.hasData(e)&&Z.get(e);if(g&&(l=g.events)){for(c=(t=(t||"").match(L)||[""]).length;c--;)if(f=m=(s=Ce.exec(t[c])||[])[1],p=(s[2]||"").split(".").sort(),f){for(d=E.event.special[f]||{},h=l[f=(r?d.delegateType:d.bindType)||f]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=h.length;o--;)u=h[o],!i&&m!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(h.splice(o,1),u.selector&&h.delegateCount--,d.remove&&d.remove.call(e,u));a&&!h.length&&(d.teardown&&!1!==d.teardown.call(e,p,g.handle)||E.removeEvent(e,f,g.handle),delete l[f])}else for(f in l)E.event.remove(e,f+t[c],n,r,!0);E.isEmptyObject(l)&&Z.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),l=E.event.fix(e),c=(Z.get(this,"events")||Object.create(null))[l.type]||[],u=E.event.special[l.type]||{};for(s[0]=l,t=1;t=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(o=[],a={},n=0;n-1:E.find(i,this,null,[c]).length),a[i]&&o.push(r);o.length&&s.push({elem:c,handlers:o})}return c=this,l\s*$/g;function Ie(e,t){return O(e,"table")&&O(11!==t.nodeType?t:t.firstChild,"tr")&&E(e).children("tbody")[0]||e}function Re(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function je(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Z.hasData(e)&&(s=Z.get(e).events))for(i in Z.remove(t,"handle events"),s)for(n=0,r=s[i].length;n1&&"string"==typeof p&&!g.checkClone&&Pe.test(p))return e.each((function(i){var o=e.eq(i);m&&(t[0]=p.call(this,i,o.html())),Be(o,t,n,r)}));if(h&&(o=(i=ke(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(s=(a=E.map(xe(i,"script"),Re)).length;d0&&we(a,!l&&xe(e,"script")),s},cleanData:function(e){for(var t,n,r,i=E.event.special,o=0;void 0!==(n=e[o]);o++)if(J(n)){if(t=n[Z.expando]){if(t.events)for(r in t.events)i[r]?E.event.remove(n,r):E.removeEvent(n,r,t.handle);n[Z.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),E.fn.extend({detach:function(e){return $e(this,e,!0)},remove:function(e){return $e(this,e)},text:function(e){return q(this,(function(e){return void 0===e?E.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Be(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ie(this,e).appendChild(e)}))},prepend:function(){return Be(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ie(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Be(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Be(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(E.cleanData(xe(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return E.clone(this,e,t)}))},html:function(e){return q(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Me.test(e)&&!be[(ve.exec(e)||["",""])[1].toLowerCase()]){e=E.htmlPrefilter(e);try{for(;n3,ae.removeChild(e)),s}}))}();var Xe=["Webkit","Moz","ms"],Ye=b.createElement("div").style,Je={};function Ke(e){return E.cssProps[e]||Je[e]||(e in Ye?e:Je[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=Xe.length;n--;)if((e=Xe[n]+t)in Ye)return e}(e)||e)}var Ze=/^(none|table(?!-c[ea]).+)/,Qe=/^--/,et={position:"absolute",visibility:"hidden",display:"block"},tt={letterSpacing:"0",fontWeight:"400"};function nt(e,t,n){var r=ie.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function rt(e,t,n,r,i,o){var a="width"===t?1:0,s=0,l=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=E.css(e,n+oe[a],!0,i)),r?("content"===n&&(l-=E.css(e,"padding"+oe[a],!0,i)),"margin"!==n&&(l-=E.css(e,"border"+oe[a]+"Width",!0,i))):(l+=E.css(e,"padding"+oe[a],!0,i),"padding"!==n?l+=E.css(e,"border"+oe[a]+"Width",!0,i):s+=E.css(e,"border"+oe[a]+"Width",!0,i));return!r&&o>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-s-.5))||0),l}function it(e,t,n){var r=Ue(e),i=(!g.boxSizingReliable()||n)&&"border-box"===E.css(e,"boxSizing",!1,r),o=i,a=Ve(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(He.test(a)){if(!n)return a;a="auto"}return(!g.boxSizingReliable()&&i||!g.reliableTrDimensions()&&O(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===E.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===E.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+rt(e,t,n||(i?"border":"content"),o,r,a)+"px"}function ot(e,t,n,r,i){return new ot.prototype.init(e,t,n,r,i)}E.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ve(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=Y(t),l=Qe.test(t),c=e.style;if(l||(t=Ke(s)),a=E.cssHooks[t]||E.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:c[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=i&&i[3]||(E.cssNumber[s]?"":"px")),g.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(l?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,r){var i,o,a,s=Y(t);return Qe.test(t)||(t=Ke(s)),(a=E.cssHooks[t]||E.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Ve(e,t,r)),"normal"===i&&t in tt&&(i=tt[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),E.each(["height","width"],(function(e,t){E.cssHooks[t]={get:function(e,n,r){if(n)return!Ze.test(E.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?it(e,t,r):We(e,et,(function(){return it(e,t,r)}))},set:function(e,n,r){var i,o=Ue(e),a=!g.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===E.css(e,"boxSizing",!1,o),l=r?rt(e,t,r,s,o):0;return s&&a&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-rt(e,t,"border",!1,o)-.5)),l&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=E.css(e,t)),nt(0,n,l)}}})),E.cssHooks.marginLeft=Ge(g.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Ve(e,"marginLeft"))||e.getBoundingClientRect().left-We(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),E.each({margin:"",padding:"",border:"Width"},(function(e,t){E.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(E.cssHooks[e+t].set=nt)})),E.fn.extend({css:function(e,t){return q(this,(function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ue(e),i=t.length;a1)}}),E.Tween=ot,ot.prototype={constructor:ot,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||E.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(E.cssNumber[n]?"":"px")},cur:function(){var e=ot.propHooks[this.prop];return e&&e.get?e.get(this):ot.propHooks._default.get(this)},run:function(e){var t,n=ot.propHooks[this.prop];return this.options.duration?this.pos=t=E.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ot.propHooks._default.set(this),this}},ot.prototype.init.prototype=ot.prototype,ot.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=E.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){E.fx.step[e.prop]?E.fx.step[e.prop](e):1!==e.elem.nodeType||!E.cssHooks[e.prop]&&null==e.elem.style[Ke(e.prop)]?e.elem[e.prop]=e.now:E.style(e.elem,e.prop,e.now+e.unit)}}},ot.propHooks.scrollTop=ot.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},E.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},E.fx=ot.prototype.init,E.fx.step={};var at,st,lt=/^(?:toggle|show|hide)$/,ct=/queueHooks$/;function ut(){st&&(!1===b.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(ut):r.setTimeout(ut,E.fx.interval),E.fx.tick())}function dt(){return r.setTimeout((function(){at=void 0})),at=Date.now()}function ht(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ft(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each((function(){E.removeAttr(this,e)}))}}),E.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?E.prop(e,t,n):(1===o&&E.isXMLDoc(e)||(i=E.attrHooks[t.toLowerCase()]||(E.expr.match.bool.test(t)?mt:void 0)),void 0!==n?null===n?void E.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=E.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!g.radioValue&&"radio"===t&&O(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(L);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),mt={set:function(e,t,n){return!1===t?E.removeAttr(e,n):e.setAttribute(n,n),n}},E.each(E.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=gt[t]||E.find.attr;gt[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=gt[a],gt[a]=i,i=null!=n(e,t,r)?a:null,gt[a]=o),i}}));var vt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;function bt(e){return(e.match(L)||[]).join(" ")}function xt(e){return e.getAttribute&&e.getAttribute("class")||""}function wt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(L)||[]}E.fn.extend({prop:function(e,t){return q(this,E.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[E.propFix[e]||e]}))}}),E.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&E.isXMLDoc(e)||(t=E.propFix[t]||t,i=E.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=E.find.attr(e,"tabindex");return t?parseInt(t,10):vt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(E.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),E.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){E.propFix[this.toLowerCase()]=this})),E.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,l=0;if(v(e))return this.each((function(t){E(this).addClass(e.call(this,t,xt(this)))}));if((t=wt(e)).length)for(;n=this[l++];)if(i=xt(n),r=1===n.nodeType&&" "+bt(i)+" "){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=bt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,l=0;if(v(e))return this.each((function(t){E(this).removeClass(e.call(this,t,xt(this)))}));if(!arguments.length)return this.attr("class","");if((t=wt(e)).length)for(;n=this[l++];)if(i=xt(n),r=1===n.nodeType&&" "+bt(i)+" "){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(s=bt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):v(e)?this.each((function(n){E(this).toggleClass(e.call(this,n,xt(this),t),t)})):this.each((function(){var t,i,o,a;if(r)for(i=0,o=E(this),a=wt(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=xt(this))&&Z.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Z.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+bt(xt(n))+" ").indexOf(t)>-1)return!0;return!1}});var _t=/\r/g;E.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=v(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,E(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=E.map(i,(function(e){return null==e?"":e+""}))),(t=E.valHooks[this.type]||E.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=E.valHooks[i.type]||E.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(_t,""):null==n?"":n:void 0}}),E.extend({valHooks:{option:{get:function(e){var t=E.find.attr(e,"value");return null!=t?t:bt(E.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?o+1:i.length;for(r=o<0?l:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),E.each(["radio","checkbox"],(function(){E.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=E.inArray(E(e).val(),t)>-1}},g.checkOn||(E.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),g.focusin="onfocusin"in r;var kt=/^(?:focusinfocus|focusoutblur)$/,Et=function(e){e.stopPropagation()};E.extend(E.event,{trigger:function(e,t,n,i){var o,a,s,l,c,u,d,h,p=[n||b],m=f.call(e,"type")?e.type:e,g=f.call(e,"namespace")?e.namespace.split("."):[];if(a=h=s=n=n||b,3!==n.nodeType&&8!==n.nodeType&&!kt.test(m+E.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),c=m.indexOf(":")<0&&"on"+m,(e=e[E.expando]?e:new E.Event(m,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=g.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:E.makeArray(t,[e]),d=E.event.special[m]||{},i||!d.trigger||!1!==d.trigger.apply(n,t))){if(!i&&!d.noBubble&&!y(n)){for(l=d.delegateType||m,kt.test(l+m)||(a=a.parentNode);a;a=a.parentNode)p.push(a),s=a;s===(n.ownerDocument||b)&&p.push(s.defaultView||s.parentWindow||r)}for(o=0;(a=p[o++])&&!e.isPropagationStopped();)h=a,e.type=o>1?l:d.bindType||m,(u=(Z.get(a,"events")||Object.create(null))[e.type]&&Z.get(a,"handle"))&&u.apply(a,t),(u=c&&a[c])&&u.apply&&J(a)&&(e.result=u.apply(a,t),!1===e.result&&e.preventDefault());return e.type=m,i||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),t)||!J(n)||c&&v(n[m])&&!y(n)&&((s=n[c])&&(n[c]=null),E.event.triggered=m,e.isPropagationStopped()&&h.addEventListener(m,Et),n[m](),e.isPropagationStopped()&&h.removeEventListener(m,Et),E.event.triggered=void 0,s&&(n[c]=s)),e.result}},simulate:function(e,t,n){var r=E.extend(new E.Event,n,{type:e,isSimulated:!0});E.event.trigger(r,null,t)}}),E.fn.extend({trigger:function(e,t){return this.each((function(){E.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return E.event.trigger(e,t,n,!0)}}),g.focusin||E.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){E.event.simulate(t,e.target,E.event.fix(e))};E.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=Z.access(r,t);i||r.addEventListener(e,n,!0),Z.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=Z.access(r,t)-1;i?Z.access(r,t,i):(r.removeEventListener(e,n,!0),Z.remove(r,t))}}}));var St=r.location,Ct={guid:Date.now()},Dt=/\?/;E.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new r.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||E.error("Invalid XML: "+e),t};var At=/\[\]$/,Tt=/\r?\n/g,Ot=/^(?:submit|button|image|reset|file)$/i,Ft=/^(?:input|select|textarea|keygen)/i;function Mt(e,t,n,r){var i;if(Array.isArray(t))E.each(t,(function(t,i){n||At.test(e)?r(e,i):Mt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==_(t))r(e,t);else for(i in t)Mt(e+"["+i+"]",t[i],n,r)}E.param=function(e,t){var n,r=[],i=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!E.isPlainObject(e))E.each(e,(function(){i(this.name,this.value)}));else for(n in e)Mt(n,e[n],t,i);return r.join("&")},E.fn.extend({serialize:function(){return E.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=E.prop(this,"elements");return e?E.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!E(this).is(":disabled")&&Ft.test(this.nodeName)&&!Ot.test(e)&&(this.checked||!ge.test(e))})).map((function(e,t){var n=E(this).val();return null==n?null:Array.isArray(n)?E.map(n,(function(e){return{name:t.name,value:e.replace(Tt,"\r\n")}})):{name:t.name,value:n.replace(Tt,"\r\n")}})).get()}});var Pt=/%20/g,Nt=/#.*$/,It=/([?&])_=[^&]*/,Rt=/^(.*?):[ \t]*([^\r\n]*)$/gm,jt=/^(?:GET|HEAD)$/,Lt=/^\/\//,zt={},Bt={},$t="*/".concat("*"),Ht=b.createElement("a");function Ut(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(L)||[];if(v(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Wt(e,t,n,r){var i={},o=e===Bt;function a(s){var l;return i[s]=!0,E.each(e[s]||[],(function(e,s){var c=s(t,n,r);return"string"!=typeof c||o||i[c]?o?!(l=c):void 0:(t.dataTypes.unshift(c),a(c),!1)})),l}return a(t.dataTypes[0])||!i["*"]&&a("*")}function qt(e,t){var n,r,i=E.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&E.extend(!0,e,r),e}Ht.href=St.href,E.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:St.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(St.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":E.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?qt(qt(e,E.ajaxSettings),t):qt(E.ajaxSettings,e)},ajaxPrefilter:Ut(zt),ajaxTransport:Ut(Bt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,i,o,a,s,l,c,u,d,h,f=E.ajaxSetup({},t),p=f.context||f,m=f.context&&(p.nodeType||p.jquery)?E(p):E.event,g=E.Deferred(),v=E.Callbacks("once memory"),y=f.statusCode||{},x={},w={},_="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(c){if(!a)for(a={};t=Rt.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(e,t){return null==c&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==c&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)k.always(e[k.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||_;return n&&n.abort(t),S(0,t),this}};if(g.promise(k),f.url=((e||f.url||St.href)+"").replace(Lt,St.protocol+"//"),f.type=t.method||t.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(L)||[""],null==f.crossDomain){l=b.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Ht.protocol+"//"+Ht.host!=l.protocol+"//"+l.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=E.param(f.data,f.traditional)),Wt(zt,f,t,k),c)return k;for(d in(u=E.event&&f.global)&&0==E.active++&&E.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!jt.test(f.type),i=f.url.replace(Nt,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Pt,"+")):(h=f.url.slice(i.length),f.data&&(f.processData||"string"==typeof f.data)&&(i+=(Dt.test(i)?"&":"?")+f.data,delete f.data),!1===f.cache&&(i=i.replace(It,"$1"),h=(Dt.test(i)?"&":"?")+"_="+Ct.guid+++h),f.url=i+h),f.ifModified&&(E.lastModified[i]&&k.setRequestHeader("If-Modified-Since",E.lastModified[i]),E.etag[i]&&k.setRequestHeader("If-None-Match",E.etag[i])),(f.data&&f.hasContent&&!1!==f.contentType||t.contentType)&&k.setRequestHeader("Content-Type",f.contentType),k.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+$t+"; q=0.01":""):f.accepts["*"]),f.headers)k.setRequestHeader(d,f.headers[d]);if(f.beforeSend&&(!1===f.beforeSend.call(p,k,f)||c))return k.abort();if(_="abort",v.add(f.complete),k.done(f.success),k.fail(f.error),n=Wt(Bt,f,t,k)){if(k.readyState=1,u&&m.trigger("ajaxSend",[k,f]),c)return k;f.async&&f.timeout>0&&(s=r.setTimeout((function(){k.abort("timeout")}),f.timeout));try{c=!1,n.send(x,S)}catch(e){if(c)throw e;S(-1,e)}}else S(-1,"No Transport");function S(e,t,a,l){var d,h,b,x,w,_=t;c||(c=!0,s&&r.clearTimeout(s),n=void 0,o=l||"",k.readyState=e>0?4:0,d=e>=200&&e<300||304===e,a&&(x=function(e,t,n){for(var r,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}(f,k,a)),!d&&E.inArray("script",f.dataTypes)>-1&&(f.converters["text script"]=function(){}),x=function(e,t,n,r){var i,o,a,s,l,c={},u=e.dataTypes.slice();if(u[1])for(a in e.converters)c[a.toLowerCase()]=e.converters[a];for(o=u.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=u.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=c[l+" "+o]||c["* "+o]))for(i in c)if((s=i.split(" "))[1]===o&&(a=c[l+" "+s[0]]||c["* "+s[0]])){!0===a?a=c[i]:!0!==c[i]&&(o=s[0],u.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(f,x,k,d),d?(f.ifModified&&((w=k.getResponseHeader("Last-Modified"))&&(E.lastModified[i]=w),(w=k.getResponseHeader("etag"))&&(E.etag[i]=w)),204===e||"HEAD"===f.type?_="nocontent":304===e?_="notmodified":(_=x.state,h=x.data,d=!(b=x.error))):(b=_,!e&&_||(_="error",e<0&&(e=0))),k.status=e,k.statusText=(t||_)+"",d?g.resolveWith(p,[h,_,k]):g.rejectWith(p,[k,_,b]),k.statusCode(y),y=void 0,u&&m.trigger(d?"ajaxSuccess":"ajaxError",[k,f,d?h:b]),v.fireWith(p,[k,_]),u&&(m.trigger("ajaxComplete",[k,f]),--E.active||E.event.trigger("ajaxStop")))}return k},getJSON:function(e,t,n){return E.get(e,t,n,"json")},getScript:function(e,t){return E.get(e,void 0,t,"script")}}),E.each(["get","post"],(function(e,t){E[t]=function(e,n,r,i){return v(n)&&(i=i||r,r=n,n=void 0),E.ajax(E.extend({url:e,type:t,dataType:i,data:n,success:r},E.isPlainObject(e)&&e))}})),E.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),E._evalUrl=function(e,t,n){return E.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){E.globalEval(e,t,n)}})},E.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=E(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return v(e)?this.each((function(t){E(this).wrapInner(e.call(this,t))})):this.each((function(){var t=E(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=v(e);return this.each((function(n){E(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){E(this).replaceWith(this.childNodes)})),this}}),E.expr.pseudos.hidden=function(e){return!E.expr.pseudos.visible(e)},E.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},E.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Gt=E.ajaxSettings.xhr();g.cors=!!Gt&&"withCredentials"in Gt,g.ajax=Gt=!!Gt,E.ajaxTransport((function(e){var t,n;if(g.cors||Gt&&!e.crossDomain)return{send:function(i,o){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];for(a in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);t=function(e){return function(){t&&(t=n=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),n=s.onerror=s.ontimeout=t("error"),void 0!==s.onabort?s.onabort=n:s.onreadystatechange=function(){4===s.readyState&&r.setTimeout((function(){t&&n()}))},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),E.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),E.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return E.globalEval(e),e}}}),E.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),E.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=E("