���� JFIF    �� �        "" $(4,$&1'-=-157:::#+?D?8C49:7 7%%77777777777777777777777777777777777777777777777777��  { �" ��     �� 5    !1AQa"q�2��BR��#b�������  ��  ��   ? ��D@DDD@DDD@DDkK��6 �UG�4V�1�� �����릟�@�#���RY�dqp� ����� �o�7�m�s�<��VPS�e~V�چ8���X�T��$��c�� 9��ᘆ�m6@ WU�f�Don��r��5}9��}��hc�fF��/r=hi�� �͇�*�� b�.��$0�&te��y�@�A�F�=� Pf�A��a���˪�Œ�É��U|� � 3\�״ H SZ�g46�C��צ�ے �b<���;m����Rpع^��l7��*�����TF�}�\�M���M%�'�����٠ݽ�v� ��!-�����?�N!La��A+[`#���M����'�~oR�?��v^)��=��h����A��X�.���˃����^Ə��ܯsO"B�c>; �e�4��5�k��/CB��.  �J?��;�҈�������������������~�<�VZ�ꭼ2/)Í”jC���ע�V�G�!���!�F������\�� Kj�R�oc�h���:Þ I��1"2�q×°8��Р@ז���_C0�ր��A��lQ��@纼�!7��F�� �]�sZ B�62r�v�z~�K�7�c��5�.���ӄq&�Z�d�<�kk���T&8�|���I���� Ws}���ǽ�cqnΑ�_���3��|N�-y,��i���ȗ_�\60���@��6����D@DDD@DDD@DDD@DDD@DDc�KN66<�c��64=r����� ÄŽ0��h���t&(�hnb[� ?��^��\��â|�,�/h�\��R��5�? �0�!צ܉-����G����٬��Q�zA���1�����V��� �:R���`�$��ik��H����D4�����#dk����� h�}����7���w%�������*o8wG�LycuT�.���ܯ7��I��u^���)��/c�,s�Nq�ۺ�;�ך�YH2���.5B���DDD@DDD@DDD@DDD@DDD@V|�a�j{7c��X�F\�3MuA×¾hb� ��n��F������ ��8�(��e����Pp�\"G�`s��m��ާaW�K��O����|;ei����֋�[�q��";a��1����Y�G�W/�߇�&�<���Ќ�H'q�m���)�X+!���=�m�ۚ丷~6a^X�)���,�>#&6G���Y��{����"" """ """ """ """ ""��at\/�a�8 �yp%�lhl�n����)���i�t��B�������������?��modskinlienminh.com - WSOX ENC PK! Mclass-IXR-message.phpnu[message =& $message; } /** * PHP4 constructor. */ public function IXR_Message( $message ) { self::__construct( $message ); } function parse() { if ( ! function_exists( 'xml_parser_create' ) ) { trigger_error( __( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." ) ); return false; } // first remove the XML declaration // merged from WP #10698 - this method avoids the RAM usage of preg_replace on very large messages $header = preg_replace( '/<\?xml.*?\?'.'>/s', '', substr( $this->message, 0, 100 ), 1 ); $this->message = trim( substr_replace( $this->message, $header, 0, 100 ) ); if ( '' == $this->message ) { return false; } // Then remove the DOCTYPE $header = preg_replace( '/^]*+>/i', '', substr( $this->message, 0, 200 ), 1 ); $this->message = trim( substr_replace( $this->message, $header, 0, 200 ) ); if ( '' == $this->message ) { return false; } // Check that the root tag is valid $root_tag = substr( $this->message, 0, strcspn( substr( $this->message, 0, 20 ), "> \t\r\n" ) ); if ( 'message, '<' ) ) { return false; } $this->_parser = xml_parser_create(); // Set XML parser to take the case of tags in to account xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false); // Set XML parser callback functions xml_set_element_handler($this->_parser, array($this, 'tag_open'), array($this, 'tag_close')); xml_set_character_data_handler($this->_parser, array($this, 'cdata')); // 256Kb, parse in chunks to avoid the RAM usage on very large messages $chunk_size = 262144; /** * Filters the chunk size that can be used to parse an XML-RPC response message. * * @since 4.4.0 * * @param int $chunk_size Chunk size to parse in bytes. */ $chunk_size = apply_filters( 'xmlrpc_chunk_parsing_size', $chunk_size ); $final = false; do { if (strlen($this->message) <= $chunk_size) { $final = true; } $part = substr($this->message, 0, $chunk_size); $this->message = substr($this->message, $chunk_size); if (!xml_parse($this->_parser, $part, $final)) { xml_parser_free($this->_parser); unset($this->_parser); return false; } if ($final) { break; } } while (true); xml_parser_free($this->_parser); unset($this->_parser); // Grab the error messages, if any if ($this->messageType == 'fault') { $this->faultCode = $this->params[0]['faultCode']; $this->faultString = $this->params[0]['faultString']; } return true; } function tag_open($parser, $tag, $attr) { $this->_currentTagContents = ''; $this->_currentTag = $tag; switch($tag) { case 'methodCall': case 'methodResponse': case 'fault': $this->messageType = $tag; break; /* Deal with stacks of arrays and structs */ case 'data': // data is to all intents and puposes more interesting than array $this->_arraystructstypes[] = 'array'; $this->_arraystructs[] = array(); break; case 'struct': $this->_arraystructstypes[] = 'struct'; $this->_arraystructs[] = array(); break; } } function cdata($parser, $cdata) { $this->_currentTagContents .= $cdata; } function tag_close($parser, $tag) { $valueFlag = false; switch($tag) { case 'int': case 'i4': $value = (int)trim($this->_currentTagContents); $valueFlag = true; break; case 'double': $value = (double)trim($this->_currentTagContents); $valueFlag = true; break; case 'string': $value = (string)trim($this->_currentTagContents); $valueFlag = true; break; case 'dateTime.iso8601': $value = new IXR_Date(trim($this->_currentTagContents)); $valueFlag = true; break; case 'value': // "If no type is indicated, the type is string." if (trim($this->_currentTagContents) != '') { $value = (string)$this->_currentTagContents; $valueFlag = true; } break; case 'boolean': $value = (boolean)trim($this->_currentTagContents); $valueFlag = true; break; case 'base64': $value = base64_decode($this->_currentTagContents); $valueFlag = true; break; /* Deal with stacks of arrays and structs */ case 'data': case 'struct': $value = array_pop($this->_arraystructs); array_pop($this->_arraystructstypes); $valueFlag = true; break; case 'member': array_pop($this->_currentStructName); break; case 'name': $this->_currentStructName[] = trim($this->_currentTagContents); break; case 'methodName': $this->methodName = trim($this->_currentTagContents); break; } if ($valueFlag) { if (count($this->_arraystructs) > 0) { // Add value to struct or array if ($this->_arraystructstypes[count($this->_arraystructstypes)-1] == 'struct') { // Add to struct $this->_arraystructs[count($this->_arraystructs)-1][$this->_currentStructName[count($this->_currentStructName)-1]] = $value; } else { // Add to array $this->_arraystructs[count($this->_arraystructs)-1][] = $value; } } else { // Just add as a parameter $this->params[] = $value; } } $this->_currentTagContents = ''; } } PK! build.zipnu[PK!Gclass-IXR-clientmulticall.phpnu[useragent = 'The Incutio XML-RPC PHP Library (multicall client)'; } /** * PHP4 constructor. */ public function IXR_ClientMulticall( $server, $path = false, $port = 80 ) { self::__construct( $server, $path, $port ); } /** * @since 1.5.0 * @since 5.5.0 Formalized the existing `...$args` parameter by adding it * to the function signature. */ function addCall( ...$args ) { $methodName = array_shift($args); $struct = array( 'methodName' => $methodName, 'params' => $args ); $this->calls[] = $struct; } /** * @since 1.5.0 * @since 5.5.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * * @return bool */ function query( ...$args ) { // Prepare multicall, then call the parent::query() method return parent::query('system.multicall', $this->calls); } } PK! A%`%` effect.jsnu[/*! * jQuery UI Effects 1.13.3 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * https://jquery.org/license */ //>>label: Effects Core //>>group: Effects /* eslint-disable max-len */ //>>description: Extends the internal jQuery effects. Includes morphing and easing. Required by all other effects. /* eslint-enable max-len */ //>>docs: https://api.jqueryui.com/category/effects-core/ //>>demos: https://jqueryui.com/effect/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./jquery-var-for-color", "./vendor/jquery-color/jquery.color", "./version" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; var dataSpace = "ui-effects-", dataSpaceStyle = "ui-effects-style", dataSpaceAnimated = "ui-effects-animated"; $.effects = { effect: {} }; /******************************************************************************/ /****************************** CLASS ANIMATIONS ******************************/ /******************************************************************************/ ( function() { var classAnimationActions = [ "add", "remove", "toggle" ], shorthandStyles = { border: 1, borderBottom: 1, borderColor: 1, borderLeft: 1, borderRight: 1, borderTop: 1, borderWidth: 1, margin: 1, padding: 1 }; $.each( [ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) { $.fx.step[ prop ] = function( fx ) { if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) { jQuery.style( fx.elem, prop, fx.end ); fx.setAttr = true; } }; } ); function camelCase( string ) { return string.replace( /-([\da-z])/gi, function( all, letter ) { return letter.toUpperCase(); } ); } function getElementStyles( elem ) { var key, len, style = elem.ownerDocument.defaultView ? elem.ownerDocument.defaultView.getComputedStyle( elem, null ) : elem.currentStyle, styles = {}; if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) { len = style.length; while ( len-- ) { key = style[ len ]; if ( typeof style[ key ] === "string" ) { styles[ camelCase( key ) ] = style[ key ]; } } // Support: Opera, IE <9 } else { for ( key in style ) { if ( typeof style[ key ] === "string" ) { styles[ key ] = style[ key ]; } } } return styles; } function styleDifference( oldStyle, newStyle ) { var diff = {}, name, value; for ( name in newStyle ) { value = newStyle[ name ]; if ( oldStyle[ name ] !== value ) { if ( !shorthandStyles[ name ] ) { if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) { diff[ name ] = value; } } } } return diff; } // Support: jQuery <1.8 if ( !$.fn.addBack ) { $.fn.addBack = function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter( selector ) ); }; } $.effects.animateClass = function( value, duration, easing, callback ) { var o = $.speed( duration, easing, callback ); return this.queue( function() { var animated = $( this ), baseClass = animated.attr( "class" ) || "", applyClassChange, allAnimations = o.children ? animated.find( "*" ).addBack() : animated; // Map the animated objects to store the original styles. allAnimations = allAnimations.map( function() { var el = $( this ); return { el: el, start: getElementStyles( this ) }; } ); // Apply class change applyClassChange = function() { $.each( classAnimationActions, function( i, action ) { if ( value[ action ] ) { animated[ action + "Class" ]( value[ action ] ); } } ); }; applyClassChange(); // Map all animated objects again - calculate new styles and diff allAnimations = allAnimations.map( function() { this.end = getElementStyles( this.el[ 0 ] ); this.diff = styleDifference( this.start, this.end ); return this; } ); // Apply original class animated.attr( "class", baseClass ); // Map all animated objects again - this time collecting a promise allAnimations = allAnimations.map( function() { var styleInfo = this, dfd = $.Deferred(), opts = $.extend( {}, o, { queue: false, complete: function() { dfd.resolve( styleInfo ); } } ); this.el.animate( this.diff, opts ); return dfd.promise(); } ); // Once all animations have completed: $.when.apply( $, allAnimations.get() ).done( function() { // Set the final class applyClassChange(); // For each animated element, // clear all css properties that were animated $.each( arguments, function() { var el = this.el; $.each( this.diff, function( key ) { el.css( key, "" ); } ); } ); // This is guarnteed to be there if you use jQuery.speed() // it also handles dequeuing the next anim... o.complete.call( animated[ 0 ] ); } ); } ); }; $.fn.extend( { addClass: ( function( orig ) { return function( classNames, speed, easing, callback ) { return speed ? $.effects.animateClass.call( this, { add: classNames }, speed, easing, callback ) : orig.apply( this, arguments ); }; } )( $.fn.addClass ), removeClass: ( function( orig ) { return function( classNames, speed, easing, callback ) { return arguments.length > 1 ? $.effects.animateClass.call( this, { remove: classNames }, speed, easing, callback ) : orig.apply( this, arguments ); }; } )( $.fn.removeClass ), toggleClass: ( function( orig ) { return function( classNames, force, speed, easing, callback ) { if ( typeof force === "boolean" || force === undefined ) { if ( !speed ) { // Without speed parameter return orig.apply( this, arguments ); } else { return $.effects.animateClass.call( this, ( force ? { add: classNames } : { remove: classNames } ), speed, easing, callback ); } } else { // Without force parameter return $.effects.animateClass.call( this, { toggle: classNames }, force, speed, easing ); } }; } )( $.fn.toggleClass ), switchClass: function( remove, add, speed, easing, callback ) { return $.effects.animateClass.call( this, { add: add, remove: remove }, speed, easing, callback ); } } ); } )(); /******************************************************************************/ /*********************************** EFFECTS **********************************/ /******************************************************************************/ ( function() { if ( $.expr && $.expr.pseudos && $.expr.pseudos.animated ) { $.expr.pseudos.animated = ( function( orig ) { return function( elem ) { return !!$( elem ).data( dataSpaceAnimated ) || orig( elem ); }; } )( $.expr.pseudos.animated ); } if ( $.uiBackCompat !== false ) { $.extend( $.effects, { // Saves a set of properties in a data storage save: function( element, set ) { var i = 0, length = set.length; for ( ; i < length; i++ ) { if ( set[ i ] !== null ) { element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] ); } } }, // Restores a set of previously saved properties from a data storage restore: function( element, set ) { var val, i = 0, length = set.length; for ( ; i < length; i++ ) { if ( set[ i ] !== null ) { val = element.data( dataSpace + set[ i ] ); element.css( set[ i ], val ); } } }, setMode: function( el, mode ) { if ( mode === "toggle" ) { mode = el.is( ":hidden" ) ? "show" : "hide"; } return mode; }, // Wraps the element around a wrapper that copies position properties createWrapper: function( element ) { // If the element is already wrapped, return it if ( element.parent().is( ".ui-effects-wrapper" ) ) { return element.parent(); } // Wrap the element var props = { width: element.outerWidth( true ), height: element.outerHeight( true ), "float": element.css( "float" ) }, wrapper = $( "
" ) .addClass( "ui-effects-wrapper" ) .css( { fontSize: "100%", background: "transparent", border: "none", margin: 0, padding: 0 } ), // Store the size in case width/height are defined in % - Fixes #5245 size = { width: element.width(), height: element.height() }, active = document.activeElement; // Support: Firefox // Firefox incorrectly exposes anonymous content // https://bugzilla.mozilla.org/show_bug.cgi?id=561664 try { // eslint-disable-next-line no-unused-expressions active.id; } catch ( e ) { active = document.body; } element.wrap( wrapper ); // Fixes #7595 - Elements lose focus when wrapped. if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { $( active ).trigger( "focus" ); } // Hotfix for jQuery 1.4 since some change in wrap() seems to actually // lose the reference to the wrapped element wrapper = element.parent(); // Transfer positioning properties to the wrapper if ( element.css( "position" ) === "static" ) { wrapper.css( { position: "relative" } ); element.css( { position: "relative" } ); } else { $.extend( props, { position: element.css( "position" ), zIndex: element.css( "z-index" ) } ); $.each( [ "top", "left", "bottom", "right" ], function( i, pos ) { props[ pos ] = element.css( pos ); if ( isNaN( parseInt( props[ pos ], 10 ) ) ) { props[ pos ] = "auto"; } } ); element.css( { position: "relative", top: 0, left: 0, right: "auto", bottom: "auto" } ); } element.css( size ); return wrapper.css( props ).show(); }, removeWrapper: function( element ) { var active = document.activeElement; if ( element.parent().is( ".ui-effects-wrapper" ) ) { element.parent().replaceWith( element ); // Fixes #7595 - Elements lose focus when wrapped. if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { $( active ).trigger( "focus" ); } } return element; } } ); } $.extend( $.effects, { version: "1.13.3", define: function( name, mode, effect ) { if ( !effect ) { effect = mode; mode = "effect"; } $.effects.effect[ name ] = effect; $.effects.effect[ name ].mode = mode; return effect; }, scaledDimensions: function( element, percent, direction ) { if ( percent === 0 ) { return { height: 0, width: 0, outerHeight: 0, outerWidth: 0 }; } var x = direction !== "horizontal" ? ( ( percent || 100 ) / 100 ) : 1, y = direction !== "vertical" ? ( ( percent || 100 ) / 100 ) : 1; return { height: element.height() * y, width: element.width() * x, outerHeight: element.outerHeight() * y, outerWidth: element.outerWidth() * x }; }, clipToBox: function( animation ) { return { width: animation.clip.right - animation.clip.left, height: animation.clip.bottom - animation.clip.top, left: animation.clip.left, top: animation.clip.top }; }, // Injects recently queued functions to be first in line (after "inprogress") unshift: function( element, queueLength, count ) { var queue = element.queue(); if ( queueLength > 1 ) { queue.splice.apply( queue, [ 1, 0 ].concat( queue.splice( queueLength, count ) ) ); } element.dequeue(); }, saveStyle: function( element ) { element.data( dataSpaceStyle, element[ 0 ].style.cssText ); }, restoreStyle: function( element ) { element[ 0 ].style.cssText = element.data( dataSpaceStyle ) || ""; element.removeData( dataSpaceStyle ); }, mode: function( element, mode ) { var hidden = element.is( ":hidden" ); if ( mode === "toggle" ) { mode = hidden ? "show" : "hide"; } if ( hidden ? mode === "hide" : mode === "show" ) { mode = "none"; } return mode; }, // Translates a [top,left] array into a baseline value getBaseline: function( origin, original ) { var y, x; switch ( origin[ 0 ] ) { case "top": y = 0; break; case "middle": y = 0.5; break; case "bottom": y = 1; break; default: y = origin[ 0 ] / original.height; } switch ( origin[ 1 ] ) { case "left": x = 0; break; case "center": x = 0.5; break; case "right": x = 1; break; default: x = origin[ 1 ] / original.width; } return { x: x, y: y }; }, // Creates a placeholder element so that the original element can be made absolute createPlaceholder: function( element ) { var placeholder, cssPosition = element.css( "position" ), position = element.position(); // Lock in margins first to account for form elements, which // will change margin if you explicitly set height // see: https://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380 // Support: Safari element.css( { marginTop: element.css( "marginTop" ), marginBottom: element.css( "marginBottom" ), marginLeft: element.css( "marginLeft" ), marginRight: element.css( "marginRight" ) } ) .outerWidth( element.outerWidth() ) .outerHeight( element.outerHeight() ); if ( /^(static|relative)/.test( cssPosition ) ) { cssPosition = "absolute"; placeholder = $( "<" + element[ 0 ].nodeName + ">" ).insertAfter( element ).css( { // Convert inline to inline block to account for inline elements // that turn to inline block based on content (like img) display: /^(inline|ruby)/.test( element.css( "display" ) ) ? "inline-block" : "block", visibility: "hidden", // Margins need to be set to account for margin collapse marginTop: element.css( "marginTop" ), marginBottom: element.css( "marginBottom" ), marginLeft: element.css( "marginLeft" ), marginRight: element.css( "marginRight" ), "float": element.css( "float" ) } ) .outerWidth( element.outerWidth() ) .outerHeight( element.outerHeight() ) .addClass( "ui-effects-placeholder" ); element.data( dataSpace + "placeholder", placeholder ); } element.css( { position: cssPosition, left: position.left, top: position.top } ); return placeholder; }, removePlaceholder: function( element ) { var dataKey = dataSpace + "placeholder", placeholder = element.data( dataKey ); if ( placeholder ) { placeholder.remove(); element.removeData( dataKey ); } }, // Removes a placeholder if it exists and restores // properties that were modified during placeholder creation cleanUp: function( element ) { $.effects.restoreStyle( element ); $.effects.removePlaceholder( element ); }, setTransition: function( element, list, factor, value ) { value = value || {}; $.each( list, function( i, x ) { var unit = element.cssUnit( x ); if ( unit[ 0 ] > 0 ) { value[ x ] = unit[ 0 ] * factor + unit[ 1 ]; } } ); return value; } } ); // Return an effect options object for the given parameters: function _normalizeArguments( effect, options, speed, callback ) { // Allow passing all options as the first parameter if ( $.isPlainObject( effect ) ) { options = effect; effect = effect.effect; } // Convert to an object effect = { effect: effect }; // Catch (effect, null, ...) if ( options == null ) { options = {}; } // Catch (effect, callback) if ( typeof options === "function" ) { callback = options; speed = null; options = {}; } // Catch (effect, speed, ?) if ( typeof options === "number" || $.fx.speeds[ options ] ) { callback = speed; speed = options; options = {}; } // Catch (effect, options, callback) if ( typeof speed === "function" ) { callback = speed; speed = null; } // Add options to effect if ( options ) { $.extend( effect, options ); } speed = speed || options.duration; effect.duration = $.fx.off ? 0 : typeof speed === "number" ? speed : speed in $.fx.speeds ? $.fx.speeds[ speed ] : $.fx.speeds._default; effect.complete = callback || options.complete; return effect; } function standardAnimationOption( option ) { // Valid standard speeds (nothing, number, named speed) if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) { return true; } // Invalid strings - treat as "normal" speed if ( typeof option === "string" && !$.effects.effect[ option ] ) { return true; } // Complete callback if ( typeof option === "function" ) { return true; } // Options hash (but not naming an effect) if ( typeof option === "object" && !option.effect ) { return true; } // Didn't match any standard API return false; } $.fn.extend( { effect: function( /* effect, options, speed, callback */ ) { var args = _normalizeArguments.apply( this, arguments ), effectMethod = $.effects.effect[ args.effect ], defaultMode = effectMethod.mode, queue = args.queue, queueName = queue || "fx", complete = args.complete, mode = args.mode, modes = [], prefilter = function( next ) { var el = $( this ), normalizedMode = $.effects.mode( el, mode ) || defaultMode; // Sentinel for duck-punching the :animated pseudo-selector el.data( dataSpaceAnimated, true ); // Save effect mode for later use, // we can't just call $.effects.mode again later, // as the .show() below destroys the initial state modes.push( normalizedMode ); // See $.uiBackCompat inside of run() for removal of defaultMode in 1.14 if ( defaultMode && ( normalizedMode === "show" || ( normalizedMode === defaultMode && normalizedMode === "hide" ) ) ) { el.show(); } if ( !defaultMode || normalizedMode !== "none" ) { $.effects.saveStyle( el ); } if ( typeof next === "function" ) { next(); } }; if ( $.fx.off || !effectMethod ) { // Delegate to the original method (e.g., .show()) if possible if ( mode ) { return this[ mode ]( args.duration, complete ); } else { return this.each( function() { if ( complete ) { complete.call( this ); } } ); } } function run( next ) { var elem = $( this ); function cleanup() { elem.removeData( dataSpaceAnimated ); $.effects.cleanUp( elem ); if ( args.mode === "hide" ) { elem.hide(); } done(); } function done() { if ( typeof complete === "function" ) { complete.call( elem[ 0 ] ); } if ( typeof next === "function" ) { next(); } } // Override mode option on a per element basis, // as toggle can be either show or hide depending on element state args.mode = modes.shift(); if ( $.uiBackCompat !== false && !defaultMode ) { if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) { // Call the core method to track "olddisplay" properly elem[ mode ](); done(); } else { effectMethod.call( elem[ 0 ], args, done ); } } else { if ( args.mode === "none" ) { // Call the core method to track "olddisplay" properly elem[ mode ](); done(); } else { effectMethod.call( elem[ 0 ], args, cleanup ); } } } // Run prefilter on all elements first to ensure that // any showing or hiding happens before placeholder creation, // which ensures that any layout changes are correctly captured. return queue === false ? this.each( prefilter ).each( run ) : this.queue( queueName, prefilter ).queue( queueName, run ); }, show: ( function( orig ) { return function( option ) { if ( standardAnimationOption( option ) ) { return orig.apply( this, arguments ); } else { var args = _normalizeArguments.apply( this, arguments ); args.mode = "show"; return this.effect.call( this, args ); } }; } )( $.fn.show ), hide: ( function( orig ) { return function( option ) { if ( standardAnimationOption( option ) ) { return orig.apply( this, arguments ); } else { var args = _normalizeArguments.apply( this, arguments ); args.mode = "hide"; return this.effect.call( this, args ); } }; } )( $.fn.hide ), toggle: ( function( orig ) { return function( option ) { if ( standardAnimationOption( option ) || typeof option === "boolean" ) { return orig.apply( this, arguments ); } else { var args = _normalizeArguments.apply( this, arguments ); args.mode = "toggle"; return this.effect.call( this, args ); } }; } )( $.fn.toggle ), cssUnit: function( key ) { var style = this.css( key ), val = []; $.each( [ "em", "px", "%", "pt" ], function( i, unit ) { if ( style.indexOf( unit ) > 0 ) { val = [ parseFloat( style ), unit ]; } } ); return val; }, cssClip: function( clipObj ) { if ( clipObj ) { return this.css( "clip", "rect(" + clipObj.top + "px " + clipObj.right + "px " + clipObj.bottom + "px " + clipObj.left + "px)" ); } return parseClip( this.css( "clip" ), this ); }, transfer: function( options, done ) { var element = $( this ), target = $( options.to ), targetFixed = target.css( "position" ) === "fixed", body = $( "body" ), fixTop = targetFixed ? body.scrollTop() : 0, fixLeft = targetFixed ? body.scrollLeft() : 0, endPosition = target.offset(), animation = { top: endPosition.top - fixTop, left: endPosition.left - fixLeft, height: target.innerHeight(), width: target.innerWidth() }, startPosition = element.offset(), transfer = $( "
" ); transfer .appendTo( "body" ) .addClass( options.className ) .css( { top: startPosition.top - fixTop, left: startPosition.left - fixLeft, height: element.innerHeight(), width: element.innerWidth(), position: targetFixed ? "fixed" : "absolute" } ) .animate( animation, options.duration, options.easing, function() { transfer.remove(); if ( typeof done === "function" ) { done(); } } ); } } ); function parseClip( str, element ) { var outerWidth = element.outerWidth(), outerHeight = element.outerHeight(), clipRegex = /^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/, values = clipRegex.exec( str ) || [ "", 0, outerWidth, outerHeight, 0 ]; return { top: parseFloat( values[ 1 ] ) || 0, right: values[ 2 ] === "auto" ? outerWidth : parseFloat( values[ 2 ] ), bottom: values[ 3 ] === "auto" ? outerHeight : parseFloat( values[ 3 ] ), left: parseFloat( values[ 4 ] ) || 0 }; } $.fx.step.clip = function( fx ) { if ( !fx.clipInit ) { fx.start = $( fx.elem ).cssClip(); if ( typeof fx.end === "string" ) { fx.end = parseClip( fx.end, fx.elem ); } fx.clipInit = true; } $( fx.elem ).cssClip( { top: fx.pos * ( fx.end.top - fx.start.top ) + fx.start.top, right: fx.pos * ( fx.end.right - fx.start.right ) + fx.start.right, bottom: fx.pos * ( fx.end.bottom - fx.start.bottom ) + fx.start.bottom, left: fx.pos * ( fx.end.left - fx.start.left ) + fx.start.left } ); }; } )(); /******************************************************************************/ /*********************************** EASING ***********************************/ /******************************************************************************/ ( function() { // Based on easing equations from Robert Penner (http://robertpenner.com/easing) var baseEasings = {}; $.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) { baseEasings[ name ] = function( p ) { return Math.pow( p, i + 2 ); }; } ); $.extend( baseEasings, { Sine: function( p ) { return 1 - Math.cos( p * Math.PI / 2 ); }, Circ: function( p ) { return 1 - Math.sqrt( 1 - p * p ); }, Elastic: function( p ) { return p === 0 || p === 1 ? p : -Math.pow( 2, 8 * ( p - 1 ) ) * Math.sin( ( ( p - 1 ) * 80 - 7.5 ) * Math.PI / 15 ); }, Back: function( p ) { return p * p * ( 3 * p - 2 ); }, Bounce: function( p ) { var pow2, bounce = 4; while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {} return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 ); } } ); $.each( baseEasings, function( name, easeIn ) { $.easing[ "easeIn" + name ] = easeIn; $.easing[ "easeOut" + name ] = function( p ) { return 1 - easeIn( 1 - p ); }; $.easing[ "easeInOut" + name ] = function( p ) { return p < 0.5 ? easeIn( p * 2 ) / 2 : 1 - easeIn( p * -2 + 2 ) / 2; }; } ); } )(); return $.effects; } ); PK!base.zipnu[PK!DY|LL slider.jsnu[/*! * jQuery UI Slider 1.13.3 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * https://jquery.org/license */ //>>label: Slider //>>group: Widgets //>>description: Displays a flexible slider with ranges and accessibility via keyboard. //>>docs: https://api.jqueryui.com/slider/ //>>demos: https://jqueryui.com/slider/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/slider.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./mouse", "../keycode", "../version", "../widget" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.widget( "ui.slider", $.ui.mouse, { version: "1.13.3", widgetEventPrefix: "slide", options: { animate: false, classes: { "ui-slider": "ui-corner-all", "ui-slider-handle": "ui-corner-all", // Note: ui-widget-header isn't the most fittingly semantic framework class for this // element, but worked best visually with a variety of themes "ui-slider-range": "ui-corner-all ui-widget-header" }, distance: 0, max: 100, min: 0, orientation: "horizontal", range: false, step: 1, value: 0, values: null, // Callbacks change: null, slide: null, start: null, stop: null }, // Number of pages in a slider // (how many times can you page up/down to go through the whole range) numPages: 5, _create: function() { this._keySliding = false; this._mouseSliding = false; this._animateOff = true; this._handleIndex = null; this._detectOrientation(); this._mouseInit(); this._calculateNewMax(); this._addClass( "ui-slider ui-slider-" + this.orientation, "ui-widget ui-widget-content" ); this._refresh(); this._animateOff = false; }, _refresh: function() { this._createRange(); this._createHandles(); this._setupEvents(); this._refreshValue(); }, _createHandles: function() { var i, handleCount, options = this.options, existingHandles = this.element.find( ".ui-slider-handle" ), handle = "", handles = []; handleCount = ( options.values && options.values.length ) || 1; if ( existingHandles.length > handleCount ) { existingHandles.slice( handleCount ).remove(); existingHandles = existingHandles.slice( 0, handleCount ); } for ( i = existingHandles.length; i < handleCount; i++ ) { handles.push( handle ); } this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) ); this._addClass( this.handles, "ui-slider-handle", "ui-state-default" ); this.handle = this.handles.eq( 0 ); this.handles.each( function( i ) { $( this ) .data( "ui-slider-handle-index", i ) .attr( "tabIndex", 0 ); } ); }, _createRange: function() { var options = this.options; if ( options.range ) { if ( options.range === true ) { if ( !options.values ) { options.values = [ this._valueMin(), this._valueMin() ]; } else if ( options.values.length && options.values.length !== 2 ) { options.values = [ options.values[ 0 ], options.values[ 0 ] ]; } else if ( Array.isArray( options.values ) ) { options.values = options.values.slice( 0 ); } } if ( !this.range || !this.range.length ) { this.range = $( "
" ) .appendTo( this.element ); this._addClass( this.range, "ui-slider-range" ); } else { this._removeClass( this.range, "ui-slider-range-min ui-slider-range-max" ); // Handle range switching from true to min/max this.range.css( { "left": "", "bottom": "" } ); } if ( options.range === "min" || options.range === "max" ) { this._addClass( this.range, "ui-slider-range-" + options.range ); } } else { if ( this.range ) { this.range.remove(); } this.range = null; } }, _setupEvents: function() { this._off( this.handles ); this._on( this.handles, this._handleEvents ); this._hoverable( this.handles ); this._focusable( this.handles ); }, _destroy: function() { this.handles.remove(); if ( this.range ) { this.range.remove(); } this._mouseDestroy(); }, _mouseCapture: function( event ) { var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle, that = this, o = this.options; if ( o.disabled ) { return false; } this.elementSize = { width: this.element.outerWidth(), height: this.element.outerHeight() }; this.elementOffset = this.element.offset(); position = { x: event.pageX, y: event.pageY }; normValue = this._normValueFromMouse( position ); distance = this._valueMax() - this._valueMin() + 1; this.handles.each( function( i ) { var thisDistance = Math.abs( normValue - that.values( i ) ); if ( ( distance > thisDistance ) || ( distance === thisDistance && ( i === that._lastChangedValue || that.values( i ) === o.min ) ) ) { distance = thisDistance; closestHandle = $( this ); index = i; } } ); allowed = this._start( event, index ); if ( allowed === false ) { return false; } this._mouseSliding = true; this._handleIndex = index; this._addClass( closestHandle, null, "ui-state-active" ); closestHandle.trigger( "focus" ); offset = closestHandle.offset(); mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" ); this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : { left: event.pageX - offset.left - ( closestHandle.width() / 2 ), top: event.pageY - offset.top - ( closestHandle.height() / 2 ) - ( parseInt( closestHandle.css( "borderTopWidth" ), 10 ) || 0 ) - ( parseInt( closestHandle.css( "borderBottomWidth" ), 10 ) || 0 ) + ( parseInt( closestHandle.css( "marginTop" ), 10 ) || 0 ) }; if ( !this.handles.hasClass( "ui-state-hover" ) ) { this._slide( event, index, normValue ); } this._animateOff = true; return true; }, _mouseStart: function() { return true; }, _mouseDrag: function( event ) { var position = { x: event.pageX, y: event.pageY }, normValue = this._normValueFromMouse( position ); this._slide( event, this._handleIndex, normValue ); return false; }, _mouseStop: function( event ) { this._removeClass( this.handles, null, "ui-state-active" ); this._mouseSliding = false; this._stop( event, this._handleIndex ); this._change( event, this._handleIndex ); this._handleIndex = null; this._clickOffset = null; this._animateOff = false; return false; }, _detectOrientation: function() { this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal"; }, _normValueFromMouse: function( position ) { var pixelTotal, pixelMouse, percentMouse, valueTotal, valueMouse; if ( this.orientation === "horizontal" ) { pixelTotal = this.elementSize.width; pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 ); } else { pixelTotal = this.elementSize.height; pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 ); } percentMouse = ( pixelMouse / pixelTotal ); if ( percentMouse > 1 ) { percentMouse = 1; } if ( percentMouse < 0 ) { percentMouse = 0; } if ( this.orientation === "vertical" ) { percentMouse = 1 - percentMouse; } valueTotal = this._valueMax() - this._valueMin(); valueMouse = this._valueMin() + percentMouse * valueTotal; return this._trimAlignValue( valueMouse ); }, _uiHash: function( index, value, values ) { var uiHash = { handle: this.handles[ index ], handleIndex: index, value: value !== undefined ? value : this.value() }; if ( this._hasMultipleValues() ) { uiHash.value = value !== undefined ? value : this.values( index ); uiHash.values = values || this.values(); } return uiHash; }, _hasMultipleValues: function() { return this.options.values && this.options.values.length; }, _start: function( event, index ) { return this._trigger( "start", event, this._uiHash( index ) ); }, _slide: function( event, index, newVal ) { var allowed, otherVal, currentValue = this.value(), newValues = this.values(); if ( this._hasMultipleValues() ) { otherVal = this.values( index ? 0 : 1 ); currentValue = this.values( index ); if ( this.options.values.length === 2 && this.options.range === true ) { newVal = index === 0 ? Math.min( otherVal, newVal ) : Math.max( otherVal, newVal ); } newValues[ index ] = newVal; } if ( newVal === currentValue ) { return; } allowed = this._trigger( "slide", event, this._uiHash( index, newVal, newValues ) ); // A slide can be canceled by returning false from the slide callback if ( allowed === false ) { return; } if ( this._hasMultipleValues() ) { this.values( index, newVal ); } else { this.value( newVal ); } }, _stop: function( event, index ) { this._trigger( "stop", event, this._uiHash( index ) ); }, _change: function( event, index ) { if ( !this._keySliding && !this._mouseSliding ) { //store the last changed value index for reference when handles overlap this._lastChangedValue = index; this._trigger( "change", event, this._uiHash( index ) ); } }, value: function( newValue ) { if ( arguments.length ) { this.options.value = this._trimAlignValue( newValue ); this._refreshValue(); this._change( null, 0 ); return; } return this._value(); }, values: function( index, newValue ) { var vals, newValues, i; if ( arguments.length > 1 ) { this.options.values[ index ] = this._trimAlignValue( newValue ); this._refreshValue(); this._change( null, index ); return; } if ( arguments.length ) { if ( Array.isArray( arguments[ 0 ] ) ) { vals = this.options.values; newValues = arguments[ 0 ]; for ( i = 0; i < vals.length; i += 1 ) { vals[ i ] = this._trimAlignValue( newValues[ i ] ); this._change( null, i ); } this._refreshValue(); } else { if ( this._hasMultipleValues() ) { return this._values( index ); } else { return this.value(); } } } else { return this._values(); } }, _setOption: function( key, value ) { var i, valsLength = 0; if ( key === "range" && this.options.range === true ) { if ( value === "min" ) { this.options.value = this._values( 0 ); this.options.values = null; } else if ( value === "max" ) { this.options.value = this._values( this.options.values.length - 1 ); this.options.values = null; } } if ( Array.isArray( this.options.values ) ) { valsLength = this.options.values.length; } this._super( key, value ); switch ( key ) { case "orientation": this._detectOrientation(); this._removeClass( "ui-slider-horizontal ui-slider-vertical" ) ._addClass( "ui-slider-" + this.orientation ); this._refreshValue(); if ( this.options.range ) { this._refreshRange( value ); } // Reset positioning from previous orientation this.handles.css( value === "horizontal" ? "bottom" : "left", "" ); break; case "value": this._animateOff = true; this._refreshValue(); this._change( null, 0 ); this._animateOff = false; break; case "values": this._animateOff = true; this._refreshValue(); // Start from the last handle to prevent unreachable handles (#9046) for ( i = valsLength - 1; i >= 0; i-- ) { this._change( null, i ); } this._animateOff = false; break; case "step": case "min": case "max": this._animateOff = true; this._calculateNewMax(); this._refreshValue(); this._animateOff = false; break; case "range": this._animateOff = true; this._refresh(); this._animateOff = false; break; } }, _setOptionDisabled: function( value ) { this._super( value ); this._toggleClass( null, "ui-state-disabled", !!value ); }, //internal value getter // _value() returns value trimmed by min and max, aligned by step _value: function() { var val = this.options.value; val = this._trimAlignValue( val ); return val; }, //internal values getter // _values() returns array of values trimmed by min and max, aligned by step // _values( index ) returns single value trimmed by min and max, aligned by step _values: function( index ) { var val, vals, i; if ( arguments.length ) { val = this.options.values[ index ]; val = this._trimAlignValue( val ); return val; } else if ( this._hasMultipleValues() ) { // .slice() creates a copy of the array // this copy gets trimmed by min and max and then returned vals = this.options.values.slice(); for ( i = 0; i < vals.length; i += 1 ) { vals[ i ] = this._trimAlignValue( vals[ i ] ); } return vals; } else { return []; } }, // Returns the step-aligned value that val is closest to, between (inclusive) min and max _trimAlignValue: function( val ) { if ( val <= this._valueMin() ) { return this._valueMin(); } if ( val >= this._valueMax() ) { return this._valueMax(); } var step = ( this.options.step > 0 ) ? this.options.step : 1, valModStep = ( val - this._valueMin() ) % step, alignValue = val - valModStep; if ( Math.abs( valModStep ) * 2 >= step ) { alignValue += ( valModStep > 0 ) ? step : ( -step ); } // Since JavaScript has problems with large floats, round // the final value to 5 digits after the decimal point (see #4124) return parseFloat( alignValue.toFixed( 5 ) ); }, _calculateNewMax: function() { var max = this.options.max, min = this._valueMin(), step = this.options.step, aboveMin = Math.round( ( max - min ) / step ) * step; max = aboveMin + min; if ( max > this.options.max ) { //If max is not divisible by step, rounding off may increase its value max -= step; } this.max = parseFloat( max.toFixed( this._precision() ) ); }, _precision: function() { var precision = this._precisionOf( this.options.step ); if ( this.options.min !== null ) { precision = Math.max( precision, this._precisionOf( this.options.min ) ); } return precision; }, _precisionOf: function( num ) { var str = num.toString(), decimal = str.indexOf( "." ); return decimal === -1 ? 0 : str.length - decimal - 1; }, _valueMin: function() { return this.options.min; }, _valueMax: function() { return this.max; }, _refreshRange: function( orientation ) { if ( orientation === "vertical" ) { this.range.css( { "width": "", "left": "" } ); } if ( orientation === "horizontal" ) { this.range.css( { "height": "", "bottom": "" } ); } }, _refreshValue: function() { var lastValPercent, valPercent, value, valueMin, valueMax, oRange = this.options.range, o = this.options, that = this, animate = ( !this._animateOff ) ? o.animate : false, _set = {}; if ( this._hasMultipleValues() ) { this.handles.each( function( i ) { valPercent = ( that.values( i ) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100; _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); if ( that.options.range === true ) { if ( that.orientation === "horizontal" ) { if ( i === 0 ) { that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate ); } if ( i === 1 ) { that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); } } else { if ( i === 0 ) { that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate ); } if ( i === 1 ) { that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); } } } lastValPercent = valPercent; } ); } else { value = this.value(); valueMin = this._valueMin(); valueMax = this._valueMax(); valPercent = ( valueMax !== valueMin ) ? ( value - valueMin ) / ( valueMax - valueMin ) * 100 : 0; _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); if ( oRange === "min" && this.orientation === "horizontal" ) { this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate ); } if ( oRange === "max" && this.orientation === "horizontal" ) { this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, o.animate ); } if ( oRange === "min" && this.orientation === "vertical" ) { this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate ); } if ( oRange === "max" && this.orientation === "vertical" ) { this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, o.animate ); } } }, _handleEvents: { keydown: function( event ) { var allowed, curVal, newVal, step, index = $( event.target ).data( "ui-slider-handle-index" ); switch ( event.keyCode ) { case $.ui.keyCode.HOME: case $.ui.keyCode.END: case $.ui.keyCode.PAGE_UP: case $.ui.keyCode.PAGE_DOWN: case $.ui.keyCode.UP: case $.ui.keyCode.RIGHT: case $.ui.keyCode.DOWN: case $.ui.keyCode.LEFT: event.preventDefault(); if ( !this._keySliding ) { this._keySliding = true; this._addClass( $( event.target ), null, "ui-state-active" ); allowed = this._start( event, index ); if ( allowed === false ) { return; } } break; } step = this.options.step; if ( this._hasMultipleValues() ) { curVal = newVal = this.values( index ); } else { curVal = newVal = this.value(); } switch ( event.keyCode ) { case $.ui.keyCode.HOME: newVal = this._valueMin(); break; case $.ui.keyCode.END: newVal = this._valueMax(); break; case $.ui.keyCode.PAGE_UP: newVal = this._trimAlignValue( curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages ) ); break; case $.ui.keyCode.PAGE_DOWN: newVal = this._trimAlignValue( curVal - ( ( this._valueMax() - this._valueMin() ) / this.numPages ) ); break; case $.ui.keyCode.UP: case $.ui.keyCode.RIGHT: if ( curVal === this._valueMax() ) { return; } newVal = this._trimAlignValue( curVal + step ); break; case $.ui.keyCode.DOWN: case $.ui.keyCode.LEFT: if ( curVal === this._valueMin() ) { return; } newVal = this._trimAlignValue( curVal - step ); break; } this._slide( event, index, newVal ); }, keyup: function( event ) { var index = $( event.target ).data( "ui-slider-handle-index" ); if ( this._keySliding ) { this._keySliding = false; this._stop( event, index ); this._change( event, index ); this._removeClass( $( event.target ), null, "ui-state-active" ); } } } } ); } ); PK!KVVclass-IXR-error.phpnu[code = $code; $this->message = htmlspecialchars($message); } /** * PHP4 constructor. */ public function IXR_Error( $code, $message ) { self::__construct( $code, $message ); } function getXml() { $xml = << faultCode {$this->code} faultString {$this->message} EOD; return $xml; } } PK!'99utils.jsnu[/** * Cookie functions. * * @output wp-includes/js/utils.js */ /* global userSettings, getAllUserSettings, wpCookies, setUserSetting */ /* exported getUserSetting, setUserSetting, deleteUserSetting */ window.wpCookies = { // The following functions are from Cookie.js class in TinyMCE 3, Moxiecode, used under LGPL. each: function( obj, cb, scope ) { var n, l; if ( ! obj ) { return 0; } scope = scope || obj; if ( typeof( obj.length ) !== 'undefined' ) { for ( n = 0, l = obj.length; n < l; n++ ) { if ( cb.call( scope, obj[n], n, obj ) === false ) { return 0; } } } else { for ( n in obj ) { if ( obj.hasOwnProperty(n) ) { if ( cb.call( scope, obj[n], n, obj ) === false ) { return 0; } } } } return 1; }, /** * Get a multi-values cookie. * Returns a JS object with the name: 'value' pairs. */ getHash: function( name ) { var cookie = this.get( name ), values; if ( cookie ) { this.each( cookie.split('&'), function( pair ) { pair = pair.split('='); values = values || {}; values[pair[0]] = pair[1]; }); } return values; }, /** * Set a multi-values cookie. * * 'values_obj' is the JS object that is stored. It is encoded as URI in wpCookies.set(). */ setHash: function( name, values_obj, expires, path, domain, secure ) { var str = ''; this.each( values_obj, function( val, key ) { str += ( ! str ? '' : '&' ) + key + '=' + val; }); this.set( name, str, expires, path, domain, secure ); }, /** * Get a cookie. */ get: function( name ) { var e, b, cookie = document.cookie, p = name + '='; if ( ! cookie ) { return; } b = cookie.indexOf( '; ' + p ); if ( b === -1 ) { b = cookie.indexOf(p); if ( b !== 0 ) { return null; } } else { b += 2; } e = cookie.indexOf( ';', b ); if ( e === -1 ) { e = cookie.length; } return decodeURIComponent( cookie.substring( b + p.length, e ) ); }, /** * Set a cookie. * * The 'expires' arg can be either a JS Date() object set to the expiration date (back-compat) * or the number of seconds until expiration */ set: function( name, value, expires, path, domain, secure ) { var d = new Date(); if ( typeof( expires ) === 'object' && expires.toGMTString ) { expires = expires.toGMTString(); } else if ( parseInt( expires, 10 ) ) { d.setTime( d.getTime() + ( parseInt( expires, 10 ) * 1000 ) ); // Time must be in milliseconds. expires = d.toGMTString(); } else { expires = ''; } document.cookie = name + '=' + encodeURIComponent( value ) + ( expires ? '; expires=' + expires : '' ) + ( path ? '; path=' + path : '' ) + ( domain ? '; domain=' + domain : '' ) + ( secure ? '; secure' : '' ); }, /** * Remove a cookie. * * This is done by setting it to an empty value and setting the expiration time in the past. */ remove: function( name, path, domain, secure ) { this.set( name, '', -1000, path, domain, secure ); } }; // Returns the value as string. Second arg or empty string is returned when value is not set. window.getUserSetting = function( name, def ) { var settings = getAllUserSettings(); if ( settings.hasOwnProperty( name ) ) { return settings[name]; } if ( typeof def !== 'undefined' ) { return def; } return ''; }; /* * Both name and value must be only ASCII letters, numbers or underscore * and the shorter, the better (cookies can store maximum 4KB). Not suitable to store text. * The value is converted and stored as string. */ window.setUserSetting = function( name, value, _del ) { if ( 'object' !== typeof userSettings ) { return false; } var uid = userSettings.uid, settings = wpCookies.getHash( 'wp-settings-' + uid ), path = userSettings.url, secure = !! userSettings.secure; name = name.toString().replace( /[^A-Za-z0-9_-]/g, '' ); if ( typeof value === 'number' ) { value = parseInt( value, 10 ); } else { value = value.toString().replace( /[^A-Za-z0-9_-]/g, '' ); } settings = settings || {}; if ( _del ) { delete settings[name]; } else { settings[name] = value; } wpCookies.setHash( 'wp-settings-' + uid, settings, 31536000, path, '', secure ); wpCookies.set( 'wp-settings-time-' + uid, userSettings.time, 31536000, path, '', secure ); return name; }; window.deleteUserSetting = function( name ) { return setUserSetting( name, '', 1 ); }; // Returns all settings as JS object. window.getAllUserSettings = function() { if ( 'object' !== typeof userSettings ) { return {}; } return wpCookies.getHash( 'wp-settings-' + userSettings.uid ) || {}; }; PK!04.tarnu[PK!,markup/class-astra-markup-20241111075226.phpnu[PK!_ E E2markup/09/class-astra-builder-base-dynamic-css.phpnu[ array( // Padding CSS. 'padding-top' => astra_responsive_spacing( $padding, 'top', 'desktop' ), 'padding-bottom' => astra_responsive_spacing( $padding, 'bottom', 'desktop' ), 'padding-left' => astra_responsive_spacing( $padding, 'left', 'desktop' ), 'padding-right' => astra_responsive_spacing( $padding, 'right', 'desktop' ), // Margin CSS. 'margin-top' => astra_responsive_spacing( $margin, 'top', 'desktop' ), 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'desktop' ), 'margin-left' => astra_responsive_spacing( $margin, 'left', 'desktop' ), 'margin-right' => astra_responsive_spacing( $margin, 'right', 'desktop' ), ), ); // Tablet CSS. $css_output_tablet = array( $selector => array( // Padding CSS. 'padding-top' => astra_responsive_spacing( $padding, 'top', 'tablet' ), 'padding-bottom' => astra_responsive_spacing( $padding, 'bottom', 'tablet' ), 'padding-left' => astra_responsive_spacing( $padding, 'left', 'tablet' ), 'padding-right' => astra_responsive_spacing( $padding, 'right', 'tablet' ), // Margin CSS. 'margin-top' => astra_responsive_spacing( $margin, 'top', 'tablet' ), 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'tablet' ), 'margin-left' => astra_responsive_spacing( $margin, 'left', 'tablet' ), 'margin-right' => astra_responsive_spacing( $margin, 'right', 'tablet' ), ), ); // Mobile CSS. $css_output_mobile = array( $selector => array( // Padding CSS. 'padding-top' => astra_responsive_spacing( $padding, 'top', 'mobile' ), 'padding-bottom' => astra_responsive_spacing( $padding, 'bottom', 'mobile' ), 'padding-left' => astra_responsive_spacing( $padding, 'left', 'mobile' ), 'padding-right' => astra_responsive_spacing( $padding, 'right', 'mobile' ), // Margin CSS. 'margin-top' => astra_responsive_spacing( $margin, 'top', 'mobile' ), 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'mobile' ), 'margin-left' => astra_responsive_spacing( $margin, 'left', 'mobile' ), 'margin-right' => astra_responsive_spacing( $margin, 'right', 'mobile' ), ), ); $css_output = astra_parse_css( $css_output_desktop ); $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); return $css_output; } return ''; } /** * Prepare Advanced Margin / Padding Dynamic CSS. * * @param string $section_id section id. * @param string $selector selector. * @return array */ public static function prepare_advanced_typography_css( $section_id, $selector ) { $font_size = astra_get_option( 'font-size-' . $section_id ); /** * Typography CSS. */ $css_output_desktop = array( $selector => array( // Typography. 'font-size' => astra_responsive_font( $font_size, 'desktop' ), ), ); $css_output_tablet = array( $selector => array( 'font-size' => astra_responsive_font( $font_size, 'tablet' ), ), ); $css_output_mobile = array( $selector => array( 'font-size' => astra_responsive_font( $font_size, 'mobile' ), ), ); /* Parse CSS from array() */ $css_output = astra_parse_css( $css_output_desktop ); $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); return $css_output; } /** * Prepare Footer Dynamic CSS. * * @param string $dynamic_css Appended dynamic CSS. * @param string $dynamic_css_filtered Filtered dynamic CSS. * @return array */ public static function footer_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) { /** * Tablet CSS. */ $css_output_tablet = array( '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-3-firstrow .ast-builder-grid-row > *:first-child, .ast-builder-grid-row-container.ast-builder-grid-row-tablet-3-lastrow .ast-builder-grid-row > *:last-child' => array( 'grid-column' => '1 / -1', ), ); /** * Mobile CSS. */ $css_output_mobile = array( '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-3-firstrow .ast-builder-grid-row > *:first-child, .ast-builder-grid-row-container.ast-builder-grid-row-mobile-3-lastrow .ast-builder-grid-row > *:last-child' => array( 'grid-column' => '1 / -1', ), ); /* Parse CSS from array() */ $css_output = astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); if ( is_customize_preview() ) { /** * Desktop CSS */ $css_output_desktop = array( '.ast-builder-grid-row-6-equal .ast-builder-grid-row' => array( 'grid-template-columns' => 'repeat( 6, 1fr )', ), '.ast-builder-grid-row-5-equal .ast-builder-grid-row' => array( 'grid-template-columns' => 'repeat( 5, 1fr )', ), '.ast-builder-grid-row-4-equal .ast-builder-grid-row' => array( 'grid-template-columns' => 'repeat( 4, 1fr )', ), '.ast-builder-grid-row-4-lheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '2fr 1fr 1fr 1fr', ), '.ast-builder-grid-row-4-rheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 1fr 1fr 2fr', ), '.ast-builder-grid-row-3-equal .ast-builder-grid-row' => array( 'grid-template-columns' => 'repeat( 3, 1fr )', ), '.ast-builder-grid-row-3-lheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '2fr 1fr 1fr', ), '.ast-builder-grid-row-3-rheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 1fr 2fr', ), '.ast-builder-grid-row-3-cheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 2fr 1fr', ), '.ast-builder-grid-row-3-cwide .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 3fr 1fr', ), '.ast-builder-grid-row-2-equal .ast-builder-grid-row' => array( 'grid-template-columns' => 'repeat( 2, 1fr )', ), '.ast-builder-grid-row-2-lheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '2fr 1fr', ), '.ast-builder-grid-row-2-rheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 2fr', ), '.ast-builder-grid-row-2-full .ast-builder-grid-row' => array( 'grid-template-columns' => '2fr', ), '.ast-builder-grid-row-full .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr', ), ); /** * Tablet CSS. */ $css_output_tablet = array( '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-6-equal .ast-builder-grid-row' => array( 'grid-template-columns' => 'repeat( 6, 1fr )', ), '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-5-equal .ast-builder-grid-row' => array( 'grid-template-columns' => 'repeat( 5, 1fr )', ), '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-4-equal .ast-builder-grid-row' => array( 'grid-template-columns' => 'repeat( 4, 1fr )', ), '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-4-lheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '2fr 1fr 1fr 1fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-4-rheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 1fr 1fr 2fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-3-equal .ast-builder-grid-row' => array( 'grid-template-columns' => 'repeat( 3, 1fr )', ), '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-3-lheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '2fr 1fr 1fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-3-rheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 1fr 2fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-3-cheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 2fr 1fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-3-cwide .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 3fr 1fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-3-firstrow .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 1fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-3-lastrow .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 1fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-2-equal .ast-builder-grid-row' => array( 'grid-template-columns' => 'repeat( 2, 1fr )', ), '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-2-lheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '2fr 1fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-2-rheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 2fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-tablet-full .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr', ), ); /** * Mobile CSS */ $css_output_mobile = array( '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-6-equal .ast-builder-grid-row' => array( 'grid-template-columns' => 'repeat( 6, 1fr )', ), '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-5-equal .ast-builder-grid-row' => array( 'grid-template-columns' => 'repeat( 5, 1fr )', ), '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-4-equal .ast-builder-grid-row' => array( 'grid-template-columns' => 'repeat( 4, 1fr )', ), '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-4-lheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '2fr 1fr 1fr 1fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-4-rheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 1fr 1fr 2fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-3-equal .ast-builder-grid-row' => array( 'grid-template-columns' => 'repeat( 3, 1fr )', ), '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-3-lheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '2fr 1fr 1fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-3-rheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 1fr 2fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-3-cheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 2fr 1fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-3-cwide .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 3fr 1fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-3-firstrow .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 1fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-3-lastrow .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 1fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-2-equal .ast-builder-grid-row' => array( 'grid-template-columns' => 'repeat( 2, 1fr )', ), '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-2-lheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '2fr 1fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-2-rheavy .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr 2fr', ), '.ast-builder-grid-row-container.ast-builder-grid-row-mobile-full .ast-builder-grid-row' => array( 'grid-template-columns' => '1fr', ), ); /* Parse CSS from array() */ $css_output .= astra_parse_css( $css_output_desktop ); $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); } $dynamic_css .= $css_output; return $dynamic_css; } /** * Different logo for mobile static CSS. * * @param string $dynamic_css Appended dynamic CSS. * @since 3.5.0 * @return string */ public static function mobile_header_logo_css( $dynamic_css ) { $mobile_header_logo = astra_get_option( 'mobile-header-logo' ); $different_mobile_header_order = astra_get_option( 'different-mobile-logo' ); if ( '' !== $mobile_header_logo && '1' == $different_mobile_header_order ) { $mobile_header_css = ' .ast-header-break-point .ast-has-mobile-header-logo .custom-logo-link { display: none; } .ast-header-break-point .ast-has-mobile-header-logo .custom-mobile-logo-link { display: inline-block; } .ast-header-break-point.ast-mobile-inherit-site-logo .ast-has-mobile-header-logo .custom-logo-link, .ast-header-break-point.ast-mobile-inherit-site-logo .ast-has-mobile-header-logo .astra-logo-svg { display: block; }'; $dynamic_css .= Astra_Enqueue_Scripts::trim_css( $mobile_header_css ); } return $dynamic_css; } /** * Prepare Element visibility Dynamic CSS. * * @param string $section_id section id. * @param string $selector selector. * @param string $default_property Section default CSS property. * @param string $mobile_tablet_default Mobile/Tabled display property. * @return array */ public static function prepare_visibility_css( $section_id, $selector, $default_property = 'flex', $mobile_tablet_default = '' ) { $astra_options = Astra_Theme_Options::get_astra_options(); $css_output_desktop = array(); $css_output_tablet = array(); $css_output_mobile = array(); // For Mobile/Tablet we need display grid property to display elements centered alignment. $mobile_tablet_default = ( $mobile_tablet_default ) ? $mobile_tablet_default : $default_property; $parent_visibility = astra_get_option( $section_id . '-visibility-responsive', array( 'desktop' => ! isset( $astra_options[ $section_id . '-visibility-responsive' ] ) && isset( $astra_options[ $section_id . '-hide-desktop' ] ) ? ( $astra_options[ $section_id . '-hide-desktop' ] ? 0 : 1 ) : 1, 'tablet' => ! isset( $astra_options[ $section_id . '-visibility-responsive' ] ) && isset( $astra_options[ $section_id . '-hide-tablet' ] ) ? ( $astra_options[ $section_id . '-hide-tablet' ] ? 0 : 1 ) : 1, 'mobile' => ! isset( $astra_options[ $section_id . '-visibility-responsive' ] ) && isset( $astra_options[ $section_id . '-hide-mobile' ] ) ? ( $astra_options[ $section_id . '-hide-mobile' ] ? 0 : 1 ) : 1, ) ); $hide_desktop = ( $parent_visibility['desktop'] ) ? $default_property : 'none'; $hide_tablet = ( $parent_visibility['tablet'] ) ? $mobile_tablet_default : 'none'; $hide_mobile = ( $parent_visibility['mobile'] ) ? $mobile_tablet_default : 'none'; $css_output_desktop = array( $selector => array( 'display' => $hide_desktop, ), ); $css_output_tablet = array( '.ast-header-break-point ' . $selector => array( 'display' => $hide_tablet, ), ); $css_output_mobile = array( '.ast-header-break-point ' . $selector => array( 'display' => $hide_mobile, ), ); /* Parse CSS from array() */ $css_output = astra_parse_css( $css_output_desktop ); $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); return $css_output; } } /** * Prepare if class 'Astra_Builder_Base_Dynamic_CSS' exist. * Kicking this off by calling 'get_instance()' method */ Astra_Builder_Base_Dynamic_CSS::get_instance(); } PK!)markup/09/class-astra-wpfooter-schema.phpnu[schema_enabled() ) { return false; } add_filter( 'astra_attr_footer', array( $this, 'wpfooter_Schema' ) ); } /** * Update Schema markup attribute. * * @param array $attr An array of attributes. * * @return array Updated embed markup. */ public function wpfooter_Schema( $attr ) { $attr['itemtype'] = 'https://schema.org/WPFooter'; $attr['itemscope'] = 'itemscope'; $attr['itemid'] = '#colophon'; return $attr; } /** * Enabled schema * * @since 2.1.3 */ protected function schema_enabled() { return apply_filters( 'astra_wpfooter_schema_enabled', parent::schema_enabled() ); } } new Astra_WPFooter_Schema(); PK!C0markup/09/class-astra-site-navigation-schema.phpnu[schema_enabled() ) { return false; } add_filter( 'astra_attr_site-navigation', array( $this, 'site_navigation_schema' ) ); } /** * Update Schema markup attribute. * * @param array $attr An array of attributes. * * @return array Updated embed markup. */ public function site_navigation_schema( $attr ) { $attr['itemtype'] = 'https://schema.org/SiteNavigationElement'; $attr['itemscope'] = 'itemscope'; return $attr; } /** * Enabled schema * * @since 2.1.3 */ protected function schema_enabled() { return apply_filters( 'astra_site_navigation_schema_enabled', parent::schema_enabled() ); } } new Astra_Site_Navigation_Schema(); PK!ğ*markup/09/class-astra-wpsidebar-schema.phpnu[schema_enabled() ) { return false; } add_filter( 'astra_attr_sidebar', array( $this, 'wpsidebar_Schema' ) ); } /** * Update Schema markup attribute. * * @param array $attr An array of attributes. * * @return array Updated embed markup. */ public function wpsidebar_Schema( $attr ) { $attr['itemtype'] = 'https://schema.org/WPSideBar'; $attr['itemscope'] = 'itemscope'; return $attr; } /** * Enabled schema * * @since 2.1.3 */ protected function schema_enabled() { return apply_filters( 'astra_wpsidebar_schema_enabled', parent::schema_enabled() ); } } new Astra_WPSideBar_Schema(); PK!-v v 'markup/09/class-astra-person-schema.phpnu[schema_enabled() ) { return false; } add_filter( 'astra_attr_post-meta-author', array( $this, 'person_Schema' ) ); add_filter( 'astra_attr_author-name', array( $this, 'author_name_schema_itemprop' ) ); add_filter( 'astra_attr_author-url', array( $this, 'author_url_schema_itemprop' ) ); add_filter( 'astra_attr_author-name-info', array( $this, 'author_name_info_schema_itemprop' ) ); add_filter( 'astra_attr_author-url-info', array( $this, 'author_info_url_schema_itemprop' ) ); add_filter( 'astra_attr_author-item-info', array( $this, 'author_item_schema_itemprop' ) ); add_filter( 'astra_attr_author-desc-info', array( $this, 'author_desc_schema_itemprop' ) ); } /** * Update Schema markup attribute. * * @param array $attr An array of attributes. * * @return array Updated embed markup. */ public function person_Schema( $attr ) { $attr['itemtype'] = 'https://schema.org/Person'; $attr['itemscope'] = 'itemscope'; $attr['itemprop'] = 'author'; $attr['class'] = 'posted-by vcard author'; return $attr; } /** * Update Schema markup attribute. * * @param array $attr An array of attributes. * * @return array Updated embed markup. */ public function author_name_schema_itemprop( $attr ) { $attr['itemprop'] = 'name'; return $attr; } /** * Update Schema markup attribute. * * @param array $attr An array of attributes. * * @return array Updated embed markup. */ public function author_name_info_schema_itemprop( $attr ) { $attr['itemprop'] = 'name'; return $attr; } /** * Update Schema markup attribute. * * @param array $attr An array of attributes. * * @return array Updated embed markup. */ public function author_url_schema_itemprop( $attr ) { $attr['itemprop'] = 'url'; return $attr; } /** * Update Schema markup attribute. * * @param array $attr An array of attributes. * * @return array Updated embed markup. */ public function author_info_url_schema_itemprop( $attr ) { $attr['itemprop'] = 'url'; return $attr; } /** * Update Schema markup attribute. * * @param array $attr An array of attributes. * * @return array Updated embed markup. */ public function author_desc_schema_itemprop( $attr ) { $attr['itemprop'] = 'description'; return $attr; } /** * Update Schema markup attribute. * * @param array $attr An array of attributes. * * @return array Updated embed markup. */ public function author_item_schema_itemprop( $attr ) { $attr['itemprop'] = 'author'; return $attr; } /** * Enabled schema * * @since 2.1.3 */ protected function schema_enabled() { return apply_filters( 'astra_person_schema_enabled', parent::schema_enabled() ); } } new Astra_Person_Schema(); PK!L*88 tooltip.jsnu[/*! * jQuery UI Tooltip 1.13.3 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * https://jquery.org/license */ //>>label: Tooltip //>>group: Widgets //>>description: Shows additional information for any element on hover or focus. //>>docs: https://api.jqueryui.com/tooltip/ //>>demos: https://jqueryui.com/tooltip/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/tooltip.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "../keycode", "../position", "../unique-id", "../version", "../widget" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; $.widget( "ui.tooltip", { version: "1.13.3", options: { classes: { "ui-tooltip": "ui-corner-all ui-widget-shadow" }, content: function() { var title = $( this ).attr( "title" ); // Escape title, since we're going from an attribute to raw HTML return $( "" ).text( title ).html(); }, hide: true, // Disabled elements have inconsistent behavior across browsers (#8661) items: "[title]:not([disabled])", position: { my: "left top+15", at: "left bottom", collision: "flipfit flip" }, show: true, track: false, // Callbacks close: null, open: null }, _addDescribedBy: function( elem, id ) { var describedby = ( elem.attr( "aria-describedby" ) || "" ).split( /\s+/ ); describedby.push( id ); elem .data( "ui-tooltip-id", id ) .attr( "aria-describedby", String.prototype.trim.call( describedby.join( " " ) ) ); }, _removeDescribedBy: function( elem ) { var id = elem.data( "ui-tooltip-id" ), describedby = ( elem.attr( "aria-describedby" ) || "" ).split( /\s+/ ), index = $.inArray( id, describedby ); if ( index !== -1 ) { describedby.splice( index, 1 ); } elem.removeData( "ui-tooltip-id" ); describedby = String.prototype.trim.call( describedby.join( " " ) ); if ( describedby ) { elem.attr( "aria-describedby", describedby ); } else { elem.removeAttr( "aria-describedby" ); } }, _create: function() { this._on( { mouseover: "open", focusin: "open" } ); // IDs of generated tooltips, needed for destroy this.tooltips = {}; // IDs of parent tooltips where we removed the title attribute this.parents = {}; // Append the aria-live region so tooltips announce correctly this.liveRegion = $( "
" ) .attr( { role: "log", "aria-live": "assertive", "aria-relevant": "additions" } ) .appendTo( this.document[ 0 ].body ); this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" ); this.disabledTitles = $( [] ); }, _setOption: function( key, value ) { var that = this; this._super( key, value ); if ( key === "content" ) { $.each( this.tooltips, function( id, tooltipData ) { that._updateContent( tooltipData.element ); } ); } }, _setOptionDisabled: function( value ) { this[ value ? "_disable" : "_enable" ](); }, _disable: function() { var that = this; // Close open tooltips $.each( this.tooltips, function( id, tooltipData ) { var event = $.Event( "blur" ); event.target = event.currentTarget = tooltipData.element[ 0 ]; that.close( event, true ); } ); // Remove title attributes to prevent native tooltips this.disabledTitles = this.disabledTitles.add( this.element.find( this.options.items ).addBack() .filter( function() { var element = $( this ); if ( element.is( "[title]" ) ) { return element .data( "ui-tooltip-title", element.attr( "title" ) ) .removeAttr( "title" ); } } ) ); }, _enable: function() { // restore title attributes this.disabledTitles.each( function() { var element = $( this ); if ( element.data( "ui-tooltip-title" ) ) { element.attr( "title", element.data( "ui-tooltip-title" ) ); } } ); this.disabledTitles = $( [] ); }, open: function( event ) { var that = this, target = $( event ? event.target : this.element ) // we need closest here due to mouseover bubbling, // but always pointing at the same event target .closest( this.options.items ); // No element to show a tooltip for or the tooltip is already open if ( !target.length || target.data( "ui-tooltip-id" ) ) { return; } if ( target.attr( "title" ) ) { target.data( "ui-tooltip-title", target.attr( "title" ) ); } target.data( "ui-tooltip-open", true ); // Kill parent tooltips, custom or native, for hover if ( event && event.type === "mouseover" ) { target.parents().each( function() { var parent = $( this ), blurEvent; if ( parent.data( "ui-tooltip-open" ) ) { blurEvent = $.Event( "blur" ); blurEvent.target = blurEvent.currentTarget = this; that.close( blurEvent, true ); } if ( parent.attr( "title" ) ) { parent.uniqueId(); that.parents[ this.id ] = { element: this, title: parent.attr( "title" ) }; parent.attr( "title", "" ); } } ); } this._registerCloseHandlers( event, target ); this._updateContent( target, event ); }, _updateContent: function( target, event ) { var content, contentOption = this.options.content, that = this, eventType = event ? event.type : null; if ( typeof contentOption === "string" || contentOption.nodeType || contentOption.jquery ) { return this._open( event, target, contentOption ); } content = contentOption.call( target[ 0 ], function( response ) { // IE may instantly serve a cached response for ajax requests // delay this call to _open so the other call to _open runs first that._delay( function() { // Ignore async response if tooltip was closed already if ( !target.data( "ui-tooltip-open" ) ) { return; } // JQuery creates a special event for focusin when it doesn't // exist natively. To improve performance, the native event // object is reused and the type is changed. Therefore, we can't // rely on the type being correct after the event finished // bubbling, so we set it back to the previous value. (#8740) if ( event ) { event.type = eventType; } this._open( event, target, response ); } ); } ); if ( content ) { this._open( event, target, content ); } }, _open: function( event, target, content ) { var tooltipData, tooltip, delayedShow, a11yContent, positionOption = $.extend( {}, this.options.position ); if ( !content ) { return; } // Content can be updated multiple times. If the tooltip already // exists, then just update the content and bail. tooltipData = this._find( target ); if ( tooltipData ) { tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content ); return; } // If we have a title, clear it to prevent the native tooltip // we have to check first to avoid defining a title if none exists // (we don't want to cause an element to start matching [title]) // // We use removeAttr only for key events, to allow IE to export the correct // accessible attributes. For mouse events, set to empty string to avoid // native tooltip showing up (happens only when removing inside mouseover). if ( target.is( "[title]" ) ) { if ( event && event.type === "mouseover" ) { target.attr( "title", "" ); } else { target.removeAttr( "title" ); } } tooltipData = this._tooltip( target ); tooltip = tooltipData.tooltip; this._addDescribedBy( target, tooltip.attr( "id" ) ); tooltip.find( ".ui-tooltip-content" ).html( content ); // Support: Voiceover on OS X, JAWS on IE <= 9 // JAWS announces deletions even when aria-relevant="additions" // Voiceover will sometimes re-read the entire log region's contents from the beginning this.liveRegion.children().hide(); a11yContent = $( "
" ).html( tooltip.find( ".ui-tooltip-content" ).html() ); a11yContent.removeAttr( "name" ).find( "[name]" ).removeAttr( "name" ); a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" ); a11yContent.appendTo( this.liveRegion ); function position( event ) { positionOption.of = event; if ( tooltip.is( ":hidden" ) ) { return; } tooltip.position( positionOption ); } if ( this.options.track && event && /^mouse/.test( event.type ) ) { this._on( this.document, { mousemove: position } ); // trigger once to override element-relative positioning position( event ); } else { tooltip.position( $.extend( { of: target }, this.options.position ) ); } tooltip.hide(); this._show( tooltip, this.options.show ); // Handle tracking tooltips that are shown with a delay (#8644). As soon // as the tooltip is visible, position the tooltip using the most recent // event. // Adds the check to add the timers only when both delay and track options are set (#14682) if ( this.options.track && this.options.show && this.options.show.delay ) { delayedShow = this.delayedShow = setInterval( function() { if ( tooltip.is( ":visible" ) ) { position( positionOption.of ); clearInterval( delayedShow ); } }, 13 ); } this._trigger( "open", event, { tooltip: tooltip } ); }, _registerCloseHandlers: function( event, target ) { var events = { keyup: function( event ) { if ( event.keyCode === $.ui.keyCode.ESCAPE ) { var fakeEvent = $.Event( event ); fakeEvent.currentTarget = target[ 0 ]; this.close( fakeEvent, true ); } } }; // Only bind remove handler for delegated targets. Non-delegated // tooltips will handle this in destroy. if ( target[ 0 ] !== this.element[ 0 ] ) { events.remove = function() { var targetElement = this._find( target ); if ( targetElement ) { this._removeTooltip( targetElement.tooltip ); } }; } if ( !event || event.type === "mouseover" ) { events.mouseleave = "close"; } if ( !event || event.type === "focusin" ) { events.focusout = "close"; } this._on( true, target, events ); }, close: function( event ) { var tooltip, that = this, target = $( event ? event.currentTarget : this.element ), tooltipData = this._find( target ); // The tooltip may already be closed if ( !tooltipData ) { // We set ui-tooltip-open immediately upon open (in open()), but only set the // additional data once there's actually content to show (in _open()). So even if the // tooltip doesn't have full data, we always remove ui-tooltip-open in case we're in // the period between open() and _open(). target.removeData( "ui-tooltip-open" ); return; } tooltip = tooltipData.tooltip; // Disabling closes the tooltip, so we need to track when we're closing // to avoid an infinite loop in case the tooltip becomes disabled on close if ( tooltipData.closing ) { return; } // Clear the interval for delayed tracking tooltips clearInterval( this.delayedShow ); // Only set title if we had one before (see comment in _open()) // If the title attribute has changed since open(), don't restore if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) { target.attr( "title", target.data( "ui-tooltip-title" ) ); } this._removeDescribedBy( target ); tooltipData.hiding = true; tooltip.stop( true ); this._hide( tooltip, this.options.hide, function() { that._removeTooltip( $( this ) ); } ); target.removeData( "ui-tooltip-open" ); this._off( target, "mouseleave focusout keyup" ); // Remove 'remove' binding only on delegated targets if ( target[ 0 ] !== this.element[ 0 ] ) { this._off( target, "remove" ); } this._off( this.document, "mousemove" ); if ( event && event.type === "mouseleave" ) { $.each( this.parents, function( id, parent ) { $( parent.element ).attr( "title", parent.title ); delete that.parents[ id ]; } ); } tooltipData.closing = true; this._trigger( "close", event, { tooltip: tooltip } ); if ( !tooltipData.hiding ) { tooltipData.closing = false; } }, _tooltip: function( element ) { var tooltip = $( "
" ).attr( "role", "tooltip" ), content = $( "
" ).appendTo( tooltip ), id = tooltip.uniqueId().attr( "id" ); this._addClass( content, "ui-tooltip-content" ); this._addClass( tooltip, "ui-tooltip", "ui-widget ui-widget-content" ); tooltip.appendTo( this._appendTo( element ) ); return this.tooltips[ id ] = { element: element, tooltip: tooltip }; }, _find: function( target ) { var id = target.data( "ui-tooltip-id" ); return id ? this.tooltips[ id ] : null; }, _removeTooltip: function( tooltip ) { // Clear the interval for delayed tracking tooltips clearInterval( this.delayedShow ); tooltip.remove(); delete this.tooltips[ tooltip.attr( "id" ) ]; }, _appendTo: function( target ) { var element = target.closest( ".ui-front, dialog" ); if ( !element.length ) { element = this.document[ 0 ].body; } return element; }, _destroy: function() { var that = this; // Close open tooltips $.each( this.tooltips, function( id, tooltipData ) { // Delegate to close method to handle common cleanup var event = $.Event( "blur" ), element = tooltipData.element; event.target = event.currentTarget = element[ 0 ]; that.close( event, true ); // Remove immediately; destroying an open tooltip doesn't use the // hide animation $( "#" + id ).remove(); // Restore the title if ( element.data( "ui-tooltip-title" ) ) { // If the title attribute has changed since open(), don't restore if ( !element.attr( "title" ) ) { element.attr( "title", element.data( "ui-tooltip-title" ) ); } element.removeData( "ui-tooltip-title" ); } } ); this.liveRegion.remove(); } } ); // DEPRECATED // TODO: Switch return back to widget declaration at top of file when this is removed if ( $.uiBackCompat !== false ) { // Backcompat for tooltipClass option $.widget( "ui.tooltip", $.ui.tooltip, { options: { tooltipClass: null }, _tooltip: function() { var tooltipData = this._superApply( arguments ); if ( this.options.tooltipClass ) { tooltipData.tooltip.addClass( this.options.tooltipClass ); } return tooltipData; } } ); } return $.ui.tooltip; } ); PK!@class-IXR-request.phpnu[method = $method; $this->args = $args; $this->xml = << {$this->method} EOD; foreach ($this->args as $arg) { $this->xml .= ''; $v = new IXR_Value($arg); $this->xml .= $v->getXml(); $this->xml .= "\n"; } $this->xml .= ''; } /** * PHP4 constructor. */ public function IXR_Request( $method, $args ) { self::__construct( $method, $args ); } function getLength() { return strlen($this->xml); } function getXml() { return $this->xml; } } PK!JM M 1menu/class-astra-header-menu-component-loader.phpnu[ defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_menu, 'nav_menu_enabled' => ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'nav-menu' ) ) ? true : false, 'tablet_break_point' => astra_get_tablet_breakpoint(), 'mobile_break_point' => astra_get_mobile_breakpoint(), ) ); } } /** * Kicking this off by creating the object of the class. */ new Astra_Header_Menu_Component_Loader(); PK!~E*menu/class-astra-header-menu-component.phpnu[). * * @since 3.0.0 * @var Array */ $menu_classes = apply_filters( 'astra_' . $theme_location . '_menu_classes', array( 'main-header-menu', 'ast-menu-shadow', 'ast-nav-menu', 'ast-flex', $submenu_class, $stack_on_mobile_class ) ); $items_wrap = ''; // Fallback Menu if primary menu not set. $fallback_menu_args = array( 'theme_location' => $theme_location, 'menu_id' => 'ast-hf-menu-' . $index, 'menu_class' => 'main-navigation ast-inline-flex', 'container' => 'div', 'before' => '
    ', 'after' => '
', 'walker' => new Astra_Walker_Page(), ); // To add default alignment for navigation which can be added through any third party plugin. // Do not add any CSS from theme except header alignment. echo '
'; if ( is_customize_preview() ) { Astra_Builder_UI_Controller::render_customizer_edit_button(); } if ( has_nav_menu( $theme_location ) ) { /** @psalm-suppress ArgumentTypeCoercion */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort wp_nav_menu( array( 'menu_id' => 'ast-hf-menu-' . $index, 'menu_class' => esc_attr( implode( ' ', $menu_classes ) ), 'container' => 'div', 'container_class' => 'main-header-bar-navigation', 'items_wrap' => $items_wrap, 'theme_location' => $theme_location, ) ); /** @psalm-suppress ArgumentTypeCoercion */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort } else { echo '
'; echo ''; echo '
'; } echo '
'; } } /** * Kicking this off by creating an object. */ new Astra_Header_Menu_Component(); PK!L4//menu/html/class-astra-header-html-component.phpnu[ defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_html, ) ); } } /** * Kicking this off by creating the object of the class. */ new Astra_Header_Html_Component_Loader(); PK!nMM6menu/html/assets/js/minified/customizer-preview.min.jsnu[jQuery,astra_builder_html_css("header",AstraBuilderHTMLData.component_limit);PK! 4menu/html/assets/js/unminified/customizer-preview.jsnu[/** * This file adds some LIVE to the Customizer live preview. To leverage * this, set your custom settings to 'postMessage' and then add your handling * here. Your javascript should grab settings from customizer controls, and * then make any necessary changes to the page using jQuery. * * @package Astra Builder * @since 3.0.0 */ ( function( $ ) { astra_builder_html_css( 'header', AstraBuilderHTMLData.component_limit ); } )( jQuery ); PK!a1%menu/html/dynamic-css/dynamic.css.phpnu[ element.addEventListener('click', function (event) { removeMetaBoxSection(); })); [...document.querySelectorAll('.editor-post-publish-panel__toggle')].forEach(element => element.addEventListener('click', function (event) { removeMetaBoxSection(); })); } function DOMContentLoaded() { const elementMetaBox = document.getElementById("the-list"); if (elementMetaBox != null) { setTimeout(buttonClickEvent, 2000); } } document.addEventListener('DOMContentLoaded', DOMContentLoaded, false); PK!j$js/astra-admin-menu-settings.jsnu[/** * Install Starter Templates * * * @since 1.2.4 */ (function($){ AstraThemeAdmin = { init: function() { this._bind(); }, /** * Binds events for the Astra Theme. * * @since 1.0.0 * @access private * @method _bind */ _bind: function() { $( document ).on('ast-after-plugin-active', AstraThemeAdmin._disableActivcationNotice ); $( document ).on('click' , '.astra-install-recommended-plugin', AstraThemeAdmin._installNow ); $( document ).on('click' , '.astra-activate-recommended-plugin', AstraThemeAdmin._activatePlugin); $( document ).on('wp-plugin-install-success' , AstraThemeAdmin._activatePlugin); $( document ).on('wp-plugin-install-error' , AstraThemeAdmin._installError); $( document ).on('wp-plugin-installing' , AstraThemeAdmin._pluginInstalling); }, /** * Plugin Installation Error. */ _installError: function( event, response ) { var $card = jQuery( '.astra-install-recommended-plugin' ); $card .removeClass( 'button-primary' ) .addClass( 'disabled' ) .html( wp.updates.l10n.installFailedShort ); }, /** * Installing Plugin */ _pluginInstalling: function(event, args) { event.preventDefault(); var slug = args.slug; var $card = jQuery( '.astra-install-recommended-plugin' ); var activatingText = astra.recommendedPluiginActivatingText; $card.each(function( index, element ) { element = jQuery( element ); if ( element.data('slug') === slug ) { element.addClass('updating-message'); element.html( activatingText ); } }); }, /** * Activate Success */ _activatePlugin: function( event, response ) { event.preventDefault(); var $message = jQuery(event.target); var $init = $message.data('init'); var activatedSlug; if (typeof $init === 'undefined') { var $message = jQuery('.astra-install-recommended-plugin[data-slug=' + response.slug + ']'); activatedSlug = response.slug; } else { activatedSlug = $init; } // Transform the 'Install' button into an 'Activate' button. var $init = $message.data('init'); var activatingText = astra.recommendedPluiginActivatingText; var astraSitesLink = astra.astraSitesLink; var astraPluginRecommendedNonce = astra.astraPluginManagerNonce; $message.removeClass( 'install-now installed button-disabled updated-message' ) .addClass('updating-message') .html( activatingText ); // WordPress adds "Activate" button after waiting for 1000ms. So we will run our activation after that. setTimeout( function() { $.ajax({ url: astra.ajaxUrl, type: 'POST', data: { 'action' : 'astra_recommended_plugin_activate', 'security' : astraPluginRecommendedNonce, 'init' : $init, }, }) .done(function (result) { console.error( result ); if( result.success ) { $message.removeClass( 'astra-activate-recommended-plugin astra-install-recommended-plugin button button-primary install-now activate-now updating-message' ); $message.parent('.ast-addon-link-wrapper').parent('.astra-recommended-plugin').addClass('active'); jQuery(document).trigger( 'ast-after-plugin-active', [astraSitesLink, activatedSlug] ); } else { $message.removeClass( 'updating-message' ); } }); }, 1200 ); }, /** * Install Now */ _installNow: function(event) { event.preventDefault(); var $button = jQuery( event.target ), $document = jQuery(document); if ( $button.hasClass( 'updating-message' ) || $button.hasClass( 'button-disabled' ) ) { return; } if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.ajaxLocked ) { wp.updates.requestFilesystemCredentials( event ); $document.on( 'credential-modal-cancel', function() { var $message = $( '.astra-install-recommended-plugin.updating-message' ); $message .addClass('astra-activate-recommended-plugin') .removeClass( 'updating-message astra-install-recommended-plugin' ) .text( wp.updates.l10n.installNow ); wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' ); } ); } wp.updates.installPlugin( { slug: $button.data( 'slug' ) }); }, /** * After plugin active redirect and deactivate activation notice */ _disableActivcationNotice: function( event, astraSitesLink, activatedSlug ) { event.preventDefault(); if ( activatedSlug.indexOf( 'astra-sites' ) >= 0 || activatedSlug.indexOf( 'astra-pro-sites' ) >= 0 ) { if ( 'undefined' != typeof AstraNotices ) { AstraNotices._ajax( 'astra-sites-on-active', '' ); } window.location.href = astraSitesLink + '&ast-disable-activation-notice'; } }, }; /** * Initialize AstraThemeAdmin */ $(function(){ AstraThemeAdmin.init(); }); })(jQuery); PK! 00js/block-editor-script.jsnu[ window.addEventListener( 'load', function(e) { astra_onload_function(); }); function astra_onload_function() { /* Do things after DOM has fully loaded */ var astraMetaBox = document.querySelector( '#astra_settings_meta_box' ); if( astraMetaBox != null ){ var titleCheckbox = document.getElementById('site-post-title'); if( null === titleCheckbox ) { titleCheckbox = document.querySelector('.site-post-title input'); } if( null !== titleCheckbox ) { titleCheckbox.addEventListener('change',function() { var titleBlock = document.querySelector('.editor-post-title__block'); if( null !== titleBlock ) { if( titleCheckbox.checked ){ titleBlock.style.opacity = '0.2'; } else { titleBlock.style.opacity = '1.0'; } } }); } } wp.data.subscribe(function () { setTimeout( function () { // Compatibility for updating layout in editor with direct reflection. const contentLayout = ( undefined !== wp.data.select( 'core/editor' ) && null !== wp.data.select( 'core/editor' ) && undefined !== wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' ) && wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-content-layout'] ) ? wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-content-layout'] : 'default', bodyClass = document.querySelector('body'); switch( contentLayout ) { case 'boxed-container': bodyClass.classList.add('ast-separate-container' , 'ast-two-container'); bodyClass.classList.remove('ast-page-builder-template' , 'ast-plain-container', 'ast-narrow-container'); break; case 'content-boxed-container': bodyClass.classList.add('ast-separate-container'); bodyClass.classList.remove('ast-two-container' , 'ast-page-builder-template' , 'ast-plain-container', 'ast-narrow-container'); break; case 'plain-container': bodyClass.classList.add('ast-plain-container'); bodyClass.classList.remove('ast-two-container' , 'ast-page-builder-template' , 'ast-separate-container', 'ast-narrow-container'); break; case 'page-builder': bodyClass.classList.add('ast-page-builder-template'); bodyClass.classList.remove('ast-two-container' , 'ast-plain-container' , 'ast-separate-container', 'ast-narrow-container'); break; case 'narrow-container': bodyClass.classList.add('ast-narrow-container'); bodyClass.classList.remove('ast-two-container' , 'ast-plain-container' , 'ast-separate-container', 'ast-page-builder-template'); break; case 'default': if( bodyClass.classList.contains( 'ast-default-layout-boxed-container' ) ) { bodyClass.classList.add('ast-separate-container' , 'ast-two-container'); bodyClass.classList.remove('ast-page-builder-template' , 'ast-plain-container', 'ast-narrow-container'); } else if( bodyClass.classList.contains( 'ast-default-layout-content-boxed-container' ) ) { bodyClass.classList.add('ast-separate-container'); bodyClass.classList.remove('ast-two-container' , 'ast-page-builder-template' , 'ast-plain-container', 'ast-narrow-container'); } else if( bodyClass.classList.contains( 'ast-default-layout-page-builder' ) ) { bodyClass.classList.add('ast-page-builder-template'); bodyClass.classList.remove('ast-two-container' , 'ast-plain-container' , 'ast-separate-container', 'ast-narrow-container'); } else if( bodyClass.classList.contains( 'ast-default-layout-plain-container' ) ) { bodyClass.classList.add('ast-plain-container'); bodyClass.classList.remove('ast-two-container' , 'ast-page-builder-template' , 'ast-separate-container', 'ast-narrow-container'); } else if( bodyClass.classList.contains( 'ast-default-layout-narrow-container' ) ) { bodyClass.classList.add('ast-narrow-container'); bodyClass.classList.remove('ast-two-container' , 'ast-page-builder-template' , 'ast-separate-container', 'ast-plain-container'); } break; } const editorStylesWrapper = document.querySelector( '.editor-styles-wrapper' ); if( null !== editorStylesWrapper ) { const editorStylesWrapperWidth = parseInt( editorStylesWrapper.offsetWidth ) if( editorStylesWrapperWidth < 1350 ) { editorStylesWrapper.classList.remove( 'ast-stacked-title-visibility' ); editorStylesWrapper.classList.add( 'ast-stacked-title-visibility' ); } else { editorStylesWrapper.classList.remove( 'ast-stacked-title-visibility' ); } } /** * In WP-5.9 block editor comes up with color palette showing color-code canvas, but with theme var() CSS its appearing directly as it is. So updated them on wp.data event. */ const customColorPickerButtons = document.querySelectorAll( '.components-color-palette__custom-color-value' ); for ( let btnCount = 0; btnCount < customColorPickerButtons.length; btnCount++ ) { let colorCode = customColorPickerButtons[btnCount].innerText, transformedCode = colorCode.toLowerCase(); if ( colorCode.indexOf( 'VAR(--AST-GLOBAL-COLOR' ) > -1 ) { customColorPickerButtons[btnCount].innerHTML = astraColors[ transformedCode ]; } } // Title visibility with new editor compatibility update. var titleVisibility = document.querySelector( '.title-visibility' ), titleBlock = document.querySelector( '.edit-post-visual-editor__post-title-wrapper' ); if( null === titleVisibility && null !== titleBlock ) { var titleVisibilityTrigger = ''; if( 'disabled' === wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-post-title'] ) { titleVisibilityTrigger = ''; titleBlock.classList.toggle( 'invisible' ); } else { titleVisibilityTrigger = ''; } titleBlock.insertAdjacentHTML( 'beforeend', titleVisibilityTrigger ); document.querySelector( '.title-visibility' ).addEventListener( 'click', function() { var titleBlock = document.querySelector( '.edit-post-visual-editor__post-title-wrapper' ); titleBlock.classList.toggle( 'invisible' ); if( this.classList.contains( 'dashicons-hidden' ) ) { this.classList.add( 'dashicons-visibility' ); this.classList.remove( 'dashicons-hidden' ); this.dataset.tooltip = 'Disable Title'; wp.data.dispatch( 'core/editor' ).editPost( { meta: { 'site-post-title': '', } } ); } else { this.classList.add( 'dashicons-hidden' ); this.classList.remove( 'dashicons-visibility' ); this.dataset.tooltip = 'Enable Title'; wp.data.dispatch( 'core/editor' ).editPost( { meta: { 'site-post-title': 'disabled', } } ); } }); } // Show post/page title wrapper outline & eye icon only when clicked. const titleInput = document.querySelector('.editor-post-title__input'); const visibilityIcon = document.querySelector('.title-visibility'); if( null != titleInput && null != visibilityIcon ) { document.addEventListener('click', function (event){ if( ! titleBlock.contains( event.target ) ){ visibilityIcon.classList.remove('ast-show-visibility-icon'); titleInput.classList.remove('ast-show-editor-title-outline'); } }); document.addEventListener('visibilitychange', function (){ visibilityIcon.classList.remove('ast-show-visibility-icon'); titleInput.classList.remove('ast-show-editor-title-outline'); }); titleBlock.addEventListener('focusout', function (){ visibilityIcon.classList.remove('ast-show-visibility-icon'); titleInput.classList.remove('ast-show-editor-title-outline'); }); titleBlock.addEventListener('click', function (){ visibilityIcon.classList.add('ast-show-visibility-icon'); titleInput.classList.add('ast-show-editor-title-outline'); }); titleInput.addEventListener('input', function (){ visibilityIcon.classList.add('ast-show-visibility-icon'); this.classList.add('ast-show-editor-title-outline'); }); } var responsivePreview = document.querySelectorAll( '.is-tablet-preview, .is-mobile-preview' ); if( responsivePreview.length ) { document.body.classList.add( 'responsive-enabled' ); } else { document.body.classList.remove( 'responsive-enabled' ); } // Adding 'inherit-container-width' width to Group block externally. let postBlocks = ( undefined !== wp.data.select( 'core/editor' ) && null !== wp.data.select( 'core/editor' ) && undefined !== wp.data.select( 'core/editor' ).getCurrentPost() && undefined !== wp.data.select( 'core/block-editor' ).getBlocks() ) ? wp.data.select( 'core/block-editor' ).getBlocks() : false, groupBlocks = document.querySelectorAll( '.block-editor-block-list__layout.is-root-container > .wp-block-group' ); if( postBlocks && groupBlocks ) { for ( let blockNum = 0; blockNum < postBlocks.length; blockNum++ ) { if( 'core/group' === postBlocks[blockNum].name && undefined !== postBlocks[blockNum].attributes && undefined !== postBlocks[blockNum].attributes.layout && undefined !== postBlocks[blockNum].attributes.layout.inherit ) { if( undefined === groupBlocks[blockNum] ) { return; } if( ! postBlocks[blockNum].attributes.layout.inherit ) { groupBlocks[blockNum].classList.remove( 'inherit-container-width' ); } if( postBlocks[blockNum].attributes.layout.inherit && ! groupBlocks[blockNum].classList.contains( 'inherit-container-width' ) ) { groupBlocks[blockNum].classList.add( 'inherit-container-width' ); } } } } }, 1 ); }); } document.body.addEventListener('mousedown', function () { var blockCssMode = document.querySelector('body').classList.contains('ast-block-legacy') var fontCss = document.getElementById('astra-google-fonts-css'); if(true === blockCssMode){ var blockCss = document.getElementById('astra-block-editor-styles-css'); var inlineCss = document.getElementById('astra-block-editor-styles-inline-css'); }else { var blockCss = document.getElementById('astra-wp-editor-styles-css'); var inlineCss = document.getElementById('astra-wp-editor-styles-inline-css'); } var blockFixCss = null !== blockCss ? blockCss.cloneNode(true) : null; var blockInlineCss = null !== inlineCss ? inlineCss.cloneNode(true) : null; var blockfontCss = null !== fontCss ? fontCss.cloneNode(true) : null; setTimeout( function() { let tabletPreview = document.getElementsByClassName('is-tablet-preview'); let mobilePreview = document.getElementsByClassName('is-mobile-preview'); if (0 !== tabletPreview.length || 0 !== mobilePreview.length) { var googleFontId = 'astra-google-fonts-css'; if(true === blockCssMode){ var styleTagId = 'astra-block-editor-styles-inline-css'; var styleTagBlockId = 'astra-block-editor-styles-css'; } else{ var styleTagId = 'astra-wp-editor-styles-inline-css'; var styleTagBlockId = 'astra-wp-editor-styles-css'; } var styleTagId = 'astra-block-editor-styles-inline-css'; var styleTagBlockId = 'astra-block-editor-styles-css'; var googleFontId = 'astra-google-fonts-css'; let preview = tabletPreview[0] || mobilePreview[0]; let iframe = preview.getElementsByTagName('iframe')[0]; let iframeDocument = iframe.contentWindow.document || iframe.contentDocument; let element = iframeDocument.getElementById( styleTagId ); let elementBlock = iframeDocument.getElementById( styleTagBlockId ); let elementGoogleFont = iframeDocument.getElementById( googleFontId ); if ( (null === element || undefined === element)) { iframeDocument.head.appendChild( blockInlineCss ); } if ( (null === elementBlock || undefined === elementBlock )) { iframeDocument.head.appendChild( blockFixCss ); } if ( (null === elementGoogleFont || undefined === elementGoogleFont ) && null !== fontCss) { iframeDocument.head.appendChild( blockfontCss ); } } }, 1000); }); PK!&Ljs/ast-parse-svg.jsnu[function parseSVG ( svg ) { svg = svg.replace( "far ", "" ) svg = svg.replace( "fas ", "" ) svg = svg.replace( "fab ", "" ) svg = svg.replace( "fa-", "" ) svg = svg.replace( "fa ", "" ) return svg } export default parseSVG PK! 9rrjs/ast-render-svg.jsnu[/** * Set inline CSS class. * @param {object} props - The block object. * @return {array} The inline CSS class. */ import astIcons from "../../../assets/svg/ast-social-icons" import parseSVG from "./ast-parse-svg" import React from 'react'; function renderSVG ( svg ) { svg = parseSVG( svg ) var fontAwesome = astIcons[svg] if ( "undefined" != typeof fontAwesome ) { var viewbox_array = ( fontAwesome["svg"].hasOwnProperty("brands") ) ? fontAwesome["svg"]["brands"]["viewBox"] : fontAwesome["svg"]["solid"]["viewBox"] var path = ( fontAwesome["svg"].hasOwnProperty("brands") ) ? fontAwesome["svg"]["brands"]["path"] : fontAwesome["svg"]["solid"]["path"] var viewBox = viewbox_array.join( " " ) return ( ) } } export default renderSVG; PK!.]8]8js/customizer-preview.jsnu[( function( $, api ) { var $document = $( document ); wp.customize.bind( 'preview-ready', function() { var defaultTarget = window.parent === window ? null : window.parent; $document.on( 'click', '.site-header-focus-item .item-customizer-focus, .builder-item-focus .edit-row-action', function(e) { e.preventDefault(); e.stopPropagation(); var p = $( this ).closest( '.site-header-focus-item' ); var section_id = p.attr( 'data-section' ) || ''; if ( section_id ) { if ( defaultTarget.wp.customize.section( section_id ) ) { defaultTarget.wp.customize.section( section_id ).focus(); } } } ); $document.on( 'click', '.site-footer-focus-item .item-customizer-focus', function(e) { e.preventDefault(); e.stopPropagation(); var p = $( this ).closest( '.site-footer-focus-item' ); var section_id = p.attr( 'data-section' ) || ''; if ( section_id ) { if ( defaultTarget.wp.customize.section( section_id ) ) { defaultTarget.wp.customize.section( section_id ).focus(); } } } ); $document.on( 'click', '.customizer-navigate-on-focus', function(e) { e.preventDefault(); e.stopPropagation(); const currentElement = $( this ).closest( '.customizer-navigate-on-focus' ); const section_id = currentElement.attr( 'data-section' ) || ''; const type = currentElement.attr( 'data-type' ) ? currentElement.attr( 'data-type' ) : 'section'; if ( section_id && type ) { if( 'section' === type ) { if ( defaultTarget.wp.customize.section( section_id ) ) { defaultTarget.wp.customize.section( section_id ).focus(); } } if( 'control' === type ) { if ( defaultTarget.wp.customize.control( section_id ) ) { defaultTarget.wp.customize.control( section_id ).focus(); } } if( 'panel' === type ) { if ( defaultTarget.wp.customize.panel( section_id ) ) { defaultTarget.wp.customize.panel( section_id ).focus(); } } } } ); /** * Ajax quantity input show. */ wp.customize( 'astra-settings[woo-header-cart-click-action]', function( setting ) { setting.bind( function( action ) { $( document.body ).trigger( 'wc_fragment_refresh' ); } ); } ); /** * Register partial refresh events at once asynchronously. */ wp.customize.preview.bind( 'active', function() { var partials = $.extend({}, astraCustomizer.dynamic_partial_options), key; var register_partial = async function () { for ( key in partials) { wp.customize.selectiveRefresh.partial.add( new wp.customize.selectiveRefresh.Partial( key, _.extend({params: partials[key]}, partials[key]) ) ); await null; } } register_partial(); }); } ); /** * Inline logo and title css only. */ wp.customize( 'astra-settings[logo-title-inline]', function( value ) { value.bind( function( is_checked ) { jQuery('#masthead').toggleClass( 'ast-logo-title-inline', is_checked ); } ); } ); } )( jQuery, wp ); /** * Apply Advanced CSS for the element * * @param string section Section ID. * @param string selector Base Selector. */ function astra_builder_advanced_css( section, selector ) { var tablet_break_point = astraBuilderPreview.tablet_break_point || 768, mobile_break_point = astraBuilderPreview.mobile_break_point || 544; // Padding. wp.customize( 'astra-settings[' + section + '-padding]', function( value ) { value.bind( function( padding ) { if( ! padding.hasOwnProperty('desktop') ) { return } if( padding.desktop.bottom != '' || padding.desktop.top != '' || padding.desktop.left != '' || padding.desktop.right != '' || padding.tablet.bottom != '' || padding.tablet.top != '' || padding.tablet.left != '' || padding.tablet.right != '' || padding.mobile.bottom != '' || padding.mobile.top != '' || padding.mobile.left != '' || padding.mobile.right != '' ) { var dynamicStyle = ''; dynamicStyle += selector + ' {'; dynamicStyle += 'padding-left: ' + padding['desktop']['left'] + padding['desktop-unit'] + ';'; dynamicStyle += 'padding-right: ' + padding['desktop']['right'] + padding['desktop-unit'] + ';'; dynamicStyle += 'padding-top: ' + padding['desktop']['top'] + padding['desktop-unit'] + ';'; dynamicStyle += 'padding-bottom: ' + padding['desktop']['bottom'] + padding['desktop-unit'] + ';'; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {'; dynamicStyle += selector + ' {'; dynamicStyle += 'padding-left: ' + padding['tablet']['left'] + padding['tablet-unit'] + ';'; dynamicStyle += 'padding-right: ' + padding['tablet']['right'] + padding['tablet-unit'] + ';'; dynamicStyle += 'padding-top: ' + padding['tablet']['top'] + padding['tablet-unit'] + ';'; dynamicStyle += 'padding-bottom: ' + padding['tablet']['bottom'] + padding['tablet-unit'] + ';'; dynamicStyle += '} '; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; dynamicStyle += selector + ' {'; dynamicStyle += 'padding-left: ' + padding['mobile']['left'] + padding['mobile-unit'] + ';'; dynamicStyle += 'padding-right: ' + padding['mobile']['right'] + padding['mobile-unit'] + ';'; dynamicStyle += 'padding-top: ' + padding['mobile']['top'] + padding['mobile-unit'] + ';'; dynamicStyle += 'padding-bottom: ' + padding['mobile']['bottom'] + padding['mobile-unit'] + ';'; dynamicStyle += '} '; dynamicStyle += '} '; astra_add_dynamic_css( section + '-padding-toggle-button', dynamicStyle ); } else { astra_add_dynamic_css( section + '-padding-toggle-button', '' ); } } ); } ); // Margin. wp.customize( 'astra-settings[' + section + '-margin]', function( value ) { value.bind( function( margin ) { if( ! margin.hasOwnProperty('desktop') ) { return } if( margin.desktop.bottom != '' || margin.desktop.top != '' || margin.desktop.left != '' || margin.desktop.right != '' || margin.tablet.bottom != '' || margin.tablet.top != '' || margin.tablet.left != '' || margin.tablet.right != '' || margin.mobile.bottom != '' || margin.mobile.top != '' || margin.mobile.left != '' || margin.mobile.right != '' ) { var dynamicStyle = ''; dynamicStyle += selector + ' {'; dynamicStyle += 'margin-left: ' + margin['desktop']['left'] + margin['desktop-unit'] + ';'; dynamicStyle += 'margin-right: ' + margin['desktop']['right'] + margin['desktop-unit'] + ';'; dynamicStyle += 'margin-top: ' + margin['desktop']['top'] + margin['desktop-unit'] + ';'; dynamicStyle += 'margin-bottom: ' + margin['desktop']['bottom'] + margin['desktop-unit'] + ';'; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {'; dynamicStyle += selector + ' {'; dynamicStyle += 'margin-left: ' + margin['tablet']['left'] + margin['tablet-unit'] + ';'; dynamicStyle += 'margin-right: ' + margin['tablet']['right'] + margin['tablet-unit'] + ';'; dynamicStyle += 'margin-top: ' + margin['tablet']['top'] + margin['tablet-unit'] + ';'; dynamicStyle += 'margin-bottom: ' + margin['tablet']['bottom'] + margin['tablet-unit'] + ';'; dynamicStyle += '} '; dynamicStyle += '} '; dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {'; dynamicStyle += selector + ' {'; dynamicStyle += 'margin-left: ' + margin['mobile']['left'] + margin['mobile-unit'] + ';'; dynamicStyle += 'margin-right: ' + margin['mobile']['right'] + margin['mobile-unit'] + ';'; dynamicStyle += 'margin-top: ' + margin['mobile']['top'] + margin['mobile-unit'] + ';'; dynamicStyle += 'margin-bottom: ' + margin['mobile']['bottom'] + margin['mobile-unit'] + ';'; dynamicStyle += '} '; dynamicStyle += '} '; astra_add_dynamic_css( section + '-margin-toggle-button', dynamicStyle ); } else { astra_add_dynamic_css( section + '-margin-toggle-button', '' ); } } ); } ); } // Single Post Content Width wp.customize( 'astra-settings[blog-single-width]', function( value ) { value.bind( function( value ) { var single_post_max_width = wp.customize('astra-settings[blog-single-max-width]').get(); var dynamicStyle = ''; if ( 'custom' === value ) { dynamicStyle += '.single-post .site-content > .ast-container {'; dynamicStyle += 'max-width: ' + single_post_max_width + 'px;'; dynamicStyle += '} '; } else{ wp.customize.preview.send( 'refresh' ); } astra_add_dynamic_css( 'blog-single-width', dynamicStyle ); } ); } ); // Blog Post Content Width wp.customize( 'astra-settings[blog-width]', function( value ) { value.bind( function( value ) { var blog_max_width = wp.customize('astra-settings[blog-max-width]').get(); var dynamicStyle = ''; if ( 'custom' === value ) { dynamicStyle += '.blog .site-content > .ast-container, .archive .site-content > .ast-container, .search .site-content > .ast-container {'; dynamicStyle += 'max-width: ' + blog_max_width + 'px;'; dynamicStyle += '} '; } else{ wp.customize.preview.send( 'refresh' ); } astra_add_dynamic_css( 'blog-width', dynamicStyle ); } ); } ); // Blog Post Content Width wp.customize( 'astra-settings[edd-archive-grids]', function( value ) { value.bind( function( value ) { for ( var i = 1; i < 7; i++ ) { jQuery('body').removeClass( 'columns-' + i ); jQuery('body').removeClass( 'tablet-columns-' + i ); jQuery('body').removeClass( 'mobile-columns-' + i ); } if ( jQuery('body').hasClass( 'ast-edd-archive-page' ) ) { jQuery('body').addClass( 'columns-' + value['desktop'] ); jQuery('body').addClass( 'tablet-columns-' + value['tablet'] ); jQuery('body').addClass( 'mobile-columns-' + value['mobile'] ); } } ); } ); // Blog Post Content Width wp.customize( 'astra-settings[edd-archive-width]', function( value ) { value.bind( function( value ) { var edd_archive_max_width = wp.customize('astra-settings[edd-archive-max-width]').get(); edd_archive_max_width = ( 'custom' === value ) ? edd_archive_max_width : edd_archive_max_width + 40; var dynamicStyle = ''; dynamicStyle += '.ast-edd-archive-page .site-content > .ast-container {'; dynamicStyle += 'max-width: ' + edd_archive_max_width + 'px;'; dynamicStyle += '} '; astra_add_dynamic_css( 'edd-archive-width', dynamicStyle ); } ); } ); // WooCommerce store notice color configs. astra_css( 'astra-settings[store-notice-text-color]', 'color', 'body p.demo_store, body .woocommerce-store-notice, body p.demo_store a, body .woocommerce-store-notice a' ); astra_css( 'astra-settings[store-notice-background-color]', 'background-color', 'body p.demo_store, body .woocommerce-store-notice, body p.demo_store a, body .woocommerce-store-notice a' ); // WooCommerce store notice position preview. wp.customize( 'astra-settings[store-notice-position]', function( setting ) { setting.bind( function( position ) { if( 'hang-over-top' === position ) { wp.customize.preview.send( 'refresh' ); } else { jQuery('body').removeClass( 'ast-woocommerce-store-notice-hanged' ); jQuery('.woocommerce-store-notice').attr( 'data-position', position ); } } ); } ); wp.customize( 'astra-settings[blog-meta-date-type]', function( setting ) { setting.bind( function( val ) { wp.customize.preview.send( 'refresh' ); } ); } ); wp.customize( 'astra-settings[blog-meta-date-format]', function( setting ) { setting.bind( function( val ) { wp.customize.preview.send( 'refresh' ); } ); } ); // Global Typography Refresh - START const bodyFontFamily = [ 'body-font-family', 'body-font-variant', 'font-size-body', 'body-font-weight', 'body-font-extras', 'headings-font-family', 'headings-font-variant', 'headings-font-weight', 'headings-font-extras' ]; bodyFontFamily.forEach(element => { // Body Font Family wp.customize( 'astra-settings['+element+']', function( value ) { value.bind( function( value ) { wp.customize.preview.send( 'refresh' ); } ); } ); }); // Global Typography Refresh - END PK!KX js/column-block-compatibility.jsnu[const updatingBlock = ['core/group']; wp.hooks.addFilter( 'blocks.registerBlockType', 'astra/meta/groupLayoutSettings', (settings, name) => { if (!updatingBlock.includes(name)) { return settings; } const newSettings = { ...settings, supports: { ...(settings.supports || {}), layout: { ...(settings.supports.layout || {}), allowEditing: true, allowSwitching: false, allowInheriting: true, }, __experimentalLayout: { ...(settings.supports.__experimentalLayout || {}), allowEditing: true, allowSwitching: false, allowInheriting: true, }, }, }; return newSettings; }, 20 ); wp.hooks.addFilter( 'blocks.getBlockAttributes', 'astra/groupBlockSetting/checkInheritOption', (attributes, blockType) => { if (!updatingBlock.includes(blockType.name)) { return attributes; } if (blockType.name == 'core/group' && undefined != attributes.layout && 'flex' === attributes.layout.type) { return attributes; } if (blockType.name == 'core/group' && undefined != attributes.layout && false == attributes.layout.inherit ) { return attributes; } attributes = { ...attributes, layout: { inherit: true, }, }; return attributes; } ); /** * Set "Inherit default layout" option enable by default for Group block. * * Also set "Full Width" layout by default on drag-drop for following blocks. */ wp.blocks.registerBlockVariation( 'core/group', { isDefault: true, attributes: { layout: { inherit: true, }, align: 'full' }, } ); wp.blocks.registerBlockVariation( 'core/cover', { isDefault: true, attributes: { align: 'full' }, } ); PK!-c)Mii tw-sack.jsnu[/* Simple AJAX Code-Kit (SACK) v1.6.1 */ /* 2005 Gregory Wild-Smith */ /* www.twilightuniverse.com */ /* Software licenced under a modified X11 licence, see documentation or authors website for more details */ function sack(file) { this.xmlhttp = null; this.resetData = function() { this.method = "POST"; this.queryStringSeparator = "?"; this.argumentSeparator = "&"; this.URLString = ""; this.encodeURIString = true; this.execute = false; this.element = null; this.elementObj = null; this.requestFile = file; this.vars = new Object(); this.responseStatus = new Array(2); }; this.resetFunctions = function() { this.onLoading = function() { }; this.onLoaded = function() { }; this.onInteractive = function() { }; this.onCompletion = function() { }; this.onError = function() { }; this.onFail = function() { }; }; this.reset = function() { this.resetFunctions(); this.resetData(); }; this.createAJAX = function() { try { this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e1) { try { this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e2) { this.xmlhttp = null; } } if (! this.xmlhttp) { if (typeof XMLHttpRequest != "undefined") { this.xmlhttp = new XMLHttpRequest(); } else { this.failed = true; } } }; this.setVar = function(name, value){ this.vars[name] = Array(value, false); }; this.encVar = function(name, value, returnvars) { if (true == returnvars) { return Array(encodeURIComponent(name), encodeURIComponent(value)); } else { this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true); } } this.processURLString = function(string, encode) { encoded = encodeURIComponent(this.argumentSeparator); regexp = new RegExp(this.argumentSeparator + "|" + encoded); varArray = string.split(regexp); for (i = 0; i < varArray.length; i++){ urlVars = varArray[i].split("="); if (true == encode){ this.encVar(urlVars[0], urlVars[1]); } else { this.setVar(urlVars[0], urlVars[1]); } } } this.createURLString = function(urlstring) { if (this.encodeURIString && this.URLString.length) { this.processURLString(this.URLString, true); } if (urlstring) { if (this.URLString.length) { this.URLString += this.argumentSeparator + urlstring; } else { this.URLString = urlstring; } } // prevents caching of URLString this.setVar("rndval", new Date().getTime()); urlstringtemp = new Array(); for (key in this.vars) { if (false == this.vars[key][1] && true == this.encodeURIString) { encoded = this.encVar(key, this.vars[key][0], true); delete this.vars[key]; this.vars[encoded[0]] = Array(encoded[1], true); key = encoded[0]; } urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0]; } if (urlstring){ this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator); } else { this.URLString += urlstringtemp.join(this.argumentSeparator); } } this.runResponse = function() { eval(this.response); } this.runAJAX = function(urlstring) { if (this.failed) { this.onFail(); } else { this.createURLString(urlstring); if (this.element) { this.elementObj = document.getElementById(this.element); } if (this.xmlhttp) { var self = this; if (this.method == "GET") { totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString; this.xmlhttp.open(this.method, totalurlstring, true); } else { this.xmlhttp.open(this.method, this.requestFile, true); try { this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") } catch (e) { } } this.xmlhttp.onreadystatechange = function() { switch (self.xmlhttp.readyState) { case 1: self.onLoading(); break; case 2: self.onLoaded(); break; case 3: self.onInteractive(); break; case 4: self.response = self.xmlhttp.responseText; self.responseXML = self.xmlhttp.responseXML; self.responseStatus[0] = self.xmlhttp.status; self.responseStatus[1] = self.xmlhttp.statusText; if (self.execute) { self.runResponse(); } if (self.elementObj) { elemNodeName = self.elementObj.nodeName; elemNodeName.toLowerCase(); if (elemNodeName == "input" || elemNodeName == "select" || elemNodeName == "option" || elemNodeName == "textarea") { self.elementObj.value = self.response; } else { self.elementObj.innerHTML = self.response; } } if (self.responseStatus[0] == "200") { self.onCompletion(); } else { self.onError(); } self.URLString = ""; break; } }; this.xmlhttp.send(this.URLString); } } }; this.reset(); this.createAJAX(); } PK!Who'o'class-astra-markup.phpnu['; $args['attrs'] = array( 'class' => 'comments-count-wrapper' ); return $args; } /** * Comment count wrapper closing div. * * @param array $args markup arguments. * @since 3.3.0 * @return array. */ public function comment_count_wrapper_close( $args ) { $args['close'] = '
'; return $args; } /** * Comment data wrapper opening div. * * @param array $args markup arguments. * @since 3.3.0 * @return array. */ public function ast_comment_data_wrap_open( $args ) { $args['open'] = '
'; $args['attrs'] = array( 'class' => 'ast-comment-data-wrap' ); return $args; } /** * Comment data wrapper closing div. * * @param array $args markup arguments. * @since 3.3.0 * @return array. */ public function ast_comment_data_wrap_close( $args ) { $args['close'] = '
'; return $args; } /** * Comment meta wrapper opening div. * * @param array $args markup arguments. * @since 3.3.0 * @return array. */ public function ast_comment_meta_wrap_open( $args ) { $args['open'] = '
'; $args['attrs'] = array( 'class' => 'ast-comment-meta-wrap' ); return $args; } /** * Comment meta wrapper closing div. * * @param array $args markup arguments. * @since 3.3.0 * @return array. */ public function ast_comment_meta_wrap_close( $args ) { $args['close'] = '
'; return $args; } /** * Comment time div attributes. * * @since 3.3.0 * @return string. */ public function ast_comment_time_attr() { return 'class = "ast-comment-time ast-col-lg-12" '; } /** * Comment cite wrapper div attributes. * * @since 3.3.0 * @return string. */ public function ast_comment_cite_wrap_attr() { return 'class = "ast-comment-cite-wrap ast-col-lg-12" '; } /** * We have removed grid css and make common css for grid style. * * @since 3.3.0 * @return string. */ public function ast_grid_common_css() { return Astra_Builder_Helper::apply_flex_based_css() ? 'ast-grid-common-col' : 'ast-col-md-12'; } /** * Blog content Grid CSS. * * @since 3.3.0 * @return string. */ public function ast_grid_blog_col() { return Astra_Builder_Helper::apply_flex_based_css() ? 'ast-grid-common-col ast-float' : 'ast-col-md-12'; } /** * We have removed grid css and make common css for grid style. * * @since 3.3.0 * @return string. */ public function ast_blog_common_css() { return Astra_Builder_Helper::apply_flex_based_css() ? 'ast-grid-common-col ast-full-width' : 'ast-col-sm-12'; } /** * Removed grid layout classes and make common class for same style. * * @since 3.3.0 * @return string. */ public function ast_grid_col_6() { return Astra_Builder_Helper::apply_flex_based_css() ? 'ast-width-md-6' : 'ast-col-md-6'; } /** * Comment form grid classes. * * @since 3.3.0 * @return string. */ public function comment_form_grid_class() { return ( Astra_Builder_Helper::apply_flex_based_css() ) ? 'ast-grid-common-col ast-width-lg-33 ast-width-md-4 ast-float' : 'ast-col-xs-12 ast-col-sm-12 ast-col-md-4 ast-col-lg-4'; } /** * Removed grid layout classes and make common class for same style * * @since 3.3.0 * @return string. */ public function ast_grid_lg_12() { return Astra_Builder_Helper::apply_flex_based_css() ? 'ast-grid-common-col' : 'ast-col-lg-12'; } /** * Layout-4 grid css backward comaptibility. * * @return string. */ public function ast_layout_4_grid() { return Astra_Builder_Helper::apply_flex_based_css() ? 'ast-grid-common-col ast-width-sm-25 ast-width-md-3 ast-float ast-full-width' : 'ast-col-lg-3 ast-col-md-3 ast-col-sm-12 ast-col-xs-12'; } /** * Layout-2 grid css backward comaptibility. * * @return string. */ public function ast_layout_2_grid() { return Astra_Builder_Helper::apply_flex_based_css() ? 'ast-grid-common-col ast-width-md-6 ast-full-width' : 'ast-col-lg-6 ast-col-md-6 ast-col-sm-12 ast-col-xs-12'; } /** * Layout-1 grid css backward comaptibility. * * @return string. */ public function ast_layout_1_grid() { return Astra_Builder_Helper::apply_flex_based_css() ? 'ast-grid-common-col' : 'ast-col-lg-12 ast-col-md-12 ast-col-sm-12 ast-col-xs-12'; } /** * Layout-3 grid css backward comaptibility. * * @return string. */ public function ast_layout_3_grid() { return Astra_Builder_Helper::apply_flex_based_css() ? 'ast-grid-common-col ast-width-md-4 ast-float ast-full-width' : 'ast-col-lg-4 ast-col-md-4 ast-col-sm-12 ast-col-xs-12'; } /** * Layout-5 grid css backward comaptibility. * * @return string. */ public function ast_layout_5_grid() { return Astra_Builder_Helper::apply_flex_based_css() ? 'ast-grid-common-col ast-width-md-16 ast-width-md-20 ast-float ast-full-width' : 'ast-col-lg-2 ast-col-md-2 ast-col-sm-12 ast-col-xs-12'; } /** * Layout-6 grid css backward comaptibility. * * @return string. */ public function ast_layout_6_grid() { return Astra_Builder_Helper::apply_flex_based_css() ? 'ast-grid-common-col ast-width-md-6 ast-width-lg-50 ast-float ast-full-width' : 'ast-col-lg-6 ast-col-md-6 ast-col-sm-12 ast-col-xs-12'; } /** * Footer widget opening div. * * @since 3.3.0 * @param array $args div attributes. * @return array. */ public function footer_widget_div_open( $args ) { $args['open'] = '
'; $args['attrs'] = array( 'class' => 'footer-widget-area-inner site-info-inner' ); return $args; } /** * Footer widget closing div. * * @since 3.3.0 * @param array $args div attributes. * @return array. */ public function footer_widget_div_close( $args ) { $args['close'] = '
'; return $args; } /** * Footer widget inner class. * * @param array $args attributes. * @since 3.3.0 * @return string. */ public function footer_widget_area_inner( $args ) { if ( Astra_Builder_Helper::apply_flex_based_css() ) { $args['class'] = $args['class'] . ' footer-widget-area-inner'; } return $args; } /** * Header widget inner class. * * @param array $args Attributes. * @since 3.3.0 * @return string. */ public function header_widget_area_inner( $args ) { if ( Astra_Builder_Helper::apply_flex_based_css() ) { $args['class'] = $args['class'] . ' header-widget-area-inner'; } return $args; } /** * Footer widget opening div. * * @since 3.3.0 * @param array $args div attributes. * @return array. */ public function header_widget_div_open( $args ) { $args['open'] = '
'; $args['attrs'] = array( 'class' => 'header-widget-area-inner site-info-inner' ); return $args; } } /** * Kicking this off by calling 'get_instance()' method */ new Astra_Markup(); PK! wp-api.jsnu[/** * @output wp-includes/js/wp-api.js */ (function( window, undefined ) { 'use strict'; /** * Initialize the WP_API. */ function WP_API() { /** @namespace wp.api.models */ this.models = {}; /** @namespace wp.api.collections */ this.collections = {}; /** @namespace wp.api.views */ this.views = {}; } /** @namespace wp */ window.wp = window.wp || {}; /** @namespace wp.api */ wp.api = wp.api || new WP_API(); wp.api.versionString = wp.api.versionString || 'wp/v2/'; // Alias _includes to _.contains, ensuring it is available if lodash is used. if ( ! _.isFunction( _.includes ) && _.isFunction( _.contains ) ) { _.includes = _.contains; } })( window ); (function( window, undefined ) { 'use strict'; var pad, r; /** @namespace wp */ window.wp = window.wp || {}; /** @namespace wp.api */ wp.api = wp.api || {}; /** @namespace wp.api.utils */ wp.api.utils = wp.api.utils || {}; /** * Determine model based on API route. * * @param {string} route The API route. * * @return {Backbone Model} The model found at given route. Undefined if not found. */ wp.api.getModelByRoute = function( route ) { return _.find( wp.api.models, function( model ) { return model.prototype.route && route === model.prototype.route.index; } ); }; /** * Determine collection based on API route. * * @param {string} route The API route. * * @return {Backbone Model} The collection found at given route. Undefined if not found. */ wp.api.getCollectionByRoute = function( route ) { return _.find( wp.api.collections, function( collection ) { return collection.prototype.route && route === collection.prototype.route.index; } ); }; /** * ECMAScript 5 shim, adapted from MDN. * @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString */ if ( ! Date.prototype.toISOString ) { pad = function( number ) { r = String( number ); if ( 1 === r.length ) { r = '0' + r; } return r; }; Date.prototype.toISOString = function() { return this.getUTCFullYear() + '-' + pad( this.getUTCMonth() + 1 ) + '-' + pad( this.getUTCDate() ) + 'T' + pad( this.getUTCHours() ) + ':' + pad( this.getUTCMinutes() ) + ':' + pad( this.getUTCSeconds() ) + '.' + String( ( this.getUTCMilliseconds() / 1000 ).toFixed( 3 ) ).slice( 2, 5 ) + 'Z'; }; } /** * Parse date into ISO8601 format. * * @param {Date} date. */ wp.api.utils.parseISO8601 = function( date ) { var timestamp, struct, i, k, minutesOffset = 0, numericKeys = [ 1, 4, 5, 6, 7, 10, 11 ]; /* * ES5 §15.9.4.2 states that the string should attempt to be parsed as a Date Time String Format string * before falling back to any implementation-specific date parsing, so that’s what we do, even if native * implementations could be faster. */ // 1 YYYY 2 MM 3 DD 4 HH 5 mm 6 ss 7 msec 8 Z 9 ± 10 tzHH 11 tzmm if ( ( struct = /^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/.exec( date ) ) ) { // Avoid NaN timestamps caused by “undefined” values being passed to Date.UTC. for ( i = 0; ( k = numericKeys[i] ); ++i ) { struct[k] = +struct[k] || 0; } // Allow undefined days and months. struct[2] = ( +struct[2] || 1 ) - 1; struct[3] = +struct[3] || 1; if ( 'Z' !== struct[8] && undefined !== struct[9] ) { minutesOffset = struct[10] * 60 + struct[11]; if ( '+' === struct[9] ) { minutesOffset = 0 - minutesOffset; } } timestamp = Date.UTC( struct[1], struct[2], struct[3], struct[4], struct[5] + minutesOffset, struct[6], struct[7] ); } else { timestamp = Date.parse ? Date.parse( date ) : NaN; } return timestamp; }; /** * Helper function for getting the root URL. * @return {[type]} [description] */ wp.api.utils.getRootUrl = function() { return window.location.origin ? window.location.origin + '/' : window.location.protocol + '//' + window.location.host + '/'; }; /** * Helper for capitalizing strings. */ wp.api.utils.capitalize = function( str ) { if ( _.isUndefined( str ) ) { return str; } return str.charAt( 0 ).toUpperCase() + str.slice( 1 ); }; /** * Helper function that capitalizes the first word and camel cases any words starting * after dashes, removing the dashes. */ wp.api.utils.capitalizeAndCamelCaseDashes = function( str ) { if ( _.isUndefined( str ) ) { return str; } str = wp.api.utils.capitalize( str ); return wp.api.utils.camelCaseDashes( str ); }; /** * Helper function to camel case the letter after dashes, removing the dashes. */ wp.api.utils.camelCaseDashes = function( str ) { return str.replace( /-([a-z])/g, function( g ) { return g[ 1 ].toUpperCase(); } ); }; /** * Extract a route part based on negative index. * * @param {string} route The endpoint route. * @param {number} part The number of parts from the end of the route to retrieve. Default 1. * Example route `/a/b/c`: part 1 is `c`, part 2 is `b`, part 3 is `a`. * @param {string} [versionString] Version string, defaults to `wp.api.versionString`. * @param {boolean} [reverse] Whether to reverse the order when extracting the route part. Optional, default false. */ wp.api.utils.extractRoutePart = function( route, part, versionString, reverse ) { var routeParts; part = part || 1; versionString = versionString || wp.api.versionString; // Remove versions string from route to avoid returning it. if ( 0 === route.indexOf( '/' + versionString ) ) { route = route.substr( versionString.length + 1 ); } routeParts = route.split( '/' ); if ( reverse ) { routeParts = routeParts.reverse(); } if ( _.isUndefined( routeParts[ --part ] ) ) { return ''; } return routeParts[ part ]; }; /** * Extract a parent name from a passed route. * * @param {string} route The route to extract a name from. */ wp.api.utils.extractParentName = function( route ) { var name, lastSlash = route.lastIndexOf( '_id>[\\d]+)/' ); if ( lastSlash < 0 ) { return ''; } name = route.substr( 0, lastSlash - 1 ); name = name.split( '/' ); name.pop(); name = name.pop(); return name; }; /** * Add args and options to a model prototype from a route's endpoints. * * @param {Array} routeEndpoints Array of route endpoints. * @param {Object} modelInstance An instance of the model (or collection) * to add the args to. */ wp.api.utils.decorateFromRoute = function( routeEndpoints, modelInstance ) { /** * Build the args based on route endpoint data. */ _.each( routeEndpoints, function( routeEndpoint ) { // Add post and edit endpoints as model args. if ( _.includes( routeEndpoint.methods, 'POST' ) || _.includes( routeEndpoint.methods, 'PUT' ) ) { // Add any non-empty args, merging them into the args object. if ( ! _.isEmpty( routeEndpoint.args ) ) { // Set as default if no args yet. if ( _.isEmpty( modelInstance.prototype.args ) ) { modelInstance.prototype.args = routeEndpoint.args; } else { // We already have args, merge these new args in. modelInstance.prototype.args = _.extend( modelInstance.prototype.args, routeEndpoint.args ); } } } else { // Add GET method as model options. if ( _.includes( routeEndpoint.methods, 'GET' ) ) { // Add any non-empty args, merging them into the defaults object. if ( ! _.isEmpty( routeEndpoint.args ) ) { // Set as default if no defaults yet. if ( _.isEmpty( modelInstance.prototype.options ) ) { modelInstance.prototype.options = routeEndpoint.args; } else { // We already have options, merge these new args in. modelInstance.prototype.options = _.extend( modelInstance.prototype.options, routeEndpoint.args ); } } } } } ); }; /** * Add mixins and helpers to models depending on their defaults. * * @param {Backbone Model} model The model to attach helpers and mixins to. * @param {string} modelClassName The classname of the constructed model. * @param {Object} loadingObjects An object containing the models and collections we are building. */ wp.api.utils.addMixinsAndHelpers = function( model, modelClassName, loadingObjects ) { var hasDate = false, /** * Array of parseable dates. * * @type {string[]}. */ parseableDates = [ 'date', 'modified', 'date_gmt', 'modified_gmt' ], /** * Mixin for all content that is time stamped. * * This mixin converts between mysql timestamps and JavaScript Dates when syncing a model * to or from the server. For example, a date stored as `2015-12-27T21:22:24` on the server * gets expanded to `Sun Dec 27 2015 14:22:24 GMT-0700 (MST)` when the model is fetched. * * @type {{toJSON: toJSON, parse: parse}}. */ TimeStampedMixin = { /** * Prepare a JavaScript Date for transmitting to the server. * * This helper function accepts a field and Date object. It converts the passed Date * to an ISO string and sets that on the model field. * * @param {Date} date A JavaScript date object. WordPress expects dates in UTC. * @param {string} field The date field to set. One of 'date', 'date_gmt', 'date_modified' * or 'date_modified_gmt'. Optional, defaults to 'date'. */ setDate: function( date, field ) { var theField = field || 'date'; // Don't alter non-parsable date fields. if ( _.indexOf( parseableDates, theField ) < 0 ) { return false; } this.set( theField, date.toISOString() ); }, /** * Get a JavaScript Date from the passed field. * * WordPress returns 'date' and 'date_modified' in the timezone of the server as well as * UTC dates as 'date_gmt' and 'date_modified_gmt'. Draft posts do not include UTC dates. * * @param {string} field The date field to set. One of 'date', 'date_gmt', 'date_modified' * or 'date_modified_gmt'. Optional, defaults to 'date'. */ getDate: function( field ) { var theField = field || 'date', theISODate = this.get( theField ); // Only get date fields and non-null values. if ( _.indexOf( parseableDates, theField ) < 0 || _.isNull( theISODate ) ) { return false; } return new Date( wp.api.utils.parseISO8601( theISODate ) ); } }, /** * Build a helper function to retrieve related model. * * @param {string} parentModel The parent model. * @param {number} modelId The model ID if the object to request * @param {string} modelName The model name to use when constructing the model. * @param {string} embedSourcePoint Where to check the embedded object for _embed data. * @param {string} embedCheckField Which model field to check to see if the model has data. * * @return {Deferred.promise} A promise which resolves to the constructed model. */ buildModelGetter = function( parentModel, modelId, modelName, embedSourcePoint, embedCheckField ) { var getModel, embeddedObjects, attributes, deferred; deferred = jQuery.Deferred(); embeddedObjects = parentModel.get( '_embedded' ) || {}; // Verify that we have a valid object id. if ( ! _.isNumber( modelId ) || 0 === modelId ) { deferred.reject(); return deferred; } // If we have embedded object data, use that when constructing the getModel. if ( embeddedObjects[ embedSourcePoint ] ) { attributes = _.findWhere( embeddedObjects[ embedSourcePoint ], { id: modelId } ); } // Otherwise use the modelId. if ( ! attributes ) { attributes = { id: modelId }; } // Create the new getModel model. getModel = new wp.api.models[ modelName ]( attributes ); if ( ! getModel.get( embedCheckField ) ) { getModel.fetch( { success: function( getModel ) { deferred.resolve( getModel ); }, error: function( getModel, response ) { deferred.reject( response ); } } ); } else { // Resolve with the embedded model. deferred.resolve( getModel ); } // Return a promise. return deferred.promise(); }, /** * Build a helper to retrieve a collection. * * @param {string} parentModel The parent model. * @param {string} collectionName The name to use when constructing the collection. * @param {string} embedSourcePoint Where to check the embedded object for _embed data. * @param {string} embedIndex An additional optional index for the _embed data. * * @return {Deferred.promise} A promise which resolves to the constructed collection. */ buildCollectionGetter = function( parentModel, collectionName, embedSourcePoint, embedIndex ) { /** * Returns a promise that resolves to the requested collection * * Uses the embedded data if available, otherwise fetches the * data from the server. * * @return {Deferred.promise} promise Resolves to a wp.api.collections[ collectionName ] * collection. */ var postId, embeddedObjects, getObjects, classProperties = '', properties = '', deferred = jQuery.Deferred(); postId = parentModel.get( 'id' ); embeddedObjects = parentModel.get( '_embedded' ) || {}; // Verify that we have a valid post ID. if ( ! _.isNumber( postId ) || 0 === postId ) { deferred.reject(); return deferred; } // If we have embedded getObjects data, use that when constructing the getObjects. if ( ! _.isUndefined( embedSourcePoint ) && ! _.isUndefined( embeddedObjects[ embedSourcePoint ] ) ) { // Some embeds also include an index offset, check for that. if ( _.isUndefined( embedIndex ) ) { // Use the embed source point directly. properties = embeddedObjects[ embedSourcePoint ]; } else { // Add the index to the embed source point. properties = embeddedObjects[ embedSourcePoint ][ embedIndex ]; } } else { // Otherwise use the postId. classProperties = { parent: postId }; } // Create the new getObjects collection. getObjects = new wp.api.collections[ collectionName ]( properties, classProperties ); // If we didn’t have embedded getObjects, fetch the getObjects data. if ( _.isUndefined( getObjects.models[0] ) ) { getObjects.fetch( { success: function( getObjects ) { // Add a helper 'parent_post' attribute onto the model. setHelperParentPost( getObjects, postId ); deferred.resolve( getObjects ); }, error: function( getModel, response ) { deferred.reject( response ); } } ); } else { // Add a helper 'parent_post' attribute onto the model. setHelperParentPost( getObjects, postId ); deferred.resolve( getObjects ); } // Return a promise. return deferred.promise(); }, /** * Set the model post parent. */ setHelperParentPost = function( collection, postId ) { // Attach post_parent id to the collection. _.each( collection.models, function( model ) { model.set( 'parent_post', postId ); } ); }, /** * Add a helper function to handle post Meta. */ MetaMixin = { /** * Get meta by key for a post. * * @param {string} key The meta key. * * @return {Object} The post meta value. */ getMeta: function( key ) { var metas = this.get( 'meta' ); return metas[ key ]; }, /** * Get all meta key/values for a post. * * @return {Object} The post metas, as a key value pair object. */ getMetas: function() { return this.get( 'meta' ); }, /** * Set a group of meta key/values for a post. * * @param {Object} meta The post meta to set, as key/value pairs. */ setMetas: function( meta ) { var metas = this.get( 'meta' ); _.extend( metas, meta ); this.set( 'meta', metas ); }, /** * Set a single meta value for a post, by key. * * @param {string} key The meta key. * @param {Object} value The meta value. */ setMeta: function( key, value ) { var metas = this.get( 'meta' ); metas[ key ] = value; this.set( 'meta', metas ); } }, /** * Add a helper function to handle post Revisions. */ RevisionsMixin = { getRevisions: function() { return buildCollectionGetter( this, 'PostRevisions' ); } }, /** * Add a helper function to handle post Tags. */ TagsMixin = { /** * Get the tags for a post. * * @return {Deferred.promise} promise Resolves to an array of tags. */ getTags: function() { var tagIds = this.get( 'tags' ), tags = new wp.api.collections.Tags(); // Resolve with an empty array if no tags. if ( _.isEmpty( tagIds ) ) { return jQuery.Deferred().resolve( [] ); } return tags.fetch( { data: { include: tagIds } } ); }, /** * Set the tags for a post. * * Accepts an array of tag slugs, or a Tags collection. * * @param {Array|Backbone.Collection} tags The tags to set on the post. * */ setTags: function( tags ) { var allTags, newTag, self = this, newTags = []; if ( _.isString( tags ) ) { return false; } // If this is an array of slugs, build a collection. if ( _.isArray( tags ) ) { // Get all the tags. allTags = new wp.api.collections.Tags(); allTags.fetch( { data: { per_page: 100 }, success: function( alltags ) { // Find the passed tags and set them up. _.each( tags, function( tag ) { newTag = new wp.api.models.Tag( alltags.findWhere( { slug: tag } ) ); // Tie the new tag to the post. newTag.set( 'parent_post', self.get( 'id' ) ); // Add the new tag to the collection. newTags.push( newTag ); } ); tags = new wp.api.collections.Tags( newTags ); self.setTagsWithCollection( tags ); } } ); } else { this.setTagsWithCollection( tags ); } }, /** * Set the tags for a post. * * Accepts a Tags collection. * * @param {Array|Backbone.Collection} tags The tags to set on the post. * */ setTagsWithCollection: function( tags ) { // Pluck out the category IDs. this.set( 'tags', tags.pluck( 'id' ) ); return this.save(); } }, /** * Add a helper function to handle post Categories. */ CategoriesMixin = { /** * Get a the categories for a post. * * @return {Deferred.promise} promise Resolves to an array of categories. */ getCategories: function() { var categoryIds = this.get( 'categories' ), categories = new wp.api.collections.Categories(); // Resolve with an empty array if no categories. if ( _.isEmpty( categoryIds ) ) { return jQuery.Deferred().resolve( [] ); } return categories.fetch( { data: { include: categoryIds } } ); }, /** * Set the categories for a post. * * Accepts an array of category slugs, or a Categories collection. * * @param {Array|Backbone.Collection} categories The categories to set on the post. * */ setCategories: function( categories ) { var allCategories, newCategory, self = this, newCategories = []; if ( _.isString( categories ) ) { return false; } // If this is an array of slugs, build a collection. if ( _.isArray( categories ) ) { // Get all the categories. allCategories = new wp.api.collections.Categories(); allCategories.fetch( { data: { per_page: 100 }, success: function( allcats ) { // Find the passed categories and set them up. _.each( categories, function( category ) { newCategory = new wp.api.models.Category( allcats.findWhere( { slug: category } ) ); // Tie the new category to the post. newCategory.set( 'parent_post', self.get( 'id' ) ); // Add the new category to the collection. newCategories.push( newCategory ); } ); categories = new wp.api.collections.Categories( newCategories ); self.setCategoriesWithCollection( categories ); } } ); } else { this.setCategoriesWithCollection( categories ); } }, /** * Set the categories for a post. * * Accepts Categories collection. * * @param {Array|Backbone.Collection} categories The categories to set on the post. * */ setCategoriesWithCollection: function( categories ) { // Pluck out the category IDs. this.set( 'categories', categories.pluck( 'id' ) ); return this.save(); } }, /** * Add a helper function to retrieve the author user model. */ AuthorMixin = { getAuthorUser: function() { return buildModelGetter( this, this.get( 'author' ), 'User', 'author', 'name' ); } }, /** * Add a helper function to retrieve the featured media. */ FeaturedMediaMixin = { getFeaturedMedia: function() { return buildModelGetter( this, this.get( 'featured_media' ), 'Media', 'wp:featuredmedia', 'source_url' ); } }; // Exit if we don't have valid model defaults. if ( _.isUndefined( model.prototype.args ) ) { return model; } // Go thru the parsable date fields, if our model contains any of them it gets the TimeStampedMixin. _.each( parseableDates, function( theDateKey ) { if ( ! _.isUndefined( model.prototype.args[ theDateKey ] ) ) { hasDate = true; } } ); // Add the TimeStampedMixin for models that contain a date field. if ( hasDate ) { model = model.extend( TimeStampedMixin ); } // Add the AuthorMixin for models that contain an author. if ( ! _.isUndefined( model.prototype.args.author ) ) { model = model.extend( AuthorMixin ); } // Add the FeaturedMediaMixin for models that contain a featured_media. if ( ! _.isUndefined( model.prototype.args.featured_media ) ) { model = model.extend( FeaturedMediaMixin ); } // Add the CategoriesMixin for models that support categories collections. if ( ! _.isUndefined( model.prototype.args.categories ) ) { model = model.extend( CategoriesMixin ); } // Add the MetaMixin for models that support meta. if ( ! _.isUndefined( model.prototype.args.meta ) ) { model = model.extend( MetaMixin ); } // Add the TagsMixin for models that support tags collections. if ( ! _.isUndefined( model.prototype.args.tags ) ) { model = model.extend( TagsMixin ); } // Add the RevisionsMixin for models that support revisions collections. if ( ! _.isUndefined( loadingObjects.collections[ modelClassName + 'Revisions' ] ) ) { model = model.extend( RevisionsMixin ); } return model; }; })( window ); /* global wpApiSettings:false */ // Suppress warning about parse function's unused "options" argument: /* jshint unused:false */ (function() { 'use strict'; var wpApiSettings = window.wpApiSettings || {}, trashableTypes = [ 'Comment', 'Media', 'Comment', 'Post', 'Page', 'Status', 'Taxonomy', 'Type' ]; /** * Backbone base model for all models. */ wp.api.WPApiBaseModel = Backbone.Model.extend( /** @lends WPApiBaseModel.prototype */ { // Initialize the model. initialize: function() { /** * Types that don't support trashing require passing ?force=true to delete. * */ if ( -1 === _.indexOf( trashableTypes, this.name ) ) { this.requireForceForDelete = true; } }, /** * Set nonce header before every Backbone sync. * * @param {string} method. * @param {Backbone.Model} model. * @param {{beforeSend}, *} options. * @return {*}. */ sync: function( method, model, options ) { var beforeSend; options = options || {}; // Remove date_gmt if null. if ( _.isNull( model.get( 'date_gmt' ) ) ) { model.unset( 'date_gmt' ); } // Remove slug if empty. if ( _.isEmpty( model.get( 'slug' ) ) ) { model.unset( 'slug' ); } if ( _.isFunction( model.nonce ) && ! _.isEmpty( model.nonce() ) ) { beforeSend = options.beforeSend; // @todo Enable option for jsonp endpoints. // options.dataType = 'jsonp'; // Include the nonce with requests. options.beforeSend = function( xhr ) { xhr.setRequestHeader( 'X-WP-Nonce', model.nonce() ); if ( beforeSend ) { return beforeSend.apply( this, arguments ); } }; // Update the nonce when a new nonce is returned with the response. options.complete = function( xhr ) { var returnedNonce = xhr.getResponseHeader( 'X-WP-Nonce' ); if ( returnedNonce && _.isFunction( model.nonce ) && model.nonce() !== returnedNonce ) { model.endpointModel.set( 'nonce', returnedNonce ); } }; } // Add '?force=true' to use delete method when required. if ( this.requireForceForDelete && 'delete' === method ) { model.url = model.url() + '?force=true'; } return Backbone.sync( method, model, options ); }, /** * Save is only allowed when the PUT OR POST methods are available for the endpoint. */ save: function( attrs, options ) { // Do we have the put method, then execute the save. if ( _.includes( this.methods, 'PUT' ) || _.includes( this.methods, 'POST' ) ) { // Proxy the call to the original save function. return Backbone.Model.prototype.save.call( this, attrs, options ); } else { // Otherwise bail, disallowing action. return false; } }, /** * Delete is only allowed when the DELETE method is available for the endpoint. */ destroy: function( options ) { // Do we have the DELETE method, then execute the destroy. if ( _.includes( this.methods, 'DELETE' ) ) { // Proxy the call to the original save function. return Backbone.Model.prototype.destroy.call( this, options ); } else { // Otherwise bail, disallowing action. return false; } } } ); /** * API Schema model. Contains meta information about the API. */ wp.api.models.Schema = wp.api.WPApiBaseModel.extend( /** @lends Schema.prototype */ { defaults: { _links: {}, namespace: null, routes: {} }, initialize: function( attributes, options ) { var model = this; options = options || {}; wp.api.WPApiBaseModel.prototype.initialize.call( model, attributes, options ); model.apiRoot = options.apiRoot || wpApiSettings.root; model.versionString = options.versionString || wpApiSettings.versionString; }, url: function() { return this.apiRoot + this.versionString; } } ); })(); ( function() { 'use strict'; var wpApiSettings = window.wpApiSettings || {}; /** * Contains basic collection functionality such as pagination. */ wp.api.WPApiBaseCollection = Backbone.Collection.extend( /** @lends BaseCollection.prototype */ { /** * Setup default state. */ initialize: function( models, options ) { this.state = { data: {}, currentPage: null, totalPages: null, totalObjects: null }; if ( _.isUndefined( options ) ) { this.parent = ''; } else { this.parent = options.parent; } }, /** * Extend Backbone.Collection.sync to add nince and pagination support. * * Set nonce header before every Backbone sync. * * @param {string} method. * @param {Backbone.Model} model. * @param {{success}, *} options. * @return {*}. */ sync: function( method, model, options ) { var beforeSend, success, self = this; options = options || {}; if ( _.isFunction( model.nonce ) && ! _.isEmpty( model.nonce() ) ) { beforeSend = options.beforeSend; // Include the nonce with requests. options.beforeSend = function( xhr ) { xhr.setRequestHeader( 'X-WP-Nonce', model.nonce() ); if ( beforeSend ) { return beforeSend.apply( self, arguments ); } }; // Update the nonce when a new nonce is returned with the response. options.complete = function( xhr ) { var returnedNonce = xhr.getResponseHeader( 'X-WP-Nonce' ); if ( returnedNonce && _.isFunction( model.nonce ) && model.nonce() !== returnedNonce ) { model.endpointModel.set( 'nonce', returnedNonce ); } }; } // When reading, add pagination data. if ( 'read' === method ) { if ( options.data ) { self.state.data = _.clone( options.data ); delete self.state.data.page; } else { self.state.data = options.data = {}; } if ( 'undefined' === typeof options.data.page ) { self.state.currentPage = null; self.state.totalPages = null; self.state.totalObjects = null; } else { self.state.currentPage = options.data.page - 1; } success = options.success; options.success = function( data, textStatus, request ) { if ( ! _.isUndefined( request ) ) { self.state.totalPages = parseInt( request.getResponseHeader( 'x-wp-totalpages' ), 10 ); self.state.totalObjects = parseInt( request.getResponseHeader( 'x-wp-total' ), 10 ); } if ( null === self.state.currentPage ) { self.state.currentPage = 1; } else { self.state.currentPage++; } if ( success ) { return success.apply( this, arguments ); } }; } // Continue by calling Backbone's sync. return Backbone.sync( method, model, options ); }, /** * Fetches the next page of objects if a new page exists. * * @param {data: {page}} options. * @return {*}. */ more: function( options ) { options = options || {}; options.data = options.data || {}; _.extend( options.data, this.state.data ); if ( 'undefined' === typeof options.data.page ) { if ( ! this.hasMore() ) { return false; } if ( null === this.state.currentPage || this.state.currentPage <= 1 ) { options.data.page = 2; } else { options.data.page = this.state.currentPage + 1; } } return this.fetch( options ); }, /** * Returns true if there are more pages of objects available. * * @return {null|boolean} */ hasMore: function() { if ( null === this.state.totalPages || null === this.state.totalObjects || null === this.state.currentPage ) { return null; } else { return ( this.state.currentPage < this.state.totalPages ); } } } ); } )(); ( function() { 'use strict'; var Endpoint, initializedDeferreds = {}, wpApiSettings = window.wpApiSettings || {}; /** @namespace wp */ window.wp = window.wp || {}; /** @namespace wp.api */ wp.api = wp.api || {}; // If wpApiSettings is unavailable, try the default. if ( _.isEmpty( wpApiSettings ) ) { wpApiSettings.root = window.location.origin + '/wp-json/'; } Endpoint = Backbone.Model.extend(/** @lends Endpoint.prototype */{ defaults: { apiRoot: wpApiSettings.root, versionString: wp.api.versionString, nonce: null, schema: null, models: {}, collections: {} }, /** * Initialize the Endpoint model. */ initialize: function() { var model = this, deferred; Backbone.Model.prototype.initialize.apply( model, arguments ); deferred = jQuery.Deferred(); model.schemaConstructed = deferred.promise(); model.schemaModel = new wp.api.models.Schema( null, { apiRoot: model.get( 'apiRoot' ), versionString: model.get( 'versionString' ), nonce: model.get( 'nonce' ) } ); // When the model loads, resolve the promise. model.schemaModel.once( 'change', function() { model.constructFromSchema(); deferred.resolve( model ); } ); if ( model.get( 'schema' ) ) { // Use schema supplied as model attribute. model.schemaModel.set( model.schemaModel.parse( model.get( 'schema' ) ) ); } else if ( ! _.isUndefined( sessionStorage ) && ( _.isUndefined( wpApiSettings.cacheSchema ) || wpApiSettings.cacheSchema ) && sessionStorage.getItem( 'wp-api-schema-model' + model.get( 'apiRoot' ) + model.get( 'versionString' ) ) ) { // Used a cached copy of the schema model if available. model.schemaModel.set( model.schemaModel.parse( JSON.parse( sessionStorage.getItem( 'wp-api-schema-model' + model.get( 'apiRoot' ) + model.get( 'versionString' ) ) ) ) ); } else { model.schemaModel.fetch( { /** * When the server returns the schema model data, store the data in a sessionCache so we don't * have to retrieve it again for this session. Then, construct the models and collections based * on the schema model data. * * @ignore */ success: function( newSchemaModel ) { // Store a copy of the schema model in the session cache if available. if ( ! _.isUndefined( sessionStorage ) && ( _.isUndefined( wpApiSettings.cacheSchema ) || wpApiSettings.cacheSchema ) ) { try { sessionStorage.setItem( 'wp-api-schema-model' + model.get( 'apiRoot' ) + model.get( 'versionString' ), JSON.stringify( newSchemaModel ) ); } catch ( error ) { // Fail silently, fixes errors in safari private mode. } } }, // Log the error condition. error: function( err ) { window.console.log( err ); } } ); } }, constructFromSchema: function() { var routeModel = this, modelRoutes, collectionRoutes, schemaRoot, loadingObjects, /** * Set up the model and collection name mapping options. As the schema is built, the * model and collection names will be adjusted if they are found in the mapping object. * * Localizing a variable wpApiSettings.mapping will over-ride the default mapping options. * */ mapping = wpApiSettings.mapping || { models: { 'Categories': 'Category', 'Comments': 'Comment', 'Pages': 'Page', 'PagesMeta': 'PageMeta', 'PagesRevisions': 'PageRevision', 'Posts': 'Post', 'PostsCategories': 'PostCategory', 'PostsRevisions': 'PostRevision', 'PostsTags': 'PostTag', 'Schema': 'Schema', 'Statuses': 'Status', 'Tags': 'Tag', 'Taxonomies': 'Taxonomy', 'Types': 'Type', 'Users': 'User' }, collections: { 'PagesMeta': 'PageMeta', 'PagesRevisions': 'PageRevisions', 'PostsCategories': 'PostCategories', 'PostsMeta': 'PostMeta', 'PostsRevisions': 'PostRevisions', 'PostsTags': 'PostTags' } }, modelEndpoints = routeModel.get( 'modelEndpoints' ), modelRegex = new RegExp( '(?:.*[+)]|\/(' + modelEndpoints.join( '|' ) + '))$' ); /** * Iterate thru the routes, picking up models and collections to build. Builds two arrays, * one for models and one for collections. */ modelRoutes = []; collectionRoutes = []; schemaRoot = routeModel.get( 'apiRoot' ).replace( wp.api.utils.getRootUrl(), '' ); loadingObjects = {}; /** * Tracking objects for models and collections. */ loadingObjects.models = {}; loadingObjects.collections = {}; _.each( routeModel.schemaModel.get( 'routes' ), function( route, index ) { // Skip the schema root if included in the schema. if ( index !== routeModel.get( ' versionString' ) && index !== schemaRoot && index !== ( '/' + routeModel.get( 'versionString' ).slice( 0, -1 ) ) ) { // Single items end with a regex, or a special case word. if ( modelRegex.test( index ) ) { modelRoutes.push( { index: index, route: route } ); } else { // Collections end in a name. collectionRoutes.push( { index: index, route: route } ); } } } ); /** * Construct the models. * * Base the class name on the route endpoint. */ _.each( modelRoutes, function( modelRoute ) { // Extract the name and any parent from the route. var modelClassName, routeName = wp.api.utils.extractRoutePart( modelRoute.index, 2, routeModel.get( 'versionString' ), true ), parentName = wp.api.utils.extractRoutePart( modelRoute.index, 1, routeModel.get( 'versionString' ), false ), routeEnd = wp.api.utils.extractRoutePart( modelRoute.index, 1, routeModel.get( 'versionString' ), true ); // Clear the parent part of the rouite if its actually the version string. if ( parentName === routeModel.get( 'versionString' ) ) { parentName = ''; } // Handle the special case of the 'me' route. if ( 'me' === routeEnd ) { routeName = 'me'; } // If the model has a parent in its route, add that to its class name. if ( '' !== parentName && parentName !== routeName ) { modelClassName = wp.api.utils.capitalizeAndCamelCaseDashes( parentName ) + wp.api.utils.capitalizeAndCamelCaseDashes( routeName ); modelClassName = mapping.models[ modelClassName ] || modelClassName; loadingObjects.models[ modelClassName ] = wp.api.WPApiBaseModel.extend( { // Return a constructed url based on the parent and id. url: function() { var url = routeModel.get( 'apiRoot' ) + routeModel.get( 'versionString' ) + parentName + '/' + ( ( _.isUndefined( this.get( 'parent' ) ) || 0 === this.get( 'parent' ) ) ? ( _.isUndefined( this.get( 'parent_post' ) ) ? '' : this.get( 'parent_post' ) + '/' ) : this.get( 'parent' ) + '/' ) + routeName; if ( ! _.isUndefined( this.get( 'id' ) ) ) { url += '/' + this.get( 'id' ); } return url; }, // Track nonces on the Endpoint 'routeModel'. nonce: function() { return routeModel.get( 'nonce' ); }, endpointModel: routeModel, // Include a reference to the original route object. route: modelRoute, // Include a reference to the original class name. name: modelClassName, // Include the array of route methods for easy reference. methods: modelRoute.route.methods, // Include the array of route endpoints for easy reference. endpoints: modelRoute.route.endpoints } ); } else { // This is a model without a parent in its route. modelClassName = wp.api.utils.capitalizeAndCamelCaseDashes( routeName ); modelClassName = mapping.models[ modelClassName ] || modelClassName; loadingObjects.models[ modelClassName ] = wp.api.WPApiBaseModel.extend( { // Function that returns a constructed url based on the ID. url: function() { var url = routeModel.get( 'apiRoot' ) + routeModel.get( 'versionString' ) + ( ( 'me' === routeName ) ? 'users/me' : routeName ); if ( ! _.isUndefined( this.get( 'id' ) ) ) { url += '/' + this.get( 'id' ); } return url; }, // Track nonces at the Endpoint level. nonce: function() { return routeModel.get( 'nonce' ); }, endpointModel: routeModel, // Include a reference to the original route object. route: modelRoute, // Include a reference to the original class name. name: modelClassName, // Include the array of route methods for easy reference. methods: modelRoute.route.methods, // Include the array of route endpoints for easy reference. endpoints: modelRoute.route.endpoints } ); } // Add defaults to the new model, pulled form the endpoint. wp.api.utils.decorateFromRoute( modelRoute.route.endpoints, loadingObjects.models[ modelClassName ], routeModel.get( 'versionString' ) ); } ); /** * Construct the collections. * * Base the class name on the route endpoint. */ _.each( collectionRoutes, function( collectionRoute ) { // Extract the name and any parent from the route. var collectionClassName, modelClassName, routeName = collectionRoute.index.slice( collectionRoute.index.lastIndexOf( '/' ) + 1 ), parentName = wp.api.utils.extractRoutePart( collectionRoute.index, 1, routeModel.get( 'versionString' ), false ); // If the collection has a parent in its route, add that to its class name. if ( '' !== parentName && parentName !== routeName && routeModel.get( 'versionString' ) !== parentName ) { collectionClassName = wp.api.utils.capitalizeAndCamelCaseDashes( parentName ) + wp.api.utils.capitalizeAndCamelCaseDashes( routeName ); modelClassName = mapping.models[ collectionClassName ] || collectionClassName; collectionClassName = mapping.collections[ collectionClassName ] || collectionClassName; loadingObjects.collections[ collectionClassName ] = wp.api.WPApiBaseCollection.extend( { // Function that returns a constructed url passed on the parent. url: function() { return routeModel.get( 'apiRoot' ) + routeModel.get( 'versionString' ) + parentName + '/' + ( ( _.isUndefined( this.parent ) || '' === this.parent ) ? ( _.isUndefined( this.get( 'parent_post' ) ) ? '' : this.get( 'parent_post' ) + '/' ) : this.parent + '/' ) + routeName; }, // Specify the model that this collection contains. model: function( attrs, options ) { return new loadingObjects.models[ modelClassName ]( attrs, options ); }, // Track nonces at the Endpoint level. nonce: function() { return routeModel.get( 'nonce' ); }, endpointModel: routeModel, // Include a reference to the original class name. name: collectionClassName, // Include a reference to the original route object. route: collectionRoute, // Include the array of route methods for easy reference. methods: collectionRoute.route.methods } ); } else { // This is a collection without a parent in its route. collectionClassName = wp.api.utils.capitalizeAndCamelCaseDashes( routeName ); modelClassName = mapping.models[ collectionClassName ] || collectionClassName; collectionClassName = mapping.collections[ collectionClassName ] || collectionClassName; loadingObjects.collections[ collectionClassName ] = wp.api.WPApiBaseCollection.extend( { // For the url of a root level collection, use a string. url: function() { return routeModel.get( 'apiRoot' ) + routeModel.get( 'versionString' ) + routeName; }, // Specify the model that this collection contains. model: function( attrs, options ) { return new loadingObjects.models[ modelClassName ]( attrs, options ); }, // Track nonces at the Endpoint level. nonce: function() { return routeModel.get( 'nonce' ); }, endpointModel: routeModel, // Include a reference to the original class name. name: collectionClassName, // Include a reference to the original route object. route: collectionRoute, // Include the array of route methods for easy reference. methods: collectionRoute.route.methods } ); } // Add defaults to the new model, pulled form the endpoint. wp.api.utils.decorateFromRoute( collectionRoute.route.endpoints, loadingObjects.collections[ collectionClassName ] ); } ); // Add mixins and helpers for each of the models. _.each( loadingObjects.models, function( model, index ) { loadingObjects.models[ index ] = wp.api.utils.addMixinsAndHelpers( model, index, loadingObjects ); } ); // Set the routeModel models and collections. routeModel.set( 'models', loadingObjects.models ); routeModel.set( 'collections', loadingObjects.collections ); } } ); wp.api.endpoints = new Backbone.Collection(); /** * Initialize the wp-api, optionally passing the API root. * * @param {Object} [args] * @param {string} [args.nonce] The nonce. Optional, defaults to wpApiSettings.nonce. * @param {string} [args.apiRoot] The api root. Optional, defaults to wpApiSettings.root. * @param {string} [args.versionString] The version string. Optional, defaults to wpApiSettings.root. * @param {Object} [args.schema] The schema. Optional, will be fetched from API if not provided. */ wp.api.init = function( args ) { var endpoint, attributes = {}, deferred, promise; args = args || {}; attributes.nonce = _.isString( args.nonce ) ? args.nonce : ( wpApiSettings.nonce || '' ); attributes.apiRoot = args.apiRoot || wpApiSettings.root || '/wp-json'; attributes.versionString = args.versionString || wpApiSettings.versionString || 'wp/v2/'; attributes.schema = args.schema || null; attributes.modelEndpoints = args.modelEndpoints || [ 'me', 'settings' ]; if ( ! attributes.schema && attributes.apiRoot === wpApiSettings.root && attributes.versionString === wpApiSettings.versionString ) { attributes.schema = wpApiSettings.schema; } if ( ! initializedDeferreds[ attributes.apiRoot + attributes.versionString ] ) { // Look for an existing copy of this endpoint. endpoint = wp.api.endpoints.findWhere( { 'apiRoot': attributes.apiRoot, 'versionString': attributes.versionString } ); if ( ! endpoint ) { endpoint = new Endpoint( attributes ); } deferred = jQuery.Deferred(); promise = deferred.promise(); endpoint.schemaConstructed.done( function( resolvedEndpoint ) { wp.api.endpoints.add( resolvedEndpoint ); // Map the default endpoints, extending any already present items (including Schema model). wp.api.models = _.extend( wp.api.models, resolvedEndpoint.get( 'models' ) ); wp.api.collections = _.extend( wp.api.collections, resolvedEndpoint.get( 'collections' ) ); deferred.resolve( resolvedEndpoint ); } ); initializedDeferreds[ attributes.apiRoot + attributes.versionString ] = promise; } return initializedDeferreds[ attributes.apiRoot + attributes.versionString ]; }; /** * Construct the default endpoints and add to an endpoints collection. */ // The wp.api.init function returns a promise that will resolve with the endpoint once it is ready. wp.api.loadPromise = wp.api.init(); } )(); PK!Wcore.jsnu[/*! jQuery UI - v1.13.3 - 2024-04-26 * https://jqueryui.com * Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-patch.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js * Copyright jQuery Foundation and other contributors; Licensed MIT */ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery" ], factory ); } else { // Browser globals factory( jQuery ); } } ( function( $ ) { "use strict"; // Source: version.js $.ui = $.ui || {}; $.ui.version = "1.13.3"; // Source: data.js /*! * jQuery UI :data 1.13.3 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * https://jquery.org/license */ //>>label: :data Selector //>>group: Core //>>description: Selects elements which have data stored under the specified key. //>>docs: https://api.jqueryui.com/data-selector/ $.extend( $.expr.pseudos, { data: $.expr.createPseudo ? $.expr.createPseudo( function( dataName ) { return function( elem ) { return !!$.data( elem, dataName ); }; } ) : // Support: jQuery <1.8 function( elem, i, match ) { return !!$.data( elem, match[ 3 ] ); } } ); // Source: disable-selection.js /*! * jQuery UI Disable Selection 1.13.3 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * https://jquery.org/license */ //>>label: disableSelection //>>group: Core //>>description: Disable selection of text content within the set of matched elements. //>>docs: https://api.jqueryui.com/disableSelection/ // This file is deprecated $.fn.extend( { disableSelection: ( function() { var eventType = "onselectstart" in document.createElement( "div" ) ? "selectstart" : "mousedown"; return function() { return this.on( eventType + ".ui-disableSelection", function( event ) { event.preventDefault(); } ); }; } )(), enableSelection: function() { return this.off( ".ui-disableSelection" ); } } ); // Source: focusable.js /*! * jQuery UI Focusable 1.13.3 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * https://jquery.org/license */ //>>label: :focusable Selector //>>group: Core //>>description: Selects elements which can be focused. //>>docs: https://api.jqueryui.com/focusable-selector/ // Selectors $.ui.focusable = function( element, hasTabindex ) { var map, mapName, img, focusableIfVisible, fieldset, nodeName = element.nodeName.toLowerCase(); if ( "area" === nodeName ) { map = element.parentNode; mapName = map.name; if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { return false; } img = $( "img[usemap='#" + mapName + "']" ); return img.length > 0 && img.is( ":visible" ); } if ( /^(input|select|textarea|button|object)$/.test( nodeName ) ) { focusableIfVisible = !element.disabled; if ( focusableIfVisible ) { // Form controls within a disabled fieldset are disabled. // However, controls within the fieldset's legend do not get disabled. // Since controls generally aren't placed inside legends, we skip // this portion of the check. fieldset = $( element ).closest( "fieldset" )[ 0 ]; if ( fieldset ) { focusableIfVisible = !fieldset.disabled; } } } else if ( "a" === nodeName ) { focusableIfVisible = element.href || hasTabindex; } else { focusableIfVisible = hasTabindex; } return focusableIfVisible && $( element ).is( ":visible" ) && visible( $( element ) ); }; // Support: IE 8 only // IE 8 doesn't resolve inherit to visible/hidden for computed values function visible( element ) { var visibility = element.css( "visibility" ); while ( visibility === "inherit" ) { element = element.parent(); visibility = element.css( "visibility" ); } return visibility === "visible"; } $.extend( $.expr.pseudos, { focusable: function( element ) { return $.ui.focusable( element, $.attr( element, "tabindex" ) != null ); } } ); // Support: IE8 Only // IE8 does not support the form attribute and when it is supplied. It overwrites the form prop // with a string, so we need to find the proper form. $.fn._form = function() { return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form ); }; // Source: form-reset-mixin.js /*! * jQuery UI Form Reset Mixin 1.13.3 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * https://jquery.org/license */ //>>label: Form Reset Mixin //>>group: Core //>>description: Refresh input widgets when their form is reset //>>docs: https://api.jqueryui.com/form-reset-mixin/ $.ui.formResetMixin = { _formResetHandler: function() { var form = $( this ); // Wait for the form reset to actually happen before refreshing setTimeout( function() { var instances = form.data( "ui-form-reset-instances" ); $.each( instances, function() { this.refresh(); } ); } ); }, _bindFormResetHandler: function() { this.form = this.element._form(); if ( !this.form.length ) { return; } var instances = this.form.data( "ui-form-reset-instances" ) || []; if ( !instances.length ) { // We don't use _on() here because we use a single event handler per form this.form.on( "reset.ui-form-reset", this._formResetHandler ); } instances.push( this ); this.form.data( "ui-form-reset-instances", instances ); }, _unbindFormResetHandler: function() { if ( !this.form.length ) { return; } var instances = this.form.data( "ui-form-reset-instances" ); instances.splice( $.inArray( this, instances ), 1 ); if ( instances.length ) { this.form.data( "ui-form-reset-instances", instances ); } else { this.form .removeData( "ui-form-reset-instances" ) .off( "reset.ui-form-reset" ); } } }; // Source: ie.js // This file is deprecated $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); // Source: jquery-patch.js /*! * jQuery UI Support for jQuery core 1.8.x and newer 1.13.3 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * https://jquery.org/license * */ //>>label: jQuery 1.8+ Support //>>group: Core //>>description: Support version 1.8.x and newer of jQuery core // Support: jQuery 1.9.x or older // $.expr[ ":" ] is deprecated. if ( !$.expr.pseudos ) { $.expr.pseudos = $.expr[ ":" ]; } // Support: jQuery 1.11.x or older // $.unique has been renamed to $.uniqueSort if ( !$.uniqueSort ) { $.uniqueSort = $.unique; } // Support: jQuery 2.2.x or older. // This method has been defined in jQuery 3.0.0. // Code from https://github.com/jquery/jquery/blob/e539bac79e666bba95bba86d690b4e609dca2286/src/selector/escapeSelector.js if ( !$.escapeSelector ) { // CSS string/identifier serialization // https://drafts.csswg.org/cssom/#common-serializing-idioms var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; var fcssescape = function( ch, asCodePoint ) { if ( asCodePoint ) { // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER if ( ch === "\0" ) { return "\uFFFD"; } // Control characters and (dependent upon position) numbers get escaped as code points return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; } // Other potentially-special ASCII characters get backslash-escaped return "\\" + ch; }; $.escapeSelector = function( sel ) { return ( sel + "" ).replace( rcssescape, fcssescape ); }; } // Support: jQuery 3.4.x or older // These methods have been defined in jQuery 3.5.0. if ( !$.fn.even || !$.fn.odd ) { $.fn.extend( { even: function() { return this.filter( function( i ) { return i % 2 === 0; } ); }, odd: function() { return this.filter( function( i ) { return i % 2 === 1; } ); } } ); } // Source: keycode.js /*! * jQuery UI Keycode 1.13.3 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * https://jquery.org/license */ //>>label: Keycode //>>group: Core //>>description: Provide keycodes as keynames //>>docs: https://api.jqueryui.com/jQuery.ui.keyCode/ $.ui.keyCode = { BACKSPACE: 8, COMMA: 188, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, LEFT: 37, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SPACE: 32, TAB: 9, UP: 38 }; // Source: labels.js /*! * jQuery UI Labels 1.13.3 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * https://jquery.org/license */ //>>label: labels //>>group: Core //>>description: Find all the labels associated with a given input //>>docs: https://api.jqueryui.com/labels/ $.fn.labels = function() { var ancestor, selector, id, labels, ancestors; if ( !this.length ) { return this.pushStack( [] ); } // Check control.labels first if ( this[ 0 ].labels && this[ 0 ].labels.length ) { return this.pushStack( this[ 0 ].labels ); } // Support: IE <= 11, FF <= 37, Android <= 2.3 only // Above browsers do not support control.labels. Everything below is to support them // as well as document fragments. control.labels does not work on document fragments labels = this.eq( 0 ).parents( "label" ); // Look for the label based on the id id = this.attr( "id" ); if ( id ) { // We don't search against the document in case the element // is disconnected from the DOM ancestor = this.eq( 0 ).parents().last(); // Get a full set of top level ancestors ancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() ); // Create a selector for the label based on the id selector = "label[for='" + $.escapeSelector( id ) + "']"; labels = labels.add( ancestors.find( selector ).addBack( selector ) ); } // Return whatever we have found for labels return this.pushStack( labels ); }; // Source: plugin.js // $.ui.plugin is deprecated. Use $.widget() extensions instead. $.ui.plugin = { add: function( module, option, set ) { var i, proto = $.ui[ module ].prototype; for ( i in set ) { proto.plugins[ i ] = proto.plugins[ i ] || []; proto.plugins[ i ].push( [ option, set[ i ] ] ); } }, call: function( instance, name, args, allowDisconnected ) { var i, set = instance.plugins[ name ]; if ( !set ) { return; } if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) { return; } for ( i = 0; i < set.length; i++ ) { if ( instance.options[ set[ i ][ 0 ] ] ) { set[ i ][ 1 ].apply( instance.element, args ); } } } }; // Source: position.js /*! * jQuery UI Position 1.13.3 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * https://jquery.org/license * * https://api.jqueryui.com/position/ */ //>>label: Position //>>group: Core //>>description: Positions elements relative to other elements. //>>docs: https://api.jqueryui.com/position/ //>>demos: https://jqueryui.com/position/ ( function() { var cachedScrollbarWidth, max = Math.max, abs = Math.abs, rhorizontal = /left|center|right/, rvertical = /top|center|bottom/, roffset = /[\+\-]\d+(\.[\d]+)?%?/, rposition = /^\w+/, rpercent = /%$/, _position = $.fn.position; function getOffsets( offsets, width, height ) { return [ parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) ]; } function parseCss( element, property ) { return parseInt( $.css( element, property ), 10 ) || 0; } function isWindow( obj ) { return obj != null && obj === obj.window; } function getDimensions( elem ) { var raw = elem[ 0 ]; if ( raw.nodeType === 9 ) { return { width: elem.width(), height: elem.height(), offset: { top: 0, left: 0 } }; } if ( isWindow( raw ) ) { return { width: elem.width(), height: elem.height(), offset: { top: elem.scrollTop(), left: elem.scrollLeft() } }; } if ( raw.preventDefault ) { return { width: 0, height: 0, offset: { top: raw.pageY, left: raw.pageX } }; } return { width: elem.outerWidth(), height: elem.outerHeight(), offset: elem.offset() }; } $.position = { scrollbarWidth: function() { if ( cachedScrollbarWidth !== undefined ) { return cachedScrollbarWidth; } var w1, w2, div = $( "
" + "
" ), innerDiv = div.children()[ 0 ]; $( "body" ).append( div ); w1 = innerDiv.offsetWidth; div.css( "overflow", "scroll" ); w2 = innerDiv.offsetWidth; if ( w1 === w2 ) { w2 = div[ 0 ].clientWidth; } div.remove(); return ( cachedScrollbarWidth = w1 - w2 ); }, getScrollInfo: function( within ) { var overflowX = within.isWindow || within.isDocument ? "" : within.element.css( "overflow-x" ), overflowY = within.isWindow || within.isDocument ? "" : within.element.css( "overflow-y" ), hasOverflowX = overflowX === "scroll" || ( overflowX === "auto" && within.width < within.element[ 0 ].scrollWidth ), hasOverflowY = overflowY === "scroll" || ( overflowY === "auto" && within.height < within.element[ 0 ].scrollHeight ); return { width: hasOverflowY ? $.position.scrollbarWidth() : 0, height: hasOverflowX ? $.position.scrollbarWidth() : 0 }; }, getWithinInfo: function( element ) { var withinElement = $( element || window ), isElemWindow = isWindow( withinElement[ 0 ] ), isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9, hasOffset = !isElemWindow && !isDocument; return { element: withinElement, isWindow: isElemWindow, isDocument: isDocument, offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 }, scrollLeft: withinElement.scrollLeft(), scrollTop: withinElement.scrollTop(), width: withinElement.outerWidth(), height: withinElement.outerHeight() }; } }; $.fn.position = function( options ) { if ( !options || !options.of ) { return _position.apply( this, arguments ); } // Make a copy, we don't want to modify arguments options = $.extend( {}, options ); var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, // Make sure string options are treated as CSS selectors target = typeof options.of === "string" ? $( document ).find( options.of ) : $( options.of ), within = $.position.getWithinInfo( options.within ), scrollInfo = $.position.getScrollInfo( within ), collision = ( options.collision || "flip" ).split( " " ), offsets = {}; dimensions = getDimensions( target ); if ( target[ 0 ].preventDefault ) { // Force left top to allow flipping options.at = "left top"; } targetWidth = dimensions.width; targetHeight = dimensions.height; targetOffset = dimensions.offset; // Clone to reuse original targetOffset later basePosition = $.extend( {}, targetOffset ); // Force my and at to have valid horizontal and vertical positions // if a value is missing or invalid, it will be converted to center $.each( [ "my", "at" ], function() { var pos = ( options[ this ] || "" ).split( " " ), horizontalOffset, verticalOffset; if ( pos.length === 1 ) { pos = rhorizontal.test( pos[ 0 ] ) ? pos.concat( [ "center" ] ) : rvertical.test( pos[ 0 ] ) ? [ "center" ].concat( pos ) : [ "center", "center" ]; } pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; // Calculate offsets horizontalOffset = roffset.exec( pos[ 0 ] ); verticalOffset = roffset.exec( pos[ 1 ] ); offsets[ this ] = [ horizontalOffset ? horizontalOffset[ 0 ] : 0, verticalOffset ? verticalOffset[ 0 ] : 0 ]; // Reduce to just the positions without the offsets options[ this ] = [ rposition.exec( pos[ 0 ] )[ 0 ], rposition.exec( pos[ 1 ] )[ 0 ] ]; } ); // Normalize collision option if ( collision.length === 1 ) { collision[ 1 ] = collision[ 0 ]; } if ( options.at[ 0 ] === "right" ) { basePosition.left += targetWidth; } else if ( options.at[ 0 ] === "center" ) { basePosition.left += targetWidth / 2; } if ( options.at[ 1 ] === "bottom" ) { basePosition.top += targetHeight; } else if ( options.at[ 1 ] === "center" ) { basePosition.top += targetHeight / 2; } atOffset = getOffsets( offsets.at, targetWidth, targetHeight ); basePosition.left += atOffset[ 0 ]; basePosition.top += atOffset[ 1 ]; return this.each( function() { var collisionPosition, using, elem = $( this ), elemWidth = elem.outerWidth(), elemHeight = elem.outerHeight(), marginLeft = parseCss( this, "marginLeft" ), marginTop = parseCss( this, "marginTop" ), collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width, collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height, position = $.extend( {}, basePosition ), myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() ); if ( options.my[ 0 ] === "right" ) { position.left -= elemWidth; } else if ( options.my[ 0 ] === "center" ) { position.left -= elemWidth / 2; } if ( options.my[ 1 ] === "bottom" ) { position.top -= elemHeight; } else if ( options.my[ 1 ] === "center" ) { position.top -= elemHeight / 2; } position.left += myOffset[ 0 ]; position.top += myOffset[ 1 ]; collisionPosition = { marginLeft: marginLeft, marginTop: marginTop }; $.each( [ "left", "top" ], function( i, dir ) { if ( $.ui.position[ collision[ i ] ] ) { $.ui.position[ collision[ i ] ][ dir ]( position, { targetWidth: targetWidth, targetHeight: targetHeight, elemWidth: elemWidth, elemHeight: elemHeight, collisionPosition: collisionPosition, collisionWidth: collisionWidth, collisionHeight: collisionHeight, offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], my: options.my, at: options.at, within: within, elem: elem } ); } } ); if ( options.using ) { // Adds feedback as second argument to using callback, if present using = function( props ) { var left = targetOffset.left - position.left, right = left + targetWidth - elemWidth, top = targetOffset.top - position.top, bottom = top + targetHeight - elemHeight, feedback = { target: { element: target, left: targetOffset.left, top: targetOffset.top, width: targetWidth, height: targetHeight }, element: { element: elem, left: position.left, top: position.top, width: elemWidth, height: elemHeight }, horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" }; if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { feedback.horizontal = "center"; } if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) { feedback.vertical = "middle"; } if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { feedback.important = "horizontal"; } else { feedback.important = "vertical"; } options.using.call( this, props, feedback ); }; } elem.offset( $.extend( position, { using: using } ) ); } ); }; $.ui.position = { fit: { left: function( position, data ) { var within = data.within, withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, outerWidth = within.width, collisionPosLeft = position.left - data.collisionPosition.marginLeft, overLeft = withinOffset - collisionPosLeft, overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, newOverRight; // Element is wider than within if ( data.collisionWidth > outerWidth ) { // Element is initially over the left side of within if ( overLeft > 0 && overRight <= 0 ) { newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset; position.left += overLeft - newOverRight; // Element is initially over right side of within } else if ( overRight > 0 && overLeft <= 0 ) { position.left = withinOffset; // Element is initially over both left and right sides of within } else { if ( overLeft > overRight ) { position.left = withinOffset + outerWidth - data.collisionWidth; } else { position.left = withinOffset; } } // Too far left -> align with left edge } else if ( overLeft > 0 ) { position.left += overLeft; // Too far right -> align with right edge } else if ( overRight > 0 ) { position.left -= overRight; // Adjust based on position and margin } else { position.left = max( position.left - collisionPosLeft, position.left ); } }, top: function( position, data ) { var within = data.within, withinOffset = within.isWindow ? within.scrollTop : within.offset.top, outerHeight = data.within.height, collisionPosTop = position.top - data.collisionPosition.marginTop, overTop = withinOffset - collisionPosTop, overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, newOverBottom; // Element is taller than within if ( data.collisionHeight > outerHeight ) { // Element is initially over the top of within if ( overTop > 0 && overBottom <= 0 ) { newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset; position.top += overTop - newOverBottom; // Element is initially over bottom of within } else if ( overBottom > 0 && overTop <= 0 ) { position.top = withinOffset; // Element is initially over both top and bottom of within } else { if ( overTop > overBottom ) { position.top = withinOffset + outerHeight - data.collisionHeight; } else { position.top = withinOffset; } } // Too far up -> align with top } else if ( overTop > 0 ) { position.top += overTop; // Too far down -> align with bottom edge } else if ( overBottom > 0 ) { position.top -= overBottom; // Adjust based on position and margin } else { position.top = max( position.top - collisionPosTop, position.top ); } } }, flip: { left: function( position, data ) { var within = data.within, withinOffset = within.offset.left + within.scrollLeft, outerWidth = within.width, offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, collisionPosLeft = position.left - data.collisionPosition.marginLeft, overLeft = collisionPosLeft - offsetLeft, overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, myOffset = data.my[ 0 ] === "left" ? -data.elemWidth : data.my[ 0 ] === "right" ? data.elemWidth : 0, atOffset = data.at[ 0 ] === "left" ? data.targetWidth : data.at[ 0 ] === "right" ? -data.targetWidth : 0, offset = -2 * data.offset[ 0 ], newOverRight, newOverLeft; if ( overLeft < 0 ) { newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset; if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) { position.left += myOffset + atOffset + offset; } } else if ( overRight > 0 ) { newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft; if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) { position.left += myOffset + atOffset + offset; } } }, top: function( position, data ) { var within = data.within, withinOffset = within.offset.top + within.scrollTop, outerHeight = within.height, offsetTop = within.isWindow ? within.scrollTop : within.offset.top, collisionPosTop = position.top - data.collisionPosition.marginTop, overTop = collisionPosTop - offsetTop, overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, top = data.my[ 1 ] === "top", myOffset = top ? -data.elemHeight : data.my[ 1 ] === "bottom" ? data.elemHeight : 0, atOffset = data.at[ 1 ] === "top" ? data.targetHeight : data.at[ 1 ] === "bottom" ? -data.targetHeight : 0, offset = -2 * data.offset[ 1 ], newOverTop, newOverBottom; if ( overTop < 0 ) { newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset; if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) { position.top += myOffset + atOffset + offset; } } else if ( overBottom > 0 ) { newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) { position.top += myOffset + atOffset + offset; } } } }, flipfit: { left: function() { $.ui.position.flip.left.apply( this, arguments ); $.ui.position.fit.left.apply( this, arguments ); }, top: function() { $.ui.position.flip.top.apply( this, arguments ); $.ui.position.fit.top.apply( this, arguments ); } } }; } )(); // Source: safe-active-element.js $.ui.safeActiveElement = function( document ) { var activeElement; // Support: IE 9 only // IE9 throws an "Unspecified error" accessing document.activeElement from an