{"version":3,"file":"themes/parachute/assets/js/dist/theme.min.js","sources":["node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","node_modules/@babel/runtime/helpers/esm/slicedToArray.js","node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","themes/parachute/assets/js/src/theme.js"],"sourcesContent":["export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","/* globals jQuery, google, cssMarker */\njQuery( $ => {\n\tconst { ajax, each, fn } = $;\n\tconst { language = '', fetchurl = '', searchurl = '' } = window.PARACHUTE || {};\n\n\tconst $window = $( window );\n\tconst $document = $( document );\n\tconst $thePage = $( 'html, body' );\n\tconst $body = $( 'body' );\n\n\tconst topMargin = $body.hasClass( 'admin-bar' ) ? 32 : 0;\n\tconst hasPageNav = $( '.page-nav' ).length > 0;\n\n\t// =========================\n\t// ! Supports Flagging\n\t// =========================\n\n\t$body.removeClass( 'no-js' ).addClass( 'js' );\n\n\t$document\n\t\t.on( 'touchstart', function() {\n\t\t\t$body.removeClass( 'notouch' ).addClass( 'touch' );\n\t\t} )\n\t\t.on( 'mousedown', function() {\n\t\t\t$body.addClass( 'using-mouse' );\n\t\t} )\n\t\t.on( 'keydown', function() {\n\t\t\t$body.removeClass( 'using-mouse' );\n\t\t} );\n\n\t// =========================\n\t// ! Utilities\n\t// =========================\n\n\t// Dirt cheap classList polyfill\n\tfunction ClassList( el ) {\n\t\tconst classes = el.className.split( /\\s+/ );\n\n\t\tfor ( let i = 0; i < classes.length; i++ ) {\n\t\t\tthis[ i ] = classes[ i ];\n\t\t}\n\n\t\tthis.length = classes.length;\n\n\t\tthis.remove = className => {\n\t\t\tel.className = el.className.replace( new RegExp( '(^|\\\\b)' + className.split( ' ' ).join( '|' ) + '(\\\\b|$)', 'gi' ), ' ' );\n\t\t};\n\n\t\tthis.add = className => {\n\t\t\tel.className += ' ' + className;\n\t\t};\n\t}\n\n\tfn.setFlagClass = function( flag, value ) {\n\t\treturn $( this ).each( function() {\n\t\t\tconst classes = this.classList || new ClassList( this );\n\n\t\t\t// Remove the old class\n\t\t\tfor ( let i = 0; i < classes.length; i++ ) {\n\t\t\t\tconst className = classes[ i ];\n\t\t\t\tif ( className.indexOf( `${ flag }-` ) === 0 ) {\n\t\t\t\t\tclasses.remove( className );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add the new one if value is set\n\t\t\tif ( value ) {\n\t\t\t\tclasses.add( `${ flag }-${ value }` );\n\t\t\t}\n\t\t} );\n\t};\n\n\t// Hit ESC to jump to login page\n\t$document.keyup( event => {\n\t\tif ( typeof document.activeElement.value !== 'undefined' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.key === 'Escape' || event.key === 'Esc' ) {\n\t\t\twindow.location = '/backend/';\n\t\t}\n\t} );\n\n\t// Wrappers as link\n\t$body.on( 'click', '[data-href]', function( e ) {\n\t\tif ( e.target.nodeName === 'a' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst url = $( this ).data( 'href' );\n\t\tconst target = url.indexOf( window.location.origin ) === 0 ? '_self' : '_blank';\n\n\t\twindow.open( url, target );\n\t} );\n\n\t// =========================\n\t// ! Page Structure\n\t// =========================\n\n\t$( '.-content' ).each( function() {\n\t\t$( this ).find( 'h2' ).each( function() {\n\t\t\tconst wrapper = document.createElement( 'div' );\n\n\t\t\twrapper.id = this.id;\n\t\t\twrapper.className = 'section';\n\t\t\tthis.removeAttribute( 'id' );\n\n\t\t\t$( this ).add( $( this ).nextUntil( 'h2' ) ).wrapAll( wrapper );\n\t\t} );\n\t} );\n\n\t// =========================\n\t// ! Image Loading\n\t// =========================\n\n\t$( '[data-background]' ).each( function() {\n\t\tconst $elm = $( this );\n\t\tconst pixel = $elm.data( 'pixel' ),\n\t\t\tbackground = $elm.data( 'background' );\n\n\t\tconst $pixel = $( document.createElement( 'img' ) );\n\n\t\t$pixel.attr( 'src', `data:image/png;base64,${ pixel }` ).addClass( 'pixel' ).appendTo( $elm );\n\n\t\tconst img = new Image();\n\n\t\tconst start = Date.now();\n\t\timg.onload = function() {\n\t\t\t$elm.css( 'background-image', `url(${ background })` );\n\t\t\t$elm.removeClass( 'pixel' );\n\n\t\t\tif ( Date.now() - start > 100 ) {\n\t\t\t\t$pixel.fadeOut( 300, () => $pixel.remove() );\n\t\t\t} else {\n\t\t\t\t$pixel.remove();\n\t\t\t}\n\t\t};\n\n\t\timg.src = background;\n\n\t\t$elm.removeAttr( 'data-pixel' );\n\t\t$elm.removeAttr( 'data-background' );\n\t} );\n\n\t// =========================\n\t// ! Scroll Handling\n\t// =========================\n\n\t// ScrollTo\n\t$body.on( 'click', 'a[href^=\"#\"]', function( e ) {\n\t\t// Do nothing if a #! link\n\t\tif ( $( this ).attr( 'href' ).indexOf( '#!' ) === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\n\t\t// Skip if toggle\n\t\tif ( $( this ).hasClass( 'toggle' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst target = $( this ).attr( 'href' ) || '';\n\n\t\tlet top = 0;\n\t\tif ( target.length > 1 ) {\n\t\t\tconst $target = $( target );\n\t\t\tif ( $target.hasClass( 'panel' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( $target && $target.length > 0 ) {\n\t\t\t\ttop = $target.offset().top - topMargin;\n\n\t\t\t\tif ( hasPageNav ) {\n\t\t\t\t\ttop -= 100;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$thePage.animate( { scrollTop: top } );\n\t} );\n\n\t// Scroll Spy\n\tif ( typeof IntersectionObserver !== 'undefined' ) {\n\t\tconst $links = $( 'a[href^=\"#\"]' );\n\n\t\tconst sectionObserver = new IntersectionObserver( changes => {\n\t\t\tchanges.forEach( change => {\n\t\t\t\tif ( change.intersectionRatio === 0 ) {\n\t\t\t\t\t$links.filter( `a[href=\"#${ change.target.id }\"]` ).removeClass( 'is-active' );\n\t\t\t\t} else {\n\t\t\t\t\t$links.filter( `a[href=\"#${ change.target.id }\"]` ).addClass( 'is-active' );\n\t\t\t\t}\n\t\t\t} );\n\t\t}, {\n\t\t\tmargin: `${ topMargin }px 0 0`,\n\t\t} );\n\n\t\t$( '.-content [id]' ).each( function() {\n\t\t\tsectionObserver.observe( this );\n\t\t} );\n\n\t\tconst stickyObserver = new IntersectionObserver( changes => {\n\t\t\tchanges.forEach( change => {\n\t\t\t\tif ( change.intersectionRatio === 1 ) {\n\t\t\t\t\t$( change.target ).data( 'target' ).removeClass( 'is-sticky' );\n\t\t\t\t}\n\t\t\t\tif ( change.intersectionRatio === 0 ) {\n\t\t\t\t\t$( change.target ).data( 'target' ).addClass( 'is-sticky' );\n\t\t\t\t}\n\t\t\t} );\n\t\t}, {\n\t\t\tmargin: `${ topMargin }px 0 0`,\n\t\t\tthreshold: [ 0, 1 ],\n\t\t} );\n\n\t\t$( '.sticky-marker' ).each( function() {\n\t\t\tconst target = $( this ).data( 'target' );\n\t\t\t$( this ).data( 'target', $( `#${ target }` ) );\n\t\t\tstickyObserver.observe( this );\n\t\t} );\n\t}\n\n\t$window.scroll( function() {\n\t\t$body.toggleClass( 'show-totop', $window.scrollTop() > window.innerHeight / 2 );\n\t} );\n\n\t// =========================\n\t// ! Button Types\n\t// =========================\n\n\t// Toggle Buttons\n\t$( '.toggle' ).click( function() {\n\t\tconst target = $( this ).data( 'toggle' ) || $( this ).attr( 'href' ).replace( '#', '' );\n\n\t\tconst className = `show-${ target }`;\n\n\t\tif ( $body.hasClass( className ) ) {\n\t\t\t$body.removeClass( className );\n\t\t} else {\n\t\t\t$body.setFlagClass( 'show', target );\n\t\t}\n\n\t\t$( '.toggle' ).removeClass( 'is-active' );\n\t\t$( `.toggle[href=\"#${ target }\"], .toggle[data-toggle=\"${ target }\"]` ).toggleClass( 'is-active', $body.hasClass( className ) );\n\t} );\n\n\t// Switch Buttons\n\t$( '.switch' ).click( function() {\n\t\tconst name = $( this ).data( 'name' );\n\t\tconst value = $( this ).data( 'value' );\n\n\t\t$body.setFlagClass( name, value );\n\n\t\t$( `.switch[data-name=\"${ name }\"]` ).removeClass( 'is-active' );\n\t\t$( `.switch[data-name=\"${ name }\"][data-value=\"${ value }\"]` ).addClass( 'is-active' );\n\t} );\n\n\t// Filter Buttons\n\t$( '[data-filter]' ).each( function() {\n\t\tconst $targets = $( $( this ).data( 'filter' ) );\n\t\tconst $filters = $( this ).find( 'button' );\n\n\t\tfunction applyFilter( match ) {\n\t\t\t$targets.removeClass( 'is-matched' );\n\n\t\t\tif ( match ) {\n\t\t\t\t$targets.filter( '.' + match ).addClass( 'is-matched' );\n\t\t\t}\n\n\t\t\t$targets.toggleClass( 'is-filtered', !! match );\n\t\t}\n\n\t\t$filters.click( function() {\n\t\t\t$filters.not( this ).removeClass( 'is-active' );\n\t\t\t$( this ).toggleClass( 'is-active' );\n\t\t\tapplyFilter( $( this ).hasClass( 'is-active' ) ? this.value : null );\n\t\t} );\n\t} );\n\n\t// Expand Buttons\n\t$( '[data-expand]' ).each( function() {\n\t\tconst $this = $( this );\n\t\tconst $target = $( '#' + $this.data( 'expand' ) );\n\n\t\t$this.click( function() {\n\t\t\t$this.toggleClass( 'is-active' );\n\t\t\tif ( $this.hasClass( 'is-active' ) ) {\n\t\t\t\t$target.addClass( 'open' ).stop().hide().animate( { height: 'toggle' }, () => $target.attr( 'style', '' ) );\n\t\t\t} else {\n\t\t\t\t$target.stop().show().animate( { height: 'toggle' }, () => $target.attr( 'style', '' ).removeClass( 'open' ) );\n\t\t\t}\n\t\t} );\n\t} );\n\n\t// Collapsibles\n\t$( '.collapsible-header' ).on( 'click', function( e ) {\n\t\tif ( e.target.nodeName.toLowerCase() === 'a' ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$( this ).parents( '.collapsible' ).toggleClass( 'is-open' ).find( '.collapsible-content' ).animate( { height: 'toggle' } );\n\t} );\n\n\t// =========================\n\t// ! Modules\n\t// =========================\n\n\t// Archive Navigating\n\t$( '.post-archive' ).each( function() {\n\t\tconst $this = $( this );\n\n\t\tconst postType = $this.data( 'post_type' ) || 'post';\n\t\tlet page = $this.data( 'page' ) || 1;\n\n\t\t$this.on( 'click', '.posts-nav-button', function() {\n\t\t\t$this.addClass( 'loading' );\n\n\t\t\tpage += $( this ).hasClass( 'next' ) ? 1 : -1;\n\n\t\t\tajax( {\n\t\t\t\turl: fetchurl,\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'parachute_archive',\n\t\t\t\t\tpost_type: postType,\n\t\t\t\t\tlanguage,\n\t\t\t\t\tpage,\n\t\t\t\t},\n\t\t\t\tdataType: 'html',\n\t\t\t\tsuccess( html ) {\n\t\t\t\t\tconst $update = $( `