Файловый менеджер - Редактировать - /home/tuudkjt/globeasy/wp-includes/ID3/litespeed-cache.tar
Назад
src/str.cls.php 0000777 00000006124 15251157102 0007445 0 ustar 00 <?php /** * LiteSpeed String Operator Library Class * * @since 1.3 * @package LiteSpeed */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Str * * Provides string manipulation utilities for LiteSpeed Cache. * * @since 1.3 */ class Str { /** * Translate QC HTML links from html. * * Converts `<a href="{#xxx#}">xxxx</a>` to `<a href="xxx">xxxx</a>`. * * @since 7.0 * @access public * @param string $html The HTML string to process. * @return string The processed HTML string. */ public static function translate_qc_apis( $html ) { preg_match_all( '/<a href="{#(\w+)#}"/U', $html, $matches ); if ( ! $matches ) { return $html; } foreach ( $matches[0] as $k => $html_to_be_replaced ) { $link = '<a href="' . Utility::build_url( Router::ACTION_CLOUD, Cloud::TYPE_API, false, null, [ 'action2' => $matches[1][ $k ] ] ) . '"'; $html = str_replace( $html_to_be_replaced, $link, $html ); } return $html; } /** * Return safe HTML * * Sanitizes HTML to allow only specific tags and attributes. * * @since 7.0 * @access public * @param string $html The HTML string to sanitize. * @return string The sanitized HTML string. */ public static function safe_html( $html ) { $common_attrs = [ 'style' => [], 'class' => [], 'target' => [], 'src' => [], 'color' => [], 'href' => [], ]; $tags = [ 'hr', 'h3', 'h4', 'h5', 'ul', 'li', 'br', 'strong', 'p', 'span', 'img', 'a', 'div', 'font' ]; $allowed_tags = []; foreach ( $tags as $tag ) { $allowed_tags[ $tag ] = $common_attrs; } return wp_kses( $html, $allowed_tags ); } /** * Generate random string * * Creates a random string of specified length and character type. * * @since 1.3 * @access public * @param int $len Length of string. * @param int $type Character type: 1-Number, 2-LowerChar, 4-UpperChar, 7-All. * @return string Randomly generated string. */ public static function rrand( $len, $type = 7 ) { switch ( $type ) { case 0: $charlist = '012'; break; case 1: $charlist = '0123456789'; break; case 2: $charlist = 'abcdefghijklmnopqrstuvwxyz'; break; case 3: $charlist = '0123456789abcdefghijklmnopqrstuvwxyz'; break; case 4: $charlist = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; break; case 5: $charlist = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; break; case 6: $charlist = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; break; case 7: $charlist = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; break; } $str = ''; $max = strlen( $charlist ) - 1; for ( $i = 0; $i < $len; $i++ ) { $str .= $charlist[ random_int( 0, $max ) ]; } return $str; } /** * Trim double quotes from a string * * Removes double quotes from a string for use as a preformatted src in HTML. * * @since 6.5.3 * @access public * @param string $text The string to process. * @return string The string with double quotes removed. */ public static function trim_quotes( $text ) { return str_replace( '"', '', $text ); } } src/data_structure/img_optming.sql 0000777 00000000526 15251157102 0013427 0 ustar 00 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `post_id` bigint(20) unsigned NOT NULL DEFAULT '0', `optm_status` tinyint(4) NOT NULL DEFAULT '0', `src` varchar(1000) NOT NULL DEFAULT '', `server_info` text NOT NULL, PRIMARY KEY (`id`), KEY `post_id` (`post_id`), KEY `optm_status` (`optm_status`), KEY `src` (`src`(191)) src/data_structure/img_optm.sql 0000777 00000000632 15251157102 0012727 0 ustar 00 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `post_id` bigint(20) unsigned NOT NULL DEFAULT '0', `optm_status` tinyint(4) NOT NULL DEFAULT '0', `src` text NOT NULL, `src_filesize` int(11) NOT NULL DEFAULT '0', `target_filesize` int(11) NOT NULL DEFAULT '0', `webp_filesize` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `post_id` (`post_id`), KEY `optm_status` (`optm_status`) src/data_structure/url.sql 0000777 00000000315 15251157102 0011714 0 ustar 00 `id` bigint(20) NOT NULL AUTO_INCREMENT, `url` varchar(500) NOT NULL, `cache_tags` varchar(1000) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `url` (`url`(191)), KEY `cache_tags` (`cache_tags`(191)) src/data_structure/avatar.sql 0000777 00000000404 15251157102 0012367 0 ustar 00 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `url` varchar(1000) NOT NULL DEFAULT '', `md5` varchar(128) NOT NULL DEFAULT '', `dateline` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `md5` (`md5`), KEY `dateline` (`dateline`) src/data_structure/crawler.sql 0000777 00000000632 15251157102 0012553 0 ustar 00 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `url` varchar(1000) NOT NULL DEFAULT '', `res` varchar(255) NOT NULL DEFAULT '' COMMENT '-=not crawl, H=hit, M=miss, B=blacklist', `reason` text NOT NULL COMMENT 'response code, comma separated', `mtime` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`), KEY `url` (`url`(191)), KEY `res` (`res`) src/data_structure/url_file.sql 0000777 00000001210 15251157102 0012706 0 ustar 00 `id` bigint(20) NOT NULL AUTO_INCREMENT, `url_id` bigint(20) NOT NULL, `vary` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'md5 of final vary', `filename` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'md5 of file content', `type` tinyint(4) NOT NULL COMMENT 'css=1,js=2,ccss=3,ucss=4', `mobile` tinyint(4) NOT NULL COMMENT 'mobile=1', `webp` tinyint(4) NOT NULL COMMENT 'webp=1', `expired` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `filename` (`filename`), KEY `type` (`type`), KEY `url_id_2` (`url_id`,`vary`,`type`), KEY `filename_2` (`filename`,`expired`), KEY `url_id` (`url_id`,`expired`) src/data_structure/crawler_blacklist.sql 0000777 00000000626 15251157102 0014606 0 ustar 00 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `url` varchar(1000) NOT NULL DEFAULT '', `res` varchar(255) NOT NULL DEFAULT '' COMMENT '-=Not Blacklist, B=blacklist', `reason` text NOT NULL COMMENT 'Reason for blacklist, comma separated', `mtime` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`), KEY `url` (`url`(191)), KEY `res` (`res`) src/htaccess.cls.php 0000777 00000060002 15251157102 0010425 0 ustar 00 <?php // phpcs:ignoreFile /** * The htaccess rewrite rule operation class * * @since 1.0.0 * @package LiteSpeed */ namespace LiteSpeed; defined('WPINC') || exit(); class Htaccess extends Root { private $frontend_htaccess = null; private $_default_frontend_htaccess = null; private $backend_htaccess = null; private $_default_backend_htaccess = null; private $theme_htaccess = null; // Not used yet private $frontend_htaccess_readable = false; private $frontend_htaccess_writable = false; private $backend_htaccess_readable = false; private $backend_htaccess_writable = false; private $theme_htaccess_readable = false; private $theme_htaccess_writable = false; private $__rewrite_on; const LS_MODULE_START = '<IfModule LiteSpeed>'; const EXPIRES_MODULE_START = '<IfModule mod_expires.c>'; const LS_MODULE_END = '</IfModule>'; const LS_MODULE_REWRITE_START = '<IfModule mod_rewrite.c>'; const REWRITE_ON = 'RewriteEngine on'; const LS_MODULE_DONOTEDIT = '## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##'; const MARKER = 'LSCACHE'; const MARKER_NONLS = 'NON_LSCACHE'; const MARKER_LOGIN_COOKIE = '### marker LOGIN COOKIE'; const MARKER_ASYNC = '### marker ASYNC'; const MARKER_CRAWLER = '### marker CRAWLER'; const MARKER_MOBILE = '### marker MOBILE'; const MARKER_NOCACHE_COOKIES = '### marker NOCACHE COOKIES'; const MARKER_NOCACHE_USER_AGENTS = '### marker NOCACHE USER AGENTS'; const MARKER_CACHE_RESOURCE = '### marker CACHE RESOURCE'; const MARKER_BROWSER_CACHE = '### marker BROWSER CACHE'; const MARKER_MINIFY = '### marker MINIFY'; const MARKER_CORS = '### marker CORS'; const MARKER_WEBP = '### marker WEBP'; const MARKER_DROPQS = '### marker DROPQS'; const MARKER_START = ' start ###'; const MARKER_END = ' end ###'; /** * Initialize the class and set its properties. * * @since 1.0.7 */ public function __construct() { $this->_path_set(); $this->_default_frontend_htaccess = $this->frontend_htaccess; $this->_default_backend_htaccess = $this->backend_htaccess; $frontend_htaccess = defined('LITESPEED_CFG_HTACCESS') ? constant('LITESPEED_CFG_HTACCESS') : false; if ($frontend_htaccess && substr($frontend_htaccess, -10) === '/.htaccess') { $this->frontend_htaccess = $frontend_htaccess; } $backend_htaccess = defined('LITESPEED_CFG_HTACCESS_BACKEND') ? constant('LITESPEED_CFG_HTACCESS_BACKEND') : false; if ($backend_htaccess && substr($backend_htaccess, -10) === '/.htaccess') { $this->backend_htaccess = $backend_htaccess; } // Filter for frontend&backend htaccess path $this->frontend_htaccess = apply_filters('litespeed_frontend_htaccess', $this->frontend_htaccess); $this->backend_htaccess = apply_filters('litespeed_backend_htaccess', $this->backend_htaccess); clearstatcache(); // frontend .htaccess privilege $test_permissions = file_exists($this->frontend_htaccess) ? $this->frontend_htaccess : dirname($this->frontend_htaccess); if (is_readable($test_permissions)) { $this->frontend_htaccess_readable = true; } if (is_writable($test_permissions)) { $this->frontend_htaccess_writable = true; } $this->__rewrite_on = array( self::REWRITE_ON, 'CacheLookup on', 'RewriteRule .* - [E=Cache-Control:no-autoflush]', 'RewriteRule ' . preg_quote(LITESPEED_DATA_FOLDER) . '/debug/.*\.log$ - [F,L]', 'RewriteRule ' . preg_quote(self::CONF_FILE) . ' - [F,L]', ); // backend .htaccess privilege if ($this->frontend_htaccess === $this->backend_htaccess) { $this->backend_htaccess_readable = $this->frontend_htaccess_readable; $this->backend_htaccess_writable = $this->frontend_htaccess_writable; } else { $test_permissions = file_exists($this->backend_htaccess) ? $this->backend_htaccess : dirname($this->backend_htaccess); if (is_readable($test_permissions)) { $this->backend_htaccess_readable = true; } if (is_writable($test_permissions)) { $this->backend_htaccess_writable = true; } } } /** * Get if htaccess file is readable * * @since 1.1.0 * @return string */ private function _readable( $kind = 'frontend' ) { if ($kind === 'frontend') { return $this->frontend_htaccess_readable; } if ($kind === 'backend') { return $this->backend_htaccess_readable; } } /** * Get if htaccess file is writable * * @since 1.1.0 * @return string */ public function writable( $kind = 'frontend' ) { if ($kind === 'frontend') { return $this->frontend_htaccess_writable; } if ($kind === 'backend') { return $this->backend_htaccess_writable; } } /** * Get frontend htaccess path * * @since 1.1.0 * @return string */ public static function get_frontend_htaccess( $show_default = false ) { if ($show_default) { return self::cls()->_default_frontend_htaccess; } return self::cls()->frontend_htaccess; } /** * Get backend htaccess path * * @since 1.1.0 * @return string */ public static function get_backend_htaccess( $show_default = false ) { if ($show_default) { return self::cls()->_default_backend_htaccess; } return self::cls()->backend_htaccess; } /** * Check to see if .htaccess exists starting at $start_path and going up directories until it hits DOCUMENT_ROOT. * * As dirname() strips the ending '/', paths passed in must exclude the final '/' * * @since 1.0.11 * @access private */ private function _htaccess_search( $start_path ) { while (!file_exists($start_path . '/.htaccess')) { if ($start_path === '/' || !$start_path) { return false; } if (!empty($_SERVER['DOCUMENT_ROOT']) && wp_normalize_path($start_path) === wp_normalize_path($_SERVER['DOCUMENT_ROOT'])) { return false; } if (dirname($start_path) === $start_path) { return false; } $start_path = dirname($start_path); } return $start_path; } /** * Set the path class variables. * * @since 1.0.11 * @access private */ private function _path_set() { $frontend = Router::frontend_path(); $frontend_htaccess_search = $this->_htaccess_search($frontend); // The existing .htaccess path to be used for frontend .htaccess $this->frontend_htaccess = ($frontend_htaccess_search ?: $frontend) . '/.htaccess'; $backend = realpath(ABSPATH); // /home/user/public_html/backend/ if ($frontend == $backend) { $this->backend_htaccess = $this->frontend_htaccess; return; } // Backend is a different path $backend_htaccess_search = $this->_htaccess_search($backend); // Found affected .htaccess if ($backend_htaccess_search) { $this->backend_htaccess = $backend_htaccess_search . '/.htaccess'; return; } // Frontend path is the parent of backend path if (stripos($backend, $frontend . '/') === 0) { // backend use frontend htaccess $this->backend_htaccess = $this->frontend_htaccess; return; } $this->backend_htaccess = $backend . '/.htaccess'; } /** * Get corresponding htaccess path * * @since 1.1.0 * @param string $kind Frontend or backend * @return string Path */ public function htaccess_path( $kind = 'frontend' ) { switch ($kind) { case 'backend': $path = $this->backend_htaccess; break; case 'frontend': default: $path = $this->frontend_htaccess; break; } return $path; } /** * Get the content of the rules file. * * NOTE: will throw error if failed * * @since 1.0.4 * @since 2.9 Used exception for failed reading * @access public */ public function htaccess_read( $kind = 'frontend' ) { $path = $this->htaccess_path($kind); if (!$path || !file_exists($path)) { return "\n"; } if (!$this->_readable($kind)) { Error::t('HTA_R'); } $content = File::read($path); if ($content === false) { Error::t('HTA_GET'); } // Remove ^M characters. $content = str_ireplace("\x0D", '', $content); return $content; } /** * Try to backup the .htaccess file if we didn't save one before. * * NOTE: will throw error if failed * * @since 1.0.10 * @access private */ private function _htaccess_backup( $kind = 'frontend' ) { $path = $this->htaccess_path($kind); if (!file_exists($path)) { return; } if (file_exists($path . '.bk')) { return; } $res = copy($path, $path . '.bk'); // Failed to backup, abort if (!$res) { Error::t('HTA_BK'); } } /** * Get mobile view rule from htaccess file * * NOTE: will throw error if failed * * @since 1.1.0 */ public function current_mobile_agents() { $rules = $this->_get_rule_by(self::MARKER_MOBILE); if (!isset($rules[0])) { Error::t('HTA_DNF', self::MARKER_MOBILE); } $rule = trim($rules[0]); // 'RewriteCond %{HTTP_USER_AGENT} ' . Utility::arr2regex( $cfg[ $id ], true ) . ' [NC]'; $match = substr($rule, strlen('RewriteCond %{HTTP_USER_AGENT} '), -strlen(' [NC]')); if (!$match) { Error::t('HTA_DNF', __('Mobile Agent Rules', 'litespeed-cache')); } return $match; } /** * Parse rewrites rule from the .htaccess file. * * NOTE: will throw error if failed * * @since 1.1.0 * @access public */ public function current_login_cookie( $kind = 'frontend' ) { $rule = $this->_get_rule_by(self::MARKER_LOGIN_COOKIE, $kind); if (!$rule) { Error::t('HTA_DNF', self::MARKER_LOGIN_COOKIE); } if (strpos($rule, 'RewriteRule .? - [E=') !== 0) { Error::t('HTA_LOGIN_COOKIE_INVALID'); } $rule_cookie = substr($rule, strlen('RewriteRule .? - [E='), -1); if (LITESPEED_SERVER_TYPE === 'LITESPEED_SERVER_OLS') { $rule_cookie = trim($rule_cookie, '"'); } // Drop `Cache-Vary:` $rule_cookie = substr($rule_cookie, strlen('Cache-Vary:')); return $rule_cookie; } /** * Get rewrite rules based on the marker * * @since 2.0 * @access private */ private function _get_rule_by( $cond, $kind = 'frontend' ) { clearstatcache(); $path = $this->htaccess_path($kind); if (!$this->_readable($kind)) { return false; } $rules = File::extract_from_markers($path, self::MARKER); if (!in_array($cond . self::MARKER_START, $rules) || !in_array($cond . self::MARKER_END, $rules)) { return false; } $key_start = array_search($cond . self::MARKER_START, $rules); $key_end = array_search($cond . self::MARKER_END, $rules); if ($key_start === false || $key_end === false) { return false; } $results = array_slice($rules, $key_start + 1, $key_end - $key_start - 1); if (!$results) { return false; } if (count($results) == 1) { return trim($results[0]); } return array_filter($results); } /** * Generate browser cache rules * * @since 1.3 * @access private * @return array Rules set */ private function _browser_cache_rules( $cfg ) { /** * Add ttl setting * * @since 1.6.3 */ $id = Base::O_CACHE_TTL_BROWSER; $ttl = $cfg[$id]; $rules = array( self::EXPIRES_MODULE_START, // '<FilesMatch "\.(pdf|ico|svg|xml|jpg|jpeg|png|gif|webp|ogg|mp4|webm|js|css|woff|woff2|ttf|eot)(\.gz)?$">', 'ExpiresActive on', 'ExpiresByType application/pdf A' . $ttl, 'ExpiresByType image/x-icon A' . $ttl, 'ExpiresByType image/vnd.microsoft.icon A' . $ttl, 'ExpiresByType image/svg+xml A' . $ttl, '', 'ExpiresByType image/jpg A' . $ttl, 'ExpiresByType image/jpeg A' . $ttl, 'ExpiresByType image/png A' . $ttl, 'ExpiresByType image/gif A' . $ttl, 'ExpiresByType image/webp A' . $ttl, 'ExpiresByType image/avif A' . $ttl, '', 'ExpiresByType video/ogg A' . $ttl, 'ExpiresByType audio/ogg A' . $ttl, 'ExpiresByType video/mp4 A' . $ttl, 'ExpiresByType video/webm A' . $ttl, '', 'ExpiresByType text/css A' . $ttl, 'ExpiresByType text/javascript A' . $ttl, 'ExpiresByType application/javascript A' . $ttl, 'ExpiresByType application/x-javascript A' . $ttl, '', 'ExpiresByType application/x-font-ttf A' . $ttl, 'ExpiresByType application/x-font-woff A' . $ttl, 'ExpiresByType application/font-woff A' . $ttl, 'ExpiresByType application/font-woff2 A' . $ttl, 'ExpiresByType application/vnd.ms-fontobject A' . $ttl, 'ExpiresByType font/ttf A' . $ttl, 'ExpiresByType font/otf A' . $ttl, 'ExpiresByType font/woff A' . $ttl, 'ExpiresByType font/woff2 A' . $ttl, '', // '</FilesMatch>', self::LS_MODULE_END, ); return $rules; } /** * Generate CORS rules for fonts * * @since 1.5 * @access private * @return array Rules set */ private function _cors_rules() { return array( '<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font\.css)$">', '<IfModule mod_headers.c>', 'Header set Access-Control-Allow-Origin "*"', '</IfModule>', '</FilesMatch>', ); } /** * Generate rewrite rules based on settings * * @since 1.3 * @access private * @param array $cfg The settings to be used for rewrite rule * @return array Rules array */ private function _generate_rules( $cfg ) { $new_rules = array(); $new_rules_nonls = array(); $new_rules_backend = array(); $new_rules_backend_nonls = array(); // continual crawler // $id = Base::O_CRAWLER; // if (!empty($cfg[$id])) { $new_rules[] = self::MARKER_ASYNC . self::MARKER_START; $new_rules[] = 'RewriteCond %{REQUEST_URI} /wp-admin/admin-ajax\.php'; $new_rules[] = 'RewriteCond %{QUERY_STRING} action=async_litespeed'; $new_rules[] = 'RewriteRule .* - [E=noabort:1]'; $new_rules[] = self::MARKER_ASYNC . self::MARKER_END; $new_rules[] = ''; // } // mobile agents $id = Base::O_CACHE_MOBILE_RULES; if ((!empty($cfg[Base::O_CACHE_MOBILE]) || !empty($cfg[Base::O_GUEST])) && !empty($cfg[$id])) { $new_rules[] = self::MARKER_MOBILE . self::MARKER_START; $new_rules[] = 'RewriteCond %{HTTP_USER_AGENT} ' . Utility::arr2regex($cfg[$id], true) . ' [NC]'; $new_rules[] = 'RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+ismobile]'; $new_rules[] = self::MARKER_MOBILE . self::MARKER_END; $new_rules[] = ''; } // nocache cookie $id = Base::O_CACHE_EXC_COOKIES; if (!empty($cfg[$id])) { $new_rules[] = self::MARKER_NOCACHE_COOKIES . self::MARKER_START; $new_rules[] = 'RewriteCond %{HTTP_COOKIE} ' . Utility::arr2regex($cfg[$id], true); $new_rules[] = 'RewriteRule .* - [E=Cache-Control:no-cache]'; $new_rules[] = self::MARKER_NOCACHE_COOKIES . self::MARKER_END; $new_rules[] = ''; } // nocache user agents $id = Base::O_CACHE_EXC_USERAGENTS; if (!empty($cfg[$id])) { $new_rules[] = self::MARKER_NOCACHE_USER_AGENTS . self::MARKER_START; $new_rules[] = 'RewriteCond %{HTTP_USER_AGENT} ' . Utility::arr2regex($cfg[$id], true) . ' [NC]'; $new_rules[] = 'RewriteRule .* - [E=Cache-Control:no-cache]'; $new_rules[] = self::MARKER_NOCACHE_USER_AGENTS . self::MARKER_END; $new_rules[] = ''; } // check login cookie $vary_cookies = $cfg[Base::O_CACHE_VARY_COOKIES]; $id = Base::O_CACHE_LOGIN_COOKIE; if (!empty($cfg[$id])) { $vary_cookies[] = $cfg[$id]; } if (LITESPEED_SERVER_TYPE === 'LITESPEED_SERVER_OLS') { // Need to keep this due to different behavior of OLS when handling response vary header @Sep/22/2018 if (defined('COOKIEHASH')) { $vary_cookies[] = ',wp-postpass_' . COOKIEHASH; } } $vary_cookies = apply_filters('litespeed_vary_cookies', $vary_cookies); // todo: test if response vary header can work in latest OLS, drop the above two lines // frontend and backend if ($vary_cookies) { $env = 'Cache-Vary:' . implode(',', $vary_cookies); // if (LITESPEED_SERVER_TYPE === 'LITESPEED_SERVER_OLS') { // } $env = '"' . $env . '"'; $new_rules[] = $new_rules_backend[] = self::MARKER_LOGIN_COOKIE . self::MARKER_START; $new_rules[] = $new_rules_backend[] = 'RewriteRule .? - [E=' . $env . ']'; $new_rules[] = $new_rules_backend[] = self::MARKER_LOGIN_COOKIE . self::MARKER_END; $new_rules[] = ''; } // CORS font rules $id = Base::O_CDN; if (!empty($cfg[$id])) { $new_rules[] = self::MARKER_CORS . self::MARKER_START; $new_rules = array_merge($new_rules, $this->_cors_rules()); // todo: network $new_rules[] = self::MARKER_CORS . self::MARKER_END; $new_rules[] = ''; } // webp support $id = Base::O_IMG_OPTM_WEBP; if (!empty($cfg[$id])) { $next_gen_format = 'webp'; if ($cfg[$id] == 2) { $next_gen_format = 'avif'; } $new_rules[] = self::MARKER_WEBP . self::MARKER_START; // Check for WebP support via HTTP_ACCEPT $new_rules[] = 'RewriteCond %{HTTP_ACCEPT} image/' . $next_gen_format . ' [OR]'; // Check for iPhone browsers (version > 13) $new_rules[] = 'RewriteCond %{HTTP_USER_AGENT} iPhone\ OS\ (1[4-9]|[2-9][0-9]) [OR]'; // Check for Firefox (version >= 65) $new_rules[] = 'RewriteCond %{HTTP_USER_AGENT} Firefox/([6-9][0-9]|[1-9][0-9]{2,})'; // Add vary $new_rules[] = 'RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]'; $new_rules[] = self::MARKER_WEBP . self::MARKER_END; $new_rules[] = ''; } // drop qs support $id = Base::O_CACHE_DROP_QS; if (!empty($cfg[$id])) { $new_rules[] = self::MARKER_DROPQS . self::MARKER_START; foreach ($cfg[$id] as $v) { $new_rules[] = 'CacheKeyModify -qs:' . $v; } $new_rules[] = self::MARKER_DROPQS . self::MARKER_END; $new_rules[] = ''; } // Browser cache $id = Base::O_CACHE_BROWSER; if (!empty($cfg[$id])) { $new_rules_nonls[] = $new_rules_backend_nonls[] = self::MARKER_BROWSER_CACHE . self::MARKER_START; $new_rules_nonls = array_merge($new_rules_nonls, $this->_browser_cache_rules($cfg)); $new_rules_backend_nonls = array_merge($new_rules_backend_nonls, $this->_browser_cache_rules($cfg)); $new_rules_nonls[] = $new_rules_backend_nonls[] = self::MARKER_BROWSER_CACHE . self::MARKER_END; $new_rules_nonls[] = ''; } // Add module wrapper for LiteSpeed rules if ($new_rules) { $new_rules = $this->_wrap_ls_module($new_rules); } if ($new_rules_backend) { $new_rules_backend = $this->_wrap_ls_module($new_rules_backend); } return array( $new_rules, $new_rules_backend, $new_rules_nonls, $new_rules_backend_nonls ); } /** * Add LitSpeed module wrapper with rewrite on * * @since 2.1.1 * @access private */ private function _wrap_ls_module( $rules = array() ) { return array_merge(array( self::LS_MODULE_START ), $this->__rewrite_on, array( '' ), $rules, array( self::LS_MODULE_END )); } /** * Insert LitSpeed module wrapper with rewrite on * * @since 2.1.1 * @access public */ public function insert_ls_wrapper() { $rules = $this->_wrap_ls_module(); $this->_insert_wrapper($rules); } /** * wrap rules with module on info * * @since 1.1.5 * @param array $rules * @return array wrapped rules with module info */ private function _wrap_do_no_edit( $rules ) { // When to clear rules, don't need DONOTEDIT msg if ($rules === false || !is_array($rules)) { return $rules; } $rules = array_merge(array( self::LS_MODULE_DONOTEDIT ), $rules, array( self::LS_MODULE_DONOTEDIT )); return $rules; } /** * Write to htaccess with rules * * NOTE: will throw error if failed * * @since 1.1.0 * @access private */ private function _insert_wrapper( $rules = array(), $kind = false, $marker = false ) { if ($kind != 'backend') { $kind = 'frontend'; } // Default marker is LiteSpeed marker `LSCACHE` if ($marker === false) { $marker = self::MARKER; } $this->_htaccess_backup($kind); File::insert_with_markers($this->htaccess_path($kind), $this->_wrap_do_no_edit($rules), $marker, true); } /** * Update rewrite rules based on setting * * NOTE: will throw error if failed * * @since 1.3 * @access public */ public function update( $cfg ) { list($frontend_rules, $backend_rules, $frontend_rules_nonls, $backend_rules_nonls) = $this->_generate_rules($cfg); // Check frontend content list($rules, $rules_nonls) = $this->_extract_rules(); // Check Non-LiteSpeed rules if ($this->_wrap_do_no_edit($frontend_rules_nonls) != $rules_nonls) { Debug2::debug('[Rules] Update non-ls frontend rules'); // Need to update frontend htaccess try { $this->_insert_wrapper($frontend_rules_nonls, false, self::MARKER_NONLS); } catch (\Exception $e) { $manual_guide_codes = $this->_rewrite_codes_msg($this->frontend_htaccess, $frontend_rules_nonls, self::MARKER_NONLS); Debug2::debug('[Rules] Update Failed'); throw new \Exception($manual_guide_codes); } } // Check LiteSpeed rules if ($this->_wrap_do_no_edit($frontend_rules) != $rules) { Debug2::debug('[Rules] Update frontend rules'); // Need to update frontend htaccess try { $this->_insert_wrapper($frontend_rules); } catch (\Exception $e) { Debug2::debug('[Rules] Update Failed'); $manual_guide_codes = $this->_rewrite_codes_msg($this->frontend_htaccess, $frontend_rules); throw new \Exception($manual_guide_codes); } } if ($this->frontend_htaccess !== $this->backend_htaccess) { list($rules, $rules_nonls) = $this->_extract_rules('backend'); // Check Non-LiteSpeed rules for backend if ($this->_wrap_do_no_edit($backend_rules_nonls) != $rules_nonls) { Debug2::debug('[Rules] Update non-ls backend rules'); // Need to update frontend htaccess try { $this->_insert_wrapper($backend_rules_nonls, 'backend', self::MARKER_NONLS); } catch (\Exception $e) { Debug2::debug('[Rules] Update Failed'); $manual_guide_codes = $this->_rewrite_codes_msg($this->backend_htaccess, $backend_rules_nonls, self::MARKER_NONLS); throw new \Exception($manual_guide_codes); } } // Check backend content if ($this->_wrap_do_no_edit($backend_rules) != $rules) { Debug2::debug('[Rules] Update backend rules'); // Need to update backend htaccess try { $this->_insert_wrapper($backend_rules, 'backend'); } catch (\Exception $e) { Debug2::debug('[Rules] Update Failed'); $manual_guide_codes = $this->_rewrite_codes_msg($this->backend_htaccess, $backend_rules); throw new \Exception($manual_guide_codes); } } } return true; } /** * Get existing rewrite rules * * NOTE: will throw error if failed * * @since 1.3 * @access private * @param string $kind Frontend or backend .htaccess file */ private function _extract_rules( $kind = 'frontend' ) { clearstatcache(); $path = $this->htaccess_path($kind); if (!$this->_readable($kind)) { Error::t('E_HTA_R'); } $rules = File::extract_from_markers($path, self::MARKER); $rules_nonls = File::extract_from_markers($path, self::MARKER_NONLS); return array( $rules, $rules_nonls ); } /** * Output the msg with rules plain data for manual insert * * @since 1.1.5 * @param string $file * @param array $rules * @return string final msg to output */ private function _rewrite_codes_msg( $file, $rules, $marker = false ) { return sprintf( __('<p>Please add/replace the following codes into the beginning of %1$s:</p> %2$s', 'litespeed-cache'), $file, '<textarea style="width:100%;" rows="10" readonly>' . htmlspecialchars($this->_wrap_rules_with_marker($rules, $marker)) . '</textarea>' ); } /** * Generate rules plain data for manual insert * * @since 1.1.5 */ private function _wrap_rules_with_marker( $rules, $marker = false ) { // Default marker is LiteSpeed marker `LSCACHE` if ($marker === false) { $marker = self::MARKER; } $start_marker = "# BEGIN {$marker}"; $end_marker = "# END {$marker}"; $new_file_data = implode("\n", array_merge(array( $start_marker ), $this->_wrap_do_no_edit($rules), array( $end_marker ))); return $new_file_data; } /** * Clear the rules file of any changes added by the plugin specifically. * * @since 1.0.4 * @access public */ public function clear_rules() { $this->_insert_wrapper(false); // Use false to avoid do-not-edit msg // Clear non ls rules $this->_insert_wrapper(false, false, self::MARKER_NONLS); if ($this->frontend_htaccess !== $this->backend_htaccess) { $this->_insert_wrapper(false, 'backend'); $this->_insert_wrapper(false, 'backend', self::MARKER_NONLS); } } } src/admin-display.cls.php 0000777 00000140740 15251157102 0011373 0 ustar 00 <?php /** * The admin-panel specific functionality of the plugin. * * Provides admin page rendering, notices, enqueueing of assets, * menu registrations, and various admin utilities. * * @since 1.0.0 * @package LiteSpeed * @subpackage LiteSpeed/admin * @author LiteSpeed Technologies <info@litespeedtech.com> */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Admin_Display * * Handles WP-Admin UI for LiteSpeed Cache. */ class Admin_Display extends Base { /** * Log tag for Admin_Display. * * @var string */ const LOG_TAG = '👮♀️'; /** * Notice class (info/blue). * * @var string */ const NOTICE_BLUE = 'notice notice-info'; /** * Notice class (success/green). * * @var string */ const NOTICE_GREEN = 'notice notice-success'; /** * Notice class (error/red). * * @var string */ const NOTICE_RED = 'notice notice-error'; /** * Notice class (warning/yellow). * * @var string */ const NOTICE_YELLOW = 'notice notice-warning'; /** * Option key for one-time messages. * * @var string */ const DB_MSG = 'messages'; /** * Option key for pinned messages. * * @var string */ const DB_MSG_PIN = 'msg_pin'; /** * Purge by: category. * * @var string */ const PURGEBY_CAT = '0'; /** * Purge by: post ID. * * @var string */ const PURGEBY_PID = '1'; /** * Purge by: tag. * * @var string */ const PURGEBY_TAG = '2'; /** * Purge by: URL. * * @var string */ const PURGEBY_URL = '3'; /** * Purge selection field name. * * @var string */ const PURGEBYOPT_SELECT = 'purgeby'; /** * Purge list field name. * * @var string */ const PURGEBYOPT_LIST = 'purgebylist'; /** * Dismiss key for messages. * * @var string */ const DB_DISMISS_MSG = 'dismiss'; /** * Rule conflict flag (on). * * @var string */ const RULECONFLICT_ON = 'ExpiresDefault_1'; /** * Rule conflict dismissed flag. * * @var string */ const RULECONFLICT_DISMISSED = 'ExpiresDefault_0'; /** * Router type for QC hide banner. * * @var string */ const TYPE_QC_HIDE_BANNER = 'qc_hide_banner'; /** * Cookie name for QC hide banner. * * @var string */ const COOKIE_QC_HIDE_BANNER = 'litespeed_qc_hide_banner'; /** * Internal messages cache. * * @var array<string,string> */ protected $messages = []; /** * Cached default settings. * * @var array<string,mixed> */ protected $default_settings = []; /** * Whether current context is network admin. * * @var bool */ protected $_is_network_admin = false; /** * Whether multisite is enabled. * * @var bool */ protected $_is_multisite = false; /** * Incremental form submit button index. * * @var int */ private $_btn_i = 0; /** * List of settings with filters and return type. * * @since 7.4 * @deprecated 7.7 Use general conf fitlers. * * @var array<string,array<string,mixed>> */ protected static $settings_filters = [ // Crawler - Blocklist. 'crawler-blocklist' => [ 'filter' => 'litespeed_crawler_disable_blocklist', 'type' => 'boolean', ], // Crawler - Settings. self::O_CRAWLER_LOAD_LIMIT => [ 'filter' => [ Base::ENV_CRAWLER_LOAD_LIMIT_ENFORCE, Base::ENV_CRAWLER_LOAD_LIMIT ], 'type' => 'input', ], // Cache - ESI. self::O_ESI_NONCE => [ 'filter' => 'litespeed_esi_nonces', ], // Page Optimization - CSS. 'optm-ucss_per_pagetype' => [ 'filter' => 'litespeed_ucss_per_pagetype', 'type' => 'boolean', ], // Page Optimization - Media. self::O_MEDIA_ADD_MISSING_SIZES => [ 'filter' => 'litespeed_media_ignore_remote_missing_sizes', 'type' => 'boolean', ], // Page Optimization - Media Exclude. self::O_MEDIA_LAZY_EXC => [ 'filter' => 'litespeed_media_lazy_img_excludes', ], // Page Optimization - Tuning (JS). self::O_OPTM_JS_DELAY_INC => [ 'filter' => 'litespeed_optm_js_delay_inc', ], self::O_OPTM_JS_EXC => [ 'filter' => 'litespeed_optimize_js_excludes', ], self::O_OPTM_JS_DEFER_EXC => [ 'filter' => 'litespeed_optm_js_defer_exc', ], self::O_OPTM_GM_JS_EXC => [ 'filter' => 'litespeed_optm_gm_js_exc', ], self::O_OPTM_EXC => [ 'filter' => 'litespeed_optm_uri_exc', ], // Page Optimization - Tuning (CSS). self::O_OPTM_CSS_EXC => [ 'filter' => 'litespeed_optimize_css_excludes', ], self::O_OPTM_UCSS_EXC => [ 'filter' => 'litespeed_ucss_exc', ], ]; /** * Flat pages map: menu slug to template metadata. * * @var array<string,array{title:string,tpl:string,network?:bool}> */ private $_pages = []; /** * Initialize the class and set its properties. * * @since 1.0.7 */ public function __construct() { $this->_pages = [ // Site-level pages 'litespeed' => [ 'title' => __( 'Dashboard', 'litespeed-cache' ), 'tpl' => 'dash/entry.tpl.php' ], 'litespeed-optimax' => [ 'title' => __( 'OptimaX', 'litespeed-cache' ), 'tpl' => 'optimax/entry.tpl.php', 'scope' => 'site' ], 'litespeed-presets' => [ 'title' => __( 'Presets', 'litespeed-cache' ), 'tpl' => 'presets/entry.tpl.php', 'scope' => 'site' ], 'litespeed-general' => [ 'title' => __( 'General', 'litespeed-cache' ), 'tpl' => 'general/entry.tpl.php' ], 'litespeed-cache' => [ 'title' => __( 'Cache', 'litespeed-cache' ), 'tpl' => 'cache/entry.tpl.php' ], 'litespeed-cdn' => [ 'title' => __( 'CDN', 'litespeed-cache' ), 'tpl' => 'cdn/entry.tpl.php', 'scope' => 'site' ], 'litespeed-img_optm' => [ 'title' => __( 'Image Optimization', 'litespeed-cache'), 'tpl' => 'img_optm/entry.tpl.php' ], 'litespeed-page_optm' => [ 'title' => __( 'Page Optimization', 'litespeed-cache' ), 'tpl' => 'page_optm/entry.tpl.php', 'scope' => 'site' ], 'litespeed-db_optm' => [ 'title' => __( 'Database', 'litespeed-cache' ), 'tpl' => 'db_optm/entry.tpl.php' ], 'litespeed-crawler' => [ 'title' => __( 'Crawler', 'litespeed-cache' ), 'tpl' => 'crawler/entry.tpl.php', 'scope' => 'site' ], 'litespeed-toolbox' => [ 'title' => __( 'Toolbox', 'litespeed-cache' ), 'tpl' => 'toolbox/entry.tpl.php' ], ]; // main css add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_style' ] ); // Main js add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_scripts' ] ); $this->_is_network_admin = is_network_admin(); $this->_is_multisite = is_multisite(); // Quick access menu $manage = ( $this->_is_multisite && $this->_is_network_admin ) ? 'manage_network_options' : 'manage_options'; if ( current_user_can( $manage ) ) { add_action( 'wp_before_admin_bar_render', [ GUI::cls(), 'backend_shortcut' ] ); // `admin_notices` is after `admin_enqueue_scripts`. add_action( $this->_is_network_admin ? 'network_admin_notices' : 'admin_notices', [ $this, 'display_messages' ] ); } /** * In case this is called outside the admin page. * * @see https://codex.wordpress.org/Function_Reference/is_plugin_active_for_network * @since 2.0 */ if ( ! function_exists( 'is_plugin_active_for_network' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } // add menus (Also check for mu-plugins) if ( $this->_is_network_admin && ( is_plugin_active_for_network( LSCWP_BASENAME ) || defined( 'LSCWP_MU_PLUGIN' ) ) ) { add_action( 'network_admin_menu', [ $this, 'register_admin_menu' ] ); } else { add_action( 'admin_menu', [ $this, 'register_admin_menu' ] ); } $this->cls( 'Metabox' )->register_settings(); } /** * Echo a translated section title. * * @since 3.0 * * @param string $id Language key. * @return void */ public function title( $id ) { echo wp_kses_post( Lang::title( $id ) ); } /** * Bind per-page admin hooks for a given page hook. * * Adds footer text filter and preview banner when loading the page. * * @param string $hook Page hook suffix returned by add_*_page(). * @return void */ private function bind_page( $hook ) { add_action( "load-$hook", function () { add_filter( 'admin_footer_text', function ( $footer_text ) { $this->cls( 'Cloud' )->maybe_preview_banner(); require_once LSCWP_DIR . 'tpl/inc/admin_footer.php'; return $footer_text; }, 1 ); // Add unified body class for settings page and top-level page add_filter( 'admin_body_class', function ( $classes ) { $screen = get_current_screen(); if ( $screen && in_array( $screen->id, [ 'settings_page_litespeed-cache-options', 'toplevel_page_litespeed' ], true ) ) { $classes .= ' litespeed-cache_page_litespeed'; } return $classes; } ); } ); } /** * Render an admin page by slug using its mapped template file. * * @param string $slug The menu slug registered in $_pages. * @return void */ private function render_page( $slug ) { $tpl = LSCWP_DIR . 'tpl/' . $this->_pages[ $slug ]['tpl']; is_file( $tpl ) ? require $tpl : wp_die( 'Template not found' ); } /** * Register the admin menu display. * * @since 1.0.0 * @return void */ public function register_admin_menu() { $capability = $this->_is_network_admin ? 'manage_network_options' : 'manage_options'; $scope = $this->_is_network_admin ? 'network' : 'site'; add_menu_page( 'LiteSpeed Cache', 'LiteSpeed Cache', $capability, 'litespeed' ); foreach ( $this->_pages as $slug => $meta ) { if ( 'litespeed-optimax' === $slug && !defined( 'LITESPEED_OX' ) ) { continue; } if ( ! empty( $meta['scope'] ) && $meta['scope'] !== $scope ) { continue; } $hook = add_submenu_page( 'litespeed', $meta['title'], $meta['title'], $capability, $slug, function () use ( $slug ) { $this->render_page( $slug ); } ); $this->bind_page( $hook ); } // sub menus under options. $hook = add_options_page( 'LiteSpeed Cache', 'LiteSpeed Cache', $capability, 'litespeed-cache-options', function () { $this->render_page( 'litespeed-cache' ); } ); $this->bind_page( $hook ); } /** * Register the stylesheets for the admin area. * * @since 1.0.14 * @return void */ public function enqueue_style() { wp_enqueue_style( Core::PLUGIN_NAME, LSWCP_PLUGIN_URL . 'assets/css/litespeed.css', [], Core::VER, 'all' ); wp_enqueue_style( Core::PLUGIN_NAME . '-dark-mode', LSWCP_PLUGIN_URL . 'assets/css/litespeed-dark-mode.css', [], Core::VER, 'all' ); } /** * Register/enqueue the JavaScript for the admin area. * * @since 1.0.0 * @since 7.3 Added deactivation modal code. * @return void */ public function enqueue_scripts() { wp_register_script( Core::PLUGIN_NAME, LSWCP_PLUGIN_URL . 'assets/js/litespeed-cache-admin.js', [], Core::VER, true ); $localize_data = []; if ( GUI::has_whm_msg() ) { $ajax_url_dismiss_whm = Utility::build_url( Core::ACTION_DISMISS, GUI::TYPE_DISMISS_WHM, true ); $localize_data['ajax_url_dismiss_whm'] = $ajax_url_dismiss_whm; } if ( GUI::has_msg_ruleconflict() ) { $ajax_url = Utility::build_url( Core::ACTION_DISMISS, GUI::TYPE_DISMISS_EXPIRESDEFAULT, true ); $localize_data['ajax_url_dismiss_ruleconflict'] = $ajax_url; } // Injection to LiteSpeed pages global $pagenow; $page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( 'admin.php' === $pagenow && $page && ( 0 === strpos( $page, 'litespeed-' ) || 'litespeed' === $page ) ) { if ( in_array( $page, [ 'litespeed-crawler', 'litespeed-cdn' ], true ) ) { // Babel JS type correction add_filter( 'script_loader_tag', [ $this, 'babel_type' ], 10, 3 ); wp_enqueue_script( Core::PLUGIN_NAME . '-lib-react', LSWCP_PLUGIN_URL . 'assets/js/react.min.js', [], Core::VER, false ); wp_enqueue_script( Core::PLUGIN_NAME . '-lib-babel', LSWCP_PLUGIN_URL . 'assets/js/babel.min.js', [], Core::VER, false ); } // Crawler Cookie Simulation if ( 'litespeed-crawler' === $page ) { wp_enqueue_script( Core::PLUGIN_NAME . '-crawler', LSWCP_PLUGIN_URL . 'assets/js/component.crawler.js', [], Core::VER, false ); $localize_data['lang'] = []; $localize_data['lang']['cookie_name'] = __( 'Cookie Name', 'litespeed-cache' ); $localize_data['lang']['cookie_value'] = __( 'Cookie Values', 'litespeed-cache' ); $localize_data['lang']['one_per_line'] = Doc::one_per_line( true ); $localize_data['lang']['remove_cookie_simulation'] = __( 'Remove cookie simulation', 'litespeed-cache' ); $localize_data['lang']['add_cookie_simulation_row'] = __( 'Add new cookie to simulate', 'litespeed-cache' ); if ( empty( $localize_data['ids'] ) ) { $localize_data['ids'] = []; } $localize_data['ids']['crawler_cookies'] = self::O_CRAWLER_COOKIES; } // CDN mapping if ( 'litespeed-cdn' === $page ) { $home_url = home_url( '/' ); $parsed = wp_parse_url( $home_url ); if ( ! empty( $parsed['scheme'] ) ) { $home_url = str_replace( $parsed['scheme'] . ':', '', $home_url ); } $cdn_url = 'https://cdn.' . substr( $home_url, 2 ); wp_enqueue_script( Core::PLUGIN_NAME . '-cdn', LSWCP_PLUGIN_URL . 'assets/js/component.cdn.js', [], Core::VER, false ); $localize_data['lang'] = []; $localize_data['lang']['cdn_mapping_url'] = Lang::title( self::CDN_MAPPING_URL ); $localize_data['lang']['cdn_mapping_inc_img'] = Lang::title( self::CDN_MAPPING_INC_IMG ); $localize_data['lang']['cdn_mapping_inc_css'] = Lang::title( self::CDN_MAPPING_INC_CSS ); $localize_data['lang']['cdn_mapping_inc_js'] = Lang::title( self::CDN_MAPPING_INC_JS ); $localize_data['lang']['cdn_mapping_filetype'] = Lang::title( self::CDN_MAPPING_FILETYPE ); $localize_data['lang']['cdn_mapping_url_desc'] = sprintf( __( 'CDN URL to be used. For example, %s', 'litespeed-cache' ), '<code>' . esc_html( $cdn_url ) . '</code>' ); $localize_data['lang']['one_per_line'] = Doc::one_per_line( true ); $localize_data['lang']['cdn_mapping_remove'] = __( 'Remove CDN URL', 'litespeed-cache' ); $localize_data['lang']['add_cdn_mapping_row'] = __( 'Add new CDN URL', 'litespeed-cache' ); $localize_data['lang']['on'] = __( 'ON', 'litespeed-cache' ); $localize_data['lang']['off'] = __( 'OFF', 'litespeed-cache' ); if ( empty( $localize_data['ids'] ) ) { $localize_data['ids'] = []; } $localize_data['ids']['cdn_mapping'] = self::O_CDN_MAPPING; } } // Load iziModal JS and CSS $show_deactivation_modal = ( is_multisite() && ! is_network_admin() ) ? false : true; if ( $show_deactivation_modal && 'plugins.php' === $pagenow ) { wp_enqueue_script( Core::PLUGIN_NAME . '-iziModal', LSWCP_PLUGIN_URL . 'assets/js/iziModal.min.js', [], Core::VER, true ); wp_enqueue_style( Core::PLUGIN_NAME . '-iziModal', LSWCP_PLUGIN_URL . 'assets/css/iziModal.min.css', [], Core::VER, 'all' ); add_action( 'admin_footer', [ $this, 'add_deactivation_html' ] ); } if ( $localize_data ) { wp_localize_script( Core::PLUGIN_NAME, 'litespeed_data', $localize_data ); } wp_enqueue_script( Core::PLUGIN_NAME ); } /** * Add modal HTML on Plugins screen. * * @since 7.3 * @return void */ public function add_deactivation_html() { require LSCWP_DIR . 'tpl/inc/modal.deactivation.php'; } /** * Filter the script tag for specific handles to set Babel type. * * @since 3.6 * * @param string $tag The script tag. * @param string $handle Script handle. * @param string $src Script source URL. * @return string The filtered script tag. */ public function babel_type( $tag, $handle, $src ) { if ( Core::PLUGIN_NAME . '-crawler' !== $handle && Core::PLUGIN_NAME . '-cdn' !== $handle ) { return $tag; } // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript return '<script src="' . Str::trim_quotes( $src ) . '" type="text/babel"></script>'; } /** * Callback that adds LiteSpeed Cache's action links. * * @since 1.0.0 * * @param array<string> $links Previously added links from other plugins. * @return array<string> Links with the LiteSpeed Cache one appended. */ public function add_plugin_links( $links ) { $links[] = '<a href="' . esc_url( admin_url( 'admin.php?page=litespeed-cache' ) ) . '">' . esc_html__( 'Settings', 'litespeed-cache' ) . '</a>'; return $links; } /** * Build a single notice HTML string. * * @since 1.0.7 * * @param string $color The color CSS class for the notice. * @param string $str The notice message. * @param bool $irremovable If true, the notice cannot be dismissed. * @param string $additional_classes Additional classes to add to the wrapper. * @return string The built notice HTML. */ public static function build_notice( $color, $str, $irremovable = false, $additional_classes = '' ) { $cls = $color; if ( $irremovable ) { $cls .= ' litespeed-irremovable'; } else { $cls .= ' is-dismissible'; } if ( $additional_classes ) { $cls .= ' ' . $additional_classes; } // possible translation $str = Lang::maybe_translate( $str ); return '<div class="litespeed_icon ' . esc_attr( $cls ) . '"><p>' . wp_kses_post( $str ) . '</p></div>'; } /** * Display info notice. * * @since 1.6.5 * * @param string|array<string> $msg Message or list of messages. * @param bool $do_echo Echo immediately instead of storing. * @param bool $irremovable If true, cannot be dismissed. * @param string $additional_classes Extra CSS classes. * @return void */ public static function info( $msg, $do_echo = false, $irremovable = false, $additional_classes = '' ) { self::add_notice( self::NOTICE_BLUE, $msg, $do_echo, $irremovable, $additional_classes ); } /** * Display note (warning) notice. * * @since 1.6.5 * * @param string|array<string> $msg Message or list of messages. * @param bool $do_echo Echo immediately instead of storing. * @param bool $irremovable If true, cannot be dismissed. * @param string $additional_classes Extra CSS classes. * @return void */ public static function note( $msg, $do_echo = false, $irremovable = false, $additional_classes = '' ) { self::add_notice( self::NOTICE_YELLOW, $msg, $do_echo, $irremovable, $additional_classes ); } /** * Display success notice. * * @since 1.6 * * @param string|array<string> $msg Message or list of messages. * @param bool $do_echo Echo immediately instead of storing. * @param bool $irremovable If true, cannot be dismissed. * @param string $additional_classes Extra CSS classes. * @return void */ public static function success( $msg, $do_echo = false, $irremovable = false, $additional_classes = '' ) { self::add_notice( self::NOTICE_GREEN, $msg, $do_echo, $irremovable, $additional_classes ); } /** * Deprecated alias for success(). * * @deprecated 4.7 Will drop in v7.5. Use success(). * * @param string|array<string> $msg Message or list of messages. * @param bool $do_echo Echo immediately instead of storing. * @param bool $irremovable If true, cannot be dismissed. * @param string $additional_classes Extra CSS classes. * @return void */ public static function succeed( $msg, $do_echo = false, $irremovable = false, $additional_classes = '' ) { self::success( $msg, $do_echo, $irremovable, $additional_classes ); } /** * Display error notice. * * @since 1.6 * * @param string|array<string> $msg Message or list of messages. * @param bool $do_echo Echo immediately instead of storing. * @param bool $irremovable If true, cannot be dismissed. * @param string $additional_classes Extra CSS classes. * @return void */ public static function error( $msg, $do_echo = false, $irremovable = false, $additional_classes = '' ) { self::add_notice( self::NOTICE_RED, $msg, $do_echo, $irremovable, $additional_classes ); } /** * Add unique (irremovable optional) messages. * * @since 4.7 * * @param string $color_mode One of info|note|success|error. * @param string|array<string> $msgs Message(s). * @param bool $irremovable If true, cannot be dismissed. * @return void */ public static function add_unique_notice( $color_mode, $msgs, $irremovable = false ) { if ( ! is_array( $msgs ) ) { $msgs = [ $msgs ]; } $color_map = [ 'info' => self::NOTICE_BLUE, 'note' => self::NOTICE_YELLOW, 'success' => self::NOTICE_GREEN, 'error' => self::NOTICE_RED, ]; if ( empty( $color_map[ $color_mode ] ) ) { self::debug( 'Wrong admin display color mode!' ); return; } $color = $color_map[ $color_mode ]; // Go through to make sure unique. $filtered_msgs = []; foreach ( $msgs as $k => $str ) { if ( is_numeric( $k ) ) { $k = md5( $str ); } // Use key to make it overwritable to previous same msg. $filtered_msgs[ $k ] = $str; } self::add_notice( $color, $filtered_msgs, false, $irremovable ); } /** * Add a notice to display on the admin page (store or echo). * * @since 1.0.7 * * @param string $color Notice color CSS class. * @param string|array<string> $msg Message(s). * @param bool $do_echo Echo immediately instead of storing. * @param bool $irremovable If true, cannot be dismissed. * @param string $additional_classes Extra classes for wrapper. * @return void */ public static function add_notice( $color, $msg, $do_echo = false, $irremovable = false, $additional_classes = '' ) { // Bypass adding for CLI or cron if ( defined( 'LITESPEED_CLI' ) || wp_doing_cron() ) { // WP CLI will show the info directly if ( defined( 'WP_CLI' ) && constant('WP_CLI') ) { if ( ! is_array( $msg ) ) { $msg = [ $msg ]; } foreach ( $msg as $v ) { $v = wp_strip_all_tags( $v ); if ( self::NOTICE_RED === $color ) { \WP_CLI::error( $v, false ); } else { \WP_CLI::success( $v ); } } } return; } if ( $do_echo ) { echo self::build_notice( $color, $msg, $irremovable, $additional_classes ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped return; } $msg_name = $irremovable ? self::DB_MSG_PIN : self::DB_MSG; $messages = self::get_option( $msg_name, [] ); if ( ! is_array( $messages ) ) { $messages = []; } if ( is_array( $msg ) ) { foreach ( $msg as $k => $str ) { $messages[ $k ] = self::build_notice( $color, $str, $irremovable, $additional_classes ); } } else { $messages[] = self::build_notice( $color, $msg, $irremovable, $additional_classes ); } $messages = array_unique( $messages ); self::update_option( $msg_name, $messages ); } /** * Display notices and errors in dashboard. * * @since 1.1.0 * @return void */ public function display_messages() { if ( ! defined( 'LITESPEED_CONF_LOADED' ) ) { $this->_in_upgrading(); } if ( GUI::has_whm_msg() ) { $this->show_display_installed(); } Data::cls()->check_upgrading_msg(); // If is in dev version, always check latest update Cloud::cls()->check_dev_version(); // One time msg $messages = self::get_option( self::DB_MSG, [] ); $added_thickbox = false; if ( is_array( $messages ) ) { foreach ( $messages as $msg ) { // Added for popup links if ( strpos( $msg, 'TB_iframe' ) && ! $added_thickbox ) { add_thickbox(); $added_thickbox = true; } echo wp_kses_post( $msg ); } } if ( -1 !== $messages ) { self::update_option( self::DB_MSG, -1 ); } // Pinned msg $messages = self::get_option( self::DB_MSG_PIN, [] ); if ( is_array( $messages ) ) { foreach ( $messages as $k => $msg ) { // Added for popup links if ( strpos( $msg, 'TB_iframe' ) && ! $added_thickbox ) { add_thickbox(); $added_thickbox = true; } // Append close btn if ( '</div>' === substr( $msg, -6 ) ) { $link = Utility::build_url( Core::ACTION_DISMISS, GUI::TYPE_DISMISS_PIN, false, null, [ 'msgid' => $k ] ); $msg = substr( $msg, 0, -6 ) . '<p><a href="' . esc_url( $link ) . '" class="button litespeed-btn-primary litespeed-btn-mini">' . esc_html__( 'Dismiss', 'litespeed-cache' ) . '</a>' . '</p></div>'; } echo wp_kses_post( $msg ); } } if ( empty( $_GET['page'] ) || 0 !== strpos( sanitize_text_field( wp_unslash( $_GET['page'] ) ), 'litespeed' ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended global $pagenow; if ( 'plugins.php' !== $pagenow ) { return; } } if ( ! $this->conf( self::O_NEWS ) ) { return; } // Show promo from cloud Cloud::cls()->show_promo(); /** * Check promo msg first * * @since 2.9 */ GUI::cls()->show_promo(); // Show version news Cloud::cls()->news(); } /** * Dismiss pinned msg. * * @since 3.5.2 * @return void */ public static function dismiss_pin() { if ( ! isset( $_GET['msgid'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended return; } $messages = self::get_option( self::DB_MSG_PIN, [] ); $msgid = sanitize_text_field( wp_unslash( $_GET['msgid'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( ! is_array( $messages ) || empty( $messages[ $msgid ] ) ) { return; } unset( $messages[ $msgid ] ); if ( ! $messages ) { $messages = -1; } self::update_option( self::DB_MSG_PIN, $messages ); } /** * Dismiss pinned msg by msg content. * * @since 7.0 * * @param string $content Message content. * @param string $color Color CSS class. * @param bool $irremovable Is irremovable. * @return void */ public static function dismiss_pin_by_content( $content, $color, $irremovable ) { $content = self::build_notice( $color, $content, $irremovable ); $messages = self::get_option( self::DB_MSG_PIN, [] ); $hit = false; if ( -1 !== $messages ) { foreach ( $messages as $k => $v ) { if ( $v === $content ) { unset( $messages[ $k ] ); $hit = true; self::debug( '✅ pinned msg content hit. Removed' ); break; } } } if ( $hit ) { if ( ! $messages ) { $messages = -1; } self::update_option( self::DB_MSG_PIN, $messages ); } else { self::debug( '❌ No pinned msg content hit' ); } } /** * Hooked to the in_widget_form action. * Appends LiteSpeed Cache settings to the widget edit settings screen. * This will append the esi on/off selector and ttl text. * * @since 1.1.0 * * @param \WP_Widget $widget The widget instance (passed by reference). * @param mixed $return_val Return param (unused). * @param array $instance The widget instance's settings. * @return void */ public function show_widget_edit( $widget, $return_val, $instance ) { require LSCWP_DIR . 'tpl/esi_widget_edit.php'; } /** * Outputs a notice when the plugin is installed via WHM. * * @since 1.0.12 * @return void */ public function show_display_installed() { require_once LSCWP_DIR . 'tpl/inc/show_display_installed.php'; } /** * Display error cookie msg. * * @since 1.0.12 * @return void */ public static function show_error_cookie() { require_once LSCWP_DIR . 'tpl/inc/show_error_cookie.php'; } /** * Display warning if lscache is disabled. * * @since 2.1 * @return void */ public function cache_disabled_warning() { include LSCWP_DIR . 'tpl/inc/check_cache_disabled.php'; } /** * Display conf data upgrading banner. * * @since 2.1 * @access private * @return void */ private function _in_upgrading() { include LSCWP_DIR . 'tpl/inc/in_upgrading.php'; } /** * Output LiteSpeed form open tag and hidden fields. * * @since 3.0 * * @param string|false $action Router action. * @param string|false $type Router type. * @param bool $has_upload Whether form has file uploads. * @return void */ public function form_action( $action = false, $type = false, $has_upload = false ) { if ( ! $action ) { $action = Router::ACTION_SAVE_SETTINGS; } if ( ! defined( 'LITESPEED_CONF_LOADED' ) ) { echo '<div class="litespeed-relative">'; } else { $current = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; if ( $has_upload ) { echo '<form method="post" action="' . esc_url( $current ) . '" class="litespeed-relative" enctype="multipart/form-data">'; } else { echo '<form method="post" action="' . esc_url( $current ) . '" class="litespeed-relative">'; } } echo '<input type="hidden" name="' . esc_attr( Router::ACTION ) . '" value="' . esc_attr( $action ) . '" />'; if ( $type ) { echo '<input type="hidden" name="' . esc_attr( Router::TYPE ) . '" value="' . esc_attr( $type ) . '" />'; } wp_nonce_field( $action, Router::NONCE ); } /** * Output LiteSpeed form end (submit + closing tags). * * @since 3.0 * * @return void */ public function form_end() { echo "<div class='litespeed-top20'></div>"; if ( ! defined( 'LITESPEED_CONF_LOADED' ) ) { submit_button( __( 'Save Changes', 'litespeed-cache' ), 'secondary litespeed-duplicate-float', 'litespeed-submit', true, [ 'disabled' => 'disabled' ] ); echo '</div>'; } else { submit_button( __( 'Save Changes', 'litespeed-cache' ), 'primary litespeed-duplicate-float', 'litespeed-submit', true, [ 'id' => 'litespeed-submit-' . $this->_btn_i++, ] ); echo '</form>'; } } /** * Register a setting for saving. * * @since 3.0 * * @param string $id Setting ID. * @return void */ public function enroll( $id ) { echo '<input type="hidden" name="' . esc_attr( Admin_Settings::ENROLL ) . '[]" value="' . esc_attr( $id ) . '" />'; } /** * Build a textarea input. * * @since 1.1.0 * * @param string $id Setting ID. * @param int|false $cols Columns count. * @param string|nil $val Pre-set value. * @return void */ public function build_textarea( $id, $cols = false, $val = null ) { if ( null === $val ) { $val = $this->conf( $id, true ); if ( is_array( $val ) ) { $val = implode( "\n", $val ); } } if ( ! $cols ) { $cols = 80; } $rows = $this->get_textarea_rows( $val ); $this->enroll( $id ); echo "<textarea name='" . esc_attr( $id ) . "' rows='" . (int) $rows . "' cols='" . (int) $cols . "'>" . esc_textarea( $val ) . '</textarea>'; $this->_check_overwritten( $id ); } /** * Calculate textarea rows. * * @since 7.4 * * @param string $val Text area value. * @return int Number of rows to use. */ public function get_textarea_rows( $val ) { $rows = 5; $lines = substr_count( (string) $val, "\n" ) + 2; if ( $lines > $rows ) { $rows = $lines; } if ( $rows > 40 ) { $rows = 40; } return $rows; } /** * Build a text input field. * * @since 1.1.0 * * @param string $id Setting ID. * @param string|null $cls CSS class. * @param string|null $val Value. * @param string $type Input type. * @param bool $disabled Whether disabled. * @return void */ public function build_input( $id, $cls = null, $val = null, $type = 'text', $disabled = false ) { if ( null === $val ) { $val = $this->conf( $id, true ); // Mask passwords. if ( $this->_conf_pswd( $id ) && $val ) { $val = str_repeat( '*', strlen( $val ) ); } } $label_id = preg_replace( '/\W/', '', $id ); if ( 'text' === $type ) { $cls = "regular-text $cls"; } if ( $disabled ) { echo "<input type='" . esc_attr( $type ) . "' class='" . esc_attr( $cls ) . "' value='" . esc_attr( $val ) . "' id='input_" . esc_attr( $label_id ) . "' disabled /> "; } else { $this->enroll( $id ); echo "<input type='" . esc_attr( $type ) . "' class='" . esc_attr( $cls ) . "' name='" . esc_attr( $id ) . "' value='" . esc_attr( $val ) . "' id='input_" . esc_attr( $label_id ) . "' /> "; } $this->_check_overwritten( $id ); } /** * Build a checkbox HTML snippet. * * @since 1.1.0 * * @param string $id Setting ID. * @param string $title Checkbox label (HTML allowed). * @param bool|null $checked Whether checked. * @param int|string $value Checkbox value. * @return void */ public function build_checkbox( $id, $title, $checked = null, $value = 1 ) { if ( null === $checked && $this->conf( $id, true ) ) { $checked = true; } $label_id = preg_replace( '/\W/', '', $id ); if ( 1 !== $value ) { $label_id .= '_' . $value; } $this->enroll( $id ); echo "<div class='litespeed-tick'> <input type='checkbox' name='" . esc_attr( $id ) . "' id='input_checkbox_" . esc_attr( $label_id ) . "' value='" . esc_attr( $value ) . "' " . checked( (bool) $checked, true, false ) . " /> <label for='input_checkbox_" . esc_attr( $label_id ) . "'>" . wp_kses_post( $title ) . '</label> </div>'; $this->_check_overwritten( $id ); } /** * Build a toggle checkbox snippet. * * @since 1.7 * * @param string $id Setting ID. * @param bool|null $checked Whether enabled. * @param string|null $title_on Label when on. * @param string|null $title_off Label when off. * @return void */ public function build_toggle( $id, $checked = null, $title_on = null, $title_off = null ) { if ( null === $checked && $this->conf( $id, true ) ) { $checked = true; } if ( null === $title_on ) { $title_on = __( 'ON', 'litespeed-cache' ); $title_off = __( 'OFF', 'litespeed-cache' ); } $cls = $checked ? 'primary' : 'default litespeed-toggleoff'; echo "<div class='litespeed-toggle litespeed-toggle-btn litespeed-toggle-btn-" . esc_attr( $cls ) . "' data-litespeed-toggle-on='primary' data-litespeed-toggle-off='default' data-litespeed_toggle_id='" . esc_attr( $id ) . "' > <input name='" . esc_attr( $id ) . "' type='hidden' value='" . esc_attr( $checked ) . "' /> <div class='litespeed-toggle-group'> <label class='litespeed-toggle-btn litespeed-toggle-btn-primary litespeed-toggle-on'>" . esc_html( $title_on ) . "</label> <label class='litespeed-toggle-btn litespeed-toggle-btn-default litespeed-toggle-active litespeed-toggle-off'>" . esc_html( $title_off ) . "</label> <span class='litespeed-toggle-handle litespeed-toggle-btn litespeed-toggle-btn-default'></span> </div> </div>"; } /** * Build a switch (radio) field. * * @since 1.1.0 * @since 1.7 Removed $disable param. * * @param string $id Setting ID. * @param array<int,mixed>|false $title_list Labels for options (OFF/ON). * @return void */ public function build_switch( $id, $title_list = false ) { $this->enroll( $id ); echo '<div class="litespeed-switch">'; if ( ! $title_list ) { $title_list = [ __( 'OFF', 'litespeed-cache' ), __( 'ON', 'litespeed-cache' ) ]; } foreach ( $title_list as $k => $v ) { $this->_build_radio( $id, $k, $v ); } echo '</div>'; $this->_check_overwritten( $id ); } /** * Build a radio input and echo it. * * @since 1.1.0 * @access private * * @param string $id Setting ID. * @param int|string $val Value for the radio. * @param string $txt Label HTML. * @return void */ private function _build_radio( $id, $val, $txt ) { $id_attr = 'input_radio_' . preg_replace( '/\W/', '', $id ) . '_' . $val; $default = isset( self::$_default_options[ $id ] ) ? self::$_default_options[ $id ] : self::$_default_site_options[ $id ]; $is_checked = ! is_string( $default ) ? ( (int) $this->conf( $id, true ) === (int) $val ) : ( $this->conf( $id, true ) === $val ); echo "<input type='radio' autocomplete='off' name='" . esc_attr( $id ) . "' id='" . esc_attr( $id_attr ) . "' value='" . esc_attr( $val ) . "' " . checked( $is_checked, true, false ) . " /> <label for='" . esc_attr( $id_attr ) . "'>" . wp_kses_post( $txt ) . '</label>'; } /** * Show overwritten info if value comes from const/primary/filter/server. * * @since 3.0 * @since 7.4 Show value from filters. Added type parameter. * * @param string $id Setting ID. * @return void */ protected function _check_overwritten( $id ) { $const_val = $this->const_overwritten( $id ); $primary_val = $this->primary_overwritten( $id ); $deprecated_filter_val = $this->deprecated_filter_overwritten( $id ); $filter_val = $this->filter_overwritten( $id ); $server_val = $this->server_overwritten( $id ); if ( null === $const_val && null === $primary_val && null === $deprecated_filter_val && null === $filter_val && null === $server_val ) { return; } // Get value to display. $val = null !== $const_val ? $const_val : $primary_val; // If we have deprecated_filter_val will set as new val. if ( null !== $deprecated_filter_val ) { $val = $deprecated_filter_val; } // If we have filter_val will set as new val. if ( null !== $filter_val ) { $val = $filter_val; } // If we have server_val will set as new val. if ( null !== $server_val ) { $val = $server_val; } // Get type (used for display purpose). $type = ( isset( self::$settings_filters[ $id ] ) && isset( self::$settings_filters[ $id ]['type'] ) ) ? self::$settings_filters[ $id ]['type'] : 'textarea'; if ( ( null !== $const_val || null !== $primary_val || null !== $filter_val ) && null === $deprecated_filter_val ) { $type = 'setting'; } // Get default setting: if settings exist, use default setting, otherwise use filter/server value. $default = ''; if ( isset( self::$_default_options[ $id ] ) || isset( self::$_default_site_options[ $id ] ) ) { $default = isset( self::$_default_options[ $id ] ) ? self::$_default_options[ $id ] : self::$_default_site_options[ $id ]; } if ( null !== $deprecated_filter_val || null !== $server_val ) { $default = null !== $deprecated_filter_val ? $deprecated_filter_val : $server_val; } // Set value to display, will be a string. if ( is_bool( $default ) ) { $val = $val ? __( 'ON', 'litespeed-cache' ) : __( 'OFF', 'litespeed-cache' ); } else { if ( is_array( $val ) ) { $val = implode( "\n", $val ); } $val = esc_textarea( $val ); } // Show warning for all types except textarea. if ( 'textarea' !== $type ) { echo '<div class="litespeed-desc litespeed-warning litespeed-overwrite">⚠️ '; if ( null !== $server_val ) { // Show $_SERVER value. printf( esc_html__( 'This value is overwritten by the %s variable.', 'litespeed-cache' ), '$_SERVER' ); $val = '$_SERVER["' . $server_val[0] . '"] = ' . $server_val[1]; } elseif ( null !== $deprecated_filter_val ) { // Show filter value. echo esc_html__( 'This value is overwritten by the filter.', 'litespeed-cache' ); } elseif ( null !== $const_val ) { // Show CONSTANT value. printf( esc_html__( 'This value is overwritten by the PHP constant %s.', 'litespeed-cache' ), '<code>' . esc_html( Base::conf_const( $id ) ) . '</code>' ); } elseif ( is_multisite() ) { // Show multisite overwrite. if ( get_current_blog_id() !== BLOG_ID_CURRENT_SITE && $this->conf( self::NETWORK_O_USE_PRIMARY ) ) { echo esc_html__( 'This value is overwritten by the primary site setting.', 'litespeed-cache' ); } else { echo esc_html__( 'This value is overwritten by the Network setting.', 'litespeed-cache' ); } } elseif ( null !== $filter_val ) { // Show filter value. echo esc_html__( 'This value is overwritten by the filter.', 'litespeed-cache' ); } echo ' ' . sprintf( esc_html__( 'Currently set to %s', 'litespeed-cache' ), '<code>' . esc_html( $val ) . '</code>' ) . '</div>'; } elseif ( 'textarea' === $type && null !== $deprecated_filter_val ) { // Show warning for textarea. // Textarea sizes. $cols = 30; $rows = $this->get_textarea_rows( $val ); $rows_current_val = $this->get_textarea_rows( implode( "\n", $this->conf( $id, true ) ) ); // If filter rows is bigger than textarea size, equalize them. if ( $rows > $rows_current_val ) { $rows = $rows_current_val; } ?> <div class="litespeed-desc-wrapper"> <div class="litespeed-desc"><?php echo esc_html__( 'Value from filter applied', 'litespeed-cache' ); ?>:</div> <textarea readonly rows="<?php echo (int) $rows; ?>" cols="<?php echo (int) $cols; ?>"><?php echo esc_textarea( $val ); ?></textarea> </div> <?php } } /** * Display seconds label and readable span. * * @since 3.0 * @return void */ public function readable_seconds() { echo esc_html__( 'seconds', 'litespeed-cache' ); echo ' <span data-litespeed-readable=""></span>'; } /** * Display default value for a setting. * * @since 1.1.1 * * @param string $id Setting ID. * @return void */ public function recommended( $id ) { if ( ! $this->default_settings ) { $this->default_settings = $this->load_default_vals(); } $val = $this->default_settings[ $id ]; if ( ! $val ) { return; } if ( ! is_array( $val ) ) { printf( '%s: <code>%s</code>', esc_html__( 'Default value', 'litespeed-cache' ), esc_html( $val ) ); return; } $rows = 5; $cols = 30; // Flexible rows/cols. $lines = count( $val ) + 1; $rows = min( max( $lines, $rows ), 40 ); foreach ( $val as $v ) { $cols = max( strlen( $v ), $cols ); } $cols = min( $cols, 150 ); $val = implode( "\n", $val ); printf( '<div class="litespeed-desc">%s:</div><textarea readonly rows="%d" cols="%d">%s</textarea>', esc_html__( 'Default value', 'litespeed-cache' ), (int) $rows, (int) $cols, esc_textarea( $val ) ); } /** * Validate rewrite rules regex syntax. * * @since 3.0 * * @param string $id Setting ID. * @return void */ protected function _validate_syntax( $id ) { $val = $this->conf( $id, true ); if ( ! $val ) { return; } if ( ! is_array( $val ) ) { $val = [ $val ]; } foreach ( $val as $v ) { if ( ! Utility::syntax_checker( $v ) ) { echo '<br /><span class="litespeed-warning"> ❌ ' . esc_html__( 'Invalid rewrite rule', 'litespeed-cache' ) . ': <code>' . wp_kses_post( $v ) . '</code></span>'; } } } /** * Validate if the .htaccess path is valid. * * @since 3.0 * * @param string $id Setting ID. * @return void */ protected function _validate_htaccess_path( $id ) { $val = $this->conf( $id, true ); if ( ! $val ) { return; } if ( '/.htaccess' !== substr( $val, -10 ) ) { echo '<br /><span class="litespeed-warning"> ❌ ' . sprintf( esc_html__( 'Path must end with %s', 'litespeed-cache' ), '<code>/.htaccess</code>' ) . '</span>'; } } /** * Check TTL ranges and show tips. * * @since 3.0 * * @param string $id Setting ID. * @param int|bool $min Minimum value (or false). * @param int|bool $max Maximum value (or false). * @param bool $allow_zero Whether zero is allowed. * @return void */ protected function _validate_ttl( $id, $min = false, $max = false, $allow_zero = false ) { $val = $this->conf( $id, true ); $tip = []; if ( $min && $val < $min && ( ! $allow_zero || 0 !== $val ) ) { $tip[] = esc_html__( 'Minimum value', 'litespeed-cache' ) . ': <code>' . $min . '</code>.'; } if ( $max && $val > $max ) { $tip[] = esc_html__( 'Maximum value', 'litespeed-cache' ) . ': <code>' . $max . '</code>.'; } echo '<br />'; if ( $tip ) { echo '<span class="litespeed-warning"> ❌ ' . wp_kses_post( implode( ' ', $tip ) ) . '</span>'; } $range = ''; if ( $allow_zero ) { $range .= esc_html__( 'Zero, or', 'litespeed-cache' ) . ' '; } if ( $min && $max ) { $range .= $min . ' - ' . $max; } elseif ( $min ) { $range .= esc_html__( 'Larger than', 'litespeed-cache' ) . ' ' . $min; } elseif ( $max ) { $range .= esc_html__( 'Smaller than', 'litespeed-cache' ) . ' ' . $max; } echo esc_html__( 'Value range', 'litespeed-cache' ) . ': <code>' . esc_html( $range ) . '</code>'; } /** * Validate IPs in a list. * * @since 3.0 * * @param string $id Setting ID. * @return void */ protected function _validate_ip( $id ) { $val = $this->conf( $id, true ); if ( ! $val ) { return; } if ( ! is_array( $val ) ) { $val = [ $val ]; } $tip = []; foreach ( $val as $v ) { if ( ! $v ) { continue; } if ( ! \WP_Http::is_ip_address( $v ) ) { $tip[] = esc_html__( 'Invalid IP', 'litespeed-cache' ) . ': <code>' . esc_html( $v ) . '</code>.'; } } if ( $tip ) { echo '<br /><span class="litespeed-warning"> ❌ ' . wp_kses_post( implode( ' ', $tip ) ) . '</span>'; } } /** * Display API environment variable support. * * @since 1.8.3 * @access protected * * @param string ...$args Server variable names. * @return void */ protected function _api_env_var( ...$args ) { echo '<span class="litespeed-success"> ' . esc_html__( 'API', 'litespeed-cache' ) . ': ' . sprintf( /* translators: %s: list of server variables in <code> tags */ esc_html__( 'Server variable(s) %s available to override this setting.', 'litespeed-cache' ), '<code>' . implode( '</code>, <code>', array_map( 'esc_html', $args ) ) . '</code>' ) . '</span>'; Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/admin/#limiting-the-crawler' ); } /** * Display URI setting example. * * @since 2.6.1 * @access protected * @return void */ protected function _uri_usage_example() { echo esc_html__( 'The URLs will be compared to the REQUEST_URI server variable.', 'litespeed-cache' ); /* translators: 1: example URL, 2: pattern example */ echo ' ' . sprintf( esc_html__( 'For example, for %1$s, %2$s can be used here.', 'litespeed-cache' ), '<code>/mypath/mypage?aa=bb</code>', '<code>mypage?aa=</code>' ); echo '<br /><i>'; /* translators: %s: caret symbol */ printf( esc_html__( 'To match the beginning, add %s to the beginning of the item.', 'litespeed-cache' ), '<code>^</code>' ); /* translators: %s: dollar symbol */ echo ' ' . sprintf( esc_html__( 'To do an exact match, add %s to the end of the URL.', 'litespeed-cache' ), '<code>$</code>' ); echo ' ' . esc_html__( 'One per line.', 'litespeed-cache' ); echo '</i>'; } /** * Return pluralized strings. * * @since 2.0 * * @param int $num Number. * @param string $kind Kind of item (group|image). * @return string */ public static function print_plural( $num, $kind = 'group' ) { if ( $num > 1 ) { switch ( $kind ) { case 'group': return sprintf( esc_html__( '%s groups', 'litespeed-cache' ), $num ); case 'image': return sprintf( esc_html__( '%s images', 'litespeed-cache' ), $num ); default: return $num; } } switch ( $kind ) { case 'group': return sprintf( esc_html__( '%s group', 'litespeed-cache' ), $num ); case 'image': return sprintf( esc_html__( '%s image', 'litespeed-cache' ), $num ); default: return $num; } } /** * Return guidance HTML. * * @since 2.0 * * @param string $title Title HTML. * @param array<int,string> $steps Steps list (HTML allowed). * @param int|string $current_step Current step number or 'done'. * @return string HTML for guidance widget. */ public static function guidance( $title, $steps, $current_step ) { if ( 'done' === $current_step ) { $current_step = count( $steps ) + 1; } $percentage = ' (' . floor( ( ( $current_step - 1 ) * 100 ) / count( $steps ) ) . '%)'; $html = '<div class="litespeed-guide"><h2>' . $title . $percentage . '</h2><ol>'; foreach ( $steps as $k => $v ) { $step = $k + 1; if ( $current_step > $step ) { $html .= '<li class="litespeed-guide-done">'; } else { $html .= '<li>'; } $html .= $v . '</li>'; } $html .= '</ol></div>'; return $html; } /** * Check whether has QC hide banner cookie. * * @since 7.1 * * @return bool */ public static function has_qc_hide_banner() { return isset( $_COOKIE[ self::COOKIE_QC_HIDE_BANNER ] ) && ( time() - (int) $_COOKIE[ self::COOKIE_QC_HIDE_BANNER ] ) < 86400 * 90; } /** * Set QC hide banner cookie. * * @since 7.1 * @return void */ public static function set_qc_hide_banner() { $expire = time() + 86400 * 365; self::debug( 'Set qc hide banner cookie' ); setcookie( self::COOKIE_QC_HIDE_BANNER, time(), $expire, COOKIEPATH, COOKIE_DOMAIN ); } /** * Handle all request actions from main cls. * * @since 7.1 * @return void */ public function handler() { $type = Router::verify_type(); switch ( $type ) { case self::TYPE_QC_HIDE_BANNER: self::set_qc_hide_banner(); break; default: break; } Admin::redirect(); } } src/utility.cls.php 0000777 00000060607 15251157102 0010346 0 ustar 00 <?php /** * Utility helpers for LiteSpeed Cache. * * @since 1.1.5 * @package LiteSpeed */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Miscellaneous utility methods used across the plugin. */ class Utility extends Root { /** * Cached list of extra internal domains. * * @var array<int,string>|null */ private static $_internal_domains; /** * Validate a list of regex rules by attempting to compile them. * * @since 1.0.9 * @since 3.0 Moved here from admin-settings.cls * @param array<int,string> $rules Regex fragments (without delimiters). * @return bool True for valid rules, false otherwise. */ public static function syntax_checker( $rules ) { return false !== preg_match( self::arr2regex( $rules ), '' ); } /** * Combine an array of strings into a single alternation regex. * * @since 3.0 * * @param array<int,string> $arr List of strings. * @param bool $drop_delimiter When true, return without regex delimiters. * @return string Regex pattern. */ public static function arr2regex( $arr, $drop_delimiter = false ) { $arr = self::sanitize_lines( $arr ); $new_arr = []; foreach ( $arr as $v ) { $new_arr[] = preg_quote( $v, '#' ); } $regex = implode( '|', $new_arr ); $regex = str_replace( ' ', '\\ ', $regex ); if ( $drop_delimiter ) { return $regex; } return '#' . $regex . '#'; } /** * Replace wildcard characters in a string/array with their regex equivalents. * * @since 3.2.2 * * @param string|array<int,string> $value String or list of strings. * @return string|array<int,string> */ public static function wildcard2regex( $value ) { if ( is_array( $value ) ) { return array_map( __CLASS__ . '::wildcard2regex', $value ); } if ( false !== strpos( $value, '*' ) ) { $value = preg_quote( $value, '#' ); $value = str_replace( '\*', '.*', $value ); } return $value; } /** * Get current page type string. * * @since 2.9 * * @return string Page type. */ public static function page_type() { global $wp_query; $page_type = 'default'; if ( $wp_query->is_page ) { $page_type = is_front_page() ? 'front' : 'page'; } elseif ( $wp_query->is_home ) { $page_type = 'home'; } elseif ( $wp_query->is_single ) { $page_type = get_post_type(); } elseif ( $wp_query->is_category ) { $page_type = 'category'; } elseif ( $wp_query->is_tag ) { $page_type = 'tag'; } elseif ( $wp_query->is_tax ) { $page_type = 'tax'; } elseif ( $wp_query->is_archive ) { if ( $wp_query->is_day ) { $page_type = 'day'; } elseif ( $wp_query->is_month ) { $page_type = 'month'; } elseif ( $wp_query->is_year ) { $page_type = 'year'; } elseif ( $wp_query->is_author ) { $page_type = 'author'; } else { $page_type = 'archive'; } } elseif ( $wp_query->is_search ) { $page_type = 'search'; } elseif ( $wp_query->is_404 ) { $page_type = '404'; } return $page_type; } /** * Get ping speed to a domain via HTTP HEAD timing. * * @since 2.9 * * @param string $domain Domain or URL. * @return int Milliseconds (99999 on error). */ public static function ping( $domain ) { if ( false !== strpos( $domain, ':' ) ) { $host = wp_parse_url( $domain, PHP_URL_HOST ); $domain = $host ? $host : $domain; } $starttime = microtime(true); $file = fsockopen($domain, 443, $errno, $errstr, 10); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fsockopen $stoptime = microtime(true); $status = 0; if (!$file) { $status = 99999; } else { // Site is up fclose($file); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose $status = ($stoptime - $starttime) * 1000; $status = floor($status); } Debug2::debug("[Util] ping [Domain] $domain \t[Speed] $status"); return $status; } /** * Convert seconds/timestamp to a readable relative time. * * @since 1.6.5 * * @param int $seconds_or_timestamp Seconds or 10-digit timestamp. * @param int $timeout If older than this, show absolute time. * @param bool $forward When true, omit "ago". * @return string Human readable time. */ public static function readable_time( $seconds_or_timestamp, $timeout = 3600, $forward = false ) { if ( 10 === strlen( (string) $seconds_or_timestamp ) ) { $seconds = time() - (int) $seconds_or_timestamp; if ( $seconds > $timeout ) { return gmdate( 'm/d/Y H:i:s', (int) $seconds_or_timestamp + (int) LITESPEED_TIME_OFFSET ); } } else { $seconds = (int) $seconds_or_timestamp; } $res = ''; if ( $seconds > 86400 ) { $num = (int) floor( $seconds / 86400 ); $res .= $num . 'd'; $seconds %= 86400; } if ( $seconds > 3600 ) { if ( $res ) { $res .= ', '; } $num = (int) floor( $seconds / 3600 ); $res .= $num . 'h'; $seconds %= 3600; } if ( $seconds > 60 ) { if ( $res ) { $res .= ', '; } $num = (int) floor( $seconds / 60 ); $res .= $num . 'm'; $seconds %= 60; } if ( $seconds > 0 ) { if ( $res ) { $res .= ' '; } $res .= $seconds . 's'; } if ( ! $res ) { return $forward ? __( 'right now', 'litespeed-cache' ) : __( 'just now', 'litespeed-cache' ); } return $forward ? $res : sprintf( __( ' %s ago', 'litespeed-cache' ), $res ); } /** * Convert array to a compact base64 JSON string. * * @since 1.6 * * @param mixed $arr Input array or scalar. * @return string|mixed Encoded string or original value. */ public static function arr2str( $arr ) { if ( ! is_array( $arr ) ) { return $arr; } return base64_encode( wp_json_encode( $arr ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode } /** * Convert size in bytes to human readable form. * * @since 1.6 * * @param int $filesize Bytes. * @param bool $is_1000 When true, use 1000-based units. * @return string */ public static function real_size( $filesize, $is_1000 = false ) { $unit = $is_1000 ? 1000 : 1024; if ( $filesize >= pow( $unit, 3 ) ) { $filesize = round( ( $filesize / pow( $unit, 3 ) ) * 100 ) / 100 . 'G'; } elseif ( $filesize >= pow( $unit, 2 ) ) { $filesize = round( ( $filesize / pow( $unit, 2 ) ) * 100 ) / 100 . 'M'; } elseif ( $filesize >= $unit ) { $filesize = round( ( $filesize / $unit ) * 100 ) / 100 . 'K'; } else { $filesize = $filesize . 'B'; } return $filesize; } /** * Parse HTML attribute string into an array. * * @since 1.2.2 * @since 1.4 Moved from optimize to utility * @access private * * @param string $str Raw attribute string. * @return array<string,string> Attributes. */ public static function parse_attr( $str ) { $attrs = []; preg_match_all( '#([\w-]+)=(["\'])([^\2]*)\2#isU', $str, $matches, PREG_SET_ORDER ); foreach ( $matches as $match ) { $attrs[ $match[1] ] = trim( $match[3] ); } return $attrs; } /** * Search for a hit within an array of strings/rules. * * Supports ^prefix, suffix$, ^exact$, and substring. * * @since 1.3 * @access private * * @param string $needle The string to compare. * @param array $haystack Array of rules/strings. * @param bool $has_ttl When true, support "rule TTL" format. * @return bool|string|array False if not found; matched item or [item, ttl] if has_ttl. */ public static function str_hit_array( $needle, $haystack, $has_ttl = false ) { if ( ! $haystack ) { return false; } if ( ! is_array( $haystack ) ) { Debug2::debug( '[Util] ❌ bad param in str_hit_array()!' ); return false; } $hit = false; $this_ttl = 0; foreach ( $haystack as $item ) { if ( ! $item ) { continue; } if ( $has_ttl ) { $this_ttl = 0; $item = explode( ' ', $item ); if ( ! empty( $item[1] ) ) { $this_ttl = $item[1]; } $item = $item[0]; } if ( '^' === substr( $item, 0, 1 ) && '$' === substr( $item, -1 ) ) { if ( substr( $item, 1, -1 ) === $needle ) { $hit = $item; break; } } elseif ( '$' === substr( $item, -1 ) ) { if ( substr( $item, 0, -1 ) === substr( $needle, -strlen( $item ) + 1 ) ) { $hit = $item; break; } } elseif ( '^' === substr( $item, 0, 1 ) ) { if ( substr( $item, 1 ) === substr( $needle, 0, strlen( $item ) - 1 ) ) { $hit = $item; break; } } elseif ( false !== strpos( $needle, $item ) ) { $hit = $item; break; } } if ( $hit ) { return $has_ttl ? [ $hit, $this_ttl ] : $hit; } return false; } /** * Load PHP-compat library. * * @since 1.2.2 * @return void */ public static function compatibility() { require_once LSCWP_DIR . 'lib/php-compatibility.func.php'; } /** * Convert URI path to absolute URL. * * @since 1.3 * * @param string $uri Relative path `/a/b.html` or `a/b.html`. * @return string Absolute URL. */ public static function uri2url( $uri ) { if ( '/' === substr( $uri, 0, 1 ) ) { self::domain_const(); $url = LSCWP_DOMAIN . $uri; } else { $url = home_url( '/' ) . $uri; } return $url; } /** * Get basename from URL. * * @since 4.7 * * @param string $url URL. * @return string Basename. */ public static function basename( $url ) { $url = trim( $url ); $uri = wp_parse_url( $url, PHP_URL_PATH ); $basename = pathinfo( (string) $uri, PATHINFO_BASENAME ); return $basename; } /** * Drop .webp and .avif suffix from a filename. * * @since 4.7 * * @param string $filename Filename. * @return string Cleaned filename. */ public static function drop_webp( $filename ) { if ( in_array( substr( $filename, -5 ), [ '.webp', '.avif' ], true ) ) { $filename = substr( $filename, 0, -5 ); } return $filename; } /** * Convert URL to URI (optionally keep query). * * @since 1.2.2 * @since 1.6.2.1 Added 2nd param keep_qs * * @param string $url URL. * @param bool $keep_qs Keep query string. * @return string URI. */ public static function url2uri( $url, $keep_qs = false ) { $url = trim( $url ); $uri = wp_parse_url( $url, PHP_URL_PATH ); $qs = wp_parse_url( $url, PHP_URL_QUERY ); if ( ! $keep_qs || ! $qs ) { return (string) $uri; } return (string) $uri . '?' . $qs; } /** * Get attachment relative path to upload folder. * * @since 3.0 * * @param string $url Full attachment URL. * @return string Relative upload path like `2018/08/file.jpg`. */ public static function att_short_path( $url ) { if ( ! defined( 'LITESPEED_UPLOAD_PATH' ) ) { $_wp_upload_dir = wp_upload_dir(); $upload_path = self::url2uri( $_wp_upload_dir['baseurl'] ); define( 'LITESPEED_UPLOAD_PATH', $upload_path ); } $local_file = self::url2uri( $url ); $short_path = substr( $local_file, strlen( LITESPEED_UPLOAD_PATH ) + 1 ); return $short_path; } /** * Make URL relative to the site root (preserves subdir). * * @param string $url Absolute URL. * @return string Relative URL starting with '/'. */ public static function make_relative( $url ) { self::domain_const(); if ( 0 === strpos( $url, LSCWP_DOMAIN ) ) { $url = substr( $url, strlen( LSCWP_DOMAIN ) ); } return trim( $url ); } /** * Extract just the scheme+host portion from a URL. * * @since 1.7.1 * * @param string $url URL. * @return string Host-only URL (with scheme if available). */ public static function parse_domain( $url ) { $parsed = wp_parse_url( $url ); if ( empty( $parsed['host'] ) ) { return ''; } if ( ! empty( $parsed['scheme'] ) ) { return $parsed['scheme'] . '://' . $parsed['host']; } return '//' . $parsed['host']; } /** * Drop protocol from URL (e.g., https://example.com -> //example.com). * * @since 3.3 * * @param string $url URL. * @return string Protocol-relative URL. */ public static function noprotocol( $url ) { $tmp = wp_parse_url( trim( $url ) ); if ( ! empty( $tmp['scheme'] ) ) { $url = str_replace( $tmp['scheme'] . ':', '', $url ); } return $url; } /** * Validate IPv4 public address. * * @since 5.5 * * @param string $ip IP address. * @return string|false IP or false when invalid. */ public static function valid_ipv4( $ip ) { return filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ); } /** * Define LSCWP_DOMAIN using the home URL (no trailing slash). * * @since 1.3 * @return void */ public static function domain_const() { if ( defined( 'LSCWP_DOMAIN' ) ) { return; } self::compatibility(); $domain = http_build_url( get_home_url(), [], HTTP_URL_STRIP_ALL ); // phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url define( 'LSCWP_DOMAIN', $domain ); } /** * Sanitize lines based on requested transforms. * * @since 1.3 * * @param array|string $arr Lines as array or newline-separated string. * @param string|null $type Comma-separated transforms: uri,basename,drop_webp,relative,domain,noprotocol,trailingslash,string. * @return array|string Sanitized list or string. */ public static function sanitize_lines( $arr, $type = null ) { $types = $type ? explode( ',', $type ) : []; if ( ! $arr ) { if ( 'string' === $type ) { return ''; } return []; } if ( ! is_array( $arr ) ) { $arr = explode( "\n", $arr ); } $arr = array_map( 'trim', $arr ); $changed = false; if ( in_array( 'uri', $types, true ) ) { $arr = array_map( __CLASS__ . '::url2uri', $arr ); $changed = true; } if ( in_array( 'basename', $types, true ) ) { $arr = array_map( __CLASS__ . '::basename', $arr ); $changed = true; } if ( in_array( 'drop_webp', $types, true ) ) { $arr = array_map( __CLASS__ . '::drop_webp', $arr ); $changed = true; } if ( in_array( 'relative', $types, true ) ) { $arr = array_map( __CLASS__ . '::make_relative', $arr ); $changed = true; } if ( in_array( 'domain', $types, true ) ) { $arr = array_map( __CLASS__ . '::parse_domain', $arr ); $changed = true; } if ( in_array( 'noprotocol', $types, true ) ) { $arr = array_map( __CLASS__ . '::noprotocol', $arr ); $changed = true; } if ( in_array( 'trailingslash', $types, true ) ) { $arr = array_map( 'trailingslashit', $arr ); $changed = true; } if ( $changed ) { $arr = array_map( 'trim', $arr ); } $arr = array_unique( $arr ); $arr = array_filter( $arr ); if ( in_array( 'string', $types, true ) ) { return implode( "\n", $arr ); } return $arr; } /** * Build an admin URL with action & nonce. * * Assumes user capabilities are already checked. * * @since 1.6 Changed order of 2nd&3rd param, changed 3rd param `append_str` to 2nd `type` * * @param string $action Action name. * @param string|false $type Optional type query value. * @param bool $is_ajax Whether to build for admin-ajax.php. * @param string|null|bool $page Page filename or true for admin.php. * @param array<string,string> $append_arr Extra query parameters. * @param bool $unescape Return unescaped URL. * @return string Built URL. */ public static function build_url( $action, $type = false, $is_ajax = false, $page = null, $append_arr = [], $unescape = false ) { $prefix = '?'; if ( '_ori' === $page ) { $page = true; $append_arr['_litespeed_ori'] = 1; } if ( ! $is_ajax ) { if ( $page ) { if ( true === $page ) { $page = 'admin.php'; } elseif ( false !== strpos( $page, '?' ) ) { $prefix = '&'; } $combined = $page . $prefix . Router::ACTION . '=' . $action; } else { // Current page rebuild URL. $params = $_GET; // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( ! empty( $params ) ) { if ( isset( $params[ Router::ACTION ] ) ) { unset( $params[ Router::ACTION ] ); } if ( isset( $params['_wpnonce'] ) ) { unset( $params['_wpnonce'] ); } if ( ! empty( $params ) ) { $prefix .= http_build_query( $params ) . '&'; } } global $pagenow; $combined = $pagenow . $prefix . Router::ACTION . '=' . $action; } } else { $combined = 'admin-ajax.php?action=litespeed_ajax&' . Router::ACTION . '=' . $action; } $prenonce = is_network_admin() ? network_admin_url( $combined ) : admin_url( $combined ); $url = wp_nonce_url( $prenonce, $action, Router::NONCE ); if ( $type ) { // Remove potential param `type` from url. $parsed = wp_parse_url( htmlspecialchars_decode( $url ) ); $query = []; if ( isset( $parsed['query'] ) ) { parse_str( $parsed['query'], $query ); } $built_arr = array_merge( $query, [ Router::TYPE => $type ] ); $parsed['query'] = http_build_query( $built_arr + (array) $append_arr ); self::compatibility(); $url = http_build_url( $parsed ); // phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url $url = htmlspecialchars( $url, ENT_QUOTES, 'UTF-8' ); } if ( $unescape ) { $url = wp_specialchars_decode( $url ); } return $url; } /** * Check if a host is internal (same as site host or filtered list). * * @since 1.2.3 * * @param string $host Host to test. * @return bool True if internal. */ public static function internal( $host ) { if ( ! defined( 'LITESPEED_FRONTEND_HOST' ) ) { if ( defined( 'WP_HOME' ) ) { $home_host = constant( 'WP_HOME' ); } else { $home_host = get_option( 'home' ); } define( 'LITESPEED_FRONTEND_HOST', (string) wp_parse_url( $home_host, PHP_URL_HOST ) ); } if ( LITESPEED_FRONTEND_HOST === $host ) { return true; } if ( ! isset( self::$_internal_domains ) ) { self::$_internal_domains = apply_filters( 'litespeed_internal_domains', [] ); } if ( self::$_internal_domains ) { return in_array( $host, self::$_internal_domains, true ); } return false; } /** * Check if a URL is an internal existing file and return its real path and size. * * @since 1.2.2 * @since 1.6.2 Moved here from optm.cls due to usage of media.cls * * @param string $url URL. * @param string|false $addition_postfix Optional postfix to append to path before checking. * @return array{0:string,1:int}|false [realpath, size] or false. */ public static function is_internal_file( $url, $addition_postfix = false ) { if ( 'data:' === substr( $url, 0, 5 ) ) { Debug2::debug2( '[Util] data: content not file' ); return false; } $url_parsed = wp_parse_url( $url ); if ( isset( $url_parsed['host'] ) && ! self::internal( $url_parsed['host'] ) ) { // Check if is cdn path. if ( ! CDN::internal( $url_parsed['host'] ) ) { Debug2::debug2( '[Util] external' ); return false; } } if ( empty( $url_parsed['path'] ) ) { return false; } // Replace child blog path for assets (multisite). if ( is_multisite() && defined( 'PATH_CURRENT_SITE' ) ) { $pattern = '#^' . PATH_CURRENT_SITE . '([_0-9a-zA-Z-]+/)(wp-(content|admin|includes))#U'; $replacement = PATH_CURRENT_SITE . '$2'; $url_parsed['path'] = preg_replace( $pattern, $replacement, $url_parsed['path'] ); } // Parse file path. if ( '/' === substr( $url_parsed['path'], 0, 1 ) ) { $docroot = isset( $_SERVER['DOCUMENT_ROOT'] ) ? sanitize_text_field( wp_unslash( $_SERVER['DOCUMENT_ROOT'] ) ) : ''; if ( defined( 'LITESPEED_WP_REALPATH' ) ) { $file_path_ori = $docroot . constant( 'LITESPEED_WP_REALPATH' ) . $url_parsed['path']; } else { $file_path_ori = $docroot . $url_parsed['path']; } } else { $file_path_ori = Router::frontend_path() . '/' . $url_parsed['path']; } // Optional postfix. if ( $addition_postfix ) { $file_path_ori .= '.' . $addition_postfix; } $file_path_ori = apply_filters( 'litespeed_realpath', $file_path_ori ); $file_path = realpath( $file_path_ori ); if ( ! is_file( $file_path ) ) { Debug2::debug2( '[Util] file not exist: ' . $file_path_ori ); return false; } return [ $file_path, (int) filesize( $file_path ) ]; } /** * Safely parse URL and component. * * @since 3.4.3 * * @param string $url URL to parse. * @param int $component One of the PHP_URL_* constants. * @return mixed */ public static function parse_url_safe( $url, $component = -1 ) { if ( '//' === substr( $url, 0, 2 ) ) { $url = 'https:' . $url; } return wp_parse_url( $url, $component ); } /** * Replace URLs in a srcset attribute using a callback. * * @since 2.2.3 * * @param string $content HTML content containing srcset. * @param callable $callback Callback that receives old URL and returns new URL or false. * @return string Modified content. */ public static function srcset_replace( $content, $callback ) { preg_match_all( '# srcset=([\'"])(.+)\g{1}#iU', $content, $matches ); $srcset_ori = []; $srcset_final = []; if ( ! empty( $matches[2] ) ) { foreach ( $matches[2] as $k => $urls_ori ) { $urls_final = explode( ',', $urls_ori ); $changed = false; foreach ( $urls_final as $k2 => $url_info ) { $url_info_arr = explode( ' ', trim( $url_info ) ); $new_url = call_user_func( $callback, $url_info_arr[0] ); if ( ! $new_url ) { continue; } $changed = true; $urls_final[ $k2 ] = str_replace( $url_info_arr[0], $new_url, $url_info ); Debug2::debug2( '[Util] - srcset replaced to ' . $new_url . ( ! empty( $url_info_arr[1] ) ? ' ' . $url_info_arr[1] : '' ) ); } if ( ! $changed ) { continue; } $urls_final = implode( ',', $urls_final ); $srcset_ori[] = $matches[0][ $k ]; $srcset_final[] = str_replace( $urls_ori, $urls_final, $matches[0][ $k ] ); } } if ( $srcset_ori ) { $content = str_replace( $srcset_ori, $srcset_final, $content ); Debug2::debug2( '[Util] - srcset replaced' ); } return $content; } /** * Generate pagination HTML or return offset. * * @since 3.0 * * @param int $total Total items. * @param int $limit Items per page. * @param bool $return_offset When true, return numeric offset instead of HTML. * @return int|string */ public static function pagination( $total, $limit, $return_offset = false ) { $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 1; // phpcs:ignore WordPress.Security.NonceVerification.Recommended $offset = ( $pagenum - 1 ) * $limit; $num_of_pages = (int) ceil( $total / $limit ); if ( $offset > $total ) { $offset = $total - $limit; } if ( $offset < 0 ) { $offset = 0; } if ( $return_offset ) { return $offset; } $page_links = paginate_links( [ 'base' => add_query_arg( 'pagenum', '%#%' ), 'format' => '', 'prev_text' => '«', 'next_text' => '»', 'total' => $num_of_pages, 'current' => $pagenum, ] ); return '<div class="tablenav"><div class="tablenav-pages" style="margin: 1em 0">' . $page_links . '</div></div>'; } /** * Build a GROUP placeholder like "(%s,%s),(%s,%s)" for a list of rows. * * @since 2.0 * * @param array<int,array<int,string>> $data Data rows (values already prepared). * @param string $fields Fields CSV (only used to count columns). * @return string Placeholder string. */ public static function chunk_placeholder( $data, $fields ) { $division = substr_count( $fields, ',' ) + 1; $q = implode( ',', array_map( function ( $el ) { return '(' . implode( ',', $el ) . ')'; }, array_chunk( array_fill( 0, count( $data ), '%s' ), $division ) ) ); return $q; } /** * Prepare image sizes list for optimization UI. * * @since 7.5 * * @param bool $detailed When true, return detailed objects; otherwise size names. * @return array<int,string|array<string,int|string>> */ public static function prepare_image_sizes_array( $detailed = false ) { $image_sizes = wp_get_registered_image_subsizes(); $sizes = []; foreach ( $image_sizes as $current_size_name => $current_size ) { if ( empty( $current_size['width'] ) && empty( $current_size['height'] ) ) { continue; } if ( ! $detailed ) { $sizes[] = $current_size_name; } else { $label = $current_size['width'] . 'x' . $current_size['height']; if ( $current_size_name !== $label ) { $label = ucfirst( $current_size_name ) . ' ( ' . $label . ' )'; } $sizes[] = [ 'label' => $label, 'file_size' => $current_size_name, 'width' => (int) $current_size['width'], 'height' => (int) $current_size['height'], ]; } } return $sizes; } } src/placeholder.cls.php 0000777 00000043722 15251157102 0011124 0 ustar 00 <?php /** * The Placeholder class. * * Handles responsive placeholders (LQIP), admin column rendering, * queueing, and generation logic (local and cloud). * * @since 3.0 * @package LiteSpeed */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Placeholder */ class Placeholder extends Base { /** * Action type: generate. * * @var string */ const TYPE_GENERATE = 'generate'; /** * Action type: clear queue. * * @var string */ const TYPE_CLEAR_Q = 'clear_q'; /** * Whether responsive placeholders are enabled. * * @var bool */ private $_conf_placeholder_resp; /** * SVG template for responsive placeholders. * * @var string */ private $_conf_placeholder_resp_svg; /** * Whether LQIP generation via cloud is enabled. * * @var bool */ private $_conf_lqip; /** * LQIP JPEG quality. * * @var int */ private $_conf_lqip_qual; /** * Minimum width for LQIP generation. * * @var int */ private $_conf_lqip_min_w; /** * Minimum height for LQIP generation. * * @var int */ private $_conf_lqip_min_h; /** * Background color for SVG placeholders. * * @var string */ private $_conf_placeholder_resp_color; /** * Whether LQIP generation is async (queued). * * @var bool */ private $_conf_placeholder_resp_async; /** * Default placeholder data (fallback). * * @var string */ private $_conf_ph_default; /** * In-memory map of generated placeholders for current request. * * @var array<string,string> */ private $_placeholder_resp_dict = []; /** * Keys currently queued within this request. * * @var array<int,string> */ private $_ph_queue = []; /** * Stats & request summary for throttling. * * @var array<string,mixed> */ protected $_summary; /** * Init * * @since 3.0 */ public function __construct() { $this->_conf_placeholder_resp = defined( 'LITESPEED_GUEST_OPTM' ) || $this->conf( self::O_MEDIA_PLACEHOLDER_RESP ); $this->_conf_placeholder_resp_svg = $this->conf( self::O_MEDIA_PLACEHOLDER_RESP_SVG ); $this->_conf_lqip = ! defined( 'LITESPEED_GUEST_OPTM' ) && $this->conf( self::O_MEDIA_LQIP ); $this->_conf_lqip_qual = $this->conf( self::O_MEDIA_LQIP_QUAL ); $this->_conf_lqip_min_w = $this->conf( self::O_MEDIA_LQIP_MIN_W ); $this->_conf_lqip_min_h = $this->conf( self::O_MEDIA_LQIP_MIN_H ); $this->_conf_placeholder_resp_async = $this->conf( self::O_MEDIA_PLACEHOLDER_RESP_ASYNC ); $this->_conf_placeholder_resp_color = $this->conf( self::O_MEDIA_PLACEHOLDER_RESP_COLOR ); $this->_conf_ph_default = $this->conf(self::O_MEDIA_LAZY_PLACEHOLDER) ? $this->conf(self::O_MEDIA_LAZY_PLACEHOLDER) : LITESPEED_PLACEHOLDER; $this->_summary = self::get_summary(); } /** * Init Placeholder. */ public function init() { Debug2::debug2( '[LQIP] init' ); add_action( 'litespeed_after_admin_init', [ $this, 'after_admin_init' ] ); } /** * Display column in Media. * * @since 3.0 * @access public */ public function after_admin_init() { if ( $this->_conf_lqip ) { add_filter( 'manage_media_columns', [ $this, 'media_row_title' ] ); add_filter( 'manage_media_custom_column', [ $this, 'media_row_actions' ], 10, 2 ); add_action( 'litespeed_media_row_lqip', [ $this, 'media_row_con' ] ); } } /** * Media Admin Menu -> LQIP column header. * * @since 3.0 * @param array<string,string> $posts_columns Columns. * @return array<string,string> */ public function media_row_title( $posts_columns ) { $posts_columns['lqip'] = __( 'LQIP', 'litespeed-cache' ); return $posts_columns; } /** * Media Admin Menu -> LQIP Column renderer trigger. * * @since 3.0 * @param string $column_name Column name. * @param int $post_id Attachment ID. * @return void */ public function media_row_actions( $column_name, $post_id ) { if ( 'lqip' !== $column_name ) { return; } do_action( 'litespeed_media_row_lqip', $post_id ); } /** * Display LQIP column. * * @since 3.0 * @param int $post_id Attachment ID. * @return void */ public function media_row_con( $post_id ) { $meta_value = wp_get_attachment_metadata( $post_id ); if ( empty( $meta_value['file'] ) ) { return; } $total_files = 0; // List all sizes. $all_sizes = [ $meta_value['file'] ]; $size_path = pathinfo( $meta_value['file'], PATHINFO_DIRNAME ) . '/'; if ( ! empty( $meta_value['sizes'] ) && is_array( $meta_value['sizes'] ) ) { foreach ( $meta_value['sizes'] as $v ) { if ( ! empty( $v['file'] ) ) { $all_sizes[] = $size_path . $v['file']; } } } foreach ( $all_sizes as $short_path ) { $lqip_folder = LITESPEED_STATIC_DIR . '/lqip/' . $short_path; if ( is_dir( $lqip_folder ) ) { Debug2::debug( '[LQIP] Found folder: ' . $short_path ); // List all files. foreach ( scandir( $lqip_folder ) as $v ) { if ( '.' === $v || '..' === $v ) { continue; } if ( 0 === $total_files ) { echo '<div class="litespeed-media-lqip"><img src="' . esc_url( Str::trim_quotes( File::read( $lqip_folder . '/' . $v ) ) ) . '" alt="' . esc_attr( sprintf( __( 'LQIP image preview for size %s', 'litespeed-cache' ), $v ) ) . '"></div>'; } echo '<div class="litespeed-media-size"><a href="' . esc_url( Str::trim_quotes( File::read( $lqip_folder . '/' . $v ) ) ) . '" target="_blank">' . esc_html( $v ) . '</a></div>'; ++$total_files; } } } if ( 0 === $total_files ) { echo '—'; } } /** * Replace image HTML with placeholder-based lazy version. * * @since 3.0 * @param string $html Original <img> HTML. * @param string $src Image source URL. * @param string $size Requested size (e.g. "300x200"). * @return string Modified HTML. */ public function replace( $html, $src, $size ) { // Check if need to enable responsive placeholder or not. $ph_candidate = $this->_placeholder( $src, $size ); $this_placeholder = $ph_candidate ? $ph_candidate : $this->_conf_ph_default; $additional_attr = ''; if ( $this->_conf_lqip && $this_placeholder !== $this->_conf_ph_default ) { Debug2::debug2( '[LQIP] Use resp LQIP [size] ' . $size ); $additional_attr = ' data-placeholder-resp="' . esc_attr( Str::trim_quotes( $size ) ) . '"'; } $snippet = ( defined( 'LITESPEED_GUEST_OPTM' ) || $this->conf( self::O_OPTM_NOSCRIPT_RM ) ) ? '' : '<noscript>' . $html . '</noscript>'; $html = preg_replace( [ '/\s+src=/i', '/\s+srcset=/i', '/\s+sizes=/i', ], [ ' data-src=', ' data-srcset=', ' data-sizes=', ], $html ); $html = preg_replace( '/<img\s+/i', '<img data-lazyloaded="1"' . $additional_attr . ' src="' . Str::trim_quotes($this_placeholder) . '" ', $html ); // $html = str_replace( array( ' src=', ' srcset=', ' sizes=' ), array( ' data-src=', ' data-srcset=', ' data-sizes=' ), $html ); // $html = str_replace( '<img ', '<img data-lazyloaded="1"' . $additional_attr . ' src="' . esc_url( Str::trim_quotes( $this_placeholder ) ) . '" ', $html ); $snippet = $html . $snippet; return $snippet; } /** * Generate responsive placeholder (or schedule generation). * * @since 2.5.1 * @access private * @param string $src Image source URL. * @param string $size Size string "WIDTHxHEIGHT". * @return string|false Data URL placeholder or false. */ private function _placeholder( $src, $size ) { // Low Quality Image Placeholders. if ( ! $size ) { Debug2::debug2( '[LQIP] no size ' . $src ); return false; } if ( ! $this->_conf_placeholder_resp ) { return false; } // If use local generator. if ( ! $this->_conf_lqip || ! $this->_lqip_size_check( $size ) ) { return $this->_generate_placeholder_locally( $size ); } Debug2::debug2( '[LQIP] Resp LQIP process [src] ' . $src . ' [size] ' . $size ); $arr_key = $size . ' ' . $src; // Check if its already in dict or not. if ( ! empty( $this->_placeholder_resp_dict[ $arr_key ] ) ) { Debug2::debug2( '[LQIP] already in dict' ); return $this->_placeholder_resp_dict[ $arr_key ]; } // Need to generate the responsive placeholder. $placeholder_realpath = $this->_placeholder_realpath( $src, $size ); // todo: give offload API. if ( file_exists( $placeholder_realpath ) ) { Debug2::debug2( '[LQIP] file exists' ); $this->_placeholder_resp_dict[ $arr_key ] = File::read( $placeholder_realpath ); return $this->_placeholder_resp_dict[ $arr_key ]; } // Prevent repeated requests in same request. if ( in_array( $arr_key, $this->_ph_queue, true ) ) { Debug2::debug2( '[LQIP] file bypass generating due to in queue' ); return $this->_generate_placeholder_locally( $size ); } $hit = Utility::str_hit_array( $src, $this->conf( self::O_MEDIA_LQIP_EXC ) ); if ( $hit ) { Debug2::debug2( '[LQIP] file bypass generating due to exclude setting [hit] ' . $hit ); return $this->_generate_placeholder_locally( $size ); } $this->_ph_queue[] = $arr_key; // Send request to generate placeholder. if ( ! $this->_conf_placeholder_resp_async ) { // If requested recently, bypass. if ( $this->_summary && ! empty( $this->_summary['curr_request'] ) && ( time() - (int) $this->_summary['curr_request'] ) < 300 ) { Debug2::debug2( '[LQIP] file bypass generating due to interval limit' ); return false; } // Generate immediately. $this->_placeholder_resp_dict[ $arr_key ] = $this->_generate_placeholder( $arr_key ); return $this->_placeholder_resp_dict[ $arr_key ]; } // Prepare default svg placeholder as tmp placeholder. $tmp_placeholder = $this->_generate_placeholder_locally( $size ); // Store it to prepare for cron. $queue = $this->load_queue( 'lqip' ); if ( in_array( $arr_key, $queue, true ) ) { Debug2::debug2( '[LQIP] already in queue' ); return $tmp_placeholder; } if ( count( $queue ) > 500 ) { Debug2::debug2( '[LQIP] queue is full' ); return $tmp_placeholder; } $queue[] = $arr_key; $this->save_queue( 'lqip', $queue ); Debug2::debug( '[LQIP] Added placeholder queue' ); return $tmp_placeholder; } /** * Generate realpath of placeholder file. * * @since 2.5.1 * @access private * @param string $src Image source URL. * @param string $size Size string "WIDTHxHEIGHT". * @return string Absolute file path. */ private function _placeholder_realpath( $src, $size ) { // Use LQIP Cloud generator, each image placeholder will be separately stored. // Compatibility with WebP and AVIF. $src = Utility::drop_webp( $src ); $filepath_prefix = $this->_build_filepath_prefix( 'lqip' ); // External images will use cache folder directly. $domain = wp_parse_url( $src, PHP_URL_HOST ); if ( $domain && ! Utility::internal( $domain ) ) { // todo: need to improve `util:internal()` to include `CDN::internal()` $md5 = md5($src); return LITESPEED_STATIC_DIR . $filepath_prefix . 'remote/' . substr( $md5, 0, 1 ) . '/' . substr( $md5, 1, 1 ) . '/' . $md5 . '.' . $size; } // Drop domain. $short_path = Utility::att_short_path( $src ); return LITESPEED_STATIC_DIR . $filepath_prefix . $short_path . '/' . $size; } /** * Cron placeholder generation. * * @since 2.5.1 * @param bool $do_continue If true, process full queue in one run. * @return void */ public static function cron( $do_continue = false ) { $_instance = self::cls(); $queue = $_instance->load_queue( 'lqip' ); if ( empty( $queue ) ) { return; } // For cron, need to check request interval too. if ( ! $do_continue ) { if ( ! empty( $_instance->_summary['curr_request'] ) && ( time() - (int) $_instance->_summary['curr_request'] ) < 300 ) { Debug2::debug( '[LQIP] Last request not done' ); return; } } foreach ( $queue as $v ) { Debug2::debug( '[LQIP] cron job [size] ' . $v ); $res = $_instance->_generate_placeholder( $v, true ); // Exit queue if out of quota. if ( 'out_of_quota' === $res ) { return; } // Only request first one unless continuing. if ( ! $do_continue ) { return; } } } /** * Generate placeholder locally (SVG). * * @since 3.0 * @access private * @param string $size Size string "WIDTHxHEIGHT". * @return string Data URL for SVG placeholder. */ private function _generate_placeholder_locally( $size ) { Debug2::debug2( '[LQIP] _generate_placeholder local [size] ' . $size ); $size = explode( 'x', $size ); $svg = str_replace( [ '{width}', '{height}', '{color}' ], [ (int) $size[0], (int) $size[1], $this->_conf_placeholder_resp_color ], $this->_conf_placeholder_resp_svg ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode return 'data:image/svg+xml;base64,' . base64_encode( $svg ); } /** * Send to LiteSpeed API to generate placeholder (and persist). * * @since 2.5.1 * @access private * @param string $raw_size_and_src Concatenated "SIZE SRC". * @param bool $from_cron If true, called from cron context. * @return string Data URL placeholder. */ private function _generate_placeholder( $raw_size_and_src, $from_cron = false ) { // Parse containing size and src info. $size_and_src = explode( ' ', $raw_size_and_src, 2 ); $size = $size_and_src[0]; if ( empty( $size_and_src[1] ) ) { $this->_popup_and_save( $raw_size_and_src ); Debug2::debug( '[LQIP] ❌ No src [raw] ' . $raw_size_and_src ); return $this->_generate_placeholder_locally( $size ); } $src = $size_and_src[1]; $file = $this->_placeholder_realpath( $src, $size ); // Local generate SVG to serve (repeated here to clear queue if settings changed). if ( ! $this->_conf_lqip || ! $this->_lqip_size_check( $size ) ) { $data = $this->_generate_placeholder_locally( $size ); } else { $err = false; $allowance = Cloud::cls()->allowance( Cloud::SVC_LQIP, $err ); if ( ! $allowance ) { Debug2::debug( '[LQIP] ❌ No credit: ' . $err ); $err && Admin_Display::error( Error::msg( $err ) ); if ( $from_cron ) { return 'out_of_quota'; } return $this->_generate_placeholder_locally( $size ); } // Generate LQIP. list( $width, $height ) = explode( 'x', $size ); $req_data = [ 'width' => (int) $width, 'height' => (int) $height, 'url' => Utility::drop_webp( $src ), 'quality' => (int) $this->_conf_lqip_qual, ]; // Check if the image is 404 first. if ( File::is_404( $req_data['url'] ) ) { $this->_popup_and_save( $raw_size_and_src, true ); $this->_append_exc( $src ); Debug2::debug( '[LQIP] 404 before request [src] ' . $req_data['url'] ); return $this->_generate_placeholder_locally( $size ); } // Update request status. $this->_summary['curr_request'] = time(); self::save_summary(); $json = Cloud::post( Cloud::SVC_LQIP, $req_data, 120 ); if ( ! is_array( $json ) ) { return $this->_generate_placeholder_locally( $size ); } if ( empty( $json['lqip'] ) || 0 !== strpos( $json['lqip'], 'data:image/svg+xml' ) ) { // Image error, pop up the current queue. $this->_popup_and_save( $raw_size_and_src, true ); $this->_append_exc( $src ); Debug2::debug( '[LQIP] wrong response format', $json ); return $this->_generate_placeholder_locally( $size ); } $data = $json['lqip']; Debug2::debug( '[LQIP] _generate_placeholder LQIP' ); } // Write to file. File::save( $file, $data, true ); // Save summary data. $this->_summary['last_spent'] = time() - (int) $this->_summary['curr_request']; $this->_summary['last_request'] = $this->_summary['curr_request']; $this->_summary['curr_request'] = 0; self::save_summary(); $this->_popup_and_save( $raw_size_and_src ); Debug2::debug( '[LQIP] saved LQIP ' . $file ); return $data; } /** * Check if the size is valid to send LQIP request or not. * * @since 3.0 * @param string $size Size string "WIDTHxHEIGHT". * @return bool True if meets minimums. */ private function _lqip_size_check( $size ) { $size = explode( 'x', $size ); if ( ( (int) $size[0] >= (int) $this->_conf_lqip_min_w ) || ( (int) $size[1] >= (int) $this->_conf_lqip_min_h ) ) { return true; } Debug2::debug2( '[LQIP] Size too small' ); return false; } /** * Add to LQIP exclude list. * * @since 3.4 * @param string $src Image URL. * @return void */ private function _append_exc( $src ) { $val = $this->conf( self::O_MEDIA_LQIP_EXC ); $val[] = $src; $this->cls( 'Conf' )->update( self::O_MEDIA_LQIP_EXC, $val ); Debug2::debug( '[LQIP] Appended to LQIP Excludes [URL] ' . $src ); } /** * Pop up the current request from queue and save. * * @since 3.0 * @param string $raw_size_and_src Concatenated "SIZE SRC". * @param bool $append_to_exc If true, also add to exclusion list. * @return void */ private function _popup_and_save( $raw_size_and_src, $append_to_exc = false ) { $queue = $this->load_queue( 'lqip' ); if ( ! empty( $queue ) && in_array( $raw_size_and_src, $queue, true ) ) { $idx = array_search( $raw_size_and_src, $queue, true ); if ( false !== $idx ) { unset( $queue[ $idx ] ); } } if ( $append_to_exc ) { $size_and_src = explode( ' ', $raw_size_and_src, 2 ); if (isset( $size_and_src[1] ) && $size_and_src[1]) { $this_src = $size_and_src[1]; // Append to lqip exc setting first. $this->_append_exc( $this_src ); // Check if other queues contain this src or not. if ( $queue ) { foreach ( $queue as $k => $raw_item ) { $parsed = explode( ' ', $raw_item, 2 ); if ( empty( $parsed[1] ) ) { continue; } if ( $parsed[1] === $this_src ) { unset( $queue[ $k ] ); } } } } } $this->save_queue( 'lqip', $queue ); } /** * Handle all request actions from main cls. * * @since 2.5.1 * @access public * @return void */ public function handler() { $type = Router::verify_type(); switch ( $type ) { case self::TYPE_GENERATE: self::cron( true ); break; case self::TYPE_CLEAR_Q: $this->clear_q( 'lqip' ); break; default: break; } Admin::redirect(); } } src/lang.cls.php 0000777 00000042155 15251157102 0007562 0 ustar 00 <?php /** * The language class. * * @package LiteSpeed * @since 3.0 */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Lang * * Provides translations and human-readable labels/status for UI. */ class Lang extends Base { /** * Get image status per status bit. * * @since 3.0 * * @param int|null $status Image status constant or null to return the full map. * @return array<string,string>|string Array map when $status is null, otherwise a single status label or 'N/A'. */ public static function img_status( $status = null ) { $list = [ Img_Optm::STATUS_NEW => __( 'Images not requested', 'litespeed-cache' ), Img_Optm::STATUS_RAW => __( 'Images ready to request', 'litespeed-cache' ), Img_Optm::STATUS_REQUESTED => __( 'Images requested', 'litespeed-cache' ), Img_Optm::STATUS_NOTIFIED => __( 'Images notified to pull', 'litespeed-cache' ), Img_Optm::STATUS_PULLED => __( 'Images optimized and pulled', 'litespeed-cache' ), ]; if ( null !== $status ) { return ! empty( $list[ $status ] ) ? $list[ $status ] : 'N/A'; } return $list; } /** * Try translating a string. * * Optionally supports sprintf-style substitutions when $raw_string * contains a '::' separator (e.g. 'key::arg1::arg2'). * * @since 4.7 * * @param string $raw_string Raw translation key or key with ::-separated args. * @return string Translated string or original raw string if not found. */ public static function maybe_translate( $raw_string ) { $map = [ 'auto_alias_failed_cdn' => __( 'Unable to automatically add %1$s as a Domain Alias for main %2$s domain, due to potential CDN conflict.', 'litespeed-cache' ) . ' ' . Doc::learn_more( 'https://quic.cloud/docs/cdn/dns/how-to-setup-domain-alias/', false, false, false, true ), 'auto_alias_failed_uid' => __( 'Unable to automatically add %1$s as a Domain Alias for main %2$s domain.', 'litespeed-cache' ) . ' ' . __( 'Alias is in use by another QUIC.cloud account.', 'litespeed-cache' ) . ' ' . Doc::learn_more( 'https://quic.cloud/docs/cdn/dns/how-to-setup-domain-alias/', false, false, false, true ), ]; // Maybe has placeholder. if ( strpos( $raw_string, '::' ) ) { $replacements = explode( '::', $raw_string ); if ( empty( $map[ $replacements[0] ] ) ) { return $raw_string; } $tpl = $map[ $replacements[0] ]; unset( $replacements[0] ); return vsprintf( $tpl, array_values( $replacements ) ); } // Direct translation only. if ( empty( $map[ $raw_string ] ) ) { return $raw_string; } return $map[ $raw_string ]; } /** * Get the title/label for an option ID. * * @since 3.0 * @access public * * @param string|int $id Option identifier constant. * @return string Human-readable title or 'N/A' if not found. */ public static function title( $id ) { $_lang_list = [ self::O_SERVER_IP => __( 'Server IP', 'litespeed-cache' ), self::O_CACHE => __( 'Enable Cache', 'litespeed-cache' ), self::O_CACHE_BROWSER => __( 'Browser Cache', 'litespeed-cache' ), self::O_CACHE_TTL_PUB => __( 'Default Public Cache TTL', 'litespeed-cache' ), self::O_CACHE_TTL_PRIV => __( 'Default Private Cache TTL', 'litespeed-cache' ), self::O_CACHE_TTL_FRONTPAGE => __( 'Default Front Page TTL', 'litespeed-cache' ), self::O_CACHE_TTL_FEED => __( 'Default Feed TTL', 'litespeed-cache' ), self::O_CACHE_TTL_REST => __( 'Default REST TTL', 'litespeed-cache' ), self::O_CACHE_TTL_STATUS => __( 'Default HTTP Status Code Page TTL', 'litespeed-cache' ), self::O_CACHE_TTL_BROWSER => __( 'Browser Cache TTL', 'litespeed-cache' ), self::O_CACHE_AJAX_TTL => __( 'AJAX Cache TTL', 'litespeed-cache' ), self::O_AUTO_UPGRADE => __( 'Automatically Upgrade', 'litespeed-cache' ), self::O_GUEST => __( 'Guest Mode', 'litespeed-cache' ), self::O_GUEST_OPTM => __( 'Guest Optimization', 'litespeed-cache' ), self::O_NEWS => __( 'Notifications', 'litespeed-cache' ), self::O_CACHE_PRIV => __( 'Cache Logged-in Users', 'litespeed-cache' ), self::O_CACHE_COMMENTER => __( 'Cache Commenters', 'litespeed-cache' ), self::O_CACHE_REST => __( 'Cache REST API', 'litespeed-cache' ), self::O_CACHE_PAGE_LOGIN => __( 'Cache Login Page', 'litespeed-cache' ), self::O_CACHE_MOBILE => __( 'Cache Mobile', 'litespeed-cache' ), self::O_CACHE_MOBILE_RULES => __( 'List of Mobile User Agents', 'litespeed-cache' ), self::O_CACHE_PRIV_URI => __( 'Private Cached URIs', 'litespeed-cache' ), self::O_CACHE_DROP_QS => __( 'Drop Query String', 'litespeed-cache' ), self::O_OBJECT => __( 'Object Cache', 'litespeed-cache' ), self::O_OBJECT_KIND => __( 'Method', 'litespeed-cache' ), self::O_OBJECT_HOST => __( 'Host', 'litespeed-cache' ), self::O_OBJECT_PORT => __( 'Port', 'litespeed-cache' ), self::O_OBJECT_LIFE => __( 'Default Object Lifetime', 'litespeed-cache' ), self::O_OBJECT_USER => __( 'Username', 'litespeed-cache' ), self::O_OBJECT_PSWD => __( 'Password', 'litespeed-cache' ), self::O_OBJECT_DB_ID => __( 'Redis Database ID', 'litespeed-cache' ), self::O_OBJECT_GLOBAL_GROUPS => __( 'Global Groups', 'litespeed-cache' ), self::O_OBJECT_NON_PERSISTENT_GROUPS => __( 'Do Not Cache Groups', 'litespeed-cache' ), self::O_OBJECT_PERSISTENT => __( 'Persistent Connection', 'litespeed-cache' ), self::O_OBJECT_ADMIN => __( 'Cache WP-Admin', 'litespeed-cache' ), self::O_OBJECT_TRANSIENTS => __( 'Store Transients', 'litespeed-cache' ), self::O_PURGE_ON_UPGRADE => __( 'Purge All On Upgrade', 'litespeed-cache' ), self::O_PURGE_STALE => __( 'Serve Stale', 'litespeed-cache' ), self::O_PURGE_TIMED_URLS => __( 'Scheduled Purge URLs', 'litespeed-cache' ), self::O_PURGE_TIMED_URLS_TIME => __( 'Scheduled Purge Time', 'litespeed-cache' ), self::O_CACHE_FORCE_URI => __( 'Force Cache URIs', 'litespeed-cache' ), self::O_CACHE_FORCE_PUB_URI => __( 'Force Public Cache URIs', 'litespeed-cache' ), self::O_CACHE_EXC => __( 'Do Not Cache URIs', 'litespeed-cache' ), self::O_CACHE_EXC_QS => __( 'Do Not Cache Query Strings', 'litespeed-cache' ), self::O_CACHE_EXC_CAT => __( 'Do Not Cache Categories', 'litespeed-cache' ), self::O_CACHE_EXC_TAG => __( 'Do Not Cache Tags', 'litespeed-cache' ), self::O_CACHE_EXC_ROLES => __( 'Do Not Cache Roles', 'litespeed-cache' ), self::O_OPTM_CSS_MIN => __( 'CSS Minify', 'litespeed-cache' ), self::O_OPTM_CSS_COMB => __( 'CSS Combine', 'litespeed-cache' ), self::O_OPTM_CSS_COMB_EXT_INL => __( 'CSS Combine External and Inline', 'litespeed-cache' ), self::O_OPTM_UCSS => __( 'Generate UCSS', 'litespeed-cache' ), self::O_OPTM_UCSS_INLINE => __( 'UCSS Inline', 'litespeed-cache' ), self::O_OPTM_UCSS_SELECTOR_WHITELIST => __( 'UCSS Selector Allowlist', 'litespeed-cache' ), self::O_OPTM_UCSS_FILE_EXC_INLINE => __( 'UCSS Inline Excluded Files', 'litespeed-cache' ), self::O_OPTM_UCSS_EXC => __( 'UCSS URI Excludes', 'litespeed-cache' ), self::O_OPTM_JS_MIN => __( 'JS Minify', 'litespeed-cache' ), self::O_OPTM_JS_COMB => __( 'JS Combine', 'litespeed-cache' ), self::O_OPTM_JS_COMB_EXT_INL => __( 'JS Combine External and Inline', 'litespeed-cache' ), self::O_OPTM_HTML_MIN => __( 'HTML Minify', 'litespeed-cache' ), self::O_OPTM_HTML_LAZY => __( 'HTML Lazy Load Selectors', 'litespeed-cache' ), self::O_OPTM_HTML_SKIP_COMMENTS => __( 'HTML Keep Comments', 'litespeed-cache' ), self::O_OPTM_CSS_ASYNC => __( 'Load CSS Asynchronously', 'litespeed-cache' ), self::O_OPTM_CCSS_PER_URL => __( 'CCSS Per URL', 'litespeed-cache' ), self::O_OPTM_CSS_ASYNC_INLINE => __( 'Inline CSS Async Lib', 'litespeed-cache' ), self::O_OPTM_CSS_FONT_DISPLAY => __( 'Font Display Optimization', 'litespeed-cache' ), self::O_OPTM_JS_DEFER => __( 'Load JS Deferred', 'litespeed-cache' ), self::O_OPTM_LOCALIZE => __( 'Localize Resources', 'litespeed-cache' ), self::O_OPTM_LOCALIZE_DOMAINS => __( 'Localization Files', 'litespeed-cache' ), self::O_OPTM_DNS_PREFETCH => __( 'DNS Prefetch', 'litespeed-cache' ), self::O_OPTM_DNS_PREFETCH_CTRL => __( 'DNS Prefetch Control', 'litespeed-cache' ), self::O_OPTM_DNS_PRECONNECT => __( 'DNS Preconnect', 'litespeed-cache' ), self::O_OPTM_CSS_EXC => __( 'CSS Excludes', 'litespeed-cache' ), self::O_OPTM_JS_DELAY_INC => __( 'JS Delayed Includes', 'litespeed-cache' ), self::O_OPTM_JS_EXC => __( 'JS Excludes', 'litespeed-cache' ), self::O_OPTM_QS_RM => __( 'Remove Query Strings', 'litespeed-cache' ), self::O_OPTM_GGFONTS_ASYNC => __( 'Load Google Fonts Asynchronously', 'litespeed-cache' ), self::O_OPTM_GGFONTS_RM => __( 'Remove Google Fonts', 'litespeed-cache' ), self::O_OPTM_CCSS_CON => __( 'Critical CSS Rules', 'litespeed-cache' ), self::O_OPTM_CCSS_SEP_POSTTYPE => __( 'Separate CCSS Cache Post Types', 'litespeed-cache' ), self::O_OPTM_CCSS_SEP_URI => __( 'Separate CCSS Cache URIs', 'litespeed-cache' ), self::O_OPTM_CCSS_SELECTOR_WHITELIST => __( 'CCSS Selector Allowlist', 'litespeed-cache' ), self::O_OPTM_JS_DEFER_EXC => __( 'JS Deferred / Delayed Excludes', 'litespeed-cache' ), self::O_OPTM_GM_JS_EXC => __( 'Guest Mode JS Excludes', 'litespeed-cache' ), self::O_OPTM_EMOJI_RM => __( 'Remove WordPress Emoji', 'litespeed-cache' ), self::O_OPTM_NOSCRIPT_RM => __( 'Remove Noscript Tags', 'litespeed-cache' ), self::O_OPTM_EXC => __( 'URI Excludes', 'litespeed-cache' ), self::O_OPTM_GUEST_ONLY => __( 'Optimize for Guests Only', 'litespeed-cache' ), self::O_OPTM_EXC_ROLES => __( 'Role Excludes', 'litespeed-cache' ), self::O_DISCUSS_AVATAR_CACHE => __( 'Gravatar Cache', 'litespeed-cache' ), self::O_DISCUSS_AVATAR_CRON => __( 'Gravatar Cache Cron', 'litespeed-cache' ), self::O_DISCUSS_AVATAR_CACHE_TTL => __( 'Gravatar Cache TTL', 'litespeed-cache' ), self::O_MEDIA_LAZY => __( 'Lazy Load Images', 'litespeed-cache' ), self::O_MEDIA_LAZY_EXC => __( 'Lazy Load Image Excludes', 'litespeed-cache' ), self::O_MEDIA_LAZY_CLS_EXC => __( 'Lazy Load Image Class Name Excludes', 'litespeed-cache' ), self::O_MEDIA_LAZY_PARENT_CLS_EXC => __( 'Lazy Load Image Parent Class Name Excludes', 'litespeed-cache' ), self::O_MEDIA_IFRAME_LAZY_CLS_EXC => __( 'Lazy Load Iframe Class Name Excludes', 'litespeed-cache' ), self::O_MEDIA_IFRAME_LAZY_PARENT_CLS_EXC => __( 'Lazy Load Iframe Parent Class Name Excludes', 'litespeed-cache' ), self::O_MEDIA_LAZY_URI_EXC => __( 'Lazy Load URI Excludes', 'litespeed-cache' ), self::O_MEDIA_LQIP_EXC => __( 'LQIP Excludes', 'litespeed-cache' ), self::O_MEDIA_LAZY_PLACEHOLDER => __( 'Basic Image Placeholder', 'litespeed-cache' ), self::O_MEDIA_PLACEHOLDER_RESP => __( 'Responsive Placeholder', 'litespeed-cache' ), self::O_MEDIA_PLACEHOLDER_RESP_COLOR => __( 'Responsive Placeholder Color', 'litespeed-cache' ), self::O_MEDIA_PLACEHOLDER_RESP_SVG => __( 'Responsive Placeholder SVG', 'litespeed-cache' ), self::O_MEDIA_LQIP => __( 'LQIP Cloud Generator', 'litespeed-cache' ), self::O_MEDIA_LQIP_QUAL => __( 'LQIP Quality', 'litespeed-cache' ), self::O_MEDIA_LQIP_MIN_W => __( 'LQIP Minimum Dimensions', 'litespeed-cache' ), self::O_MEDIA_PLACEHOLDER_RESP_ASYNC => __( 'Generate LQIP In Background', 'litespeed-cache' ), self::O_MEDIA_IFRAME_LAZY => __( 'Lazy Load Iframes', 'litespeed-cache' ), self::O_MEDIA_ADD_MISSING_SIZES => __( 'Add Missing Sizes', 'litespeed-cache' ), self::O_MEDIA_VPI => __( 'Viewport Images', 'litespeed-cache' ), self::O_MEDIA_VPI_CRON => __( 'Viewport Images Cron', 'litespeed-cache' ), self::O_MEDIA_AUTO_RESCALE_ORI => __( 'Auto Rescale Original Images', 'litespeed-cache' ), self::O_IMG_OPTM_AUTO => __( 'Auto Request Cron', 'litespeed-cache' ), self::O_IMG_OPTM_ORI => __( 'Optimize Original Images', 'litespeed-cache' ), self::O_IMG_OPTM_RM_BKUP => __( 'Remove Original Backups', 'litespeed-cache' ), self::O_IMG_OPTM_WEBP => __( 'Next-Gen Image Format', 'litespeed-cache' ), self::O_IMG_OPTM_LOSSLESS => __( 'Optimize Losslessly', 'litespeed-cache' ), self::O_IMG_OPTM_SIZES_SKIPPED => __( 'Optimize Image Sizes', 'litespeed-cache' ), self::O_IMG_OPTM_EXIF => __( 'Preserve EXIF/XMP data', 'litespeed-cache' ), self::O_IMG_OPTM_WEBP_ATTR => __( 'WebP/AVIF Attribute To Replace', 'litespeed-cache' ), self::O_IMG_OPTM_WEBP_REPLACE_SRCSET => __( 'WebP/AVIF For Extra srcset', 'litespeed-cache' ), self::O_IMG_OPTM_JPG_QUALITY => __( 'WordPress Image Quality Control', 'litespeed-cache' ), self::O_ESI => __( 'Enable ESI', 'litespeed-cache' ), self::O_ESI_CACHE_ADMBAR => __( 'Cache Admin Bar', 'litespeed-cache' ), self::O_ESI_CACHE_COMMFORM => __( 'Cache Comment Form', 'litespeed-cache' ), self::O_ESI_NONCE => __( 'ESI Nonces', 'litespeed-cache' ), self::O_CACHE_VARY_GROUP => __( 'Vary Group', 'litespeed-cache' ), self::O_PURGE_HOOK_ALL => __( 'Purge All Hooks', 'litespeed-cache' ), self::O_UTIL_NO_HTTPS_VARY => __( 'Improve HTTP/HTTPS Compatibility', 'litespeed-cache' ), self::O_UTIL_INSTANT_CLICK => __( 'Instant Click', 'litespeed-cache' ), self::O_CACHE_EXC_COOKIES => __( 'Do Not Cache Cookies', 'litespeed-cache' ), self::O_CACHE_EXC_USERAGENTS => __( 'Do Not Cache User Agents', 'litespeed-cache' ), self::O_CACHE_LOGIN_COOKIE => __( 'Login Cookie', 'litespeed-cache' ), self::O_CACHE_VARY_COOKIES => __( 'Vary Cookies', 'litespeed-cache' ), self::O_MISC_HEARTBEAT_FRONT => __( 'Frontend Heartbeat Control', 'litespeed-cache' ), self::O_MISC_HEARTBEAT_FRONT_TTL => __( 'Frontend Heartbeat TTL', 'litespeed-cache' ), self::O_MISC_HEARTBEAT_BACK => __( 'Backend Heartbeat Control', 'litespeed-cache' ), self::O_MISC_HEARTBEAT_BACK_TTL => __( 'Backend Heartbeat TTL', 'litespeed-cache' ), self::O_MISC_HEARTBEAT_EDITOR => __( 'Editor Heartbeat', 'litespeed-cache' ), self::O_MISC_HEARTBEAT_EDITOR_TTL => __( 'Editor Heartbeat TTL', 'litespeed-cache' ), self::O_CDN => __( 'Use CDN Mapping', 'litespeed-cache' ), self::CDN_MAPPING_URL => __( 'CDN URL', 'litespeed-cache' ), self::CDN_MAPPING_INC_IMG => __( 'Include Images', 'litespeed-cache' ), self::CDN_MAPPING_INC_CSS => __( 'Include CSS', 'litespeed-cache' ), self::CDN_MAPPING_INC_JS => __( 'Include JS', 'litespeed-cache' ), self::CDN_MAPPING_FILETYPE => __( 'Include File Types', 'litespeed-cache' ), self::O_CDN_ATTR => __( 'HTML Attribute To Replace', 'litespeed-cache' ), self::O_CDN_ORI => __( 'Original URLs', 'litespeed-cache' ), self::O_CDN_ORI_DIR => __( 'Included Directories', 'litespeed-cache' ), self::O_CDN_EXC => __( 'Exclude Path', 'litespeed-cache' ), self::O_CDN_CLOUDFLARE => __( 'Cloudflare API', 'litespeed-cache' ), self::O_CDN_CLOUDFLARE_CLEAR => __( 'Clear Cloudflare cache', 'litespeed-cache' ), self::O_CRAWLER => __( 'Crawler', 'litespeed-cache' ), self::O_CRAWLER_CRAWL_INTERVAL => __( 'Crawl Interval', 'litespeed-cache' ), self::O_CRAWLER_LOAD_LIMIT => __( 'Server Load Limit', 'litespeed-cache' ), self::O_CRAWLER_ROLES => __( 'Role Simulation', 'litespeed-cache' ), self::O_CRAWLER_COOKIES => __( 'Cookie Simulation', 'litespeed-cache' ), self::O_CRAWLER_SITEMAP => __( 'Custom Sitemap', 'litespeed-cache' ), self::O_DEBUG_DISABLE_ALL => __( 'Disable All Features', 'litespeed-cache' ), self::O_DEBUG => __( 'Debug Log', 'litespeed-cache' ), self::O_DEBUG_IPS => __( 'Admin IPs', 'litespeed-cache' ), self::O_DEBUG_LEVEL => __( 'Debug Level', 'litespeed-cache' ), self::O_DEBUG_FILESIZE => __( 'Log File Size Limit', 'litespeed-cache' ), self::O_DEBUG_COLLAPSE_QS => __( 'Collapse Query Strings', 'litespeed-cache' ), self::O_DEBUG_INC => __( 'Debug URI Includes', 'litespeed-cache' ), self::O_DEBUG_EXC => __( 'Debug URI Excludes', 'litespeed-cache' ), self::O_DEBUG_EXC_STRINGS => __( 'Debug String Excludes', 'litespeed-cache' ), self::O_DB_OPTM_REVISIONS_MAX => __( 'Revisions Max Number', 'litespeed-cache' ), self::O_DB_OPTM_REVISIONS_AGE => __( 'Revisions Max Age', 'litespeed-cache' ), self::O_OPTIMAX => __( 'OptimaX', 'litespeed-cache' ), ]; if ( array_key_exists( $id, $_lang_list ) ) { return $_lang_list[ $id ]; } return 'N/A'; } } src/esi.cls.php 0000777 00000066272 15251157102 0007427 0 ustar 00 <?php // phpcs:ignoreFile /** * The ESI class. * * This is used to define all esi related functions. * * @since 1.1.3 * @package LiteSpeed */ namespace LiteSpeed; defined('WPINC') || exit(); class ESI extends Root { const LOG_TAG = '⏺'; private static $has_esi = false; private static $_combine_ids = array(); private $esi_args = null; private $_esi_preserve_list = array(); private $_nonce_actions = array( -1 => '' ); // val is cache control const QS_ACTION = 'lsesi'; const QS_PARAMS = 'esi'; const COMBO = '__combo'; // ESI include combine='main' handler const PARAM_ARGS = 'args'; const PARAM_ID = 'id'; const PARAM_INSTANCE = 'instance'; const PARAM_NAME = 'name'; const WIDGET_O_ESIENABLE = 'widget_esi_enable'; const WIDGET_O_TTL = 'widget_ttl'; /** * Confructor of ESI * * @since 1.2.0 * @since 4.0 Change to be after Vary init in hook 'after_setup_theme' */ public function init() { /** * Bypass ESI related funcs if disabled ESI to fix potential DIVI compatibility issue * * @since 2.9.7.2 */ if (Router::is_ajax() || !$this->cls('Router')->esi_enabled()) { return; } // Guest mode, don't need to use ESI if (defined('LITESPEED_GUEST') && LITESPEED_GUEST) { return; } if (defined('LITESPEED_ESI_OFF')) { return; } // If page is not cacheable if (defined('DONOTCACHEPAGE') && apply_filters('litespeed_const_DONOTCACHEPAGE', DONOTCACHEPAGE)) { return; } // Init ESI in `after_setup_theme` hook after detected if LITESPEED_DISABLE_ALL is ON or not $this->_hooks(); /** * Overwrite wp_create_nonce func * * @since 2.9.5 */ $this->_transform_nonce(); !defined('LITESPEED_ESI_INITED') && define('LITESPEED_ESI_INITED', true); } /** * Init ESI related hooks * * Load delayed by hook to give the ability to bypass by LITESPEED_DISABLE_ALL const * * @since 2.9.7.2 * @since 4.0 Changed to private from public * @access private */ private function _hooks() { add_filter('template_include', array( $this, 'esi_template' ), 99999); add_action('load-widgets.php', __NAMESPACE__ . '\Purge::purge_widget'); add_action('wp_update_comment_count', __NAMESPACE__ . '\Purge::purge_comment_widget'); /** * Recover REQUEST_URI * * @since 1.8.1 */ if (!empty($_GET[self::QS_ACTION])) { self::debug('ESI req'); $this->_register_esi_actions(); } /** * Shortcode ESI * * To use it, just change the original shortcode as below: * old: [someshortcode aa='bb'] * new: [esi someshortcode aa='bb' cache='private,no-vary' ttl='600'] * * 1. `cache` attribute is optional, default to 'public,no-vary'. * 2. `ttl` attribute is optional, default is your public TTL setting. * 3. `_ls_silence` attribute is optional, default is false. * * @since 2.8 * @since 2.8.1 Check is_admin for Elementor compatibility #726013 */ if (!is_admin()) { add_shortcode('esi', array( $this, 'shortcode' )); } } /** * Take over all nonce calls and transform to ESI * * @since 2.9.5 */ private function _transform_nonce() { if (is_admin()) { return; } // Load ESI nonces in conf $nonces = $this->conf(Base::O_ESI_NONCE); add_filter('litespeed_esi_nonces', array( $this->cls('Data'), 'load_esi_nonces' )); if ($nonces = apply_filters('litespeed_esi_nonces', $nonces)) { foreach ($nonces as $action) { $this->nonce_action($action); } } add_action('litespeed_nonce', array( $this, 'nonce_action' )); } /** * Register a new nonce action to convert it to ESI * * @since 2.9.5 */ public function nonce_action( $action ) { // Split the Cache Control $action = explode(' ', $action); $control = !empty($action[1]) ? $action[1] : ''; $action = $action[0]; // Wildcard supported $action = Utility::wildcard2regex($action); if (array_key_exists($action, $this->_nonce_actions)) { return; } $this->_nonce_actions[$action] = $control; // Debug2::debug('[ESI] Appended nonce action to nonce list [action] ' . $action); } /** * Check if an action is registered to replace ESI * * @since 2.9.5 */ public function is_nonce_action( $action ) { // If GM not run yet, then ESI not init yet, then ESI nonce will not be allowed even nonce func replaced. if (!defined('LITESPEED_ESI_INITED')) { return null; } if (is_admin()) { return null; } if (defined('LITESPEED_ESI_OFF')) { return null; } foreach ($this->_nonce_actions as $k => $v) { if (strpos($k, '*') !== false) { if (preg_match('#' . $k . '#iU', $action)) { return $v; } } elseif ($k == $action) { return $v; } } return null; } /** * Shortcode ESI * * @since 2.8 * @access public */ public function shortcode( $atts ) { if (empty($atts[0])) { Debug2::debug('[ESI] ===shortcode wrong format', $atts); return 'Wrong shortcode esi format'; } $cache = 'public,no-vary'; if (!empty($atts['cache'])) { $cache = $atts['cache']; unset($atts['cache']); } $silence = false; if (!empty($atts['_ls_silence'])) { $silence = true; } do_action('litespeed_esi_shortcode-' . $atts[0]); // Show ESI link return $this->sub_esi_block('esi', 'esi-shortcode', $atts, $cache, $silence); } /** * Check if the requested page has esi elements. If so, return esi on * header. * * @since 1.1.3 * @access public * @return string Esi On header if request has esi, empty string otherwise. */ public static function has_esi() { return self::$has_esi; } /** * Sets that the requested page has esi elements. * * @since 1.1.3 * @access public */ public static function set_has_esi() { self::$has_esi = true; } /** * Register all of the hooks related to the esi logic of the plugin. * Specifically when the page IS an esi page. * * @since 1.1.3 * @access private */ private function _register_esi_actions() { /** * This hook is in `init` * For any plugin need to check if page is ESI, use `LSCACHE_IS_ESI` check after `init` hook */ !defined('LSCACHE_IS_ESI') && define('LSCACHE_IS_ESI', $_GET[self::QS_ACTION]); // Reused this to ESI block ID !empty($_SERVER['ESI_REFERER']) && defined('LSCWP_LOG') && Debug2::debug('[ESI] ESI_REFERER: ' . $_SERVER['ESI_REFERER']); /** * Only when ESI's parent is not REST, replace REQUEST_URI to avoid breaking WP5 editor REST call * * @since 2.9.3 */ if (!empty($_SERVER['ESI_REFERER']) && !$this->cls('REST')->is_rest($_SERVER['ESI_REFERER'])) { self::debug('overwrite REQUEST_URI to ESI_REFERER [from] ' . $_SERVER['REQUEST_URI'] . ' [to] ' . $_SERVER['ESI_REFERER']); if (!empty($_SERVER['ESI_REFERER'])) { $_SERVER['REQUEST_URI'] = $_SERVER['ESI_REFERER']; if (substr(get_option('permalink_structure'), -1) === '/' && strpos($_SERVER['ESI_REFERER'], '?') === false) { $_SERVER['REQUEST_URI'] = trailingslashit($_SERVER['ESI_REFERER']); } } // Prevent from 301 redirecting if (!empty($_SERVER['SCRIPT_URI'])) { $SCRIPT_URI = parse_url($_SERVER['SCRIPT_URI']); $SCRIPT_URI['path'] = $_SERVER['REQUEST_URI']; Utility::compatibility(); $_SERVER['SCRIPT_URI'] = http_build_url($SCRIPT_URI); } } if (!empty($_SERVER['ESI_CONTENT_TYPE']) && strpos($_SERVER['ESI_CONTENT_TYPE'], 'application/json') === 0) { add_filter('litespeed_is_json', '__return_true'); } /** * Make REST call be able to parse ESI * NOTE: Not effective due to ESI req are all to `/` yet * * @since 2.9.4 */ add_action('rest_api_init', array( $this, 'load_esi_block' ), 101); // Register ESI blocks add_action('litespeed_esi_load-widget', array( $this, 'load_widget_block' )); add_action('litespeed_esi_load-admin-bar', array( $this, 'load_admin_bar_block' )); add_action('litespeed_esi_load-comment-form', array( $this, 'load_comment_form_block' )); add_action('litespeed_esi_load-nonce', array( $this, 'load_nonce_block' )); add_action('litespeed_esi_load-esi', array( $this, 'load_esi_shortcode' )); add_action('litespeed_esi_load-' . self::COMBO, array( $this, 'load_combo' )); } /** * Hooked to the template_include action. * Selects the esi template file when the post type is a LiteSpeed ESI page. * * @since 1.1.3 * @access public * @param string $template The template path filtered. * @return string The new template path. */ public function esi_template( $template ) { // Check if is an ESI request if (defined('LSCACHE_IS_ESI')) { self::debug('calling ESI template'); return LSCWP_DIR . 'tpl/esi.tpl.php'; } self::debug('calling default template'); $this->_register_not_esi_actions(); return $template; } /** * Register all of the hooks related to the esi logic of the plugin. * Specifically when the page is NOT an esi page. * * @since 1.1.3 * @access private */ private function _register_not_esi_actions() { do_action('litespeed_tpl_normal'); if (!Control::is_cacheable()) { return; } if (Router::is_ajax()) { return; } add_filter('widget_display_callback', array( $this, 'sub_widget_block' ), 0, 3); // Add admin_bar esi if (Router::is_logged_in()) { remove_action('wp_body_open', 'wp_admin_bar_render', 0); // Remove default Admin bar. Fix https://github.com/elementor/elementor/issues/25198 remove_action('wp_footer', 'wp_admin_bar_render', 1000); add_action('wp_footer', array( $this, 'sub_admin_bar_block' ), 1000); } // Add comment forum esi for logged-in user or commenter if (!Router::is_ajax() && Vary::has_vary()) { add_filter('comment_form_defaults', array( $this, 'register_comment_form_actions' )); } } /** * Set an ESI to be combine='sub' * * @since 3.4.2 */ public static function combine( $block_id ) { if (!isset($_SERVER['X-LSCACHE']) || strpos($_SERVER['X-LSCACHE'], 'combine') === false) { return; } if (in_array($block_id, self::$_combine_ids)) { return; } self::$_combine_ids[] = $block_id; } /** * Load combined ESI * * @since 3.4.2 */ public function load_combo() { Control::set_nocache('ESI combine request'); if (empty($_POST['esi_include'])) { return; } self::set_has_esi(); Debug2::debug('[ESI] 🍔 Load combo', $_POST['esi_include']); $output = ''; foreach ($_POST['esi_include'] as $url) { $qs = parse_url(htmlspecialchars_decode($url), PHP_URL_QUERY); parse_str($qs, $qs); if (empty($qs[self::QS_ACTION])) { continue; } $esi_id = $qs[self::QS_ACTION]; $esi_param = !empty($qs[self::QS_PARAMS]) ? $this->_parse_esi_param($qs[self::QS_PARAMS]) : false; $inline_param = apply_filters('litespeed_esi_inline-' . $esi_id, array(), $esi_param); // Returned array need to be [ val, control, tag ] if ($inline_param) { $output .= self::_build_inline($url, $inline_param); } } echo $output; } /** * Build a whole inline segment * * @since 3.4.2 */ private static function _build_inline( $url, $inline_param ) { if (!$url || empty($inline_param['val']) || empty($inline_param['control']) || empty($inline_param['tag'])) { return ''; } $url = esc_attr($url); $control = esc_attr($inline_param['control']); $tag = esc_attr($inline_param['tag']); return "<esi:inline name='$url' cache-control='" . $control . "' cache-tag='" . $tag . "'>" . $inline_param['val'] . '</esi:inline>'; } /** * Build the esi url. This method will build the html comment wrapper as well as serialize and encode the parameter array. * * The block_id parameter should contain alphanumeric and '-_' only. * * @since 1.1.3 * @access private * @param string $block_id The id to use to display the correct esi block. * @param string $wrapper The wrapper for the esi comments. * @param array $params The esi parameters. * @param string $control The cache control attribute if any. * @param bool $silence If generate wrapper comment or not * @param bool $preserved If this ESI block is used in any filter, need to temporarily convert it to a string to avoid the HTML tag being removed/filtered. * @param bool $svar If store the value in memory or not, in memory will be faster * @param array $inline_param If show the current value for current request( this can avoid multiple esi requests in first time cache generating process ) */ public function sub_esi_block( $block_id, $wrapper, $params = array(), $control = 'private,no-vary', $silence = false, $preserved = false, $svar = false, $inline_param = array() ) { if (empty($block_id) || !is_array($params) || preg_match('/[^\w-]/', $block_id)) { return false; } if (defined('LITESPEED_ESI_OFF')) { Debug2::debug('[ESI] ESI OFF so force loading [block_id] ' . $block_id); do_action('litespeed_esi_load-' . $block_id, $params); return; } if ($silence) { // Don't add comment to esi block ( original for nonce used in tag property data-nonce='esi_block' ) $params['_ls_silence'] = true; } if ($this->cls('REST')->is_rest() || $this->cls('REST')->is_internal_rest()) { $params['is_json'] = 1; } $params = apply_filters('litespeed_esi_params', $params, $block_id); $control = apply_filters('litespeed_esi_control', $control, $block_id); if (!is_array($params) || !is_string($control)) { defined('LSCWP_LOG') && Debug2::debug("[ESI] 🛑 Sub hooks returned Params: \n" . var_export($params, true) . "\ncache control: \n" . var_export($control, true)); return false; } // Build params for URL $appended_params = array( self::QS_ACTION => $block_id, ); if (!empty($control)) { $appended_params['_control'] = $control; } if ($params) { $appended_params[self::QS_PARAMS] = base64_encode(\json_encode($params)); Debug2::debug2('[ESI] param ', $params); } // Append hash $appended_params['_hash'] = $this->_gen_esi_md5($appended_params); /** * Escape potential chars * * @since 2.9.4 */ $appended_params = array_map('urlencode', $appended_params); // Generate ESI URL $url = add_query_arg($appended_params, trailingslashit(wp_make_link_relative(home_url()))); $output = ''; if ($inline_param) { $output .= self::_build_inline($url, $inline_param); } $output .= "<esi:include src='$url'"; if (!empty($control)) { $control = esc_attr($control); $output .= " cache-control='$control'"; } if ($svar) { $output .= " as-var='1'"; } if (in_array($block_id, self::$_combine_ids)) { $output .= " combine='sub'"; } if ($block_id == self::COMBO && isset($_SERVER['X-LSCACHE']) && strpos($_SERVER['X-LSCACHE'], 'combine') !== false) { $output .= " combine='main'"; } $output .= ' />'; if (!$silence) { $output = "<!-- lscwp $wrapper -->$output<!-- lscwp $wrapper esi end -->"; } self::debug("💕 [BLock_ID] $block_id \t[wrapper] $wrapper \t\t[Control] $control"); self::debug2($output); self::set_has_esi(); // Convert to string to avoid html chars filter when using // Will reverse the buffer when output in self::finalize() if ($preserved) { $hash = md5($output); $this->_esi_preserve_list[$hash] = $output; self::debug("Preserved to $hash"); return $hash; } return $output; } /** * Generate ESI hash md5 * * @since 2.9.6 * @access private */ private function _gen_esi_md5( $params ) { $keys = array( self::QS_ACTION, '_control', self::QS_PARAMS ); $str = ''; foreach ($keys as $v) { if (isset($params[$v]) && is_string($params[$v])) { $str .= $params[$v]; } } Debug2::debug2('[ESI] md5_string=' . $str); return md5($this->conf(Base::HASH) . $str); } /** * Parses the request parameters on an ESI request * * @since 1.1.3 * @access private */ private function _parse_esi_param( $qs_params = false ) { $req_params = false; if ($qs_params) { $req_params = $qs_params; } elseif (isset($_REQUEST[self::QS_PARAMS])) { $req_params = $_REQUEST[self::QS_PARAMS]; } if (!$req_params) { return false; } $unencrypted = base64_decode($req_params); if ($unencrypted === false) { return false; } Debug2::debug2('[ESI] params', $unencrypted); // $unencoded = urldecode($unencrypted); no need to do this as $_GET is already parsed $params = \json_decode($unencrypted, true); return $params; } /** * Select the correct esi output based on the parameters in an ESI request. * * @since 1.1.3 * @access public */ public function load_esi_block() { /** * Validate if is a legal ESI req * * @since 2.9.6 */ if (empty($_GET['_hash']) || $this->_gen_esi_md5($_GET) != $_GET['_hash']) { Debug2::debug('[ESI] ❌ Failed to validate _hash'); return; } $params = $this->_parse_esi_param(); if (defined('LSCWP_LOG')) { $logInfo = '[ESI] ⭕ '; if (!empty($params[self::PARAM_NAME])) { $logInfo .= ' Name: ' . $params[self::PARAM_NAME] . ' ----- '; } $logInfo .= ' [ID] ' . LSCACHE_IS_ESI; Debug2::debug($logInfo); } if (!empty($params['_ls_silence'])) { !defined('LSCACHE_ESI_SILENCE') && define('LSCACHE_ESI_SILENCE', true); } /** * Buffer needs to be JSON format * * @since 2.9.4 */ if (!empty($params['is_json'])) { add_filter('litespeed_is_json', '__return_true'); } Tag::add(rtrim(Tag::TYPE_ESI, '.')); Tag::add(Tag::TYPE_ESI . LSCACHE_IS_ESI); // Debug2::debug(var_export($params, true )); /** * Handle default cache control 'private,no-vary' for sub_esi_block() @ticket #923505 * * @since 2.2.3 */ if (!empty($_GET['_control'])) { $control = explode(',', $_GET['_control']); if (in_array('private', $control)) { Control::set_private(); } if (in_array('no-vary', $control)) { Control::set_no_vary(); } } do_action('litespeed_esi_load-' . LSCACHE_IS_ESI, $params); } // The *_sub_* functions are helpers for the sub_* functions. // The *_load_* functions are helpers for the load_* functions. /** * Loads the default options for default WordPress widgets. * * @since 1.1.3 * @access public */ public static function widget_default_options( $options, $widget ) { if (!is_array($options)) { return $options; } $widget_name = get_class($widget); switch ($widget_name) { case 'WP_Widget_Recent_Posts': case 'WP_Widget_Recent_Comments': $options[self::WIDGET_O_ESIENABLE] = Base::VAL_OFF; $options[self::WIDGET_O_TTL] = 86400; break; default: break; } return $options; } /** * Hooked to the widget_display_callback filter. * If the admin configured the widget to display via esi, this function * will set up the esi request and cancel the widget display. * * @since 1.1.3 * @access public * @param array $instance Parameter used to build the widget. * @param \WP_Widget $widget The widget to build. * @param array $args Parameter used to build the widget. * @return mixed Return false if display through esi, instance otherwise. */ public function sub_widget_block( $instance, $widget, $args ) { // #210407 if (!is_array($instance)) { return $instance; } $name = get_class($widget); if (!isset($instance[Base::OPTION_NAME])) { return $instance; } $options = $instance[Base::OPTION_NAME]; if (!isset($options) || !$options[self::WIDGET_O_ESIENABLE]) { defined('LSCWP_LOG') && Debug2::debug('ESI 0 ' . $name . ': ' . (!isset($options) ? 'not set' : 'set off')); return $instance; } $esi_private = $options[self::WIDGET_O_ESIENABLE] == Base::VAL_ON2 ? 'private,' : ''; $params = array( self::PARAM_NAME => $name, self::PARAM_ID => $widget->id, self::PARAM_INSTANCE => $instance, self::PARAM_ARGS => $args, ); echo $this->sub_esi_block('widget', 'widget ' . $name, $params, $esi_private . 'no-vary'); return false; } /** * Hooked to the wp_footer action. * Sets up the ESI request for the admin bar. * * @access public * @since 1.1.3 * @global type $wp_admin_bar */ public function sub_admin_bar_block() { global $wp_admin_bar; if (!is_admin_bar_showing() || !is_object($wp_admin_bar)) { return; } // To make each admin bar ESI request different for `Edit` button different link $params = array( 'ref' => $_SERVER['REQUEST_URI'], ); echo $this->sub_esi_block('admin-bar', 'adminbar', $params); } /** * Parses the esi input parameters and generates the widget for esi display. * * @access public * @since 1.1.3 * @global $wp_widget_factory * @param array $params Input parameters needed to correctly display widget */ public function load_widget_block( $params ) { // global $wp_widget_factory; // $widget = $wp_widget_factory->widgets[ $params[ self::PARAM_NAME ] ]; $option = $params[self::PARAM_INSTANCE]; $option = $option[Base::OPTION_NAME]; // Since we only reach here via esi, safe to assume setting exists. $ttl = $option[self::WIDGET_O_TTL]; defined('LSCWP_LOG') && Debug2::debug('ESI widget render: name ' . $params[self::PARAM_NAME] . ', id ' . $params[self::PARAM_ID] . ', ttl ' . $ttl); if ($ttl == 0) { Control::set_nocache('ESI Widget time to live set to 0'); } else { Control::set_custom_ttl($ttl); if ($option[self::WIDGET_O_ESIENABLE] == Base::VAL_ON2) { Control::set_private(); } Control::set_no_vary(); Tag::add(Tag::TYPE_WIDGET . $params[self::PARAM_ID]); } the_widget($params[self::PARAM_NAME], $params[self::PARAM_INSTANCE], $params[self::PARAM_ARGS]); } /** * Generates the admin bar for esi display. * * @access public * @since 1.1.3 */ public function load_admin_bar_block( $params ) { global $wp_the_query; if (!empty($params['ref'])) { $ref_qs = parse_url($params['ref'], PHP_URL_QUERY); if (!empty($ref_qs)) { parse_str($ref_qs, $ref_qs_arr); if (!empty($ref_qs_arr)) { foreach ($ref_qs_arr as $k => $v) { $_GET[$k] = $v; } } } } // Needed when permalink structure is "Plain" if (!isset($wp_the_query)) { wp(); } wp_admin_bar_render(); if (!$this->conf(Base::O_ESI_CACHE_ADMBAR)) { Control::set_nocache('build-in set to not cacheable'); } else { Control::set_private(); Control::set_no_vary(); } defined('LSCWP_LOG') && Debug2::debug('ESI: adminbar ref: ' . $_SERVER['REQUEST_URI']); } /** * Parses the esi input parameters and generates the comment form for esi display. * * @access public * @since 1.1.3 * @param array $params Input parameters needed to correctly display comment form */ public function load_comment_form_block( $params ) { comment_form($params[self::PARAM_ARGS], $params[self::PARAM_ID]); if (!$this->conf(Base::O_ESI_CACHE_COMMFORM)) { Control::set_nocache('build-in set to not cacheable'); } else { // by default comment form is public if (Vary::has_vary()) { Control::set_private(); Control::set_no_vary(); } } } /** * Generate nonce for certain action * * @access public * @since 2.6 */ public function load_nonce_block( $params ) { $action = $params['action']; Debug2::debug('[ESI] load_nonce_block [action] ' . $action); // set nonce TTL to half day Control::set_custom_ttl(43200); if (Router::is_logged_in()) { Control::set_private(); } if (function_exists('wp_create_nonce_litespeed_esi')) { echo wp_create_nonce_litespeed_esi($action); } else { echo wp_create_nonce($action); } } /** * Show original shortcode * * @access public * @since 2.8 */ public function load_esi_shortcode( $params ) { if (isset($params['ttl'])) { if (!$params['ttl']) { Control::set_nocache('ESI shortcode att ttl=0'); } else { Control::set_custom_ttl($params['ttl']); } unset($params['ttl']); } // Replace to original shortcode $shortcode = $params[0]; $atts_ori = array(); foreach ($params as $k => $v) { if ($k === 0) { continue; } $atts_ori[] = is_string($k) ? "$k='" . addslashes($v) . "'" : $v; } Tag::add(Tag::TYPE_ESI . "esi.$shortcode"); // Output original shortcode final content echo do_shortcode("[$shortcode " . implode(' ', $atts_ori) . ' ]'); } /** * Hooked to the comment_form_defaults filter. * Stores the default comment form settings. * If sub_comment_form_block is triggered, the output buffer is cleared and an esi block is added. The remaining comment form is also buffered and cleared. * Else there is no need to make the comment form ESI. * * @since 1.1.3 * @access public */ public function register_comment_form_actions( $defaults ) { $this->esi_args = $defaults; echo GUI::clean_wrapper_begin(); add_filter('comment_form_submit_button', array( $this, 'sub_comment_form_btn' ), 1000, 2); // To save the params passed in add_action('comment_form', array( $this, 'sub_comment_form_block' ), 1000); return $defaults; } /** * Store the args passed in comment_form for the ESI comment param usage in `$this->sub_comment_form_block()` * * @since 3.4 * @access public */ public function sub_comment_form_btn( $unused, $args ) { if (empty($args) || empty($this->esi_args)) { Debug2::debug('comment form args empty?'); return $unused; } $esi_args = array(); // compare current args with default ones foreach ($args as $k => $v) { if (!isset($this->esi_args[$k])) { $esi_args[$k] = $v; } elseif (is_array($v)) { $diff = array_diff_assoc($v, $this->esi_args[$k]); if (!empty($diff)) { $esi_args[$k] = $diff; } } elseif ($v !== $this->esi_args[$k]) { $esi_args[$k] = $v; } } $this->esi_args = $esi_args; return $unused; } /** * Hooked to the comment_form_submit_button filter. * * This method will compare the used comment form args against the default args. The difference will be passed to the esi request. * * @access public * @since 1.1.3 */ public function sub_comment_form_block( $post_id ) { echo GUI::clean_wrapper_end(); $params = array( self::PARAM_ID => $post_id, self::PARAM_ARGS => $this->esi_args, ); echo $this->sub_esi_block('comment-form', 'comment form', $params); echo GUI::clean_wrapper_begin(); add_action('comment_form_after', array( $this, 'comment_form_sub_clean' )); } /** * Hooked to the comment_form_after action. * Cleans up the remaining comment form output. * * @since 1.1.3 * @access public */ public function comment_form_sub_clean() { echo GUI::clean_wrapper_end(); } /** * Replace preserved blocks * * @since 2.6 * @access public */ public function finalize( $buffer ) { // Prepend combo esi block if (self::$_combine_ids) { Debug2::debug('[ESI] 🍔 Enabled combo'); $esi_block = $this->sub_esi_block(self::COMBO, '__COMBINE_MAIN__', array(), 'no-cache', true); $buffer = $esi_block . $buffer; } // Bypass if no preserved list to be replaced if (!$this->_esi_preserve_list) { return $buffer; } $keys = array_keys($this->_esi_preserve_list); Debug2::debug('[ESI] replacing preserved blocks', $keys); $buffer = str_replace($keys, $this->_esi_preserve_list, $buffer); return $buffer; } /** * Check if the content contains preserved list or not * * @since 3.3 */ public function contain_preserve_esi( $content ) { $hit_list = array(); foreach ($this->_esi_preserve_list as $k => $v) { if (strpos($content, '"' . $k . '"') !== false) { $hit_list[] = '"' . $k . '"'; } if (strpos($content, "'" . $k . "'") !== false) { $hit_list[] = "'" . $k . "'"; } } return $hit_list; } } src/optimize.cls.php 0000777 00000115541 15251157102 0010501 0 ustar 00 <?php // phpcs:ignoreFile /** * The optimize class. * * @since 1.2.2 */ namespace LiteSpeed; defined('WPINC') || exit(); class Optimize extends Base { const LOG_TAG = '🎢'; const LIB_FILE_CSS_ASYNC = 'assets/js/css_async.min.js'; const LIB_FILE_WEBFONTLOADER = 'assets/js/webfontloader.min.js'; const LIB_FILE_JS_DELAY = 'assets/js/js_delay.min.js'; const ITEM_TIMESTAMP_PURGE_CSS = 'timestamp_purge_css'; const DUMMY_CSS_REGEX = "#<link [ \w='\"/]*id=['\"]litespeed-cache-dummy-css['\"] href=['\"].+assets/css/litespeed-dummy\.css[?\w.=-]*['\"][ \w='\"/]*>#isU"; private $content; private $content_ori; private $cfg_css_min; private $cfg_css_comb; private $cfg_js_min; private $cfg_js_comb; private $cfg_css_async; private $cfg_js_delay_inc = array(); private $cfg_js_defer; private $cfg_js_defer_exc = false; private $cfg_ggfonts_async; private $_conf_css_font_display; private $cfg_ggfonts_rm; private $dns_prefetch; private $dns_preconnect; private $_ggfonts_urls = array(); private $_ccss; private $_ucss = false; private $__optimizer; private $html_foot = ''; // The html info append to <body> private $html_head = ''; // The html info append to <head> private $html_head_early = ''; // The html info prepend to top of head private static $_var_i = 0; private $_var_preserve_js = array(); private $_request_url; /** * Constructor * * @since 4.0 */ public function __construct() { self::debug('init'); $this->__optimizer = $this->cls('Optimizer'); } /** * Init optimizer * * @since 3.0 * @access protected */ public function init() { $this->cfg_css_async = defined('LITESPEED_GUEST_OPTM') || $this->conf(self::O_OPTM_CSS_ASYNC); if ($this->cfg_css_async) { if (!$this->cls('Cloud')->activated()) { self::debug('❌ CCSS set to OFF due to QC not activated'); $this->cfg_css_async = false; } if ((defined('LITESPEED_GUEST_OPTM') || ($this->conf(self::O_OPTM_UCSS) && $this->conf(self::O_OPTM_CSS_COMB))) && $this->conf(self::O_OPTM_UCSS_INLINE)) { self::debug('⚠️ CCSS set to OFF due to UCSS Inline'); $this->cfg_css_async = false; } } $this->cfg_js_defer = $this->conf(self::O_OPTM_JS_DEFER); if (defined('LITESPEED_GUEST_OPTM')) { $this->cfg_js_defer = 2; } if ($this->cfg_js_defer == 2) { add_filter( 'litespeed_optm_cssjs', function ( $con, $file_type ) { if ($file_type == 'js') { $con = str_replace('DOMContentLoaded', 'DOMContentLiteSpeedLoaded', $con); // $con = str_replace( 'addEventListener("load"', 'addEventListener("litespeedLoad"', $con ); } return $con; }, 20, 2 ); } // To remove emoji from WP if ($this->conf(self::O_OPTM_EMOJI_RM)) { $this->_emoji_rm(); } if ($this->conf(self::O_OPTM_QS_RM)) { add_filter('style_loader_src', array( $this, 'remove_query_strings' ), 999); add_filter('script_loader_src', array( $this, 'remove_query_strings' ), 999); } // GM JS exclude @since 4.1 if (defined('LITESPEED_GUEST_OPTM')) { $this->cfg_js_defer_exc = apply_filters('litespeed_optm_gm_js_exc', $this->conf(self::O_OPTM_GM_JS_EXC)); } else { /** * Exclude js from deferred setting * * @since 1.5 */ if ($this->cfg_js_defer) { add_filter('litespeed_optm_js_defer_exc', array( $this->cls('Data'), 'load_js_defer_exc' )); $this->cfg_js_defer_exc = apply_filters('litespeed_optm_js_defer_exc', $this->conf(self::O_OPTM_JS_DEFER_EXC)); $this->cfg_js_delay_inc = apply_filters('litespeed_optm_js_delay_inc', $this->conf(self::O_OPTM_JS_DELAY_INC)); } } // Add vary filter for Role Excludes @since 1.6 add_filter('litespeed_vary', array( $this, 'vary_add_role_exclude' )); // DNS optm (Prefetch/Preconnect) @since 7.3 $this->_dns_optm_init(); add_filter('litespeed_buffer_finalize', array( $this, 'finalize' ), 20); // Inject a dummy CSS file to control final optimized data location in <head> wp_enqueue_style(Core::PLUGIN_NAME . '-dummy', LSWCP_PLUGIN_URL . 'assets/css/litespeed-dummy.css'); } /** * Exclude role from optimization filter * * @since 1.6 * @access public */ public function vary_add_role_exclude( $vary ) { if ($this->cls('Conf')->in_optm_exc_roles()) { $vary['role_exclude_optm'] = 1; } return $vary; } /** * Remove emoji from WP * * @since 1.4 * @since 2.9.8 Changed to private * @access private */ private function _emoji_rm() { remove_action('wp_head', 'print_emoji_detection_script', 7); remove_action('admin_print_scripts', 'print_emoji_detection_script'); remove_filter('the_content_feed', 'wp_staticize_emoji'); remove_filter('comment_text_rss', 'wp_staticize_emoji'); /** * Added for better result * * @since 1.6.2.1 */ remove_action('wp_print_styles', 'print_emoji_styles'); remove_action('admin_print_styles', 'print_emoji_styles'); remove_filter('wp_mail', 'wp_staticize_emoji_for_email'); } /** * Delete file-based cache folder * * @since 2.1 * @access public */ public function rm_cache_folder( $subsite_id = false ) { if ($subsite_id) { file_exists(LITESPEED_STATIC_DIR . '/css/' . $subsite_id) && File::rrmdir(LITESPEED_STATIC_DIR . '/css/' . $subsite_id); file_exists(LITESPEED_STATIC_DIR . '/js/' . $subsite_id) && File::rrmdir(LITESPEED_STATIC_DIR . '/js/' . $subsite_id); return; } file_exists(LITESPEED_STATIC_DIR . '/css') && File::rrmdir(LITESPEED_STATIC_DIR . '/css'); file_exists(LITESPEED_STATIC_DIR . '/js') && File::rrmdir(LITESPEED_STATIC_DIR . '/js'); } /** * Remove QS * * @since 1.3 * @access public */ public function remove_query_strings( $src ) { if (strpos($src, '_litespeed_rm_qs=0') || strpos($src, '/recaptcha')) { return $src; } if (!Utility::is_internal_file($src)) { return $src; } if (strpos($src, '.js?') !== false || strpos($src, '.css?') !== false) { $src = preg_replace('/\?.*/', '', $src); } return $src; } /** * Run optimize process * NOTE: As this is after cache finalized, can NOT set any cache control anymore * * @since 1.2.2 * @access public * @return string The content that is after optimization */ public function finalize( $content ) { $content = $this->_finalize($content); // Fallback to replace dummy css placeholder if (false !== preg_match(self::DUMMY_CSS_REGEX, $content)) { self::debug('Fallback to drop dummy CSS'); $content = preg_replace( self::DUMMY_CSS_REGEX, '', $content ); } return $content; } private function _finalize( $content ) { if (defined('LITESPEED_NO_PAGEOPTM')) { self::debug2('bypass: NO_PAGEOPTM const'); return $content; } if (!defined('LITESPEED_IS_HTML')) { self::debug('bypass: Not frontend HTML type'); return $content; } if (!defined('LITESPEED_GUEST_OPTM')) { if (!Control::is_cacheable()) { self::debug('bypass: Not cacheable'); return $content; } // Check if hit URI excludes add_filter('litespeed_optm_uri_exc', array( $this->cls('Data'), 'load_optm_uri_exc' )); $excludes = apply_filters('litespeed_optm_uri_exc', $this->conf(self::O_OPTM_EXC)); $result = Utility::str_hit_array($_SERVER['REQUEST_URI'], $excludes); if ($result) { self::debug('bypass: hit URI Excludes setting: ' . $result); return $content; } } self::debug('start'); $this->content_ori = $this->content = $content; $this->_optimize(); return $this->content; } /** * Optimize css src * * @since 1.2.2 * @access private */ private function _optimize() { global $wp; // get current request url $permalink_structure = get_option( 'permalink_structure' ); if ( ! empty( $permalink_structure ) ) { $this->_request_url = trailingslashit( home_url( $wp->request ) ); } else { $qs_add = $wp->query_string ? '?' . (string) $wp->query_string : '' ; $this->_request_url = home_url( $wp->request ) . $qs_add; } $this->cfg_css_min = defined('LITESPEED_GUEST_OPTM') || $this->conf(self::O_OPTM_CSS_MIN); $this->cfg_css_comb = defined('LITESPEED_GUEST_OPTM') || $this->conf(self::O_OPTM_CSS_COMB); $this->cfg_js_min = defined('LITESPEED_GUEST_OPTM') || $this->conf(self::O_OPTM_JS_MIN); $this->cfg_js_comb = defined('LITESPEED_GUEST_OPTM') || $this->conf(self::O_OPTM_JS_COMB); $this->cfg_ggfonts_rm = defined('LITESPEED_GUEST_OPTM') || $this->conf(self::O_OPTM_GGFONTS_RM); $this->cfg_ggfonts_async = !defined('LITESPEED_GUEST_OPTM') && $this->conf(self::O_OPTM_GGFONTS_ASYNC); // forced rm already $this->_conf_css_font_display = !defined('LITESPEED_GUEST_OPTM') && $this->conf(self::O_OPTM_CSS_FONT_DISPLAY); if (!$this->cls('Router')->can_optm()) { self::debug('bypass: admin/feed/preview'); return; } if ($this->cfg_css_async) { $this->_ccss = $this->cls('CSS')->prepare_ccss(); if (!$this->_ccss) { self::debug('❌ CCSS set to OFF due to CCSS not generated yet'); $this->cfg_css_async = false; } elseif (strpos($this->_ccss, '<style id="litespeed-ccss" data-error') === 0) { self::debug('❌ CCSS set to OFF due to CCSS failed to generate'); $this->cfg_css_async = false; } } do_action('litespeed_optm'); // Parse css from content $src_list = false; if ($this->cfg_css_min || $this->cfg_css_comb || $this->cfg_ggfonts_rm || $this->cfg_css_async || $this->cfg_ggfonts_async || $this->_conf_css_font_display) { add_filter('litespeed_optimize_css_excludes', array( $this->cls('Data'), 'load_css_exc' )); list($src_list, $html_list) = $this->_parse_css(); } // css optimizer if ($this->cfg_css_min || $this->cfg_css_comb) { if ($src_list) { // IF combine if ($this->cfg_css_comb) { // Check if has inline UCSS enabled or not if ((defined('LITESPEED_GUEST_OPTM') || $this->conf(self::O_OPTM_UCSS)) && $this->conf(self::O_OPTM_UCSS_INLINE)) { $filename = $this->cls('UCSS')->load($this->_request_url, true); if ($filename) { $filepath_prefix = $this->_build_filepath_prefix('ucss'); $this->_ucss = File::read(LITESPEED_STATIC_DIR . $filepath_prefix . $filename); // Drop all css $this->content = str_replace($html_list, '', $this->content); } } if (!$this->_ucss) { $url = $this->_build_hash_url($src_list); if ($url) { // Handle css async load if ($this->cfg_css_async) { $this->html_head .= '<link rel="preload" data-asynced="1" data-optimized="2" as="style" onload="this.onload=null;this.rel=\'stylesheet\'" href="' . Str::trim_quotes($url) . '" />'; // todo: How to use " in attr wrapper " } else { $this->html_head .= '<link data-optimized="2" rel="stylesheet" href="' . Str::trim_quotes($url) . '" />'; // use 2 as combined } // Move all css to top $this->content = str_replace($html_list, '', $this->content); } } } // Only minify elseif ($this->cfg_css_min) { // will handle async css load inside $this->_src_queue_handler($src_list, $html_list); } // Only HTTP2 push else { foreach ($src_list as $src_info) { if (!empty($src_info['inl'])) { continue; } } } } } // Handle css lazy load if not handled async loaded yet if ($this->cfg_css_async && !$this->cfg_css_min && !$this->cfg_css_comb) { // async html $html_list_async = $this->_async_css_list($html_list, $src_list); // Replace async css $this->content = str_replace($html_list, $html_list_async, $this->content); } // Parse js from buffer as needed $src_list = false; if ($this->cfg_js_min || $this->cfg_js_comb || $this->cfg_js_defer || $this->cfg_js_delay_inc) { add_filter('litespeed_optimize_js_excludes', array( $this->cls('Data'), 'load_js_exc' )); list($src_list, $html_list) = $this->_parse_js(); } // js optimizer if ($src_list) { // IF combine if ($this->cfg_js_comb) { $url = $this->_build_hash_url($src_list, 'js'); if ($url) { $this->html_foot .= $this->_build_js_tag($url); // Will move all JS to bottom combined one $this->content = str_replace($html_list, '', $this->content); } } // Only minify elseif ($this->cfg_js_min) { // Will handle js defer inside $this->_src_queue_handler($src_list, $html_list, 'js'); } // Only HTTP2 push and Defer else { foreach ($src_list as $k => $src_info) { // Inline JS if (!empty($src_info['inl'])) { if ($this->cfg_js_defer) { $attrs = !empty($src_info['attrs']) ? $src_info['attrs'] : ''; $deferred = $this->_js_inline_defer($src_info['src'], $attrs); if ($deferred) { $this->content = str_replace($html_list[$k], $deferred, $this->content); } } } // JS files elseif ($this->cfg_js_defer) { $deferred = $this->_js_defer($html_list[$k], $src_info['src']); if ($deferred) { $this->content = str_replace($html_list[$k], $deferred, $this->content); } } elseif ($this->cfg_js_delay_inc) { $deferred = $this->_js_delay($html_list[$k], $src_info['src']); if ($deferred) { $this->content = str_replace($html_list[$k], $deferred, $this->content); } } } } } // Append JS inline var for preserved ESI // Shouldn't give any optm (defer/delay) @since 4.4 if ($this->_var_preserve_js) { $this->html_head .= '<script>var ' . implode(',', $this->_var_preserve_js) . ';</script>'; self::debug2('Inline JS defer vars', $this->_var_preserve_js); } // Append async compatibility lib to head if ($this->cfg_css_async) { // Inline css async lib if ($this->conf(self::O_OPTM_CSS_ASYNC_INLINE)) { $this->html_head .= $this->_build_js_inline(File::read(LSCWP_DIR . self::LIB_FILE_CSS_ASYNC), true); } else { $css_async_lib_url = LSWCP_PLUGIN_URL . self::LIB_FILE_CSS_ASYNC; $this->html_head .= $this->_build_js_tag($css_async_lib_url); // Don't exclude it from defer for now } } /** * Handle google fonts async * This will result in a JS snippet in head, so need to put it in the end to avoid being replaced by JS parser */ $this->_async_ggfonts(); /** * Font display optm * * @since 3.0 */ $this->_font_optm(); // Inject JS Delay lib $this->_maybe_js_delay(); /** * HTML Lazyload */ if ($this->conf(self::O_OPTM_HTML_LAZY)) { $this->html_head = $this->cls('CSS')->prepare_html_lazy() . $this->html_head; } // Maybe prepend inline UCSS if ($this->_ucss) { $this->html_head = '<style id="litespeed-ucss">' . $this->_ucss . '</style>' . $this->html_head; } // Check if there is any critical css rules setting if ($this->cfg_css_async && $this->_ccss) { $this->html_head = $this->_ccss . $this->html_head; } // Replace html head part $this->html_head_early = apply_filters('litespeed_optm_html_head_early', $this->html_head_early); if ($this->html_head_early) { // Put header content to be after charset if (false !== strpos($this->content, '<meta charset')) { self::debug('Put early optm data to be after <meta charset>'); $this->content = preg_replace('#<meta charset([^>]*)>#isU', '<meta charset$1>' . $this->html_head_early, $this->content, 1); } else { self::debug('Put early optm data to be right after <head>'); $this->content = preg_replace('#<head([^>]*)>#isU', '<head$1>' . $this->html_head_early, $this->content, 1); } } $this->html_head = apply_filters('litespeed_optm_html_head', $this->html_head); if ($this->html_head) { if (apply_filters('litespeed_optm_html_after_head', false)) { $this->content = str_replace('</head>', $this->html_head . '</head>', $this->content); } else { // Put header content to dummy css position if (false !== preg_match(self::DUMMY_CSS_REGEX, $this->content)) { self::debug('Put optm data to dummy css location'); $this->content = preg_replace( self::DUMMY_CSS_REGEX, $this->html_head, $this->content ); } // Fallback: try to be after charset elseif (strpos($this->content, '<meta charset') !== false) { self::debug('Put optm data to be after <meta charset>'); $this->content = preg_replace('#<meta charset([^>]*)>#isU', '<meta charset$1>' . $this->html_head, $this->content, 1); } else { self::debug('Put optm data to be after <head>'); $this->content = preg_replace('#<head([^>]*)>#isU', '<head$1>' . $this->html_head, $this->content, 1); } } } // Replace html foot part $this->html_foot = apply_filters('litespeed_optm_html_foot', $this->html_foot); if ($this->html_foot) { $this->content = str_replace('</body>', $this->html_foot . '</body>', $this->content); } // Drop noscript if enabled if ($this->conf(self::O_OPTM_NOSCRIPT_RM)) { // $this->content = preg_replace( '#<noscript>.*</noscript>#isU', '', $this->content ); } // HTML minify if (defined('LITESPEED_GUEST_OPTM') || $this->conf(self::O_OPTM_HTML_MIN)) { $this->content = $this->__optimizer->html_min($this->content); } } /** * Build a full JS tag * * @since 4.0 */ private function _build_js_tag( $src ) { if ($this->cfg_js_defer === 2 || Utility::str_hit_array($src, $this->cfg_js_delay_inc)) { return '<script data-optimized="1" type="litespeed/javascript" data-src="' . Str::trim_quotes($src) . '"></script>'; } if ($this->cfg_js_defer) { return '<script data-optimized="1" src="' . Str::trim_quotes($src) . '" defer></script>'; } return '<script data-optimized="1" src="' . Str::trim_quotes($src) . '"></script>'; } /** * Build a full inline JS snippet * * @since 4.0 */ private function _build_js_inline( $script, $minified = false ) { if ($this->cfg_js_defer) { $deferred = $this->_js_inline_defer($script, false, $minified); if ($deferred) { return $deferred; } } return '<script>' . $script . '</script>'; } /** * Load JS delay lib * * @since 4.0 */ private function _maybe_js_delay() { if ($this->cfg_js_defer !== 2 && !$this->cfg_js_delay_inc) { return; } if (!defined('LITESPEED_JS_DELAY_LIB_LOADED')) { define('LITESPEED_JS_DELAY_LIB_LOADED', true); $this->html_foot .= '<script>' . File::read(LSCWP_DIR . self::LIB_FILE_JS_DELAY) . '</script>'; } } /** * Google font async * * @since 2.7.3 * @access private */ private function _async_ggfonts() { if (!$this->cfg_ggfonts_async || !$this->_ggfonts_urls) { return; } self::debug2('google fonts async found: ', $this->_ggfonts_urls); $this->html_head_early .= '<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin />'; /** * Append fonts * * Could be multiple fonts * * <link rel='stylesheet' href='//fonts.googleapis.com/css?family=Open+Sans%3A400%2C600%2C700%2C800%2C300&ver=4.9.8' type='text/css' media='all' /> * <link rel='stylesheet' href='//fonts.googleapis.com/css?family=PT+Sans%3A400%2C700%7CPT+Sans+Narrow%3A400%7CMontserrat%3A600&subset=latin&ver=4.9.8' type='text/css' media='all' /> * -> family: PT Sans:400,700|PT Sans Narrow:400|Montserrat:600 * <link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,300,300italic,400italic,600,700,900&subset=latin%2Clatin-ext' /> */ $script = 'WebFontConfig={google:{families:['; $families = array(); foreach ($this->_ggfonts_urls as $v) { $qs = wp_specialchars_decode($v); $qs = urldecode($qs); $qs = parse_url($qs, PHP_URL_QUERY); parse_str($qs, $qs); if (empty($qs['family'])) { self::debug('ERR ggfonts failed to find family: ' . $v); continue; } $subset = empty($qs['subset']) ? '' : ':' . $qs['subset']; foreach (array_filter(explode('|', $qs['family'])) as $v2) { $families[] = Str::trim_quotes($v2 . $subset); } } $script .= '"' . implode('","', $families) . ($this->_conf_css_font_display ? '&display=swap' : '') . '"'; $script .= ']}};'; // if webfontloader lib was loaded before WebFontConfig variable, call WebFont.load $script .= 'if ( typeof WebFont === "object" && typeof WebFont.load === "function" ) { WebFont.load( WebFontConfig ); }'; $html = $this->_build_js_inline($script); // https://cdnjs.cloudflare.com/ajax/libs/webfont/1.6.28/webfontloader.js $webfont_lib_url = LSWCP_PLUGIN_URL . self::LIB_FILE_WEBFONTLOADER; // default async, if js defer set use defer $html .= $this->_build_js_tag($webfont_lib_url); // Put this in the very beginning for preconnect $this->html_head = $html . $this->html_head; } /** * Font optm * * @since 3.0 * @access private */ private function _font_optm() { if (!$this->_conf_css_font_display || !$this->_ggfonts_urls) { return; } self::debug2('google fonts optm ', $this->_ggfonts_urls); foreach ($this->_ggfonts_urls as $v) { if (strpos($v, 'display=')) { continue; } $this->html_head = str_replace($v, $v . '&display=swap', $this->html_head); $this->html_foot = str_replace($v, $v . '&display=swap', $this->html_foot); $this->content = str_replace($v, $v . '&display=swap', $this->content); } } /** * Prefetch DNS * * @since 1.7.1 DNS prefetch * @since 5.6.1 DNS preconnect * @access private */ private function _dns_optm_init() { // Widely enable link DNS prefetch if (defined('LITESPEED_GUEST_OPTM') || $this->conf(self::O_OPTM_DNS_PREFETCH_CTRL)) { @header('X-DNS-Prefetch-Control: on'); } $this->dns_prefetch = $this->conf(self::O_OPTM_DNS_PREFETCH); $this->dns_preconnect = $this->conf(self::O_OPTM_DNS_PRECONNECT); if (!$this->dns_prefetch && !$this->dns_preconnect) { return; } if (function_exists('wp_resource_hints')) { add_filter('wp_resource_hints', array( $this, 'dns_optm_filter' ), 10, 2); } else { add_action('litespeed_optm', array( $this, 'dns_optm_output' )); } } /** * DNS optm hook for WP * * @since 1.7.1 * @access public */ public function dns_optm_filter( $urls, $relation_type ) { if ('dns-prefetch' === $relation_type) { foreach ($this->dns_prefetch as $v) { if ($v) { $urls[] = $v; } } } if ('preconnect' === $relation_type) { foreach ($this->dns_preconnect as $v) { if ($v) { $urls[] = $v; } } } return $urls; } /** * DNS optm output directly * * @since 1.7.1 DNS prefetch * @since 5.6.1 DNS preconnect * @access public */ public function dns_optm_output() { foreach ($this->dns_prefetch as $v) { if ($v) { $this->html_head_early .= '<link rel="dns-prefetch" href="' . Str::trim_quotes($v) . '" />'; } } foreach ($this->dns_preconnect as $v) { if ($v) { $this->html_head_early .= '<link rel="preconnect" href="' . Str::trim_quotes($v) . '" crossorigin />'; } } } /** * Run minify with src queue list * * @since 1.2.2 * @access private */ private function _src_queue_handler( $src_list, $html_list, $file_type = 'css' ) { $html_list_ori = $html_list; $can_webp = $this->cls('Media')->webp_support(); $tag = $file_type == 'css' ? 'link' : 'script'; foreach ($src_list as $key => $src_info) { // Minify inline CSS/JS if (!empty($src_info['inl'])) { if ($file_type == 'css') { $code = Optimizer::minify_css($src_info['src']); $can_webp && ($code = $this->cls('Media')->replace_background_webp($code)); $snippet = str_replace($src_info['src'], $code, $html_list[$key]); } else { // Inline defer JS if ($this->cfg_js_defer) { $attrs = !empty($src_info['attrs']) ? $src_info['attrs'] : ''; $snippet = $this->_js_inline_defer($src_info['src'], $attrs) ?: $html_list[$key]; } else { $code = Optimizer::minify_js($src_info['src']); $snippet = str_replace($src_info['src'], $code, $html_list[$key]); } } } // CSS/JS files else { $url = $this->_build_single_hash_url($src_info['src'], $file_type); if ($url) { $snippet = str_replace($src_info['src'], $url, $html_list[$key]); } // Handle css async load if ($file_type == 'css' && $this->cfg_css_async) { $snippet = $this->_async_css($snippet); } // Handle js defer if ($file_type === 'js' && $this->cfg_js_defer) { $snippet = $this->_js_defer($snippet, $src_info['src']) ?: $snippet; } } $snippet = str_replace("<$tag ", '<' . $tag . ' data-optimized="1" ', $snippet); $html_list[$key] = $snippet; } $this->content = str_replace($html_list_ori, $html_list, $this->content); } /** * Build a single URL mapped filename (This will not save in DB) * * @since 4.0 */ private function _build_single_hash_url( $src, $file_type = 'css' ) { $content = $this->__optimizer->load_file($src, $file_type); $is_min = $this->__optimizer->is_min($src); $content = $this->__optimizer->optm_snippet($content, $file_type, !$is_min, $src); $filepath_prefix = $this->_build_filepath_prefix($file_type); // Save to file $filename = $filepath_prefix . md5($this->remove_query_strings($src)) . '.' . $file_type; $static_file = LITESPEED_STATIC_DIR . $filename; File::save($static_file, $content, true); // QS is required as $src may contains version info $qs_hash = substr(md5($src), -5); return LITESPEED_STATIC_URL . "$filename?ver=$qs_hash"; } /** * Generate full URL path with hash for a list of src * * @since 1.2.2 * @access private */ private function _build_hash_url( $src_list, $file_type = 'css' ) { // $url_sensitive = $this->conf( self::O_OPTM_CSS_UNIQUE ) && $file_type == 'css'; // If need to keep unique CSS per URI // Replace preserved ESI (before generating hash) if ($file_type == 'js') { foreach ($src_list as $k => $v) { if (empty($v['inl'])) { continue; } $src_list[$k]['src'] = $this->_preserve_esi($v['src']); } } $minify = $file_type === 'css' ? $this->cfg_css_min : $this->cfg_js_min; $filename_info = $this->__optimizer->serve($this->_request_url, $file_type, $minify, $src_list); if (!$filename_info) { return false; // Failed to generate } list($filename, $type) = $filename_info; // Add cache tag in case later file deleted to avoid lscache served stale non-existed files @since 4.4.1 Tag::add(Tag::TYPE_MIN . '.' . $filename); $qs_hash = substr(md5(self::get_option(self::ITEM_TIMESTAMP_PURGE_CSS)), -5); // As filename is already related to filecon md5, no need QS anymore $filepath_prefix = $this->_build_filepath_prefix($type); return LITESPEED_STATIC_URL . $filepath_prefix . $filename . '?ver=' . $qs_hash; } /** * Parse js src * * @since 1.2.2 * @access private */ private function _parse_js() { $excludes = apply_filters('litespeed_optimize_js_excludes', $this->conf(self::O_OPTM_JS_EXC)); $combine_ext_inl = $this->conf(self::O_OPTM_JS_COMB_EXT_INL); if (!apply_filters('litespeed_optm_js_comb_ext_inl', true)) { self::debug2('js_comb_ext_inl bypassed via litespeed_optm_js_comb_ext_inl filter'); $combine_ext_inl = false; } $src_list = array(); $html_list = array(); // V7 added: (?:\r\n?|\n?) to fix replacement leaving empty new line $content = preg_replace('#<!--.*-->(?:\r\n?|\n?)#sU', '', $this->content); preg_match_all('#<script([^>]*)>(.*)</script>(?:\r\n?|\n?)#isU', $content, $matches, PREG_SET_ORDER); foreach ($matches as $match) { $attrs = empty($match[1]) ? array() : Utility::parse_attr($match[1]); if (isset($attrs['data-optimized'])) { continue; } if (!empty($attrs['data-no-optimize'])) { continue; } if (!empty($attrs['data-cfasync']) && $attrs['data-cfasync'] === 'false') { continue; } if (!empty($attrs['type']) && $attrs['type'] != 'text/javascript') { continue; } // to avoid multiple replacement if (in_array($match[0], $html_list)) { continue; } $this_src_arr = array(); // JS files if (!empty($attrs['src'])) { // Exclude check $js_excluded = Utility::str_hit_array($attrs['src'], $excludes); $is_internal = Utility::is_internal_file($attrs['src']); $is_file = substr($attrs['src'], 0, 5) != 'data:'; $ext_excluded = !$combine_ext_inl && !$is_internal; if ($js_excluded || $ext_excluded || !$is_file) { // Maybe defer if ($this->cfg_js_defer) { $deferred = $this->_js_defer($match[0], $attrs['src']); if ($deferred) { $this->content = str_replace($match[0], $deferred, $this->content); } } self::debug2('_parse_js bypassed due to ' . ($js_excluded ? 'js files excluded [hit] ' . $js_excluded : 'external js')); continue; } if (strpos($attrs['src'], '/localres/') !== false) { continue; } if (strpos($attrs['src'], 'instant_click') !== false) { continue; } $this_src_arr['src'] = $attrs['src']; } // Inline JS elseif (!empty($match[2])) { // self::debug( '🌹🌹🌹 ' . $match[2] . '🌹' ); // Exclude check $js_excluded = Utility::str_hit_array($match[2], $excludes); if ($js_excluded || !$combine_ext_inl) { // Maybe defer if ($this->cfg_js_defer) { $deferred = $this->_js_inline_defer($match[2], $match[1]); if ($deferred) { $this->content = str_replace($match[0], $deferred, $this->content); } } self::debug2('_parse_js bypassed due to ' . ($js_excluded ? 'js excluded [hit] ' . $js_excluded : 'inline js')); continue; } $this_src_arr['inl'] = true; $this_src_arr['src'] = $match[2]; if ($match[1]) { $this_src_arr['attrs'] = $match[1]; } } else { // Compatibility to those who changed src to data-src already self::debug2('No JS src or inline JS content'); continue; } $src_list[] = $this_src_arr; $html_list[] = $match[0]; } return array( $src_list, $html_list ); } /** * Inline JS defer * * @since 3.0 * @access private */ private function _js_inline_defer( $con, $attrs = false, $minified = false ) { if (strpos($attrs, 'data-no-defer') !== false) { self::debug2('bypass: attr api data-no-defer'); return false; } $hit = Utility::str_hit_array($con, $this->cfg_js_defer_exc); if ($hit) { self::debug2('inline js defer excluded [setting] ' . $hit); return false; } $con = trim($con); // Minify JS first if (!$minified) { // && $this->cfg_js_defer !== 2 $con = Optimizer::minify_js($con); } if (!$con) { return false; } // Check if the content contains ESI nonce or not $con = $this->_preserve_esi($con); if ($this->cfg_js_defer === 2) { // Drop type attribute from $attrs if (strpos($attrs, ' type=') !== false) { $attrs = preg_replace('# type=([\'"])([^\1]+)\1#isU', '', $attrs); } // Replace DOMContentLoaded $con = str_replace('DOMContentLoaded', 'DOMContentLiteSpeedLoaded', $con); return '<script' . $attrs . ' type="litespeed/javascript">' . $con . '</script>'; // return '<script' . $attrs . ' type="litespeed/javascript" src="data:text/javascript;base64,' . base64_encode( $con ) . '"></script>'; // return '<script' . $attrs . ' type="litespeed/javascript">' . $con . '</script>'; } return '<script' . $attrs . ' src="data:text/javascript;base64,' . base64_encode($con) . '" defer></script>'; } /** * Replace ESI to JS inline var (mainly used to avoid nonce timeout) * * @since 3.5.1 */ private function _preserve_esi( $con ) { $esi_placeholder_list = $this->cls('ESI')->contain_preserve_esi($con); if (!$esi_placeholder_list) { return $con; } foreach ($esi_placeholder_list as $esi_placeholder) { $js_var = '__litespeed_var_' . self::$_var_i++ . '__'; $con = str_replace($esi_placeholder, $js_var, $con); $this->_var_preserve_js[] = $js_var . '=' . $esi_placeholder; } return $con; } /** * Parse css src and remove to-be-removed css * * @since 1.2.2 * @access private * @return array All the src & related raw html list */ private function _parse_css() { $excludes = apply_filters('litespeed_optimize_css_excludes', $this->conf(self::O_OPTM_CSS_EXC)); $ucss_file_exc_inline = apply_filters('litespeed_optimize_ucss_file_exc_inline', $this->conf(self::O_OPTM_UCSS_FILE_EXC_INLINE)); // Append dummy css to exclude list $excludes[] = 'litespeed-dummy.css'; $combine_ext_inl = $this->conf(self::O_OPTM_CSS_COMB_EXT_INL); if (!apply_filters('litespeed_optm_css_comb_ext_inl', true)) { self::debug2('css_comb_ext_inl bypassed via litespeed_optm_css_comb_ext_inl filter'); $combine_ext_inl = false; } $css_to_be_removed = apply_filters('litespeed_optm_css_to_be_removed', array()); $src_list = array(); $html_list = array(); // $dom = new \PHPHtmlParser\Dom; // $dom->load( $content );return $val; // $items = $dom->find( 'link' ); // V7 added: (?:\r\n?|\n?) to fix replacement leaving empty new line $content = preg_replace( array( '#<!--.*-->(?:\r\n?|\n?)#sU', '#<script([^>]*)>.*</script>(?:\r\n?|\n?)#isU', '#<noscript([^>]*)>.*</noscript>(?:\r\n?|\n?)#isU' ), '', $this->content ); preg_match_all('#<link ([^>]+)/?>|<style([^>]*)>([^<]+)</style>(?:\r\n?|\n?)#isU', $content, $matches, PREG_SET_ORDER); foreach ($matches as $match) { // to avoid multiple replacement if (in_array($match[0], $html_list)) { continue; } if ($exclude = Utility::str_hit_array($match[0], $excludes)) { self::debug2('_parse_css bypassed exclude ' . $exclude); continue; } $this_src_arr = array(); if (strpos($match[0], '<link') === 0) { $attrs = Utility::parse_attr($match[1]); if (empty($attrs['rel']) || $attrs['rel'] !== 'stylesheet') { continue; } if (empty($attrs['href'])) { continue; } // Check if need to remove this css if (Utility::str_hit_array($attrs['href'], $css_to_be_removed)) { self::debug('rm css snippet ' . $attrs['href']); // Delete this css snippet from orig html $this->content = str_replace($match[0], '', $this->content); continue; } // Check if need to inline this css file if ($this->conf(self::O_OPTM_UCSS) && Utility::str_hit_array($attrs['href'], $ucss_file_exc_inline)) { self::debug('ucss_file_exc_inline hit ' . $attrs['href']); // Replace this css to inline from orig html $inline_script = '<style>' . $this->__optimizer->load_file($attrs['href']) . '</style>'; $this->content = str_replace($match[0], $inline_script, $this->content); continue; } // Check Google fonts hit if (strpos($attrs['href'], 'fonts.googleapis.com') !== false) { /** * For async gg fonts, will add webfont into head, hence remove it from buffer and store the matches to use later * * @since 2.7.3 * @since 3.0 For font display optm, need to parse google fonts URL too */ if (!in_array($attrs['href'], $this->_ggfonts_urls)) { $this->_ggfonts_urls[] = $attrs['href']; } if ($this->cfg_ggfonts_rm || $this->cfg_ggfonts_async) { self::debug('rm css snippet [Google fonts] ' . $attrs['href']); $this->content = str_replace($match[0], '', $this->content); continue; } } if (isset($attrs['data-optimized'])) { // $this_src_arr[ 'exc' ] = true; continue; } elseif (!empty($attrs['data-no-optimize'])) { // $this_src_arr[ 'exc' ] = true; continue; } $is_internal = Utility::is_internal_file($attrs['href']); $ext_excluded = !$combine_ext_inl && !$is_internal; if ($ext_excluded) { self::debug2('Bypassed due to external link'); // Maybe defer if ($this->cfg_css_async) { $snippet = $this->_async_css($match[0]); if ($snippet != $match[0]) { $this->content = str_replace($match[0], $snippet, $this->content); } } continue; } if (!empty($attrs['media']) && $attrs['media'] !== 'all') { $this_src_arr['media'] = $attrs['media']; } $this_src_arr['src'] = $attrs['href']; } else { // Inline style if (!$combine_ext_inl) { self::debug2('Bypassed due to inline'); continue; } $attrs = Utility::parse_attr($match[2]); if (!empty($attrs['data-no-optimize'])) { continue; } if (!empty($attrs['media']) && $attrs['media'] !== 'all') { $this_src_arr['media'] = $attrs['media']; } $this_src_arr['inl'] = true; $this_src_arr['src'] = $match[3]; } $src_list[] = $this_src_arr; $html_list[] = $match[0]; } return array( $src_list, $html_list ); } /** * Replace css to async loaded css * * @since 1.3 * @access private */ private function _async_css_list( $html_list, $src_list ) { foreach ($html_list as $k => $ori) { if (!empty($src_list[$k]['inl'])) { continue; } $html_list[$k] = $this->_async_css($ori); } return $html_list; } /** * Async CSS snippet * * @since 3.5 */ private function _async_css( $ori ) { if (strpos($ori, 'data-asynced') !== false) { self::debug2('bypass: attr data-asynced exist'); return $ori; } if (strpos($ori, 'data-no-async') !== false) { self::debug2('bypass: attr api data-no-async'); return $ori; } // async replacement $v = str_replace('stylesheet', 'preload', $ori); $v = str_replace('<link', '<link data-asynced="1" as="style" onload="this.onload=null;this.rel=\'stylesheet\'" ', $v); // Append to noscript content if (!defined('LITESPEED_GUEST_OPTM') && !$this->conf(self::O_OPTM_NOSCRIPT_RM)) { $v .= '<noscript>' . preg_replace('/ id=\'[\w-]+\' /U', ' ', $ori) . '</noscript>'; } return $v; } /** * Defer JS snippet * * @since 3.5 */ private function _js_defer( $ori, $src ) { if (strpos($ori, ' async') !== false) { $ori = preg_replace('# async(?:=([\'"])(?:[^\1]*?)\1)?#is', '', $ori); } if (strpos($ori, 'defer') !== false) { return false; } if (strpos($ori, 'data-deferred') !== false) { self::debug2('bypass: attr data-deferred exist'); return false; } if (strpos($ori, 'data-no-defer') !== false) { self::debug2('bypass: attr api data-no-defer'); return false; } /** * Exclude JS from setting * * @since 1.5 */ if (Utility::str_hit_array($src, $this->cfg_js_defer_exc)) { self::debug('js defer exclude ' . $src); return false; } if ($this->cfg_js_defer === 2 || Utility::str_hit_array($src, $this->cfg_js_delay_inc)) { if (strpos($ori, ' type=') !== false) { $ori = preg_replace('# type=([\'"])([^\1]+)\1#isU', '', $ori); } return str_replace(' src=', ' type="litespeed/javascript" data-src=', $ori); } return str_replace('></script>', ' defer data-deferred="1"></script>', $ori); } /** * Delay JS for included setting * * @since 5.6 */ private function _js_delay( $ori, $src ) { if (strpos($ori, ' async') !== false) { $ori = str_replace(' async', '', $ori); } if (strpos($ori, 'defer') !== false) { return false; } if (strpos($ori, 'data-deferred') !== false) { self::debug2('bypass: attr data-deferred exist'); return false; } if (strpos($ori, 'data-no-defer') !== false) { self::debug2('bypass: attr api data-no-defer'); return false; } if (!Utility::str_hit_array($src, $this->cfg_js_delay_inc)) { return; } if (strpos($ori, ' type=') !== false) { $ori = preg_replace('# type=([\'"])([^\1]+)\1#isU', '', $ori); } return str_replace(' src=', ' type="litespeed/javascript" data-src=', $ori); } } src/report.cls.php 0000777 00000014172 15251157102 0010152 0 ustar 00 <?php // phpcs:ignoreFile /** * The report class * * @since 1.1.0 * @package LiteSpeed */ namespace LiteSpeed; defined('WPINC') || exit(); class Report extends Base { const TYPE_SEND_REPORT = 'send_report'; /** * Handle all request actions from main cls * * @since 1.6.5 * @access public */ public function handler() { $type = Router::verify_type(); switch ($type) { case self::TYPE_SEND_REPORT: $this->post_env(); break; default: break; } Admin::redirect(); } /** * post env report number to ls center server * * @since 1.6.5 * @access public */ public function post_env() { $report_con = $this->generate_environment_report(); // Generate link $link = !empty($_POST['link']) ? esc_url($_POST['link']) : ''; $notes = !empty($_POST['notes']) ? esc_html($_POST['notes']) : ''; $php_info = !empty($_POST['attach_php']) ? esc_html($_POST['attach_php']) : ''; $report_php = $php_info === '1' ? $this->generate_php_report() : ''; if ($report_php) { $report_con .= "\nPHPINFO\n" . $report_php; } $data = array( 'env' => $report_con, 'link' => $link, 'notes' => $notes, ); $json = Cloud::post(Cloud::API_REPORT, $data); if (!is_array($json)) { return; } $num = !empty($json['num']) ? $json['num'] : '--'; $summary = array( 'num' => $num, 'dateline' => time(), ); self::save_summary($summary); return $num; } /** * Gathers the PHP information. * * @since 7.0 * @access public */ public function generate_php_report( $flags = INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES ) { // INFO_ENVIRONMENT $report = ''; ob_start(); phpinfo($flags); $report = ob_get_contents(); ob_end_clean(); preg_match('%<style type="text/css">(.*?)</style>.*?<body>(.*?)</body>%s', $report, $report); return $report[2]; } /** * Gathers the environment details and creates the report. * Will write to the environment report file. * * @since 1.0.12 * @access public */ public function generate_environment_report( $options = null ) { global $wp_version, $_SERVER; $frontend_htaccess = Htaccess::get_frontend_htaccess(); $backend_htaccess = Htaccess::get_backend_htaccess(); $paths = array( $frontend_htaccess ); if ($frontend_htaccess != $backend_htaccess) { $paths[] = $backend_htaccess; } if (is_multisite()) { $active_plugins = get_site_option('active_sitewide_plugins'); if (!empty($active_plugins)) { $active_plugins = array_keys($active_plugins); } } else { $active_plugins = get_option('active_plugins'); } if (function_exists('wp_get_theme')) { $theme_obj = wp_get_theme(); $active_theme = $theme_obj->get('Name'); } else { $active_theme = get_current_theme(); } $extras = array( 'wordpress version' => $wp_version, 'siteurl' => get_option('siteurl'), 'home' => get_option('home'), 'home_url' => home_url(), 'locale' => get_locale(), 'active theme' => $active_theme, ); $extras['active plugins'] = $active_plugins; $extras['cloud'] = Cloud::get_summary(); foreach (array( 'mini_html', 'pk_b64', 'sk_b64', 'cdn_dash', 'ips' ) as $v) { if (!empty($extras['cloud'][$v])) { unset($extras['cloud'][$v]); } } if (is_null($options)) { $options = $this->get_options(true); if (is_multisite()) { $options2 = $this->get_options(); foreach ($options2 as $k => $v) { if (isset($options[$k]) && $options[$k] !== $v) { $options['[Overwritten] ' . $k] = $v; } } } } if (!is_null($options) && is_multisite()) { $blogs = Activation::get_network_ids(); if (!empty($blogs)) { $i = 0; foreach ($blogs as $blog_id) { if (++$i > 3) { // Only log 3 subsites break; } $opts = $this->cls('Conf')->load_options($blog_id, true); if (isset($opts[self::O_CACHE])) { $options['blog ' . $blog_id . ' radio select'] = $opts[self::O_CACHE]; } } } } // Security: Remove cf key in report $secure_fields = array( self::O_CDN_CLOUDFLARE_KEY, self::O_OBJECT_PSWD ); foreach ($secure_fields as $v) { if (!empty($options[$v])) { $options[$v] = str_repeat('*', strlen($options[$v])); } } $report = $this->build_environment_report($_SERVER, $options, $extras, $paths); return $report; } /** * Builds the environment report buffer with the given parameters * * @access private */ private function build_environment_report( $server, $options, $extras = array(), $htaccess_paths = array() ) { $server_keys = array( 'DOCUMENT_ROOT' => '', 'SERVER_SOFTWARE' => '', 'X-LSCACHE' => '', 'HTTP_X_LSCACHE' => '', ); $server_vars = array_intersect_key($server, $server_keys); $server_vars[] = 'LSWCP_TAG_PREFIX = ' . LSWCP_TAG_PREFIX; $server_vars = array_merge($server_vars, $this->cls('Base')->server_vars()); $buf = $this->_format_report_section('Server Variables', $server_vars); $buf .= $this->_format_report_section('WordPress Specific Extras', $extras); $buf .= $this->_format_report_section('LSCache Plugin Options', $options); if (empty($htaccess_paths)) { return $buf; } foreach ($htaccess_paths as $path) { if (!file_exists($path) || !is_readable($path)) { $buf .= $path . " does not exist or is not readable.\n"; continue; } $content = file_get_contents($path); if ($content === false) { $buf .= $path . " returned false for file_get_contents.\n"; continue; } $buf .= $path . " contents:\n" . $content . "\n\n"; } return $buf; } /** * Creates a part of the environment report based on a section header and an array for the section parameters. * * @since 1.0.12 * @access private */ private function _format_report_section( $section_header, $section ) { $tab = ' '; // four spaces if (empty($section)) { return 'No matching ' . $section_header . "\n\n"; } $buf = $section_header; foreach ($section as $k => $v) { $buf .= "\n" . $tab; if (!is_numeric($k)) { $buf .= $k . ' = '; } if (!is_string($v)) { $v = var_export($v, true); } else { $v = esc_html($v); } $buf .= $v; } return $buf . "\n\n"; } } src/import.cls.php 0000777 00000010453 15251157102 0010147 0 ustar 00 <?php // phpcs:ignoreFile /** * The import/export class. * * @since 1.8.2 */ namespace LiteSpeed; defined('WPINC') || exit(); class Import extends Base { protected $_summary; const TYPE_IMPORT = 'import'; const TYPE_EXPORT = 'export'; const TYPE_RESET = 'reset'; /** * Init * * @since 1.8.2 */ public function __construct() { Debug2::debug('Import init'); $this->_summary = self::get_summary(); } /** * Export settings to file * * @since 1.8.2 * @since 7.3 added download content type * @access public */ public function export( $only_data_return = false ) { $raw_data = $this->get_options(true); $data = array(); foreach ($raw_data as $k => $v) { $data[] = \json_encode(array( $k, $v )); } $data = implode("\n\n", $data); if ($only_data_return) { return $data; } $filename = $this->_generate_filename(); // Update log $this->_summary['export_file'] = $filename; $this->_summary['export_time'] = time(); self::save_summary(); Debug2::debug('Import: Saved to ' . $filename); @header('Content-Type: application/octet-stream'); @header('Content-Disposition: attachment; filename=' . $filename); echo $data; exit(); } /** * Import settings from file * * @since 1.8.2 * @access public */ public function import( $file = false ) { if (!$file) { if (empty($_FILES['ls_file']['name']) || substr($_FILES['ls_file']['name'], -5) != '.data' || empty($_FILES['ls_file']['tmp_name'])) { Debug2::debug('Import: Failed to import, wrong ls_file'); $msg = __('Import failed due to file error.', 'litespeed-cache'); Admin_Display::error($msg); return false; } $this->_summary['import_file'] = $_FILES['ls_file']['name']; $data = file_get_contents($_FILES['ls_file']['tmp_name']); } else { $this->_summary['import_file'] = $file; $data = file_get_contents($file); } // Update log $this->_summary['import_time'] = time(); self::save_summary(); $ori_data = array(); try { // Check if the data is v4+ or not if (strpos($data, '["_version",') === 0) { Debug2::debug('[Import] Data version: v4+'); $data = explode("\n", $data); foreach ($data as $v) { $v = trim($v); if (!$v) { continue; } list($k, $v) = \json_decode($v, true); $ori_data[$k] = $v; } } else { $ori_data = \json_decode(base64_decode($data), true); } } catch (\Exception $ex) { Debug2::debug('[Import] ❌ Failed to parse serialized data'); return false; } if (!$ori_data) { Debug2::debug('[Import] ❌ Failed to import, no data'); return false; } else { Debug2::debug('[Import] Importing data', $ori_data); } $this->cls('Conf')->update_confs($ori_data); if (!$file) { Debug2::debug('Import: Imported ' . $_FILES['ls_file']['name']); $msg = sprintf(__('Imported setting file %s successfully.', 'litespeed-cache'), $_FILES['ls_file']['name']); Admin_Display::success($msg); } else { Debug2::debug('Import: Imported ' . $file); } return true; } /** * Reset all configs to default values. * * @since 2.6.3 * @access public */ public function reset() { $options = $this->cls('Conf')->load_default_vals(); $this->cls('Conf')->update_confs($options); Debug2::debug('[Import] Reset successfully.'); $msg = __('Reset successfully.', 'litespeed-cache'); Admin_Display::success($msg); } /** * Generate the filename to export * * @since 1.8.2 * @access private */ private function _generate_filename() { // Generate filename $parsed_home = parse_url(get_home_url()); $filename = 'LSCWP_cfg-'; if (!empty($parsed_home['host'])) { $filename .= $parsed_home['host'] . '_'; } if (!empty($parsed_home['path'])) { $filename .= $parsed_home['path'] . '_'; } $filename = str_replace('/', '_', $filename); $filename .= '-' . date('Ymd_His') . '.data'; return $filename; } /** * Handle all request actions from main cls * * @since 1.8.2 * @access public */ public function handler() { $type = Router::verify_type(); switch ($type) { case self::TYPE_IMPORT: $this->import(); break; case self::TYPE_EXPORT: $this->export(); break; case self::TYPE_RESET: $this->reset(); break; default: break; } Admin::redirect(); } } src/img-optm.cls.php 0000777 00000202205 15251157102 0010364 0 ustar 00 <?php // phpcs:ignoreFile /** * The class to optimize image. * * @since 2.0 * @package LiteSpeed */ namespace LiteSpeed; use WpOrg\Requests\Autoload; use WpOrg\Requests\Requests; defined('WPINC') || exit(); class Img_Optm extends Base { const LOG_TAG = '🗜️'; const CLOUD_ACTION_NEW_REQ = 'new_req'; const CLOUD_ACTION_TAKEN = 'taken'; const CLOUD_ACTION_REQUEST_DESTROY = 'imgoptm_destroy'; const CLOUD_ACTION_CLEAN = 'clean'; const TYPE_NEW_REQ = 'new_req'; const TYPE_RESCAN = 'rescan'; const TYPE_DESTROY = 'destroy'; const TYPE_RESET_COUNTER = 'reset_counter'; const TYPE_CLEAN = 'clean'; const TYPE_PULL = 'pull'; const TYPE_BATCH_SWITCH_ORI = 'batch_switch_ori'; const TYPE_BATCH_SWITCH_OPTM = 'batch_switch_optm'; const TYPE_CALC_BKUP = 'calc_bkup'; const TYPE_RESET_ROW = 'reset_row'; const TYPE_RM_BKUP = 'rm_bkup'; const STATUS_NEW = 0; // 'new'; const STATUS_RAW = 1; // 'raw'; const STATUS_REQUESTED = 3; // 'requested'; const STATUS_NOTIFIED = 6; // 'notified'; const STATUS_DUPLICATED = 8; // 'duplicated'; const STATUS_PULLED = 9; // 'pulled'; const STATUS_FAILED = -1; // 'failed'; const STATUS_MISS = -3; // 'miss'; const STATUS_ERR_FETCH = -5; // 'err_fetch'; const STATUS_ERR_404 = -6; // 'err_404'; const STATUS_ERR_OPTM = -7; // 'err_optm'; const STATUS_XMETA = -8; // 'xmeta'; const STATUS_ERR = -9; // 'err'; const DB_SIZE = 'litespeed-optimize-size'; const DB_SET = 'litespeed-optimize-set'; const DB_NEED_PULL = 'need_pull'; private $wp_upload_dir; private $tmp_pid; private $tmp_type; private $tmp_path; private $_img_in_queue = []; private $_existed_src_list = []; private $_pids_set = []; private $_thumbnail_set = ''; private $_table_img_optm; private $_table_img_optming; private $_cron_ran = false; private $_sizes_skipped = []; private $__media; private $__data; protected $_summary; private $_format = ''; /** * Init * * @since 2.0 */ public function __construct() { Debug2::debug2('[ImgOptm] init'); $this->wp_upload_dir = wp_upload_dir(); $this->__media = $this->cls('Media'); $this->__data = $this->cls('Data'); $this->_table_img_optm = $this->__data->tb('img_optm'); $this->_table_img_optming = $this->__data->tb('img_optming'); $this->_summary = self::get_summary(); if (empty($this->_summary['next_post_id'])) { $this->_summary['next_post_id'] = 0; } if ($this->conf(Base::O_IMG_OPTM_WEBP)) { $this->_format = 'webp'; if ($this->conf(Base::O_IMG_OPTM_WEBP) == 2) { $this->_format = 'avif'; } } // Allow users to ignore custom sizes. $this->_sizes_skipped = apply_filters( 'litespeed_imgoptm_sizes_skipped', $this->conf( Base::O_IMG_OPTM_SIZES_SKIPPED ) ); } /** * Gather images auto when update attachment meta * This is to optimize new uploaded images first. Stored in img_optm table. * Later normal process will auto remove these records when trying to optimize these images again * * @since 4.0 */ public function wp_update_attachment_metadata( $meta_value, $post_id ) { global $wpdb; self::debug2('🖌️ Auto update attachment meta [id] ' . $post_id); if (empty($meta_value['file'])) { return; } // Load gathered images if (!$this->_existed_src_list) { // To aavoid extra query when recalling this function self::debug('SELECT src from img_optm table'); if ($this->__data->tb_exist('img_optm')) { $q = "SELECT src FROM `$this->_table_img_optm` WHERE post_id = %d"; $list = $wpdb->get_results($wpdb->prepare($q, $post_id)); foreach ($list as $v) { $this->_existed_src_list[] = $post_id . '.' . $v->src; } } if ($this->__data->tb_exist('img_optming')) { $q = "SELECT src FROM `$this->_table_img_optming` WHERE post_id = %d"; $list = $wpdb->get_results($wpdb->prepare($q, $post_id)); foreach ($list as $v) { $this->_existed_src_list[] = $post_id . '.' . $v->src; } } else { $this->__data->tb_create('img_optming'); } } // Prepare images $this->tmp_pid = $post_id; $this->tmp_path = pathinfo($meta_value['file'], PATHINFO_DIRNAME) . '/'; $this->_append_img_queue($meta_value, true); if (!empty($meta_value['sizes'])) { foreach( $meta_value['sizes'] as $img_size_name => $img_size ){ $this->_append_img_queue($img_size, false, $img_size_name ); } } if (!$this->_img_in_queue) { self::debug('auto update attachment meta 2 bypass: empty _img_in_queue'); return; } // Save to DB $this->_save_raw(); // $this->_send_request(); } /** * Auto send optm request * * @since 2.4.1 * @access public */ public static function cron_auto_request() { if (!wp_doing_cron()) { return false; } $instance = self::cls(); $instance->new_req(); } /** * Calculate wet run allowance * * @since 3.0 */ public function wet_limit() { $wet_limit = 1; if (!empty($this->_summary['img_taken'])) { $wet_limit = pow($this->_summary['img_taken'], 2); } if ($wet_limit == 1 && !empty($this->_summary['img_status.' . self::STATUS_ERR_OPTM])) { $wet_limit = pow($this->_summary['img_status.' . self::STATUS_ERR_OPTM], 2); } if ($wet_limit < Cloud::IMG_OPTM_DEFAULT_GROUP) { return $wet_limit; } // No limit return false; } /** * Push raw img to image optm server * * @since 1.6 * @access public */ public function new_req() { global $wpdb; // check if is running if (!empty($this->_summary['is_running']) && time() - $this->_summary['is_running'] < apply_filters('litespeed_imgoptm_new_req_interval', 3600)) { self::debug('The previous req was in 3600s.'); return; } $this->_summary['is_running'] = time(); self::save_summary(); // Check if has credit to push $err = false; $allowance = Cloud::cls()->allowance(Cloud::SVC_IMG_OPTM, $err); $wet_limit = $this->wet_limit(); self::debug("allowance_max $allowance wet_limit $wet_limit"); if ($wet_limit && $wet_limit < $allowance) { $allowance = $wet_limit; } if (!$allowance) { self::debug('❌ No credit'); Admin_Display::error(Error::msg($err)); $this->_finished_running(); return; } self::debug('preparing images to push'); $this->__data->tb_create('img_optming'); $q = "SELECT COUNT(1) FROM `$this->_table_img_optming` WHERE optm_status = %d"; $q = $wpdb->prepare($q, array( self::STATUS_REQUESTED )); $total_requested = $wpdb->get_var($q); $max_requested = $allowance * 1; if ($total_requested > $max_requested) { self::debug('❌ Too many queued images (' . $total_requested . ' > ' . $max_requested . ')'); Admin_Display::error(Error::msg('too_many_requested')); $this->_finished_running(); return; } $allowance -= $total_requested; if ($allowance < 1) { self::debug('❌ Too many requested images ' . $total_requested); Admin_Display::error(Error::msg('too_many_requested')); $this->_finished_running(); return; } // Limit maximum number of items waiting to be pulled $q = "SELECT COUNT(1) FROM `$this->_table_img_optming` WHERE optm_status = %d"; $q = $wpdb->prepare($q, array( self::STATUS_NOTIFIED )); $total_notified = $wpdb->get_var($q); if ($total_notified > 0) { self::debug('❌ Too many notified images (' . $total_notified . ')'); Admin_Display::error(Error::msg('too_many_notified')); $this->_finished_running(); return; } $q = "SELECT COUNT(1) FROM `$this->_table_img_optming` WHERE optm_status IN (%d, %d)"; $q = $wpdb->prepare($q, array( self::STATUS_NEW, self::STATUS_RAW )); $total_new = $wpdb->get_var($q); // $allowance -= $total_new; // May need to get more images $list = []; $more = $allowance - $total_new; if ($more > 0) { $q = "SELECT b.post_id, b.meta_value FROM `$wpdb->posts` a LEFT JOIN `$wpdb->postmeta` b ON b.post_id = a.ID WHERE b.meta_key = '_wp_attachment_metadata' AND a.post_type = 'attachment' AND a.post_status = 'inherit' AND a.ID>%d AND a.post_mime_type IN ('image/jpeg', 'image/png', 'image/gif') ORDER BY a.ID LIMIT %d "; $q = $wpdb->prepare($q, array( $this->_summary['next_post_id'], $more )); $list = $wpdb->get_results($q); foreach ($list as $v) { if (!$v->post_id) { continue; } $this->_summary['next_post_id'] = $v->post_id; $meta_value = $this->_parse_wp_meta_value($v); if (!$meta_value) { continue; } $meta_value['file'] = wp_normalize_path($meta_value['file']); $basedir = $this->wp_upload_dir['basedir'] . '/'; if (strpos($meta_value['file'], $basedir) === 0) { $meta_value['file'] = substr($meta_value['file'], strlen($basedir)); } $this->tmp_pid = $v->post_id; $this->tmp_path = pathinfo($meta_value['file'], PATHINFO_DIRNAME) . '/'; $this->_append_img_queue($meta_value, true); if (!empty($meta_value['sizes'])) { foreach( $meta_value['sizes'] as $img_size_name => $img_size ){ $this->_append_img_queue($img_size, false, $img_size_name ); } } } self::save_summary(); $num_a = count($this->_img_in_queue); self::debug('Images found: ' . $num_a); $this->_filter_duplicated_src(); self::debug('Images after duplicated: ' . count($this->_img_in_queue)); $this->_filter_invalid_src(); self::debug('Images after invalid: ' . count($this->_img_in_queue)); // Check w/ legacy imgoptm table, bypass finished images $this->_filter_legacy_src(); $num_b = count($this->_img_in_queue); if ($num_b != $num_a) { self::debug('Images after filtered duplicated/invalid/legacy src: ' . $num_b); } // Save to DB $this->_save_raw(); } // Push to Cloud server $accepted_imgs = $this->_send_request($allowance); $this->_finished_running(); if (!$accepted_imgs) { return; } $placeholder1 = Admin_Display::print_plural($accepted_imgs[0], 'image'); $placeholder2 = Admin_Display::print_plural($accepted_imgs[1], 'image'); $msg = sprintf(__('Pushed %1$s to Cloud server, accepted %2$s.', 'litespeed-cache'), $placeholder1, $placeholder2); Admin_Display::success($msg); } /** * Set running to done */ private function _finished_running() { $this->_summary['is_running'] = 0; self::save_summary(); } /** * Add a new img to queue which will be pushed to request * * @since 1.6 * @since 7.5 Allow to choose which image sizes should be optimized + added parameter $img_size_name. * @access private */ private function _append_img_queue( $meta_value, $is_ori_file = false, $img_size_name = false ) { if (empty($meta_value['file']) || empty($meta_value['width']) || empty($meta_value['height'])) { self::debug2('bypass image due to lack of file/w/h: pid ' . $this->tmp_pid, $meta_value); return; } $short_file_path = $meta_value['file']; // Test if need to skip image size. if (!$is_ori_file) { $short_file_path = $this->tmp_path . $short_file_path; $skip = false !== array_search( $img_size_name, $this->_sizes_skipped, true ); if($skip){ self::debug2( 'bypass image ' . $short_file_path . ' due to skipped size: ' . $img_size_name ); return; } } // Check if src is gathered already or not if (in_array($this->tmp_pid . '.' . $short_file_path, $this->_existed_src_list)) { // Debug2::debug2( '[Img_Optm] bypass image due to gathered: pid ' . $this->tmp_pid . ' ' . $short_file_path ); return; } else { // Append handled images $this->_existed_src_list[] = $this->tmp_pid . '.' . $short_file_path; } // check file exists or not $_img_info = $this->__media->info($short_file_path, $this->tmp_pid); $extension = pathinfo($short_file_path, PATHINFO_EXTENSION); if (!$_img_info || !in_array($extension, array( 'jpg', 'jpeg', 'png', 'gif' ))) { self::debug2('bypass image due to file not exist: pid ' . $this->tmp_pid . ' ' . $short_file_path); return; } // Check if optimized file exists or not $target_needed = false; if ($this->_format) { $target_file_path = $short_file_path . '.' . $this->_format; if (!$this->__media->info($target_file_path, $this->tmp_pid)) { $target_needed = true; } } if ($this->conf(self::O_IMG_OPTM_ORI)) { $target_file_path = substr($short_file_path, 0, -strlen($extension)) . 'bk.' . $extension; if (!$this->__media->info($target_file_path, $this->tmp_pid)) { $target_needed = true; } } if (!$target_needed) { self::debug2('bypass image due to optimized file exists: pid ' . $this->tmp_pid . ' ' . $short_file_path); return; } // Debug2::debug2( '[Img_Optm] adding image: pid ' . $this->tmp_pid ); $this->_img_in_queue[] = array( 'pid' => $this->tmp_pid, 'md5' => $_img_info['md5'], 'url' => $_img_info['url'], 'src' => $short_file_path, // not needed in LiteSpeed IAPI, just leave for local storage after post 'mime_type' => !empty($meta_value['mime-type']) ? $meta_value['mime-type'] : '', ); } /** * Save gathered image raw data * * @since 3.0 */ private function _save_raw() { if (empty($this->_img_in_queue)) { return; } $data = []; $pid_list = []; foreach ($this->_img_in_queue as $k => $v) { $_img_info = $this->__media->info($v['src'], $v['pid']); // attachment doesn't exist, delete the record if (empty($_img_info['url']) || empty($_img_info['md5'])) { unset($this->_img_in_queue[$k]); continue; } $pid_list[] = (int) $v['pid']; $data[] = $v['pid']; $data[] = self::STATUS_RAW; $data[] = $v['src']; } global $wpdb; $fields = 'post_id, optm_status, src'; $q = "INSERT INTO `$this->_table_img_optming` ( $fields ) VALUES "; // Add placeholder $q .= Utility::chunk_placeholder($data, $fields); // Store data $wpdb->query($wpdb->prepare($q, $data)); $count = count($this->_img_in_queue); self::debug('Added raw images [total] ' . $count); $this->_img_in_queue = []; // Save thumbnail groups for future rescan index $this->_gen_thumbnail_set(); $pid_list = array_unique($pid_list); self::debug('pid list to append to postmeta', $pid_list); $pid_list = array_diff($pid_list, $this->_pids_set); $this->_pids_set = array_merge($this->_pids_set, $pid_list); $existed_meta = $wpdb->get_results("SELECT * FROM `$wpdb->postmeta` WHERE post_id IN ('" . implode("','", $pid_list) . "') AND meta_key='" . self::DB_SET . "'"); $existed_pid = []; if ($existed_meta) { foreach ($existed_meta as $v) { $existed_pid[] = $v->post_id; } self::debug('pid list to update postmeta', $existed_pid); $wpdb->query( $wpdb->prepare("UPDATE `$wpdb->postmeta` SET meta_value=%s WHERE post_id IN ('" . implode("','", $existed_pid) . "') AND meta_key=%s", array( $this->_thumbnail_set, self::DB_SET, )) ); } // Add new meta $new_pids = $existed_pid ? array_diff($pid_list, $existed_pid) : $pid_list; if ($new_pids) { self::debug('pid list to update postmeta', $new_pids); foreach ($new_pids as $v) { self::debug('New group set info [pid] ' . $v); $q = "INSERT INTO `$wpdb->postmeta` (post_id, meta_key, meta_value) VALUES (%d, %s, %s)"; $wpdb->query($wpdb->prepare($q, array( $v, self::DB_SET, $this->_thumbnail_set ))); } } } /** * Generate thumbnail sets of current image group * * @since 5.4 */ private function _gen_thumbnail_set() { if ($this->_thumbnail_set) { return; } $set = []; foreach (Media::cls()->get_image_sizes() as $size) { $curr_size = $size['width'] . 'x' . $size['height']; if (in_array($curr_size, $set)) { continue; } $set[] = $curr_size; } $this->_thumbnail_set = implode(PHP_EOL, $set); } /** * Filter duplicated src in work table and $this->_img_in_queue, then mark them as duplicated * * @since 2.0 * @access private */ private function _filter_duplicated_src() { global $wpdb; $srcpath_list = []; $list = $wpdb->get_results("SELECT src FROM `$this->_table_img_optming`"); foreach ($list as $v) { $srcpath_list[] = $v->src; } foreach ($this->_img_in_queue as $k => $v) { if (in_array($v['src'], $srcpath_list)) { unset($this->_img_in_queue[$k]); continue; } $srcpath_list[] = $v['src']; } } /** * Filter legacy finished ones * * @since 5.4 */ private function _filter_legacy_src() { global $wpdb; if (!$this->__data->tb_exist('img_optm')) { return; } if (!$this->_img_in_queue) { return; } $finished_ids = []; Utility::compatibility(); $post_ids = array_unique(array_column($this->_img_in_queue, 'pid')); $list = $wpdb->get_results("SELECT post_id FROM `$this->_table_img_optm` WHERE post_id in (" . implode(',', $post_ids) . ') GROUP BY post_id'); foreach ($list as $v) { $finished_ids[] = $v->post_id; } foreach ($this->_img_in_queue as $k => $v) { if (in_array($v['pid'], $finished_ids)) { self::debug('Legacy image optimized [pid] ' . $v['pid']); unset($this->_img_in_queue[$k]); continue; } } // Drop all existing legacy records $wpdb->query("DELETE FROM `$this->_table_img_optm` WHERE post_id in (" . implode(',', $post_ids) . ')'); } /** * Filter the invalid src before sending * * @since 3.0.8.3 * @access private */ private function _filter_invalid_src() { $img_in_queue_invalid = []; foreach ($this->_img_in_queue as $k => $v) { if ($v['src']) { $extension = pathinfo($v['src'], PATHINFO_EXTENSION); } if (!$v['src'] || empty($extension) || !in_array($extension, array( 'jpg', 'jpeg', 'png', 'gif' ))) { $img_in_queue_invalid[] = $v['id']; unset($this->_img_in_queue[$k]); continue; } } if (!$img_in_queue_invalid) { return; } $count = count($img_in_queue_invalid); $msg = sprintf(__('Cleared %1$s invalid images.', 'litespeed-cache'), $count); Admin_Display::success($msg); self::debug('Found invalid src [total] ' . $count); } /** * Push img request to Cloud server * * @since 1.6.7 * @access private */ private function _send_request( $allowance ) { global $wpdb; $q = "SELECT id, src, post_id FROM `$this->_table_img_optming` WHERE optm_status=%d LIMIT %d"; $q = $wpdb->prepare($q, array( self::STATUS_RAW, $allowance )); $_img_in_queue = $wpdb->get_results($q); if (!$_img_in_queue) { return; } self::debug('Load img in queue [total] ' . count($_img_in_queue)); $list = []; foreach ($_img_in_queue as $v) { $_img_info = $this->__media->info($v->src, $v->post_id); // If record is invalid, remove from img_optming table if (empty($_img_info['url']) || empty($_img_info['md5'])) { $wpdb->query($wpdb->prepare("DELETE FROM `$this->_table_img_optming` WHERE id=%d", $v->id)); continue; } $img = array( 'id' => $v->id, 'url' => $_img_info['url'], 'md5' => $_img_info['md5'], ); // Build the needed image types for request as we now support soft reset counter if ($this->_format) { $target_file_path = $v->src . '.' . $this->_format; if ($this->__media->info($target_file_path, $v->post_id)) { $img['optm_' . $this->_format] = 0; } } if ($this->conf(self::O_IMG_OPTM_ORI)) { $extension = pathinfo($v->src, PATHINFO_EXTENSION); $target_file_path = substr($v->src, 0, -strlen($extension)) . 'bk.' . $extension; if ($this->__media->info($target_file_path, $v->post_id)) { $img['optm_ori'] = 0; } } $list[] = $img; } if (!$list) { $msg = __('No valid image found in the current request.', 'litespeed-cache'); Admin_Display::error($msg); return; } $data = array( 'action' => self::CLOUD_ACTION_NEW_REQ, 'list' => \json_encode($list), 'optm_ori' => $this->conf(self::O_IMG_OPTM_ORI) ? 1 : 0, 'optm_lossless' => $this->conf(self::O_IMG_OPTM_LOSSLESS) ? 1 : 0, 'keep_exif' => $this->conf(self::O_IMG_OPTM_EXIF) ? 1 : 0, ); if ($this->_format) { $data['optm_' . $this->_format] = 1; } // Push to Cloud server $json = Cloud::post(Cloud::SVC_IMG_OPTM, $data); if (!$json) { return; } // Check data format if (empty($json['ids'])) { self::debug('Failed to parse response data from Cloud server ', $json); $msg = __('No valid image found by Cloud server in the current request.', 'litespeed-cache'); Admin_Display::error($msg); return; } self::debug('Returned data from Cloud server count: ' . count($json['ids'])); $ids = implode(',', array_map('intval', $json['ids'])); // Update img table $q = "UPDATE `$this->_table_img_optming` SET optm_status = '" . self::STATUS_REQUESTED . "' WHERE id IN ( $ids )"; $wpdb->query($q); $this->_summary['last_requested'] = time(); self::save_summary(); return array( count($list), count($json['ids']) ); } /** * Cloud server notify Client img status changed * * @access public */ public function notify_img() { // Interval validation to avoid hacking domain_key if (!empty($this->_summary['notify_ts_err']) && time() - $this->_summary['notify_ts_err'] < 3) { return Cloud::err('too_often'); } $post_data = \json_decode(file_get_contents('php://input'), true); if (is_null($post_data)) { $post_data = $_POST; } global $wpdb; $notified_data = $post_data['data']; if (empty($notified_data) || !is_array($notified_data)) { self::debug('❌ notify exit: no notified data'); return Cloud::err('no notified data'); } if (empty($post_data['server']) || (substr($post_data['server'], -11) !== '.quic.cloud' && substr($post_data['server'], -15) !== '.quicserver.com')) { self::debug('notify exit: no/wrong server'); return Cloud::err('no/wrong server'); } if (empty($post_data['status'])) { self::debug('notify missing status'); return Cloud::err('no status'); } $status = $post_data['status']; self::debug('notified status=' . $status); $last_log_pid = 0; if (empty($this->_summary['reduced'])) { $this->_summary['reduced'] = 0; } if ($status == self::STATUS_NOTIFIED) { // Notified data format: [ img_optm_id => [ id=>, src_size=>, ori=>, ori_md5=>, ori_reduced=>, webp=>, webp_md5=>, webp_reduced=> ] ] $q = "SELECT a.*, b.meta_id as b_meta_id, b.meta_value AS b_optm_info FROM `$this->_table_img_optming` a LEFT JOIN `$wpdb->postmeta` b ON b.post_id = a.post_id AND b.meta_key = %s WHERE a.id IN ( " . implode(',', array_fill(0, count($notified_data), '%d')) . ' )'; $list = $wpdb->get_results($wpdb->prepare($q, array_merge(array( self::DB_SIZE ), array_keys($notified_data)))); $ls_optm_size_row_exists_postids = []; foreach ($list as $v) { $json = $notified_data[$v->id]; // self::debug('Notified data for [id] ' . $v->id, $json); $server = !empty($json['server']) ? $json['server'] : $post_data['server']; $server_info = array( 'server' => $server, ); // Save server side ID to send taken notification after pulled $server_info['id'] = $json['id']; if (!empty($json['file_id'])) { $server_info['file_id'] = $json['file_id']; } // Optm info array $postmeta_info = array( 'ori_total' => 0, 'ori_saved' => 0, 'webp_total' => 0, 'webp_saved' => 0, 'avif_total' => 0, 'avif_saved' => 0, ); // Init postmeta_info for the first one if (!empty($v->b_meta_id)) { foreach (maybe_unserialize($v->b_optm_info) as $k2 => $v2) { $postmeta_info[$k2] += $v2; } } if (!empty($json['ori'])) { $server_info['ori_md5'] = $json['ori_md5']; $server_info['ori'] = $json['ori']; // Append meta info $postmeta_info['ori_total'] += $json['src_size']; $postmeta_info['ori_saved'] += $json['ori_reduced']; // optimized image size info in img_optm tb will be updated when pull $this->_summary['reduced'] += $json['ori_reduced']; } if (!empty($json['webp'])) { $server_info['webp_md5'] = $json['webp_md5']; $server_info['webp'] = $json['webp']; // Append meta info $postmeta_info['webp_total'] += $json['src_size']; $postmeta_info['webp_saved'] += $json['webp_reduced']; $this->_summary['reduced'] += $json['webp_reduced']; } if (!empty($json['avif'])) { $server_info['avif_md5'] = $json['avif_md5']; $server_info['avif'] = $json['avif']; // Append meta info $postmeta_info['avif_total'] += $json['src_size']; $postmeta_info['avif_saved'] += $json['avif_reduced']; $this->_summary['reduced'] += $json['avif_reduced']; } // Update status and data in working table $q = "UPDATE `$this->_table_img_optming` SET optm_status = %d, server_info = %s WHERE id = %d "; $wpdb->query($wpdb->prepare($q, array( $status, \json_encode($server_info), $v->id ))); // Update postmeta for optm summary $postmeta_info = serialize($postmeta_info); if (empty($v->b_meta_id) && !in_array($v->post_id, $ls_optm_size_row_exists_postids)) { self::debug('New size info [pid] ' . $v->post_id); $q = "INSERT INTO `$wpdb->postmeta` ( post_id, meta_key, meta_value ) VALUES ( %d, %s, %s )"; $wpdb->query($wpdb->prepare($q, array( $v->post_id, self::DB_SIZE, $postmeta_info ))); $ls_optm_size_row_exists_postids[] = $v->post_id; } else { $q = "UPDATE `$wpdb->postmeta` SET meta_value = %s WHERE meta_id = %d "; $wpdb->query($wpdb->prepare($q, array( $postmeta_info, $v->b_meta_id ))); } // write log $pid_log = $last_log_pid == $v->post_id ? '.' : $v->post_id; self::debug('notify_img [status] ' . $status . " \t\t[pid] " . $pid_log . " \t\t[id] " . $v->id); $last_log_pid = $v->post_id; } self::save_summary(); // Mark need_pull tag for cron self::update_option(self::DB_NEED_PULL, self::STATUS_NOTIFIED); } else { // Other errors will directly remove the working records // Delete from working table $q = "DELETE FROM `$this->_table_img_optming` WHERE id IN ( " . implode(',', array_fill(0, count($notified_data), '%d')) . ' ) '; $wpdb->query($wpdb->prepare($q, $notified_data)); } return Cloud::ok(array( 'count' => count($notified_data) )); } /** * Cron start async req * * @since 5.5 */ public static function start_async_cron() { Task::async_call('imgoptm'); } /** * Manually start async req * * @since 5.5 */ public static function start_async() { Task::async_call('imgoptm_force'); $msg = __('Started async image optimization request', 'litespeed-cache'); Admin_Display::success($msg); } /** * Check if need to pull or not * * @since 7.2 */ public static function need_pull() { $tag = self::get_option(self::DB_NEED_PULL); if (!$tag || $tag != self::STATUS_NOTIFIED) { return false; } return true; } /** * Ajax req handler * * @since 5.5 */ public static function async_handler( $force = false ) { self::debug('------------async-------------start_async_handler'); if (!self::need_pull()) { self::debug('❌ no need pull'); return; } if (defined('LITESPEED_IMG_OPTM_PULL_CRON') && !constant('LITESPEED_IMG_OPTM_PULL_CRON')) { self::debug('Cron disabled [define] LITESPEED_IMG_OPTM_PULL_CRON'); return; } self::cls()->pull($force); } /** * Calculate pull threads * * @since 5.8 * @access private */ private function _calc_pull_threads() { global $wpdb; if (defined('LITESPEED_IMG_OPTM_PULL_THREADS')) { return constant('LITESPEED_IMG_OPTM_PULL_THREADS'); } // Tune number of images per request based on number of images waiting and cloud packages $imgs_per_req = 1; // base 1, ramp up to ~50 max // Ramp up the request rate based on how many images are waiting $c = "SELECT count(id) FROM `$this->_table_img_optming` WHERE optm_status = %d"; $_c = $wpdb->prepare($c, array( self::STATUS_NOTIFIED )); $images_waiting = $wpdb->get_var($_c); if ($images_waiting && $images_waiting > 0) { $imgs_per_req = ceil($images_waiting / 1000); // ie. download 5/request if 5000 images are waiting } // Cap the request rate at 50 images per request $imgs_per_req = min(50, $imgs_per_req); self::debug('Pulling images at rate: ' . $imgs_per_req . ' Images per request.'); return $imgs_per_req; } /** * Pull optimized img * * @since 1.6 * @access public */ public function pull( $manual = false ) { global $wpdb; $timeoutLimit = ini_get('max_execution_time'); $endts = time() + $timeoutLimit; self::debug('' . ($manual ? 'Manually' : 'Cron') . ' pull started [timeout: ' . $timeoutLimit . 's]'); if ($this->cron_running()) { self::debug('Pull cron is running'); $msg = __('Pull Cron is running', 'litespeed-cache'); Admin_Display::note($msg); return; } $this->_summary['last_pulled'] = time(); $this->_summary['last_pulled_by_cron'] = !$manual; self::save_summary(); $imgs_per_req = $this->_calc_pull_threads(); $q = "SELECT * FROM `$this->_table_img_optming` WHERE optm_status = %d ORDER BY id LIMIT %d"; $_q = $wpdb->prepare($q, array( self::STATUS_NOTIFIED, $imgs_per_req )); $rm_ori_bkup = $this->conf(self::O_IMG_OPTM_RM_BKUP); $total_pulled_ori = 0; $total_pulled_webp = 0; $total_pulled_avif = 0; $server_list = []; try { while ($img_rows = $wpdb->get_results($_q)) { self::debug('timeout left: ' . ($endts - time()) . 's'); if (function_exists('set_time_limit')) { $endts += 600; self::debug('Endtime extended to ' . date('Ymd H:i:s', $endts)); set_time_limit(600); // This will be no more important as we use noabort now } // Disabled as we use noabort // if ($endts - time() < 10) { // self::debug("🚨 End loop due to timeout limit reached " . $timeoutLimit . "s"); // break; // } /** * Update cron timestamp to avoid duplicated running * * @since 1.6.2 */ $this->_update_cron_running(); // Run requests in parallel $requests = []; // store each request URL for Requests::request_multiple() $imgs_by_req = []; // store original request data so that we can reference it in the response $req_counter = 0; foreach ($img_rows as $row_img) { // request original image $server_info = \json_decode($row_img->server_info, true); if (!empty($server_info['ori'])) { $image_url = $server_info['server'] . '/' . $server_info['ori']; self::debug('Queueing pull: ' . $image_url); $requests[$req_counter] = array( 'url' => $image_url, 'type' => 'GET', ); $imgs_by_req[$req_counter++] = array( 'type' => 'ori', 'data' => $row_img, ); } // request webp image $webp_size = 0; if (!empty($server_info['webp'])) { $image_url = $server_info['server'] . '/' . $server_info['webp']; self::debug('Queueing pull WebP: ' . $image_url); $requests[$req_counter] = array( 'url' => $image_url, 'type' => 'GET', ); $imgs_by_req[$req_counter++] = array( 'type' => 'webp', 'data' => $row_img, ); } // request avif image $avif_size = 0; if (!empty($server_info['avif'])) { $image_url = $server_info['server'] . '/' . $server_info['avif']; self::debug('Queueing pull AVIF: ' . $image_url); $requests[$req_counter] = array( 'url' => $image_url, 'type' => 'GET', ); $imgs_by_req[$req_counter++] = array( 'type' => 'avif', 'data' => $row_img, ); } } self::debug('Loaded images count: ' . $req_counter); $complete_action = function ( $response, $req_count ) use ( $imgs_by_req, $rm_ori_bkup, &$total_pulled_ori, &$total_pulled_webp, &$total_pulled_avif, &$server_list ) { global $wpdb; $row_data = isset($imgs_by_req[$req_count]) ? $imgs_by_req[$req_count] : false; if (false === $row_data) { self::debug('❌ failed to pull image: Request not found in lookup variable.'); return; } $row_type = isset($row_data['type']) ? $row_data['type'] : 'ori'; $row_img = $row_data['data']; $local_file = $this->wp_upload_dir['basedir'] . '/' . $row_img->src; $server_info = \json_decode($row_img->server_info, true); // Handle status_code 404/5xx too as its success=true if ( empty( $response->success ) || empty( $response->status_code ) || 200 !== $response->status_code ) { self::debug('❌ Failed to pull optimized img: HTTP error [status_code] ' . ( empty( $response->status_code ) ? 'N/A' : $response->status_code )); $this->_step_back_image($row_img->id); $msg = __('Some optimized image file(s) has expired and was cleared.', 'litespeed-cache'); Admin_Display::error($msg); return; } if ('webp' === $row_type) { file_put_contents($local_file . '.webp', $response->body); if (!file_exists($local_file . '.webp') || !filesize($local_file . '.webp') || md5_file($local_file . '.webp') !== $server_info['webp_md5']) { self::debug('❌ Failed to pull optimized webp img: file md5 mismatch, server md5: ' . $server_info['webp_md5']); // Delete working table $q = "DELETE FROM `$this->_table_img_optming` WHERE id = %d "; $wpdb->query($wpdb->prepare($q, $row_img->id)); $msg = __('Pulled WebP image md5 does not match the notified WebP image md5.', 'litespeed-cache'); Admin_Display::error($msg); return; } self::debug('Pulled optimized img WebP: ' . $local_file . '.webp'); $webp_size = filesize($local_file . '.webp'); /** * API for WebP * * @since 2.9.5 * @since 3.0 $row_img less elements (see above one) * @see #751737 - API docs for WEBP generation */ do_action('litespeed_img_pull_webp', $row_img, $local_file . '.webp'); ++$total_pulled_webp; } elseif ('avif' === $row_type) { file_put_contents($local_file . '.avif', $response->body); if (!file_exists($local_file . '.avif') || !filesize($local_file . '.avif') || md5_file($local_file . '.avif') !== $server_info['avif_md5']) { self::debug('❌ Failed to pull optimized avif img: file md5 mismatch, server md5: ' . $server_info['avif_md5']); // Delete working table $q = "DELETE FROM `$this->_table_img_optming` WHERE id = %d "; $wpdb->query($wpdb->prepare($q, $row_img->id)); $msg = __('Pulled AVIF image md5 does not match the notified AVIF image md5.', 'litespeed-cache'); Admin_Display::error($msg); return; } self::debug('Pulled optimized img AVIF: ' . $local_file . '.avif'); $avif_size = filesize($local_file . '.avif'); /** * API for AVIF * * @since 7.0 */ do_action('litespeed_img_pull_avif', $row_img, $local_file . '.avif'); ++$total_pulled_avif; } else { // "ori" image type file_put_contents($local_file . '.tmp', $response->body); if (!file_exists($local_file . '.tmp') || !filesize($local_file . '.tmp') || md5_file($local_file . '.tmp') !== $server_info['ori_md5']) { self::debug( '❌ Failed to pull optimized img: file md5 mismatch [url] ' . $server_info['server'] . '/' . $server_info['ori'] . ' [server_md5] ' . $server_info['ori_md5'] ); // Delete working table $q = "DELETE FROM `$this->_table_img_optming` WHERE id = %d "; $wpdb->query($wpdb->prepare($q, $row_img->id)); $msg = __('One or more pulled images does not match with the notified image md5', 'litespeed-cache'); Admin_Display::error($msg); return; } // Backup ori img if (!$rm_ori_bkup) { $extension = pathinfo($local_file, PATHINFO_EXTENSION); $bk_file = substr($local_file, 0, -strlen($extension)) . 'bk.' . $extension; file_exists($local_file) && rename($local_file, $bk_file); } // Replace ori img rename($local_file . '.tmp', $local_file); self::debug('Pulled optimized img: ' . $local_file); /** * API Hook * * @since 2.9.5 * @since 3.0 $row_img has less elements now. Most useful ones are `post_id`/`src` */ do_action('litespeed_img_pull_ori', $row_img, $local_file); self::debug2('Remove _table_img_optming record [id] ' . $row_img->id); } // Delete working table $q = "DELETE FROM `$this->_table_img_optming` WHERE id = %d "; $wpdb->query($wpdb->prepare($q, $row_img->id)); // Save server_list to notify taken if (empty($server_list[$server_info['server']])) { $server_list[$server_info['server']] = []; } $server_info_id = !empty($server_info['file_id']) ? $server_info['file_id'] : $server_info['id']; $server_list[$server_info['server']][] = $server_info_id; ++$total_pulled_ori; }; $force_wp_remote_get = defined('LITESPEED_FORCE_WP_REMOTE_GET') && constant('LITESPEED_FORCE_WP_REMOTE_GET'); if (!$force_wp_remote_get && class_exists('\WpOrg\Requests\Requests') && class_exists('\WpOrg\Requests\Autoload')) { // Make sure Requests can load internal classes. Autoload::register(); // Run pull requests in parallel Requests::request_multiple($requests, [ 'timeout' => 60, 'connect_timeout' => 60, 'complete' => $complete_action, 'verify' => false, 'verifyname' => false, ]); } else { foreach ($requests as $cnt => $req) { $wp_response = wp_safe_remote_get($req['url'], [ 'timeout' => 60 ]); $request_response = [ 'success' => false, 'status_code' => 0, 'body' => null, 'sslverify' => false ]; if (is_wp_error($wp_response)) { $error_message = $wp_response->get_error_message(); self::debug('❌ failed to pull image: ' . $error_message); } else { $request_response['success'] = true; $request_response['status_code'] = $wp_response['response']['code']; $request_response['body'] = $wp_response['body']; } self::debug('response code [code] ' . $wp_response['response']['code'] . ' [url] ' . $req['url']); $request_response = (object) $request_response; $complete_action($request_response, $cnt); } } self::debug('Current batch pull finished'); } } catch (\Exception $e) { Admin_Display::error('Image pull process failure: ' . $e->getMessage()); } // Notify IAPI images taken foreach ($server_list as $server => $img_list) { $data = array( 'action' => self::CLOUD_ACTION_TAKEN, 'list' => $img_list, 'server' => $server, ); // TODO: improve this so we do not call once per server, but just once and then filter on the server side Cloud::post(Cloud::SVC_IMG_OPTM, $data); } if (empty($this->_summary['img_taken'])) { $this->_summary['img_taken'] = 0; } $this->_summary['img_taken'] += $total_pulled_ori + $total_pulled_webp + $total_pulled_avif; self::save_summary(); // Manually running needs to roll back timestamp for next running if ($manual) { $this->_update_cron_running(true); } // $msg = sprintf(__('Pulled %d image(s)', 'litespeed-cache'), $total_pulled_ori + $total_pulled_webp); // Admin_Display::success($msg); // Check if there is still task in queue $q = "SELECT * FROM `$this->_table_img_optming` WHERE optm_status = %d LIMIT 1"; $to_be_continued = $wpdb->get_row($wpdb->prepare($q, self::STATUS_NOTIFIED)); if ($to_be_continued) { self::debug('Task in queue, to be continued...'); return; // return Router::self_redirect(Router::ACTION_IMG_OPTM, self::TYPE_PULL); } // If all pulled, update tag to done self::debug('Marked pull status to all pulled'); self::update_option(self::DB_NEED_PULL, self::STATUS_PULLED); } /** * Push image back to previous status * * @since 3.0 * @access private */ private function _step_back_image( $id ) { global $wpdb; self::debug('Push image back to new status [id] ' . $id); // Reset the image to gathered status $q = "UPDATE `$this->_table_img_optming` SET optm_status = %d WHERE id = %d "; $wpdb->query($wpdb->prepare($q, array( self::STATUS_RAW, $id ))); } /** * Parse wp's meta value * * @since 1.6.7 * @access private */ private function _parse_wp_meta_value( $v ) { if (empty($v)) { self::debug('bypassed parsing meta due to null value'); return false; } if (!$v->meta_value) { self::debug('bypassed parsing meta due to no meta_value: pid ' . $v->post_id); return false; } $meta_value = @maybe_unserialize($v->meta_value); if (!is_array($meta_value)) { self::debug('bypassed parsing meta due to meta_value not json: pid ' . $v->post_id); return false; } if (empty($meta_value['file'])) { self::debug('bypassed parsing meta due to no ori file: pid ' . $v->post_id); return false; } return $meta_value; } /** * Clean up all unfinished queue locally and to Cloud server * * @since 2.1.2 * @access public */ public function clean() { global $wpdb; // Reset img_optm table's queue if ($this->__data->tb_exist('img_optming')) { // Get min post id to mark $q = "SELECT MIN(post_id) FROM `$this->_table_img_optming`"; $min_pid = $wpdb->get_var($q) - 1; if ($this->_summary['next_post_id'] > $min_pid) { $this->_summary['next_post_id'] = $min_pid; self::save_summary(); } $q = "DELETE FROM `$this->_table_img_optming`"; $wpdb->query($q); } $msg = __('Cleaned up unfinished data successfully.', 'litespeed-cache'); Admin_Display::success($msg); } /** * Reset image counter * * @since 7.0 * @access private */ private function _reset_counter() { self::debug('reset image optm counter'); $this->_summary['next_post_id'] = 0; self::save_summary(); $this->clean(); $msg = __('Reset image optimization counter successfully.', 'litespeed-cache'); Admin_Display::success($msg); } /** * Destroy all optimized images * * @since 3.0 * @access private */ private function _destroy() { global $wpdb; self::debug('executing DESTROY process'); $offset = !empty($_GET['litespeed_i']) ? $_GET['litespeed_i'] : 0; /** * Limit images each time before redirection to fix Out of memory issue. #665465 * * @since 2.9.8 */ // Start deleting files $limit = apply_filters('litespeed_imgoptm_destroy_max_rows', 500); $img_q = "SELECT b.post_id, b.meta_value FROM `$wpdb->posts` a LEFT JOIN `$wpdb->postmeta` b ON b.post_id = a.ID WHERE b.meta_key = '_wp_attachment_metadata' AND a.post_type = 'attachment' AND a.post_status = 'inherit' AND a.post_mime_type IN ('image/jpeg', 'image/png', 'image/gif') ORDER BY a.ID LIMIT %d,%d "; $q = $wpdb->prepare($img_q, array( $offset * $limit, $limit )); $list = $wpdb->get_results($q); $i = 0; foreach ($list as $v) { if (!$v->post_id) { continue; } $meta_value = $this->_parse_wp_meta_value($v); if (!$meta_value) { continue; } ++$i; $this->tmp_pid = $v->post_id; $this->tmp_path = pathinfo($meta_value['file'], PATHINFO_DIRNAME) . '/'; $this->_destroy_optm_file($meta_value, true); if (!empty($meta_value['sizes'])) { array_map(array( $this, '_destroy_optm_file' ), $meta_value['sizes']); } } self::debug('batch switched images total: ' . $i); ++$offset; $to_be_continued = $wpdb->get_row($wpdb->prepare($img_q, array( $offset * $limit, 1 ))); if ($to_be_continued) { // Check if post_id is beyond next_post_id self::debug('[next_post_id] ' . $this->_summary['next_post_id'] . ' [cursor post id] ' . $to_be_continued->post_id); if ($to_be_continued->post_id <= $this->_summary['next_post_id']) { self::debug('redirecting to next'); return Router::self_redirect(Router::ACTION_IMG_OPTM, self::TYPE_DESTROY); } self::debug('🎊 Finished destroying'); } // Delete postmeta info $q = "DELETE FROM `$wpdb->postmeta` WHERE meta_key = %s"; $wpdb->query($wpdb->prepare($q, self::DB_SIZE)); $wpdb->query($wpdb->prepare($q, self::DB_SET)); // Delete img_optm table $this->__data->tb_del('img_optm'); $this->__data->tb_del('img_optming'); // Clear options table summary info self::delete_option('_summary'); self::delete_option(self::DB_NEED_PULL); $msg = __('Destroy all optimization data successfully.', 'litespeed-cache'); Admin_Display::success($msg); } /** * Destroy optm file */ private function _destroy_optm_file( $meta_value, $is_ori_file = false ) { $short_file_path = $meta_value['file']; if (!$is_ori_file) { $short_file_path = $this->tmp_path . $short_file_path; } self::debug('deleting ' . $short_file_path); // del webp $this->__media->info($short_file_path . '.webp', $this->tmp_pid) && $this->__media->del($short_file_path . '.webp', $this->tmp_pid); $this->__media->info($short_file_path . '.optm.webp', $this->tmp_pid) && $this->__media->del($short_file_path . '.optm.webp', $this->tmp_pid); // del avif $this->__media->info($short_file_path . '.avif', $this->tmp_pid) && $this->__media->del($short_file_path . '.avif', $this->tmp_pid); $this->__media->info($short_file_path . '.optm.avif', $this->tmp_pid) && $this->__media->del($short_file_path . '.optm.avif', $this->tmp_pid); $extension = pathinfo($short_file_path, PATHINFO_EXTENSION); $local_filename = substr($short_file_path, 0, -strlen($extension) - 1); $bk_file = $local_filename . '.bk.' . $extension; $bk_optm_file = $local_filename . '.bk.optm.' . $extension; // del optimized ori if ($this->__media->info($bk_file, $this->tmp_pid)) { self::debug('deleting optim ori'); $this->__media->del($short_file_path, $this->tmp_pid); $this->__media->rename($bk_file, $short_file_path, $this->tmp_pid); } $this->__media->info($bk_optm_file, $this->tmp_pid) && $this->__media->del($bk_optm_file, $this->tmp_pid); } /** * Rescan to find new generated images * * @since 1.6.7 * @access private */ private function _rescan() { global $wpdb; exit('tobedone'); $offset = !empty($_GET['litespeed_i']) ? $_GET['litespeed_i'] : 0; $limit = 500; self::debug('rescan images'); // Get images $q = "SELECT b.post_id, b.meta_value FROM `$wpdb->posts` a, `$wpdb->postmeta` b WHERE a.post_type = 'attachment' AND a.post_status = 'inherit' AND a.post_mime_type IN ('image/jpeg', 'image/png', 'image/gif') AND a.ID = b.post_id AND b.meta_key = '_wp_attachment_metadata' ORDER BY a.ID LIMIT %d, %d "; $list = $wpdb->get_results($wpdb->prepare($q, $offset * $limit, $limit + 1)); // last one is the seed for next batch if (!$list) { $msg = __('Rescanned successfully.', 'litespeed-cache'); Admin_Display::success($msg); self::debug('rescan bypass: no gathered image found'); return; } if (count($list) == $limit + 1) { $to_be_continued = true; array_pop($list); // last one is the seed for next round, discard here. } else { $to_be_continued = false; } // Prepare post_ids to inquery gathered images $pid_set = []; $scanned_list = []; foreach ($list as $v) { $meta_value = $this->_parse_wp_meta_value($v); if (!$meta_value) { continue; } $scanned_list[] = array( 'pid' => $v->post_id, 'meta' => $meta_value, ); $pid_set[] = $v->post_id; } // Build gathered images $q = "SELECT src, post_id FROM `$this->_table_img_optm` WHERE post_id IN (" . implode(',', array_fill(0, count($pid_set), '%d')) . ')'; $list = $wpdb->get_results($wpdb->prepare($q, $pid_set)); foreach ($list as $v) { $this->_existed_src_list[] = $v->post_id . '.' . $v->src; } // Find new images foreach ($scanned_list as $v) { $meta_value = $v['meta']; // Parse all child src and put them into $this->_img_in_queue, missing ones to $this->_img_in_queue_missed $this->tmp_pid = $v['pid']; $this->tmp_path = pathinfo($meta_value['file'], PATHINFO_DIRNAME) . '/'; $this->_append_img_queue($meta_value, true); if (!empty($meta_value['sizes'])) { foreach( $meta_value['sizes'] as $img_size_name => $img_size ){ $this->_append_img_queue($img_size, false, $img_size_name ); } } } self::debug('rescanned [img] ' . count($this->_img_in_queue)); $count = count($this->_img_in_queue); if ($count > 0) { // Save to DB $this->_save_raw(); } if ($to_be_continued) { return Router::self_redirect(Router::ACTION_IMG_OPTM, self::TYPE_RESCAN); } $msg = $count ? sprintf(__('Rescanned %d images successfully.', 'litespeed-cache'), $count) : __('Rescanned successfully.', 'litespeed-cache'); Admin_Display::success($msg); } /** * Calculate bkup original images storage * * @since 2.2.6 * @access private */ private function _calc_bkup() { global $wpdb; $offset = !empty($_GET['litespeed_i']) ? $_GET['litespeed_i'] : 0; $limit = 500; if (!$offset) { $this->_summary['bk_summary'] = array( 'date' => time(), 'count' => 0, 'sum' => 0, ); } $img_q = "SELECT b.post_id, b.meta_value FROM `$wpdb->posts` a LEFT JOIN `$wpdb->postmeta` b ON b.post_id = a.ID WHERE b.meta_key = '_wp_attachment_metadata' AND a.post_type = 'attachment' AND a.post_status = 'inherit' AND a.post_mime_type IN ('image/jpeg', 'image/png', 'image/gif') ORDER BY a.ID LIMIT %d,%d "; $q = $wpdb->prepare($img_q, array( $offset * $limit, $limit )); $list = $wpdb->get_results($q); foreach ($list as $v) { if (!$v->post_id) { continue; } $meta_value = $this->_parse_wp_meta_value($v); if (!$meta_value) { continue; } $this->tmp_pid = $v->post_id; $this->tmp_path = pathinfo($meta_value['file'], PATHINFO_DIRNAME) . '/'; $this->_get_bk_size($meta_value, true); if (!empty($meta_value['sizes'])) { array_map(array( $this, '_get_bk_size' ), $meta_value['sizes']); } } $this->_summary['bk_summary']['date'] = time(); self::save_summary(); self::debug('_calc_bkup total: ' . $this->_summary['bk_summary']['count'] . ' [size] ' . $this->_summary['bk_summary']['sum']); ++$offset; $to_be_continued = $wpdb->get_row($wpdb->prepare($img_q, array( $offset * $limit, 1 ))); if ($to_be_continued) { return Router::self_redirect(Router::ACTION_IMG_OPTM, self::TYPE_CALC_BKUP); } $msg = __('Calculated backups successfully.', 'litespeed-cache'); Admin_Display::success($msg); } /** * Calculate single size */ private function _get_bk_size( $meta_value, $is_ori_file = false ) { $short_file_path = $meta_value['file']; if (!$is_ori_file) { $short_file_path = $this->tmp_path . $short_file_path; } $extension = pathinfo($short_file_path, PATHINFO_EXTENSION); $local_filename = substr($short_file_path, 0, -strlen($extension) - 1); $bk_file = $local_filename . '.bk.' . $extension; $img_info = $this->__media->info($bk_file, $this->tmp_pid); if (!$img_info) { return; } ++$this->_summary['bk_summary']['count']; $this->_summary['bk_summary']['sum'] += $img_info['size']; } /** * Delete bkup original images storage * * @since 2.5 * @access public */ public function rm_bkup() { global $wpdb; if (!$this->__data->tb_exist('img_optming')) { return; } $offset = !empty($_GET['litespeed_i']) ? $_GET['litespeed_i'] : 0; $limit = 500; if (empty($this->_summary['rmbk_summary'])) { $this->_summary['rmbk_summary'] = array( 'date' => time(), 'count' => 0, 'sum' => 0, ); } $img_q = "SELECT b.post_id, b.meta_value FROM `$wpdb->posts` a LEFT JOIN `$wpdb->postmeta` b ON b.post_id = a.ID WHERE b.meta_key = '_wp_attachment_metadata' AND a.post_type = 'attachment' AND a.post_status = 'inherit' AND a.post_mime_type IN ('image/jpeg', 'image/png', 'image/gif') ORDER BY a.ID LIMIT %d,%d "; $q = $wpdb->prepare($img_q, array( $offset * $limit, $limit )); $list = $wpdb->get_results($q); foreach ($list as $v) { if (!$v->post_id) { continue; } $meta_value = $this->_parse_wp_meta_value($v); if (!$meta_value) { continue; } $this->tmp_pid = $v->post_id; $this->tmp_path = pathinfo($meta_value['file'], PATHINFO_DIRNAME) . '/'; $this->_del_bk_file($meta_value, true); if (!empty($meta_value['sizes'])) { array_map(array( $this, '_del_bk_file' ), $meta_value['sizes']); } } $this->_summary['rmbk_summary']['date'] = time(); self::save_summary(); self::debug('rm_bkup total: ' . $this->_summary['rmbk_summary']['count'] . ' [size] ' . $this->_summary['rmbk_summary']['sum']); ++$offset; $to_be_continued = $wpdb->get_row($wpdb->prepare($img_q, array( $offset * $limit, 1 ))); if ($to_be_continued) { return Router::self_redirect(Router::ACTION_IMG_OPTM, self::TYPE_RM_BKUP); } $msg = __('Removed backups successfully.', 'litespeed-cache'); Admin_Display::success($msg); } /** * Delete single file */ private function _del_bk_file( $meta_value, $is_ori_file = false ) { $short_file_path = $meta_value['file']; if (!$is_ori_file) { $short_file_path = $this->tmp_path . $short_file_path; } $extension = pathinfo($short_file_path, PATHINFO_EXTENSION); $local_filename = substr($short_file_path, 0, -strlen($extension) - 1); $bk_file = $local_filename . '.bk.' . $extension; $img_info = $this->__media->info($bk_file, $this->tmp_pid); if (!$img_info) { return; } ++$this->_summary['rmbk_summary']['count']; $this->_summary['rmbk_summary']['sum'] += $img_info['size']; $this->__media->del($bk_file, $this->tmp_pid); } /** * Count images * * @since 1.6 * @access public */ public function img_count() { global $wpdb; $q = "SELECT count(*) FROM `$wpdb->posts` a LEFT JOIN `$wpdb->postmeta` b ON b.post_id = a.ID WHERE b.meta_key = '_wp_attachment_metadata' AND a.post_type = 'attachment' AND a.post_status = 'inherit' AND a.post_mime_type IN ('image/jpeg', 'image/png', 'image/gif') "; $groups_all = $wpdb->get_var($q); $groups_new = $wpdb->get_var($q . ' AND ID>' . (int) $this->_summary['next_post_id'] . ' ORDER BY ID'); $groups_done = $wpdb->get_var($q . ' AND ID<=' . (int) $this->_summary['next_post_id'] . ' ORDER BY ID'); $q = "SELECT b.post_id FROM `$wpdb->posts` a LEFT JOIN `$wpdb->postmeta` b ON b.post_id = a.ID WHERE b.meta_key = '_wp_attachment_metadata' AND a.post_type = 'attachment' AND a.post_status = 'inherit' AND a.post_mime_type IN ('image/jpeg', 'image/png', 'image/gif') ORDER BY a.ID DESC LIMIT 1 "; $max_id = $wpdb->get_var($q); $count_list = array( 'max_id' => $max_id, 'groups_all' => $groups_all, 'groups_new' => $groups_new, 'groups_done' => $groups_done, ); // images count from work table if ($this->__data->tb_exist('img_optming')) { $q = "SELECT COUNT(DISTINCT post_id),COUNT(*) FROM `$this->_table_img_optming` WHERE optm_status = %d"; $groups_to_check = array( self::STATUS_RAW, self::STATUS_REQUESTED, self::STATUS_NOTIFIED, self::STATUS_ERR_FETCH ); foreach ($groups_to_check as $v) { $count_list['img.' . $v] = $count_list['group.' . $v] = 0; list($count_list['group.' . $v], $count_list['img.' . $v]) = $wpdb->get_row($wpdb->prepare($q, $v), ARRAY_N); } } return $count_list; } /** * Check if fetch cron is running * * @since 1.6.2 * @access public */ public function cron_running( $bool_res = true ) { $last_run = !empty($this->_summary['last_pull']) ? $this->_summary['last_pull'] : 0; $is_running = $last_run && time() - $last_run < 120; if ($bool_res) { return $is_running; } return array( $last_run, $is_running ); } /** * Update fetch cron timestamp tag * * @since 1.6.2 * @access private */ private function _update_cron_running( $done = false ) { $this->_summary['last_pull'] = time(); if ($done) { // Only update cron tag when its from the active running cron if ($this->_cron_ran) { // Rollback for next running $this->_summary['last_pull'] -= 120; } else { return; } } self::save_summary(); $this->_cron_ran = true; } /** * Batch switch images to ori/optm version * * @since 1.6.2 * @access public */ public function batch_switch( $type ) { global $wpdb; if (defined('LITESPEED_CLI') || wp_doing_cron()) { $offset = 0; while ($offset !== 'done') { Admin_Display::info("Starting switch to $type [offset] $offset"); $offset = $this->_batch_switch($type, $offset); } } else { $offset = !empty($_GET['litespeed_i']) ? $_GET['litespeed_i'] : 0; $newOffset = $this->_batch_switch($type, $offset); if ($newOffset !== 'done') { return Router::self_redirect(Router::ACTION_IMG_OPTM, $type); } } $msg = __('Switched images successfully.', 'litespeed-cache'); Admin_Display::success($msg); } /** * Switch images per offset */ private function _batch_switch( $type, $offset ) { global $wpdb; $limit = 500; $this->tmp_type = $type; $img_q = "SELECT b.post_id, b.meta_value FROM `$wpdb->posts` a LEFT JOIN `$wpdb->postmeta` b ON b.post_id = a.ID WHERE b.meta_key = '_wp_attachment_metadata' AND a.post_type = 'attachment' AND a.post_status = 'inherit' AND a.post_mime_type IN ('image/jpeg', 'image/png', 'image/gif') ORDER BY a.ID LIMIT %d,%d "; $q = $wpdb->prepare($img_q, array( $offset * $limit, $limit )); $list = $wpdb->get_results($q); $i = 0; foreach ($list as $v) { if (!$v->post_id) { continue; } $meta_value = $this->_parse_wp_meta_value($v); if (!$meta_value) { continue; } ++$i; $this->tmp_pid = $v->post_id; $this->tmp_path = pathinfo($meta_value['file'], PATHINFO_DIRNAME) . '/'; $this->_switch_bk_file($meta_value, true); if (!empty($meta_value['sizes'])) { array_map(array( $this, '_switch_bk_file' ), $meta_value['sizes']); } } self::debug('batch switched images total: ' . $i . ' [type] ' . $type); ++$offset; $to_be_continued = $wpdb->get_row($wpdb->prepare($img_q, array( $offset * $limit, 1 ))); if ($to_be_continued) { return $offset; } return 'done'; } /** * Delete single file */ private function _switch_bk_file( $meta_value, $is_ori_file = false ) { $short_file_path = $meta_value['file']; if (!$is_ori_file) { $short_file_path = $this->tmp_path . $short_file_path; } $extension = pathinfo($short_file_path, PATHINFO_EXTENSION); $local_filename = substr($short_file_path, 0, -strlen($extension) - 1); $bk_file = $local_filename . '.bk.' . $extension; $bk_optm_file = $local_filename . '.bk.optm.' . $extension; // self::debug('_switch_bk_file ' . $bk_file . ' [type] ' . $this->tmp_type); // switch to ori if ($this->tmp_type === self::TYPE_BATCH_SWITCH_ORI || $this->tmp_type == 'orig') { // self::debug('switch to orig ' . $bk_file); if (!$this->__media->info($bk_file, $this->tmp_pid)) { return; } $this->__media->rename($local_filename . '.' . $extension, $bk_optm_file, $this->tmp_pid); $this->__media->rename($bk_file, $local_filename . '.' . $extension, $this->tmp_pid); } // switch to optm elseif ($this->tmp_type === self::TYPE_BATCH_SWITCH_OPTM || $this->tmp_type == 'optm') { // self::debug('switch to optm ' . $bk_file); if (!$this->__media->info($bk_optm_file, $this->tmp_pid)) { return; } $this->__media->rename($local_filename . '.' . $extension, $bk_file, $this->tmp_pid); $this->__media->rename($bk_optm_file, $local_filename . '.' . $extension, $this->tmp_pid); } } /** * Switch image between original one and optimized one * * @since 1.6.2 * @access private */ private function _switch_optm_file( $type ) { Admin_Display::success(__('Switched to optimized file successfully.', 'litespeed-cache')); return; global $wpdb; $pid = substr($type, 4); $switch_type = substr($type, 0, 4); $q = "SELECT src,post_id FROM `$this->_table_img_optm` WHERE post_id = %d AND optm_status = %d"; $list = $wpdb->get_results($wpdb->prepare($q, array( $pid, self::STATUS_PULLED ))); $msg = 'Unknown Msg'; foreach ($list as $v) { // to switch webp file if ($switch_type === 'webp') { if ($this->__media->info($v->src . '.webp', $v->post_id)) { $this->__media->rename($v->src . '.webp', $v->src . '.optm.webp', $v->post_id); self::debug('Disabled WebP: ' . $v->src); $msg = __('Disabled WebP file successfully.', 'litespeed-cache'); } elseif ($this->__media->info($v->src . '.optm.webp', $v->post_id)) { $this->__media->rename($v->src . '.optm.webp', $v->src . '.webp', $v->post_id); self::debug('Enable WebP: ' . $v->src); $msg = __('Enabled WebP file successfully.', 'litespeed-cache'); } } // to switch avif file elseif ($switch_type === 'avif') { if ($this->__media->info($v->src . '.avif', $v->post_id)) { $this->__media->rename($v->src . '.avif', $v->src . '.optm.avif', $v->post_id); self::debug('Disabled AVIF: ' . $v->src); $msg = __('Disabled AVIF file successfully.', 'litespeed-cache'); } elseif ($this->__media->info($v->src . '.optm.avif', $v->post_id)) { $this->__media->rename($v->src . '.optm.avif', $v->src . '.avif', $v->post_id); self::debug('Enable AVIF: ' . $v->src); $msg = __('Enabled AVIF file successfully.', 'litespeed-cache'); } } // to switch original file else { $extension = pathinfo($v->src, PATHINFO_EXTENSION); $local_filename = substr($v->src, 0, -strlen($extension) - 1); $bk_file = $local_filename . '.bk.' . $extension; $bk_optm_file = $local_filename . '.bk.optm.' . $extension; // revert ori back if ($this->__media->info($bk_file, $v->post_id)) { $this->__media->rename($v->src, $bk_optm_file, $v->post_id); $this->__media->rename($bk_file, $v->src, $v->post_id); self::debug('Restore original img: ' . $bk_file); $msg = __('Restored original file successfully.', 'litespeed-cache'); } elseif ($this->__media->info($bk_optm_file, $v->post_id)) { $this->__media->rename($v->src, $bk_file, $v->post_id); $this->__media->rename($bk_optm_file, $v->src, $v->post_id); self::debug('Switch to optm img: ' . $v->src); $msg = __('Switched to optimized file successfully.', 'litespeed-cache'); } } } Admin_Display::success($msg); } /** * Delete one optm data and recover original file * * @since 2.4.2 * @access public */ public function reset_row( $post_id ) { global $wpdb; if (!$post_id) { return; } // Gathered image don't have DB_SIZE info yet // $size_meta = get_post_meta( $post_id, self::DB_SIZE, true ); // if ( ! $size_meta ) { // return; // } self::debug('_reset_row [pid] ' . $post_id); // TODO: Load image sub files $img_q = "SELECT b.post_id, b.meta_value FROM `$wpdb->postmeta` b WHERE b.post_id =%d AND b.meta_key = '_wp_attachment_metadata'"; $q = $wpdb->prepare($img_q, array( $post_id )); $v = $wpdb->get_row($q); $meta_value = $this->_parse_wp_meta_value($v); if ($meta_value) { $this->tmp_pid = $v->post_id; $this->tmp_path = pathinfo($meta_value['file'], PATHINFO_DIRNAME) . '/'; $this->_destroy_optm_file($meta_value, true); if (!empty($meta_value['sizes'])) { array_map(array( $this, '_destroy_optm_file' ), $meta_value['sizes']); } } delete_post_meta($post_id, self::DB_SIZE); delete_post_meta($post_id, self::DB_SET); $msg = __('Reset the optimized data successfully.', 'litespeed-cache'); Admin_Display::success($msg); } /** * Show an image's optm status * * @since 1.6.5 * @access public */ public function check_img() { global $wpdb; $pid = $_POST['data']; self::debug('Check image [ID] ' . $pid); $data = []; $data['img_count'] = $this->img_count(); $data['optm_summary'] = self::get_summary(); $data['_wp_attached_file'] = get_post_meta($pid, '_wp_attached_file', true); $data['_wp_attachment_metadata'] = get_post_meta($pid, '_wp_attachment_metadata', true); // Get img_optm data $q = "SELECT * FROM `$this->_table_img_optm` WHERE post_id = %d"; $list = $wpdb->get_results($wpdb->prepare($q, $pid)); $img_data = []; if ($list) { foreach ($list as $v) { $img_data[] = array( 'id' => $v->id, 'optm_status' => $v->optm_status, 'src' => $v->src, 'srcpath_md5' => $v->srcpath_md5, 'src_md5' => $v->src_md5, 'server_info' => $v->server_info, ); } } $data['img_data'] = $img_data; return array( '_res' => 'ok', 'data' => $data, ); } /** * Handle all request actions from main cls * * @since 2.0 * @access public */ public function handler() { $type = Router::verify_type(); switch ($type) { case self::TYPE_RESET_ROW: $this->reset_row(!empty($_GET['id']) ? $_GET['id'] : false); break; case self::TYPE_CALC_BKUP: $this->_calc_bkup(); break; case self::TYPE_RM_BKUP: $this->rm_bkup(); break; case self::TYPE_NEW_REQ: $this->new_req(); break; case self::TYPE_RESCAN: $this->_rescan(); break; case self::TYPE_RESET_COUNTER: $this->_reset_counter(); break; case self::TYPE_DESTROY: $this->_destroy(); break; case self::TYPE_CLEAN: $this->clean(); break; case self::TYPE_PULL: self::start_async(); break; case self::TYPE_BATCH_SWITCH_ORI: case self::TYPE_BATCH_SWITCH_OPTM: $this->batch_switch($type); break; case substr($type, 0, 4) === 'avif': case substr($type, 0, 4) === 'webp': case substr($type, 0, 4) === 'orig': $this->_switch_optm_file($type); break; default: break; } Admin::redirect(); } } src/root.cls.php 0000777 00000035156 15251157102 0007627 0 ustar 00 <?php // phpcs:ignoreFile /** * The abstract instance * * @since 3.0 */ namespace LiteSpeed; defined('WPINC') || exit(); abstract class Root { const CONF_FILE = '.litespeed_conf.dat'; // Instance set private static $_instances; private static $_options = array(); private static $_const_options = array(); private static $_primary_options = array(); private static $_network_options = array(); /** * Check if need to separate ccss for mobile * * @since 4.7 * @access protected */ protected function _separate_mobile() { return (wp_is_mobile() || apply_filters('litespeed_is_mobile', false)) && $this->conf(Base::O_CACHE_MOBILE); } /** * Log an error message * * @since 7.0 */ public static function debugErr( $msg, $backtrace_limit = false ) { $msg = '❌ ' . $msg; self::debug($msg, $backtrace_limit); } /** * Log a debug message. * * @since 4.4 * @access public */ public static function debug( $msg, $backtrace_limit = false ) { if (!defined('LSCWP_LOG')) { return; } if (defined('static::LOG_TAG')) { $msg = static::LOG_TAG . ' ' . $msg; } Debug2::debug($msg, $backtrace_limit); } /** * Log an advanced debug message. * * @since 4.4 * @access public */ public static function debug2( $msg, $backtrace_limit = false ) { if (!defined('LSCWP_LOG_MORE')) { return; } if (defined('static::LOG_TAG')) { $msg = static::LOG_TAG . ' ' . $msg; } Debug2::debug2($msg, $backtrace_limit); } /** * Check if there is cache folder for that type * * @since 3.0 */ public function has_cache_folder( $type ) { $subsite_id = is_multisite() && !is_network_admin() ? get_current_blog_id() : ''; if (file_exists(LITESPEED_STATIC_DIR . '/' . $type . '/' . $subsite_id)) { return true; } return false; } /** * Maybe make the cache folder if not existed * * @since 4.4.2 */ protected function _maybe_mk_cache_folder( $type ) { if (!$this->has_cache_folder($type)) { $subsite_id = is_multisite() && !is_network_admin() ? get_current_blog_id() : ''; $path = LITESPEED_STATIC_DIR . '/' . $type . '/' . $subsite_id; mkdir($path, 0755, true); } } /** * Delete file-based cache folder for that type * * @since 3.0 */ public function rm_cache_folder( $type ) { if (!$this->has_cache_folder($type)) { return; } $subsite_id = is_multisite() && !is_network_admin() ? get_current_blog_id() : ''; File::rrmdir(LITESPEED_STATIC_DIR . '/' . $type . '/' . $subsite_id); // Clear All summary data self::save_summary(false, false, true); if ($type == 'ccss' || $type == 'ucss') { Debug2::debug('[CSS] Cleared ' . $type . ' queue'); } elseif ($type == 'avatar') { Debug2::debug('[Avatar] Cleared ' . $type . ' queue'); } elseif ($type == 'css' || $type == 'js') { return; } else { Debug2::debug('[' . strtoupper($type) . '] Cleared ' . $type . ' queue'); } } /** * Build the static filepath * * @since 4.0 */ protected function _build_filepath_prefix( $type ) { $filepath_prefix = '/' . $type . '/'; if (is_multisite()) { $filepath_prefix .= get_current_blog_id() . '/'; } return $filepath_prefix; } /** * Load current queues from data file * * @since 4.1 * @since 4.3 Elevated to root.cls */ public function load_queue( $type ) { $filepath_prefix = $this->_build_filepath_prefix($type); $static_path = LITESPEED_STATIC_DIR . $filepath_prefix . '.litespeed_conf.dat'; $queue = array(); if (file_exists($static_path)) { $queue = \json_decode(file_get_contents($static_path), true) ?: array(); } return $queue; } /** * Save current queues to data file * * @since 4.1 * @since 4.3 Elevated to root.cls */ public function save_queue( $type, $list ) { $filepath_prefix = $this->_build_filepath_prefix($type); $static_path = LITESPEED_STATIC_DIR . $filepath_prefix . '.litespeed_conf.dat'; $data = \json_encode($list); File::save($static_path, $data, true); } /** * Clear all waiting queues * * @since 3.4 * @since 4.3 Elevated to root.cls */ public function clear_q( $type, $silent = false ) { $filepath_prefix = $this->_build_filepath_prefix($type); $static_path = LITESPEED_STATIC_DIR . $filepath_prefix . '.litespeed_conf.dat'; if (file_exists($static_path)) { $silent = false; unlink($static_path); } if (!$silent) { $msg = __('All QUIC.cloud service queues have been cleared.', 'litespeed-cache'); Admin_Display::success($msg); } } /** * Load an instance or create it if not existed * * @since 4.0 */ public static function cls( $cls = false, $unset = false, $data = false ) { if (!$cls) { $cls = self::ori_cls(); } $cls = __NAMESPACE__ . '\\' . $cls; $cls_tag = strtolower($cls); if (!isset(self::$_instances[$cls_tag])) { if ($unset) { return; } self::$_instances[$cls_tag] = new $cls($data); } elseif ($unset) { unset(self::$_instances[$cls_tag]); return; } return self::$_instances[$cls_tag]; } /** * Set one conf or confs */ public function set_conf( $id, $val = null ) { if (is_array($id)) { foreach ($id as $k => $v) { $this->set_conf($k, $v); } return; } self::$_options[$id] = $val; } /** * Set one primary conf or confs */ public function set_primary_conf( $id, $val = null ) { if (is_array($id)) { foreach ($id as $k => $v) { $this->set_primary_conf($k, $v); } return; } self::$_primary_options[$id] = $val; } /** * Set one network conf */ public function set_network_conf( $id, $val = null ) { if (is_array($id)) { foreach ($id as $k => $v) { $this->set_network_conf($k, $v); } return; } self::$_network_options[$id] = $val; } /** * Set one const conf */ public function set_const_conf( $id, $val ) { self::$_const_options[$id] = $val; } /** * Check if is overwritten by const * * @since 3.0 */ public function const_overwritten( $id ) { if (!isset(self::$_const_options[$id]) || self::$_const_options[$id] == self::$_options[$id]) { return null; } return self::$_const_options[$id]; } /** * Check if is overwritten by primary site * * @since 3.2.2 */ public function primary_overwritten( $id ) { if (!isset(self::$_primary_options[$id]) || self::$_primary_options[$id] == self::$_options[$id]) { return null; } // Network admin settings is impossible to be overwritten by primary if (is_network_admin()) { return null; } return self::$_primary_options[$id]; } /** * Check if is overwritten by filter. * * @since 7.7 */ public function filter_overwritten( $id ) { $val_setting = $this->conf($id, true); // if setting not found if( null === $val_setting ){ return null; } $filter_name = 'litespeed_conf_load_option_' . $id; $val_filter = apply_filters($filter_name, $val_setting ); if ($val_setting === $val_filter) { // If the value is the same, return null. return null; } return $val_filter; } /** * Check if is overwritten by code filter * * @deprecated 7.7 Use general filter_overwritten() * @since 7.4 */ public function deprecated_filter_overwritten( $id ) { $cls_admin_display = Admin_Display::$settings_filters; // Check if filter name is set. if(!isset($cls_admin_display[$id]) || !isset($cls_admin_display[$id]['filter']) || is_array($cls_admin_display[$id]['filter']) ){ return null; } $val_setting = $this->conf($id, true); // if setting not found if( null === $val_setting ){ $val_setting = ''; } $val_filter = apply_filters($cls_admin_display[$id]['filter'], $val_setting ); if ($val_setting === $val_filter) { // If the value is the same, return null. return null; } return $val_filter; } /** * Check if is overwritten by $SERVER variable * * @since 7.4 */ public function server_overwritten( $id ) { $cls_admin_display = Admin_Display::$settings_filters; if(!isset($cls_admin_display[$id]['filter'])){ return null; } if(!is_array($cls_admin_display[$id]['filter'])) { $cls_admin_display[$id]['filter'] = array( $cls_admin_display[$id]['filter'] ); } foreach( $cls_admin_display[$id]['filter'] as $variable ){ if(isset($_SERVER[$variable])) { return [ $variable , $_SERVER[$variable] ] ; } } return null; } /** * Get the list of configured options for the blog. * * @since 1.0 */ public function get_options( $ori = false ) { if (!$ori) { return array_merge(self::$_options, self::$_primary_options, self::$_network_options, self::$_const_options); } return self::$_options; } /** * If has a conf or not */ public function has_conf( $id ) { return array_key_exists($id, self::$_options); } /** * If has a primary conf or not */ public function has_primary_conf( $id ) { return array_key_exists($id, self::$_primary_options); } /** * If has a network conf or not */ public function has_network_conf( $id ) { return array_key_exists($id, self::$_network_options); } /** * Get conf */ public function conf( $id, $ori = false ) { if (isset(self::$_options[$id])) { if (!$ori) { $val = $this->const_overwritten($id); if ($val !== null) { defined('LSCWP_LOG') && Debug2::debug('[Conf] 🏛️ const option ' . $id . '=' . var_export($val, true)); return $val; } $val = $this->primary_overwritten($id); // Network Use primary site settings if ($val !== null) { return $val; } $val = $this->filter_overwritten($id); if ($val !== null) { return $val; } } // Network original value will be in _network_options if (!is_network_admin() || !$this->has_network_conf($id)) { return self::$_options[$id]; } } if ($this->has_network_conf($id)) { if (!$ori) { $val = $this->const_overwritten($id); if ($val !== null) { defined('LSCWP_LOG') && Debug2::debug('[Conf] 🏛️ const option ' . $id . '=' . var_export($val, true)); return $val; } } return $this->network_conf($id); } defined('LSCWP_LOG') && Debug2::debug('[Conf] Invalid option ID ' . $id); return null; } /** * Get primary conf */ public function primary_conf( $id ) { return self::$_primary_options[$id]; } /** * Get network conf */ public function network_conf( $id ) { if (!$this->has_network_conf($id)) { return null; } return self::$_network_options[$id]; } /** * Get called class short name */ public static function ori_cls() { $cls = new \ReflectionClass(get_called_class()); $shortname = $cls->getShortName(); $namespace = str_replace(__NAMESPACE__ . '\\', '', $cls->getNamespaceName() . '\\'); if ($namespace) { // the left namespace after dropped LiteSpeed $shortname = $namespace . $shortname; } return $shortname; } /** * Generate conf name for wp_options record * * @since 3.0 */ public static function name( $id ) { $name = strtolower(self::ori_cls()); return 'litespeed.' . $name . '.' . $id; } /** * Dropin with prefix for WP's get_option * * @since 3.0 */ public static function get_option( $id, $default_v = false ) { $v = get_option(self::name($id), $default_v); // Maybe decode array if (is_array($default_v)) { $v = self::_maybe_decode($v); } return $v; } /** * Dropin with prefix for WP's get_site_option * * @since 3.0 */ public static function get_site_option( $id, $default_v = false ) { $v = get_site_option(self::name($id), $default_v); // Maybe decode array if (is_array($default_v)) { $v = self::_maybe_decode($v); } return $v; } /** * Dropin with prefix for WP's get_blog_option * * @since 3.0 */ public static function get_blog_option( $blog_id, $id, $default_v = false ) { $v = get_blog_option($blog_id, self::name($id), $default_v); // Maybe decode array if (is_array($default_v)) { $v = self::_maybe_decode($v); } return $v; } /** * Dropin with prefix for WP's add_option * * @since 3.0 */ public static function add_option( $id, $v ) { add_option(self::name($id), self::_maybe_encode($v)); } /** * Dropin with prefix for WP's add_site_option * * @since 3.0 */ public static function add_site_option( $id, $v ) { add_site_option(self::name($id), self::_maybe_encode($v)); } /** * Dropin with prefix for WP's update_option * * @since 3.0 */ public static function update_option( $id, $v ) { update_option(self::name($id), self::_maybe_encode($v)); } /** * Dropin with prefix for WP's update_site_option * * @since 3.0 */ public static function update_site_option( $id, $v ) { update_site_option(self::name($id), self::_maybe_encode($v)); } /** * Decode an array * * @since 4.0 */ private static function _maybe_decode( $v ) { if (!is_array($v)) { $v2 = \json_decode($v, true); if ($v2 !== null) { $v = $v2; } } return $v; } /** * Encode an array * * @since 4.0 */ private static function _maybe_encode( $v ) { if (is_array($v)) { $v = \json_encode($v) ?: $v; // Non utf-8 encoded value will get failed, then used ori value } return $v; } /** * Dropin with prefix for WP's delete_option * * @since 3.0 */ public static function delete_option( $id ) { delete_option(self::name($id)); } /** * Dropin with prefix for WP's delete_site_option * * @since 3.0 */ public static function delete_site_option( $id ) { delete_site_option(self::name($id)); } /** * Read summary * * @since 3.0 * @access public */ public static function get_summary( $field = false ) { $summary = self::get_option('_summary', array()); if (!is_array($summary)) { $summary = array(); } if (!$field) { return $summary; } if (array_key_exists($field, $summary)) { return $summary[$field]; } return null; } /** * Save summary * * @since 3.0 * @access public */ public static function save_summary( $data = false, $reload = false, $overwrite = false ) { if ($reload || empty(static::cls()->_summary)) { self::reload_summary(); } $existing_summary = static::cls()->_summary; if ($overwrite || !is_array($existing_summary)) { $existing_summary = array(); } $new_summary = array_merge($existing_summary, $data ?: array()); // self::debug2('Save after Reloaded summary', $new_summary); static::cls()->_summary = $new_summary; self::update_option('_summary', $new_summary); } /** * Reload summary * * @since 5.0 */ public static function reload_summary() { static::cls()->_summary = self::get_summary(); // self::debug2( 'Reloaded summary', static::cls()->_summary ); } /** * Get the current instance object. To be inherited. * * @since 3.0 */ public static function get_instance() { return static::cls(); } } src/vary.cls.php 0000777 00000052522 15251157102 0007621 0 ustar 00 <?php /** * Manage the X-LiteSpeed-Vary behavior and vary cookie. * * @since 1.1.3 * @package LiteSpeed */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Handles detection of user state (guest, logged-in, commenter, etc.) * and builds the X-LiteSpeed-Vary header and vary cookie accordingly. */ class Vary extends Root { /** * Log tag used in debug output. * * @var string */ const LOG_TAG = '🔱'; /** * Vary header name. * * @var string */ const X_HEADER = 'X-LiteSpeed-Vary'; /** * Default vary cookie name (used for logged-in/commenter state). * * @var string */ private static $_vary_name = '_lscache_vary'; /** * Whether Ajax calls are permitted to change the vary cookie. * * @var bool */ private static $_can_change_vary = false; /** * Update the default vary cookie name if site settings require it. * * @since 4.0 * @since 7.0 Moved to after_user_init to allow ESI no-vary no conflict. * @return void */ private function _update_vary_name() { $db_cookie = $this->conf( Base::O_CACHE_LOGIN_COOKIE ); // network aware in v3.0. // If no vary set in rewrite rule. if ( ! isset( $_SERVER['LSCACHE_VARY_COOKIE'] ) ) { if ( $db_cookie ) { // Check for ESI no-vary control. $something_wrong = true; if ( ! empty( $_GET[ ESI::QS_ACTION ] ) && ! empty( $_GET['_control'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended $control_raw = wp_unslash( (string) $_GET['_control'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized $control = array_map( 'sanitize_text_field', explode( ',', $control_raw ) ); if ( in_array( 'no-vary', $control, true ) ) { self::debug( 'no-vary control existed, bypass vary_name update' ); $something_wrong = false; self::$_vary_name = $db_cookie; } } if ( defined( 'LITESPEED_CLI' ) || wp_doing_cron() ) { $something_wrong = false; } if ( $something_wrong ) { // Display cookie error msg to admin. if ( is_multisite() ? is_network_admin() : is_admin() ) { Admin_Display::show_error_cookie(); } Control::set_nocache( '❌❌ vary cookie setting error' ); } } return; } // DB setting does not exist – nothing to check. if ( ! $db_cookie ) { return; } // Beyond this point, ensure DB vary is present in $_SERVER env. $server_raw = wp_unslash( (string) $_SERVER['LSCACHE_VARY_COOKIE'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized $vary_arr = array_map( 'trim', explode( ',', $server_raw ) ); if ( in_array( $db_cookie, $vary_arr, true ) ) { self::$_vary_name = $db_cookie; return; } if ( is_multisite() ? is_network_admin() : is_admin() ) { Admin_Display::show_error_cookie(); } Control::set_nocache( 'vary cookie setting lost error' ); } /** * Run after user init to set up vary/caching for current request. * * @since 4.0 * @return void */ public function after_user_init() { $this->_update_vary_name(); // Logged-in user. if ( Router::is_logged_in() ) { // If not ESI, check cache logged-in user setting. if ( ! $this->cls( 'Router' )->esi_enabled() ) { // Cache logged-in => private cache. if ( $this->conf( Base::O_CACHE_PRIV ) && ! is_admin() ) { add_action( 'wp_logout', __NAMESPACE__ . '\Purge::purge_on_logout' ); $this->cls( 'Control' )->init_cacheable(); Control::set_private( 'logged in user' ); } else { // No cache for logged-in user. Control::set_nocache( 'logged in user' ); } } elseif ( ! is_admin() ) { // ESI is on; can be public cache, but ensure cacheable is initialized. $this->cls( 'Control' )->init_cacheable(); } // Clear login state on logout. add_action( 'clear_auth_cookie', [ $this, 'remove_logged_in' ] ); } else { // Only after vary init we can detect guest mode. $this->_maybe_guest_mode(); // Set vary cookie when user logs in (to avoid guest vary). add_action( 'set_logged_in_cookie', [ $this, 'add_logged_in' ], 10, 4 ); add_action( 'wp_login', __NAMESPACE__ . '\Purge::purge_on_logout' ); $this->cls( 'Control' )->init_cacheable(); // Check login-page cacheable setting — login page doesn't go through main WP logic. add_action( 'login_init', [ $this->cls( 'Tag' ), 'check_login_cacheable' ], 5 ); // Optional lightweight guest vary updater. if ( ! empty( $_GET['litespeed_guest'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended add_action( 'wp_loaded', [ $this, 'update_guest_vary' ], 20 ); } } // Commenter checks. add_filter( 'comments_array', [ $this, 'check_commenter' ] ); // Set vary cookie for commenter. add_action( 'set_comment_cookies', [ $this, 'append_commenter' ] ); // REST: don't change vary because they don't carry on user info usually. add_action( 'rest_api_init', function () { self::debug( 'Rest API init disabled vary change' ); add_filter( 'litespeed_can_change_vary', '__return_false' ); } ); } /** * Mark request as Guest mode when applicable. * * @since 4.0 * @return void */ private function _maybe_guest_mode() { if ( defined( 'LITESPEED_GUEST' ) ) { self::debug( '👒👒 Guest mode ' . ( LITESPEED_GUEST ? 'predefined' : 'turned off' ) ); return; } if ( ! $this->conf( Base::O_GUEST ) ) { return; } // If vary is set, then not a guest. if ( self::has_vary() ) { return; } // Admin QS present? not a guest. if ( ! empty( $_GET[ Router::ACTION ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended return; } if ( wp_doing_ajax() ) { return; } if ( wp_doing_cron() ) { return; } // Request to update vary? not a guest. if ( ! empty( $_GET['litespeed_guest'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended return; } // User explicitly turned guest off. if ( ! empty( $_GET['litespeed_guest_off'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended return; } self::debug( '👒👒 Guest mode' ); ! defined( 'LITESPEED_GUEST' ) && define( 'LITESPEED_GUEST', true ); if ( $this->conf( Base::O_GUEST_OPTM ) ) { ! defined( 'LITESPEED_GUEST_OPTM' ) && define( 'LITESPEED_GUEST_OPTM', true ); } } /** * Update Guest vary * * @since 4.0 * @deprecated 4.1 Use independent lightweight guest.vary.php instead. * @return void */ public function update_guest_vary() { // Must not be cached. ! defined( 'LSCACHE_NO_CACHE' ) && define( 'LSCACHE_NO_CACHE', true ); $_guest = new Lib\Guest(); if ( $_guest->always_guest() || self::has_vary() ) { // If contains vary already, don't reload (avoid loops). ! defined( 'LITESPEED_GUEST' ) && define( 'LITESPEED_GUEST', true ); self::debug( '🤠🤠 Guest' ); echo '[]'; exit; } self::debug( 'Will update guest vary in finalize' ); // Return JSON to trigger reload. echo wp_json_encode( [ 'reload' => 'yes' ] ); exit; } /** * Filter callback on `comments_array` to mark commenter state. * * @since 1.0.4 * * @param array $comments The comments to output. * @return array Filtered comments. */ public function check_commenter( $comments ) { /** * Allow bypassing pending comment check for comment plugins. * * @since 2.9.5 */ if ( apply_filters( 'litespeed_vary_check_commenter_pending', true ) ) { $pending = false; foreach ( $comments as $comment ) { if ( ! $comment->comment_approved ) { $pending = true; break; } } // No pending comments => ensure public cache state. if ( ! $pending ) { self::debug( 'No pending comment' ); $this->remove_commenter(); // Remove commenter prefilled info for public cache. foreach ( $_COOKIE as $cookie_name => $cookie_value ) { if ( strlen( $cookie_name ) >= 15 && 0 === strpos( $cookie_name, 'comment_author_' ) ) { unset( $_COOKIE[ $cookie_name ] ); } } return $comments; } } // Pending comments present — set commenter vary. $this->add_commenter(); if ( $this->conf( Base::O_CACHE_COMMENTER ) ) { Control::set_private( 'existing commenter' ); } else { Control::set_nocache( 'existing commenter' ); } return $comments; } /** * Check if default vary has a value * * @since 1.1.3 * * @return false|string Cookie value or false if missing. */ public static function has_vary() { if ( empty( $_COOKIE[ self::$_vary_name ] ) ) { return false; } // Cookie values are not user-displayed; unslash only. return wp_unslash( (string) $_COOKIE[ self::$_vary_name ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized } /** * Append user status with logged-in. * * @since 1.1.3 * @since 1.6.2 Removed static referral. * * @param string|false $logged_in_cookie The logged-in cookie value. * @param int|false $expire Expiration timestamp. * @param int|false $expiration Unused (WordPress signature). * @param int|false $uid User ID. * @return void */ public function add_logged_in( $logged_in_cookie = false, $expire = false, $expiration = false, $uid = false ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed self::debug( 'add_logged_in' ); // Allow Ajax vary change during login flow. // NOTE: Run before `$this->_update_default_vary()` to make vary changeable self::can_ajax_vary(); // Ensure vary cookie exists/updated. $this->_update_default_vary( $uid, $expire ); } /** * Remove user logged-in status. * * @since 1.1.3 * @since 1.6.2 Removed static referral. * @return void */ public function remove_logged_in() { self::debug( 'remove_logged_in' ); // Allow Ajax vary change during logout flow. self::can_ajax_vary(); // Force update vary to remove login status. $this->_update_default_vary( -1 ); } /** * Allow vary to be changed for Ajax calls. * * @since 2.2.2 * @since 2.6 Changed to static. * @return void */ public static function can_ajax_vary() { self::debug( '_can_change_vary -> true' ); self::$_can_change_vary = true; } /** * Whether we can change the default vary right now. * * @since 1.6.2 * @return bool */ private function can_change_vary() { // Don't change on Ajax unless explicitly allowed (no webp header). if ( Router::is_ajax() && ! self::$_can_change_vary ) { self::debug( 'can_change_vary bypassed due to ajax call' ); return false; } // Allow only GET/POST. // POST request can set vary to fix #820789 login "loop" guest cache issue. if ( isset( $_SERVER['REQUEST_METHOD'] ) && 'GET' !== $_SERVER['REQUEST_METHOD'] && 'POST' !== $_SERVER['REQUEST_METHOD'] ) { self::debug( 'can_change_vary bypassed due to method not get/post' ); return false; } // Disable when crawler is making the request. if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) && 0 === strpos( wp_unslash( (string) $_SERVER['HTTP_USER_AGENT'] ), Crawler::FAST_USER_AGENT ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized ) { self::debug( 'can_change_vary bypassed due to crawler' ); return false; } if ( ! apply_filters( 'litespeed_can_change_vary', true ) ) { self::debug( 'can_change_vary bypassed due to litespeed_can_change_vary hook' ); return false; } return true; } /** * Update default vary cookie (idempotent within a request). * * @since 1.6.2 * @since 1.6.6.1 Guard to ensure single run. * * @param int|false $uid User ID or false. * @param int|false $expire Expiration timestamp (default: +2 days). * @return void */ private function _update_default_vary( $uid = false, $expire = false ) { // Ensure header output only runs once. if ( ! defined( 'LITESPEED_DID_' . __FUNCTION__ ) ) { define( 'LITESPEED_DID_' . __FUNCTION__, true ); } else { self::debug2( '_update_default_vary bypassed due to run already' ); return; } // ESI shouldn't change vary (main page only). if ( defined( 'LSCACHE_IS_ESI' ) && LSCACHE_IS_ESI ) { self::debug2( '_update_default_vary bypassed due to ESI' ); return; } $vary = $this->finalize_default_vary( $uid ); $current_vary = self::has_vary(); if ( $current_vary !== $vary && 'commenter' !== $current_vary && $this->can_change_vary() ) { if ( ! $expire ) { $expire = time() + 2 * DAY_IN_SECONDS; } $this->_cookie( $vary, (int) $expire ); } } /** * Get the current vary cookie name. * * @since 1.9.1 * @return string */ public function get_vary_name() { return self::$_vary_name; } /** * Check if a user role is in a configured vary group. * * @since 1.2.0 * @since 3.0 Moved here from conf.cls. * * @param string $role User role(s), comma-separated. * @return int|string Group ID or 0. */ public function in_vary_group( $role ) { $group = 0; $vary_groups = $this->conf( Base::O_CACHE_VARY_GROUP ); $roles = explode( ',', $role ); $found = array_intersect( $roles, array_keys( (array) $vary_groups ) ); if ( $found ) { $groups = []; foreach ( $found as $curr_role ) { $groups[] = $vary_groups[ $curr_role ]; } $group = implode( ',', array_unique( $groups ) ); } elseif ( in_array( 'administrator', $roles, true ) ) { $group = 99; } if ( $group ) { self::debug2( 'role in vary_group [group] ' . $group ); } return $group; } /** * Finalize default vary cookie value for current user. * NOTE: Login process will also call this because it does not call wp hook as normal page loading. * * @since 1.6.2 * * @param int|false $uid Optional user ID. * @return false|string False for guests when no vary needed, or hashed vary. */ public function finalize_default_vary( $uid = false ) { // Bypass vary for guests where applicable (avoid non-guest filenames for assets). if ( defined( 'LITESPEED_GUEST' ) && LITESPEED_GUEST ) { return false; } $vary = []; if ( $this->conf( Base::O_GUEST ) ) { $vary['guest_mode'] = 1; } if ( ! $uid ) { $uid = get_current_user_id(); } else { self::debug( 'uid: ' . $uid ); } // Get user role/group. $role = Router::get_role( $uid ); if ( $uid > 0 ) { $vary['logged-in'] = 1; if ( $role ) { // Parse role group from settings. $role_group = $this->in_vary_group( $role ); if ( $role_group ) { $vary['role'] = $role_group; } } // Admin bar preference. $pref = get_user_option( 'show_admin_bar_front', $uid ); self::debug2( 'show_admin_bar_front: ' . var_export( $pref, true ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export $admin_bar = ( false === $pref || 'true' === $pref ); if ( $admin_bar ) { $vary['admin_bar'] = 1; self::debug2( 'admin bar : true' ); } } else { self::debug( 'role id: failed, guest' ); } /** * Filter vary entries before hashing. * * @since 1.6 Added for Role Excludes for optimization cls * @since 1.6.2 Hooked to webp (legacy) * @since 3.0 Used by 3rd hooks too */ $vary = apply_filters( 'litespeed_vary', $vary ); if ( ! $vary ) { return false; } ksort( $vary ); $list = []; foreach ( $vary as $key => $val ) { $list[] = $key . ':' . $val; } $res = implode( ';', $list ); if ( defined( 'LSCWP_LOG' ) ) { return $res; } // Encrypt in production. return md5( $this->conf( Base::HASH ) . $res ); } /** * Get hash of all varies that affect caching (current cookies + default + env). * * @since 4.0 * @return string */ public function finalize_full_varies() { $vary = $this->_finalize_curr_vary_cookies( true ); $vary .= $this->finalize_default_vary( get_current_user_id() ); $vary .= $this->get_env_vary(); return $vary; } /** * Get request environment vary value (from server variables). * * @since 4.0 * @return string|false */ public function get_env_vary() { $env_vary = isset( $_SERVER['LSCACHE_VARY_VALUE'] ) ? wp_unslash( (string) $_SERVER['LSCACHE_VARY_VALUE'] ) : false; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized if ( ! $env_vary ) { $env_vary = isset( $_SERVER['HTTP_X_LSCACHE_VARY_VALUE'] ) ? wp_unslash( (string) $_SERVER['HTTP_X_LSCACHE_VARY_VALUE'] ) : false; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized } return $env_vary; } /** * Mark current user as commenter (called on comment submit). * * @since 1.1.6 * @return void */ public function append_commenter() { $this->add_commenter( true ); } /** * Add commenter vary (optionally from redirect). * * @since 1.1.3 * * @param bool $from_redirect Whether request is from redirect page. * @return void */ private function add_commenter( $from_redirect = false ) { // If the cookie is lost somehow, set it. if ( 'commenter' !== self::has_vary() ) { self::debug( 'Add commenter' ); // Save commenter status only for current domain path. $this->_cookie( 'commenter', time() + (int) apply_filters( 'comment_cookie_lifetime', 30000000 ), self::_relative_path( $from_redirect ) ); } } /** * Remove commenter vary if set. * * @since 1.1.3 * @return void */ private function remove_commenter() { if ( 'commenter' === self::has_vary() ) { self::debug( 'Remove commenter' ); $this->_cookie( false, false, self::_relative_path() ); } } /** * Generate a relative cookie path from current request. * * @since 1.1.3 * * @param bool $from_redirect When true, uses HTTP_REFERER; otherwise SCRIPT_URL. * @return string|false Path or false. */ private static function _relative_path( $from_redirect = false ) { $path = false; $tag = $from_redirect ? 'HTTP_REFERER' : 'SCRIPT_URL'; if ( ! empty( $_SERVER[ $tag ] ) ) { $parsed = wp_parse_url( wp_unslash( (string) $_SERVER[ $tag ] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized $path = ! empty( $parsed['path'] ) ? $parsed['path'] : false; self::debug( 'Cookie Vary path: ' . ( $path ? $path : 'false' ) ); } return $path; } /** * Build the final X-LiteSpeed-Vary header for current request. * NOTE: Non caccheable page can still set vary ( for logged in process ). * * @since 1.0.13 * * @return string|void Header string or nothing when not needed. */ public function finalize() { // Finalize default vary for non-guest. if ( ! defined( 'LITESPEED_GUEST' ) || ! LITESPEED_GUEST ) { $this->_update_default_vary(); } $tp_cookies = $this->_finalize_curr_vary_cookies(); if ( ! $tp_cookies ) { self::debug2( 'no customized vary' ); return; } self::debug( 'finalized 3rd party cookies', $tp_cookies ); return self::X_HEADER . ': ' . implode( ',', $tp_cookies ); } /** * Get vary cookies (names or values JSON) added for current page. * * @since 1.0.13 * * @param bool $values_json When true, returns JSON array of cookie values; else cookie=name items. * @return array|string|false List of vary cookie items, JSON string, or false when none. */ private function _finalize_curr_vary_cookies( $values_json = false ) { global $post; $cookies = []; // No need to append default vary cookie name. if ( ! empty( $post->post_password ) ) { $postpass_key = 'wp-postpass_' . COOKIEHASH; if ( $this->_get_cookie_val( $postpass_key ) ) { self::debug( 'finalize bypassed due to password protected vary ' ); // If user has password cookie, do not cache & ignore existing vary cookies. Control::set_nocache( 'password protected vary' ); return false; } $cookies[] = $values_json ? $this->_get_cookie_val( $postpass_key ) : $postpass_key; } $cookies = apply_filters( 'litespeed_vary_curr_cookies', $cookies ); if ( $cookies ) { $cookies = array_filter( array_unique( $cookies ) ); self::debug( 'vary cookies changed by filter litespeed_vary_curr_cookies', $cookies ); } if ( ! $cookies ) { return false; } // Format cookie name data or value data. sort( $cookies ); // Maintain stable order for $values_json=true. foreach ( $cookies as $k => $v ) { $cookies[ $k ] = $values_json ? $this->_get_cookie_val( $v ) : 'cookie=' . $v; } return $values_json ? wp_json_encode( $cookies ) : $cookies; } /** * Get a cookie value safely. * * @since 4.0 * * @param string $key Cookie name. * @return false|string Cookie value or false. */ private function _get_cookie_val( $key ) { if ( ! empty( $_COOKIE[ $key ] ) ) { return wp_unslash( (string) $_COOKIE[ $key ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized } return false; } /** * Set or clear the vary cookie. * * If the vary cookie changed, mark page as non-cacheable for this response. * * @since 1.0.4 * * @param int|false $val Cookie value to set, or false to clear. * @param int $expire Expiration timestamp (ignored when $val is false). * @param string $path Cookie path (false to use COOKIEPATH). * @return void */ private function _cookie( $val = false, $expire = 0, $path = false ) { if ( ! $val ) { $expire = 1; } // HTTPS bypass toggle for clients using both HTTP/HTTPS. $is_ssl = $this->conf( Base::O_UTIL_NO_HTTPS_VARY ) ? false : is_ssl(); setcookie( self::$_vary_name, $val, (int) $expire, $path ? $path : COOKIEPATH, COOKIE_DOMAIN, $is_ssl, true ); self::debug( 'set_cookie ---> [k] ' . self::$_vary_name . ' [v] ' . ( false === $val ? 'false' : $val ) . ' [ttl] ' . ( (int) $expire - time() ) ); } } src/vpi.cls.php 0000777 00000022600 15251157102 0007430 0 ustar 00 <?php /** * The viewport image (VPI) class. * * Handles discovering above-the-fold images for posts/pages and stores the * viewport image list per post (desktop & mobile). Coordinates with the * remote service via queue + cron + webhook notify. * * @since 4.7 * @package LiteSpeed */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Generate and manage ViewPort Images (VPI) for pages. */ class VPI extends Base { /** * Log tag for debug output. * * @var string */ const LOG_TAG = '[VPI]'; /** * Action types. * * @var string */ const TYPE_GEN = 'gen'; const TYPE_CLEAR_Q = 'clear_q'; /** * VPI Desktop Meta name. * * @since 7.6 * @var string */ const POST_META = 'litespeed_vpi_list'; /** * VPI Mobile Meta name. * * @since 7.6 * @var string */ const POST_META_MOBILE = 'litespeed_vpi_list_mobile'; /** * Summary values persisted between requests (timings, last runs, etc). * * @var array */ protected $_summary; /** * In-memory working queue for VPI jobs. * * @var array */ private $_queue; /** * Init. * * @since 4.7 */ public function __construct() { $this->_summary = self::get_summary(); } /** * Queue the current page for VPI generation. * * @since 4.7 * @return void */ public function add_to_queue() { $is_mobile = $this->_separate_mobile(); global $wp; $request_url = home_url( $wp->request ); if ( ! apply_filters( 'litespeed_vpi_should_queue', true, $request_url ) ) { return; } // Sanitize user agent coming from the server superglobal. $ua = ! empty( $_SERVER['HTTP_USER_AGENT'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) : ''; // Store it to prepare for cron. $this->_queue = $this->load_queue( 'vpi' ); if ( count( $this->_queue ) > 500 ) { self::debug( 'Queue is full - 500' ); return; } $home_id = (int) get_option( 'page_for_posts' ); if ( ! is_singular() && ! ( $home_id > 0 && is_home() ) ) { self::debug( 'not single post ID' ); return; } $post_id = is_home() ? $home_id : get_the_ID(); $queue_k = ( $is_mobile ? 'mobile' : '' ) . ' ' . $request_url; if ( ! empty( $this->_queue[ $queue_k ] ) ) { self::debug( 'queue k existed ' . $queue_k ); return; } $this->_queue[ $queue_k ] = [ 'url' => apply_filters( 'litespeed_vpi_url', $request_url ), 'post_id' => $post_id, 'user_agent' => substr( $ua, 0, 200 ), 'is_mobile' => $is_mobile, ]; // Current UA will be used to request. $this->save_queue( 'vpi', $this->_queue ); self::debug( 'Added queue_vpi [url] ' . $queue_k . ' [UA] ' . $ua ); // Prepare cache tag for later purge. Tag::add( 'VPI.' . md5( $queue_k ) ); } /** * Handle finish notifications from remote service. * * Expects JSON body; falls back to $_POST for legacy callers. * * @since 4.7 * @return array Response object for the cloud layer. */ public function notify() { // phpcs:ignore WordPress.Security.NonceVerification.Missing $post_data = \json_decode( file_get_contents( 'php://input' ), true ); if ( is_null( $post_data ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing $post_data = $_POST; } self::debug( 'notify() data', $post_data ); $this->_queue = $this->load_queue( 'vpi' ); list( $post_data ) = $this->cls( 'Cloud' )->extract_msg( $post_data, 'vpi' ); $notified_data = $post_data['data']; if ( empty( $notified_data ) || ! is_array( $notified_data ) ) { self::debug( '❌ notify exit: no notified data' ); return Cloud::err( 'no notified data' ); } // Check if it's in queue or not. $valid_i = 0; foreach ( $notified_data as $v ) { if ( empty( $v['request_url'] ) ) { self::debug( '❌ notify bypass: no request_url', $v ); continue; } if ( empty( $v['queue_k'] ) ) { self::debug( '❌ notify bypass: no queue_k', $v ); continue; } $queue_k = $v['queue_k']; if ( empty( $this->_queue[ $queue_k ] ) ) { self::debug( '❌ notify bypass: no this queue [q_k]' . $queue_k ); continue; } // Save data. if ( ! empty( $v['data_vpi'] ) ) { $post_id = (int) $this->_queue[ $queue_k ]['post_id']; $name = ! empty( $v['is_mobile'] ) ? self::POST_META_MOBILE : self::POST_META; $urldecode = is_array( $v['data_vpi'] ) ? array_map( 'urldecode', $v['data_vpi'] ) : urldecode( $v['data_vpi'] ); self::debug( 'save data_vpi', $urldecode ); $this->cls( 'Metabox' )->save( $post_id, $name, $urldecode ); ++$valid_i; } unset( $this->_queue[ $queue_k ] ); self::debug( 'notify data handled, unset queue [q_k] ' . $queue_k ); } $this->save_queue( 'vpi', $this->_queue ); self::debug( 'notified' ); return Cloud::ok( [ 'count' => $valid_i ] ); } /** * Cron entry point. * * @since 4.7 * * @param bool $do_continue Continue processing multiple queue items within one cron tick. * @return mixed Result of the handler. */ public static function cron( $do_continue = false ) { $_instance = self::cls(); return $_instance->_cron_handler( $do_continue ); } /** * Cron queue processor. * * @since 4.7 * * @param bool $do_continue Continue processing multiple queue items within one cron tick. * @return void */ private function _cron_handler( $do_continue = false ) { self::debug( 'cron start' ); $this->_queue = $this->load_queue( 'vpi' ); if ( empty( $this->_queue ) ) { return; } // For cron, need to check request interval too. if ( ! $do_continue ) { if ( ! empty( $this->_summary['curr_request_vpi'] ) && time() - (int) $this->_summary['curr_request_vpi'] < 300 && ! $this->conf( self::O_DEBUG ) ) { self::debug( 'Last request not done' ); return; } } $i = 0; foreach ( $this->_queue as $k => $v ) { if ( ! empty( $v['_status'] ) ) { continue; } self::debug( 'cron job [tag] ' . $k . ' [url] ' . $v['url'] . ( $v['is_mobile'] ? ' 📱 ' : '' ) . ' [UA] ' . $v['user_agent'] ); ++$i; $res = $this->_send_req( $v['url'], $k, $v['user_agent'], $v['is_mobile'] ); if ( ! $res ) { // Status is wrong, drop this item from queue. $this->_queue = $this->load_queue( 'vpi' ); unset( $this->_queue[ $k ] ); $this->save_queue( 'vpi', $this->_queue ); if ( ! $do_continue ) { return; } GUI::print_loading( count( $this->_queue ), 'VPI' ); Router::self_redirect( Router::ACTION_VPI, self::TYPE_GEN ); return; } // Exit queue if out of quota or service is hot. if ( 'out_of_quota' === $res || 'svc_hot' === $res ) { return; } $this->_queue = $this->load_queue( 'vpi' ); $this->_queue[ $k ]['_status'] = 'requested'; $this->save_queue( 'vpi', $this->_queue ); self::debug( 'Saved to queue [k] ' . $k ); // only request first one if not continuing. if ( ! $do_continue ) { return; } GUI::print_loading( count( $this->_queue ), 'VPI' ); Router::self_redirect( Router::ACTION_VPI, self::TYPE_GEN ); return; } } /** * Send request to QUIC.cloud API to generate VPI. * * @since 4.7 * @access private * * @param string $request_url The URL to analyze for VPI. * @param string $queue_k Queue key for this job. * @param string $user_agent Sanitized User-Agent string (<=200 chars). * @param bool $is_mobile Whether the job is for mobile viewport. * @return bool|string True on queued successfully, 'out_of_quota'/'svc_hot' on throttling, or false on error. */ private function _send_req( $request_url, $queue_k, $user_agent, $is_mobile ) { $svc = Cloud::SVC_VPI; // Check if has credit to push or not. $err = false; $allowance = $this->cls( 'Cloud' )->allowance( $svc, $err ); if ( ! $allowance ) { self::debug( '❌ No credit: ' . $err ); $err && Admin_Display::error( Error::msg( $err ) ); return 'out_of_quota'; } set_time_limit( 120 ); // Update request status. self::save_summary( [ 'curr_request_vpi' => time() ], true ); // Gather guest HTML to send. $html = $this->cls( 'CSS' )->prepare_html( $request_url, $user_agent ); if ( ! $html ) { return false; } // Parse HTML to gather CSS content before requesting. $css = false; list( $css, $html ) = $this->cls( 'CSS' )->prepare_css( $html ); if ( ! $css ) { self::debug( '❌ No css' ); return false; } $data = [ 'url' => $request_url, 'queue_k' => $queue_k, 'user_agent' => $user_agent, 'is_mobile' => $is_mobile ? 1 : 0, // todo: compatible w/ tablet. 'html' => $html, 'css' => $css, ]; self::debug( 'Generating: ', $data ); $json = Cloud::post( $svc, $data, 30 ); if ( ! is_array( $json ) ) { return $json; } // Unknown status, remove this line. if ( 'queued' !== $json['status'] ) { return false; } // Save summary data. self::reload_summary(); $this->_summary['last_spent_vpi'] = time() - (int) $this->_summary['curr_request_vpi']; $this->_summary['last_request_vpi'] = $this->_summary['curr_request_vpi']; $this->_summary['curr_request_vpi'] = 0; self::save_summary(); return true; } /** * Handle all request actions from main controller. * * @since 4.7 * @return void */ public function handler() { $type = Router::verify_type(); switch ( $type ) { case self::TYPE_GEN: self::cron( true ); break; case self::TYPE_CLEAR_Q: $this->clear_q( 'vpi' ); break; default: break; } Admin::redirect(); } } src/crawler-map.cls.php 0000777 00000046642 15251157102 0011060 0 ustar 00 <?php /** * The Crawler Sitemap Class. * * @package LiteSpeed * @since 1.1.0 */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Crawler_Map * * Maintains and persists crawler sitemap/blacklist state, parses custom sitemaps, * and exposes helpers to query & mutate crawler results. */ class Crawler_Map extends Root { const LOG_TAG = '🐞🗺️'; const BM_MISS = 1; const BM_HIT = 2; const BM_BLACKLIST = 4; /** * Site URL used to simplify URLs. * * @var string */ private $_site_url; /** * Main crawler table name. * * @var string */ private $_tb; /** * Crawler blacklist table name. * * @var string */ private $_tb_blacklist; /** * Data service instance. * * @var \LiteSpeed\Data */ private $__data; /** * Timeout (seconds) when fetching sitemaps. * * @var int */ private $_conf_map_timeout; /** * Collected URLs from parsed sitemaps. * * @var array<int,string> */ private $_urls = []; /** * Instantiate the class. * * @since 1.1.0 */ public function __construct() { $this->_site_url = get_site_url(); $this->__data = Data::cls(); $this->_tb = $this->__data->tb( 'crawler' ); $this->_tb_blacklist = $this->__data->tb( 'crawler_blacklist' ); // Specify the timeout while parsing the sitemap. $this->_conf_map_timeout = defined( 'LITESPEED_CRAWLER_MAP_TIMEOUT' ) ? constant( 'LITESPEED_CRAWLER_MAP_TIMEOUT' ) : 180; } /** * Save URLs crawl status into DB. * * @since 3.0 * @access public * * @param array<int,array<int,array{url:string,code:int}>> $items Map of bit => [ id => [url, code] ]. * @param int $curr_crawler Current crawler index (0-based). * @return array<int,array> */ public function save_map_status( $items, $curr_crawler ) { global $wpdb; Utility::compatibility(); $total_crawler = count( Crawler::cls()->list_crawlers() ); $total_crawler_pos = $total_crawler - 1; // Replace current crawler's position. $curr_crawler = (int) $curr_crawler; foreach ( $items as $bit => $ids ) { // $ids = [ id => [ url, code ], ... ]. if ( ! $ids ) { continue; } self::debug( 'Update map [crawler] ' . $curr_crawler . ' [bit] ' . $bit . ' [count] ' . count( $ids ) ); // Update res first, then reason $right_pos = $total_crawler_pos - $curr_crawler; $id_all = implode(',', array_map('intval', array_keys($ids))); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared $wpdb->query("UPDATE `$this->_tb` SET res = CONCAT( LEFT( res, $curr_crawler ), '$bit', RIGHT( res, $right_pos ) ) WHERE id IN ( $id_all )"); // Add blacklist if (Crawler::STATUS_BLACKLIST === $bit || Crawler::STATUS_NOCACHE === $bit) { $q = "SELECT a.id, a.url FROM `$this->_tb_blacklist` a LEFT JOIN `$this->_tb` b ON b.url=a.url WHERE b.id IN ( $id_all )"; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared $existing = $wpdb->get_results($q, ARRAY_A); // Update current crawler status tag in existing blacklist if ($existing) { // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQL.NotPrepared $count = $wpdb->query("UPDATE `$this->_tb_blacklist` SET res = CONCAT( LEFT( res, $curr_crawler ), '$bit', RIGHT( res, $right_pos ) ) WHERE id IN ( " . implode(',', array_column($existing, 'id')) . ' )'); self::debug('Update blacklist [count] ' . $count); } // Append new blacklist if (count($ids) > count($existing)) { $new_urls = array_diff(array_column($ids, 'url'), array_column($existing, 'url')); self::debug('Insert into blacklist [count] ' . count($new_urls)); $q = "INSERT INTO `$this->_tb_blacklist` ( url, res, reason ) VALUES " . implode(',', array_fill(0, count($new_urls), '( %s, %s, %s )')); $data = []; $res = array_fill(0, $total_crawler, '-'); $res[$curr_crawler] = $bit; $res = implode('', $res); $default_reason = $total_crawler > 1 ? str_repeat(',', $total_crawler - 1) : ''; // Pre-populate default reason value first, update later foreach ($new_urls as $url) { $data[] = $url; $data[] = $res; $data[] = $default_reason; } // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared $wpdb->query($wpdb->prepare($q, $data)); } } // Update sitemap reason w/ HTTP code. $reason_array = []; foreach ( $ids as $row_id => $row ) { $code = (int) $row['code']; if ( empty( $reason_array[ $code ] ) ) { $reason_array[ $code ] = []; } $reason_array[ $code ][] = (int) $row_id; } foreach ($reason_array as $code => $v2) { // Complement comma if ($curr_crawler) { $code = ',' . $code; } if ($curr_crawler < $total_crawler_pos) { $code .= ','; } // phpcs:ignore WordPress.DB $count = $wpdb->query( "UPDATE `$this->_tb` SET reason=CONCAT(SUBSTRING_INDEX(reason, ',', $curr_crawler), '$code', SUBSTRING_INDEX(reason, ',', -$right_pos)) WHERE id IN (" . implode(',', $v2) . ')' ); self::debug("Update map reason [code] $code [pos] left $curr_crawler right -$right_pos [count] $count"); // Update blacklist reason if (Crawler::STATUS_BLACKLIST === $bit || Crawler::STATUS_NOCACHE === $bit) { // phpcs:ignore WordPress.DB $count = $wpdb->query( "UPDATE `$this->_tb_blacklist` a LEFT JOIN `$this->_tb` b ON b.url = a.url SET a.reason=CONCAT(SUBSTRING_INDEX(a.reason, ',', $curr_crawler), '$code', SUBSTRING_INDEX(a.reason, ',', -$right_pos)) WHERE b.id IN (" . implode(',', $v2) . ')' ); self::debug("Update blacklist [code] $code [pos] left $curr_crawler right -$right_pos [count] $count"); } } // Reset list. $items[ $bit ] = []; } return $items; } /** * Add one record to blacklist. * NOTE: $id is sitemap table ID. * * @since 3.0 * @access public * * @param int $id Sitemap row ID. * @return void */ public function blacklist_add( $id ) { global $wpdb; $id = (int) $id; // Build res&reason. $total_crawler = count( Crawler::cls()->list_crawlers() ); $res = str_repeat(Crawler::STATUS_BLACKLIST, $total_crawler); $reason = implode(',', array_fill(0, $total_crawler, 'Man')); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared $row = $wpdb->get_row("SELECT a.url, b.id FROM `$this->_tb` a LEFT JOIN `$this->_tb_blacklist` b ON b.url = a.url WHERE a.id = '$id'", ARRAY_A); if (!$row) { self::debug('blacklist failed to add [id] ' . $id); return; } self::debug('Add to blacklist [url] ' . $row['url']); $q = "UPDATE `$this->_tb` SET res = %s, reason = %s WHERE id = %d"; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared $wpdb->query($wpdb->prepare($q, [ $res, $reason, $id ])); if ($row['id']) { $q = "UPDATE `$this->_tb_blacklist` SET res = %s, reason = %s WHERE id = %d"; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared $wpdb->query($wpdb->prepare($q, [ $res, $reason, $row['id'] ])); } else { $q = "INSERT INTO `$this->_tb_blacklist` (url, res, reason) VALUES (%s, %s, %s)"; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared $wpdb->query($wpdb->prepare($q, [ $row['url'], $res, $reason ])); } } /** * Delete one record from blacklist. * * @since 3.0 * @access public * * @param int $id Blacklist row ID. * @return void */ public function blacklist_del( $id ) { global $wpdb; if ( ! $this->__data->tb_exist( 'crawler_blacklist' ) ) { return; } $id = (int) $id; self::debug('blacklist delete [id] ' . $id); $sql = sprintf( "UPDATE `%s` SET res=REPLACE(REPLACE(res, '%s', '-'), '%s', '-') WHERE url=(SELECT url FROM `%s` WHERE id=%d)", $this->_tb, Crawler::STATUS_NOCACHE, Crawler::STATUS_BLACKLIST, $this->_tb_blacklist, $id ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared $wpdb->query($sql); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared $wpdb->query("DELETE FROM `$this->_tb_blacklist` WHERE id='$id'"); } /** * Empty blacklist. * * @since 3.0 * @access public * @return void */ public function blacklist_empty() { global $wpdb; if ( ! $this->__data->tb_exist( 'crawler_blacklist' ) ) { return; } self::debug('Truncate blacklist'); $sql = sprintf("UPDATE `%s` SET res=REPLACE(REPLACE(res, '%s', '-'), '%s', '-')", $this->_tb, Crawler::STATUS_NOCACHE, Crawler::STATUS_BLACKLIST); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared $wpdb->query($sql); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared $wpdb->query("TRUNCATE `$this->_tb_blacklist`"); } /** * List blacklist. * * @since 3.0 * @access public * * @param int|false $limit Number of rows to fetch, or false for all. * @param int|false $offset Offset for pagination, or false to auto-calc. * @return array<int,array<string,mixed>> */ public function list_blacklist( $limit = false, $offset = false ) { global $wpdb; if ( ! $this->__data->tb_exist( 'crawler_blacklist' ) ) { return []; } $q = "SELECT * FROM `$this->_tb_blacklist` ORDER BY id DESC"; if ( false !== $limit ) { if ( false === $offset ) { $total = $this->count_blacklist(); $offset = Utility::pagination($total, $limit, true); } $q .= ' LIMIT %d, %d'; // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared $q = $wpdb->prepare($q, $offset, $limit); } // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared return $wpdb->get_results($q, ARRAY_A); } /** * Count blacklist. * * @return int|false */ public function count_blacklist() { global $wpdb; if ( ! $this->__data->tb_exist( 'crawler_blacklist' ) ) { return false; } $q = "SELECT COUNT(*) FROM `$this->_tb_blacklist`"; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared return $wpdb->get_var($q); } /** * Empty sitemap. * * @since 3.0 * @access public * @return void */ public function empty_map() { Data::cls()->tb_del( 'crawler' ); $msg = __( 'Sitemap cleaned successfully', 'litespeed-cache' ); Admin_Display::success( $msg ); } /** * List generated sitemap. * * @since 3.0 * @access public * * @param int $limit Number of rows per page. * @param int|bool $offset Offset for pagination, or false to auto-calc. * @return array<int,array<string,mixed>> */ public function list_map( $limit, $offset = false ) { global $wpdb; if ( ! $this->__data->tb_exist( 'crawler' ) ) { return []; } if ( false === $offset ) { $total = $this->count_map(); $offset = Utility::pagination($total, $limit, true); } $type = Router::verify_type(); $req_uri_like = ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing if ( ! empty( $_POST['kw'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing $kw = sanitize_text_field( wp_unslash( $_POST['kw'] ) ); $q = "SELECT * FROM `$this->_tb` WHERE url LIKE %s"; if ( 'hit' === $type ) { $q .= " AND res LIKE '%" . Crawler::STATUS_HIT . "%'"; } if ( 'miss' === $type ) { $q .= " AND res LIKE '%" . Crawler::STATUS_MISS . "%'"; } if ( 'blacklisted' === $type ) { $q .= " AND res LIKE '%" . Crawler::STATUS_BLACKLIST . "%'"; } $q .= ' ORDER BY id LIMIT %d, %d'; $req_uri_like = '%' . $wpdb->esc_like( $kw ) . '%'; return $wpdb->get_results( $wpdb->prepare( $q, $req_uri_like, $offset, $limit ), ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared } $q = "SELECT * FROM `$this->_tb`"; if ( 'hit' === $type ) { $q .= " WHERE res LIKE '%" . Crawler::STATUS_HIT . "%'"; } if ( 'miss' === $type ) { $q .= " WHERE res LIKE '%" . Crawler::STATUS_MISS . "%'"; } if ( 'blacklisted' === $type ) { $q .= " WHERE res LIKE '%" . Crawler::STATUS_BLACKLIST . "%'"; } $q .= ' ORDER BY id LIMIT %d, %d'; return $wpdb->get_results( $wpdb->prepare( $q, $offset, $limit ), ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared } /** * Count sitemap. * * @return int|false */ public function count_map() { global $wpdb; if ( ! $this->__data->tb_exist( 'crawler' ) ) { return false; } $q = "SELECT COUNT(*) FROM `$this->_tb`"; $type = Router::verify_type(); if ( 'hit' === $type ) { $q .= " WHERE res LIKE '%" . Crawler::STATUS_HIT . "%'"; } if ( 'miss' === $type ) { $q .= " WHERE res LIKE '%" . Crawler::STATUS_MISS . "%'"; } if ( 'blacklisted' === $type ) { $q .= " WHERE res LIKE '%" . Crawler::STATUS_BLACKLIST . "%'"; } return $wpdb->get_var( $q ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared } /** * Generate sitemap. * * @since 1.1.0 * @access public * * @param bool $manual Whether triggered manually from UI. * @return void */ public function gen( $manual = false ) { $count = $this->_gen(); if ( ! $count ) { Admin_Display::error( __( 'No valid sitemap parsed for crawler.', 'litespeed-cache' ) ); return; } if ( ! wp_doing_cron() && $manual ) { $msg = sprintf( __( 'Sitemap created successfully: %d items', 'litespeed-cache' ), $count ); Admin_Display::success( $msg ); } } /** * Generate the sitemap. * * @since 1.1.0 * @access private * @return int|false Number of URLs generated or false on failure. */ private function _gen() { global $wpdb; if ( ! $this->__data->tb_exist( 'crawler' ) ) { $this->__data->tb_create( 'crawler' ); } if ( ! $this->__data->tb_exist( 'crawler_blacklist' ) ) { $this->__data->tb_create( 'crawler_blacklist' ); } // Use custom sitemap. $sitemap = $this->conf( Base::O_CRAWLER_SITEMAP ); if ( ! $sitemap ) { return false; } $offset = strlen( $this->_site_url ); $sitemap = Utility::sanitize_lines( $sitemap ); try { foreach ( $sitemap as $this_map ) { $this->_parse( $this_map ); } } catch ( \Exception $e ) { self::debug( '❌ failed to parse custom sitemap: ' . $e->getMessage() ); } if ( is_array( $this->_urls ) && ! empty( $this->_urls ) ) { if ( defined( 'LITESPEED_CRAWLER_DROP_DOMAIN' ) && constant( 'LITESPEED_CRAWLER_DROP_DOMAIN' ) ) { foreach ( $this->_urls as $k => $v ) { if ( 0 !== stripos( $v, $this->_site_url ) ) { unset( $this->_urls[ $k ] ); continue; } $this->_urls[ $k ] = substr( $v, $offset ); } } $this->_urls = array_values( array_unique( $this->_urls ) ); } self::debug( 'Truncate sitemap' ); $wpdb->query( "TRUNCATE `$this->_tb`" ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery self::debug( 'Generate sitemap' ); // Filter URLs in blacklist. $blacklist = $this->list_blacklist(); $full_blacklisted = []; $partial_blacklisted = []; foreach ( $blacklist as $v ) { if ( false === strpos( $v['res'], '-' ) ) { // Full blacklisted. $full_blacklisted[] = $v['url']; } else { // Replace existing reason. $v['reason'] = explode( ',', $v['reason'] ); $v['reason'] = array_map( function ( $element ) { return $element ? 'Existed' : ''; }, $v['reason'] ); $v['reason'] = implode( ',', $v['reason'] ); $partial_blacklisted[ $v['url'] ] = [ 'res' => $v['res'], 'reason' => $v['reason'], ]; } } // Drop all blacklisted URLs. $this->_urls = array_diff( $this->_urls, $full_blacklisted ); // Default res & reason. $crawler_count = count( Crawler::cls()->list_crawlers() ); $default_res = str_repeat( '-', $crawler_count ); $default_reason = $crawler_count > 1 ? str_repeat( ',', $crawler_count - 1 ) : ''; $data = []; foreach ( $this->_urls as $url ) { $data[] = $url; $data[] = array_key_exists( $url, $partial_blacklisted ) ? $partial_blacklisted[ $url ]['res'] : $default_res; $data[] = array_key_exists( $url, $partial_blacklisted ) ? $partial_blacklisted[ $url ]['reason'] : $default_reason; } foreach ( array_chunk( $data, 300 ) as $data2 ) { $this->_save( $data2 ); } // Reset crawler. Crawler::cls()->reset_pos(); return count( $this->_urls ); } /** * Save data to table. * * @since 3.0 * @access private * * @param array<int,string> $data Flat array (url,res,reason, url,res,reason, ...). * @param string $fields Fields list for insert (default url,res,reason). * @return void */ private function _save( $data, $fields = 'url,res,reason' ) { global $wpdb; if ( empty( $data ) ) { return; } $q = "INSERT INTO `$this->_tb` ( {$fields} ) VALUES "; // Add placeholder. $q .= Utility::chunk_placeholder( $data, $fields ); // Store data. $wpdb->query( $wpdb->prepare( $q, $data ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared } /** * Parse custom sitemap and collect urls. * * @since 1.1.1 * @access private * * @param string $sitemap Absolute sitemap URL. * @return void * @throws \Exception If remote read or parsing fails. */ private function _parse( $sitemap ) { /** * Read via wp func to avoid allow_url_fopen = off * * @since 2.2.7 */ $response = wp_safe_remote_get( $sitemap, [ 'timeout' => $this->_conf_map_timeout, 'sslverify' => false, ] ); if ( is_wp_error( $response ) ) { $error_message = $response->get_error_message(); self::debug( 'failed to read sitemap: ' . $error_message ); throw new \Exception( 'Failed to remote read ' . esc_url( $sitemap ) ); } $xml_object = simplexml_load_string($response['body'], null, LIBXML_NOCDATA); if (!$xml_object) { if ($this->_urls) { return; } throw new \Exception('Failed to parse xml ' . esc_url( $sitemap )); } // start parsing. $xml_array = (array) $xml_object; if ( ! empty( $xml_array['sitemap'] ) ) { // parse sitemap set. if ( is_object( $xml_array['sitemap'] ) ) { $xml_array['sitemap'] = (array) $xml_array['sitemap']; } if ( ! empty( $xml_array['sitemap']['loc'] ) ) { // is single sitemap. $this->_parse( (string) $xml_array['sitemap']['loc'] ); } else { // parse multiple sitemaps. foreach ( (array) $xml_array['sitemap'] as $val ) { $val = (array) $val; if ( ! empty( $val['loc'] ) ) { $this->_parse( (string) $val['loc'] ); // recursive parse sitemap. } } } } elseif ( ! empty( $xml_array['url'] ) ) { // parse url set. if ( is_object( $xml_array['url'] ) ) { $xml_array['url'] = (array) $xml_array['url']; } // if only 1 element. if ( ! empty( $xml_array['url']['loc'] ) ) { $this->_urls[] = (string) $xml_array['url']['loc']; } else { foreach ( (array) $xml_array['url'] as $val ) { $val = (array) $val; if ( ! empty( $val['loc'] ) ) { $this->_urls[] = (string) $val['loc']; } } } } } } src/doc.cls.php 0000777 00000012711 15251157102 0007401 0 ustar 00 <?php /** * Helper to render small documentation/tooltips in the UI. * * @package LiteSpeed * @since 2.2.7 */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Small utility view helpers for docs/warnings/links. */ class Doc { /** * Show a notice when an option is effectively forced ON by Guest Mode. * * @since 5.5 * * @param string $id Option id. * @return void */ public static function maybe_on_by_gm( $id ) { if ( apply_filters( 'litespeed_conf', $id ) ) { return; } if ( ! apply_filters( 'litespeed_conf', Base::O_GUEST ) ) { return; } if ( ! apply_filters( 'litespeed_conf', Base::O_GUEST_OPTM ) ) { return; } echo '<font class="litespeed-warning">'; echo wp_kses_post( '⚠️ ' . sprintf( __( 'This setting is %1$s for certain qualifying requests due to %2$s!', 'litespeed-cache' ), '<code>' . esc_html__( 'ON', 'litespeed-cache' ) . '</code>', esc_html( Lang::title( Base::O_GUEST_OPTM ) ) ) ); self::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/general/#guest-optimization' ); echo '</font>'; } /** * Warn that changes affect the crawler list. * * @since 4.3 * @return void */ public static function crawler_affected() { echo '<span class="litespeed-primary">'; echo '⚠️ ' . esc_html__( 'This setting will regenerate crawler list and clear the disabled list!', 'litespeed-cache' ); echo '</span>'; } /** * Privacy policy text for front-end disclosure. * * @since 2.2.7 * * @return string Safe HTML string. */ public static function privacy_policy() { $text = esc_html__( 'This site utilizes caching in order to facilitate a faster response time and better user experience. Caching potentially stores a duplicate copy of every web page that is on display on this site. All cache files are temporary, and are never accessed by any third party, except as necessary to obtain technical support from the cache plugin vendor. Cache files expire on a schedule set by the site administrator, but may easily be purged by the admin before their natural expiration, if necessary. We may use QUIC.cloud services to process & cache your data temporarily.', 'litespeed-cache' ); $link = sprintf( /* translators: %s: QUIC.cloud privacy policy URL */ esc_html__( 'Please see %s for more details.', 'litespeed-cache' ), sprintf( '<a href="%1$s" target="_blank" rel="noopener noreferrer">%1$s</a>', esc_url( 'https://quic.cloud/privacy-policy/' ) ) ); // Return as HTML (link already escaped). return $text . ' ' . $link; } /** * Render (or return) a "Learn more" link. * * @since 2.4.2 * * @param string $url Destination URL. * @param string $title Optional link text. Defaults to "Learn More". * @param bool $self_tab Open in self tab or new tab (adds target/_blank + rel). * @param string $css_class CSS class for the anchor. * @param bool $return_output Return instead of echo. * @return string|void */ public static function learn_more( $url, $title = '', $self_tab = false, $css_class = '', $return_output = false ) { $css_class = $css_class ? $css_class : 'litespeed-learn-more'; $title = $title ? $title : esc_html__( 'Learn More', 'litespeed-cache' ); $target_rel = $self_tab ? '' : ' target="_blank" rel="noopener noreferrer"'; $anchor = sprintf( ' <a href="%s"%s class="%s">%s</a>', esc_url( $url ), $target_rel, // Already hardcoded/safe. esc_attr( $css_class ), wp_kses_post( $title ) ); if ( $return_output ) { return $anchor; } echo wp_kses_post( $anchor ); } /** * Output "One per line." helper text. * * @since 3.0 * * @param bool $return_output Return the string instead of echoing. * @return string|void */ public static function one_per_line( $return_output = false ) { $str = esc_html__( 'One per line.', 'litespeed-cache' ); if ( $return_output ) { return $str; } echo esc_html( $str ); } /** * Output helper text about full/partial URL support. * * @since 3.4 * * @param bool $string_only If true, say "strings" only; otherwise specify URLs/strings. * @return void */ public static function full_or_partial_url( $string_only = false ) { if ( $string_only ) { echo esc_html__( 'Both full and partial strings can be used.', 'litespeed-cache' ); } else { echo esc_html__( 'Both full URLs and partial strings can be used.', 'litespeed-cache' ); } } /** * Notice that a setting will edit .htaccess. * * @since 3.0 * @return void */ public static function notice_htaccess() { echo '<span class="litespeed-primary">'; echo '⚠️ ' . esc_html__( 'This setting will edit the .htaccess file.', 'litespeed-cache' ) . ' '; self::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#edit-htaccess-tab' ); echo '</span>'; } /** * Gentle reminder that QUIC.cloud queues are asynchronous. * * @since 5.3.1 * * @param bool $return_output Return the HTML instead of echoing. * @return string|void */ public static function queue_issues( $return_output = false ) { $link = self::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/troubleshoot/#quiccloud-queue-issues', '', false, '', true ); $html = sprintf( '<div class="litespeed-desc">%s %s</div>', esc_html__( 'The queue is processed asynchronously. It may take time.', 'litespeed-cache' ), $link // already escaped. ); if ( $return_output ) { return $html; } echo wp_kses_post( $html ); } } src/gui.cls.php 0000777 00000111113 15251157102 0007414 0 ustar 00 <?php /** * The frontend GUI class. * * Provides front-end and admin-bar UI helpers for LiteSpeed Cache. * * @package LiteSpeed * @since 1.3 */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * GUI helpers for LiteSpeed Cache. */ class GUI extends Base { const LOG_TAG = '[GUI]'; /** * Counter for temporary HTML wrappers. * * @var int Counter for temporary HTML wrappers to remove from the buffer. */ private static $_clean_counter = 0; /** * Promo display flag. * * @var bool Internal flag used by promo templates to decide whether to display. */ private $_promo_true = false; /** * Promo list configuration. * * Format: [ file_tag => [ days, litespeed_only ], ... ] * * @var array<string, array{0:int,1:bool}> */ private $_promo_list = [ 'new_version' => [ 7, false ], 'score' => [ 14, false ], // 'slack' => [ 3, false ], ]; /** Path to guest JavaScript file. */ const LIB_GUEST_JS = 'assets/js/guest.min.js'; /** Path to guest document.referrer JavaScript file. */ const LIB_GUEST_DOCREF_JS = 'assets/js/guest.docref.min.js'; /** Path to guest vary endpoint. */ const PHP_GUEST = 'guest.vary.php'; /** Dismiss type: WHM. */ const TYPE_DISMISS_WHM = 'whm'; /** Dismiss type: ExpiresDefault. */ const TYPE_DISMISS_EXPIRESDEFAULT = 'ExpiresDefault'; /** Dismiss type: Promo. */ const TYPE_DISMISS_PROMO = 'promo'; /** Dismiss type: PIN. */ const TYPE_DISMISS_PIN = 'pin'; /** WHM message option name. */ const WHM_MSG = 'lscwp_whm_install'; /** WHM message option value. */ const WHM_MSG_VAL = 'whm_install'; /** * Summary options cache. * * @var array<string,mixed> Summary/options cache. */ protected $_summary; /** * Instance. * * @since 1.3 */ public function __construct() { $this->_summary = self::get_summary(); } /** * Frontend init. * * @since 3.0 */ public function init() { self::debug2( 'init' ); if ( is_admin_bar_showing() && current_user_can( 'manage_options' ) ) { add_action( 'wp_enqueue_scripts', [ $this, 'frontend_enqueue_style' ] ); add_action( 'admin_bar_menu', [ $this, 'frontend_shortcut' ], 95 ); } /** * Turn on instant click. * * @since 1.8.2 */ if ( $this->conf( self::O_UTIL_INSTANT_CLICK ) ) { add_action( 'wp_enqueue_scripts', [ $this, 'frontend_enqueue_style_public' ] ); } // NOTE: this needs to be before optimizer to avoid wrapper being removed. add_filter( 'litespeed_buffer_finalize', [ $this, 'finalize' ], 8 ); } /** * Print a loading message when redirecting CCSS/UCSS page to avoid blank page confusion. * * @param int $counter Files left in queue. * @param string $type Queue type label. * @return void */ public static function print_loading( $counter, $type ) { echo '<div style="font-size:25px;text-align:center;padding-top:150px;width:100%;position:absolute;">'; echo "<img width='35' src='" . esc_url( LSWCP_PLUGIN_URL . 'assets/img/Litespeed.icon.svg' ) . "' alt='' /> "; printf( /* translators: 1: number, 2: text */ esc_html__( '%1$s %2$s files left in queue', 'litespeed-cache' ), esc_html( number_format_i18n( $counter ) ), esc_html( $type ) ); echo '<p><a href="' . esc_url( admin_url( 'admin.php?page=litespeed-page_optm' ) ) . '">' . esc_html__( 'Cancel', 'litespeed-cache' ) . '</a></p>'; echo '</div>'; } /** * Display the tab list. * * @since 7.3 * * @param array<string,string> $tabs Key => Label pairs. * @return void */ public static function display_tab_list( $tabs ) { $i = 1; foreach ( $tabs as $k => $val ) { $accesskey = $i <= 9 ? $i : ''; printf( '<a class="litespeed-tab nav-tab" href="#%1$s" data-litespeed-tab="%1$s" litespeed-accesskey="%2$s">%3$s</a>', esc_attr( $k ), esc_attr( $accesskey ), esc_html( $val ) ); ++$i; } } /** * Render a pie chart SVG string. * * @since 1.6.6 * * @param int $percent Percentage 0-100. * @param int $width Width/height in pixels. * @param bool $finished_tick Show a tick when 100%. * @param bool $without_percentage Hide the % label. * @param string|bool $append_cls Extra CSS class. * @return string SVG markup. */ public static function pie( $percent, $width = 50, $finished_tick = false, $without_percentage = false, $append_cls = false ) { $label = $without_percentage ? $percent : ( $percent . '%' ); $percentage = '<text x="50%" y="50%">' . esc_html( $label ) . '</text>'; if ( 100 === $percent && $finished_tick ) { $percentage = '<text x="50%" y="50%" class="litespeed-pie-done">✓</text>'; } $svg = sprintf( "<svg class='litespeed-pie %1\$s' viewbox='0 0 33.83098862 33.83098862' width='%2\$d' height='%2\$d' xmlns='http://www.w3.org/2000/svg'> <circle class='litespeed-pie_bg' cx='16.91549431' cy='16.91549431' r='15.91549431' /> <circle class='litespeed-pie_circle' cx='16.91549431' cy='16.91549431' r='15.91549431' stroke-dasharray='%3\$d,100' /> <g class='litespeed-pie_info'>%4\$s</g> </svg>", esc_attr( $append_cls ), $width, $percent, $percentage ); return $svg; } /** * Allowed SVG tags/attributes for kses. * * @since 7.3 * * @return array<string,array<string,bool>> Allowed tags/attributes. */ public static function allowed_svg_tags() { return [ 'svg' => [ 'width' => true, 'height' => true, 'viewbox' => true, // Note: SVG standard uses 'viewBox', but wp_kses normalizes to lowercase. 'xmlns' => true, 'class' => true, 'id' => true, ], 'circle' => [ 'cx' => true, 'cy' => true, 'r' => true, 'fill' => true, 'stroke' => true, 'class' => true, 'stroke-width' => true, 'stroke-dasharray' => true, ], 'path' => [ 'd' => true, 'fill' => true, 'stroke' => true, ], 'text' => [ 'x' => true, 'y' => true, 'dx' => true, 'dy' => true, 'font-size' => true, 'font-family' => true, 'font-weight' => true, 'fill' => true, 'stroke' => true, 'stroke-width' => true, 'text-anchor' => true, 'class' => true, 'id' => true, ], 'g' => [ 'transform' => true, 'fill' => true, 'stroke' => true, 'stroke-width' => true, 'class' => true, 'id' => true, ], 'button' => [ 'type' => true, 'data-balloon-break' => true, 'data-balloon-pos' => true, 'aria-label' => true, 'class' => true, ], ]; } /** * Display a tiny pie with a tooltip. * * @since 3.0 * * @param int $percent Percentage 0-100. * @param int $width Width/height in pixels. * @param string $tooltip Tooltip text. * @param string $tooltip_pos Tooltip position (e.g., 'up'). * @param string|bool $append_cls Extra CSS class. * @return string HTML/SVG. */ public static function pie_tiny( $percent, $width = 50, $tooltip = '', $tooltip_pos = 'up', $append_cls = false ) { // formula C = 2πR. $dasharray = 2 * 3.1416 * 9 * ( $percent / 100 ); return sprintf( " <button type='button' data-balloon-break data-balloon-pos='%1\$s' aria-label='%2\$s' class='litespeed-btn-pie'> <svg class='litespeed-pie litespeed-pie-tiny %3\$s' viewbox='0 0 30 30' width='%4\$d' height='%4\$d' xmlns='http://www.w3.org/2000/svg'> <circle class='litespeed-pie_bg' cx='15' cy='15' r='9' /> <circle class='litespeed-pie_circle' cx='15' cy='15' r='9' stroke-dasharray='%5\$s,100' /> <g class='litespeed-pie_info'><text x='50%%' y='50%%'>i</text></g> </svg> </button> ", esc_attr( $tooltip_pos ), esc_attr( $tooltip ), esc_attr( $append_cls ), $width, esc_attr( $dasharray ) ); } /** * Get CSS class name for PageSpeed score. * * Scale: * 90-100 (fast) * 50-89 (average) * 0-49 (slow) * * @since 2.9 * @access public * * @param int $score Score 0-100. * @return string Class name: success|warning|danger. */ public function get_cls_of_pagescore( $score ) { if ( $score >= 90 ) { return 'success'; } if ( $score >= 50 ) { return 'warning'; } return 'danger'; } /** * Handle dismiss actions for banners and notices. * * @since 1.0 * @access public * @return void */ public static function dismiss() { $_instance = self::cls(); switch ( Router::verify_type() ) { case self::TYPE_DISMISS_WHM: self::dismiss_whm(); break; case self::TYPE_DISMISS_EXPIRESDEFAULT: self::update_option( Admin_Display::DB_DISMISS_MSG, Admin_Display::RULECONFLICT_DISMISSED ); break; case self::TYPE_DISMISS_PIN: Admin_Display::dismiss_pin(); break; case self::TYPE_DISMISS_PROMO: if ( empty( $_GET['promo_tag'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended break; } $promo_tag = sanitize_key( wp_unslash( $_GET['promo_tag'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( empty( $_instance->_promo_list[ $promo_tag ] ) ) { break; } defined( 'LSCWP_LOG' ) && self::debug( 'Dismiss promo ' . $promo_tag ); // Forever dismiss. if ( ! empty( $_GET['done'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended $_instance->_summary[ $promo_tag ] = 'done'; } elseif ( ! empty( $_GET['later'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended // Delay the banner to half year later. $_instance->_summary[ $promo_tag ] = time() + ( 86400 * 180 ); } else { // Update welcome banner to 30 days after. $_instance->_summary[ $promo_tag ] = time() + ( 86400 * 30 ); } self::save_summary(); break; default: break; } if ( Router::is_ajax() ) { // All dismiss actions are considered as ajax call, so just exit. exit( wp_json_encode( [ 'success' => 1 ] ) ); } // Plain click link, redirect to referral url. Admin::redirect(); } /** * Check if has rule conflict notice. * * @since 1.1.5 * @access public * * @return bool True if message should be shown. */ public static function has_msg_ruleconflict() { $db_dismiss_msg = self::get_option( Admin_Display::DB_DISMISS_MSG ); if ( ! $db_dismiss_msg ) { self::update_option( Admin_Display::DB_DISMISS_MSG, -1 ); } return Admin_Display::RULECONFLICT_ON === $db_dismiss_msg; } /** * Check if has WHM notice. * * @since 1.1.1 * @access public * * @return bool True if message should be shown. */ public static function has_whm_msg() { $val = self::get_option( self::WHM_MSG ); if ( ! $val ) { self::dismiss_whm(); return false; } return self::WHM_MSG_VAL === $val; } /** * Delete WHM message tag. * * @since 1.1.1 * @access public * @return void */ public static function dismiss_whm() { self::update_option( self::WHM_MSG, -1 ); } /** * Whether current request is a LiteSpeed admin page. * * @since 2.9 * * @return bool True if LiteSpeed page. */ private function _is_litespeed_page() { if ( ! empty( $_GET['page'] ) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended in_array( (string) $_GET['page'], // phpcs:ignore WordPress.Security.NonceVerification.Recommended [ 'litespeed-settings', 'litespeed-dash', Admin::PAGE_EDIT_HTACCESS, 'litespeed-optimization', 'litespeed-crawler', 'litespeed-import', 'litespeed-report', ], true ) ) { return true; } return false; } /** * Display promo banner (or check-only mode to know which promo would display). * * @since 2.1 * @access public * * @param bool $check_only If true, only return the promo tag that would be shown. * @return false|string False if none, or the promo tag string. */ public function show_promo( $check_only = false ) { $is_litespeed_page = $this->_is_litespeed_page(); // Bypass showing info banner if disabled all in debug. if ( defined( 'LITESPEED_DISABLE_ALL' ) && LITESPEED_DISABLE_ALL ) { return false; } if ( file_exists( ABSPATH . '.litespeed_no_banner' ) ) { defined( 'LSCWP_LOG' ) && self::debug( 'Bypass banners due to silence file' ); return false; } foreach ( $this->_promo_list as $promo_tag => $v ) { list( $delay_days, $litespeed_page_only ) = $v; if ( $litespeed_page_only && ! $is_litespeed_page ) { continue; } // First time check. if ( empty( $this->_summary[ $promo_tag ] ) ) { $this->_summary[ $promo_tag ] = time() + 86400 * $delay_days; self::save_summary(); continue; } $promo_timestamp = $this->_summary[ $promo_tag ]; // Was ticked as done. if ( 'done' === $promo_timestamp ) { continue; } // Not reach the dateline yet. if ( time() < $promo_timestamp ) { continue; } // Try to load, if can pass, will set $this->_promo_true = true. $this->_promo_true = false; include LSCWP_DIR . "tpl/banner/$promo_tag.php"; // If not defined, means it didn't pass the display workflow in tpl. if ( ! $this->_promo_true ) { continue; } if ( $check_only ) { return $promo_tag; } defined( 'LSCWP_LOG' ) && self::debug( 'Show promo ' . $promo_tag ); // Only contain one. break; } return false; } /** * Load frontend public script. * * @since 1.8.2 * @access public * @return void */ public function frontend_enqueue_style_public() { wp_enqueue_script( Core::PLUGIN_NAME, LSWCP_PLUGIN_URL . 'assets/js/instant_click.min.js', [], Core::VER, [ 'strategy' => 'defer', 'in_footer' => true, ] ); } /** * Load frontend stylesheet. * * @since 1.3 * @access public * @return void */ public function frontend_enqueue_style() { wp_enqueue_style( Core::PLUGIN_NAME, LSWCP_PLUGIN_URL . 'assets/css/litespeed.css', [], Core::VER, 'all' ); } /** * Load frontend menu shortcut items in the admin bar. * * @since 1.3 * @since 7.6 Add VPI clear. * @access public * @return void */ public function frontend_shortcut() { global $wp_admin_bar; $wp_admin_bar->add_menu( [ 'id' => 'litespeed-menu', 'title' => '<span class="ab-icon"></span>', 'href' => get_admin_url( null, 'admin.php?page=litespeed' ), 'meta' => [ 'tabindex' => 0, 'class' => 'litespeed-top-toolbar', ], ] ); $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-single', 'title' => esc_html__( 'Purge this page', 'litespeed-cache' ) . ' - LSCache', 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_FRONT, false, true ), 'meta' => [ 'tabindex' => '0' ], ] ); if ( $this->has_cache_folder( 'ucss' ) ) { $possible_url_tag = UCSS::get_url_tag(); $append_arr = []; if ( $possible_url_tag ) { $append_arr['url_tag'] = $possible_url_tag; } $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-single-ucss', 'title' => esc_html__( 'Purge this page', 'litespeed-cache' ) . ' - UCSS', 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_UCSS, false, true, $append_arr ), 'meta' => [ 'tabindex' => '0' ], ] ); } $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-single-action', 'title' => esc_html__( 'Mark this page as ', 'litespeed-cache' ), 'meta' => [ 'tabindex' => '0' ], ] ); $current_uri = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; if ( $current_uri ) { $append_arr = [ Conf::TYPE_SET . '[' . self::O_CACHE_FORCE_URI . '][]' => $current_uri . '$', 'redirect' => $current_uri, ]; $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-single-action', 'id' => 'litespeed-single-forced_cache', 'title' => esc_html__( 'Forced cacheable', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_CONF, Conf::TYPE_SET, false, true, $append_arr ), ] ); $append_arr = [ Conf::TYPE_SET . '[' . self::O_CACHE_EXC . '][]' => $current_uri . '$', 'redirect' => $current_uri, ]; $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-single-action', 'id' => 'litespeed-single-noncache', 'title' => esc_html__( 'Non cacheable', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_CONF, Conf::TYPE_SET, false, true, $append_arr ), ] ); $append_arr = [ Conf::TYPE_SET . '[' . self::O_CACHE_PRIV_URI . '][]' => $current_uri . '$', 'redirect' => $current_uri, ]; $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-single-action', 'id' => 'litespeed-single-private', 'title' => esc_html__( 'Private cache', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_CONF, Conf::TYPE_SET, false, true, $append_arr ), ] ); $append_arr = [ Conf::TYPE_SET . '[' . self::O_OPTM_EXC . '][]' => $current_uri . '$', 'redirect' => $current_uri, ]; $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-single-action', 'id' => 'litespeed-single-nonoptimize', 'title' => esc_html__( 'No optimization', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_CONF, Conf::TYPE_SET, false, true, $append_arr ), ] ); } $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-single-action', 'id' => 'litespeed-single-more', 'title' => esc_html__( 'More settings', 'litespeed-cache' ), 'href' => get_admin_url( null, 'admin.php?page=litespeed-cache' ), ] ); $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-all', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL, false, '_ori' ), 'meta' => [ 'tabindex' => '0' ], ] ); $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-all-lscache', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'LSCache', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_LSCACHE, false, '_ori' ), 'meta' => [ 'tabindex' => '0' ], ] ); $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-cssjs', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'CSS/JS Cache', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_CSSJS, false, '_ori' ), 'meta' => [ 'tabindex' => '0' ], ] ); if ( $this->conf( self::O_CDN_CLOUDFLARE ) ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-cloudflare', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'Cloudflare', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_CDN_CLOUDFLARE, CDN\Cloudflare::TYPE_PURGE_ALL ), 'meta' => [ 'tabindex' => '0' ], ] ); } if ( defined( 'LSCWP_OBJECT_CACHE' ) ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-object', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'Object Cache', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_OBJECT, false, '_ori' ), 'meta' => [ 'tabindex' => '0' ], ] ); } if ( Router::opcache_enabled() ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-opcache', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'Opcode Cache', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_OPCACHE, false, '_ori' ), 'meta' => [ 'tabindex' => '0' ], ] ); } if ( $this->has_cache_folder( 'ccss' ) ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-ccss', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - CCSS', 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_CCSS, false, '_ori' ), 'meta' => [ 'tabindex' => '0' ], ] ); } if ( $this->has_cache_folder( 'ucss' ) ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-ucss', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - UCSS', 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_UCSS, false, '_ori' ), ] ); } if ( $this->has_cache_folder( 'localres' ) ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-localres', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'Localized Resources', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_LOCALRES, false, '_ori' ), 'meta' => [ 'tabindex' => '0' ], ] ); } if ( $this->has_cache_folder( 'lqip' ) ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-placeholder', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'LQIP Cache', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_LQIP, false, '_ori' ), 'meta' => [ 'tabindex' => '0' ], ] ); } if ( $this->has_cache_folder( 'vpi' ) ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-vpi', 'title' => __( 'Purge All', 'litespeed-cache' ) . ' - VPI', 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_VPI, false, '_ori' ), 'meta' => [ 'tabindex' => '0' ], ] ); } if ( $this->has_cache_folder( 'avatar' ) ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-avatar', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'Gravatar Cache', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_AVATAR, false, '_ori' ), 'meta' => [ 'tabindex' => '0' ], ] ); } do_action( 'litespeed_frontend_shortcut' ); } /** * Hooked to wp_before_admin_bar_render. * Adds links to the admin bar so users can quickly manage/purge. * * @since 1.7.2 Moved from admin_display.cls to gui.cls; Renamed from `add_quick_purge` to `backend_shortcut`. * @access public * @global \WP_Admin_Bar $wp_admin_bar * @return void */ public function backend_shortcut() { global $wp_admin_bar; if ( defined( 'LITESPEED_DISABLE_ALL' ) && LITESPEED_DISABLE_ALL ) { $wp_admin_bar->add_menu( [ 'id' => 'litespeed-menu', 'title' => '<span class="ab-icon icon_disabled" title="LiteSpeed Cache"></span>', 'href' => 'admin.php?page=litespeed-toolbox#settings-debug', 'meta' => [ 'tabindex' => 0, 'class' => 'litespeed-top-toolbar', ], ] ); $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-enable_all', 'title' => esc_html__( 'Enable All Features', 'litespeed-cache' ), 'href' => 'admin.php?page=litespeed-toolbox#settings-debug', 'meta' => [ 'tabindex' => '0' ], ] ); return; } $wp_admin_bar->add_menu( [ 'id' => 'litespeed-menu', 'title' => '<span class="ab-icon" title="' . esc_attr__( 'LiteSpeed Cache Purge All', 'litespeed-cache' ) . ' - ' . esc_attr__( 'LSCache', 'litespeed-cache' ) . '"></span>', 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_LSCACHE ), 'meta' => [ 'tabindex' => 0, 'class' => 'litespeed-top-toolbar', ], ] ); $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-bar-manage', 'title' => esc_html__( 'Manage', 'litespeed-cache' ), 'href' => 'admin.php?page=litespeed', 'meta' => [ 'tabindex' => '0' ], ] ); $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-bar-setting', 'title' => esc_html__( 'Settings', 'litespeed-cache' ), 'href' => 'admin.php?page=litespeed-cache', 'meta' => [ 'tabindex' => '0' ], ] ); if ( ! is_network_admin() ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-bar-imgoptm', 'title' => esc_html__( 'Image Optimization', 'litespeed-cache' ), 'href' => 'admin.php?page=litespeed-img_optm', 'meta' => [ 'tabindex' => '0' ], ] ); } $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-all', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL ), 'meta' => [ 'tabindex' => '0' ], ] ); $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-all-lscache', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'LSCache', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_LSCACHE ), 'meta' => [ 'tabindex' => '0' ], ] ); $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-cssjs', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'CSS/JS Cache', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_CSSJS ), 'meta' => [ 'tabindex' => '0' ], ] ); if ( $this->conf( self::O_CDN_CLOUDFLARE ) ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-cloudflare', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'Cloudflare', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_CDN_CLOUDFLARE, CDN\Cloudflare::TYPE_PURGE_ALL ), 'meta' => [ 'tabindex' => '0' ], ] ); } if ( defined( 'LSCWP_OBJECT_CACHE' ) ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-object', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'Object Cache', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_OBJECT ), 'meta' => [ 'tabindex' => '0' ], ] ); } if ( Router::opcache_enabled() ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-opcache', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'Opcode Cache', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_OPCACHE ), 'meta' => [ 'tabindex' => '0' ], ] ); } if ( $this->has_cache_folder( 'ccss' ) ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-ccss', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - CCSS', 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_CCSS ), 'meta' => [ 'tabindex' => '0' ], ] ); } if ( $this->has_cache_folder( 'ucss' ) ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-ucss', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - UCSS', 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_UCSS ), ] ); } if ( $this->has_cache_folder( 'localres' ) ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-localres', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'Localized Resources', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_LOCALRES ), 'meta' => [ 'tabindex' => '0' ], ] ); } if ( $this->has_cache_folder( 'lqip' ) ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-placeholder', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'LQIP Cache', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_LQIP ), 'meta' => [ 'tabindex' => '0' ], ] ); } if ( $this->has_cache_folder( 'vpi' ) ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-vpi', 'title' => __( 'Purge All', 'litespeed-cache' ) . ' - VPI', 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_VPI ), 'meta' => [ 'tabindex' => '0' ], ] ); } if ( $this->has_cache_folder( 'avatar' ) ) { $wp_admin_bar->add_menu( [ 'parent' => 'litespeed-menu', 'id' => 'litespeed-purge-avatar', 'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'Gravatar Cache', 'litespeed-cache' ), 'href' => Utility::build_url( Router::ACTION_PURGE, Purge::TYPE_PURGE_ALL_AVATAR ), 'meta' => [ 'tabindex' => '0' ], ] ); } do_action( 'litespeed_backend_shortcut' ); } /** * Clear unfinished data link/button. * * @since 2.4.2 * @access public * * @param int $unfinished_num Number of unfinished images. * @return string HTML for action button. */ public static function img_optm_clean_up( $unfinished_num ) { return sprintf( '<a href="%1$s" class="button litespeed-btn-warning" data-balloon-pos="up" aria-label="%2$s"><span class="dashicons dashicons-editor-removeformatting"></span> %3$s</a>', esc_url( Utility::build_url( Router::ACTION_IMG_OPTM, Img_Optm::TYPE_CLEAN ) ), esc_attr__( 'Remove all previous unfinished image optimization requests.', 'litespeed-cache' ), esc_html__( 'Clean Up Unfinished Data', 'litespeed-cache' ) . ( $unfinished_num ? ': ' . Admin_Display::print_plural( $unfinished_num, 'image' ) : '' ) ); } /** * Generate install link. * * @since 2.4.2 * @access public * * @param string $title Plugin title. * @param string $name Slug. * @param string $v Version (unused, kept for BC). * @return string HTML link. */ public static function plugin_install_link( $title, $name, $v ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $name ), 'install-plugin_' . $name ); $action = sprintf( '<a href="%1$s" class="install-now" data-slug="%2$s" data-name="%3$s" aria-label="%4$s">%5$s</a>', esc_url( $url ), esc_attr( $name ), esc_attr( $title ), esc_attr( sprintf( __( 'Install %s', 'litespeed-cache' ), $title ) ), esc_html__( 'Install Now', 'litespeed-cache' ) ); return $action; } /** * Generate upgrade link. * * @since 2.4.2 * @access public * * @param string $title Plugin title. * @param string $name Slug. * @param string $v Version string. * @return string HTML message with links. */ public static function plugin_upgrade_link( $title, $name, $v ) { $details_url = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $name . '§ion=changelog&TB_iframe=true&width=600&height=800' ); $file = $name . '/' . $name . '.php'; $msg = sprintf( /* translators: 1: details URL, 2: class/aria, 3: version, 4: update URL, 5: class/aria */ __('<a href="%1$s" %2$s>View version %3$s details</a> or <a href="%4$s" %5$s target="_blank">update now</a>.', 'litespeed-cache'), esc_url( $details_url ), sprintf( 'class="thickbox open-plugin-details-modal" aria-label="%s"', esc_attr( sprintf( /* translators: 1: plugin title, 2: version */ __( 'View %1$s version %2$s details', 'litespeed-cache' ), $title, $v ) ) ), esc_html( $v ), esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ) ), sprintf( 'class="update-link" aria-label="%s"', esc_attr( sprintf( /* translators: %s: plugin title */ __( 'Update %s now', 'litespeed-cache' ), $title ) ) ) ); return $msg; } /** * Finalize buffer by GUI class. * * @since 1.6 * @access public * * @param string $buffer HTML buffer. * @return string Filtered buffer. */ public function finalize( $buffer ) { $buffer = $this->_clean_wrapper( $buffer ); // Maybe restore doc.ref. if ( $this->conf( Base::O_GUEST ) && false !== strpos( $buffer, '<head>' ) && defined( 'LITESPEED_IS_HTML' ) ) { $buffer = $this->_enqueue_guest_docref_js( $buffer ); } if ( defined( 'LITESPEED_GUEST' ) && LITESPEED_GUEST && false !== strpos( $buffer, '</body>' ) && defined( 'LITESPEED_IS_HTML' ) ) { $buffer = $this->_enqueue_guest_js( $buffer ); } return $buffer; } /** * Append guest restore doc.ref JS for organic traffic count. * * @since 4.4.6 * * @param string $buffer HTML buffer. * @return string Buffer with inline script injected. */ private function _enqueue_guest_docref_js( $buffer ) { $js_con = File::read( LSCWP_DIR . self::LIB_GUEST_DOCREF_JS ); $buffer = preg_replace( '/<head>/', '<head><script data-no-optimize="1">' . $js_con . '</script>', $buffer, 1 ); return $buffer; } /** * Append guest JS to update vary. * * @since 4.0 * * @param string $buffer HTML buffer. * @return string Buffer with inline script injected. */ private function _enqueue_guest_js( $buffer ) { $js_con = File::read( LSCWP_DIR . self::LIB_GUEST_JS ); // Build path for guest endpoint using wp_parse_url for compatibility. $guest_update_path = wp_parse_url( LSWCP_PLUGIN_URL . self::PHP_GUEST, PHP_URL_PATH ); $js_con = str_replace( 'litespeed_url', esc_url( $guest_update_path ), $js_con ); $buffer = preg_replace( '/<\/body>/', '<script data-no-optimize="1">' . $js_con . '</script></body>', $buffer, 1 ); return $buffer; } /** * Clean wrapper from buffer. * * @since 1.4 * @since 1.6 Converted to private with adding prefix _. * @access private * * @param string $buffer HTML buffer. * @return string Cleaned buffer. */ private function _clean_wrapper( $buffer ) { if ( self::$_clean_counter < 1 ) { self::debug2( 'bypassed by no counter' ); return $buffer; } self::debug2( 'start cleaning counter ' . self::$_clean_counter ); for ( $i = 1; $i <= self::$_clean_counter; $i++ ) { // If miss beginning. $start = strpos( $buffer, self::clean_wrapper_begin( $i ) ); if ( false === $start ) { $buffer = str_replace( self::clean_wrapper_end( $i ), '', $buffer ); self::debug2( "lost beginning wrapper $i" ); continue; } // If miss end. $end_wrapper = self::clean_wrapper_end( $i ); $end = strpos( $buffer, $end_wrapper ); if ( false === $end ) { $buffer = str_replace( self::clean_wrapper_begin( $i ), '', $buffer ); self::debug2( "lost ending wrapper $i" ); continue; } // Now replace wrapped content. $buffer = substr_replace( $buffer, '', $start, $end - $start + strlen( $end_wrapper ) ); self::debug2( "cleaned wrapper $i" ); } return $buffer; } /** * Display a to-be-removed HTML wrapper (begin tag). * * @since 1.4 * @access public * * @param int|false $counter Optional explicit wrapper id; auto-increment if false. * @return string Wrapper begin HTML comment. */ public static function clean_wrapper_begin( $counter = false ) { if ( false === $counter ) { ++self::$_clean_counter; $counter = self::$_clean_counter; self::debug( 'clean wrapper ' . $counter . ' begin' ); } return '<!-- LiteSpeed To Be Removed begin ' . $counter . ' -->'; } /** * Display a to-be-removed HTML wrapper (end tag). * * @since 1.4 * @access public * * @param int|false $counter Optional explicit wrapper id; use latest if false. * @return string Wrapper end HTML comment. */ public static function clean_wrapper_end( $counter = false ) { if ( false === $counter ) { $counter = self::$_clean_counter; self::debug( 'clean wrapper ' . $counter . ' end' ); } return '<!-- LiteSpeed To Be Removed end ' . $counter . ' -->'; } } src/admin-settings.cls.php 0000777 00000026167 15251157102 0011574 0 ustar 00 <?php /** * The admin settings handler of the plugin. * * Handles saving and validating settings from the admin UI and network admin. * * @since 1.1.0 * @package LiteSpeed */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Admin_Settings * * Saves, sanitizes, and validates LiteSpeed Cache settings. */ class Admin_Settings extends Base { const LOG_TAG = '[Settings]'; const ENROLL = '_settings-enroll'; /** * Save settings (single site). * * Accepts data from $_POST or WP-CLI. * Importers may call the Conf class directly. * * @since 3.0 * * @param array<string,mixed> $raw_data Raw data from request/CLI. * @return void */ public function save( $raw_data ) { self::debug( 'saving' ); if ( empty( $raw_data[ self::ENROLL ] ) ) { wp_die( esc_html__( 'No fields', 'litespeed-cache' ) ); } $raw_data = Admin::cleanup_text( $raw_data ); // Convert data to config format. $the_matrix = []; foreach ( array_unique( $raw_data[ self::ENROLL ] ) as $id ) { $child = false; // Drop array format. if ( false !== strpos( $id, '[' ) ) { if ( 0 === strpos( $id, self::O_CDN_MAPPING ) || 0 === strpos( $id, self::O_CRAWLER_COOKIES ) ) { // CDN child | Cookie Crawler settings. $child = substr( $id, strpos( $id, '[' ) + 1, strpos( $id, ']' ) - strpos( $id, '[' ) - 1 ); // Drop ending []; Compatible with xx[0] way from CLI. $id = substr( $id, 0, strpos( $id, '[' ) ); } else { // Drop ending []. $id = substr( $id, 0, strpos( $id, '[' ) ); } } if ( ! array_key_exists( $id, self::$_default_options ) ) { continue; } // Validate $child. if ( self::O_CDN_MAPPING === $id ) { if ( ! in_array( $child, [ self::CDN_MAPPING_URL, self::CDN_MAPPING_INC_IMG, self::CDN_MAPPING_INC_CSS, self::CDN_MAPPING_INC_JS, self::CDN_MAPPING_FILETYPE ], true ) ) { continue; } } if ( self::O_CRAWLER_COOKIES === $id ) { if ( ! in_array( $child, [ self::CRWL_COOKIE_NAME, self::CRWL_COOKIE_VALS ], true ) ) { continue; } } // Pull value from request. if ( $child ) { // []=xxx or [0]=xxx $data = ! empty( $raw_data[ $id ][ $child ] ) ? $raw_data[ $id ][ $child ] : $this->type_casting(false, $id); } else { $data = ! empty( $raw_data[ $id ] ) ? $raw_data[ $id ] : $this->type_casting(false, $id); } // Sanitize/normalize complex fields. if ( self::O_CDN_MAPPING === $id || self::O_CRAWLER_COOKIES === $id ) { // Use existing queued data if available (only when $child != false). $data2 = array_key_exists( $id, $the_matrix ) ? $the_matrix[ $id ] : ( defined( 'WP_CLI' ) && WP_CLI ? $this->conf( $id ) : [] ); } switch ( $id ) { // Don't allow Editor/admin to be used in crawler role simulator. case self::O_CRAWLER_ROLES: $data = Utility::sanitize_lines( $data ); if ( $data ) { foreach ( $data as $k => $v ) { if ( user_can( $v, 'edit_posts' ) ) { /* translators: %s: user id in <code> tags */ $msg = sprintf( esc_html__( 'The user with id %s has editor access, which is not allowed for the role simulator.', 'litespeed-cache' ), '<code>' . esc_html( $v ) . '</code>' ); Admin_Display::error( $msg ); unset( $data[ $k ] ); } } } break; case self::O_CDN_MAPPING: /** * CDN setting * * Raw data format: * cdn-mapping[url][] = 'xxx' * cdn-mapping[url][2] = 'xxx2' * cdn-mapping[inc_js][] = 1 * * Final format: * cdn-mapping[0][url] = 'xxx' * cdn-mapping[2][url] = 'xxx2' */ if ( $data ) { foreach ( $data as $k => $v ) { if ( self::CDN_MAPPING_FILETYPE === $child ) { $v = Utility::sanitize_lines( $v ); } if ( self::CDN_MAPPING_URL === $child ) { // If not a valid URL, turn off CDN. if ( 0 !== strpos( $v, 'https://' ) ) { self::debug( '❌ CDN mapping set to OFF due to invalid URL' ); $the_matrix[ self::O_CDN ] = false; } $v = trailingslashit( $v ); } if ( in_array( $child, [ self::CDN_MAPPING_INC_IMG, self::CDN_MAPPING_INC_CSS, self::CDN_MAPPING_INC_JS ], true ) ) { // Because these can't be auto detected in `config->update()`, need to format here. $v = 'false' === $v ? 0 : (bool) $v; } if ( empty( $data2[ $k ] ) ) { $data2[ $k ] = []; } $data2[ $k ][ $child ] = $v; } } $data = $data2; break; case self::O_CRAWLER_COOKIES: /** * Cookie Crawler setting * Raw Format: * crawler-cookies[name][] = xxx * crawler-cookies[name][2] = xxx2 * crawler-cookies[vals][] = xxx * * Final format: * crawler-cookie[0][name] = 'xxx' * crawler-cookie[0][vals] = 'xxx' * crawler-cookie[2][name] = 'xxx2' * * Empty line for `vals` uses literal `_null`. */ if ( $data ) { foreach ( $data as $k => $v ) { if ( self::CRWL_COOKIE_VALS === $child ) { $v = Utility::sanitize_lines( $v ); } if ( empty( $data2[ $k ] ) ) { $data2[ $k ] = []; } $data2[ $k ][ $child ] = $v; } } $data = $data2; break; // Cache exclude category. case self::O_CACHE_EXC_CAT: $data2 = []; $data = Utility::sanitize_lines( $data ); foreach ( $data as $v ) { $cat_id = get_cat_ID( $v ); if ( ! $cat_id ) { continue; } $data2[] = $cat_id; } $data = $data2; break; // Cache exclude tag. case self::O_CACHE_EXC_TAG: $data2 = []; $data = Utility::sanitize_lines( $data ); foreach ( $data as $v ) { $term = get_term_by( 'name', $v, 'post_tag' ); if ( ! $term ) { // Could surface an admin error here if desired. continue; } $data2[] = $term->term_id; } $data = $data2; break; case self::O_IMG_OPTM_SIZES_SKIPPED: // Skip image sizes $image_sizes = Utility::prepare_image_sizes_array(); $saved_sizes = isset( $raw_data[$id] ) ? $raw_data[$id] : []; $data = array_diff( $image_sizes, $saved_sizes ); break; default: break; } $the_matrix[ $id ] = $data; } // Special handler for CDN/Crawler 2d list to drop empty rows. foreach ( $the_matrix as $id => $data ) { /** * Format: * cdn-mapping[0][url] = 'xxx' * cdn-mapping[2][url] = 'xxx2' * crawler-cookie[0][name] = 'xxx' * crawler-cookie[0][vals] = 'xxx' * crawler-cookie[2][name] = 'xxx2' */ if ( self::O_CDN_MAPPING === $id || self::O_CRAWLER_COOKIES === $id ) { // Drop row if all children are empty. foreach ( $data as $k => $v ) { foreach ( $v as $v2 ) { if ( $v2 ) { continue 2; } } // All empty. unset( $the_matrix[ $id ][ $k ] ); } } // Don't allow repeated cookie names. if ( self::O_CRAWLER_COOKIES === $id ) { $existed = []; foreach ( $the_matrix[ $id ] as $k => $v ) { if ( empty( $v[ self::CRWL_COOKIE_NAME ] ) || in_array( $v[ self::CRWL_COOKIE_NAME ], $existed, true ) ) { // Filter repeated or empty name. unset( $the_matrix[ $id ][ $k ] ); continue; } $existed[] = $v[ self::CRWL_COOKIE_NAME ]; } } // tmp fix the 3rd part woo update hook issue when enabling vary cookie. if ( 'wc_cart_vary' === $id ) { if ( $data ) { add_filter( 'litespeed_vary_cookies', function ( $arr ) { $arr[] = 'woocommerce_cart_hash'; return array_unique( $arr ); } ); } else { add_filter( 'litespeed_vary_cookies', function ( $arr ) { $key = array_search( 'woocommerce_cart_hash', $arr, true ); if ( false !== $key ) { unset( $arr[ $key ] ); } return array_unique( $arr ); } ); } } } // id validation will be inside. $this->cls( 'Conf' )->update_confs( $the_matrix ); $msg = __( 'Options saved.', 'litespeed-cache' ); Admin_Display::success( $msg ); } /** * Parses any changes made by the network admin on the network settings. * * @since 3.0 * * @param array<string,mixed> $raw_data Raw data from request/CLI. * @return void */ public function network_save( $raw_data ) { self::debug( 'network saving' ); if ( empty( $raw_data[ self::ENROLL ] ) ) { wp_die( esc_html__( 'No fields', 'litespeed-cache' ) ); } $raw_data = Admin::cleanup_text( $raw_data ); foreach ( array_unique( $raw_data[ self::ENROLL ] ) as $id ) { // Append current field to setting save. if ( ! array_key_exists( $id, self::$_default_site_options ) ) { continue; } $data = ! empty( $raw_data[ $id ] ) ? $raw_data[ $id ] : false; // id validation will be inside. $this->cls( 'Conf' )->network_update( $id, $data ); } // Update related files. Activation::cls()->update_files(); $msg = __( 'Options saved.', 'litespeed-cache' ); Admin_Display::success( $msg ); } /** * Hooked to the wp_redirect filter when saving widgets fails validation. * * @since 1.1.3 * * @param string $location The redirect location. * @return string Updated location string. */ public static function widget_save_err( $location ) { return str_replace( '?message=0', '?error=0', $location ); } /** * Validate the LiteSpeed Cache settings on widget save. * * @since 1.1.3 * * @param array $instance The new settings. * @param array $new_instance The raw submitted settings. * @param array $old_instance The original settings. * @param \WP_Widget $widget The widget instance. * @return array|false Updated settings on success, false on error. */ public static function validate_widget_save( $instance, $new_instance, $old_instance, $widget ) { if ( empty( $new_instance ) ) { return $instance; } if ( ! isset( $new_instance[ ESI::WIDGET_O_ESIENABLE ], $new_instance[ ESI::WIDGET_O_TTL ] ) ) { return $instance; } $esi = (int) $new_instance[ ESI::WIDGET_O_ESIENABLE ] % 3; $ttl = (int) $new_instance[ ESI::WIDGET_O_TTL ]; if ( 0 !== $ttl && $ttl < 30 ) { add_filter( 'wp_redirect', __CLASS__ . '::widget_save_err' ); return false; // Invalid ttl. } if ( empty( $instance[ Conf::OPTION_NAME ] ) ) { // @todo to be removed. $instance[ Conf::OPTION_NAME ] = []; } $instance[ Conf::OPTION_NAME ][ ESI::WIDGET_O_ESIENABLE ] = $esi; $instance[ Conf::OPTION_NAME ][ ESI::WIDGET_O_TTL ] = $ttl; $current = ! empty( $old_instance[ Conf::OPTION_NAME ] ) ? $old_instance[ Conf::OPTION_NAME ] : false; // Avoid unsanitized superglobal usage. $referrer = isset( $_SERVER['HTTP_REFERER'] ) ? esc_url_raw( wp_unslash( $_SERVER['HTTP_REFERER'] ) ) : ''; // Only purge when not in the Customizer. if ( false === strpos( $referrer, '/wp-admin/customize.php' ) ) { if ( ! $current || $esi !== (int) $current[ ESI::WIDGET_O_ESIENABLE ] ) { Purge::purge_all( 'Widget ESI_enable changed' ); } elseif ( 0 !== $ttl && $ttl !== (int) $current[ ESI::WIDGET_O_TTL ] ) { Purge::add( Tag::TYPE_WIDGET . $widget->id ); } Purge::purge_all( 'Widget saved' ); } return $instance; } } src/base.cls.php 0000777 00000104724 15251157102 0007554 0 ustar 00 <?php /** * The base constants and defaults for LiteSpeed Cache. * * Defines all option keys, default values, and helper methods shared across the plugin. * * @since 3.7 * @package LiteSpeed */ namespace LiteSpeed; defined('WPINC') || exit(); /** * Class Base * * Core definitions and helpers shared across LiteSpeed Cache. */ class Base extends Root { // This is redundant since v3.0 // New conf items are `litespeed.key` const OPTION_NAME = 'litespeed-cache-conf'; const _CACHE = '_cache'; // final cache status from setting // -------------------------------------------------- ## // -------------- General ----------------- ## // -------------------------------------------------- ## const _VER = '_version'; // Not set-able const HASH = 'hash'; // Not set-able const O_AUTO_UPGRADE = 'auto_upgrade'; const O_API_KEY = 'api_key'; // Deprecated since v6.4. TODO: Will drop after v8 (still need to keep for v7 upgrade conf usage as v6.5.4 has a major user base) const O_SERVER_IP = 'server_ip'; const O_GUEST = 'guest'; const O_GUEST_OPTM = 'guest_optm'; const O_NEWS = 'news'; const O_GUEST_UAS = 'guest_uas'; const O_GUEST_IPS = 'guest_ips'; // Deprecated since v7.7. TODO: Will drop after v9 // -------------------------------------------------- ## // -------------- Cache ----------------- ## // -------------------------------------------------- ## const O_CACHE = 'cache'; const O_CACHE_PRIV = 'cache-priv'; const O_CACHE_COMMENTER = 'cache-commenter'; const O_CACHE_REST = 'cache-rest'; const O_CACHE_PAGE_LOGIN = 'cache-page_login'; const O_CACHE_RES = 'cache-resources'; // Deprecated since v7.2. TODO: Drop after v7.5 const O_CACHE_MOBILE = 'cache-mobile'; const O_CACHE_MOBILE_RULES = 'cache-mobile_rules'; const O_CACHE_BROWSER = 'cache-browser'; const O_CACHE_EXC_USERAGENTS = 'cache-exc_useragents'; const O_CACHE_EXC_COOKIES = 'cache-exc_cookies'; const O_CACHE_EXC_QS = 'cache-exc_qs'; const O_CACHE_EXC_CAT = 'cache-exc_cat'; const O_CACHE_EXC_TAG = 'cache-exc_tag'; const O_CACHE_FORCE_URI = 'cache-force_uri'; const O_CACHE_FORCE_PUB_URI = 'cache-force_pub_uri'; const O_CACHE_PRIV_URI = 'cache-priv_uri'; const O_CACHE_EXC = 'cache-exc'; const O_CACHE_EXC_ROLES = 'cache-exc_roles'; const O_CACHE_DROP_QS = 'cache-drop_qs'; const O_CACHE_TTL_PUB = 'cache-ttl_pub'; const O_CACHE_TTL_PRIV = 'cache-ttl_priv'; const O_CACHE_TTL_FRONTPAGE = 'cache-ttl_frontpage'; const O_CACHE_TTL_FEED = 'cache-ttl_feed'; const O_CACHE_TTL_REST = 'cache-ttl_rest'; const O_CACHE_TTL_STATUS = 'cache-ttl_status'; const O_CACHE_TTL_BROWSER = 'cache-ttl_browser'; const O_CACHE_AJAX_TTL = 'cache-ajax_ttl'; const O_CACHE_LOGIN_COOKIE = 'cache-login_cookie'; const O_CACHE_VARY_COOKIES = 'cache-vary_cookies'; const O_CACHE_VARY_GROUP = 'cache-vary_group'; // -------------------------------------------------- ## // -------------- Purge ----------------- ## // -------------------------------------------------- ## const O_PURGE_ON_UPGRADE = 'purge-upgrade'; const O_PURGE_STALE = 'purge-stale'; const O_PURGE_POST_ALL = 'purge-post_all'; const O_PURGE_POST_FRONTPAGE = 'purge-post_f'; const O_PURGE_POST_HOMEPAGE = 'purge-post_h'; const O_PURGE_POST_PAGES = 'purge-post_p'; const O_PURGE_POST_PAGES_WITH_RECENT_POSTS = 'purge-post_pwrp'; const O_PURGE_POST_AUTHOR = 'purge-post_a'; const O_PURGE_POST_YEAR = 'purge-post_y'; const O_PURGE_POST_MONTH = 'purge-post_m'; const O_PURGE_POST_DATE = 'purge-post_d'; const O_PURGE_POST_TERM = 'purge-post_t'; // include category|tag|tax const O_PURGE_POST_POSTTYPE = 'purge-post_pt'; const O_PURGE_TIMED_URLS = 'purge-timed_urls'; const O_PURGE_TIMED_URLS_TIME = 'purge-timed_urls_time'; const O_PURGE_HOOK_ALL = 'purge-hook_all'; // -------------------------------------------------- ## // -------------- ESI ----------------- ## // -------------------------------------------------- ## const O_ESI = 'esi'; const O_ESI_CACHE_ADMBAR = 'esi-cache_admbar'; const O_ESI_CACHE_COMMFORM = 'esi-cache_commform'; const O_ESI_NONCE = 'esi-nonce'; // -------------------------------------------------- ## // -------------- Utilities ----------------- ## // -------------------------------------------------- ## const O_UTIL_INSTANT_CLICK = 'util-instant_click'; const O_UTIL_NO_HTTPS_VARY = 'util-no_https_vary'; // -------------------------------------------------- ## // -------------- Debug ----------------- ## // -------------------------------------------------- ## const O_DEBUG_DISABLE_ALL = 'debug-disable_all'; const O_DEBUG = 'debug'; const O_DEBUG_IPS = 'debug-ips'; const O_DEBUG_LEVEL = 'debug-level'; const O_DEBUG_FILESIZE = 'debug-filesize'; const O_DEBUG_COOKIE = 'debug-cookie'; // For backwards compatibility, will drop after v7.0 const O_DEBUG_COLLAPSE_QS = 'debug-collapse_qs'; const O_DEBUG_COLLAPS_QS = 'debug-collapse_qs'; // For backwards compatibility, will drop after v6.5 const O_DEBUG_INC = 'debug-inc'; const O_DEBUG_EXC = 'debug-exc'; const O_DEBUG_EXC_STRINGS = 'debug-exc_strings'; // -------------------------------------------------- ## // -------------- DB Optm ----------------- ## // -------------------------------------------------- ## const O_DB_OPTM_REVISIONS_MAX = 'db_optm-revisions_max'; const O_DB_OPTM_REVISIONS_AGE = 'db_optm-revisions_age'; // -------------------------------------------------- ## // -------------- HTML Optm ----------------- ## // -------------------------------------------------- ## const O_OPTM_CSS_MIN = 'optm-css_min'; const O_OPTM_CSS_COMB = 'optm-css_comb'; const O_OPTM_CSS_COMB_EXT_INL = 'optm-css_comb_ext_inl'; const O_OPTM_UCSS = 'optm-ucss'; const O_OPTM_UCSS_INLINE = 'optm-ucss_inline'; const O_OPTM_UCSS_SELECTOR_WHITELIST = 'optm-ucss_whitelist'; const O_OPTM_UCSS_FILE_EXC_INLINE = 'optm-ucss_file_exc_inline'; const O_OPTM_UCSS_EXC = 'optm-ucss_exc'; const O_OPTM_CSS_EXC = 'optm-css_exc'; const O_OPTM_JS_MIN = 'optm-js_min'; const O_OPTM_JS_COMB = 'optm-js_comb'; const O_OPTM_JS_COMB_EXT_INL = 'optm-js_comb_ext_inl'; const O_OPTM_JS_DELAY_INC = 'optm-js_delay_inc'; const O_OPTM_JS_EXC = 'optm-js_exc'; const O_OPTM_HTML_MIN = 'optm-html_min'; const O_OPTM_HTML_LAZY = 'optm-html_lazy'; const O_OPTM_HTML_SKIP_COMMENTS = 'optm-html_skip_comment'; const O_OPTM_QS_RM = 'optm-qs_rm'; const O_OPTM_GGFONTS_RM = 'optm-ggfonts_rm'; const O_OPTM_CSS_ASYNC = 'optm-css_async'; const O_OPTM_CCSS_PER_URL = 'optm-ccss_per_url'; const O_OPTM_CCSS_SEP_POSTTYPE = 'optm-ccss_sep_posttype'; const O_OPTM_CCSS_SEP_URI = 'optm-ccss_sep_uri'; const O_OPTM_CCSS_SELECTOR_WHITELIST = 'optm-ccss_whitelist'; const O_OPTM_CSS_ASYNC_INLINE = 'optm-css_async_inline'; const O_OPTM_CSS_FONT_DISPLAY = 'optm-css_font_display'; const O_OPTM_JS_DEFER = 'optm-js_defer'; const O_OPTM_LOCALIZE = 'optm-localize'; const O_OPTM_LOCALIZE_DOMAINS = 'optm-localize_domains'; const O_OPTM_EMOJI_RM = 'optm-emoji_rm'; const O_OPTM_NOSCRIPT_RM = 'optm-noscript_rm'; const O_OPTM_GGFONTS_ASYNC = 'optm-ggfonts_async'; const O_OPTM_EXC_ROLES = 'optm-exc_roles'; const O_OPTM_CCSS_CON = 'optm-ccss_con'; const O_OPTM_JS_DEFER_EXC = 'optm-js_defer_exc'; const O_OPTM_GM_JS_EXC = 'optm-gm_js_exc'; const O_OPTM_DNS_PREFETCH = 'optm-dns_prefetch'; const O_OPTM_DNS_PREFETCH_CTRL = 'optm-dns_prefetch_ctrl'; const O_OPTM_DNS_PRECONNECT = 'optm-dns_preconnect'; const O_OPTM_EXC = 'optm-exc'; const O_OPTM_GUEST_ONLY = 'optm-guest_only'; // -------------------------------------------------- ## // -------------- Object Cache ----------------- ## // -------------------------------------------------- ## const O_OBJECT = 'object'; const O_OBJECT_KIND = 'object-kind'; const O_OBJECT_HOST = 'object-host'; const O_OBJECT_PORT = 'object-port'; const O_OBJECT_LIFE = 'object-life'; const O_OBJECT_PERSISTENT = 'object-persistent'; const O_OBJECT_ADMIN = 'object-admin'; const O_OBJECT_TRANSIENTS = 'object-transients'; const O_OBJECT_DB_ID = 'object-db_id'; const O_OBJECT_USER = 'object-user'; const O_OBJECT_PSWD = 'object-pswd'; const O_OBJECT_GLOBAL_GROUPS = 'object-global_groups'; const O_OBJECT_NON_PERSISTENT_GROUPS = 'object-non_persistent_groups'; // -------------------------------------------------- ## // -------------- Discussion ----------------- ## // -------------------------------------------------- ## const O_DISCUSS_AVATAR_CACHE = 'discuss-avatar_cache'; const O_DISCUSS_AVATAR_CRON = 'discuss-avatar_cron'; const O_DISCUSS_AVATAR_CACHE_TTL = 'discuss-avatar_cache_ttl'; // -------------------------------------------------- ## // -------------- Media ----------------- ## // -------------------------------------------------- ## const O_MEDIA_LAZY = 'media-lazy'; const O_MEDIA_LAZY_PLACEHOLDER = 'media-lazy_placeholder'; const O_MEDIA_PLACEHOLDER_RESP = 'media-placeholder_resp'; const O_MEDIA_PLACEHOLDER_RESP_COLOR = 'media-placeholder_resp_color'; const O_MEDIA_PLACEHOLDER_RESP_SVG = 'media-placeholder_resp_svg'; const O_MEDIA_LQIP = 'media-lqip'; const O_MEDIA_LQIP_QUAL = 'media-lqip_qual'; const O_MEDIA_LQIP_MIN_W = 'media-lqip_min_w'; const O_MEDIA_LQIP_MIN_H = 'media-lqip_min_h'; const O_MEDIA_PLACEHOLDER_RESP_ASYNC = 'media-placeholder_resp_async'; const O_MEDIA_IFRAME_LAZY = 'media-iframe_lazy'; const O_MEDIA_ADD_MISSING_SIZES = 'media-add_missing_sizes'; const O_MEDIA_LAZY_EXC = 'media-lazy_exc'; const O_MEDIA_LAZY_CLS_EXC = 'media-lazy_cls_exc'; const O_MEDIA_LAZY_PARENT_CLS_EXC = 'media-lazy_parent_cls_exc'; const O_MEDIA_IFRAME_LAZY_CLS_EXC = 'media-iframe_lazy_cls_exc'; const O_MEDIA_IFRAME_LAZY_PARENT_CLS_EXC = 'media-iframe_lazy_parent_cls_exc'; const O_MEDIA_LAZY_URI_EXC = 'media-lazy_uri_exc'; const O_MEDIA_LQIP_EXC = 'media-lqip_exc'; const O_MEDIA_VPI = 'media-vpi'; const O_MEDIA_VPI_CRON = 'media-vpi_cron'; const O_IMG_OPTM_JPG_QUALITY = 'img_optm-jpg_quality'; const O_MEDIA_AUTO_RESCALE_ORI = 'media-auto_rescale_ori'; // -------------------------------------------------- ## // -------------- Image Optm ----------------- ## // -------------------------------------------------- ## const O_IMG_OPTM_AUTO = 'img_optm-auto'; const O_IMG_OPTM_CRON = 'img_optm-cron'; // @Deprecated since v7.0 TODO: remove after v7.5 const O_IMG_OPTM_ORI = 'img_optm-ori'; const O_IMG_OPTM_RM_BKUP = 'img_optm-rm_bkup'; const O_IMG_OPTM_WEBP = 'img_optm-webp'; const O_IMG_OPTM_LOSSLESS = 'img_optm-lossless'; const O_IMG_OPTM_SIZES_SKIPPED = 'img_optm-sizes_skipped'; const O_IMG_OPTM_EXIF = 'img_optm-exif'; const O_IMG_OPTM_WEBP_ATTR = 'img_optm-webp_attr'; const O_IMG_OPTM_WEBP_REPLACE_SRCSET = 'img_optm-webp_replace_srcset'; // -------------------------------------------------- ## // -------------- Crawler ----------------- ## // -------------------------------------------------- ## const O_CRAWLER = 'crawler'; const O_CRAWLER_USLEEP = 'crawler-usleep'; // @Deprecated since v7.0 TODO: remove after v7.5 const O_CRAWLER_RUN_DURATION = 'crawler-run_duration'; // @Deprecated since v7.0 TODO: remove after v7.5 const O_CRAWLER_RUN_INTERVAL = 'crawler-run_interval'; // @Deprecated since v7.0 TODO: remove after v7.5 const O_CRAWLER_CRAWL_INTERVAL = 'crawler-crawl_interval'; const O_CRAWLER_THREADS = 'crawler-threads'; // @Deprecated since v7.0 TODO: remove after v7.5 const O_CRAWLER_TIMEOUT = 'crawler-timeout'; // @Deprecated since v7.0 TODO: remove after v7.5 const O_CRAWLER_LOAD_LIMIT = 'crawler-load_limit'; const O_CRAWLER_SITEMAP = 'crawler-sitemap'; const O_CRAWLER_DROP_DOMAIN = 'crawler-drop_domain'; // @Deprecated since v7.0 TODO: remove after v7.5 const O_CRAWLER_MAP_TIMEOUT = 'crawler-map_timeout'; // @Deprecated since v7.0 TODO: remove after v7.5 const O_CRAWLER_ROLES = 'crawler-roles'; const O_CRAWLER_COOKIES = 'crawler-cookies'; // -------------------------------------------------- ## // -------------- Misc ----------------- ## // -------------------------------------------------- ## const O_MISC_HEARTBEAT_FRONT = 'misc-heartbeat_front'; const O_MISC_HEARTBEAT_FRONT_TTL = 'misc-heartbeat_front_ttl'; const O_MISC_HEARTBEAT_BACK = 'misc-heartbeat_back'; const O_MISC_HEARTBEAT_BACK_TTL = 'misc-heartbeat_back_ttl'; const O_MISC_HEARTBEAT_EDITOR = 'misc-heartbeat_editor'; const O_MISC_HEARTBEAT_EDITOR_TTL = 'misc-heartbeat_editor_ttl'; // -------------------------------------------------- ## // -------------- CDN ----------------- ## // -------------------------------------------------- ## const O_CDN = 'cdn'; const O_CDN_ORI = 'cdn-ori'; const O_CDN_ORI_DIR = 'cdn-ori_dir'; const O_CDN_EXC = 'cdn-exc'; const O_CDN_QUIC = 'cdn-quic'; // No more a visible setting since v7 const O_CDN_CLOUDFLARE = 'cdn-cloudflare'; const O_CDN_CLOUDFLARE_EMAIL = 'cdn-cloudflare_email'; const O_CDN_CLOUDFLARE_KEY = 'cdn-cloudflare_key'; const O_CDN_CLOUDFLARE_NAME = 'cdn-cloudflare_name'; const O_CDN_CLOUDFLARE_ZONE = 'cdn-cloudflare_zone'; const O_CDN_CLOUDFLARE_CLEAR = 'cdn-cloudflare_clear'; const O_CDN_MAPPING = 'cdn-mapping'; const O_CDN_ATTR = 'cdn-attr'; const O_QC_NAMESERVERS = 'qc-nameservers'; const O_QC_CNAME = 'qc-cname'; // -------------------------------------------------- ## // -------------- OptimaX ----------------- ## // -------------------------------------------------- ## const O_OPTIMAX = 'optimax'; const NETWORK_O_USE_PRIMARY = 'use_primary_settings'; const DEBUG_TMP_DISABLE = 'debug-disable_tmp'; /*** Other consts ***/ const O_GUIDE = 'litespeed-guide'; // Array of each guidance tag as key, step as val //xx todo: may need to remove // Server variables const ENV_CRAWLER_USLEEP = 'CRAWLER_USLEEP'; const ENV_CRAWLER_LOAD_LIMIT = 'CRAWLER_LOAD_LIMIT'; const ENV_CRAWLER_LOAD_LIMIT_ENFORCE = 'CRAWLER_LOAD_LIMIT_ENFORCE'; const CRWL_COOKIE_NAME = 'name'; const CRWL_COOKIE_VALS = 'vals'; const CDN_MAPPING_URL = 'url'; const CDN_MAPPING_INC_IMG = 'inc_img'; const CDN_MAPPING_INC_CSS = 'inc_css'; const CDN_MAPPING_INC_JS = 'inc_js'; const CDN_MAPPING_FILETYPE = 'filetype'; const VAL_OFF = 0; const VAL_ON = 1; const VAL_ON2 = 2; /* This is for API hook usage */ const IMG_OPTM_BM_ORI = 1; // @Deprecated since v7.0 const IMG_OPTM_BM_WEBP = 2; // @Deprecated since v7.0 const IMG_OPTM_BM_LOSSLESS = 4; // @Deprecated since v7.0 const IMG_OPTM_BM_EXIF = 8; // @Deprecated since v7.0 const IMG_OPTM_BM_AVIF = 16; // @Deprecated since v7.0 /** * Site related options (Will not overwrite other sites' config). * * @var string[] */ protected static $single_site_options = [ self::O_CRAWLER, self::O_CRAWLER_SITEMAP, self::O_CDN, self::O_CDN_ORI, self::O_CDN_ORI_DIR, self::O_CDN_EXC, self::O_CDN_CLOUDFLARE, self::O_CDN_CLOUDFLARE_EMAIL, self::O_CDN_CLOUDFLARE_KEY, self::O_CDN_CLOUDFLARE_NAME, self::O_CDN_CLOUDFLARE_ZONE, self::O_CDN_CLOUDFLARE_CLEAR, self::O_CDN_MAPPING, self::O_CDN_ATTR, self::O_QC_NAMESERVERS, self::O_QC_CNAME, ]; /** * Default options for single-site installs. * * @var array<string,mixed> */ protected static $_default_options = [ self::_VER => '', self::HASH => '', self::O_API_KEY => '', self::O_AUTO_UPGRADE => false, self::O_SERVER_IP => '', self::O_GUEST => false, self::O_GUEST_OPTM => false, self::O_NEWS => false, // Cache self::O_CACHE => false, self::O_CACHE_PRIV => false, self::O_CACHE_COMMENTER => false, self::O_CACHE_REST => false, self::O_CACHE_PAGE_LOGIN => false, self::O_CACHE_MOBILE => false, self::O_CACHE_MOBILE_RULES => [], self::O_CACHE_BROWSER => false, self::O_CACHE_EXC_USERAGENTS => [], self::O_CACHE_EXC_COOKIES => [], self::O_CACHE_EXC_QS => [], self::O_CACHE_EXC_CAT => [], self::O_CACHE_EXC_TAG => [], self::O_CACHE_FORCE_URI => [], self::O_CACHE_FORCE_PUB_URI => [], self::O_CACHE_PRIV_URI => [], self::O_CACHE_EXC => [], self::O_CACHE_EXC_ROLES => [], self::O_CACHE_DROP_QS => [], self::O_CACHE_TTL_PUB => 0, self::O_CACHE_TTL_PRIV => 0, self::O_CACHE_TTL_FRONTPAGE => 0, self::O_CACHE_TTL_FEED => 0, self::O_CACHE_TTL_REST => 0, self::O_CACHE_TTL_BROWSER => 0, self::O_CACHE_TTL_STATUS => [], self::O_CACHE_LOGIN_COOKIE => '', self::O_CACHE_AJAX_TTL => [], self::O_CACHE_VARY_COOKIES => [], self::O_CACHE_VARY_GROUP => [], // Purge self::O_PURGE_ON_UPGRADE => false, self::O_PURGE_STALE => false, self::O_PURGE_POST_ALL => false, self::O_PURGE_POST_FRONTPAGE => false, self::O_PURGE_POST_HOMEPAGE => false, self::O_PURGE_POST_PAGES => false, self::O_PURGE_POST_PAGES_WITH_RECENT_POSTS => false, self::O_PURGE_POST_AUTHOR => false, self::O_PURGE_POST_YEAR => false, self::O_PURGE_POST_MONTH => false, self::O_PURGE_POST_DATE => false, self::O_PURGE_POST_TERM => false, self::O_PURGE_POST_POSTTYPE => false, self::O_PURGE_TIMED_URLS => [], self::O_PURGE_TIMED_URLS_TIME => '', self::O_PURGE_HOOK_ALL => [], // ESI self::O_ESI => false, self::O_ESI_CACHE_ADMBAR => false, self::O_ESI_CACHE_COMMFORM => false, self::O_ESI_NONCE => [], // Util self::O_UTIL_INSTANT_CLICK => false, self::O_UTIL_NO_HTTPS_VARY => false, // Debug self::O_DEBUG_DISABLE_ALL => false, self::O_DEBUG => false, self::O_DEBUG_IPS => [], self::O_DEBUG_LEVEL => false, self::O_DEBUG_FILESIZE => 0, self::O_DEBUG_COLLAPSE_QS => false, self::O_DEBUG_INC => [], self::O_DEBUG_EXC => [], self::O_DEBUG_EXC_STRINGS => [], // DB Optm self::O_DB_OPTM_REVISIONS_MAX => 0, self::O_DB_OPTM_REVISIONS_AGE => 0, // HTML Optm self::O_OPTM_CSS_MIN => false, self::O_OPTM_CSS_COMB => false, self::O_OPTM_CSS_COMB_EXT_INL => false, self::O_OPTM_UCSS => false, self::O_OPTM_UCSS_INLINE => false, self::O_OPTM_UCSS_SELECTOR_WHITELIST => [], self::O_OPTM_UCSS_FILE_EXC_INLINE => [], self::O_OPTM_UCSS_EXC => [], self::O_OPTM_CSS_EXC => [], self::O_OPTM_JS_MIN => false, self::O_OPTM_JS_COMB => false, self::O_OPTM_JS_COMB_EXT_INL => false, self::O_OPTM_JS_DELAY_INC => [], self::O_OPTM_JS_EXC => [], self::O_OPTM_HTML_MIN => false, self::O_OPTM_HTML_LAZY => [], self::O_OPTM_HTML_SKIP_COMMENTS => [], self::O_OPTM_QS_RM => false, self::O_OPTM_GGFONTS_RM => false, self::O_OPTM_CSS_ASYNC => false, self::O_OPTM_CCSS_PER_URL => false, self::O_OPTM_CCSS_SEP_POSTTYPE => [], self::O_OPTM_CCSS_SEP_URI => [], self::O_OPTM_CCSS_SELECTOR_WHITELIST => [], self::O_OPTM_CSS_ASYNC_INLINE => false, self::O_OPTM_CSS_FONT_DISPLAY => false, self::O_OPTM_JS_DEFER => false, self::O_OPTM_EMOJI_RM => false, self::O_OPTM_NOSCRIPT_RM => false, self::O_OPTM_GGFONTS_ASYNC => false, self::O_OPTM_EXC_ROLES => [], self::O_OPTM_CCSS_CON => '', self::O_OPTM_JS_DEFER_EXC => [], self::O_OPTM_GM_JS_EXC => [], self::O_OPTM_DNS_PREFETCH => [], self::O_OPTM_DNS_PREFETCH_CTRL => false, self::O_OPTM_DNS_PRECONNECT => [], self::O_OPTM_EXC => [], self::O_OPTM_GUEST_ONLY => false, // Object self::O_OBJECT => false, self::O_OBJECT_KIND => false, self::O_OBJECT_HOST => '', self::O_OBJECT_PORT => 0, self::O_OBJECT_LIFE => 0, self::O_OBJECT_PERSISTENT => false, self::O_OBJECT_ADMIN => false, self::O_OBJECT_TRANSIENTS => false, self::O_OBJECT_DB_ID => 0, self::O_OBJECT_USER => '', self::O_OBJECT_PSWD => '', self::O_OBJECT_GLOBAL_GROUPS => [], self::O_OBJECT_NON_PERSISTENT_GROUPS => [], // Discuss self::O_DISCUSS_AVATAR_CACHE => false, self::O_DISCUSS_AVATAR_CRON => false, self::O_DISCUSS_AVATAR_CACHE_TTL => 0, self::O_OPTM_LOCALIZE => false, self::O_OPTM_LOCALIZE_DOMAINS => [], // Media self::O_MEDIA_LAZY => false, self::O_MEDIA_LAZY_PLACEHOLDER => '', self::O_MEDIA_PLACEHOLDER_RESP => false, self::O_MEDIA_PLACEHOLDER_RESP_COLOR => '', self::O_MEDIA_PLACEHOLDER_RESP_SVG => '', self::O_MEDIA_LQIP => false, self::O_MEDIA_LQIP_QUAL => 0, self::O_MEDIA_LQIP_MIN_W => 0, self::O_MEDIA_LQIP_MIN_H => 0, self::O_MEDIA_PLACEHOLDER_RESP_ASYNC => false, self::O_MEDIA_IFRAME_LAZY => false, self::O_MEDIA_ADD_MISSING_SIZES => false, self::O_MEDIA_LAZY_EXC => [], self::O_MEDIA_LAZY_CLS_EXC => [], self::O_MEDIA_LAZY_PARENT_CLS_EXC => [], self::O_MEDIA_IFRAME_LAZY_CLS_EXC => [], self::O_MEDIA_IFRAME_LAZY_PARENT_CLS_EXC => [], self::O_MEDIA_LAZY_URI_EXC => [], self::O_MEDIA_LQIP_EXC => [], self::O_MEDIA_VPI => false, self::O_MEDIA_VPI_CRON => false, self::O_MEDIA_AUTO_RESCALE_ORI => false, // Image Optm self::O_IMG_OPTM_AUTO => false, self::O_IMG_OPTM_ORI => false, self::O_IMG_OPTM_RM_BKUP => false, self::O_IMG_OPTM_WEBP => false, self::O_IMG_OPTM_LOSSLESS => false, self::O_IMG_OPTM_SIZES_SKIPPED => [], self::O_IMG_OPTM_EXIF => false, self::O_IMG_OPTM_WEBP_ATTR => [], self::O_IMG_OPTM_WEBP_REPLACE_SRCSET => false, self::O_IMG_OPTM_JPG_QUALITY => 0, // Crawler self::O_CRAWLER => false, self::O_CRAWLER_CRAWL_INTERVAL => 0, self::O_CRAWLER_LOAD_LIMIT => 0, self::O_CRAWLER_SITEMAP => '', self::O_CRAWLER_ROLES => [], self::O_CRAWLER_COOKIES => [], // Misc self::O_MISC_HEARTBEAT_FRONT => false, self::O_MISC_HEARTBEAT_FRONT_TTL => 0, self::O_MISC_HEARTBEAT_BACK => false, self::O_MISC_HEARTBEAT_BACK_TTL => 0, self::O_MISC_HEARTBEAT_EDITOR => false, self::O_MISC_HEARTBEAT_EDITOR_TTL => 0, // CDN self::O_CDN => false, self::O_CDN_ORI => [], self::O_CDN_ORI_DIR => [], self::O_CDN_EXC => [], self::O_CDN_QUIC => false, self::O_CDN_CLOUDFLARE => false, self::O_CDN_CLOUDFLARE_EMAIL => '', self::O_CDN_CLOUDFLARE_KEY => '', self::O_CDN_CLOUDFLARE_NAME => '', self::O_CDN_CLOUDFLARE_ZONE => '', self::O_CDN_CLOUDFLARE_CLEAR => false, self::O_CDN_MAPPING => [], self::O_CDN_ATTR => [], self::O_QC_NAMESERVERS => '', self::O_QC_CNAME => '', self::DEBUG_TMP_DISABLE => 0, ]; /** * Default options for multisite (site-level options stored network-wide). * * @var array<string,mixed> */ protected static $_default_site_options = [ self::_VER => '', self::O_CACHE => false, self::NETWORK_O_USE_PRIMARY => false, self::O_AUTO_UPGRADE => false, self::O_GUEST => false, self::O_CACHE_BROWSER => false, self::O_CACHE_MOBILE => false, self::O_CACHE_MOBILE_RULES => [], self::O_CACHE_DROP_QS => [], self::O_CACHE_LOGIN_COOKIE => '', self::O_CACHE_VARY_COOKIES => [], self::O_CACHE_EXC_COOKIES => [], self::O_CACHE_EXC_USERAGENTS => [], self::O_CACHE_TTL_BROWSER => 0, self::O_PURGE_ON_UPGRADE => false, self::O_OBJECT => false, self::O_OBJECT_KIND => false, self::O_OBJECT_HOST => '', self::O_OBJECT_PORT => 0, self::O_OBJECT_LIFE => 0, self::O_OBJECT_PERSISTENT => false, self::O_OBJECT_ADMIN => false, self::O_OBJECT_TRANSIENTS => false, self::O_OBJECT_DB_ID => 0, self::O_OBJECT_USER => '', self::O_OBJECT_PSWD => '', self::O_OBJECT_GLOBAL_GROUPS => [], self::O_OBJECT_NON_PERSISTENT_GROUPS => [], // Debug self::O_DEBUG_DISABLE_ALL => false, self::O_DEBUG => false, self::O_DEBUG_IPS => [], self::O_DEBUG_LEVEL => false, self::O_DEBUG_FILESIZE => 0, self::O_DEBUG_COLLAPSE_QS => false, self::O_DEBUG_INC => [], self::O_DEBUG_EXC => [], self::O_DEBUG_EXC_STRINGS => [], self::O_IMG_OPTM_WEBP => false, ]; /** * Multi-switch options: option ID => max state (int). * NOTE: all the val of following items will be int while not bool * * @var array<string,int> */ protected static $_multi_switch_list = [ self::O_DEBUG => 2, self::O_OPTM_JS_DEFER => 2, self::O_IMG_OPTM_WEBP => 2, ]; /** * Correct the option type. * * TODO: add similar network func * * @since 3.0.3 * * @param mixed $val Incoming value. * @param string $id Option ID. * @param bool $is_site_conf Whether using site-level defaults. * @return mixed */ protected function type_casting( $val, $id, $is_site_conf = false ) { $default_v = ! $is_site_conf ? self::$_default_options[ $id ] : self::$_default_site_options[ $id ]; if ( is_bool( $default_v ) ) { if ( 'true' === $val ) { $val = true; } if ( 'false' === $val ) { $val = false; } $max = $this->_conf_multi_switch( $id ); if ( $max ) { $val = (int) $val; $val %= $max + 1; } else { $val = (bool) $val; } } elseif ( is_array( $default_v ) ) { // from textarea input if ( ! is_array( $val ) ) { $val = Utility::sanitize_lines( $val, $this->_conf_filter( $id ) ); } } elseif ( ! is_string( $default_v ) ) { $val = (int) $val; } else { // Check if the string has a limit set $val = $this->_conf_string_val( $id, $val ); } return $val; } /** * Load default network settings from data.ini * * @since 3.0 * @return array<string,mixed> */ public function load_default_site_vals() { // Load network_default.json if ( file_exists( LSCWP_DIR . 'data/const.network_default.json' ) ) { $default_ini_cfg = json_decode( File::read( LSCWP_DIR . 'data/const.network_default.json' ), true ); foreach ( self::$_default_site_options as $k => $v ) { if ( ! array_key_exists( $k, $default_ini_cfg ) ) { continue; } // Parse value in ini file $ini_v = $this->type_casting( $default_ini_cfg[ $k ], $k, true ); if ( $ini_v === $v ) { continue; } self::$_default_site_options[ $k ] = $ini_v; } } self::$_default_site_options[ self::_VER ] = Core::VER; return self::$_default_site_options; } /** * Load default values from default.json * * @since 3.0 * @access public * @return array<string,mixed> */ public function load_default_vals() { // Load default.json if ( file_exists( LSCWP_DIR . 'data/const.default.json' ) ) { $default_ini_cfg = json_decode( File::read( LSCWP_DIR . 'data/const.default.json' ), true ); foreach ( self::$_default_options as $k => $v ) { if ( ! array_key_exists( $k, $default_ini_cfg ) ) { continue; } // Parse value in ini file $ini_v = $this->type_casting( $default_ini_cfg[ $k ], $k ); // NOTE: Multiple lines value must be stored as array /** * Special handler for CDN_mapping * * Format in .ini: * [cdn-mapping] * url[0] = 'https://example.com/' * inc_js[0] = true * filetype[0] = '.css * .js * .jpg' * * format out: * [0] = [ 'url' => 'https://example.com', 'inc_js' => true, 'filetype' => [ '.css', '.js', '.jpg' ] ] */ if ( self::O_CDN_MAPPING === $k ) { $mapping_fields = [ self::CDN_MAPPING_URL, self::CDN_MAPPING_INC_IMG, self::CDN_MAPPING_INC_CSS, self::CDN_MAPPING_INC_JS, self::CDN_MAPPING_FILETYPE, // Array ]; $ini_v2 = []; foreach ( $ini_v[ self::CDN_MAPPING_URL ] as $k2 => $v2 ) { // $k2 is numeric $this_row = []; foreach ( $mapping_fields as $v3 ) { $this_v = ! empty( $ini_v[ $v3 ][ $k2 ] ) ? $ini_v[ $v3 ][ $k2 ] : false; if ( self::CDN_MAPPING_URL === $v3 ) { if ( empty( $this_v ) ) { $this_v = ''; } } if ( self::CDN_MAPPING_FILETYPE === $v3 ) { $this_v = $this_v ? Utility::sanitize_lines( $this_v ) : []; // Note: Since v3.0 its already an array } $this_row[ $v3 ] = $this_v; } $ini_v2[ $k2 ] = $this_row; } $ini_v = $ini_v2; } if ( $ini_v === $v ) { continue; } self::$_default_options[ $k ] = $ini_v; } } // Load internal default vals // Setting the default bool to int is also to avoid type casting override it back to bool self::$_default_options[ self::O_CACHE ] = is_multisite() ? self::VAL_ON2 : self::VAL_ON; // For multi site, default is 2 (Use Network Admin Settings). For single site, default is 1 (Enabled). // Load default vals containing variables if ( ! self::$_default_options[ self::O_CDN_ORI_DIR ] ) { self::$_default_options[ self::O_CDN_ORI_DIR ] = LSCWP_CONTENT_FOLDER . "\nwp-includes"; self::$_default_options[ self::O_CDN_ORI_DIR ] = explode( "\n", self::$_default_options[ self::O_CDN_ORI_DIR ] ); self::$_default_options[ self::O_CDN_ORI_DIR ] = array_map( 'trim', self::$_default_options[ self::O_CDN_ORI_DIR ] ); } // Set security key if not initialized yet if ( ! self::$_default_options[ self::HASH ] ) { self::$_default_options[ self::HASH ] = Str::rrand( 32 ); } self::$_default_options[ self::_VER ] = Core::VER; return self::$_default_options; } /** * Format the string value. * * @since 3.0 * * @param string $id Option ID. * @param mixed $val Value. * @return string */ protected function _conf_string_val( $id, $val ) { return (string) $val; } /** * If the switch setting is a triple value or not. * * @since 3.0 * * @param string $id Option ID. * @return int|false */ protected function _conf_multi_switch( $id ) { if ( ! empty( self::$_multi_switch_list[ $id ] ) ) { return self::$_multi_switch_list[ $id ]; } if ( self::O_CACHE === $id && is_multisite() ) { return self::VAL_ON2; } return false; } /** * Append a new multi switch max limit for the bool option. * * @since 3.0 * * @param string $id Option ID. * @param int $v Max state. * @return void */ public static function set_multi_switch( $id, $v ) { self::$_multi_switch_list[ $id ] = $v; } /** * Generate const name based on $id. * * @since 3.0 * * @param string $id Option ID. * @return string */ public static function conf_const( $id ) { return 'LITESPEED_CONF__' . strtoupper( str_replace( '-', '__', $id ) ); } /** * Filter to be used when saving setting. * * @since 3.0 * * @param string $id Option ID. * @return string|false */ protected function _conf_filter( $id ) { $filters = [ self::O_MEDIA_LAZY_EXC => 'uri', self::O_DEBUG_INC => 'relative', self::O_DEBUG_EXC => 'relative', self::O_MEDIA_LAZY_URI_EXC => 'relative', self::O_CACHE_PRIV_URI => 'relative', self::O_PURGE_TIMED_URLS => 'relative', self::O_CACHE_FORCE_URI => 'relative', self::O_CACHE_FORCE_PUB_URI => 'relative', self::O_CACHE_EXC => 'relative', // self::O_OPTM_CSS_EXC => 'uri', // Need to comment out for inline & external CSS // self::O_OPTM_JS_EXC => 'uri', self::O_OPTM_EXC => 'relative', self::O_OPTM_CCSS_SEP_URI => 'uri', // self::O_OPTM_JS_DEFER_EXC => 'uri', self::O_OPTM_DNS_PREFETCH => 'domain', self::O_CDN_ORI => 'noprotocol,trailingslash', // `Original URLs` // self::O_OPTM_LOCALIZE_DOMAINS => 'noprotocol', // `Localize Resources` // self:: => '', // self:: => '', ]; if ( ! empty( $filters[ $id ] ) ) { return $filters[ $id ]; } return false; } /** * If the setting changes worth a purge or not. * * @since 3.0 * * @param string $id Option ID. * @return bool */ protected function _conf_purge( $id ) { $check_ids = [ self::O_MEDIA_LAZY_URI_EXC, self::O_OPTM_EXC, self::O_CACHE_PRIV_URI, self::O_PURGE_TIMED_URLS, self::O_CACHE_FORCE_URI, self::O_CACHE_FORCE_PUB_URI, self::O_CACHE_EXC, ]; return in_array( $id, $check_ids, true ); } /** * If the setting changes worth a purge ALL or not. * * @since 3.0 * * @param string $id Option ID. * @return bool */ protected function _conf_purge_all( $id ) { $check_ids = [ self::O_CACHE, self::O_ESI, self::O_DEBUG_DISABLE_ALL, self::NETWORK_O_USE_PRIMARY ]; return in_array( $id, $check_ids, true ); } /** * If the setting is a password or not. * * @since 3.0 * * @param string $id Option ID. * @return bool */ protected function _conf_pswd( $id ) { $check_ids = [ self::O_CDN_CLOUDFLARE_KEY, self::O_OBJECT_PSWD ]; return in_array( $id, $check_ids, true ); } /** * If the setting is cron related or not. * * @since 3.0 * * @param string $id Option ID. * @return bool */ protected function _conf_cron( $id ) { $check_ids = [ self::O_OPTM_CSS_ASYNC, self::O_MEDIA_PLACEHOLDER_RESP_ASYNC, self::O_DISCUSS_AVATAR_CRON, self::O_IMG_OPTM_AUTO, self::O_CRAWLER ]; return in_array( $id, $check_ids, true ); } /** * If the setting changes worth a purge, return the tag. * * @since 3.0 * * @param string $id Option ID. * @return string|false */ protected function _conf_purge_tag( $id ) { $check_ids = [ self::O_CACHE_PAGE_LOGIN => Tag::TYPE_LOGIN, ]; if ( ! empty( $check_ids[ $id ] ) ) { return $check_ids[ $id ]; } return false; } /** * Generate server vars. * * @since 2.4.1 * * @return array<string,mixed> Map of constant name => value|null. */ public function server_vars() { $consts = [ 'WP_SITEURL', 'WP_HOME', 'WP_CONTENT_DIR', 'SHORTINIT', 'LSCWP_CONTENT_DIR', 'LSCWP_CONTENT_FOLDER', 'LSCWP_DIR', 'LITESPEED_TIME_OFFSET', 'LITESPEED_SERVER_TYPE', 'LITESPEED_CLI', 'LITESPEED_ALLOWED', 'LITESPEED_ON', 'LSWCP_TAG_PREFIX', 'COOKIEHASH', ]; $server_vars = []; foreach ( $consts as $v ) { $server_vars[ $v ] = defined( $v ) ? constant( $v ) : null; } return $server_vars; } } src/error.cls.php 0000777 00000016552 15251157102 0007774 0 ustar 00 <?php /** * The error class. * * @package LiteSpeed * @since 3.0 */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Error * * Handles error message translation and throwing for LiteSpeed Cache. * * @since 3.0 */ class Error { /** * Error code mappings to numeric values. * * @since 3.0 * @var array */ private static $code_set = [ 'HTA_LOGIN_COOKIE_INVALID' => 4300, // .htaccess did not find. 'HTA_DNF' => 4500, // .htaccess did not find. 'HTA_BK' => 9010, // backup 'HTA_R' => 9041, // read htaccess 'HTA_W' => 9042, // write 'HTA_GET' => 9030, // failed to get ]; /** * Throw an error with message * * Throws an exception with the translated error message. * * @since 3.0 * @access public * @param string $code Error code. * @param mixed $args Optional arguments for message formatting. * @throws \Exception Always throws an exception with the error message. */ public static function t( $code, $args = null ) { throw new \Exception( wp_kses_post( self::msg( $code, $args ) ) ); } /** * Translate an error to description * * Converts error codes to human-readable messages. * * @since 3.0 * @access public * @param string $code Error code. * @param mixed $args Optional arguments for message formatting. * @return string Translated error message. */ public static function msg( $code, $args = null ) { switch ( $code ) { case 'qc_setup_required': $msg = sprintf( __( 'You will need to finish %s setup to use the online services.', 'litespeed-cache' ), '<strong>QUIC.cloud</strong>' ) . Doc::learn_more( admin_url( 'admin.php?page=litespeed-general' ), __( 'Click here to set.', 'litespeed-cache' ), true, false, true ); break; case 'out_of_daily_quota': $msg = __( 'You have used all of your daily quota for today.', 'litespeed-cache' ); $msg .= ' ' . Doc::learn_more( 'https://docs.quic.cloud/billing/services/#daily-limits-on-free-quota-usage', __( 'Learn more or purchase additional quota.', 'litespeed-cache' ), false, false, true ); break; case 'out_of_quota': $msg = __( 'You have used all of your quota left for current service this month.', 'litespeed-cache' ); $msg .= ' ' . Doc::learn_more( 'https://docs.quic.cloud/billing/services/#daily-limits-on-free-quota-usage', __( 'Learn more or purchase additional quota.', 'litespeed-cache' ), false, false, true ); break; case 'too_many_requested': $msg = __( 'You have too many requested images, please try again in a few minutes.', 'litespeed-cache' ); break; case 'too_many_notified': $msg = __( 'You have images waiting to be pulled. Please wait for the automatic pull to complete, or pull them down manually now.', 'litespeed-cache' ); break; case 'empty_list': $msg = __( 'The image list is empty.', 'litespeed-cache' ); break; case 'lack_of_param': $msg = __( 'Not enough parameters. Please check if the QUIC.cloud connection is set correctly', 'litespeed-cache' ); break; case 'unfinished_queue': $msg = __( 'There is proceeding queue not pulled yet.', 'litespeed-cache' ); break; case 0 === strpos( $code, 'unfinished_queue ' ): $msg = sprintf( __( 'There is proceeding queue not pulled yet. Queue info: %s.', 'litespeed-cache' ), '<code>' . substr( $code, strlen( 'unfinished_queue ' ) ) . '</code>' ); break; case 'err_alias': $msg = __( 'The site is not a valid alias on QUIC.cloud.', 'litespeed-cache' ); break; case 'site_not_registered': $msg = __( 'The site is not registered on QUIC.cloud.', 'litespeed-cache' ); break; case 'err_key': $msg = __( 'The QUIC.cloud connection is not correct. Please try to sync your QUIC.cloud connection again.', 'litespeed-cache' ); break; case 'heavy_load': $msg = __( 'The current server is under heavy load.', 'litespeed-cache' ); break; case 'redetect_node': $msg = __( 'Online node needs to be redetected.', 'litespeed-cache' ); break; case 'err_overdraw': $msg = __( 'Credits are not enough to proceed the current request.', 'litespeed-cache' ); break; case 'W': $msg = __( '%s file not writable.', 'litespeed-cache' ); break; case 'HTA_DNF': if ( ! is_array( $args ) ) { $args = [ '<code>' . $args . '</code>' ]; } $args[] = '.htaccess'; $msg = __( 'Could not find %1$s in %2$s.', 'litespeed-cache' ); break; case 'HTA_LOGIN_COOKIE_INVALID': $msg = sprintf( __( 'Invalid login cookie. Please check the %s file.', 'litespeed-cache' ), '.htaccess' ); break; case 'HTA_BK': $msg = sprintf( __( 'Failed to back up %s file, aborted changes.', 'litespeed-cache' ), '.htaccess' ); break; case 'HTA_R': $msg = sprintf( __( '%s file not readable.', 'litespeed-cache' ), '.htaccess' ); break; case 'HTA_W': $msg = sprintf( __( '%s file not writable.', 'litespeed-cache' ), '.htaccess' ); break; case 'HTA_GET': $msg = sprintf( __( 'Failed to get %s file contents.', 'litespeed-cache' ), '.htaccess' ); break; case 'failed_tb_creation': $msg = __( 'Failed to create table %1$s! SQL: %2$s.', 'litespeed-cache' ); break; case 'crawler_disabled': $msg = __( 'Crawler disabled by the server admin.', 'litespeed-cache' ); break; case 'try_later': // QC error code $msg = __( 'Previous request too recent. Please try again later.', 'litespeed-cache' ); break; case 0 === strpos( $code, 'try_later ' ): $msg = sprintf( __( 'Previous request too recent. Please try again after %s.', 'litespeed-cache' ), '<code>' . Utility::readable_time( substr( $code, strlen( 'try_later ' ) ), 3600, true ) . '</code>' ); break; case 'waiting_for_approval': $msg = __( 'Your application is waiting for approval.', 'litespeed-cache' ); break; case 'callback_fail_hash': $msg = __( 'The callback validation to your domain failed due to hash mismatch.', 'litespeed-cache' ); break; case 'callback_fail': $msg = __( 'The callback validation to your domain failed. Please make sure there is no firewall blocking our servers.', 'litespeed-cache' ); break; case substr( $code, 0, 14 ) === 'callback_fail ': $msg = __( 'The callback validation to your domain failed. Please make sure there is no firewall blocking our servers. Response code: ', 'litespeed-cache' ) . substr( $code, 14 ); break; case 'forbidden': $msg = __( 'Your domain has been forbidden from using our services due to a previous policy violation.', 'litespeed-cache' ); break; case 'err_dns_active': $msg = __( 'You cannot remove this DNS zone, because it is still in use. Please update the domain\'s nameservers, then try to delete this zone again, otherwise your site will become inaccessible.', 'litespeed-cache' ); break; default: $msg = __( 'Unknown error', 'litespeed-cache' ) . ': ' . $code; break; } if ( null !== $args ) { $msg = is_array( $args ) ? vsprintf( $msg, $args ) : sprintf( $msg, $args ); } if ( isset( self::$code_set[ $code ] ) ) { $msg = 'ERROR ' . self::$code_set[ $code ] . ': ' . $msg; } return $msg; } } src/media.cls.php 0000777 00000120420 15251157102 0007710 0 ustar 00 <?php /** * The class to operate media data. * * @package LiteSpeed * @since 1.4 */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Media * * Handles media-related optimizations like lazy loading, next-gen image replacement, and admin UI. */ class Media extends Root { const LOG_TAG = '📺'; const LIB_FILE_IMG_LAZYLOAD = 'assets/js/lazyload.min.js'; /** * Current page buffer content. * * @var string */ private $content; /** * WordPress uploads directory info. * * @var array */ private $_wp_upload_dir; /** * List of VPI (viewport images) to preload in <head>. * * @var array */ private $_vpi_preload_list = []; /** * The user-level next-gen format supported (''|webp|avif). * * @var string */ private $_format = ''; /** * The system-level chosen next-gen format (webp|avif). * * @var string */ private $_sys_format = ''; /** * Init. * * @since 1.4 */ public function __construct() { self::debug2( 'init' ); $this->_wp_upload_dir = wp_upload_dir(); if ( $this->conf( Base::O_IMG_OPTM_WEBP ) ) { $this->_sys_format = 'webp'; $this->_format = 'webp'; if ( 2 === $this->conf( Base::O_IMG_OPTM_WEBP ) ) { $this->_sys_format = 'avif'; $this->_format = 'avif'; } if ( ! $this->_browser_support_next_gen() ) { $this->_format = ''; } $this->_format = apply_filters( 'litespeed_next_gen_format', $this->_format ); } } /** * Hooks after user init. * * @since 7.2 * @since 7.4 Add media replace original with scaled. * @return void */ public function after_user_init() { // Hook to attachment delete action (PR#844, Issue#841) for AJAX del compatibility. add_action( 'delete_attachment', [ $this, 'delete_attachment' ], 11, 2 ); // For big images, allow to replace original with scaled image. if ( $this->conf( Base::O_MEDIA_AUTO_RESCALE_ORI ) ) { // Added priority 9 to happen before other functions added. add_filter( 'wp_update_attachment_metadata', [ $this, 'rescale_ori' ], 9, 2 ); } } /** * Init optm features. * * @since 3.0 * @access public * @return void */ public function init() { if ( is_admin() ) { return; } // Due to ajax call doesn't send correct accept header, have to limit webp to HTML only. if ( $this->webp_support() ) { // Hook to srcset. if ( function_exists( 'wp_calculate_image_srcset' ) ) { add_filter( 'wp_calculate_image_srcset', [ $this, 'webp_srcset' ], 988 ); } // Hook to mime icon // add_filter( 'wp_get_attachment_image_src', [ $this, 'webp_attach_img_src' ], 988 );// todo: need to check why not // add_filter( 'wp_get_attachment_url', [ $this, 'webp_url' ], 988 ); // disabled to avoid wp-admin display } if ( $this->conf( Base::O_MEDIA_LAZY ) && ! $this->cls( 'Metabox' )->setting( 'litespeed_no_image_lazy' ) ) { self::debug( 'Suppress default WP lazyload' ); add_filter( 'wp_lazy_loading_enabled', '__return_false' ); } /** * Replace gravatar. * * @since 3.0 */ $this->cls( 'Avatar' ); add_filter( 'litespeed_buffer_finalize', [ $this, 'finalize' ], 4 ); add_filter( 'litespeed_optm_html_head', [ $this, 'finalize_head' ] ); } /** * Handle attachment create (rescale original). * * @param array $metadata Current meta array. * @param int $attachment_id Attachment ID. * @return array Modified metadata. * @since 7.4 */ public function rescale_ori( $metadata, $attachment_id ) { // Test if create and image was resized. if ( $metadata && isset( $metadata['original_image'], $metadata['file'] ) && false !== strpos( $metadata['file'], '-scaled' ) ) { // Get rescaled file name. $path_exploded = explode( '/', strrev( $metadata['file'] ), 2 ); $rescaled_file_name = strrev( $path_exploded[0] ); // Create paths for images: resized and original. $base_path = $this->_wp_upload_dir['basedir'] . $this->_wp_upload_dir['subdir'] . '/'; $rescaled_path = $base_path . $rescaled_file_name; $new_path = $base_path . $metadata['original_image']; // Change array file key. $metadata['file'] = $this->_wp_upload_dir['subdir'] . '/' . $metadata['original_image']; if ( 0 === strpos( $metadata['file'], '/' ) ) { $metadata['file'] = substr( $metadata['file'], 1 ); } // Delete array "original_image" key. unset( $metadata['original_image'] ); if ( file_exists( $rescaled_path ) && file_exists( $new_path ) ) { // Move rescaled to original using WP_Filesystem. global $wp_filesystem; if ( ! $wp_filesystem ) { require_once ABSPATH . '/wp-admin/includes/file.php'; \WP_Filesystem(); } if ( $wp_filesystem ) { $wp_filesystem->move( $rescaled_path, $new_path, true ); } // Update meta "_wp_attached_file". update_post_meta( $attachment_id, '_wp_attached_file', $metadata['file'] ); } } return $metadata; } /** * Add featured image and VPI preloads to head. * * @param string $content Current head HTML. * @return string Modified head HTML. */ public function finalize_head( $content ) { // <link rel="preload" as="image" href="xx"> if ( $this->_vpi_preload_list ) { foreach ( $this->_vpi_preload_list as $v ) { $content .= '<link rel="preload" as="image" href="' . esc_url( Str::trim_quotes( $v ) ) . '">'; } } return $content; } /** * Adjust WP default JPG quality. * * @since 3.0 * @access public * * @param int $quality Current quality. * @return int Adjusted quality. */ public function adjust_jpg_quality( $quality ) { $v = $this->conf( Base::O_IMG_OPTM_JPG_QUALITY ); if ( $v ) { return $v; } return $quality; } /** * Register admin menu. * * @since 1.6.3 * @access public * @return void */ public function after_admin_init() { /** * JPG quality control. * * @since 3.0 */ add_filter( 'jpeg_quality', [ $this, 'adjust_jpg_quality' ] ); add_filter( 'manage_media_columns', [ $this, 'media_row_title' ] ); add_filter( 'manage_media_custom_column', [ $this, 'media_row_actions' ], 10, 2 ); add_action( 'litespeed_media_row', [ $this, 'media_row_con' ] ); } /** * Media delete action hook. * * @since 2.4.3 * @access public * * @param int $post_id Post ID. * @return void */ public static function delete_attachment( $post_id ) { self::debug( 'delete_attachment [pid] ' . $post_id ); Img_Optm::cls()->reset_row( $post_id ); } /** * Return media file info if exists. * * This is for remote attachment plugins. * * @since 2.9.8 * @access public * * @param string $short_file_path Relative file path under uploads. * @param int $post_id Post ID. * @return array|false Array( url, md5, size ) or false. */ public function info( $short_file_path, $post_id ) { $short_file_path = wp_normalize_path( $short_file_path ); $basedir = $this->_wp_upload_dir['basedir'] . '/'; if ( 0 === strpos( $short_file_path, $basedir ) ) { $short_file_path = substr( $short_file_path, strlen( $basedir ) ); } $real_file = $basedir . $short_file_path; if ( file_exists( $real_file ) ) { return [ 'url' => $this->_wp_upload_dir['baseurl'] . '/' . $short_file_path, 'md5' => md5_file( $real_file ), 'size' => filesize( $real_file ), ]; } /** * WP Stateless compatibility #143 https://github.com/litespeedtech/lscache_wp/issues/143 * * @since 2.9.8 * Should return array( 'url', 'md5', 'size' ). */ $info = apply_filters( 'litespeed_media_info', [], $short_file_path, $post_id ); if ( ! empty( $info['url'] ) && ! empty( $info['md5'] ) && ! empty( $info['size'] ) ) { return $info; } return false; } /** * Delete media file. * * @since 2.9.8 * @access public * * @param string $short_file_path Relative file path under uploads. * @param int $post_id Post ID. * @return void */ public function del( $short_file_path, $post_id ) { $real_file = $this->_wp_upload_dir['basedir'] . '/' . $short_file_path; if ( file_exists( $real_file ) ) { wp_delete_file( $real_file ); self::debug( 'deleted ' . $real_file ); } do_action( 'litespeed_media_del', $short_file_path, $post_id ); } /** * Rename media file. * * @since 2.9.8 * @access public * * @param string $short_file_path Old relative path. * @param string $short_file_path_new New relative path. * @param int $post_id Post ID. * @return void */ public function rename( $short_file_path, $short_file_path_new, $post_id ) { $real_file = $this->_wp_upload_dir['basedir'] . '/' . $short_file_path; $real_file_new = $this->_wp_upload_dir['basedir'] . '/' . $short_file_path_new; if ( file_exists( $real_file ) ) { global $wp_filesystem; if ( ! $wp_filesystem ) { require_once ABSPATH . '/wp-admin/includes/file.php'; \WP_Filesystem(); } if ( $wp_filesystem ) { $wp_filesystem->move( $real_file, $real_file_new, true ); } self::debug( 'renamed ' . $real_file . ' to ' . $real_file_new ); } do_action( 'litespeed_media_rename', $short_file_path, $short_file_path_new, $post_id ); } /** * Media Admin Menu -> Image Optimization Column Title. * * @since 1.6.3 * @access public * * @param array $posts_columns Existing columns. * @return array Modified columns. */ public function media_row_title( $posts_columns ) { $posts_columns['imgoptm'] = esc_html__( 'LiteSpeed Optimization', 'litespeed-cache' ); return $posts_columns; } /** * Media Admin Menu -> Image Optimization Column. * * @since 1.6.2 * @access public * * @param string $column_name Current column name. * @param int $post_id Post ID. * @return void */ public function media_row_actions( $column_name, $post_id ) { if ( 'imgoptm' !== $column_name ) { return; } do_action( 'litespeed_media_row', $post_id ); } /** * Display image optimization info in the media list row. * * @since 3.0 * * @param int $post_id Attachment post ID. * @return void */ public function media_row_con( $post_id ) { $att_info = wp_get_attachment_metadata( $post_id ); if ( empty( $att_info['file'] ) ) { return; } $short_path = $att_info['file']; $size_meta = get_post_meta( $post_id, Img_Optm::DB_SIZE, true ); echo '<p>'; // Original image info. if ( $size_meta && ! empty( $size_meta['ori_saved'] ) ) { $percent = (int) ceil( ( (int) $size_meta['ori_saved'] * 100 ) / max( 1, (int) $size_meta['ori_total'] ) ); $extension = pathinfo( $short_path, PATHINFO_EXTENSION ); $bk_file = substr( $short_path, 0, -strlen( $extension ) ) . 'bk.' . $extension; $bk_optm_file = substr( $short_path, 0, -strlen( $extension ) ) . 'bk.optm.' . $extension; $link = Utility::build_url( Router::ACTION_IMG_OPTM, 'orig' . $post_id ); $desc = false; $cls = ''; if ( $this->info( $bk_file, $post_id ) ) { $curr_status = esc_html__( '(optm)', 'litespeed-cache' ); $desc = esc_attr__( 'Currently using optimized version of file.', 'litespeed-cache' ) . ' ' . esc_attr__( 'Click to switch to original (unoptimized) version.', 'litespeed-cache' ); } elseif ( $this->info( $bk_optm_file, $post_id ) ) { $cls .= ' litespeed-warning'; $curr_status = esc_html__( '(non-optm)', 'litespeed-cache' ); $desc = esc_attr__( 'Currently using original (unoptimized) version of file.', 'litespeed-cache' ) . ' ' . esc_attr__( 'Click to switch to optimized version.', 'litespeed-cache' ); } echo wp_kses_post( GUI::pie_tiny( $percent, 24, sprintf( esc_html__( 'Original file reduced by %1$s (%2$s)', 'litespeed-cache' ), $percent . '%', Utility::real_size( $size_meta['ori_saved'] ) ), 'left' ) ); printf( esc_html__( 'Orig saved %s', 'litespeed-cache' ), (int) $percent . '%' ); if ( $desc ) { printf( ' <a href="%1$s" class="litespeed-media-href %2$s" data-balloon-pos="left" data-balloon-break aria-label="%3$s">%4$s</a>', esc_url( $link ), esc_attr( $cls ), wp_kses_post( $desc ), esc_html( $curr_status ) ); } else { printf( ' <span class="litespeed-desc" data-balloon-pos="left" data-balloon-break aria-label="%1$s">%2$s</span>', esc_attr__( 'Using optimized version of file. ', 'litespeed-cache' ) . ' ' . esc_attr__( 'No backup of original file exists.', 'litespeed-cache' ), esc_html__( '(optm)', 'litespeed-cache' ) ); } } elseif ( $size_meta && 0 === (int) $size_meta['ori_saved'] ) { echo wp_kses_post( GUI::pie_tiny( 0, 24, esc_html__( 'Congratulation! Your file was already optimized', 'litespeed-cache' ), 'left' ) ); printf( esc_html__( 'Orig %s', 'litespeed-cache' ), '<span class="litespeed-desc">' . esc_html__( '(no savings)', 'litespeed-cache' ) . '</span>' ); } else { echo esc_html__( 'Orig', 'litespeed-cache' ) . '<span class="litespeed-left10">—</span>'; } echo '</p>'; echo '<p>'; // WebP/AVIF info. if ( $size_meta && $this->webp_support( true ) && ! empty( $size_meta[ $this->_sys_format . '_saved' ] ) ) { $is_avif = 'avif' === $this->_sys_format; $size_meta_saved = $size_meta[ $this->_sys_format . '_saved' ]; $size_meta_total = $size_meta[ $this->_sys_format . '_total' ]; $percent = ceil( ( $size_meta_saved * 100 ) / max( 1, $size_meta_total ) ); $link = Utility::build_url( Router::ACTION_IMG_OPTM, $this->_sys_format . $post_id ); $desc = false; $cls = ''; if ( $this->info( $short_path . '.' . $this->_sys_format, $post_id ) ) { $curr_status = esc_html__( '(optm)', 'litespeed-cache' ); $desc = $is_avif ? esc_attr__( 'Currently using optimized version of AVIF file.', 'litespeed-cache' ) : esc_attr__( 'Currently using optimized version of WebP file.', 'litespeed-cache' ); $desc .= ' ' . esc_attr__( 'Click to switch to original (unoptimized) version.', 'litespeed-cache' ); } elseif ( $this->info( $short_path . '.optm.' . $this->_sys_format, $post_id ) ) { $cls .= ' litespeed-warning'; $curr_status = esc_html__( '(non-optm)', 'litespeed-cache' ); $desc = $is_avif ? esc_attr__( 'Currently using original (unoptimized) version of AVIF file.', 'litespeed-cache' ) : esc_attr__( 'Currently using original (unoptimized) version of WebP file.', 'litespeed-cache' ); $desc .= ' ' . esc_attr__( 'Click to switch to optimized version.', 'litespeed-cache' ); } echo wp_kses_post( GUI::pie_tiny( $percent, 24, sprintf( $is_avif ? esc_html__( 'AVIF file reduced by %1$s (%2$s)', 'litespeed-cache' ) : esc_html__( 'WebP file reduced by %1$s (%2$s)', 'litespeed-cache' ), $percent . '%', Utility::real_size( $size_meta_saved ) ), 'left' ) ); printf( $is_avif ? esc_html__( 'AVIF saved %s', 'litespeed-cache' ) : esc_html__( 'WebP saved %s', 'litespeed-cache' ), '<span>' . esc_html( $percent ) . '%</span>' ); if ( $desc ) { printf( ' <a href="%1$s" class="litespeed-media-href %2$s" data-balloon-pos="left" data-balloon-break aria-label="%3$s">%4$s</a>', esc_url( $link ), esc_attr( $cls ), wp_kses_post( $desc ), esc_html( $curr_status ) ); } else { printf( ' <span class="litespeed-desc" data-balloon-pos="left" data-balloon-break aria-label="%1$s %2$s">%3$s</span>', esc_attr__( 'Using optimized version of file. ', 'litespeed-cache' ), $is_avif ? esc_attr__( 'No backup of unoptimized AVIF file exists.', 'litespeed-cache' ) : esc_attr__( 'No backup of unoptimized WebP file exists.', 'litespeed-cache' ), esc_html__( '(optm)', 'litespeed-cache' ) ); } } else { echo esc_html( $this->next_gen_image_title() ) . '<span class="litespeed-left10">—</span>'; } echo '</p>'; // Delete row btn. if ( $size_meta ) { printf( '<div class="row-actions"><span class="delete"><a href="%1$s" class="">%2$s</a></span></div>', esc_url( Utility::build_url( Router::ACTION_IMG_OPTM, Img_Optm::TYPE_RESET_ROW, false, null, [ 'id' => $post_id ] ) ), esc_html__( 'Restore from backup', 'litespeed-cache' ) ); echo '</div>'; } } /** * Get wp size info. * * NOTE: this is not used because it has to be after admin_init. * * @since 1.6.2 * @return array $sizes Data for all currently-registered image sizes. */ public function get_image_sizes() { global $_wp_additional_image_sizes; $sizes = []; foreach ( get_intermediate_image_sizes() as $_size ) { if ( in_array( $_size, [ 'thumbnail', 'medium', 'medium_large', 'large' ], true ) ) { $sizes[ $_size ]['width'] = get_option( $_size . '_size_w' ); $sizes[ $_size ]['height'] = get_option( $_size . '_size_h' ); $sizes[ $_size ]['crop'] = (bool) get_option( $_size . '_crop' ); } elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) { $sizes[ $_size ] = [ 'width' => $_wp_additional_image_sizes[ $_size ]['width'], 'height' => $_wp_additional_image_sizes[ $_size ]['height'], 'crop' => $_wp_additional_image_sizes[ $_size ]['crop'], ]; } } return $sizes; } /** * Exclude role from optimization filter. * * @since 1.6.2 * @access public * * @param bool $sys_level Return system-level format if true. * @return string Next-gen format name or empty string. */ public function webp_support( $sys_level = false ) { if ( $sys_level ) { return $this->_sys_format; } return $this->_format; // User level next gen support. } /** * Detect if browser supports next-gen format. * * @return bool */ private function _browser_support_next_gen() { $accept = isset( $_SERVER['HTTP_ACCEPT'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_ACCEPT'] ) ) : ''; if ( $accept ) { if ( false !== strpos( $accept, 'image/' . $this->_sys_format ) ) { return true; } } $ua = isset( $_SERVER['HTTP_USER_AGENT'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) : ''; if ( $ua ) { $user_agents = [ 'chrome-lighthouse', 'googlebot', 'page speed' ]; foreach ( $user_agents as $user_agent ) { if ( false !== stripos( $ua, $user_agent ) ) { return true; } } if ( preg_match( '/iPhone OS (\d+)_/i', $ua, $matches ) ) { if ( $matches[1] >= 14 ) { return true; } } if ( preg_match( '/Firefox\/(\d+)/i', $ua, $matches ) ) { if ( $matches[1] >= 65 ) { return true; } } } return false; } /** * Get next gen image title. * * @since 7.0 * @return string */ public function next_gen_image_title() { $next_gen_img = 'WebP'; if ( 2 === $this->conf( Base::O_IMG_OPTM_WEBP ) ) { $next_gen_img = 'AVIF'; } return $next_gen_img; } /** * Run lazy load process. * NOTE: As this is after cache finalized, can NOT set any cache control anymore. * * Only do for main page. Do NOT do for esi or dynamic content. * * @since 1.4 * @access public * * @param string $content Final buffer. * @return string The buffer. */ public function finalize( $content ) { if ( defined( 'LITESPEED_NO_LAZY' ) ) { self::debug2( 'bypass: NO_LAZY const' ); return $content; } if ( ! defined( 'LITESPEED_IS_HTML' ) ) { self::debug2( 'bypass: Not frontend HTML type' ); return $content; } if ( ! Control::is_cacheable() ) { self::debug( 'bypass: Not cacheable' ); return $content; } self::debug( 'finalize' ); $this->content = $content; $this->_finalize(); return $this->content; } /** * Run lazyload replacement for images in buffer. * * @since 1.4 * @access private * @return void */ private function _finalize() { /** * Use webp for optimized images. * * @since 1.6.2 */ if ( $this->webp_support() ) { $this->content = $this->_replace_buffer_img_webp( $this->content ); } /** * Check if URI is excluded. * * @since 3.0 */ $excludes = $this->conf( Base::O_MEDIA_LAZY_URI_EXC ); if ( ! defined( 'LITESPEED_GUEST_OPTM' ) ) { $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; $result = $request_uri ? Utility::str_hit_array( $request_uri, $excludes ) : false; if ( $result ) { self::debug( 'bypass lazyload: hit URI Excludes setting: ' . $result ); return; } } $cfg_lazy = ( defined( 'LITESPEED_GUEST_OPTM' ) || $this->conf( Base::O_MEDIA_LAZY ) ) && ! $this->cls( 'Metabox' )->setting( 'litespeed_no_image_lazy' ); $cfg_iframe_lazy = defined( 'LITESPEED_GUEST_OPTM' ) || $this->conf( Base::O_MEDIA_IFRAME_LAZY ); $cfg_js_delay = defined( 'LITESPEED_GUEST_OPTM' ) || 2 === $this->conf( Base::O_OPTM_JS_DEFER ); $cfg_trim_noscript = defined( 'LITESPEED_GUEST_OPTM' ) || $this->conf( Base::O_OPTM_NOSCRIPT_RM ); $cfg_vpi = defined( 'LITESPEED_GUEST_OPTM' ) || $this->conf( Base::O_MEDIA_VPI ); // Preload VPI. if ( $cfg_vpi ) { $this->_parse_img_for_preload(); } if ( $cfg_lazy ) { if ( $cfg_vpi ) { add_filter( 'litespeed_media_lazy_img_excludes', [ $this->cls( 'Metabox' ), 'lazy_img_excludes' ] ); } list( $src_list, $html_list, $placeholder_list ) = $this->_parse_img(); $html_list_ori = $html_list; } else { self::debug( 'lazyload disabled' ); } // image lazy load. if ( $cfg_lazy ) { $__placeholder = Placeholder::cls(); foreach ( $html_list as $k => $v ) { $size = $placeholder_list[ $k ]; $src = $src_list[ $k ]; $html_list[ $k ] = $__placeholder->replace( $v, $src, $size ); } } if ( $cfg_lazy ) { $this->content = str_replace( $html_list_ori, $html_list, $this->content ); } // iframe lazy load. if ( $cfg_iframe_lazy ) { $html_list = $this->_parse_iframe(); $html_list_ori = $html_list; foreach ( $html_list as $k => $v ) { $snippet = $cfg_trim_noscript ? '' : '<noscript>' . $v . '</noscript>'; if ( $cfg_js_delay ) { $v = str_replace( ' src=', ' data-litespeed-src=', $v ); } else { $v = str_replace( ' src=', ' data-src=', $v ); } $v = str_replace( '<iframe ', '<iframe data-lazyloaded="1" src="about:blank" ', $v ); $snippet = $v . $snippet; $html_list[ $k ] = $snippet; } $this->content = str_replace( $html_list_ori, $html_list, $this->content ); } // Include lazyload lib js and init lazyload. if ( $cfg_lazy || $cfg_iframe_lazy ) { $lazy_lib = '<script data-no-optimize="1">window.lazyLoadOptions=Object.assign({},{threshold:' . apply_filters( 'litespeed_lazyload_threshold', 300 ) . '},window.lazyLoadOptions||{});' . File::read( LSCWP_DIR . self::LIB_FILE_IMG_LAZYLOAD ) . '</script>'; if ( $cfg_js_delay ) { // Load JS delay lib. if ( ! defined( 'LITESPEED_JS_DELAY_LIB_LOADED' ) ) { define( 'LITESPEED_JS_DELAY_LIB_LOADED', true ); $lazy_lib .= '<script data-no-optimize="1">' . File::read( LSCWP_DIR . Optimize::LIB_FILE_JS_DELAY ) . '</script>'; } } $this->content = str_replace( '</body>', $lazy_lib . '</body>', $this->content ); } } /** * Parse img src for VPI preload only. * Note: Didn't reuse the _parse_img() because it contains replacement logic which is not needed for preload. * * @since 6.2 * @since 7.6 - Added attributes fetchpriority="high" and decode="sync" for VPI images. * @return void */ private function _parse_img_for_preload() { // Load VPI setting. $is_mobile = $this->_separate_mobile(); $vpi_files = $this->cls( 'Metabox' )->setting( $is_mobile ? VPI::POST_META_MOBILE : VPI::POST_META ); if ( $vpi_files ) { $vpi_files = Utility::sanitize_lines( $vpi_files, 'basename' ); } if ( ! $vpi_files ) { return; } if ( ! $this->content ) { return; } $content = preg_replace( [ '#<!--.*-->#sU', '#<noscript([^>]*)>.*</noscript>#isU' ], '', $this->content ); if ( ! $content ) { return; } $vpi_fp_search = []; $vpi_fp_replace = []; preg_match_all('#<img\s+([^>]+)/?>#isU', $content, $matches, PREG_SET_ORDER); foreach ($matches as $match) { $attrs = Utility::parse_attr($match[1]); if ( empty( $attrs['src'] ) ) { continue; } if ( false !== strpos( $attrs['src'], 'base64' ) || 0 === strpos( $attrs['src'], 'data:' ) ) { self::debug2( 'lazyload bypassed base64 img' ); continue; } if ( false !== strpos( $attrs['src'], '{' ) ) { self::debug2( 'image src has {} ' . $attrs['src'] ); continue; } // If the src contains VPI filename, then preload it. if ( ! Utility::str_hit_array( $attrs['src'], $vpi_files ) ) { continue; } self::debug2( 'VPI preload found and matched: ' . $attrs['src'] ); $this->_vpi_preload_list[] = $attrs['src']; // Add attributes fetchpriority="high" and decode="sync" // after WP 6.3.0 use: wp_img_tag_add_loading_optimization_attrs(). $new_html = []; $attrs[ 'fetchpriority' ] = 'high'; $attrs[ 'decoding' ] = 'sync'; // create html with new attributes. foreach ( $attrs as $k => $attr ) { $new_html[] = $k . '="' . $attr . '"'; } if ( $new_html ) { $vpi_fp_search[] = $match[1]; $vpi_fp_replace[] = implode( ' ', $new_html); } } // if VPI fetchpriority changes, do the replacement if ( $vpi_fp_search && $vpi_fp_replace ) { $this->content = str_replace( $vpi_fp_search, $vpi_fp_replace, $this->content ); } unset( $vpi_fp_search ); unset( $vpi_fp_replace ); } /** * Parse img src. * * @since 1.4 * @access private * @return array{0:array,1:array,2:array} All the src & related raw html list with placeholders. */ private function _parse_img() { /** * Exclude list. * * @since 1.5 * @since 2.7.1 Changed to array. */ $excludes = apply_filters( 'litespeed_media_lazy_img_excludes', $this->conf( Base::O_MEDIA_LAZY_EXC ) ); $cls_excludes = apply_filters( 'litespeed_media_lazy_img_cls_excludes', $this->conf( Base::O_MEDIA_LAZY_CLS_EXC ) ); $cls_excludes[] = 'skip-lazy'; // https://core.trac.wordpress.org/ticket/44427 $src_list = []; $html_list = []; $placeholder_list = []; $content = preg_replace( [ '#<!--.*-->#sU', '#<noscript([^>]*)>.*</noscript>#isU', '#<script([^>]*)>.*</script>#isU', // Remove script to avoid false matches and warnings, when image size detection is turned ON. ], '', $this->content ); /** * Exclude parent classes. * * @since 3.0 */ $parent_cls_exc = apply_filters( 'litespeed_media_lazy_img_parent_cls_excludes', $this->conf( Base::O_MEDIA_LAZY_PARENT_CLS_EXC ) ); if ( $parent_cls_exc ) { self::debug2( 'Lazyload Class excludes', $parent_cls_exc ); foreach ( $parent_cls_exc as $v ) { $content = preg_replace('#<(\w+) [^>]*class=(\'|")[^\'"]*' . preg_quote($v, '#') . '[^\'"]*\2[^>]*>.*</\1>#sU', '', $content); } } preg_match_all( '#<img\s+([^>]+)/?>#isU', $content, $matches, PREG_SET_ORDER ); foreach ( $matches as $match ) { $attrs = Utility::parse_attr( $match[1] ); if ( empty( $attrs['src'] ) ) { continue; } /** * Add src validation to bypass base64 img src. * * @since 1.6 */ if ( false !== strpos( $attrs['src'], 'base64' ) || 0 === strpos( $attrs['src'], 'data:' ) ) { self::debug2( 'lazyload bypassed base64 img' ); continue; } self::debug2( 'lazyload found: ' . $attrs['src'] ); if ( ! empty( $attrs['data-no-lazy'] ) || ! empty( $attrs['data-skip-lazy'] ) || ! empty( $attrs['data-lazyloaded'] ) || ! empty( $attrs['data-src'] ) || ! empty( $attrs['data-srcset'] ) ) { self::debug2( 'bypassed' ); continue; } $hit = ! empty( $attrs['class'] ) ? Utility::str_hit_array( $attrs['class'], $cls_excludes ) : false; if ( $hit ) { self::debug2( 'lazyload image cls excludes [hit] ' . $hit ); continue; } /** * Exclude from lazyload by setting. * * @since 1.5 */ if ( $excludes && Utility::str_hit_array( $attrs['src'], $excludes ) ) { self::debug2( 'lazyload image exclude ' . $attrs['src'] ); continue; } /** * Excludes invalid image src from buddypress avatar crop. * * @see https://wordpress.org/support/topic/lazy-load-breaking-buddypress-upload-avatar-feature * @since 3.0 */ if ( false !== strpos( $attrs['src'], '{' ) ) { self::debug2( 'image src has {} ' . $attrs['src'] ); continue; } // to avoid multiple replacement. if ( in_array( $match[0], $html_list, true ) ) { continue; } // Add missing dimensions. if ( defined( 'LITESPEED_GUEST_OPTM' ) || $this->conf( Base::O_MEDIA_ADD_MISSING_SIZES ) ) { if ( ! apply_filters( 'litespeed_media_add_missing_sizes', true ) ) { self::debug2( 'add_missing_sizes bypassed via litespeed_media_add_missing_sizes filter' ); } elseif ( empty( $attrs['width'] ) || 'auto' === $attrs['width'] || empty( $attrs['height'] ) || 'auto' === $attrs['height'] ) { self::debug( '⚠️ Missing sizes for image [src] ' . $attrs['src'] ); $dimensions = $this->_detect_dimensions( $attrs['src'] ); if ( $dimensions ) { $ori_width = $dimensions[0]; $ori_height = $dimensions[1]; // Calculate height based on width. if ( ! empty( $attrs['width'] ) && 'auto' !== $attrs['width'] ) { $ori_height = (int) ( ( $ori_height * (int) $attrs['width'] ) / max( 1, $ori_width ) ); } elseif ( ! empty( $attrs['height'] ) && 'auto' !== $attrs['height'] ) { $ori_width = (int) ( ( $ori_width * (int) $attrs['height'] ) / max( 1, $ori_height ) ); } $attrs['width'] = $ori_width; $attrs['height'] = $ori_height; $new_html = preg_replace( '#\s+(width|height)=(["\'])[^\2]*?\2#', '', $match[0] ); $new_html = preg_replace( '#<img\s+#i', '<img width="' . Str::trim_quotes( $attrs['width'] ) . '" height="' . Str::trim_quotes( $attrs['height'] ) . '" ', $new_html ); self::debug( 'Add missing sizes ' . $attrs['width'] . 'x' . $attrs['height'] . ' to ' . $attrs['src'] ); $this->content = str_replace( $match[0], $new_html, $this->content ); $match[0] = $new_html; } } } $placeholder = false; if ( ! empty( $attrs['width'] ) && 'auto' !== $attrs['width'] && ! empty( $attrs['height'] ) && 'auto' !== $attrs['height'] ) { $placeholder = (int) $attrs['width'] . 'x' . (int) $attrs['height']; } $src_list[] = $attrs['src']; $html_list[] = $match[0]; $placeholder_list[] = $placeholder; } return [ $src_list, $html_list, $placeholder_list ]; } /** * Detect the original sizes. * * @since 4.0 * * @param string $src Source URL/path. * @return array|false getimagesize array or false. */ private function _detect_dimensions( $src ) { $pathinfo = Utility::is_internal_file( $src ); if ( $pathinfo ) { $src = $pathinfo[0]; } elseif ( apply_filters( 'litespeed_media_ignore_remote_missing_sizes', false ) ) { return false; } if ( 0 === strpos( $src, '//' ) ) { $src = 'https:' . $src; } try { $sizes = getimagesize( $src ); } catch ( \Exception $e ) { return false; } if ( ! empty( $sizes[0] ) && ! empty( $sizes[1] ) ) { return $sizes; } return false; } /** * Parse iframe src. * * @since 1.4 * @access private * @return array All the related raw html list (full <iframe> tags). */ private function _parse_iframe() { $cls_excludes = apply_filters( 'litespeed_media_iframe_lazy_cls_excludes', $this->conf( Base::O_MEDIA_IFRAME_LAZY_CLS_EXC ) ); $cls_excludes[] = 'skip-lazy'; // https://core.trac.wordpress.org/ticket/44427 $html_list = []; $content = preg_replace( '#<!--.*-->#sU', '', $this->content ); /** * Exclude parent classes. * * @since 3.0 */ $parent_cls_exc = apply_filters( 'litespeed_media_iframe_lazy_parent_cls_excludes', $this->conf( Base::O_MEDIA_IFRAME_LAZY_PARENT_CLS_EXC ) ); if ( $parent_cls_exc ) { self::debug2( 'Iframe Lazyload Class excludes', $parent_cls_exc ); foreach ( $parent_cls_exc as $v ) { $content = preg_replace('#<(\w+) [^>]*class=(\'|")[^\'"]*' . preg_quote($v, '#') . '[^\'"]*\2[^>]*>.*</\1>#sU', '', $content); } } preg_match_all( '#<iframe \s*([^>]+)></iframe>#isU', $content, $matches, PREG_SET_ORDER ); foreach ( $matches as $match ) { $attrs = Utility::parse_attr( $match[1] ); if ( empty( $attrs['src'] ) ) { continue; } self::debug2( 'found iframe: ' . $attrs['src'] ); if ( ! empty( $attrs['data-no-lazy'] ) || ! empty( $attrs['data-skip-lazy'] ) || ! empty( $attrs['data-lazyloaded'] ) || ! empty( $attrs['data-src'] ) ) { self::debug2( 'bypassed' ); continue; } $hit = ! empty( $attrs['class'] ) ? Utility::str_hit_array( $attrs['class'], $cls_excludes ) : false; if ( $hit ) { self::debug2( 'iframe lazyload cls excludes [hit] ' . $hit ); continue; } if ( apply_filters( 'litespeed_iframe_lazyload_exc', false, $attrs['src'] ) ) { self::debug2( 'bypassed by filter' ); continue; } // to avoid multiple replacement. if ( in_array( $match[0], $html_list, true ) ) { continue; } $html_list[] = $match[0]; } return $html_list; } /** * Replace image src to webp/avif in buffer. * * @since 1.6.2 * @access private * * @param string $content HTML content. * @return string Modified content. */ private function _replace_buffer_img_webp( $content ) { /** * Added custom element & attribute support. * * @since 2.2.2 */ $webp_ele_to_check = $this->conf( Base::O_IMG_OPTM_WEBP_ATTR ); foreach ( $webp_ele_to_check as $v ) { if ( ! $v || false === strpos( $v, '.' ) ) { self::debug2( 'buffer_webp no . attribute ' . $v ); continue; } self::debug2( 'buffer_webp attribute ' . $v ); $v = explode( '.', $v ); $attr = preg_quote( $v[1], '#' ); if ( $v[0] ) { $pattern = '#<' . preg_quote( $v[0], '#' ) . '([^>]+)' . $attr . '=([\'"])(.+)\2#iU'; } else { $pattern = '# ' . $attr . '=([\'"])(.+)\1#iU'; } preg_match_all( $pattern, $content, $matches ); foreach ( $matches[ $v[0] ? 3 : 2 ] as $k2 => $url ) { // Check if is a DATA-URI. if ( false !== strpos( $url, 'data:image' ) ) { continue; } $url2 = $this->replace_webp( $url ); if ( ! $url2 ) { continue; } if ( $v[0] ) { $html_snippet = sprintf( '<' . $v[0] . '%1$s' . $v[1] . '=%2$s', $matches[1][ $k2 ], $matches[2][ $k2 ] . $url2 . $matches[2][ $k2 ] ); } else { $html_snippet = sprintf( ' ' . $v[1] . '=%1$s', $matches[1][ $k2 ] . $url2 . $matches[1][ $k2 ] ); } $content = str_replace( $matches[0][ $k2 ], $html_snippet, $content ); } } // parse srcset. // todo: should apply this to cdn too. if ( ( defined( 'LITESPEED_GUEST_OPTM' ) || $this->conf( Base::O_IMG_OPTM_WEBP_REPLACE_SRCSET ) ) && $this->webp_support() ) { $content = Utility::srcset_replace( $content, [ $this, 'replace_webp' ] ); } // Replace background-image. if ( ( defined( 'LITESPEED_GUEST_OPTM' ) || $this->conf( Base::O_IMG_OPTM_WEBP ) ) && $this->webp_support() ) { $content = $this->replace_background_webp( $content ); } return $content; } /** * Replace background image in inline styles and JSON blobs. * * @since 4.0 * * @param string $content HTML content. * @return string Modified content. */ public function replace_background_webp( $content ) { self::debug2( 'Start replacing background WebP/AVIF.' ); // Handle Elementor's data-settings JSON encoded background-images. $content = $this->replace_urls_in_json( $content ); preg_match_all( '#url\(([^)]+)\)#iU', $content, $matches ); foreach ( $matches[1] as $k => $url ) { // Check if is a DATA-URI. if ( false !== strpos( $url, 'data:image' ) ) { continue; } /** * Support quotes in src `background-image: url('src')`. * * @since 2.9.3 */ $url = trim( $url, '\'"' ); // Fix Elementor's Slideshow unusual background images like style="background-image: url("https://xxxx.png");" if ( 0 === strpos( $url, '"' ) && '"' === substr( $url, -6 ) ) { $url = substr( $url, 6, -6 ); } $url2 = $this->replace_webp( $url ); if ( ! $url2 ) { continue; } $html_snippet = str_replace( $url, $url2, $matches[0][ $k ] ); $content = str_replace( $matches[0][ $k ], $html_snippet, $content ); } return $content; } /** * Replace images in json data settings attributes. * * @since 6.2 * * @param string $content HTML content to scan and modify. * @return string Modified content with replaced URLs inside JSON attributes. */ public function replace_urls_in_json( $content ) { $pattern = '/data-settings="(.*?)"/i'; $parent_class = $this; preg_match_all( $pattern, $content, $matches, PREG_SET_ORDER ); foreach ( $matches as $match ) { // Check if the string contains HTML entities. $is_encoded = preg_match( '/"|<|>|&|'/', $match[1] ); // Decode HTML entities in the JSON string. $json_string = html_entity_decode( $match[1] ); $json_data = \json_decode( $json_string, true ); if ( JSON_ERROR_NONE === json_last_error() && is_array( $json_data ) ) { $did_webp_replace = false; array_walk_recursive( $json_data, /** * Replace URLs in JSON data recursively. * * @param mixed $item Value (modified in place). * @param string $key Array key. */ function ( &$item, $key ) use ( &$did_webp_replace, $parent_class ) { if ( 'url' === $key ) { $item_image = $parent_class->replace_webp( $item ); if ( $item_image ) { $item = $item_image; $did_webp_replace = true; } } } ); if ( $did_webp_replace ) { // Re-encode the modified array back to a JSON string. $new_json_string = wp_json_encode( $json_data ); // Re-encode the JSON string to HTML entities only if it was originally encoded. if ( $is_encoded ) { $new_json_string = htmlspecialchars( $new_json_string, ENT_QUOTES | 0 ); // ENT_HTML401 for PHP>=5.4. } // Replace the old JSON string in the content with the new, modified JSON string. $content = str_replace( $match[1], $new_json_string, $content ); } } } return $content; } /** * Replace internal image src to webp or avif. * * @since 1.6.2 * @access public * * @param string $url Image URL. * @return string|false Replaced URL or false if not applicable. */ public function replace_webp( $url ) { if ( ! $this->webp_support() ) { self::debug2( 'No next generation format chosen in setting, bypassed' ); return false; } self::debug2( $this->_sys_format . ' replacing: ' . substr( $url, 0, 200 ) ); if ( substr( $url, -5 ) === '.' . $this->_sys_format ) { self::debug2( 'already ' . $this->_sys_format ); return false; } /** * WebP/AVIF API hook. * NOTE: As $url may contain query strings, check filters which may parse_url before appending format. * * @since 2.9.5 * @see #751737 - API docs for WebP generation */ $ori_check = apply_filters( 'litespeed_media_check_ori', Utility::is_internal_file( $url ), $url ); if ( $ori_check ) { // check if has webp/avif file. $has_next = apply_filters( 'litespeed_media_check_webp', Utility::is_internal_file( $url, $this->_sys_format ), $url ); if ( $has_next ) { $url .= '.' . $this->_sys_format; } else { self::debug2( '-no WebP or AVIF file, bypassed' ); return false; } } else { self::debug2( '-no file, bypassed' ); return false; } self::debug2( '- replaced to: ' . $url ); return $url; } /** * Hook to wp_get_attachment_image_src. * * @since 1.6.2 * @access public * * @param array $img The URL, width, height array. * @return array */ public function webp_attach_img_src( $img ) { self::debug2( 'changing attach src: ' . $img[0] ); $url = $img ? $this->replace_webp( $img[0] ) : false; if ( $url ) { $img[0] = $url; } return $img; } /** * Try to replace img url. * * @since 1.6.2 * @access public * * @param string $url Image URL. * @return string */ public function webp_url( $url ) { $url2 = $url ? $this->replace_webp( $url ) : false; if ( $url2 ) { $url = $url2; } return $url; } /** * Hook to replace WP responsive images. * * @since 1.6.2 * @access public * * @param array $srcs Srcset array. * @return array */ public function webp_srcset( $srcs ) { if ( $srcs ) { foreach ( $srcs as $w => $data ) { $url = $this->replace_webp( $data['url'] ); if ( ! $url ) { continue; } $srcs[ $w ]['url'] = $url; } } return $srcs; } } src/ucss.cls.php 0000777 00000040421 15251157102 0007610 0 ustar 00 <?php /** * The ucss class. * * @since 5.1 * @package LiteSpeed */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * UCSS optimization class. * * @since 5.1 */ class UCSS extends Base { const LOG_TAG = '[UCSS]'; const TYPE_GEN = 'gen'; const TYPE_CLEAR_Q = 'clear_q'; /** * Summary data. * * @var array */ protected $_summary; /** * UCSS whitelist selectors. * * @var array */ private $_ucss_whitelist; /** * Queue for UCSS generation. * * @var array */ private $_queue; /** * Init * * @since 3.0 */ public function __construct() { $this->_summary = self::get_summary(); add_filter( 'litespeed_ucss_whitelist', [ $this->cls( 'Data' ), 'load_ucss_whitelist' ] ); } /** * Uniform url tag for ucss usage * * @since 4.7 * * @param string|false $request_url The request URL. * @return string The URL tag. */ public static function get_url_tag( $request_url = false ) { $url_tag = $request_url; if (is_404()) { $url_tag = '404'; } elseif (apply_filters('litespeed_ucss_per_pagetype', false)) { $url_tag = Utility::page_type(); self::debug('litespeed_ucss_per_pagetype filter altered url to ' . $url_tag); } return $url_tag; } /** * Get UCSS path * * @since 4.0 * * @param string $request_url The request URL. * @param bool $dry_run Whether to run in dry mode. * @return string|false The UCSS filename or false. */ public function load( $request_url, $dry_run = false ) { // Check UCSS URI excludes $ucss_exc = apply_filters( 'litespeed_ucss_exc', $this->conf( self::O_OPTM_UCSS_EXC ) ); $hit = $ucss_exc ? Utility::str_hit_array( $request_url, $ucss_exc ) : false; if ( $hit ) { self::debug( 'UCSS bypassed due to UCSS URI Exclude setting: ' . $hit ); Core::comment( 'QUIC.cloud UCSS bypassed by setting' ); return false; } $filepath_prefix = $this->_build_filepath_prefix('ucss'); $url_tag = self::get_url_tag($request_url); $vary = $this->cls('Vary')->finalize_full_varies(); $filename = $this->cls('Data')->load_url_file($url_tag, $vary, 'ucss'); if ($filename) { $static_file = LITESPEED_STATIC_DIR . $filepath_prefix . $filename . '.css'; if (file_exists($static_file)) { self::debug2('existing ucss ' . $static_file); // Check if is error comment inside only $tmp = File::read($static_file); if ( '/*' === substr( $tmp, 0, 2 ) && '*/' === substr( trim( $tmp ), -2 ) ) { self::debug2('existing ucss is error only: ' . $tmp); Core::comment('QUIC.cloud UCSS bypassed due to generation error ❌ ' . $filepath_prefix . $filename . '.css'); return false; } Core::comment('QUIC.cloud UCSS loaded ✅ ' . $filepath_prefix . $filename . '.css' ); return $filename . '.css'; } } if ($dry_run) { return false; } Core::comment('QUIC.cloud UCSS in queue'); $uid = get_current_user_id(); $ua = $this->_get_ua(); // Store it for cron $this->_queue = $this->load_queue('ucss'); if (count($this->_queue) > 500) { self::debug('UCSS Queue is full - 500'); return false; } $queue_k = (strlen($vary) > 32 ? md5($vary) : $vary) . ' ' . $url_tag; $this->_queue[ $queue_k ] = [ 'url' => apply_filters( 'litespeed_ucss_url', $request_url ), 'user_agent' => substr( $ua, 0, 200 ), 'is_mobile' => $this->_separate_mobile(), 'is_webp' => $this->cls( 'Media' )->webp_support() ? 1 : 0, 'uid' => $uid, 'vary' => $vary, 'url_tag' => $url_tag, ]; // Current UA will be used to request $this->save_queue('ucss', $this->_queue); self::debug('Added queue_ucss [url_tag] ' . $url_tag . ' [UA] ' . $ua . ' [vary] ' . $vary . ' [uid] ' . $uid); // Prepare cache tag for later purge Tag::add('UCSS.' . md5($queue_k)); return false; } /** * Get User Agent * * @since 5.3 * * @return string The user agent string. */ private function _get_ua() { return ! empty( $_SERVER['HTTP_USER_AGENT'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) : ''; } /** * Add rows to q * * @since 5.3 * * @param array $url_files Array of URL file data. * @return false|void False if queue is full. */ public function add_to_q( $url_files ) { // Store it for cron $this->_queue = $this->load_queue('ucss'); if (count($this->_queue) > 500) { self::debug('UCSS Queue is full - 500'); return false; } $ua = $this->_get_ua(); foreach ($url_files as $url_file) { $vary = $url_file['vary']; $request_url = $url_file['url']; $is_mobile = $url_file['mobile']; $is_webp = $url_file['webp']; $url_tag = self::get_url_tag($request_url); $queue_k = (strlen($vary) > 32 ? md5($vary) : $vary) . ' ' . $url_tag; $q = [ 'url' => apply_filters( 'litespeed_ucss_url', $request_url ), 'user_agent' => substr( $ua, 0, 200 ), 'is_mobile' => $is_mobile, 'is_webp' => $is_webp, 'uid' => false, 'vary' => $vary, 'url_tag' => $url_tag, ]; // Current UA will be used to request self::debug('Added queue_ucss [url_tag] ' . $url_tag . ' [UA] ' . $ua . ' [vary] ' . $vary . ' [uid] false'); $this->_queue[$queue_k] = $q; } $this->save_queue('ucss', $this->_queue); } /** * Generate UCSS * * @since 4.0 * * @param bool $keep_going Whether to continue processing. * @return mixed The cron handler result. */ public static function cron( $keep_going = false ) { $_instance = self::cls(); return $_instance->_cron_handler( $keep_going ); } /** * Handle UCSS cron * * @since 4.2 * * @param bool $keep_going Whether to continue processing. * @return mixed The redirect result or void. */ private function _cron_handler( $keep_going ) { $this->_queue = $this->load_queue( 'ucss' ); if ( empty( $this->_queue ) ) { return; } // For cron, need to check request interval too if ( ! $keep_going ) { if (!empty($this->_summary['curr_request']) && time() - $this->_summary['curr_request'] < 300 && !$this->conf(self::O_DEBUG)) { self::debug('Last request not done'); return; } } $i = 0; foreach ($this->_queue as $k => $v) { if (!empty($v['_status'])) { continue; } self::debug('cron job [tag] ' . $k . ' [url] ' . $v['url'] . ($v['is_mobile'] ? ' 📱 ' : '') . ' [UA] ' . $v['user_agent']); if (!isset($v['is_webp'])) { $v['is_webp'] = false; } ++$i; $res = $this->_send_req($v['url'], $k, $v['uid'], $v['user_agent'], $v['vary'], $v['url_tag'], $v['is_mobile'], $v['is_webp']); if (!$res) { // Status is wrong, drop this this->_queue $this->_queue = $this->load_queue('ucss'); unset($this->_queue[$k]); $this->save_queue('ucss', $this->_queue); if ( ! $keep_going ) { return; } if ( $i > 3 ) { GUI::print_loading( count( $this->_queue ), 'UCSS' ); return Router::self_redirect( Router::ACTION_UCSS, self::TYPE_GEN ); } continue; } // Exit queue if out of quota or service is hot if ( 'out_of_quota' === $res || 'svc_hot' === $res ) { return; } $this->_queue = $this->load_queue( 'ucss' ); $this->_queue[ $k ]['_status'] = 'requested'; $this->save_queue( 'ucss', $this->_queue ); self::debug( 'Saved to queue [k] ' . $k ); // only request first one if ( ! $keep_going ) { return; } if ($i > 3) { GUI::print_loading(count($this->_queue), 'UCSS'); return Router::self_redirect(Router::ACTION_UCSS, self::TYPE_GEN); } } } /** * Send to QC API to generate UCSS * * @since 2.3 * @access private * * @param string $request_url The request URL. * @param string $queue_k The queue key. * @param int|false $uid The user ID. * @param string $user_agent The user agent. * @param string $vary The vary string. * @param string $url_tag The URL tag. * @param bool $is_mobile Whether is mobile. * @param bool $is_webp Whether supports webp. * @return string|bool|null The result status. */ private function _send_req( $request_url, $queue_k, $uid, $user_agent, $vary, $url_tag, $is_mobile, $is_webp ) { // Check if has credit to push or not $err = false; $allowance = $this->cls('Cloud')->allowance(Cloud::SVC_UCSS, $err); if (!$allowance) { self::debug('❌ No credit: ' . $err); $err && Admin_Display::error(Error::msg($err)); return 'out_of_quota'; } set_time_limit(120); // Update css request status $this->_summary['curr_request'] = time(); self::save_summary(); // Gather guest HTML to send $html = $this->cls('CSS')->prepare_html($request_url, $user_agent, $uid); if (!$html) { return false; } // Parse HTML to gather all CSS content before requesting $css = false; list(, $html) = $this->prepare_css($html, $is_webp, true); // Use this to drop CSS from HTML as we don't need those CSS to generate UCSS $filename = $this->cls('Data')->load_url_file($url_tag, $vary, 'css'); $filepath_prefix = $this->_build_filepath_prefix('css'); $static_file = LITESPEED_STATIC_DIR . $filepath_prefix . $filename . '.css'; self::debug('Checking combined file ' . $static_file); if (file_exists($static_file)) { $css = File::read($static_file); } if (!$css) { self::debug('❌ No combined css'); return false; } $data = [ 'url' => $request_url, 'queue_k' => $queue_k, 'user_agent' => $user_agent, 'is_mobile' => $is_mobile ? 1 : 0, // todo:compatible w/ tablet 'is_webp' => $is_webp ? 1 : 0, 'html' => $html, 'css' => $css, ]; if (!isset($this->_ucss_whitelist)) { $this->_ucss_whitelist = $this->_filter_whitelist(); } $data['whitelist'] = $this->_ucss_whitelist; self::debug('Generating: ', $data); $json = Cloud::post(Cloud::SVC_UCSS, $data, 30); if (!is_array($json)) { return $json; } // Old version compatibility if (empty($json['status'])) { if (!empty($json['ucss'])) { $this->_save_con('ucss', $json['ucss'], $queue_k, $is_mobile, $is_webp); } // Delete the row return false; } // Unknown status, remove this line if ( 'queued' !== $json['status'] ) { return false; } // Save summary data $this->_summary['last_spent'] = time() - $this->_summary['curr_request']; $this->_summary['last_request'] = $this->_summary['curr_request']; $this->_summary['curr_request'] = 0; self::save_summary(); return true; } /** * Save UCSS content * * @since 4.2 * * @param string $type The content type. * @param string $css The CSS content. * @param string $queue_k The queue key. * @param bool $is_mobile Whether is mobile. * @param bool $is_webp Whether supports webp. */ private function _save_con( $type, $css, $queue_k, $is_mobile, $is_webp ) { // Add filters $css = apply_filters('litespeed_' . $type, $css, $queue_k); self::debug2('con: ', $css); if ( '/*' === substr( $css, 0, 2 ) && '*/' === substr( $css, -2 ) ) { self::debug('❌ empty ' . $type . ' [content] ' . $css); // continue; // Save the error info too } // Write to file $filecon_md5 = md5($css); $filepath_prefix = $this->_build_filepath_prefix($type); $static_file = LITESPEED_STATIC_DIR . $filepath_prefix . $filecon_md5 . '.css'; File::save($static_file, $css, true); $url_tag = $this->_queue[$queue_k]['url_tag']; $vary = $this->_queue[$queue_k]['vary']; self::debug2("Save URL to file [file] $static_file [vary] $vary"); $this->cls('Data')->save_url($url_tag, $vary, $type, $filecon_md5, dirname($static_file), $is_mobile, $is_webp); Purge::add(strtoupper($type) . '.' . md5($queue_k)); } /** * Prepare CSS from HTML for CCSS generation only. UCSS will used combined CSS directly. * Prepare refined HTML for both CCSS and UCSS. * * @since 3.4.3 * * @param string $html The HTML content. * @param bool $is_webp Whether supports webp. * @param bool $dryrun Whether to run in dry mode. * @return array Array of CSS and HTML. */ public function prepare_css( $html, $is_webp = false, $dryrun = false ) { $css = ''; preg_match_all('#<link ([^>]+)/?>|<style([^>]*)>([^<]+)</style>#isU', $html, $matches, PREG_SET_ORDER); foreach ($matches as $match) { $debug_info = ''; if (strpos($match[0], '<link') === 0) { $attrs = Utility::parse_attr($match[1]); if (empty($attrs['rel'])) { continue; } if ( 'stylesheet' !== $attrs['rel'] ) { if ( 'preload' !== $attrs['rel'] || empty( $attrs['as'] ) || 'style' !== $attrs['as'] ) { continue; } } if (!empty($attrs['media']) && strpos($attrs['media'], 'print') !== false) { continue; } if (empty($attrs['href'])) { continue; } // Check Google fonts hit if (strpos($attrs['href'], 'fonts.googleapis.com') !== false) { $html = str_replace($match[0], '', $html); continue; } $debug_info = $attrs['href']; // Load CSS content if (!$dryrun) { // Dryrun will not load CSS but just drop them $con = $this->cls('Optimizer')->load_file($attrs['href']); if (!$con) { continue; } } else { $con = ''; } } else { // Inline style $attrs = Utility::parse_attr($match[2]); if (!empty($attrs['media']) && strpos($attrs['media'], 'print') !== false) { continue; } Debug2::debug2('[CSS] Load inline CSS ' . substr($match[3], 0, 100) . '...', $attrs); $con = $match[3]; $debug_info = '__INLINE__'; } $con = Optimizer::minify_css($con); if ($is_webp && $this->cls('Media')->webp_support()) { $con = $this->cls('Media')->replace_background_webp($con); } if ( ! empty( $attrs['media'] ) && 'all' !== $attrs['media'] ) { $con = '@media ' . $attrs['media'] . '{' . $con . "}\n"; } else { $con = $con . "\n"; } $con = '/* ' . $debug_info . ' */' . $con; $css .= $con; $html = str_replace($match[0], '', $html); } return [ $css, $html ]; } /** * Filter the comment content, add quotes to selector from whitelist. Return the json * * @since 3.3 */ private function _filter_whitelist() { $whitelist = []; $list = apply_filters('litespeed_ucss_whitelist', $this->conf(self::O_OPTM_UCSS_SELECTOR_WHITELIST)); foreach ($list as $k => $v) { if (substr($v, 0, 2) === '//') { continue; } $whitelist[] = $v; } return $whitelist; } /** * Notify finished from server * * @since 5.1 */ public function notify() { $post_data = \json_decode( file_get_contents( 'php://input' ), true ); if ( is_null( $post_data ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- This is a callback from QUIC.cloud, verified by extract_msg() $post_data = $_POST; } self::debug('notify() data', $post_data); $this->_queue = $this->load_queue('ucss'); list($post_data) = $this->cls('Cloud')->extract_msg($post_data, 'ucss'); $notified_data = $post_data['data']; if (empty($notified_data) || !is_array($notified_data)) { self::debug('❌ notify exit: no notified data'); return Cloud::err('no notified data'); } // Check if its in queue or not $valid_i = 0; foreach ($notified_data as $v) { if (empty($v['request_url'])) { self::debug('❌ notify bypass: no request_url', $v); continue; } if (empty($v['queue_k'])) { self::debug('❌ notify bypass: no queue_k', $v); continue; } if (empty($this->_queue[$v['queue_k']])) { self::debug('❌ notify bypass: no this queue [q_k]' . $v['queue_k']); continue; } // Save data if (!empty($v['data_ucss'])) { $is_mobile = $this->_queue[$v['queue_k']]['is_mobile']; $is_webp = $this->_queue[$v['queue_k']]['is_webp']; $this->_save_con('ucss', $v['data_ucss'], $v['queue_k'], $is_mobile, $is_webp); ++$valid_i; } unset($this->_queue[$v['queue_k']]); self::debug('notify data handled, unset queue [q_k] ' . $v['queue_k']); } $this->save_queue('ucss', $this->_queue); self::debug('notified'); return Cloud::ok( [ 'count' => $valid_i ] ); } /** * Handle all request actions from main cls * * @since 2.3 * @access public */ public function handler() { $type = Router::verify_type(); switch ($type) { case self::TYPE_GEN: self::cron(true); break; case self::TYPE_CLEAR_Q: $this->clear_q('ucss'); break; default: break; } Admin::redirect(); } } src/cdn/cloudflare.cls.php 0000777 00000017634 15251157102 0011531 0 ustar 00 <?php /** * The cloudflare CDN class. * * @since 2.1 * @package LiteSpeed * @subpackage LiteSpeed/src/cdn * @author LiteSpeed Technologies <info@litespeedtech.com> */ namespace LiteSpeed\CDN; use LiteSpeed\Base; use LiteSpeed\Debug2; use LiteSpeed\Router; use LiteSpeed\Admin; use LiteSpeed\Admin_Display; defined('WPINC') || exit(); /** * Class Cloudflare * * @since 2.1 */ class Cloudflare extends Base { const TYPE_PURGE_ALL = 'purge_all'; const TYPE_GET_DEVMODE = 'get_devmode'; const TYPE_SET_DEVMODE_ON = 'set_devmode_on'; const TYPE_SET_DEVMODE_OFF = 'set_devmode_off'; const ITEM_STATUS = 'status'; /** * Update zone&name based on latest settings * * @since 3.0 * @access public */ public function try_refresh_zone() { if (!$this->conf(self::O_CDN_CLOUDFLARE)) { return; } $zone = $this->fetch_zone(); if ($zone) { $this->cls('Conf')->update(self::O_CDN_CLOUDFLARE_NAME, $zone['name']); $this->cls('Conf')->update(self::O_CDN_CLOUDFLARE_ZONE, $zone['id']); Debug2::debug("[Cloudflare] Get zone successfully \t\t[ID] " . $zone['id']); } else { $this->cls('Conf')->update(self::O_CDN_CLOUDFLARE_ZONE, ''); Debug2::debug('[Cloudflare] ❌ Get zone failed, clean zone'); } } /** * Get Cloudflare development mode * * @since 1.7.2 * @access private * @param bool $show_msg Whether to show success/error message. */ private function get_devmode( $show_msg = true ) { Debug2::debug('[Cloudflare] get_devmode'); $zone = $this->zone(); if (!$zone) { return; } $url = 'https://api.cloudflare.com/client/v4/zones/' . $zone . '/settings/development_mode'; $res = $this->cloudflare_call($url, 'GET', false, $show_msg); if (!$res) { return; } Debug2::debug('[Cloudflare] get_devmode result ', $res); // Make sure is array: #992174 $curr_status = self::get_option(self::ITEM_STATUS, array()); if ( ! is_array( $curr_status ) ) { $curr_status = array(); } $curr_status['devmode'] = $res['value']; $curr_status['devmode_expired'] = (int) $res['time_remaining'] + time(); // update status self::update_option(self::ITEM_STATUS, $curr_status); } /** * Set Cloudflare development mode * * @since 1.7.2 * @access private * @param string $type The type of development mode to set (on/off). */ private function set_devmode( $type ) { Debug2::debug('[Cloudflare] set_devmode'); $zone = $this->zone(); if (!$zone) { return; } $url = 'https://api.cloudflare.com/client/v4/zones/' . $zone . '/settings/development_mode'; $new_val = self::TYPE_SET_DEVMODE_ON === $type ? 'on' : 'off'; $data = array( 'value' => $new_val ); $res = $this->cloudflare_call($url, 'PATCH', $data); if (!$res) { return; } $res = $this->get_devmode(false); if ($res) { $msg = sprintf(__('Notified Cloudflare to set development mode to %s successfully.', 'litespeed-cache'), strtoupper($new_val)); Admin_Display::success($msg); } } /** * Shortcut to purge Cloudflare * * @since 7.1 * @access public * @param string|bool $reason The reason for purging, or false if none. */ public static function purge_all( $reason = false ) { if ($reason) { Debug2::debug('[Cloudflare] purge call because: ' . $reason); } self::cls()->purge_all_private(); } /** * Purge Cloudflare cache * * @since 1.7.2 * @access private */ private function purge_all_private() { Debug2::debug('[Cloudflare] purge_all_private'); $cf_on = $this->conf(self::O_CDN_CLOUDFLARE); if (!$cf_on) { $msg = __('Cloudflare API is set to off.', 'litespeed-cache'); Admin_Display::error($msg); return; } $zone = $this->zone(); if (!$zone) { return; } $url = 'https://api.cloudflare.com/client/v4/zones/' . $zone . '/purge_cache'; $data = array( 'purge_everything' => true ); $res = $this->cloudflare_call($url, 'DELETE', $data); if ($res) { $msg = __('Notified Cloudflare to purge all successfully.', 'litespeed-cache'); Admin_Display::success($msg); } } /** * Get current Cloudflare zone from cfg * * @since 1.7.2 * @access private */ private function zone() { $zone = $this->conf(self::O_CDN_CLOUDFLARE_ZONE); if (!$zone) { $msg = __('No available Cloudflare zone', 'litespeed-cache'); Admin_Display::error($msg); return false; } return $zone; } /** * Get Cloudflare zone settings * * @since 1.7.2 * @access private */ private function fetch_zone() { $kw = $this->conf(self::O_CDN_CLOUDFLARE_NAME); $url = 'https://api.cloudflare.com/client/v4/zones?status=active&match=all'; // Try exact match first if ($kw && false !== strpos($kw, '.')) { $zones = $this->cloudflare_call($url . '&name=' . $kw, 'GET', false, false); if ($zones) { Debug2::debug('[Cloudflare] fetch_zone exact matched'); return $zones[0]; } } // Can't find, try to get default one $zones = $this->cloudflare_call($url, 'GET', false, false); if (!$zones) { Debug2::debug('[Cloudflare] fetch_zone no zone'); return false; } if (!$kw) { Debug2::debug('[Cloudflare] fetch_zone no set name, use first one by default'); return $zones[0]; } foreach ($zones as $v) { if (false !== strpos($v['name'], $kw)) { Debug2::debug('[Cloudflare] fetch_zone matched ' . $kw . ' [name] ' . $v['name']); return $v; } } // Can't match current name, return default one Debug2::debug('[Cloudflare] fetch_zone failed match name, use first one by default'); return $zones[0]; } /** * Cloudflare API * * @since 1.7.2 * @access private * @param string $url The API URL to call. * @param string $method The HTTP method to use (GET, POST, etc.). * @param array|bool $data The data to send with the request, or false if none. * @param bool $show_msg Whether to show success/error message. */ private function cloudflare_call( $url, $method = 'GET', $data = false, $show_msg = true ) { Debug2::debug("[Cloudflare] cloudflare_call \t\t[URL] $url"); if (strlen($this->conf(self::O_CDN_CLOUDFLARE_KEY)) === 40) { $headers = array( 'Content-Type' => 'application/json', 'Authorization' => 'Bearer ' . $this->conf(self::O_CDN_CLOUDFLARE_KEY), ); } else { $headers = array( 'Content-Type' => 'application/json', 'X-Auth-Email' => $this->conf(self::O_CDN_CLOUDFLARE_EMAIL), 'X-Auth-Key' => $this->conf(self::O_CDN_CLOUDFLARE_KEY), ); } $wp_args = array( 'method' => $method, 'headers' => $headers, ); if ($data) { if (is_array($data)) { $data = wp_json_encode($data); } $wp_args['body'] = $data; } $resp = wp_remote_request($url, $wp_args); if (is_wp_error($resp)) { Debug2::debug('[Cloudflare] error in response'); if ($show_msg) { $msg = __('Failed to communicate with Cloudflare', 'litespeed-cache'); Admin_Display::error($msg); } return false; } $result = wp_remote_retrieve_body($resp); $json = \json_decode($result, true); if ($json && $json['success'] && $json['result']) { Debug2::debug('[Cloudflare] cloudflare_call called successfully'); if ($show_msg) { $msg = __('Communicated with Cloudflare successfully.', 'litespeed-cache'); Admin_Display::success($msg); } return $json['result']; } Debug2::debug("[Cloudflare] cloudflare_call called failed: $result"); if ($show_msg) { $msg = __('Failed to communicate with Cloudflare', 'litespeed-cache'); Admin_Display::error($msg); } return false; } /** * Handle all request actions from main cls * * @since 1.7.2 * @access public */ public function handler() { $type = Router::verify_type(); switch ($type) { case self::TYPE_PURGE_ALL: $this->purge_all_private(); break; case self::TYPE_GET_DEVMODE: $this->get_devmode(); break; case self::TYPE_SET_DEVMODE_ON: case self::TYPE_SET_DEVMODE_OFF: $this->set_devmode($type); break; default: break; } Admin::redirect(); } } src/cdn/quic.cls.php 0000777 00000006022 15251157102 0010337 0 ustar 00 <?php /** * The quic.cloud class. * * @since 2.4.1 * @package LiteSpeed * @subpackage LiteSpeed/src/cdn */ namespace LiteSpeed\CDN; use LiteSpeed\Cloud; use LiteSpeed\Base; defined('WPINC') || exit(); /** * Class Quic * * Handles Quic.cloud CDN integration. * * @since 2.4.1 */ class Quic extends Base { const LOG_TAG = '☁️'; const TYPE_REG = 'reg'; /** * Force sync flag. * * @var bool */ private $force = false; /** * Notify CDN new config updated * * Syncs configuration with Quic.cloud CDN. * * @since 2.4.1 * @access public * @param bool $force Whether to force sync. * @return bool|void */ public function try_sync_conf( $force = false ) { $cloud_summary = Cloud::get_summary(); if ($force) { $this->force = $force; } if (!$this->conf(self::O_CDN_QUIC)) { if (!empty($cloud_summary['conf_md5'])) { self::debug('❌ No QC CDN, clear conf md5!'); Cloud::save_summary(array( 'conf_md5' => '' )); } return false; } // Notice: Sync conf must be after `wp_loaded` hook, to get 3rd party vary injected (e.g. `woocommerce_cart_hash`). if (!did_action('wp_loaded')) { add_action('wp_loaded', array( $this, 'try_sync_conf' ), 999); self::debug('WP not loaded yet, delay sync to wp_loaded:999'); return; } $options = $this->get_options(); $options['_tp_cookies'] = apply_filters('litespeed_vary_cookies', array()); // Build necessary options only $options_needed = array( self::O_CACHE_DROP_QS, self::O_CACHE_EXC_COOKIES, self::O_CACHE_EXC_USERAGENTS, self::O_CACHE_LOGIN_COOKIE, self::O_CACHE_VARY_COOKIES, self::O_CACHE_MOBILE_RULES, self::O_CACHE_MOBILE, self::O_CACHE_BROWSER, self::O_CACHE_TTL_BROWSER, self::O_IMG_OPTM_WEBP, self::O_GUEST, '_tp_cookies', ); $consts_needed = array( 'LSWCP_TAG_PREFIX' ); $options_for_md5 = array(); foreach ($options_needed as $v) { if (isset($options[$v])) { $options_for_md5[$v] = $options[$v]; // Remove overflow multi lines fields if (is_array($options_for_md5[$v]) && count($options_for_md5[$v]) > 30) { $options_for_md5[$v] = array_slice($options_for_md5[$v], 0, 30); } } } $server_vars = $this->server_vars(); foreach ($consts_needed as $v) { if (isset($server_vars[$v])) { if (empty($options_for_md5['_server'])) { $options_for_md5['_server'] = array(); } $options_for_md5['_server'][$v] = $server_vars[$v]; } } $conf_md5 = md5(wp_json_encode($options_for_md5)); if (!empty($cloud_summary['conf_md5'])) { if ($conf_md5 === $cloud_summary['conf_md5']) { if (!$this->force) { self::debug('Bypass sync conf to QC due to same md5', $conf_md5); return; } self::debug('!!!Force sync conf even same md5'); } else { self::debug('[conf_md5] ' . $conf_md5 . ' [existing_conf_md5] ' . $cloud_summary['conf_md5']); } } Cloud::save_summary(array( 'conf_md5' => $conf_md5 )); self::debug('sync conf to QC'); Cloud::post(Cloud::SVC_D_SYNC_CONF, $options_for_md5); } } src/cloud.cls.php 0000777 00000203641 15251157102 0007746 0 ustar 00 <?php /** * Cloud service cls * * @package LiteSpeed * @since 3.0 */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Cloud * * Handles QUIC.cloud communication, node detection, activation, and related utilities. */ class Cloud extends Base { const LOG_TAG = '❄️'; /** * Base API server URL. * * @var string */ private $_cloud_server = 'https://api.quic.cloud'; /** * Cloud IPs endpoint. * * @var string */ private $_cloud_ips = 'https://quic.cloud/ips'; /** * Cloud dashboard URL. * * @var string */ private $_cloud_server_dash = 'https://my.quic.cloud'; /** * Cloud WP API server URL. * * @var string */ protected $_cloud_server_wp = 'https://wpapi.quic.cloud'; const SVC_D_ACTIVATE = 'd/activate'; const SVC_U_ACTIVATE = 'u/wp3/activate'; const SVC_D_ENABLE_CDN = 'd/enable_cdn'; const SVC_D_LINK = 'd/link'; const SVC_D_API = 'd/api'; const SVC_D_DASH = 'd/dash'; const SVC_D_V3UPGRADE = 'd/v3upgrade'; const SVC_U_LINK = 'u/wp3/link'; const SVC_U_ENABLE_CDN = 'u/wp3/enablecdn'; const SVC_D_STATUS_CDN_CLI = 'd/status/cdn_cli'; const SVC_D_NODES = 'd/nodes'; const SVC_D_SYNC_CONF = 'd/sync_conf'; const SVC_D_USAGE = 'd/usage'; const SVC_D_SETUP_TOKEN = 'd/get_token'; const SVC_D_DEL_CDN_DNS = 'd/del_cdn_dns'; const SVC_PAGE_OPTM = 'page_optm'; const SVC_CCSS = 'ccss'; const SVC_UCSS = 'ucss'; const SVC_VPI = 'vpi'; const SVC_LQIP = 'lqip'; const SVC_QUEUE = 'queue'; const SVC_IMG_OPTM = 'img_optm'; const SVC_HEALTH = 'health'; const SVC_CDN = 'cdn'; const IMG_OPTM_DEFAULT_GROUP = 200; const IMGOPTM_TAKEN = 'img_optm-taken'; const TTL_NODE = 3; // Days before node expired const EXPIRATION_REQ = 300; // Seconds of min interval between two unfinished requests const TTL_IPS = 3; // Days for node ip list cache const API_REPORT = 'wp/report'; const API_NEWS = 'news'; const API_VER = 'ver_check'; const API_BETA_TEST = 'beta_test'; const API_REST_ECHO = 'tool/wp_rest_echo'; const API_SERVER_KEY_SIGN = 'key_sign'; /** * Center services hosted at the central API server. * * @var string[] */ private static $center_svc_set = [ self::SVC_D_ACTIVATE, self::SVC_U_ACTIVATE, self::SVC_D_ENABLE_CDN, self::SVC_D_LINK, self::SVC_D_NODES, self::SVC_D_SYNC_CONF, self::SVC_D_USAGE, self::SVC_D_API, self::SVC_D_V3UPGRADE, self::SVC_D_DASH, self::SVC_D_STATUS_CDN_CLI, // self::API_NEWS, self::API_REPORT, // self::API_VER, // self::API_BETA_TEST, self::SVC_D_SETUP_TOKEN, self::SVC_D_DEL_CDN_DNS, ]; /** * Services hosted on the WP API server. * * @var string[] */ private static $wp_svc_set = [ self::API_NEWS, self::API_VER, self::API_BETA_TEST, self::API_REST_ECHO ]; /** * Public services that do not require an API key. * * @var string[] */ private static $_pub_svc_set = [ self::API_NEWS, self::API_REPORT, self::API_VER, self::API_BETA_TEST, self::API_REST_ECHO, self::SVC_D_V3UPGRADE, self::SVC_D_DASH ]; /** * Services that should go through the queue. * * @var string[] */ private static $_queue_svc_set = [ self::SVC_CCSS, self::SVC_UCSS, self::SVC_VPI ]; /** * Services that need load check. * * @var string[] */ public static $services_load_check = [ // self::SVC_CCSS, // self::SVC_UCSS, // self::SVC_VPI, self::SVC_LQIP, self::SVC_HEALTH, ]; /** * All supported services. * * @var string[] */ public static $services = [ self::SVC_IMG_OPTM, self::SVC_PAGE_OPTM, self::SVC_CCSS, self::SVC_UCSS, self::SVC_VPI, self::SVC_LQIP, self::SVC_CDN, self::SVC_HEALTH, // self::SVC_QUEUE, ]; const TYPE_CLEAR_PROMO = 'clear_promo'; const TYPE_REDETECT_CLOUD = 'redetect_cloud'; const TYPE_CLEAR_CLOUD = 'clear_cloud'; const TYPE_ACTIVATE = 'activate'; const TYPE_LINK = 'link'; const TYPE_ENABLE_CDN = 'enablecdn'; const TYPE_API = 'api'; const TYPE_SYNC_USAGE = 'sync_usage'; const TYPE_RESET = 'reset'; const TYPE_SYNC_STATUS = 'sync_status'; /** * Summary data for cloud interactions. * * @var array<string,mixed> */ protected $_summary; /** * Init * * @since 3.0 */ public function __construct() { $allowed_hosts = [ 'wpapi.quic.cloud' ]; if ( defined( 'LITESPEED_DEV' ) && constant( 'LITESPEED_DEV' ) ) { $allowed_hosts[] = 'my.preview.quic.cloud'; $allowed_hosts[] = 'api.preview.quic.cloud'; $this->_cloud_server = 'https://api.preview.quic.cloud'; $this->_cloud_ips = 'https://api.preview.quic.cloud/ips'; $this->_cloud_server_dash = 'https://my.preview.quic.cloud'; $this->_cloud_server_wp = 'https://wpapi.quic.cloud'; } else { $allowed_hosts[] = 'my.quic.cloud'; $allowed_hosts[] = 'api.quic.cloud'; } add_filter( 'allowed_redirect_hosts', function( $hosts ) use ( $allowed_hosts ) { if ( ! is_array ( $hosts ) ) { $hosts = []; } return array_merge( $hosts, $allowed_hosts ); } ); $this->_summary = self::get_summary(); } /** * Init QC setup preparation * * @since 7.0 */ public function init_qc_prepare() { if ( empty( $this->_summary['sk_b64'] ) ) { $keypair = sodium_crypto_sign_keypair(); $pk = base64_encode( sodium_crypto_sign_publickey( $keypair ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode $sk = base64_encode( sodium_crypto_sign_secretkey( $keypair ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode $this->_summary['pk_b64'] = $pk; $this->_summary['sk_b64'] = $sk; $this->save_summary(); // ATM `qc_activated` = null return true; } return false; } /** * Init QC setup * * @since 7.0 */ public function init_qc() { $this->init_qc_prepare(); $ref = $this->_get_ref_url(); // WPAPI REST echo dryrun $echobox = self::post( self::API_REST_ECHO, false, 60 ); if ( false === $echobox ) { self::debugErr( 'REST Echo Failed!' ); $msg = __( "QUIC.cloud's access to your WP REST API seems to be blocked.", 'litespeed-cache' ); Admin_Display::error( $msg ); wp_safe_redirect( $ref ); exit; } self::debug( 'echo succeeded' ); // Load separate thread echoed data from storage if ( empty( $echobox['wpapi_ts'] ) || empty( $echobox['wpapi_signature_b64'] ) ) { Admin_Display::error( __( 'Failed to get echo data from WPAPI', 'litespeed-cache' ) ); wp_safe_redirect( $ref ); exit; } $data = [ 'wp_pk_b64' => $this->_summary['pk_b64'], 'wpapi_ts' => $echobox['wpapi_ts'], 'wpapi_signature_b64' => $echobox['wpapi_signature_b64'], ]; $server_ip = $this->conf( self::O_SERVER_IP ); if ( $server_ip ) { $data['server_ip'] = $server_ip; } // Activation redirect $param = [ 'site_url' => site_url(), 'ver' => Core::VER, 'data' => $data, 'ref' => $ref, ]; wp_safe_redirect( $this->_cloud_server_dash . '/' . self::SVC_U_ACTIVATE . '?data=' . rawurlencode( Utility::arr2str( $param ) ) ); exit; } /** * Decide the ref * * @param string|false $ref Ref slug. * @return string */ private function _get_ref_url( $ref = false ) { $link = 'admin.php?page=litespeed'; if ( 'cdn' === $ref ) { $link = 'admin.php?page=litespeed-cdn'; } if ( 'online' === $ref ) { $link = 'admin.php?page=litespeed-general'; } // phpcs:ignore WordPress.Security.NonceVerification.Recommended $ref_get = ! empty( $_GET['ref'] ) ? sanitize_text_field( wp_unslash( $_GET['ref'] ) ) : ''; if ( $ref_get && 'cdn' === $ref_get ) { $link = 'admin.php?page=litespeed-cdn'; } if ( $ref_get && 'online' === $ref_get ) { $link = 'admin.php?page=litespeed-general'; } return get_admin_url( null, $link ); } /** * Init QC setup (CLI) * * @since 7.0 */ public function init_qc_cli() { $this->init_qc_prepare(); $server_ip = $this->conf( self::O_SERVER_IP ); if ( ! $server_ip ) { self::debugErr( 'Server IP needs to be set first!' ); $msg = sprintf( __( 'You need to set the %1$s first. Please use the command %2$s to set.', 'litespeed-cache' ), '`' . __( 'Server IP', 'litespeed-cache' ) . '`', '`wp litespeed-option set server_ip __your_ip_value__`' ); Admin_Display::error( $msg ); return; } // WPAPI REST echo dryrun $echobox = self::post( self::API_REST_ECHO, false, 60 ); if ( false === $echobox ) { self::debugErr( 'REST Echo Failed!' ); $msg = __( "QUIC.cloud's access to your WP REST API seems to be blocked.", 'litespeed-cache' ); Admin_Display::error( $msg ); return; } self::debug( 'echo succeeded' ); // Load separate thread echoed data from storage if ( empty( $echobox['wpapi_ts'] ) || empty( $echobox['wpapi_signature_b64'] ) ) { self::debug( 'Resp: ', $echobox ); Admin_Display::error( __( 'Failed to get echo data from WPAPI', 'litespeed-cache' ) ); return; } $data = [ 'wp_pk_b64' => $this->_summary['pk_b64'], 'wpapi_ts' => $echobox['wpapi_ts'], 'wpapi_signature_b64' => $echobox['wpapi_signature_b64'], 'server_ip' => $server_ip, ]; $res = $this->post( self::SVC_D_ACTIVATE, $data ); return $res; } /** * Init QC CDN setup (CLI) * * @since 7.0 * * @param string $method Method. * @param string|bool $cert Cert path. * @param string|bool $key Key path. * @param string|bool $cf_token Cloudflare token. */ public function init_qc_cdn_cli( $method, $cert = false, $key = false, $cf_token = false ) { if ( ! $this->activated() ) { Admin_Display::error( __( 'You need to activate QC first.', 'litespeed-cache' ) ); return; } $server_ip = $this->conf( self::O_SERVER_IP ); if ( ! $server_ip ) { self::debugErr( 'Server IP needs to be set first!' ); $msg = sprintf( __( 'You need to set the %1$s first. Please use the command %2$s to set.', 'litespeed-cache' ), '`' . __( 'Server IP', 'litespeed-cache' ) . '`', '`wp litespeed-option set server_ip __your_ip_value__`' ); Admin_Display::error( $msg ); return; } if ( $cert ) { if ( ! file_exists( $cert ) || ! file_exists( $key ) ) { Admin_Display::error( __( 'Cert or key file does not exist.', 'litespeed-cache' ) ); return; } } $data = [ 'method' => $method, 'server_ip' => $server_ip, ]; if ( $cert ) { $data['cert'] = File::read( $cert ); $data['key'] = File::read( $key ); } if ( $cf_token ) { $data['cf_token'] = $cf_token; } $res = $this->post( self::SVC_D_ENABLE_CDN, $data ); return $res; } /** * Link to QC setup * * @since 7.0 */ public function link_qc() { if ( ! $this->activated() ) { Admin_Display::error( __( 'You need to activate QC first.', 'litespeed-cache' ) ); return; } $data = [ 'wp_ts' => time(), ]; $data['wp_signature_b64'] = $this->_sign_b64( $data['wp_ts'] ); // Activation redirect $param = [ 'site_url' => site_url(), 'ver' => Core::VER, 'data' => $data, 'ref' => $this->_get_ref_url(), ]; wp_safe_redirect( $this->_cloud_server_dash . '/' . self::SVC_U_LINK . '?data=' . rawurlencode( Utility::arr2str( $param ) ) ); exit; } /** * Show QC Account CDN status * * @since 7.0 */ public function cdn_status_cli() { if ( ! $this->activated() ) { Admin_Display::error( __( 'You need to activate QC first.', 'litespeed-cache' ) ); return; } $data = []; $res = $this->post( self::SVC_D_STATUS_CDN_CLI, $data ); return $res; } /** * Link to QC Account for CLI * * @since 7.0 * * @param string $email Account email. * @param string $key API key. */ public function link_qc_cli( $email, $key ) { if ( ! $this->activated() ) { Admin_Display::error( __( 'You need to activate QC first.', 'litespeed-cache' ) ); return; } $data = [ 'qc_acct_email' => $email, 'qc_acct_apikey'=> $key, ]; $res = $this->post( self::SVC_D_LINK, $data ); return $res; } /** * API link parsed call to QC * * @since 7.0 * * @param string $action2 Action slug. */ public function api_link_call( $action2 ) { if ( ! $this->activated() ) { Admin_Display::error( __( 'You need to activate QC first.', 'litespeed-cache' ) ); return; } $data = [ 'action2' => $action2, ]; $res = $this->post( self::SVC_D_API, $data ); self::debug( 'API link call result: ', $res ); } /** * Enable QC CDN * * @since 7.0 */ public function enable_cdn() { if ( ! $this->activated() ) { Admin_Display::error( __( 'You need to activate QC first.', 'litespeed-cache' ) ); return; } $data = [ 'wp_ts' => time(), ]; $data['wp_signature_b64'] = $this->_sign_b64( $data['wp_ts'] ); // Activation redirect $param = [ 'site_url' => site_url(), 'ver' => Core::VER, 'data' => $data, 'ref' => $this->_get_ref_url(), ]; wp_safe_redirect( $this->_cloud_server_dash . '/' . self::SVC_U_ENABLE_CDN . '?data=' . rawurlencode( Utility::arr2str( $param ) ) ); exit; } /** * Encrypt data for cloud req * * @since 7.0 * * @param string|int $data Data to sign. * @return string|false */ private function _sign_b64( $data ) { if ( empty( $this->_summary['sk_b64'] ) ) { self::debugErr( 'No sk to sign.' ); return false; } $sk = base64_decode( $this->_summary['sk_b64'] ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode if ( strlen( $sk ) !== SODIUM_CRYPTO_SIGN_SECRETKEYBYTES ) { self::debugErr( 'Invalid local sign sk length.' ); // Reset local pk/sk unset( $this->_summary['pk_b64'] ); unset( $this->_summary['sk_b64'] ); $this->save_summary(); self::debug( 'Clear local sign pk/sk pair.' ); return false; } $signature = sodium_crypto_sign_detached( (string) $data, $sk ); return base64_encode( $signature ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode } /** * Load server pk from cloud * * @since 7.0 * * @param bool $from_wpapi Load from WP API server. * @return string|false Binary public key or false. */ private function _load_server_pk( $from_wpapi = false ) { // Load cloud pk $server_key_url = $this->_cloud_server . '/' . self::API_SERVER_KEY_SIGN; if ( $from_wpapi ) { $server_key_url = $this->_cloud_server_wp . '/' . self::API_SERVER_KEY_SIGN; } $resp = wp_safe_remote_get( $server_key_url ); if ( is_wp_error( $resp ) ) { self::debugErr( 'Failed to load key: ' . $resp->get_error_message() ); return false; } $pk = trim( $resp['body'] ); self::debug( 'Loaded key from ' . $server_key_url . ': ' . $pk ); $cloud_pk = base64_decode( $pk ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode if ( strlen( $cloud_pk ) !== SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES ) { self::debugErr( 'Invalid cloud public key length.' ); return false; } $sk = base64_decode( $this->_summary['sk_b64'] ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode if ( strlen( $sk ) !== SODIUM_CRYPTO_SIGN_SECRETKEYBYTES ) { self::debugErr( 'Invalid local secret key length.' ); // Reset local pk/sk unset( $this->_summary['pk_b64'] ); unset( $this->_summary['sk_b64'] ); $this->save_summary(); self::debug( 'Unset local pk/sk pair.' ); return false; } return $cloud_pk; } /** * WPAPI echo back to notify the sealed databox * * @since 7.0 */ public function wp_rest_echo() { // phpcs:ignore WordPress.Security.NonceVerification.Missing self::debug( 'Parsing echo', $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing $ts = !empty( $_POST['wpapi_ts'] ) ? sanitize_text_field( wp_unslash( $_POST['wpapi_ts'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing $sig = !empty( $_POST['wpapi_signature_b64'] ) ? sanitize_text_field( wp_unslash( $_POST['wpapi_signature_b64'] ) ) : ''; if ( empty( $ts ) || empty( $sig ) ) { return self::err( 'No echo data' ); } $is_valid = $this->_validate_signature( $sig, $ts, true ); if ( ! $is_valid ) { return self::err( 'Data validation from WPAPI REST Echo failed' ); } $diff = time() - (int) $ts; if ( abs( $diff ) > 86400 ) { self::debugErr( 'WPAPI echo data timeout [diff] ' . $diff ); return self::err( 'Echo data expired' ); } $signature_b64 = $this->_sign_b64( $ts ); self::debug( 'Response to echo [signature_b64] ' . $signature_b64 ); return self::ok( [ 'signature_b64' => $signature_b64 ] ); } /** * Validate cloud data * * @since 7.0 * * @param string $signature_b64 Base64 signature. * @param string $data Data to validate. * @param bool $from_wpapi Whether the signature is from WP API server. * @return bool */ private function _validate_signature( $signature_b64, $data, $from_wpapi = false ) { // Try validation try { $cloud_pk = $this->_load_server_pk( $from_wpapi ); if ( ! $cloud_pk ) { return false; } $signature = base64_decode( $signature_b64 ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode $is_valid = sodium_crypto_sign_verify_detached( $signature, (string) $data, $cloud_pk ); } catch ( \SodiumException $e ) { self::debugErr( 'Decryption failed: ' . esc_html( $e->getMessage() ) ); return false; } self::debug( 'Signature validation result: ' . ( $is_valid ? 'true' : 'false' ) ); return $is_valid; } /** * Finish qc activation after redirection back from QC * * @since 7.0 * * @param string|false $ref Ref slug. */ public function finish_qc_activation( $ref = false ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.NonceVerification.Recommended $qc_activated = !empty( $_GET['qc_activated'] ) ? sanitize_text_field( wp_unslash( $_GET['qc_activated'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.NonceVerification.Recommended $qc_ts = !empty( $_GET['qc_ts'] ) ? sanitize_text_field( wp_unslash( $_GET['qc_ts'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.NonceVerification.Recommended $qc_sig = !empty( $_GET['qc_signature_b64'] ) ? sanitize_text_field( wp_unslash( $_GET['qc_signature_b64'] ) ) : ''; if ( ! $qc_activated || ! $qc_ts || ! $qc_sig ) { return; } $data_to_validate_signature = [ 'wp_pk_b64' => $this->_summary['pk_b64'], 'qc_ts' => $qc_ts, ]; $is_valid = $this->_validate_signature( $qc_sig, implode( '', $data_to_validate_signature ) ); if ( ! $is_valid ) { self::debugErr( 'Failed to validate qc activation data' ); Admin_Display::error( sprintf( __( 'Failed to validate %s activation data.', 'litespeed-cache' ), 'QUIC.cloud' ) ); return; } self::debug( 'QC activation status: ' . $qc_activated ); if ( ! in_array( $qc_activated, [ 'anonymous', 'linked', 'cdn' ], true ) ) { self::debugErr( 'Failed to parse qc activation status' ); Admin_Display::error( sprintf( __( 'Failed to parse %s activation status.', 'litespeed-cache' ), 'QUIC.cloud' ) ); return; } $diff = time() - (int) $qc_ts; if ( abs( $diff ) > 86400 ) { self::debugErr( 'QC activation data timeout [diff] ' . $diff ); Admin_Display::error( sprintf( __( '%s activation data expired.', 'litespeed-cache' ), 'QUIC.cloud' ) ); return; } // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.NonceVerification.Recommended $main_domain = ! empty( $_GET['main_domain'] ) ? sanitize_text_field( wp_unslash( $_GET['main_domain'] ) ) : false; $this->update_qc_activation( $qc_activated, $main_domain ); wp_safe_redirect( $this->_get_ref_url( $ref ) ); exit; } /** * Finish qc activation process * * @since 7.0 * * @param string $qc_activated Activation status. * @param string|bool $main_domain Main domain. * @param bool $quite Quiet flag. */ public function update_qc_activation( $qc_activated, $main_domain = false, $quite = false ) { $this->_summary['qc_activated'] = $qc_activated; if ( $main_domain ) { $this->_summary['main_domain'] = $main_domain; } $this->save_summary(); $msg = sprintf( __( 'Congratulations, %s successfully set this domain up for the anonymous online services.', 'litespeed-cache' ), 'QUIC.cloud' ); if ( 'linked' === $qc_activated ) { $msg = sprintf( __( 'Congratulations, %s successfully set this domain up for the online services.', 'litespeed-cache' ), 'QUIC.cloud' ); // Sync possible partner info $this->sync_usage(); } if ( 'cdn' === $qc_activated ) { $msg = sprintf( __( 'Congratulations, %s successfully set this domain up for the online services with CDN service.', 'litespeed-cache' ), 'QUIC.cloud' ); // Turn on CDN option $this->cls( 'Conf' )->update_confs( [ self::O_CDN_QUIC => true ] ); } if ( ! $quite ) { Admin_Display::success( '🎊 ' . $msg ); } $this->_clear_reset_qc_reg_msg(); $this->clear_cloud(); } /** * Load QC status for dash usage. * Format to translate: `<a href="{#xxx#}" class="button button-primary">xxxx</a><a href="{#xxx#}">xxxx2</a>` * * @since 7.0 * * @param string $type Type. * @param bool $force Force refresh. * @return string */ public function load_qc_status_for_dash( $type, $force = false ) { return Str::translate_qc_apis( $this->_load_qc_status_for_dash( $type, $force ) ); } /** * Internal: load QC status HTML for dash. * * @param string $type Type. * @param bool $force Force refresh. * @return string */ private function _load_qc_status_for_dash( $type, $force = false ) { if ( ! $force && ! empty( $this->_summary['mini_html'] ) && isset( $this->_summary['mini_html'][ $type ] ) && ! empty( $this->_summary['mini_html'][ 'ttl.' . $type ] ) && $this->_summary['mini_html'][ 'ttl.' . $type ] > time() ) { return Str::safe_html( $this->_summary['mini_html'][ $type ] ); } // Try to update dash content $data = self::post( self::SVC_D_DASH, [ 'action2' => ( 'cdn_dash_mini' === $type ? 'cdn_dash' : $type ) ] ); if ( ! empty( $data['qc_activated'] ) ) { // Sync conf as changed if ( empty( $this->_summary['qc_activated'] ) || $this->_summary['qc_activated'] !== $data['qc_activated'] ) { $msg = sprintf( __( 'Congratulations, %s successfully set this domain up for the online services with CDN service.', 'litespeed-cache' ), 'QUIC.cloud' ); Admin_Display::success( '🎊 ' . $msg ); $this->_clear_reset_qc_reg_msg(); // Turn on CDN option $this->cls( 'Conf' )->update_confs( [ self::O_CDN_QUIC => true ] ); $this->cls( 'CDN\Quic' )->try_sync_conf( true ); } $this->_summary['qc_activated'] = $data['qc_activated']; $this->save_summary(); } // Show the info if ( isset( $this->_summary['mini_html'][ $type ] ) ) { return Str::safe_html( $this->_summary['mini_html'][ $type ] ); } return ''; } /** * Update QC status * * @since 7.0 */ public function update_cdn_status() { // phpcs:ignore WordPress.Security.NonceVerification.Missing $qc_activated = !empty( $_POST['qc_activated'] ) ? sanitize_text_field( wp_unslash( $_POST['qc_activated'] ) ) : ''; if ( !$qc_activated || ! in_array( $qc_activated, [ 'anonymous', 'linked', 'cdn', 'deleted' ], true ) ) { return self::err( 'lack_of_params' ); } self::debug( 'update_cdn_status request hash: ' . $qc_activated ); if ( 'deleted' === $qc_activated ) { $this->_reset_qc_reg(); } else { $this->_summary['qc_activated'] = $qc_activated; $this->save_summary(); } if ( 'cdn' === $qc_activated ) { $msg = sprintf( __( 'Congratulations, %s successfully set this domain up for the online services with CDN service.', 'litespeed-cache' ), 'QUIC.cloud' ); Admin_Display::success( '🎊 ' . $msg ); $this->_clear_reset_qc_reg_msg(); // Turn on CDN option $this->cls( 'Conf' )->update_confs( [ self::O_CDN_QUIC => true ] ); $this->cls( 'CDN\Quic' )->try_sync_conf( true ); } return self::ok( [ 'qc_activated' => $qc_activated ] ); } /** * Reset QC setup * * @since 7.0 */ public function reset_qc() { unset( $this->_summary['pk_b64'] ); unset( $this->_summary['sk_b64'] ); unset( $this->_summary['qc_activated'] ); if ( ! empty( $this->_summary['partner'] ) ) { unset( $this->_summary['partner'] ); } $this->save_summary(); self::debug( 'Clear local QC activation.' ); $this->clear_cloud(); Admin_Display::success( sprintf( __( 'Reset %s activation successfully.', 'litespeed-cache' ), 'QUIC.cloud' ) ); wp_safe_redirect( $this->_get_ref_url() ); exit; } /** * Show latest commit version always if is on dev * * @since 3.0 */ public function check_dev_version() { if ( ! preg_match( '/[^\d\.]/', Core::VER ) ) { return; } $last_check = empty( $this->_summary[ 'last_request.' . self::API_VER ] ) ? 0 : $this->_summary[ 'last_request.' . self::API_VER ]; if ( time() - $last_check > 86400 ) { $auto_v = self::version_check( 'dev' ); if ( ! empty( $auto_v['dev'] ) ) { self::save_summary( [ 'version.dev' => $auto_v['dev'] ] ); } } if ( empty( $this->_summary['version.dev'] ) ) { return; } self::debug( 'Latest dev version ' . $this->_summary['version.dev'] ); if ( version_compare( $this->_summary['version.dev'], Core::VER, '<=' ) ) { return; } // Show the dev banner require_once LSCWP_DIR . 'tpl/banner/new_version_dev.tpl.php'; } /** * Check latest version * * @since 2.9 * @access public * * @param string|false $src Source. * @return mixed */ public static function version_check( $src = false ) { $req_data = [ 'v' => defined( 'LSCWP_CUR_V' ) ? LSCWP_CUR_V : '', 'src' => $src, 'php' => phpversion(), ]; // If code ver is smaller than db ver, bypass if ( ! empty( $req_data['v'] ) && version_compare( Core::VER, $req_data['v'], '<' ) ) { return; } if ( defined( 'LITESPEED_ERR' ) ) { $litespeed_err = constant( 'LITESPEED_ERR' ); $req_data['err'] = base64_encode( ! is_string( $litespeed_err ) ? wp_json_encode( $litespeed_err ) : $litespeed_err ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode } $data = self::post( self::API_VER, $req_data ); return $data; } /** * Show latest news * * @since 3.0 */ public function news() { $this->_update_news(); if ( empty( $this->_summary['news.new'] ) ) { return; } if ( ! empty( $this->_summary['news.plugin'] ) && Activation::cls()->dash_notifier_is_plugin_active( $this->_summary['news.plugin'] ) ) { return; } require_once LSCWP_DIR . 'tpl/banner/cloud_news.tpl.php'; } /** * Update latest news * * @since 2.9.9.1 */ private function _update_news() { if ( ! empty( $this->_summary['news.utime'] ) && time() - (int) $this->_summary['news.utime'] < 86400 * 7 ) { return; } self::save_summary( [ 'news.utime' => time() ] ); $data = self::get( self::API_NEWS ); if ( empty( $data['id'] ) ) { return; } // Save news if ( ! empty( $this->_summary['news.id'] ) && (string) $this->_summary['news.id'] === (string) $data['id'] ) { return; } $this->_summary['news.id'] = $data['id']; $this->_summary['news.plugin'] = ! empty( $data['plugin'] ) ? $data['plugin'] : ''; $this->_summary['news.title'] = ! empty( $data['title'] ) ? $data['title'] : ''; $this->_summary['news.content'] = ! empty( $data['content'] ) ? $data['content'] : ''; $this->_summary['news.zip'] = ! empty( $data['zip'] ) ? $data['zip'] : ''; $this->_summary['news.new'] = 1; if ( $this->_summary['news.plugin'] ) { $plugin_info = Activation::cls()->dash_notifier_get_plugin_info( $this->_summary['news.plugin'] ); if ( $plugin_info && ! empty( $plugin_info->name ) ) { $this->_summary['news.plugin_name'] = $plugin_info->name; } } self::save_summary(); } /** * Check if contains a package in a service or not * * @since 4.0 * * @param string $service Service. * @param int $pkg Package flag. * @return bool */ public function has_pkg( $service, $pkg ) { if ( ! empty( $this->_summary[ 'usage.' . $service ]['pkgs'] ) && ( $this->_summary[ 'usage.' . $service ]['pkgs'] & $pkg ) ) { return true; } return false; } /** * Get allowance of current service * * @since 3.0 * @access private * * @param string $service Service. * @param string|bool $err Error code by ref. * @return int */ public function allowance( $service, &$err = false ) { // Only auto sync usage at most one time per day if ( empty( $this->_summary[ 'last_request.' . self::SVC_D_USAGE ] ) || time() - (int) $this->_summary[ 'last_request.' . self::SVC_D_USAGE ] > 86400 ) { $this->sync_usage(); } if ( in_array( $service, [ self::SVC_CCSS, self::SVC_UCSS, self::SVC_VPI ], true ) ) { // @since 4.2 $service = self::SVC_PAGE_OPTM; } if ( empty( $this->_summary[ 'usage.' . $service ] ) ) { return 0; } $usage = $this->_summary[ 'usage.' . $service ]; // Image optm is always free $allowance_max = 0; if ( self::SVC_IMG_OPTM === $service ) { $allowance_max = self::IMG_OPTM_DEFAULT_GROUP; } $allowance = (int) $usage['quota'] - (int) $usage['used']; $err = 'out_of_quota'; if ( $allowance > 0 ) { if ( $allowance_max && $allowance_max < $allowance ) { $allowance = $allowance_max; } // Daily limit @since 4.2 if ( isset( $usage['remaining_daily_quota'] ) && $usage['remaining_daily_quota'] >= 0 && $usage['remaining_daily_quota'] < $allowance ) { $allowance = $usage['remaining_daily_quota']; if ( ! $allowance ) { $err = 'out_of_daily_quota'; } } return $allowance; } // Check Pay As You Go balance if ( empty( $usage['pag_bal'] ) ) { return $allowance_max; } if ( $allowance_max && $allowance_max < $usage['pag_bal'] ) { return $allowance_max; } return (int) $usage['pag_bal']; } /** * Sync Cloud usage summary data * * @since 3.0 * @access public */ public function sync_usage() { $usage = $this->_post( self::SVC_D_USAGE ); if ( ! $usage ) { return; } self::debug( 'sync_usage ' . wp_json_encode( $usage ) ); foreach ( self::$services as $v ) { $this->_summary[ 'usage.' . $v ] = ! empty( $usage[ $v ] ) ? $usage[ $v ] : false; } self::save_summary(); return $this->_summary; } /** * Clear all existing cloud nodes for future reconnect * * @since 3.0 * @access public */ public function clear_cloud() { foreach ( self::$services as $service ) { if ( isset( $this->_summary[ 'server.' . $service ] ) ) { unset( $this->_summary[ 'server.' . $service ] ); } if ( isset( $this->_summary[ 'server_date.' . $service ] ) ) { unset( $this->_summary[ 'server_date.' . $service ] ); } } self::save_summary(); self::debug( 'Cleared all local service node caches' ); } /** * Ping clouds to find the fastest node * * @since 3.0 * @access public * * @param string $service Service. * @param bool $force Force redetect. * @return string|false */ public function detect_cloud( $service, $force = false ) { if ( in_array( $service, self::$center_svc_set, true ) ) { return $this->_cloud_server; } if ( in_array( $service, self::$wp_svc_set, true ) ) { return $this->_cloud_server_wp; } // Check if the stored server needs to be refreshed if ( ! $force ) { if ( ! empty( $this->_summary[ 'server.' . $service ] ) && ! empty( $this->_summary[ 'server_date.' . $service ] ) && (int) $this->_summary[ 'server_date.' . $service ] > time() - 86400 * self::TTL_NODE ) { $server = $this->_summary[ 'server.' . $service ]; if ( false === strpos( $this->_cloud_server, 'preview.' ) && false === strpos( $server, 'preview.' ) ) { return $server; } if ( false !== strpos( $this->_cloud_server, 'preview.' ) && false !== strpos( $server, 'preview.' ) ) { return $server; } } } if ( ! $service || ! in_array( $service, self::$services, true ) ) { $msg = __( 'Cloud Error', 'litespeed-cache' ) . ': ' . $service; Admin_Display::error( $msg ); return false; } // Send request to Quic Online Service $json = $this->_post( self::SVC_D_NODES, [ 'svc' => $this->_maybe_queue( $service ) ] ); // Check if get list correctly if ( empty( $json['list'] ) || ! is_array( $json['list'] ) ) { self::debug( 'request cloud list failed: ', $json ); if ( $json ) { $msg = __( 'Cloud Error', 'litespeed-cache' ) . ": [Service] $service [Info] " . wp_json_encode( $json ); Admin_Display::error( $msg ); } return false; } // Ping closest cloud $valid_clouds = false; if ( ! empty( $json['list_preferred'] ) ) { $valid_clouds = $this->_get_closest_nodes( $json['list_preferred'], $service ); } if ( ! $valid_clouds ) { $valid_clouds = $this->_get_closest_nodes( $json['list'], $service ); } if ( ! $valid_clouds ) { return false; } // Check server load if ( in_array( $service, self::$services_load_check, true ) ) { // TODO $valid_cloud_loads = []; foreach ( $valid_clouds as $v ) { $response = wp_safe_remote_get( $v, [ 'timeout' => 5 ] ); if ( is_wp_error( $response ) ) { $error_message = $response->get_error_message(); self::debug( 'failed to do load checker: ' . $error_message ); continue; } $curr_load = \json_decode( $response['body'], true ); if ( ! empty( $curr_load['_res'] ) && 'ok' === $curr_load['_res'] && isset( $curr_load['load'] ) ) { $valid_cloud_loads[ $v ] = $curr_load['load']; } } if ( ! $valid_cloud_loads ) { $msg = __( 'Cloud Error', 'litespeed-cache' ) . ": [Service] $service [Info] " . __( 'No available Cloud Node after checked server load.', 'litespeed-cache' ); Admin_Display::error( $msg ); return false; } self::debug( 'Closest nodes list after load check', $valid_cloud_loads ); $qualified_list = array_keys( $valid_cloud_loads, min( $valid_cloud_loads ), true ); } else { $qualified_list = $valid_clouds; } $closest = $qualified_list[ array_rand( $qualified_list ) ]; self::debug( 'Chose node: ' . $closest ); // store data into option locally $this->_summary[ 'server.' . $service ] = $closest; $this->_summary[ 'server_date.' . $service ] = time(); self::save_summary(); return $this->_summary[ 'server.' . $service ]; } /** * Ping to choose the closest nodes * * @since 7.0 * * @param array $nodes_list Node list. * @param string $service Service. * @return array|false */ private function _get_closest_nodes( $nodes_list, $service ) { $speed_list = []; foreach ( $nodes_list as $v ) { // Exclude possible failed 503 nodes if ( ! empty( $this->_summary['disabled_node'] ) && ! empty( $this->_summary['disabled_node'][ $v ] ) && time() - (int) $this->_summary['disabled_node'][ $v ] < 86400 ) { continue; } $speed_list[ $v ] = Utility::ping( $v ); } if ( ! $speed_list ) { self::debug( 'nodes are in 503 failed nodes' ); return false; } $min = min( $speed_list ); if ( 99999 === (int) $min ) { self::debug( 'failed to ping all clouds' ); return false; } // Random pick same time range ip (230ms 250ms) $range_len = strlen( $min ); $range_num = substr( $min, 0, 1 ); $valid_clouds = []; foreach ( $speed_list as $node => $speed ) { if ( strlen( $speed ) === $range_len && substr( $speed, 0, 1 ) === $range_num ) { $valid_clouds[] = $node; } elseif ( $speed < $min * 4 ) { // Append the lower speed ones $valid_clouds[] = $node; } } if ( ! $valid_clouds ) { $msg = __( 'Cloud Error', 'litespeed-cache' ) . ": [Service] $service [Info] " . __( 'No available Cloud Node.', 'litespeed-cache' ); Admin_Display::error( $msg ); return false; } self::debug( 'Closest nodes list', $valid_clouds ); return $valid_clouds; } /** * May need to convert to queue service * * @param string $service Service. * @return string */ private function _maybe_queue( $service ) { if ( in_array( $service, self::$_queue_svc_set, true ) ) { return self::SVC_QUEUE; } return $service; } /** * Get data from QUIC cloud server * * @since 3.0 * @access public * * @param string $service Service. * @param array $data Data. * @return mixed */ public static function get( $service, $data = [] ) { $instance = self::cls(); return $instance->_get( $service, $data ); } /** * Get data from QUIC cloud server (private) * * @since 3.0 * @access private * * @param string $service Service. * @param array|bool $data Data array or false to omit. * @return mixed */ private function _get( $service, $data = false ) { $service_tag = $service; if ( ! empty( $data['action'] ) ) { $service_tag .= '-' . $data['action']; } $maybe_cloud = $this->_maybe_cloud( $service_tag ); if ( ! $maybe_cloud || 'svc_hot' === $maybe_cloud ) { return $maybe_cloud; } $server = $this->detect_cloud( $service ); if ( ! $server ) { return; } $url = $server . '/' . $service; $param = [ 'site_url' => site_url(), 'main_domain'=> ! empty( $this->_summary['main_domain'] ) ? $this->_summary['main_domain'] : '', 'ver' => Core::VER, ]; if ( $data ) { $param['data'] = $data; } $url .= '?' . http_build_query( $param ); self::debug( 'getting from : ' . $url ); self::save_summary( [ 'curr_request.' . $service_tag => time() ] ); File::save( $this->_qc_time_file( $service_tag, 'curr' ), time(), true ); $response = wp_safe_remote_get( $url, [ 'timeout' => 15, 'headers' => [ 'Accept' => 'application/json' ], ] ); return $this->_parse_response( $response, $service, $service_tag, $server ); } /** * Check if is able to do cloud request or not * * @since 3.0 * @access private * * @param string $service_tag Service tag. * @return bool|string */ private function _maybe_cloud( $service_tag ) { $site_url = site_url(); if ( ! wp_http_validate_url( $site_url ) ) { self::debug( 'wp_http_validate_url failed: ' . $site_url ); return false; } // Deny if is IP if ( preg_match( '#^(([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)\.){3}([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)$#', Utility::parse_url_safe( $site_url, PHP_URL_HOST ) ) ) { self::debug( 'IP home url is not allowed for cloud service.' ); $msg = __( 'In order to use QC services, need a real domain name, cannot use an IP.', 'litespeed-cache' ); Admin_Display::error( $msg ); return false; } // If in valid err_domains, bypass request if ( $this->_is_err_domain( $site_url ) ) { self::debug( 'home url is in err_domains, bypass request: ' . $site_url ); return false; } // we don't want the `img_optm-taken` to fail at any given time if ( self::IMGOPTM_TAKEN === $service_tag ) { return true; } if ( self::SVC_D_SYNC_CONF === $service_tag && ! $this->activated() ) { self::debug( 'Skip sync conf as QC not activated yet.' ); return false; } // Check TTL if ( ! empty( $this->_summary[ 'ttl.' . $service_tag ] ) ) { $ttl = (int) $this->_summary[ 'ttl.' . $service_tag ] - time(); if ( $ttl > 0 ) { self::debug( '❌ TTL limit. [srv] ' . $service_tag . ' [TTL cool down] ' . $ttl . ' seconds' ); return 'svc_hot'; } } $expiration_req = self::EXPIRATION_REQ; // Limit frequent unfinished request to 5min $timestamp_tag = 'curr'; if ( self::SVC_IMG_OPTM . '-' . Img_Optm::TYPE_NEW_REQ === $service_tag ) { $timestamp_tag = 'last'; } // For all other requests, if is under debug mode, will always allow if ( ! $this->conf( self::O_DEBUG ) ) { if ( ! empty( $this->_summary[ $timestamp_tag . '_request.' . $service_tag ] ) ) { $expired = (int) $this->_summary[ $timestamp_tag . '_request.' . $service_tag ] + $expiration_req - time(); if ( $expired > 0 ) { self::debug( '❌ try [' . $service_tag . '] after ' . $expired . ' seconds' ); if ( self::API_VER !== $service_tag ) { $msg = __( 'Cloud Error', 'litespeed-cache' ) . ': ' . sprintf( __( 'Please try after %1$s for service %2$s.', 'litespeed-cache' ), Utility::readable_time( $expired, 0, true ), '<code>' . $service_tag . '</code>' ); Admin_Display::error( [ 'cloud_trylater' => $msg ] ); } return false; } } else { // May fail to store to db if db is oc cached/dead/locked/readonly. Need to store to file to prevent from duplicate calls $file_path = $this->_qc_time_file( $service_tag, $timestamp_tag ); if ( file_exists( $file_path ) ) { $last_request = File::read( $file_path ); $expired = (int) $last_request + $expiration_req * 10 - time(); if ( $expired > 0 ) { self::debug( '❌ try [' . $service_tag . '] after ' . $expired . ' seconds' ); return false; } } // For ver check, additional check to prevent frequent calls as old DB ver may be cached if ( self::API_VER === $service_tag ) { $file_path = $this->_qc_time_file( $service_tag ); if ( file_exists( $file_path ) ) { $last_request = File::read( $file_path ); $expired = (int) $last_request + $expiration_req * 10 - time(); if ( $expired > 0 ) { self::debug( '❌❌ Unusual req! try [' . $service_tag . '] after ' . $expired . ' seconds' ); return false; } } } } } if ( in_array( $service_tag, self::$_pub_svc_set, true ) ) { return true; } if ( ! $this->activated() && self::SVC_D_ACTIVATE !== $service_tag ) { Admin_Display::error( Error::msg( 'qc_setup_required' ) ); return false; } return true; } /** * Get QC req ts file path * * @since 7.5 * * @param string $service_tag Service tag. * @param string $type Type: 'last' or 'curr'. * @return string */ private function _qc_time_file( $service_tag, $type = 'last' ) { if ( 'curr' !== $type ) { $type = 'last'; } $legacy_file = LITESPEED_STATIC_DIR . '/qc_' . $type . '_request' . md5( $service_tag ); if ( file_exists( $legacy_file ) ) { wp_delete_file( $legacy_file ); } $service_tag = preg_replace( '/[^a-zA-Z0-9]/', '', $service_tag ); return LITESPEED_STATIC_DIR . '/qc.' . $type . '.' . $service_tag; } /** * Check if a service tag ttl is valid or not * * @since 7.1 * * @param string $service_tag Service tag. * @return int|false Seconds remaining or false if not hot. */ public function service_hot( $service_tag ) { if ( empty( $this->_summary[ 'ttl.' . $service_tag ] ) ) { return false; } $ttl = (int) $this->_summary[ 'ttl.' . $service_tag ] - time(); if ( $ttl <= 0 ) { return false; } return $ttl; } /** * Check if activated QUIC.cloud service or not * * @since 7.0 * @access public */ public function activated() { return ! empty( $this->_summary['sk_b64'] ) && ! empty( $this->_summary['qc_activated'] ); } /** * Show my.qc quick link to the domain page * * @return string */ public function qc_link() { $data = [ 'site_url' => site_url(), 'ver' => LSCWP_V, 'ref' => $this->_get_ref_url(), ]; return $this->_cloud_server_dash . '/u/wp3/manage?data=' . rawurlencode( Utility::arr2str( $data ) ); // . (!empty($this->_summary['is_linked']) ? '?wplogin=1' : ''); } /** * Post data to QUIC.cloud server * * @since 3.0 * @access public * * @param string $service Service name/route. * @param array|bool $data Payload data or false to omit. * @param int|false $time_out Timeout seconds or false for default. * @return mixed Response payload or false on failure. */ public static function post( $service, $data = false, $time_out = false ) { $instance = self::cls(); return $instance->_post( $service, $data, $time_out ); } /** * Post data to cloud server * * @since 3.0 * @access private * * @param string $service Service name/route. * @param array|bool $data Payload data or false to omit. * @param int|false $time_out Timeout seconds or false for default. * @return mixed Response payload or false on failure. */ private function _post( $service, $data = false, $time_out = false ) { $service_tag = $service; if ( ! empty( $data['action'] ) ) { $service_tag .= '-' . $data['action']; } $maybe_cloud = $this->_maybe_cloud( $service_tag ); if ( ! $maybe_cloud || 'svc_hot' === $maybe_cloud ) { self::debug( 'Maybe cloud failed: ' . wp_json_encode( $maybe_cloud ) ); return $maybe_cloud; } $server = $this->detect_cloud( $service ); if ( ! $server ) { return; } $url = $server . '/' . $this->_maybe_queue( $service ); self::debug( 'posting to : ' . $url ); if ( $data ) { $data['service_type'] = $service; // For queue distribution usage } // Encrypt service as signature // $signature_ts = time(); // $sign_data = [ // 'service_tag' => $service_tag, // 'ts' => $signature_ts, // ]; // $data['signature_b64'] = $this->_sign_b64(implode('', $sign_data)); // $data['signature_ts'] = $signature_ts; self::debug( 'data', $data ); $param = [ 'site_url' => site_url(), // Need to use site_url() as WPML case may change home_url() for diff langs (no need to treat as alias for multi langs) 'main_domain' => ! empty( $this->_summary['main_domain'] ) ? $this->_summary['main_domain'] : '', 'wp_pk_b64' => ! empty( $this->_summary['pk_b64'] ) ? $this->_summary['pk_b64'] : '', 'ver' => Core::VER, 'data' => $data, ]; self::save_summary( [ 'curr_request.' . $service_tag => time() ] ); File::save( $this->_qc_time_file( $service_tag, 'curr' ), time(), true ); $response = wp_safe_remote_post( $url, [ 'body' => $param, 'timeout' => $time_out ? $time_out : 30, 'headers' => [ 'Accept' => 'application/json', 'Expect' => '', ], ] ); return $this->_parse_response( $response, $service, $service_tag, $server ); } /** * Parse response JSON * Mark the request successful if the response status is ok * * @since 3.0 * * @param array|mixed $response WP HTTP API response. * @param string $service Service name. * @param string $service_tag Service tag including action. * @param string $server Server URL. * @return array|false Parsed JSON array or false on failure. */ private function _parse_response( $response, $service, $service_tag, $server ) { // If show the error or not if failed $visible_err = self::API_VER !== $service && self::API_NEWS !== $service && self::SVC_D_DASH !== $service; if ( is_wp_error( $response ) ) { $error_message = $response->get_error_message(); self::debug( 'failed to request: ' . $error_message ); if ( $visible_err ) { $msg = esc_html__( 'Failed to request via WordPress', 'litespeed-cache' ) . ': ' . esc_html( $error_message ) . ' [server] ' . esc_html( $server ) . ' [service] ' . esc_html( $service ); Admin_Display::error( $msg ); // Tmp disabled this node from reusing in 1 day if ( empty( $this->_summary['disabled_node'] ) ) { $this->_summary['disabled_node'] = []; } $this->_summary['disabled_node'][ $server ] = time(); self::save_summary(); // Force redetect node self::debug( 'Node error, redetecting node [svc] ' . $service ); $this->detect_cloud( $service, true ); } return false; } $json = \json_decode( $response['body'], true ); if ( ! is_array( $json ) ) { self::debugErr( 'failed to decode response json: ' . $response['body'] ); if ( $visible_err ) { $msg = esc_html__( 'Failed to request via WordPress', 'litespeed-cache' ) . ': ' . esc_html( $response['body'] ) . ' [server] ' . esc_html( $server ) . ' [service] ' . esc_html( $service ); Admin_Display::error( $msg ); // Tmp disabled this node from reusing in 1 day if ( empty( $this->_summary['disabled_node'] ) ) { $this->_summary['disabled_node'] = []; } $this->_summary['disabled_node'][ $server ] = time(); self::save_summary(); // Force redetect node self::debugErr( 'Node error, redetecting node [svc] ' . $service ); $this->detect_cloud( $service, true ); } return false; } // Check and save TTL data if ( ! empty( $json['_ttl'] ) ) { $ttl = (int) $json['_ttl']; self::debug( 'Service TTL to save: ' . $ttl ); if ( $ttl > 0 && $ttl < 86400 ) { self::save_summary([ 'ttl.' . $service_tag => $ttl + time(), ]); } } if ( ! empty( $json['_code'] ) ) { self::debugErr( 'Hit err _code: ' . $json['_code'] ); if ( 'unpulled_images' === $json['_code'] ) { $msg = __( 'Cloud server refused the current request due to unpulled images. Please pull the images first.', 'litespeed-cache' ); Admin_Display::error( $msg ); return false; } if ( 'blocklisted' === $json['_code'] ) { $msg = __( 'Your domain_key has been temporarily blocklisted to prevent abuse. You may contact support at QUIC.cloud to learn more.', 'litespeed-cache' ); Admin_Display::error( $msg ); return false; } if ( 'rate_limit' === $json['_code'] ) { self::debugErr( 'Cloud server rate limit exceeded.' ); $msg = __( 'Cloud server refused the current request due to rate limiting. Please try again later.', 'litespeed-cache' ); Admin_Display::error( $msg ); return false; } if ( 'heavy_load' === $json['_code'] || 'redetect_node' === $json['_code'] ) { // Force redetect node self::debugErr( 'Node redetecting node [svc] ' . $service ); Admin_Display::info( __( 'Redetected node', 'litespeed-cache' ) . ': ' . Error::msg( $json['_code'] ) ); $this->detect_cloud( $service, true ); } } if ( ! empty( $json['_503'] ) ) { self::debugErr( 'service 503 unavailable temporarily. ' . $json['_503'] ); $msg = __( 'We are working hard to improve your online service experience. The service will be unavailable while we work. We apologize for any inconvenience.', 'litespeed-cache' ); $msg .= ' ' . $json['_503'] . ' [server] ' . esc_html( $server ) . ' [service] ' . esc_html( $service ); Admin_Display::error( $msg ); // Force redetect node self::debugErr( 'Node error, redetecting node [svc] ' . $service ); $this->detect_cloud( $service, true ); return false; } list( $json, $return ) = $this->extract_msg( $json, $service, $server ); if ( $return ) { return false; } $curr_request = $this->_summary[ 'curr_request.' . $service_tag ]; self::save_summary([ 'last_request.' . $service_tag => $curr_request, 'curr_request.' . $service_tag => 0, ]); File::save( $this->_qc_time_file( $service_tag ), $curr_request, true ); File::save( $this->_qc_time_file( $service_tag, 'curr' ), 0, true ); if ( $json ) { self::debug2( 'response ok', $json ); } else { self::debug2( 'response ok' ); } // Only successful request return Array return $json; } /** * Extract msg from json * * @since 5.0 * * @param array $json Response JSON. * @param string $service Service name. * @param string|bool $server Server URL or false. * @param bool $is_callback Whether called from callback context. * @return array Array with [json array, bool should_return_false] */ public function extract_msg( $json, $service, $server = false, $is_callback = false ) { if ( ! empty( $json['_info'] ) ) { self::debug( '_info: ' . $json['_info'] ); $msg = __( 'Message from QUIC.cloud server', 'litespeed-cache' ) . ': ' . $json['_info']; $msg .= $this->_parse_link( $json ); Admin_Display::info( $msg ); unset( $json['_info'] ); } if ( ! empty( $json['_note'] ) ) { self::debug( '_note: ' . $json['_note'] ); $msg = __( 'Message from QUIC.cloud server', 'litespeed-cache' ) . ': ' . $json['_note']; $msg .= $this->_parse_link( $json ); Admin_Display::note( $msg ); unset( $json['_note'] ); } if ( ! empty( $json['_success'] ) ) { self::debug( '_success: ' . $json['_success'] ); $msg = __( 'Good news from QUIC.cloud server', 'litespeed-cache' ) . ': ' . $json['_success']; $msg .= $this->_parse_link( $json ); Admin_Display::success( $msg ); unset( $json['_success'] ); } // Upgrade is required if ( ! empty( $json['_err_req_v'] ) ) { self::debug( '_err_req_v: ' . $json['_err_req_v'] ); $msg = sprintf( __( '%1$s plugin version %2$s required for this action.', 'litespeed-cache' ), Core::NAME, 'v' . $json['_err_req_v'] . '+' ) . ' [server] ' . esc_html( $server ) . ' [service] ' . esc_html( $service ); // Append upgrade link $msg2 = ' ' . GUI::plugin_upgrade_link( Core::NAME, Core::PLUGIN_NAME, $json['_err_req_v'] ); $msg2 .= $this->_parse_link( $json ); Admin_Display::error( $msg . $msg2 ); return [ $json, true ]; } // Parse _carry_on info if ( ! empty( $json['_carry_on'] ) ) { self::debug( 'Carry_on usage', $json['_carry_on'] ); // Store generic info foreach ( [ 'usage', 'promo', 'mini_html', 'partner', '_error', '_info', '_note', '_success' ] as $v ) { if ( isset( $json['_carry_on'][ $v ] ) ) { switch ( $v ) { case 'usage': $usage_svc_tag = in_array( $service, [ self::SVC_CCSS, self::SVC_UCSS, self::SVC_VPI ], true ) ? self::SVC_PAGE_OPTM : $service; $this->_summary[ 'usage.' . $usage_svc_tag ] = $json['_carry_on'][ $v ]; break; case 'promo': if ( empty( $this->_summary[ $v ] ) || ! is_array( $this->_summary[ $v ] ) ) { $this->_summary[ $v ] = []; } $this->_summary[ $v ][] = $json['_carry_on'][ $v ]; break; case 'mini_html': foreach ( $json['_carry_on'][ $v ] as $k2 => $v2 ) { if ( 0 === strpos( $k2, 'ttl.' ) ) { $v2 += time(); } $this->_summary[ $v ][ $k2 ] = $v2; } break; case 'partner': $this->_summary[ $v ] = $json['_carry_on'][ $v ]; break; case '_error': case '_info': case '_note': case '_success': $color_mode = substr( $v, 1 ); $msgs = $json['_carry_on'][ $v ]; Admin_Display::add_unique_notice( $color_mode, $msgs, true ); break; default: break; } } } self::save_summary(); unset( $json['_carry_on'] ); } // Parse general error msg if ( ! $is_callback && ( empty( $json['_res'] ) || 'ok' !== $json['_res'] ) ) { $json_msg = ! empty( $json['_msg'] ) ? $json['_msg'] : 'unknown'; self::debug( '❌ _err: ' . $json_msg, $json ); $str_translated = Error::msg( $json_msg ); $msg = __( 'Failed to communicate with QUIC.cloud server', 'litespeed-cache' ) . ': ' . $str_translated . ' [server] ' . esc_html( $server ) . ' [service] ' . esc_html( $service ); $msg .= $this->_parse_link( $json ); $visible_err = self::API_VER !== $service && self::API_NEWS !== $service && self::SVC_D_DASH !== $service; if ( $visible_err ) { Admin_Display::error( $msg ); } // QC may try auto alias // Store the domain as `err_domains` only for QC auto alias feature if ( 'err_alias' === $json_msg ) { if ( empty( $this->_summary['err_domains'] ) ) { $this->_summary['err_domains'] = []; } $site_url = site_url(); if ( ! array_key_exists( $site_url, $this->_summary['err_domains'] ) ) { $this->_summary['err_domains'][ $site_url ] = time(); } self::save_summary(); } // Site not on QC, reset QC connection registration if ( 'site_not_registered' === $json_msg || 'err_key' === $json_msg ) { $this->_reset_qc_reg(); } return [ $json, true ]; } unset( $json['_res'] ); if ( ! empty( $json['_msg'] ) ) { unset( $json['_msg'] ); } return [ $json, false ]; } /** * Clear QC linked status * * @since 5.0 */ private function _reset_qc_reg() { unset( $this->_summary['qc_activated'] ); if ( ! empty( $this->_summary['partner'] ) ) { unset( $this->_summary['partner'] ); } self::save_summary(); $msg = $this->_reset_qc_reg_content(); Admin_Display::error( $msg, false, true ); } /** * Build reset QC registration content. * * @since 7.0 * @return string */ private function _reset_qc_reg_content() { $msg = __( 'Site not recognized. QUIC.cloud deactivated automatically. Please reactivate your QUIC.cloud account.', 'litespeed-cache' ); $msg .= Doc::learn_more( admin_url( 'admin.php?page=litespeed' ), __( 'Click here to proceed.', 'litespeed-cache' ), true, false, true ); $msg .= Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/general/', false, false, false, true ); return $msg; } /** * Clear reset QC reg msg if exist * * @since 7.0 */ private function _clear_reset_qc_reg_msg() { self::debug( 'Removed pinned reset QC reg content msg' ); $msg = $this->_reset_qc_reg_content(); Admin_Display::dismiss_pin_by_content( $msg, Admin_Display::NOTICE_RED, true ); } /** * REST call: check if the error domain is valid call for auto alias purpose * * @since 5.0 */ public function rest_err_domains() { // phpcs:ignore WordPress.Security.NonceVerification.Missing $alias = !empty( $_POST['alias'] ) ? sanitize_text_field( wp_unslash( $_POST['alias'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing if ( empty( $_POST['main_domain'] ) || !$alias ) { return self::err( 'lack_of_param' ); } // phpcs:ignore WordPress.Security.NonceVerification.Missing $this->extract_msg( $_POST, 'Quic.cloud', false, true ); if ( $this->_is_err_domain( $alias ) ) { if ( site_url() === $alias ) { $this->_remove_domain_from_err_list( $alias ); } return self::ok(); } return self::err( 'Not an alias req from here' ); } /** * Remove a domain from err domain * * @since 5.0 * * @param string $url URL to remove. */ private function _remove_domain_from_err_list( $url ) { unset( $this->_summary['err_domains'][ $url ] ); self::save_summary(); } /** * Check if is err domain * * @since 5.0 * * @param string $site_url Site URL. * @return bool */ private function _is_err_domain( $site_url ) { if ( empty( $this->_summary['err_domains'] ) ) { return false; } if ( ! array_key_exists( $site_url, $this->_summary['err_domains'] ) ) { return false; } // Auto delete if too long ago if ( time() - (int) $this->_summary['err_domains'][ $site_url ] > 86400 * 10 ) { $this->_remove_domain_from_err_list( $site_url ); return false; } if ( time() - (int) $this->_summary['err_domains'][ $site_url ] > 86400 ) { return false; } return true; } /** * Show promo from cloud * * @since 3.0 * @access public */ public function show_promo() { if ( empty( $this->_summary['promo'] ) ) { return; } require_once LSCWP_DIR . 'tpl/banner/cloud_promo.tpl.php'; } /** * Clear promo from cloud * * @since 3.0 * @access private */ private function _clear_promo() { if ( count( $this->_summary['promo'] ) > 1 ) { array_shift( $this->_summary['promo'] ); } else { $this->_summary['promo'] = []; } self::save_summary(); } /** * Parse _links from json * * @since 1.6.5 * @since 1.6.7 Self clean the parameter * @access private * * @param array $json JSON array (passed by reference). * @return string HTML link string. */ private function _parse_link( &$json ) { $msg = ''; if ( ! empty( $json['_links'] ) ) { foreach ( $json['_links'] as $v ) { $msg .= ' ' . sprintf( '<a href="%s" class="%s" target="_blank">%s</a>', esc_url( $v['link'] ), ! empty( $v['cls'] ) ? esc_attr( $v['cls'] ) : '', esc_html( $v['title'] ) ); } unset( $json['_links'] ); } return $msg; } /** * Request callback validation from Cloud * * @since 3.0 * @access public */ public function ip_validate() { // phpcs:ignore WordPress.Security.NonceVerification.Missing $hash = ! empty( $_POST['hash'] ) ? sanitize_text_field( wp_unslash( $_POST['hash'] ) ) : ''; if ( !$hash ) { return self::err( 'lack_of_params' ); } if ( md5( substr( $this->_summary['pk_b64'], 0, 4 ) ) !== $hash ) { self::debug( '__callback IP request decryption failed' ); return self::err( 'err_hash' ); } Control::set_nocache( 'Cloud IP hash validation' ); $resp_hash = md5( substr( $this->_summary['pk_b64'], 2, 4 ) ); self::debug( '__callback IP request hash: ' . $resp_hash ); return self::ok( [ 'hash' => $resp_hash ] ); } /** * Check if this visit is from cloud or not * * @since 3.0 */ public function is_from_cloud() { $check_point = time() - 86400 * self::TTL_IPS; if ( empty( $this->_summary['ips'] ) || empty( $this->_summary['ips_ts'] ) || $this->_summary['ips_ts'] < $check_point ) { self::debug( 'Force updating ip as ips_ts is older than ' . self::TTL_IPS . ' days' ); $this->_update_ips(); } $res = $this->cls( 'Router' )->ip_access( $this->_summary['ips'] ); if ( ! $res ) { self::debug( '❌ Not our cloud IP' ); // Auto check ip list again but need an interval limit safety. if ( empty( $this->_summary['ips_ts_runner'] ) || time() - (int) $this->_summary['ips_ts_runner'] > 600 ) { self::debug( 'Force updating ip as ips_ts_runner is older than 10mins' ); // Refresh IP list for future detection $this->_update_ips(); $res = $this->cls( 'Router' )->ip_access( $this->_summary['ips'] ); if ( ! $res ) { self::debug( '❌ 2nd time: Not our cloud IP' ); } else { self::debug( '✅ Passed Cloud IP verification' ); } return $res; } } else { self::debug( '✅ Passed Cloud IP verification' ); } return $res; } /** * Update Cloud IP list * * @since 4.2 * * @throws \Exception When fetching whitelist fails. */ private function _update_ips() { self::debug( 'Load remote Cloud IP list from ' . $this->_cloud_ips ); // Prevent multiple call in a short period self::save_summary([ 'ips_ts' => time(), 'ips_ts_runner' => time(), ]); $response = wp_safe_remote_get( $this->_cloud_ips . '?json' ); if ( is_wp_error( $response ) ) { $error_message = $response->get_error_message(); self::debug( 'failed to get ip whitelist: ' . $error_message ); throw new \Exception( 'Failed to fetch QUIC.cloud whitelist ' . esc_html($error_message) ); } $json = \json_decode( $response['body'], true ); self::debug( 'Load ips', $json ); self::save_summary( [ 'ips' => $json ] ); } /** * Return succeeded response * * @since 3.0 * * @param array $data Additional data. * @return array */ public static function ok( $data = [] ) { $data['_res'] = 'ok'; return $data; } /** * Return error * * @since 3.0 * * @param string $code Error code. * @return array */ public static function err( $code ) { self::debug( '❌ Error response code: ' . $code ); return [ '_res' => 'err', '_msg' => $code, ]; } /** * Return pong for ping to check PHP function availability * * @since 6.5 * * @return array */ public function ping() { $resp = [ 'v_lscwp' => Core::VER, 'v_lscwp_db' => $this->conf( self::_VER ), 'v_php' => PHP_VERSION, 'v_wp' => $GLOBALS['wp_version'], 'home_url' => home_url(), 'site_url' => site_url(), ]; // phpcs:ignore WordPress.Security.NonceVerification.Missing if ( ! empty( $_POST['funcs'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized foreach ( wp_unslash($_POST['funcs']) as $v ) { $resp[ $v ] = function_exists( $v ) ? 'y' : 'n'; } } // phpcs:ignore WordPress.Security.NonceVerification.Missing if ( ! empty( $_POST['classes'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized foreach ( wp_unslash($_POST['classes']) as $v ) { $resp[ $v ] = class_exists( $v ) ? 'y' : 'n'; } } // phpcs:ignore WordPress.Security.NonceVerification.Missing if ( ! empty( $_POST['consts'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized foreach ( wp_unslash($_POST['consts']) as $v ) { $resp[ $v ] = defined( $v ) ? 'y' : 'n'; } } return self::ok( $resp ); } /** * Display a banner for dev env if using preview QC node. * * @since 7.0 */ public function maybe_preview_banner() { if ( false !== strpos( $this->_cloud_server, 'preview.' ) ) { Admin_Display::note( __( 'Linked to QUIC.cloud preview environment, for testing purpose only.', 'litespeed-cache' ), true, true, 'litespeed-warning-bg' ); } } /** * Handle all request actions from main cls * * @since 3.0 * @access public */ public function handler() { $type = Router::verify_type(); switch ( $type ) { case self::TYPE_CLEAR_CLOUD: $this->clear_cloud(); break; case self::TYPE_REDETECT_CLOUD: // phpcs:ignore WordPress.Security.NonceVerification.Recommended $svc = ! empty( $_GET['svc'] ) ? sanitize_text_field( wp_unslash( $_GET['svc'] ) ) : ''; if ( $svc ) { $this->detect_cloud( $svc, true ); } break; case self::TYPE_CLEAR_PROMO: $this->_clear_promo(); break; case self::TYPE_RESET: $this->reset_qc(); break; case self::TYPE_ACTIVATE: $this->init_qc(); break; case self::TYPE_LINK: $this->link_qc(); break; case self::TYPE_ENABLE_CDN: $this->enable_cdn(); break; case self::TYPE_API: // phpcs:ignore WordPress.Security.NonceVerification.Recommended $action2 = ! empty( $_GET['action2'] ) ? sanitize_text_field( wp_unslash( $_GET['action2'] ) ) : ''; if ( $action2 ) { $this->api_link_call( $action2 ); } break; case self::TYPE_SYNC_STATUS: $this->load_qc_status_for_dash( 'cdn_dash', true ); $msg = __( 'Sync QUIC.cloud status successfully.', 'litespeed-cache' ); Admin_Display::success( $msg ); break; case self::TYPE_SYNC_USAGE: $this->sync_usage(); $msg = __( 'Sync credit allowance with Cloud Server successfully.', 'litespeed-cache' ); Admin_Display::success( $msg ); break; default: break; } Admin::redirect(); } } src/avatar.cls.php 0000777 00000021234 15251157102 0010112 0 ustar 00 <?php /** * The avatar cache class. * * Caches remote (e.g., Gravatar) avatars locally and rewrites URLs * to serve cached copies with a TTL. Supports on-demand generation * during page render and batch generation via cron. * * @since 3.0 * @package LiteSpeed */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Avatar */ class Avatar extends Base { const TYPE_GENERATE = 'generate'; /** * Avatar cache TTL (seconds). * * @var int */ private $_conf_cache_ttl; /** * Avatar DB table name. * * @var string */ private $_tb; /** * In-request map from original URL => rewritten URL to avoid duplicates. * * @var array<string,string> */ private $_avatar_realtime_gen_dict = []; /** * Summary/status data for last requests. * * @var array<string,mixed> */ protected $_summary; /** * Init. * * @since 1.4 */ public function __construct() { $this->_tb = Data::cls()->tb( 'avatar' ); if ( ! $this->conf( self::O_DISCUSS_AVATAR_CACHE ) ) { return; } self::debug2( '[Avatar] init' ); $this->_conf_cache_ttl = $this->conf( self::O_DISCUSS_AVATAR_CACHE_TTL ); add_filter( 'get_avatar_url', [ $this, 'crawl_avatar' ] ); $this->_summary = self::get_summary(); } /** * Check whether DB table is needed. * * @since 3.0 * @access public * @return bool */ public function need_db() { return (bool) $this->conf( self::O_DISCUSS_AVATAR_CACHE ); } /** * Serve static avatar by md5 (used by local static route). * * @since 3.0 * @access public * @param string $md5 MD5 hash of original avatar URL. * @return void */ public function serve_static( $md5 ) { global $wpdb; self::debug( '[Avatar] is avatar request' ); if ( strlen( $md5 ) !== 32 ) { self::debug( '[Avatar] wrong md5 ' . $md5 ); return; } $url = $wpdb->get_var( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching $wpdb->prepare( 'SELECT url FROM `' . $this->_tb . '` WHERE md5 = %s', // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared $md5 ) ); if ( ! $url ) { self::debug( '[Avatar] no matched url for md5 ' . $md5 ); return; } $url = $this->_generate( $url ); wp_safe_redirect( $url ); exit; } /** * Localize/replace avatar URL with cached one (filter callback). * * @since 3.0 * @access public * @param string $url Original avatar URL. * @return string Rewritten/cached avatar URL (or original). */ public function crawl_avatar( $url ) { if ( ! $url ) { return $url; } // Check if already generated in this request. if ( ! empty( $this->_avatar_realtime_gen_dict[ $url ] ) ) { self::debug2( '[Avatar] already in dict [url] ' . $url ); return $this->_avatar_realtime_gen_dict[ $url ]; } $realpath = $this->_realpath( $url ); $mtime = file_exists( $realpath ) ? filemtime( $realpath ) : false; if ( $mtime && time() - (int) $mtime <= $this->_conf_cache_ttl ) { self::debug2( '[Avatar] cache file exists [url] ' . $url ); return $this->_rewrite( $url, $mtime ); } // Only handle gravatar or known remote avatar providers; keep generic check for "gravatar.com". if ( strpos( $url, 'gravatar.com' ) === false ) { return $url; } // Throttle generation. if ( ! empty( $this->_summary['curr_request'] ) && time() - (int) $this->_summary['curr_request'] < 300 ) { self::debug2( '[Avatar] Bypass generating due to interval limit [url] ' . $url ); return $url; } // Generate immediately and track for this request. $this->_avatar_realtime_gen_dict[ $url ] = $this->_generate( $url ); return $this->_avatar_realtime_gen_dict[ $url ]; } /** * Count queued avatars (expired ones) for cron. * * @since 3.0 * @access public * @return int|false */ public function queue_count() { global $wpdb; if ( ! Data::cls()->tb_exist( 'avatar' ) ) { Data::cls()->tb_create( 'avatar' ); } $cnt = $wpdb->get_var( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching $wpdb->prepare( 'SELECT COUNT(*) FROM `' . $this->_tb . '` WHERE dateline < %d', // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared time() - $this->_conf_cache_ttl ) ); return (int) $cnt; } /** * Build final local URL for cached avatar. * * @since 3.0 * @param string $url Original URL. * @param int|null $time Optional filemtime for cache busting. * @return string Local URL. */ private function _rewrite( $url, $time = null ) { $qs = $time ? '?ver=' . $time : ''; return LITESPEED_STATIC_URL . '/avatar/' . $this->_filepath( $url ) . $qs; } /** * Generate filesystem realpath for cache file. * * @since 3.0 * @access private * @param string $url Original URL. * @return string Absolute filesystem path. */ private function _realpath( $url ) { return LITESPEED_STATIC_DIR . '/avatar/' . $this->_filepath( $url ); } /** * Get relative filepath for cached avatar. * * @since 4.0 * @param string $url Original URL. * @return string Relative path under avatar/ (may include blog id). */ private function _filepath( $url ) { $filename = md5( $url ) . '.jpg'; if ( is_multisite() ) { $filename = get_current_blog_id() . '/' . $filename; } return $filename; } /** * Cron generation for expired avatars. * * @since 3.0 * @access public * @param bool $force Bypass throttle. * @return void */ public static function cron( $force = false ) { global $wpdb; $_instance = self::cls(); if ( ! $_instance->queue_count() ) { self::debug( '[Avatar] no queue' ); return; } // For cron, need to check request interval too. if ( ! $force ) { if ( ! empty( $_instance->_summary['curr_request'] ) && time() - (int) $_instance->_summary['curr_request'] < 300 ) { self::debug( '[Avatar] curr_request too close' ); return; } } $list = $wpdb->get_results( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching $wpdb->prepare( 'SELECT url FROM `' . $_instance->_tb . '` WHERE dateline < %d ORDER BY id DESC LIMIT %d', // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared time() - $_instance->_conf_cache_ttl, (int) apply_filters( 'litespeed_avatar_limit', 30 ) ) ); self::debug( '[Avatar] cron job [count] ' . ( $list ? count( $list ) : 0 ) ); if ( $list ) { foreach ( $list as $v ) { self::debug( '[Avatar] cron job [url] ' . $v->url ); $_instance->_generate( $v->url ); } } } /** * Download and store the avatar locally, then update DB row. * * @since 3.0 * @access private * @param string $url Original avatar URL. * @return string Rewritten local URL (fallback to original on failure). */ private function _generate( $url ) { global $wpdb; $file = $this->_realpath( $url ); // Mark request start self::save_summary( [ 'curr_request' => time(), ] ); // Ensure cache directory exists $this->_maybe_mk_cache_folder( 'avatar' ); $response = wp_safe_remote_get( $url, [ 'timeout' => 180, 'stream' => true, 'filename' => $file, ] ); self::debug( '[Avatar] _generate [url] ' . $url ); // Parse response data if ( is_wp_error( $response ) ) { $error_message = $response->get_error_message(); if ( file_exists( $file ) ) { wp_delete_file( $file ); } self::debug( '[Avatar] failed to get: ' . $error_message ); return $url; } // Save summary data self::save_summary( [ 'last_spent' => time() - (int) $this->_summary['curr_request'], 'last_request' => $this->_summary['curr_request'], 'curr_request' => 0, ] ); // Update/insert DB record $md5 = md5( $url ); $existed = $wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching $wpdb->prepare( 'UPDATE `' . $this->_tb . '` SET dateline = %d WHERE md5 = %s', // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared time(), $md5 ) ); if ( ! $existed ) { $wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching $wpdb->prepare( 'INSERT INTO `' . $this->_tb . '` (url, md5, dateline) VALUES (%s, %s, %d)', // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared $url, $md5, time() ) ); } self::debug( '[Avatar] saved avatar ' . $file ); return $this->_rewrite( $url ); } /** * Handle all request actions from main cls. * * @since 3.0 * @access public * @return void */ public function handler() { $type = Router::verify_type(); switch ( $type ) { case self::TYPE_GENERATE: self::cron( true ); break; default: break; } Admin::redirect(); } } src/control.cls.php 0000777 00000060545 15251157102 0010324 0 ustar 00 <?php /** * The plugin cache-control class for X-LiteSpeed-Cache-Control. * * Provides helpers for determining cacheability, emitting cache-control headers, * and honoring various LiteSpeed Cache configuration options. * * @package LiteSpeed * @since 1.1.3 */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Control * * Handles cache-control flags, TTL calculation, redirection checks, * role-based exclusions, and final header output. */ class Control extends Root { const LOG_TAG = '💵'; const BM_CACHEABLE = 1; const BM_PRIVATE = 2; const BM_SHARED = 4; const BM_NO_VARY = 8; const BM_FORCED_CACHEABLE = 32; const BM_PUBLIC_FORCED = 64; const BM_STALE = 128; const BM_NOTCACHEABLE = 256; const X_HEADER = 'X-LiteSpeed-Cache-Control'; /** * Bitmask control flags for current request. * * @var int */ protected static $_control = 0; /** * Custom TTL for current request (seconds). * * @var int */ protected static $_custom_ttl = 0; /** * Mapping of HTTP status codes to custom TTLs. * * @var array<string,int|string> */ private $_response_header_ttls = []; /** * Init cache control. * * @since 1.6.2 * @return void */ public function init() { /** * Add vary filter for Role Excludes. * * @since 1.6.2 */ add_filter( 'litespeed_vary', [ $this, 'vary_add_role_exclude' ] ); // 301 redirect hook. add_filter( 'wp_redirect', [ $this, 'check_redirect' ], 10, 2 ); // Load response header conf. $this->_response_header_ttls = $this->conf( Base::O_CACHE_TTL_STATUS ); foreach ( $this->_response_header_ttls as $k => $v ) { $v = explode( ' ', $v ); if ( empty( $v[0] ) || empty( $v[1] ) ) { continue; } $this->_response_header_ttls[ $v[0] ] = $v[1]; } if ( $this->conf( Base::O_PURGE_STALE ) ) { $this->set_stale(); } } /** * Exclude role from optimization filter. * * @since 1.6.2 * @access public * * @param array<string,mixed> $vary Existing vary map. * @return array<string,mixed> */ public function vary_add_role_exclude( $vary ) { if ( $this->in_cache_exc_roles() ) { $vary['role_exclude_cache'] = 1; } return $vary; } /** * Check if one user role is in exclude cache group settings. * * @since 1.6.2 * @since 3.0 Moved here from conf.cls * @access public * * @param string|null $role The user role. * @return string|false Comma-separated roles if set, otherwise false. */ public function in_cache_exc_roles( $role = null ) { // Get user role. if ( null === $role ) { $role = Router::get_role(); } if ( ! $role ) { return false; } $roles = explode( ',', $role ); $found = array_intersect( $roles, $this->conf( Base::O_CACHE_EXC_ROLES ) ); return $found ? implode( ',', $found ) : false; } /** * 1. Initialize cacheable status for `wp` hook * 2. Hook error page tags for cacheable pages * * @since 1.1.3 * @access public * @return void */ public function init_cacheable() { // Hook `wp` to mark default cacheable status. // NOTE: Any process that does NOT run into `wp` hook will not get cacheable by default. add_action( 'wp', [ $this, 'set_cacheable' ], 5 ); // Hook WP REST to be cacheable. if ( $this->conf( Base::O_CACHE_REST ) ) { add_action( 'rest_api_init', [ $this, 'set_cacheable' ], 5 ); } // AJAX cache. $ajax_cache = $this->conf( Base::O_CACHE_AJAX_TTL ); foreach ( $ajax_cache as $v ) { $v = explode( ' ', $v ); if ( empty( $v[0] ) || empty( $v[1] ) ) { continue; } add_action( 'wp_ajax_nopriv_' . $v[0], function () use ( $v ) { self::set_custom_ttl( $v[1] ); self::force_cacheable( 'ajax Cache setting for action ' . $v[0] ); }, 4 ); } // Check error page. add_filter( 'status_header', [ $this, 'check_error_codes' ], 10, 2 ); } /** * Check if the page returns any error code. * * @since 1.0.13.1 * @access public * * @param string $status_header Status header. * @param int $code HTTP status code. * @return string Original status header. */ public function check_error_codes( $status_header, $code ) { if ( array_key_exists( $code, $this->_response_header_ttls ) ) { if ( self::is_cacheable() && ! $this->_response_header_ttls[ $code ] ) { self::set_nocache( '[Ctrl] TTL is set to no cache [status_header] ' . $code ); } // Set TTL. self::set_custom_ttl( $this->_response_header_ttls[ $code ] ); } elseif ( self::is_cacheable() ) { $first = substr( $code, 0, 1 ); if ( '4' === $first || '5' === $first ) { self::set_nocache( '[Ctrl] 4xx/5xx default to no cache [status_header] ' . $code ); } } // Set cache tag. if ( in_array( $code, Tag::$error_code_tags, true ) ) { Tag::add( Tag::TYPE_HTTP . $code ); } // Give the default status_header back. return $status_header; } /** * Set no vary setting. * * @access public * @since 1.1.3 * @return void */ public static function set_no_vary() { if ( self::is_no_vary() ) { return; } self::$_control |= self::BM_NO_VARY; self::debug( 'X Cache_control -> no-vary', 3 ); } /** * Get no vary setting. * * @access public * @since 1.1.3 * @return bool */ public static function is_no_vary() { return self::$_control & self::BM_NO_VARY; } /** * Set stale. * * @access public * @since 1.1.3 * @return void */ public function set_stale() { if ( self::is_stale() ) { return; } self::$_control |= self::BM_STALE; self::debug( 'X Cache_control -> stale' ); } /** * Get stale. * * @access public * @since 1.1.3 * @return bool */ public static function is_stale() { return self::$_control & self::BM_STALE; } /** * Set cache control to shared private. * * @access public * @since 1.1.3 * * @param string|false $reason The reason to mark shared, or false. * @return void */ public static function set_shared( $reason = false ) { if ( self::is_shared() ) { return; } self::$_control |= self::BM_SHARED; self::set_private(); if ( ! is_string( $reason ) ) { $reason = false; } if ( $reason ) { $reason = "( $reason )"; } self::debug( 'X Cache_control -> shared ' . $reason ); } /** * Check if is shared private. * * @access public * @since 1.1.3 * @return bool */ public static function is_shared() { return (bool) ( self::$_control & self::BM_SHARED ) && self::is_private(); } /** * Set cache control to forced public. * * @access public * @since 1.7.1 * * @param string|false $reason Reason text or false. * @return void */ public static function set_public_forced( $reason = false ) { if ( self::is_public_forced() ) { return; } self::$_control |= self::BM_PUBLIC_FORCED; if ( ! is_string( $reason ) ) { $reason = false; } if ( $reason ) { $reason = "( $reason )"; } self::debug( 'X Cache_control -> public forced ' . $reason ); } /** * Check if is public forced. * * @access public * @since 1.7.1 * @return bool */ public static function is_public_forced() { return self::$_control & self::BM_PUBLIC_FORCED; } /** * Set cache control to private. * * @access public * @since 1.1.3 * * @param string|false $reason The reason to set private. * @return void */ public static function set_private( $reason = false ) { if ( self::is_private() ) { return; } self::$_control |= self::BM_PRIVATE; if ( ! is_string( $reason ) ) { $reason = false; } if ( $reason ) { $reason = "( $reason )"; } self::debug( 'X Cache_control -> private ' . $reason ); } /** * Check if is private. * * @access public * @since 1.1.3 * @return bool */ public static function is_private() { // if ( defined( 'LITESPEED_GUEST' ) && LITESPEED_GUEST ) { // return false; // } return (bool) ( self::$_control & self::BM_PRIVATE ) && ! self::is_public_forced(); } /** * Initialize cacheable status in `wp` hook, if not call this, by default it will be non-cacheable. * * @access public * @since 1.1.3 * * @param string|false $reason Reason text or false. * @return void */ public function set_cacheable( $reason = false ) { self::$_control |= self::BM_CACHEABLE; if ( ! is_string( $reason ) ) { $reason = false; } if ( $reason ) { $reason = ' [reason] ' . $reason; } self::debug( 'Cache_control init on' . $reason ); } /** * This will disable non-cacheable BM. * * @access public * @since 2.2 * * @param string|false $reason Reason text or false. * @return void */ public static function force_cacheable( $reason = false ) { self::$_control |= self::BM_FORCED_CACHEABLE; if ( ! is_string( $reason ) ) { $reason = false; } if ( $reason ) { $reason = ' [reason] ' . $reason; } self::debug( 'Forced cacheable' . $reason ); } /** * Switch to nocacheable status. * * @access public * @since 1.1.3 * * @param string|false $reason The reason to no cache. * @return void */ public static function set_nocache( $reason = false ) { self::$_control |= self::BM_NOTCACHEABLE; if ( ! is_string( $reason ) ) { $reason = false; } if ( $reason ) { $reason = "( $reason )"; } self::debug( 'X Cache_control -> no Cache ' . $reason, 5 ); } /** * Check current notcacheable bit set. * * @access public * @since 1.1.3 * @return bool True if notcacheable bit is set, otherwise false. */ public static function isset_notcacheable() { return self::$_control & self::BM_NOTCACHEABLE; } /** * Check current force cacheable bit set. * * @access public * @since 2.2 * @return bool */ public static function is_forced_cacheable() { return self::$_control & self::BM_FORCED_CACHEABLE; } /** * Check current cacheable status. * * @access public * @since 1.1.3 * @return bool True if is still cacheable, otherwise false. */ public static function is_cacheable() { if ( defined( 'LSCACHE_NO_CACHE' ) && LSCACHE_NO_CACHE ) { self::debug( 'LSCACHE_NO_CACHE constant defined' ); return false; } // Guest mode always cacheable // if ( defined( 'LITESPEED_GUEST' ) && LITESPEED_GUEST ) { // return true; // } // If it's forced public cacheable. if ( self::is_public_forced() ) { return true; } // If it's forced cacheable. if ( self::is_forced_cacheable() ) { return true; } return ! self::isset_notcacheable() && ( self::$_control & self::BM_CACHEABLE ); } /** * Set a custom TTL to use with the request if needed. * * @access public * @since 1.1.3 * * @param int|string $ttl An integer or numeric string to use as the TTL. * @param string|false $reason Optional reason text. * @return void */ public static function set_custom_ttl( $ttl, $reason = false ) { if ( is_numeric( $ttl ) ) { self::$_custom_ttl = (int) $ttl; self::debug( 'X Cache_control TTL -> ' . $ttl . ( $reason ? ' [reason] ' . $ttl : '' ) ); } } /** * Generate final TTL. * * @access public * @since 1.1.3 * @return int */ public function get_ttl() { if ( 0 !== self::$_custom_ttl ) { return (int) self::$_custom_ttl; } // Check if is in timed url list or not. $timed_urls = Utility::wildcard2regex( $this->conf( Base::O_PURGE_TIMED_URLS ) ); $timed_urls_time = $this->conf( Base::O_PURGE_TIMED_URLS_TIME ); if ( $timed_urls && $timed_urls_time ) { $current_url = Tag::build_uri_tag( true ); // Use time limit ttl. $scheduled_time = strtotime( $timed_urls_time ); $ttl = $scheduled_time - current_time('timestamp'); // phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp if ( $ttl < 0 ) { $ttl += 86400; // add one day } foreach ( $timed_urls as $v ) { if ( false !== strpos( $v, '*' ) ) { if ( preg_match( '#' . $v . '#iU', $current_url ) ) { self::debug( 'X Cache_control TTL is limited to ' . $ttl . ' due to scheduled purge regex ' . $v ); return $ttl; } } elseif ( $v === $current_url ) { self::debug( 'X Cache_control TTL is limited to ' . $ttl . ' due to scheduled purge rule ' . $v ); return $ttl; } } } // Private cache uses private ttl setting. if ( self::is_private() ) { return (int) $this->conf( Base::O_CACHE_TTL_PRIV ); } if ( is_front_page() ) { return (int) $this->conf( Base::O_CACHE_TTL_FRONTPAGE ); } $feed_ttl = (int) $this->conf( Base::O_CACHE_TTL_FEED ); if ( is_feed() && $feed_ttl > 0 ) { return $feed_ttl; } if ( $this->cls( 'REST' )->is_rest() || $this->cls( 'REST' )->is_internal_rest() ) { return (int) $this->conf( Base::O_CACHE_TTL_REST ); } return (int) $this->conf( Base::O_CACHE_TTL_PUB ); } /** * Check if need to set no cache status for redirection or not. * * @access public * @since 1.1.3 * * @param string $location Redirect location. * @param int $status HTTP status. * @return string Redirect location. */ public function check_redirect( $location, $status ) { $script_uri = ''; if ( !empty( $_SERVER['SCRIPT_URI'] ) ) { $script_uri = sanitize_text_field( wp_unslash( $_SERVER['SCRIPT_URI'] ) ); } elseif ( !empty( $_SERVER['REQUEST_URI'] ) ) { $home = trailingslashit( home_url() ); $script_uri = $home . ltrim( sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ), '/' ); } if ( '' !== $script_uri ) { self::debug( '301 from ' . $script_uri ); self::debug( '301 to ' . $location ); $to_check = [ PHP_URL_SCHEME, PHP_URL_HOST, PHP_URL_PATH, PHP_URL_QUERY ]; $is_same_redirect = true; $query_string = ! empty( $_SERVER['QUERY_STRING'] ) ? sanitize_text_field( wp_unslash( $_SERVER['QUERY_STRING'] ) ) : ''; foreach ( $to_check as $v ) { $url_parsed = PHP_URL_QUERY === $v ? $query_string : wp_parse_url( $script_uri, $v ); $target = wp_parse_url( $location, $v ); self::debug( 'Compare [from] ' . $url_parsed . ' [to] ' . $target ); if ( PHP_URL_QUERY === $v ) { $url_parsed = $url_parsed ? urldecode( $url_parsed ) : ''; $target = $target ? urldecode( $target ) : ''; if ( '&' === substr( $url_parsed, -1 ) ) { $url_parsed = substr( $url_parsed, 0, -1 ); } } if ( $url_parsed !== $target ) { $is_same_redirect = false; self::debug( '301 different redirection' ); break; } } if ( $is_same_redirect ) { self::set_nocache( '301 to same url' ); } } return $location; } /** * Sets up the Cache Control header. * * @since 1.1.3 * @access public * @return string empty string if empty, otherwise the cache control header. */ public function output() { $esi_hdr = ''; if ( ESI::has_esi() ) { $esi_hdr = ',esi=on'; } $hdr = self::X_HEADER . ': '; // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase if ( defined( 'DONOTCACHEPAGE' ) && apply_filters( 'litespeed_const_DONOTCACHEPAGE', DONOTCACHEPAGE ) ) { self::debug( '❌ forced no cache [reason] DONOTCACHEPAGE const' ); $hdr .= 'no-cache' . $esi_hdr; return $hdr; } // Guest mode directly return cacheable result // if ( defined( 'LITESPEED_GUEST' ) && LITESPEED_GUEST ) { // If is POST, no cache // if ( defined( 'LSCACHE_NO_CACHE' ) && LSCACHE_NO_CACHE ) { // self::debug( "[Ctrl] ❌ forced no cache [reason] LSCACHE_NO_CACHE const" ); // $hdr .= 'no-cache'; // } // else if( $_SERVER[ 'REQUEST_METHOD' ] !== 'GET' ) { // self::debug( "[Ctrl] ❌ forced no cache [reason] req not GET" ); // $hdr .= 'no-cache'; // } // else { // $hdr .= 'public'; // $hdr .= ',max-age=' . $this->get_ttl(); // } // $hdr .= $esi_hdr; // return $hdr; // } // Fix cli `uninstall --deactivate` fatal err if (!self::is_cacheable()) { $hdr .= 'no-cache' . $esi_hdr; return $hdr; } if ( self::is_shared() ) { $hdr .= 'shared,private'; } elseif ( self::is_private() ) { $hdr .= 'private'; } else { $hdr .= 'public'; } if ( self::is_no_vary() ) { $hdr .= ',no-vary'; } $hdr .= ',max-age=' . $this->get_ttl() . $esi_hdr; return $hdr; } /** * Generate all `control` tags before output. * * @access public * @since 1.1.3 * @return void */ public function finalize() { // if ( defined( 'LITESPEED_GUEST' ) && LITESPEED_GUEST ) { // return; // } if ( is_preview() ) { self::set_nocache( 'preview page' ); return; } // Check if has metabox non-cacheable setting or not. if ( file_exists( LSCWP_DIR . 'src/metabox.cls.php' ) && $this->cls( 'Metabox' )->setting( 'litespeed_no_cache' ) ) { self::set_nocache( 'per post metabox setting' ); return; } // Check if URI is forced public cache. $excludes = $this->conf( Base::O_CACHE_FORCE_PUB_URI ); $req_uri = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; $hit = Utility::str_hit_array( $req_uri, $excludes, true ); if ( $hit ) { list( $result, $this_ttl ) = $hit; self::set_public_forced( 'Setting: ' . $result ); self::debug( 'Forced public cacheable due to setting: ' . $result ); if ( $this_ttl ) { self::set_custom_ttl( $this_ttl ); } } if ( self::is_public_forced() ) { return; } // Check if URI is forced cache. $excludes = $this->conf( Base::O_CACHE_FORCE_URI ); $hit = Utility::str_hit_array( $req_uri, $excludes, true ); if ( $hit ) { list( $result, $this_ttl ) = $hit; self::force_cacheable(); self::debug( 'Forced cacheable due to setting: ' . $result ); if ( $this_ttl ) { self::set_custom_ttl( $this_ttl ); } } // if is not cacheable, terminate check. // Even no need to run 3rd party hook. if ( ! self::is_cacheable() ) { self::debug( 'not cacheable before ctrl finalize' ); return; } // Apply 3rd party filter. // NOTE: Hook always needs to run asap because some 3rd party set is_mobile in this hook. do_action( 'litespeed_control_finalize', defined( 'LSCACHE_IS_ESI' ) ? LSCACHE_IS_ESI : false ); // Pass ESI block id. // if is not cacheable, terminate check. if ( ! self::is_cacheable() ) { self::debug( 'not cacheable after api_control' ); return; } // Check litespeed setting to set cacheable status. if ( ! $this->_setting_cacheable() ) { self::set_nocache(); return; } // If user has password cookie, do not cache (moved from vary). global $post; if ( ! empty( $post->post_password ) && isset( $_COOKIE[ 'wp-postpass_' . COOKIEHASH ] ) ) { self::set_nocache( 'pswd cookie' ); return; } // The following check to the end is ONLY for mobile. $is_mobile_conf = apply_filters( 'litespeed_is_mobile', false ); if ( ! $this->conf( Base::O_CACHE_MOBILE ) ) { if ( $is_mobile_conf ) { self::set_nocache( 'mobile' ); } return; } $env_vary = isset( $_SERVER['LSCACHE_VARY_VALUE'] ) ? sanitize_text_field( wp_unslash( $_SERVER['LSCACHE_VARY_VALUE'] ) ) : ''; if ( !$env_vary && isset( $_SERVER['HTTP_X_LSCACHE_VARY_VALUE'] ) ) { $env_vary = sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_LSCACHE_VARY_VALUE'] ) ); } if ( $env_vary && false !== strpos( $env_vary, 'ismobile' ) ) { if ( ! wp_is_mobile() && ! $is_mobile_conf ) { self::set_nocache( 'is not mobile' ); // todo: no need to uncache, it will correct vary value in vary finalize anyways. return; } } elseif ( wp_is_mobile() || $is_mobile_conf ) { self::set_nocache( 'is mobile' ); return; } } /** * Check if is mobile for filter `litespeed_is_mobile` in API. * * @since 3.0 * @access public * @return bool */ public static function is_mobile() { return wp_is_mobile(); } /** * Get request method w/ compatibility to X-Http-Method-Override. * * @since 6.2 * @return string */ private function _get_req_method() { if ( isset( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] ) ) { $override = sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] ) ); self::debug( 'X-Http-Method-Override -> ' . $override ); if ( ! defined( 'LITESPEED_X_HTTP_METHOD_OVERRIDE' ) ) { define( 'LITESPEED_X_HTTP_METHOD_OVERRIDE', true ); } return $override; } if ( isset( $_SERVER['REQUEST_METHOD'] ) ) { return sanitize_text_field( wp_unslash( $_SERVER['REQUEST_METHOD'] ) ); } return 'unknown'; } /** * Check if a page is cacheable based on litespeed setting. * * @since 1.0.0 * @access private * @return bool True if cacheable, false otherwise. */ private function _setting_cacheable() { // logged_in users already excluded, no hook added. // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( ! empty( $_REQUEST[ Router::ACTION ] ) ) { return $this->_no_cache_for( 'Query String Action' ); } $method = $this->_get_req_method(); if ( defined( 'LITESPEED_X_HTTP_METHOD_OVERRIDE' ) && LITESPEED_X_HTTP_METHOD_OVERRIDE && 'HEAD' === $method ) { return $this->_no_cache_for( 'HEAD method from override' ); } if ( 'GET' !== $method && 'HEAD' !== $method ) { return $this->_no_cache_for( 'Not GET method: ' . $method ); } if ( is_feed() && 0 === $this->conf( Base::O_CACHE_TTL_FEED ) ) { return $this->_no_cache_for( 'feed' ); } if ( is_trackback() ) { return $this->_no_cache_for( 'trackback' ); } if ( is_search() ) { return $this->_no_cache_for( 'search' ); } // Check private cache URI setting. $excludes = $this->conf( Base::O_CACHE_PRIV_URI ); $req_uri = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; $result = Utility::str_hit_array( $req_uri, $excludes ); if ( $result ) { self::set_private( 'Admin cfg Private Cached URI: ' . $result ); } if ( ! self::is_forced_cacheable() ) { // Check if URI is excluded from cache. $excludes = $this->cls( 'Data' )->load_cache_nocacheable( $this->conf( Base::O_CACHE_EXC ) ); $result = Utility::str_hit_array( $req_uri, $excludes ); if ( $result ) { return $this->_no_cache_for( 'Admin configured URI Do not cache: ' . $result ); } // Check QS excluded setting. $excludes = $this->conf( Base::O_CACHE_EXC_QS ); $qs_hit = $this->_is_qs_excluded( $excludes ); if ( ! empty( $excludes ) && $qs_hit ) { return $this->_no_cache_for( 'Admin configured QS Do not cache: ' . $qs_hit ); } $excludes = $this->conf( Base::O_CACHE_EXC_CAT ); if ( ! empty( $excludes ) && has_category( $excludes ) ) { return $this->_no_cache_for( 'Admin configured Category Do not cache.' ); } $excludes = $this->conf( Base::O_CACHE_EXC_TAG ); if ( ! empty( $excludes ) && has_tag( $excludes ) ) { return $this->_no_cache_for( 'Admin configured Tag Do not cache.' ); } $excludes = $this->conf( Base::O_CACHE_EXC_COOKIES ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- names only, compared as keys. if ( ! empty( $excludes ) && ! empty( $_COOKIE ) ) { $cookie_hit = array_intersect( array_keys( $_COOKIE ), $excludes ); if ( $cookie_hit ) { return $this->_no_cache_for( 'Admin configured Cookie Do not cache.' ); } } $excludes = $this->conf( Base::O_CACHE_EXC_USERAGENTS ); if ( ! empty( $excludes ) && isset( $_SERVER['HTTP_USER_AGENT'] ) ) { $nummatches = preg_match( Utility::arr2regex( $excludes ), sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) ); if ( $nummatches ) { return $this->_no_cache_for( 'Admin configured User Agent Do not cache.' ); } } // Check if is exclude roles ( Need to set Vary too ). $result = $this->in_cache_exc_roles(); if ( $result ) { return $this->_no_cache_for( 'Role Excludes setting ' . $result ); } } return true; } /** * Write a debug message for if a page is not cacheable. * * @since 1.0.0 * @access private * * @param string $reason An explanation for why the page is not cacheable. * @return bool Always false. */ private function _no_cache_for( $reason ) { self::debug( 'X Cache_control off - ' . $reason ); return false; } /** * Check if current request has qs excluded setting. * * @since 1.3 * @access private * * @param array<int,string> $excludes QS excludes setting. * @return bool|string False if not excluded, otherwise the hit qs list. */ private function _is_qs_excluded( $excludes ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( ! empty( $_GET ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended $keys = array_keys( $_GET ); $intersect = array_intersect( $keys, $excludes ); if ( $intersect ) { return implode( ',', $intersect ); } } return false; } } src/activation.cls.php 0000777 00000042532 15251157102 0011001 0 ustar 00 <?php /** * The plugin activation class. * * @since 1.1.0 * @since 1.5 Moved into /inc * @package LiteSpeed * @subpackage LiteSpeed/inc * @author LiteSpeed Technologies <info@litespeedtech.com> */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Activation * * Handles plugin activation, deactivation, and related file management. * * @since 1.1.0 */ class Activation extends Base { const TYPE_UPGRADE = 'upgrade'; const TYPE_INSTALL_3RD = 'install_3rd'; const TYPE_INSTALL_ZIP = 'install_zip'; const TYPE_DISMISS_RECOMMENDED = 'dismiss_recommended'; const NETWORK_TRANSIENT_COUNT = 'lscwp_network_count'; /** * Data file path for configuration. * * @since 4.1 * @var string */ private static $data_file; /** * Construct * * Initializes the data file path. * * @since 4.1 */ public function __construct() { self::$data_file = LSCWP_CONTENT_DIR . '/' . self::CONF_FILE; } /** * The activation hook callback. * * Handles plugin activation tasks, including file creation and multisite setup. * * @since 1.0.0 * @access public */ public static function register_activation() { $count = 0; ! defined( 'LSCWP_LOG_TAG' ) && define( 'LSCWP_LOG_TAG', 'Activate_' . get_current_blog_id() ); /* Network file handler */ if ( is_multisite() ) { $count = self::get_network_count(); if ( false !== $count ) { $count = (int) $count + 1; set_site_transient( self::NETWORK_TRANSIENT_COUNT, $count, DAY_IN_SECONDS ); } if ( ! is_network_admin() ) { if ( 1 === $count ) { // Only itself is activated, set .htaccess with only CacheLookUp try { Htaccess::cls()->insert_ls_wrapper(); } catch ( \Exception $ex ) { Admin_Display::error( $ex->getMessage() ); } } } } self::cls()->update_files(); if ( defined( 'LSCWP_REF' ) && 'whm' === LSCWP_REF ) { GUI::update_option( GUI::WHM_MSG, GUI::WHM_MSG_VAL ); } } /** * Uninstall plugin * * Removes all LiteSpeed Cache settings and data. * * @since 1.1.0 * @since 7.3 Updated to remove all settings. * @access public */ public static function uninstall_litespeed_cache() { Task::destroy(); if ( is_multisite() ) { // Save main site id $current_blog = get_current_blog_id(); // get all sites $sub_sites = get_sites(); // clear foreach site foreach ( $sub_sites as $sub_site ) { $sub_blog_id = (int) $sub_site->blog_id; if ( $sub_blog_id !== $current_blog ) { // Switch to blog switch_to_blog( $sub_blog_id ); // Delete site options self::delete_settings(); // Delete site tables Data::cls()->tables_del(); } } // Return to main site switch_to_blog( $current_blog ); } // Delete current blog/site // Delete options self::delete_settings(); // Delete site tables Data::cls()->tables_del(); if ( file_exists( LITESPEED_STATIC_DIR ) ) { File::rrmdir( LITESPEED_STATIC_DIR ); } Cloud::version_check( 'uninstall' ); } /** * Remove all litespeed settings. * * Deletes all LiteSpeed Cache options from the database. * * @since 7.3 * @access private */ private static function delete_settings() { global $wpdb; // phpcs:ignore WordPress.DB.DirectDatabaseQuery $wpdb->query($wpdb->prepare("DELETE FROM `$wpdb->options` WHERE option_name LIKE %s", 'litespeed.%')); } /** * Get the blog ids for the network. Accepts function arguments. * * @since 1.0.12 * @access public * @param array $args Arguments for get_sites(). * @return array The array of blog ids. */ public static function get_network_ids( $args = [] ) { $args['fields'] = 'ids'; $blogs = get_sites( $args ); return $blogs; } /** * Gets the count of active litespeed cache plugins on multisite. * * @since 1.0.12 * @access private * @return int|false Number of active LSCWP or false if none. */ private static function get_network_count() { $count = get_site_transient( self::NETWORK_TRANSIENT_COUNT ); if ( false !== $count ) { return (int) $count; } // need to update $default = []; $count = 0; $sites = self::get_network_ids( [ 'deleted' => 0 ] ); if ( empty( $sites ) ) { return false; } foreach ( $sites as $site ) { $bid = is_object( $site ) && property_exists( $site, 'blog_id' ) ? $site->blog_id : $site; $plugins = get_blog_option( $bid, 'active_plugins', $default ); if ( ! empty( $plugins ) && in_array( LSCWP_BASENAME, $plugins, true ) ) { ++$count; } } /** * In case this is called outside the admin page * * @see https://codex.wordpress.org/Function_Reference/is_plugin_active_for_network * @since 2.0 */ if ( ! function_exists( 'is_plugin_active_for_network' ) ) { require_once ABSPATH . '/wp-admin/includes/plugin.php'; } if ( is_plugin_active_for_network( LSCWP_BASENAME ) ) { ++$count; } return $count; } /** * Is this deactivate call the last active installation on the multisite network? * * @since 1.0.12 * @access private */ private static function is_deactivate_last() { $count = self::get_network_count(); if ( false === $count ) { return false; } if ( 1 !== $count ) { // Not deactivating the last one. --$count; set_site_transient( self::NETWORK_TRANSIENT_COUNT, $count, DAY_IN_SECONDS ); return false; } delete_site_transient( self::NETWORK_TRANSIENT_COUNT ); return true; } /** * The deactivation hook callback. * * Initializes all clean up functionalities. * * @since 1.0.0 * @access public */ public static function register_deactivation() { Task::destroy(); ! defined( 'LSCWP_LOG_TAG' ) && define( 'LSCWP_LOG_TAG', 'Deactivate_' . get_current_blog_id() ); Purge::purge_all(); if ( is_multisite() ) { if ( ! self::is_deactivate_last() ) { if ( is_network_admin() ) { // Still other activated subsite left, set .htaccess with only CacheLookUp try { Htaccess::cls()->insert_ls_wrapper(); } catch ( \Exception $ex ) { Admin_Display::error($ex->getMessage()); } } return; } } /* 1) wp-config.php; */ try { self::cls()->manage_wp_cache_const( false ); } catch ( \Exception $ex ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.PHP.DevelopmentFunctions.error_log_error_log error_log( 'In wp-config.php: WP_CACHE could not be set to false during deactivation!' ); Admin_Display::error( $ex->getMessage() ); } /* 2) adv-cache.php; Dropped in v3.0.4 */ /* 3) object-cache.php; */ Object_Cache::cls()->del_file(); /* 4) .htaccess; */ try { Htaccess::cls()->clear_rules(); } catch ( \Exception $ex ) { Admin_Display::error( $ex->getMessage() ); } /* 5) .litespeed_conf.dat; */ self::del_conf_data_file(); /* 6) delete option lscwp_whm_install */ // delete in case it's not deleted prior to deactivation. GUI::dismiss_whm(); } /** * Manage related files based on plugin latest conf * * Handle files: * 1) wp-config.php; * 2) adv-cache.php; * 3) object-cache.php; * 4) .htaccess; * 5) .litespeed_conf.dat; * * @since 3.0 * @access public */ public function update_files() { Debug2::debug( '🗂️ [Activation] update_files' ); // Update cache setting `_CACHE` $this->cls( 'Conf' )->define_cache(); // Site options applied already $options = $this->get_options(); /* 1) wp-config.php; */ try { $this->manage_wp_cache_const( $options[ self::_CACHE ] ); } catch ( \Exception $ex ) { // Add msg to admin page or CLI Admin_Display::error( wp_kses_post( $ex->getMessage() ) ); } /* 2) adv-cache.php; Dropped in v3.0.4 */ /* 3) object-cache.php; */ if ( $options[ self::O_OBJECT ] && ( ! $options[ self::O_DEBUG_DISABLE_ALL ] || is_multisite() ) ) { $this->cls( 'Object_Cache' )->update_file( $options ); } else { $this->cls( 'Object_Cache' )->del_file(); // Note: because it doesn't reconnect, which caused setting page OC option changes delayed, thus may meet Connect Test Failed issue (Next refresh will correct it). Not a big deal, will keep as is. } /* 4) .htaccess; */ try { $this->cls( 'Htaccess' )->update( $options ); } catch ( \Exception $ex ) { Admin_Display::error( wp_kses_post( $ex->getMessage() ) ); } /* 5) .litespeed_conf.dat; */ if ( ( $options[ self::O_GUEST ] || $options[ self::O_OBJECT ] ) && ( ! $options[ self::O_DEBUG_DISABLE_ALL ] || is_multisite() ) ) { $this->update_conf_data_file( $options ); } } /** * Delete data conf file * * Removes the .litespeed_conf.dat file. * * @since 4.1 * @access private */ private static function del_conf_data_file() { global $wp_filesystem; if ( ! $wp_filesystem ) { require_once ABSPATH . 'wp-admin/includes/file.php'; WP_Filesystem(); } if ( $wp_filesystem->exists( self::$data_file ) ) { $wp_filesystem->delete( self::$data_file ); } } /** * Update data conf file for guest mode & object cache * * Updates the .litespeed_conf.dat file with relevant settings. * * @since 4.1 * @access private * @param array $options Plugin options. */ private function update_conf_data_file( $options ) { $ids = []; if ( $options[ self::O_OBJECT ] ) { $this_ids = [ self::O_DEBUG, self::O_OBJECT_KIND, self::O_OBJECT_HOST, self::O_OBJECT_PORT, self::O_OBJECT_LIFE, self::O_OBJECT_USER, self::O_OBJECT_PSWD, self::O_OBJECT_DB_ID, self::O_OBJECT_PERSISTENT, self::O_OBJECT_ADMIN, self::O_OBJECT_TRANSIENTS, self::O_OBJECT_GLOBAL_GROUPS, self::O_OBJECT_NON_PERSISTENT_GROUPS, ]; $ids = array_merge( $ids, $this_ids ); } if ( $options[ self::O_GUEST ] ) { $this_ids = [ self::HASH, self::O_CACHE_LOGIN_COOKIE, self::O_DEBUG_IPS, self::O_UTIL_NO_HTTPS_VARY, ]; $ids = array_merge( $ids, $this_ids ); } $data = []; foreach ( $ids as $v ) { $data[ $v ] = $options[ $v ]; } $data = wp_json_encode( $data ); $old_data = File::read( self::$data_file ); if ( $old_data !== $data ) { defined( 'LSCWP_LOG' ) && Debug2::debug( '[Activation] Updating .litespeed_conf.dat' ); File::save( self::$data_file, $data ); } } /** * Update the WP_CACHE variable in the wp-config.php file. * * If enabling, check if the variable is defined, and if not, define it. * Vice versa for disabling. * * @since 1.0.0 * @since 3.0 Refactored * @param bool $enable Whether to enable WP_CACHE. * @throws \Exception If wp-config.php cannot be modified. * @return bool True if updated, false if no change needed. */ public function manage_wp_cache_const( $enable ) { if ( $enable ) { if ( defined( 'WP_CACHE' ) && WP_CACHE ) { return false; } } elseif ( ! defined( 'WP_CACHE' ) || ( defined( 'WP_CACHE' ) && ! WP_CACHE ) ) { return false; } if ( apply_filters( 'litespeed_wpconfig_readonly', false ) ) { throw new \Exception( 'wp-config file is forbidden to modify due to API hook: litespeed_wpconfig_readonly' ); } /** * Follow WP's logic to locate wp-config file * * @see wp-load.php */ $conf_file = ABSPATH . 'wp-config.php'; if ( ! file_exists( $conf_file ) ) { $conf_file = dirname( ABSPATH ) . '/wp-config.php'; } $content = File::read( $conf_file ); if ( ! $content ) { throw new \Exception( 'wp-config file content is empty: ' . wp_kses_post( $conf_file ) ); } // Remove the line `define('WP_CACHE', true/false);` first if ( defined( 'WP_CACHE' ) ) { $content = preg_replace( '/define\(\s*([\'"])WP_CACHE\1\s*,\s*\w+\s*\)\s*;/sU', '', $content ); } // Insert const if ( $enable ) { $content = preg_replace( '/^<\?php/', "<?php\ndefine( 'WP_CACHE', true );", $content ); } $res = File::save( $conf_file, $content, false, false, false ); if ( true !== $res ) { throw new \Exception( 'wp-config.php operation failed when changing `WP_CACHE` const: ' . wp_kses_post( $res ) ); } return true; } /** * Handle auto update * * Enables auto-updates for the plugin if configured. * * @since 2.7.2 * @access public */ public function auto_update() { if ( ! $this->conf( Base::O_AUTO_UPGRADE ) ) { return; } add_filter( 'auto_update_plugin', [ $this, 'auto_update_hook' ], 10, 2 ); } /** * Auto upgrade hook * * Determines whether to auto-update the plugin. * * @since 3.0 * @access public * @param bool $update Whether to update. * @param object $item Plugin data. * @return bool Whether to update. */ public function auto_update_hook( $update, $item ) { if ( ! empty( $item->slug ) && 'litespeed-cache' === $item->slug ) { $auto_v = Cloud::version_check( 'auto_update_plugin' ); if ( ! empty( $auto_v['latest'] ) && ! empty( $item->new_version ) && $auto_v['latest'] === $item->new_version ) { return true; } } return $update; // Else, use the normal API response to decide whether to update or not } /** * Upgrade LSCWP * * Upgrades the LiteSpeed Cache plugin. * * @since 2.9 * @access public */ public function upgrade() { $plugin = Core::PLUGIN_FILE; /** * Load upgrade cls * * @see wp-admin/update.php */ include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; include_once ABSPATH . 'wp-admin/includes/file.php'; include_once ABSPATH . 'wp-admin/includes/misc.php'; try { ob_start(); $skin = new \WP_Ajax_Upgrader_Skin(); $upgrader = new \Plugin_Upgrader( $skin ); $result = $upgrader->upgrade( $plugin ); if ( ! is_plugin_active( $plugin ) ) { // todo: upgrade should reactivate the plugin again by WP. Need to check why disabled after upgraded. activate_plugin( $plugin, '', is_multisite() ); } ob_end_clean(); } catch ( \Exception $e ) { Admin_Display::error( __( 'Failed to upgrade.', 'litespeed-cache' ) ); return; } if ( is_wp_error( $result ) ) { Admin_Display::error( __( 'Failed to upgrade.', 'litespeed-cache' ) ); return; } Admin_Display::success( __( 'Upgraded successfully.', 'litespeed-cache' ) ); } /** * Detect if the plugin is active or not * * @since 1.0 * @access public * @param string $plugin Plugin slug. * @return bool True if active, false otherwise. */ public function dash_notifier_is_plugin_active( $plugin ) { include_once ABSPATH . 'wp-admin/includes/plugin.php'; $plugin_path = $plugin . '/' . $plugin . '.php'; return is_plugin_active( $plugin_path ); } /** * Detect if the plugin is installed or not * * @since 1.0 * @access public * @param string $plugin Plugin slug. * @return bool True if installed, false otherwise. */ public function dash_notifier_is_plugin_installed( $plugin ) { include_once ABSPATH . 'wp-admin/includes/plugin.php'; $plugin_path = $plugin . '/' . $plugin . '.php'; $valid = validate_plugin( $plugin_path ); return ! is_wp_error( $valid ); } /** * Grab a plugin info from WordPress * * @since 1.0 * @access public * @param string $slug Plugin slug. * @return object|false Plugin info or false on failure. */ public function dash_notifier_get_plugin_info( $slug ) { include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; $result = plugins_api( 'plugin_information', [ 'slug' => $slug ] ); if ( is_wp_error( $result ) ) { return false; } return $result; } /** * Install the 3rd party plugin * * Installs and activates a third-party plugin. * * @since 1.0 * @access public */ public function dash_notifier_install_3rd() { ! defined( 'SILENCE_INSTALL' ) && define( 'SILENCE_INSTALL', true ); // phpcs:ignore $slug = ! empty( $_GET['plugin'] ) ? wp_unslash( sanitize_text_field( $_GET['plugin'] ) ) : false; // Check if plugin is installed already if ( ! $slug || $this->dash_notifier_is_plugin_active( $slug ) ) { return; } /** * Load upgrade cls * * @see wp-admin/update.php */ include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; include_once ABSPATH . 'wp-admin/includes/file.php'; include_once ABSPATH . 'wp-admin/includes/misc.php'; $plugin_path = $slug . '/' . $slug . '.php'; if ( ! $this->dash_notifier_is_plugin_installed( $slug ) ) { $plugin_info = $this->dash_notifier_get_plugin_info( $slug ); if ( ! $plugin_info ) { return; } // Try to install plugin try { ob_start(); $skin = new \Automatic_Upgrader_Skin(); $upgrader = new \Plugin_Upgrader( $skin ); $result = $upgrader->install( $plugin_info->download_link ); ob_end_clean(); } catch ( \Exception $e ) { return; } } if ( ! is_plugin_active( $plugin_path ) ) { activate_plugin( $plugin_path ); } } /** * Handle all request actions from main cls * * Processes various activation-related actions. * * @since 2.9 * @access public */ public function handler() { $type = Router::verify_type(); switch ( $type ) { case self::TYPE_UPGRADE: $this->upgrade(); break; case self::TYPE_INSTALL_3RD: $this->dash_notifier_install_3rd(); break; case self::TYPE_DISMISS_RECOMMENDED: Cloud::reload_summary(); Cloud::save_summary( [ 'news.new' => 0 ] ); break; case self::TYPE_INSTALL_ZIP: Cloud::reload_summary(); $summary = Cloud::get_summary(); if ( ! empty( $summary['news.zip'] ) ) { Cloud::save_summary( [ 'news.new' => 0 ] ); $this->cls( 'Debug2' )->beta_test( $summary['zip'] ); } break; default: break; } Admin::redirect(); } } src/purge.cls.php 0000777 00000104643 15251157102 0007764 0 ustar 00 <?php /** * Purge handlers for X-LiteSpeed-Purge. * * @since 1.1.3 * @since 2.2 Refactored. Changed access from public to private for most functions and class variables. * @package LiteSpeed */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Purge */ class Purge extends Base { const LOG_TAG = '🧹'; /** * Public purge tags for X-LiteSpeed-Purge. * * @var array<int,string> */ protected $_pub_purge = []; /** * Public purge tags for X-LiteSpeed-Purge2. * * @var array<int,string> */ protected $_pub_purge2 = []; /** * Private purge tags for X-LiteSpeed-Purge (private section). * * @var array<int,string> */ protected $_priv_purge = []; /** * Whether to purge only current URL (QS helper). * * @var bool */ protected $_purge_single = false; const X_HEADER = 'X-LiteSpeed-Purge'; const X_HEADER2 = 'X-LiteSpeed-Purge2'; const DB_QUEUE = 'queue'; const DB_QUEUE2 = 'queue2'; const TYPE_PURGE_ALL = 'purge_all'; const TYPE_PURGE_ALL_LSCACHE = 'purge_all_lscache'; const TYPE_PURGE_ALL_CSSJS = 'purge_all_cssjs'; const TYPE_PURGE_ALL_LOCALRES = 'purge_all_localres'; const TYPE_PURGE_ALL_CCSS = 'purge_all_ccss'; const TYPE_PURGE_ALL_UCSS = 'purge_all_ucss'; const TYPE_PURGE_ALL_LQIP = 'purge_all_lqip'; const TYPE_PURGE_ALL_VPI = 'purge_all_vpi'; const TYPE_PURGE_ALL_AVATAR = 'purge_all_avatar'; const TYPE_PURGE_ALL_OBJECT = 'purge_all_object'; const TYPE_PURGE_ALL_OPCACHE = 'purge_all_opcache'; const TYPE_PURGE_FRONT = 'purge_front'; const TYPE_PURGE_UCSS = 'purge_ucss'; const TYPE_PURGE_FRONTPAGE = 'purge_frontpage'; const TYPE_PURGE_PAGES = 'purge_pages'; const TYPE_PURGE_ERROR = 'purge_error'; /** * Init hooks. * * @since 3.0 * @return void */ public function init() { $purge_post_events = apply_filters( 'litespeed_purge_post_events', [ 'delete_post', 'wp_trash_post', 'wp_update_comment_count', ] ); foreach ( $purge_post_events as $event ) { add_action( $event, [ $this, 'purge_post' ] ); } // Purge post only when status is/was publish. add_action( 'transition_post_status', [ $this, 'purge_publish' ], 10, 3 ); add_action( 'wp_update_comment_count', [ $this, 'purge_feeds' ] ); if ( $this->conf( self::O_OPTM_UCSS ) ) { add_action( 'edit_post', __NAMESPACE__ . '\Purge::purge_ucss' ); } } /** * Only purge publish related status post. * * @since 3.0 * @param string $new_status New status. * @param string $old_status Old status. * @param \WP_Post $post Post object. * @return void */ public function purge_publish( $new_status, $old_status, $post ) { if ( 'publish' !== $new_status && 'publish' !== $old_status ) { return; } $this->purge_post( $post->ID ); } /** * Handle all request actions from main cls. * * @since 1.8 * @since 7.6 Add VPI clear. * @access public */ public function handler() { $type = Router::verify_type(); switch ( $type ) { case self::TYPE_PURGE_ALL: $this->_purge_all(); break; case self::TYPE_PURGE_ALL_LSCACHE: $this->_purge_all_lscache(); break; case self::TYPE_PURGE_ALL_CSSJS: $this->_purge_all_cssjs(); break; case self::TYPE_PURGE_ALL_LOCALRES: $this->_purge_all_localres(); break; case self::TYPE_PURGE_ALL_CCSS: $this->_purge_all_ccss(); break; case self::TYPE_PURGE_ALL_UCSS: $this->_purge_all_ucss(); break; case self::TYPE_PURGE_ALL_LQIP: $this->_purge_all_lqip(); break; case self::TYPE_PURGE_ALL_VPI: $this->_purge_all_vpi(); break; case self::TYPE_PURGE_ALL_AVATAR: $this->_purge_all_avatar(); break; case self::TYPE_PURGE_ALL_OBJECT: $this->_purge_all_object(); break; case self::TYPE_PURGE_ALL_OPCACHE: $this->purge_all_opcache(); break; case self::TYPE_PURGE_FRONT: $this->_purge_front(); break; case self::TYPE_PURGE_UCSS: $this->_purge_ucss(); break; case self::TYPE_PURGE_FRONTPAGE: $this->_purge_frontpage(); break; case self::TYPE_PURGE_PAGES: $this->_purge_pages(); break; case ( 0 === strpos( $type, self::TYPE_PURGE_ERROR ) ): $this->_purge_error( substr( $type, strlen( self::TYPE_PURGE_ERROR ) ) ); break; default: break; } Admin::redirect(); } /** * Shortcut to purge all lscache. * * @since 1.0.0 * @param string|false $reason Optional reason to log. * @return void */ public static function purge_all( $reason = false ) { self::cls()->_purge_all( $reason ); } /** * Purge all caches (LSCache/CSS/JS/localres/object/opcache). * * @since 2.2 * @param string|false $reason Optional log string. * @return void */ private function _purge_all( $reason = false ) { $this->_purge_all_lscache( true ); $this->_purge_all_cssjs( true ); $this->_purge_all_localres( true ); $this->_purge_all_object( true ); $this->purge_all_opcache( true ); if ( $this->conf( self::O_CDN_CLOUDFLARE_CLEAR ) ) { CDN\Cloudflare::purge_all( 'Purge All' ); } $reason = is_string( $reason ) ? "( $reason )" : ''; self::debug( 'Purge all ' . $reason, 3 ); $msg = __( 'Purged all caches successfully.', 'litespeed-cache' ); if ( ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::success( $msg ); } do_action( 'litespeed_purged_all' ); } /** * Shortcut to purge lscache. * * @since 7.7 * @param string|false $reason Optional reason to log. * @return void */ public static function purge_all_lscache( $reason = false ) { if ( $reason ) { self::debug( 'Purge lscache ' . $reason, 3 ); } self::cls()->_purge_all_lscache(); } /** * Alerts LiteSpeed Web Server to purge all pages. * * @since 2.2 * @param bool $silence If true, don't show admin notice. * @return void */ private function _purge_all_lscache( $silence = false ) { $this->_add( '*' ); do_action( 'litespeed_purged_all_lscache' ); if ( ! $silence ) { $msg = __( 'Notified LiteSpeed Web Server to purge all LSCache entries.', 'litespeed-cache' ); if ( ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::success( $msg ); } } } /** * Delete all critical CSS. * * @since 2.3 * @param bool $silence If true, don't show admin notice. * @return void */ private function _purge_all_ccss( $silence = false ) { do_action( 'litespeed_purged_all_ccss' ); $this->cls( 'CSS' )->rm_cache_folder( 'ccss' ); $this->cls( 'Data' )->url_file_clean( 'ccss' ); if ( ! $silence ) { $msg = __( 'Cleaned all Critical CSS files.', 'litespeed-cache' ); if ( ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::success( $msg ); } } } /** * Delete all unique CSS. * * @since 2.3 * @param bool $silence If true, don't show admin notice. * @return void */ private function _purge_all_ucss( $silence = false ) { do_action( 'litespeed_purged_all_ucss' ); $this->cls( 'CSS' )->rm_cache_folder( 'ucss' ); $this->cls( 'Data' )->url_file_clean( 'ucss' ); if ( ! $silence ) { $msg = __( 'Cleaned all Unique CSS files.', 'litespeed-cache' ); if ( ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::success( $msg ); } } } /** * Purge one UCSS by URL or post ID. * * @since 4.5 * @param int|string $post_id_or_url Post ID or URL. * @return void */ public static function purge_ucss( $post_id_or_url ) { self::debug( 'Purge a single UCSS: ' . $post_id_or_url ); // If is post_id, generate URL. if ( ! preg_match( '/\D/', (string) $post_id_or_url ) ) { $post_id_or_url = get_permalink( (int) $post_id_or_url ); } $post_id_or_url = (string) $post_id_or_url; $permalink_structure = get_option( 'permalink_structure' ); if ( ! empty( $permalink_structure ) ) { $post_id_or_url = trailingslashit( (string) $post_id_or_url ); } $existing_url_files = Data::cls()->mark_as_expired( $post_id_or_url, true ); if ( $existing_url_files ) { self::cls( 'UCSS' )->add_to_q( $existing_url_files ); } } /** * Delete all LQIP images. * * @since 3.0 * @param bool $silence If true, don't show admin notice. * @return void */ private function _purge_all_lqip( $silence = false ) { do_action( 'litespeed_purged_all_lqip' ); $this->cls( 'Placeholder' )->rm_cache_folder( 'lqip' ); if ( ! $silence ) { $msg = __( 'Cleaned all LQIP files.', 'litespeed-cache' ); if ( ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::success( $msg ); } } } /** * Delete all VPI data generated * * @since 7.6 * @param bool $silence If true, don't show admin notice. * @return void * @access private */ private function _purge_all_vpi( $silence = false ) { global $wpdb; do_action( 'litespeed_purged_all_vpi' ); $wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery $wpdb->prepare( 'DELETE FROM `' . $wpdb->postmeta . '` WHERE meta_key = %s', VPI::POST_META ) ); $wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery $wpdb->prepare( 'DELETE FROM `' . $wpdb->postmeta . '` WHERE meta_key = %s', VPI::POST_META_MOBILE ) ); $this->cls( 'Placeholder' )->rm_cache_folder( 'vpi' ); if ( !$silence ) { $msg = __( 'Cleaned all VPI data.', 'litespeed-cache' ); !defined( 'LITESPEED_PURGE_SILENT' ) && Admin_Display::success( $msg ); } } /** * Delete all avatar images * * @since 3.0 * @param bool $silence If true, don't show admin notice. * @return void */ private function _purge_all_avatar( $silence = false ) { do_action( 'litespeed_purged_all_avatar' ); // Clear Database table $this->cls( 'Data' )->table_truncate( 'avatar' ); // Remove the folder $this->cls( 'Avatar' )->rm_cache_folder( 'avatar' ); if ( ! $silence ) { $msg = __( 'Cleaned all Gravatar files.', 'litespeed-cache' ); if ( ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::success( $msg ); } } } /** * Delete all localized resources. * * @since 3.3 * @param bool $silence If true, don't show admin notice. * @return void */ private function _purge_all_localres( $silence = false ) { do_action( 'litespeed_purged_all_localres' ); $this->_add( Tag::TYPE_LOCALRES ); if ( ! $silence ) { $msg = __( 'Cleaned all localized resource entries.', 'litespeed-cache' ); if ( ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::success( $msg ); } } } /** * Purge CSS/JS assets and related LSCache entries. * * @since 1.2.2 * @param bool $silence If true, don't show admin notice. * @return void */ private function _purge_all_cssjs( $silence = false ) { if ( wp_doing_cron() || defined( 'LITESPEED_DID_send_headers' ) ) { self::debug( '❌ Bypassed cssjs delete as header sent (lscache purge after this point will fail) or doing cron' ); return; } $this->_purge_all_lscache( $silence ); // Purge CSSJS must purge lscache too to avoid 404 do_action( 'litespeed_purged_all_cssjs' ); Optimize::update_option( Optimize::ITEM_TIMESTAMP_PURGE_CSS, time() ); $this->_add( Tag::TYPE_MIN ); $this->cls( 'CSS' )->rm_cache_folder( 'css' ); $this->cls( 'CSS' )->rm_cache_folder( 'js' ); $this->cls( 'Data' )->url_file_clean( 'css' ); $this->cls( 'Data' )->url_file_clean( 'js' ); // Clear UCSS queue as it used combined CSS to generate. $this->clear_q( 'ucss', true ); if ( ! $silence ) { $msg = __( 'Notified LiteSpeed Web Server to purge CSS/JS entries.', 'litespeed-cache' ); if ( ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::success( $msg ); } } } /** * Purge opcode cache. * * @since 1.8.2 * @since 7.3 Added test for opcode cache restriction. * @param bool $silence If true, don't show admin notice. * @return bool True on success. */ public function purge_all_opcache( $silence = false ) { if ( ! Router::opcache_enabled() ) { self::debug( '❌ Failed to reset OPcache due to OPcache not enabled' ); if ( ! $silence ) { $msg = __( 'OPcache is not enabled.', 'litespeed-cache' ); if ( ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::error( $msg ); } } return false; } if ( Router::opcache_restricted( __FILE__ ) ) { self::debug( '❌ Failed to reset OPcache due to OPcache is restricted. File requesting the clear is not allowed.' ); if ( ! $silence ) { $msg = sprintf( __( 'OPcache is restricted by %s setting.', 'litespeed-cache' ), '<code>restrict_api</code>' ); if ( ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::error( $msg ); } } return false; } if ( ! opcache_reset() ) { self::debug( '❌ Reset OPcache not worked' ); if ( ! $silence ) { $msg = __( 'Reset the OPcache failed.', 'litespeed-cache' ); if ( ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::success( $msg ); } } return false; } do_action( 'litespeed_purged_all_opcache' ); self::debug( 'Reset OPcache' ); if ( ! $silence ) { $msg = __( 'Reset the entire OPcache successfully.', 'litespeed-cache' ); if ( ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::success( $msg ); } } return true; } /** * Purge object cache (public wrapper). * * @since 3.4 * @param bool $silence If true, don't show admin notice. * @return void */ public static function purge_all_object( $silence = true ) { self::cls()->_purge_all_object( $silence ); } /** * Purge object cache. * * @since 1.8 * @param bool $silence If true, don't show admin notice. * @return bool True on success. */ private function _purge_all_object( $silence = false ) { if ( ! defined( 'LSCWP_OBJECT_CACHE' ) ) { self::debug( 'Failed to flush object cache due to object cache not enabled' ); if ( ! $silence ) { $msg = __( 'Object cache is not enabled.', 'litespeed-cache' ); Admin_Display::error( $msg ); } return false; } do_action( 'litespeed_purged_all_object' ); $this->cls( 'Object_Cache' )->flush(); self::debug( 'Flushed object cache' ); if ( ! $silence ) { $msg = __( 'Purge all object caches successfully.', 'litespeed-cache' ); if ( ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::success( $msg ); } } return true; } /** * Add public purge tags for current request. * * @since 1.1.3 * @param string|array<int,string> $tags Tags to add. * @param bool $purge2 Whether to send via X-LiteSpeed-Purge2. * @return void */ public static function add( $tags, $purge2 = false ) { self::cls()->_add( $tags, $purge2 ); } /** * Add tags to purge list. * * @since 2.2 * @param string|array<int,string> $tags Tags. * @param bool $purge2 Use Purge2 header. * @return void */ private function _add( $tags, $purge2 = false ) { if ( ! is_array( $tags ) ) { $tags = [ $tags ]; } $tags = $this->_prepend_bid( $tags ); if ( ! array_diff( $tags, $purge2 ? $this->_pub_purge2 : $this->_pub_purge ) ) { return; } if ( $purge2 ) { $this->_pub_purge2 = array_unique( array_merge( $this->_pub_purge2, $tags ) ); } else { $this->_pub_purge = array_unique( array_merge( $this->_pub_purge, $tags ) ); } self::debug( 'added ' . implode( ',', $tags ) . ( $purge2 ? ' [Purge2]' : '' ), 8 ); // Send purge header immediately or queue if headers already sent or delayed. $curr_built = $this->_build( $purge2 ); if ( defined( 'LITESPEED_CLI' ) ) { // Can't send, already has output, need to save and wait for next run self::update_option($purge2 ? self::DB_QUEUE2 : self::DB_QUEUE, $curr_built); self::debug( 'CLI request, queue stored: ' . $curr_built ); } else { if ( ! headers_sent() ) { header( $curr_built ); } if ( wp_doing_cron() || defined( 'LITESPEED_DID_send_headers' ) || apply_filters( 'litespeed_delay_purge', false ) ) { self::update_option( $purge2 ? self::DB_QUEUE2 : self::DB_QUEUE, $curr_built ); self::debug( 'Output existed, queue stored: ' . $curr_built ); } self::debug( $curr_built ); } } /** * Add private purge tags for current request. * * @since 1.1.3 * @param string|array<int,string> $tags Tags. * @return void */ public static function add_private( $tags ) { self::cls()->_add_private( $tags ); } /** * Add private ESI tag to purge list. * * @since 3.0 * @param string $tag ESI tag. * @return void */ public static function add_private_esi( $tag ) { self::add_private( Tag::TYPE_ESI . $tag ); } /** * Add private all tag to purge list. * * @since 3.0 * @return void */ public static function add_private_all() { self::add_private( '*' ); } /** * Add private purge tags. * * @since 2.2 * @param string|array<int,string> $tags Tags. * @return void */ private function _add_private( $tags ) { if ( ! is_array( $tags ) ) { $tags = [ $tags ]; } $tags = $this->_prepend_bid( $tags ); if ( ! array_diff( $tags, $this->_priv_purge ) ) { return; } self::debug( 'added [private] ' . implode( ',', $tags ), 3 ); $this->_priv_purge = array_unique( array_merge( $this->_priv_purge, $tags ) ); // Send header immediately or skip if sent. $built = $this->_build(); if ( $built && ! headers_sent() ) { header( $built ); } } /** * Add current blog ID prefix to tags (multisite). * * @since 4.0 * @param array<int,string> $tags Tags. * @return array<int,string> */ private function _prepend_bid( $tags ) { if ( in_array( '*', $tags, true ) ) { return [ '*' ]; } $curr_bid = is_multisite() ? get_current_blog_id() : ''; foreach ( $tags as $k => $v ) { $tags[ $k ] = $curr_bid . '_' . $v; } return $tags; } /** * Activate `purge single url tag` for Admin QS. * * @since 1.1.3 * @return void */ public static function set_purge_single() { self::cls()->_purge_single = true; do_action( 'litespeed_purged_single' ); } /** * Purge frontend url (based on HTTP_REFERER). * * @since 1.3 * @since 2.2 Access changed from public to private, renamed from `frontend_purge`. * @return void */ private function _purge_front() { if ( empty( $_SERVER['HTTP_REFERER'] ) ) { exit( 'no referer' ); } $ref = esc_url_raw( wp_unslash( $_SERVER['HTTP_REFERER'] ) ); $this->purge_url( $ref ); do_action( 'litespeed_purged_front', $ref ); wp_safe_redirect( $ref ); exit; } /** * Purge single UCSS (via referer or `url_tag`). * * @since 4.7 * @return void */ private function _purge_ucss() { if ( empty( $_SERVER['HTTP_REFERER'] ) ) { exit( 'no referer' ); } $ref = esc_url_raw( wp_unslash( $_SERVER['HTTP_REFERER'] ) ); $url_tag = ! empty( $_GET['url_tag'] ) ? sanitize_text_field( wp_unslash( $_GET['url_tag'] ) ) : $ref; // phpcs:ignore WordPress.Security.NonceVerification.Recommended self::debug( 'Purge ucss [url_tag] ' . $url_tag ); do_action( 'litespeed_purge_ucss', $url_tag ); $this->purge_url( $ref ); wp_safe_redirect( $ref ); exit; } /** * Purge the front page. * * @since 1.0.3 * @return void */ private function _purge_frontpage() { $this->_add( Tag::TYPE_FRONTPAGE ); if ( 'LITESPEED_SERVER_OLS' !== LITESPEED_SERVER_TYPE ) { $this->_add_private( Tag::TYPE_FRONTPAGE ); } $msg = __( 'Notified LiteSpeed Web Server to purge the front page.', 'litespeed-cache' ); if ( ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::success( $msg ); } do_action( 'litespeed_purged_frontpage' ); } /** * Purge all pages. * * @since 1.0.15 * @return void */ private function _purge_pages() { $this->_add( Tag::TYPE_PAGES ); $msg = __( 'Notified LiteSpeed Web Server to purge all pages.', 'litespeed-cache' ); if ( ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::success( $msg ); } do_action( 'litespeed_purged_pages' ); } /** * Purge error pages (403/404/500). * * @since 1.0.14 * @param string|false $type Error type. * @return void */ private function _purge_error( $type = false ) { $this->_add( Tag::TYPE_HTTP ); if ( ! $type || ! in_array( (string) $type, [ '403', '404', '500' ], true ) ) { return; } $this->_add( Tag::TYPE_HTTP . $type ); $msg = __( 'Notified LiteSpeed Web Server to purge error pages.', 'litespeed-cache' ); if ( ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::success( $msg ); } } /** * Purge selected category by slug. * * @since 1.0.7 * @param string $value Category slug. * @return void */ public function purge_cat( $value ) { $val = trim( (string) $value ); if ( '' === $val ) { return; } if ( 0 === preg_match( '/^[a-zA-Z0-9-]+$/', $val ) ) { self::debug( "$val cat invalid" ); return; } $cat = get_category_by_slug( $val ); if ( false === $cat ) { self::debug( "$val cat not existed/published" ); return; } self::add( Tag::TYPE_ARCHIVE_TERM . $cat->term_id ); if ( ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::success( sprintf( __( 'Purge category %s', 'litespeed-cache' ), $val ) ); } do_action( 'litespeed_purged_cat', $value ); } /** * Purge selected tag by slug. * * @since 1.0.7 * @param string $val Tag slug. * @return void */ public function purge_tag( $val ) { $val = trim( (string) $val ); if ( '' === $val ) { return; } if ( 0 === preg_match( '/^[a-zA-Z0-9-]+$/', $val ) ) { self::debug( "$val tag invalid" ); return; } $term = get_term_by( 'slug', $val, 'post_tag' ); if ( false === $term ) { self::debug( "$val tag not exist" ); return; } self::add( Tag::TYPE_ARCHIVE_TERM . $term->term_id ); if ( ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::success( sprintf( __( 'Purge tag %s', 'litespeed-cache' ), $val ) ); } do_action( 'litespeed_purged_tag', $val ); } /** * Purge selected url (relative allowed). * * @since 1.0.7 * @param string $url URL. * @param bool $purge2 Use Purge2 header. * @param bool $quite If true, do not show admin notice. * @return void */ public function purge_url( $url, $purge2 = false, $quite = false ) { $val = trim( (string) $url ); if ( '' === $val ) { return; } if ( false !== strpos( $val, '<' ) ) { self::debug( "$val url contains <" ); return; } $val = Utility::make_relative( $val ); $hash = Tag::get_uri_tag( $val ); if ( false === $hash ) { self::debug( "$val url invalid" ); return; } self::add( $hash, $purge2 ); if ( ! $quite && ! defined( 'LITESPEED_PURGE_SILENT' ) ) { Admin_Display::success( sprintf( __( 'Purge url %s', 'litespeed-cache' ), $val ) ); } do_action( 'litespeed_purged_link', $url ); } /** * Purge a list based on admin selection. * * @since 1.0.7 * @return void */ public function purge_list() { if ( ! isset( $_REQUEST[ Admin_Display::PURGEBYOPT_SELECT ], $_REQUEST[ Admin_Display::PURGEBYOPT_LIST ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended return; } $sel = sanitize_text_field( wp_unslash( $_REQUEST[ Admin_Display::PURGEBYOPT_SELECT ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended $list_buf = sanitize_textarea_field( wp_unslash( $_REQUEST[ Admin_Display::PURGEBYOPT_LIST ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( '' === $list_buf ) { return; } $list_buf = str_replace( ',', "\n", $list_buf ); $raw_list = explode( "\n", $list_buf ); switch ( $sel ) { case Admin_Display::PURGEBY_CAT: $cb = 'purge_cat'; break; case Admin_Display::PURGEBY_PID: $cb = 'purge_post'; break; case Admin_Display::PURGEBY_TAG: $cb = 'purge_tag'; break; case Admin_Display::PURGEBY_URL: $cb = 'purge_url'; break; default: return; } array_map( [ $this, $cb ], $raw_list ); // For redirection (safe copy back to GET). $_GET[ Admin_Display::PURGEBYOPT_SELECT ] = $sel; // phpcs:ignore WordPress.Security.NonceVerification.Recommended } /** * Purge ESI. * * @since 3.0 * @param string $tag ESI tag. * @return void */ public static function purge_esi( $tag ) { self::add( Tag::TYPE_ESI . $tag ); do_action( 'litespeed_purged_esi', $tag ); } /** * Purge a certain post type. * * @since 3.0 * @param string $post_type Post type. * @return void */ public static function purge_posttype( $post_type ) { self::add( Tag::TYPE_ARCHIVE_POSTTYPE . $post_type ); self::add( $post_type ); do_action( 'litespeed_purged_posttype', $post_type ); } /** * Purge all related tags to a post. * * @since 1.0.0 * @param int $pid Post ID. * @return void */ public function purge_post( $pid ) { $pid = (int) $pid; // Ignore the status we don't care. $status = get_post_status( $pid ); if ( ! $pid || ! in_array( $status, [ 'publish', 'trash', 'private', 'draft' ], true ) ) { return; } $purge_tags = $this->_get_purge_tags_by_post( $pid ); if ( ! $purge_tags ) { return; } self::add( $purge_tags ); if ( $this->conf( self::O_CACHE_REST ) ) { self::add( Tag::TYPE_REST ); } do_action( 'litespeed_purged_post', $pid ); } /** * Purge a widget by ID (or discover Recent Comments widget). * * Hooked to load-widgets.php. * * @since 1.1.3 * @param string|null $widget_id Widget ID. * @return void */ public static function purge_widget( $widget_id = null ) { if ( null === $widget_id ) { if ( empty( $_POST['widget-id'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing return; } $widget_id = sanitize_text_field( wp_unslash( $_POST['widget-id'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing if ( '' === $widget_id ) { return; } } self::add( Tag::TYPE_WIDGET . $widget_id ); self::add_private( Tag::TYPE_WIDGET . $widget_id ); do_action( 'litespeed_purged_widget', $widget_id ); } /** * Purges the comment widget when the count is updated. * * @since 1.1.3 * @global \WP_Widget_Factory $wp_widget_factory * @return void */ public static function purge_comment_widget() { global $wp_widget_factory; if ( ! isset( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'] ) ) { return; } $recent_comments = $wp_widget_factory->widgets['WP_Widget_Recent_Comments']; if ( null !== $recent_comments ) { self::add( Tag::TYPE_WIDGET . $recent_comments->id ); self::add_private( Tag::TYPE_WIDGET . $recent_comments->id ); do_action( 'litespeed_purged_comment_widget', $recent_comments->id ); } } /** * Purges feeds on comment count update. * * @since 1.0.9 * @return void */ public function purge_feeds() { if ( $this->conf( self::O_CACHE_TTL_FEED ) > 0 ) { self::add( Tag::TYPE_FEED ); } do_action( 'litespeed_purged_feeds' ); } /** * Purges all private cache entries when the user logs out. * * @since 1.1.3 * @return void */ public static function purge_on_logout() { self::add_private_all(); do_action( 'litespeed_purged_on_logout' ); } /** * Finalize purge tags before output. * * @since 1.1.3 * @return void */ private function _finalize() { if ( ! defined( 'LITESPEED_DID_' . __FUNCTION__ ) ) { define( 'LITESPEED_DID_' . __FUNCTION__, true ); } else { return; } do_action( 'litespeed_purge_finalize' ); // Append unique uri purge tags if Admin QS is `PURGESINGLE` or `PURGE`. if ( $this->_purge_single ) { $tags = [ Tag::build_uri_tag() ]; $this->_pub_purge = array_merge( $this->_pub_purge, $this->_prepend_bid( $tags ) ); } if ( ! empty( $this->_pub_purge ) ) { $this->_pub_purge = array_unique( $this->_pub_purge ); } if ( ! empty( $this->_priv_purge ) ) { $this->_priv_purge = array_unique( $this->_priv_purge ); } } /** * Gather and return purge header string. * * @since 1.1.0 * @return string Purge header line. */ public static function output() { $instance = self::cls(); $instance->_finalize(); return $instance->_build(); } /** * Build the current purge header(s). * * @since 1.1.5 * @param bool $purge2 Whether to build X-LiteSpeed-Purge2. * @return string Purge header line. */ private function _build( $purge2 = false ) { if ( $purge2 ) { if ( empty( $this->_pub_purge2 ) ) { return ''; } } elseif ( empty( $this->_pub_purge ) && empty( $this->_priv_purge ) ) { return ''; } $purge_header = ''; $private_prefix = self::X_HEADER . ': private,'; // Handle purge2. if ( $purge2 ) { $public_tags = $this->_append_prefix( $this->_pub_purge2 ); if ( empty( $public_tags ) ) { return ''; } $purge_header = self::X_HEADER2 . ': public,'; if ( Control::is_stale() ) { $purge_header .= 'stale,'; } $purge_header .= implode( ',', $public_tags ); return $purge_header; } if ( ! empty( $this->_pub_purge ) ) { $public_tags = $this->_append_prefix( $this->_pub_purge ); if ( empty( $public_tags ) ) { return ''; // If this ends up empty, private will also end up empty } $purge_header = self::X_HEADER . ': public,'; if ( Control::is_stale() ) { $purge_header .= 'stale,'; } $purge_header .= implode( ',', $public_tags ); $private_prefix = ';private,'; } // Private purge tags. if ( ! empty( $this->_priv_purge ) ) { $private_tags = $this->_append_prefix( $this->_priv_purge, true ); $purge_header .= $private_prefix . implode( ',', $private_tags ); } return $purge_header; } /** * Append LS tag prefix to tags; handle '*' across network. * * @since 1.1.0 * @param array<int,string> $purge_tags Tags. * @param bool $is_private Private tags. * @return array<int,string> */ private function _append_prefix( $purge_tags, $is_private = false ) { $curr_bid = is_multisite() ? get_current_blog_id() : ''; $purge_tags = apply_filters( 'litespeed_purge_tags', $purge_tags, $is_private ); if ( ! in_array( '*', $purge_tags, true ) ) { $tags = []; foreach ( $purge_tags as $val ) { $tags[] = LSWCP_TAG_PREFIX . $val; } return $tags; } // Purge All: maybe reset crawler. if ( ! $is_private && $this->conf( self::O_CRAWLER ) ) { Crawler::cls()->reset_pos(); } if ( ( defined( 'LSWCP_EMPTYCACHE' ) && LSWCP_EMPTYCACHE ) || $is_private ) { return [ '*' ]; } if ( is_multisite() && ! $this->_is_subsite_purge() ) { $blogs = Activation::get_network_ids(); if ( empty( $blogs ) ) { self::debug( 'build_purge_headers: blog list is empty' ); return []; } $tags = []; foreach ( $blogs as $blog_id ) { $tags[] = LSWCP_TAG_PREFIX . $blog_id . '_'; } return $tags; } return [ LSWCP_TAG_PREFIX . $curr_bid . '_' ]; } /** * Check if this is a subsite purge in multisite. * * @since 4.0 * @return bool */ private function _is_subsite_purge() { if ( ! is_multisite() ) { return false; } if ( is_network_admin() ) { return false; } if ( defined( 'LSWCP_EMPTYCACHE' ) && LSWCP_EMPTYCACHE ) { return false; } // Ajax network contexts. if ( Router::is_ajax() && ( check_ajax_referer( 'updates', false, false ) || check_ajax_referer( 'litespeed-purgeall-network', false, false ) ) ) { return false; } return true; } /** * Get purge tags related to a post. * * @since 1.0.0 * @param int $post_id Post ID. * @return array<int,string> */ private function _get_purge_tags_by_post( $post_id ) { if ( $this->conf( self::O_PURGE_POST_ALL ) ) { return [ '*' ]; } do_action( 'litespeed_api_purge_post', $post_id ); $purge_tags = []; // Post itself. $purge_tags[] = Tag::TYPE_POST . $post_id; $post_status = get_post_status( $post_id ); if ( function_exists( 'is_post_status_viewable' ) && is_post_status_viewable( $post_status ) ) { $purge_tags[] = Tag::get_uri_tag( wp_make_link_relative( get_permalink( $post_id ) ) ); } // Avoid overriding global $post: use explicit post object. $the_post = get_post( $post_id ); $post_type = $the_post ? $the_post->post_type : ''; // Widgets: recent posts. global $wp_widget_factory; $recent_posts = isset( $wp_widget_factory->widgets['WP_Widget_Recent_Posts'] ) ? $wp_widget_factory->widgets['WP_Widget_Recent_Posts'] : null; if ( null !== $recent_posts ) { $purge_tags[] = Tag::TYPE_WIDGET . $recent_posts->id; } // get adjacent posts id as related post tag if ( 'post' === $post_type ) { $prev_post = get_previous_post(); $next_post = get_next_post(); if ( ! empty( $prev_post->ID ) ) { $purge_tags[] = Tag::TYPE_POST . $prev_post->ID; self::debug( '--------purge_tags prev is: ' . $prev_post->ID ); } if ( ! empty( $next_post->ID ) ) { $purge_tags[] = Tag::TYPE_POST . $next_post->ID; self::debug( '--------purge_tags next is: ' . $next_post->ID ); } } if ( $this->conf( self::O_PURGE_POST_TERM ) ) { $taxonomies = get_object_taxonomies( $post_type ); // self::debug('purge by post, check tax = ' . var_export($taxonomies, true)); foreach ( $taxonomies as $tax ) { $terms = get_the_terms( $post_id, $tax ); if ( ! empty( $terms ) ) { foreach ( $terms as $term ) { $purge_tags[] = Tag::TYPE_ARCHIVE_TERM . $term->term_id; } } } } if ( $this->conf( self::O_CACHE_TTL_FEED ) ) { $purge_tags[] = Tag::TYPE_FEED; } // Author archives. if ( $this->conf( self::O_PURGE_POST_AUTHOR ) ) { $purge_tags[] = Tag::TYPE_AUTHOR . get_post_field( 'post_author', $post_id ); } // Post type archives. if ( $this->conf( self::O_PURGE_POST_POSTTYPE ) && get_post_type_archive_link( $post_type ) ) { $purge_tags[] = Tag::TYPE_ARCHIVE_POSTTYPE . $post_type; $purge_tags[] = $post_type; } if ( $this->conf( self::O_PURGE_POST_FRONTPAGE ) ) { $purge_tags[] = Tag::TYPE_FRONTPAGE; } if ( $this->conf( self::O_PURGE_POST_HOMEPAGE ) ) { $purge_tags[] = Tag::TYPE_HOME; } if ( $this->conf( self::O_PURGE_POST_PAGES ) ) { $purge_tags[] = Tag::TYPE_PAGES; } if ( $this->conf( self::O_PURGE_POST_PAGES_WITH_RECENT_POSTS ) ) { $purge_tags[] = Tag::TYPE_PAGES_WITH_RECENT_POSTS; } // Date archives (use gmdate as per WPCS). $date_gmt = $the_post ? strtotime( $the_post->post_date_gmt ) : false; if ( $date_gmt ) { if ( $this->conf( self::O_PURGE_POST_DATE ) ) { $purge_tags[] = Tag::TYPE_ARCHIVE_DATE . gmdate( 'Ymd', $date_gmt ); } if ( $this->conf( self::O_PURGE_POST_MONTH ) ) { $purge_tags[] = Tag::TYPE_ARCHIVE_DATE . gmdate( 'Ym', $date_gmt ); } if ( $this->conf( self::O_PURGE_POST_YEAR ) ) { $purge_tags[] = Tag::TYPE_ARCHIVE_DATE . gmdate( 'Y', $date_gmt ); } } return array_unique( array_filter( $purge_tags ) ); } /** * Run a filter and also purge all (utility for hooks). * * @since 1.1.5 * @param string $val Filter value. * @return string Same value. */ public static function filter_with_purge_all( $val ) { self::purge_all(); return $val; } } src/data.upgrade.func.php 0000777 00000013340 15251157102 0011344 0 ustar 00 <?php /** * Database upgrade funcs * * NOTE: whenever called this file, always call Data::get_upgrade_lock and Data::_set_upgrade_lock first. * * @package LiteSpeed * @since 3.0 */ defined( 'WPINC' ) || exit(); use LiteSpeed\Debug2; use LiteSpeed\Cloud; use LiteSpeed\Conf; /** * Check whether a DB table exists. * * @since 7.2 * * @param string $table_name Fully-qualified table name. * @return bool */ function litespeed_table_exists( $table_name ) { global $wpdb; $save_state = $wpdb->suppress_errors; $wpdb->suppress_errors( true ); // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnquotedComplexPlaceholder, WordPress.DB.DirectDatabaseQuery.DirectQuery $tb_exists = $wpdb->get_var( $wpdb->prepare( 'DESCRIBE `%1s`', $table_name ) ); $wpdb->suppress_errors( $save_state ); return null !== $tb_exists; } /** * Migrate v7.0- url_files URL from no trailing slash to trailing slash. * * @since 7.0.1 * @return void */ function litespeed_update_7_0_1() { global $wpdb; Debug2::debug( '[Data] v7.0.1 upgrade started' ); $tb_url = $wpdb->prefix . 'litespeed_url'; if ( ! litespeed_table_exists( $tb_url ) ) { Debug2::debug( '[Data] Table `litespeed_url` not found, bypassed migration' ); return; } // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery $list = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `{$tb_url}` WHERE url LIKE %s", 'https://%/' ), ARRAY_A ); $existing_urls = array(); if ($list) { foreach ($list as $v) { $existing_urls[] = $v['url']; } } // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery $list = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `{$tb_url}` WHERE url LIKE %s", 'https://%' ), ARRAY_A ); if ( ! $list ) { return; } foreach ( $list as $v ) { if ( '/' === substr( $v['url'], -1 ) ) { continue; } $new_url = $v['url'] . '/'; if ( in_array( $new_url, $existing_urls, true ) ) { continue; } // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery $wpdb->query( $wpdb->prepare( "UPDATE `{$tb_url}` SET url = %s WHERE id = %d", $new_url, $v['id'] ) ); } } /** * Migrate from domain key to pk/sk for QC * * @since 7.0 */ function litespeed_update_7() { Debug2::debug('[Data] v7 upgrade started'); $__cloud = Cloud::cls(); $domain_key = $__cloud->conf('api_key'); if (!$domain_key) { Debug2::debug('[Data] No domain key, bypassed migration'); return; } $new_prepared = $__cloud->init_qc_prepare(); if (!$new_prepared && $__cloud->activated()) { Debug2::debug('[Data] QC previously activated in v7, bypassed migration'); return; } $data = array( 'domain_key' => $domain_key, ); $resp = $__cloud->post(Cloud::SVC_D_V3UPGRADE, $data); if ( ! empty( $resp['qc_activated'] ) ) { if ( 'deleted' !== $resp['qc_activated'] ) { $cloud_summary_updates = array( 'qc_activated' => $resp['qc_activated'] ); if (!empty($resp['main_domain'])) { $cloud_summary_updates['main_domain'] = $resp['main_domain']; } Cloud::save_summary($cloud_summary_updates); Debug2::debug('[Data] Updated QC activated status to ' . $resp['qc_activated']); } } } /** * Drop deprecated guest_ips and guest_uas from DB options. * Migrate url table to make all links trailing slash for UCSS/CCSS. * * These values are now read from files instead. * * @since 7.7 */ function litespeed_update_7_7() { global $wpdb; Debug2::debug( '[Data] v7.7 upgrade: dropping guest_ips/guest_uas options' ); Conf::delete_option( 'conf.guest_ips' ); Conf::delete_option( 'conf.guest_uas' ); Conf::delete_site_option( 'conf.guest_ips' ); Conf::delete_site_option( 'conf.guest_uas' ); // Normalize all URLs to have trailing slash to match UCSS/CCSS generation logic Debug2::debug( '[Data] v7.7 upgrade: normalizing URL trailing slashes' ); // Skip if plain permalink mode (no trailing slash) $permalink_structure = get_option( 'permalink_structure' ); if ( empty( $permalink_structure ) ) { Debug2::debug( '[Data] Plain permalink mode, bypassed URL trailing slash migration' ); return; } $tb_url = $wpdb->prefix . 'litespeed_url'; if ( ! litespeed_table_exists( $tb_url ) ) { Debug2::debug( '[Data] Table `litespeed_url` not found, bypassed URL migration' ); return; } // Check if there are URLs without trailing slash (exclude URLs with query string) // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery $count = $wpdb->get_var( "SELECT COUNT(*) FROM `{$tb_url}` WHERE url LIKE 'https://%' AND url NOT LIKE '%/' AND url NOT LIKE '%?%'" ); if ( ! $count ) { Debug2::debug( '[Data] No URLs without trailing slash found, bypassed' ); return; } // Append trailing slash to all URLs that don't have one and don't have duplicate with slash (exclude URLs with query string) // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery $wpdb->query( "UPDATE `{$tb_url}` SET url = CONCAT(url, '/') WHERE url LIKE 'https://%' AND url NOT LIKE '%/' AND url NOT LIKE '%?%' AND CONCAT(url, '/') NOT IN (SELECT * FROM (SELECT url FROM `{$tb_url}` WHERE url LIKE '%/') AS tmp)" ); } /** * Append webp/mobile to url_file * * @since 5.3 */ function litespeed_update_5_3() { global $wpdb; Debug2::debug('[Data] Upgrade url_file table'); $tb = $wpdb->prefix . 'litespeed_url_file'; if ( litespeed_table_exists( $tb ) ) { $q = "ALTER TABLE `{$tb}` ADD COLUMN `mobile` tinyint(4) NOT NULL COMMENT 'mobile=1', ADD COLUMN `webp` tinyint(4) NOT NULL COMMENT 'webp=1' "; // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery $wpdb->query( $q ); } } src/debug2.cls.php 0000777 00000042064 15251157102 0010010 0 ustar 00 <?php /** * The plugin logging class. * * @package LiteSpeed * @since 1.1.2 */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Centralized debug logging utilities for LiteSpeed Cache. */ class Debug2 extends Root { /** * Active log file path. * * @var string */ private static $log_path; /** * Directory prefix for all log files. * * @var string */ private static $log_path_prefix; /** * Request-specific log line prefix. * * @var string */ private static $_prefix; const TYPE_CLEAR_LOG = 'clear_log'; const TYPE_BETA_TEST = 'beta_test'; const BETA_TEST_URL = 'beta_test_url'; const BETA_TEST_URL_WP = 'https://downloads.wordpress.org/plugin/litespeed-cache.zip'; /** * Constructor. * * NOTE: until LSCWP_LOG is defined, calls to WP filters are not logged to * avoid a recursion loop inside log_filters(). * * @since 1.1.2 * @access public */ public function __construct() { self::$log_path_prefix = LITESPEED_STATIC_DIR . '/debug/'; // Maybe move legacy log files $this->_maybe_init_folder(); self::$log_path = $this->path( 'debug' ); $ua = isset( $_SERVER['HTTP_USER_AGENT'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) : ''; if ( '' !== $ua && 0 === strpos( $ua, 'lscache_' ) ) { self::$log_path = $this->path( 'crawler' ); } ! defined( 'LSCWP_LOG_TAG' ) && define( 'LSCWP_LOG_TAG', get_current_blog_id() ); if ( $this->conf( Base::O_DEBUG_LEVEL ) ) { ! defined( 'LSCWP_LOG_MORE' ) && define( 'LSCWP_LOG_MORE', true ); } defined( 'LSCWP_DEBUG_EXC_STRINGS' ) || define( 'LSCWP_DEBUG_EXC_STRINGS', $this->conf( Base::O_DEBUG_EXC_STRINGS ) ); } /** * Disable all functionalities temporarily (toggle). * * @since 7.4 * @access public * * @param int $time How long (in seconds) to disable LSC functions. */ public static function tmp_disable( $time = 86400 ) { $conf = Conf::cls(); $disabled = self::cls()->conf( Base::DEBUG_TMP_DISABLE ); if ( 0 === $disabled ) { $conf->update_confs( [ Base::DEBUG_TMP_DISABLE => time() + (int) $time ] ); self::debug2( 'LiteSpeed Cache temporary disabled.' ); return; } $conf->update_confs( [ Base::DEBUG_TMP_DISABLE => 0 ] ); self::debug2( 'LiteSpeed Cache reactivated.' ); } /** * Is the temporary disable active? If expired, re-enable. * * @since 7.4 * @access public * * @return bool */ public static function is_tmp_disable() { $disabled_time = self::cls()->conf( Base::DEBUG_TMP_DISABLE ); if ( 0 === $disabled_time ) { return false; } if ( time() < (int) $disabled_time ) { return true; } Conf::cls()->update_confs( [ Base::DEBUG_TMP_DISABLE => 0 ] ); return false; } /** * Ensure log directory exists and move legacy logs into it. * * @since 6.5 * @access private */ private function _maybe_init_folder() { if ( file_exists( self::$log_path_prefix . 'index.php' ) ) { return; } File::save( self::$log_path_prefix . 'index.php', '<?php // Silence is golden.', true ); $logs = [ 'debug', 'debug.purge', 'crawler' ]; foreach ( $logs as $log ) { $old_path = LSCWP_CONTENT_DIR . '/' . $log . '.log'; $new_path = $this->path( $log ); if ( file_exists( $old_path ) && ! file_exists( $new_path ) ) { // phpcs:ignore WordPress.WP.AlternativeFunctions.rename_rename -- Moving legacy log files during migration rename( $old_path, $new_path ); } } } /** * Get absolute path for a log type. * * @since 6.5 * @param string $type Log type (debug|purge|crawler). * @return string */ public function path( $type ) { return self::$log_path_prefix . self::FilePath( $type ); } /** * Get fixed filename for a log type. * * @since 6.5 * @param string $type Log type (debug|debug.purge|crawler). * @return string */ public static function FilePath( $type ) { if ( 'debug.purge' === $type ) { $type = 'purge'; } $key = defined( 'AUTH_KEY' ) ? AUTH_KEY : md5( __FILE__ ); $rand = substr( md5( substr( $key, -16 ) ), -16 ); return $type . $rand . '.log'; } /** * Write end-of-request markers and response timing. * * @since 4.7 * @access public * @return void */ public static function ended() { $headers = headers_list(); foreach ( $headers as $key => $header ) { if ( 0 === stripos( $header, 'Set-Cookie' ) ) { unset( $headers[ $key ] ); } } self::debug( 'Response headers', $headers ); $elapsed_time = number_format( ( microtime( true ) - LSCWP_TS_0 ) * 1000, 2 ); self::debug( "End response\n--------------------------------------------------Duration: " . $elapsed_time . " ms------------------------------\n" ); } /** * Run beta test upgrade. Accepts a direct ZIP URL or attempts to derive one. * * @since 2.9.5 * @access public * * @param string|false $zip ZIP URL or false to read from request. * @return void */ public function beta_test( $zip = false ) { if ( ! $zip ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( empty( $_REQUEST[ self::BETA_TEST_URL ] ) ) { return; } // phpcs:ignore WordPress.Security.NonceVerification.Recommended $zip = sanitize_text_field( wp_unslash( $_REQUEST[ self::BETA_TEST_URL ] ) ); if ( self::BETA_TEST_URL_WP !== $zip ) { if ( 'latest' === $zip ) { $zip = self::BETA_TEST_URL_WP; } else { // Generate zip url $zip = $this->_package_zip( $zip ); } } } if ( ! $zip ) { self::debug( '[Debug2] ❌ No ZIP file' ); return; } self::debug( '[Debug2] ZIP file ' . $zip ); $update_plugins = get_site_transient( 'update_plugins' ); if ( ! is_object( $update_plugins ) ) { $update_plugins = new \stdClass(); } $plugin_info = new \stdClass(); $plugin_info->new_version = Core::VER; $plugin_info->slug = Core::PLUGIN_NAME; $plugin_info->plugin = Core::PLUGIN_FILE; $plugin_info->package = $zip; $plugin_info->url = 'https://wordpress.org/plugins/litespeed-cache/'; $update_plugins->response[ Core::PLUGIN_FILE ] = $plugin_info; set_site_transient( 'update_plugins', $update_plugins ); Activation::cls()->upgrade(); } /** * Resolve a GitHub commit-ish into a downloadable ZIP URL via QC API. * * @since 2.9.5 * @access private * * @param string $commit Commit hash/branch/tag. * @return string|false */ private function _package_zip( $commit ) { $data = [ 'commit' => $commit, ]; $res = Cloud::get( Cloud::API_BETA_TEST, $data ); if ( empty( $res['zip'] ) ) { return false; } return $res['zip']; } /** * Write purge headers into a dedicated purge log. * * @since 2.7 * @access public * * @param string $purge_header The Purge header value. * @return void */ public static function log_purge( $purge_header ) { if ( ! defined( 'LSCWP_LOG' ) && ! defined( 'LSCWP_LOG_BYPASS_NOTADMIN' ) ) { return; } $purge_file = self::cls()->path( 'purge' ); self::cls()->_init_request( $purge_file ); $msg = $purge_header . self::_backtrace_info( 6 ); File::append( $purge_file, self::format_message( $msg ) ); } /** * Initialize logging for current request if enabled. * * @since 1.1.0 * @access public * @return void */ public function init() { if ( defined( 'LSCWP_LOG' ) ) { return; } $debug = $this->conf( Base::O_DEBUG ); if ( Base::VAL_ON2 === $debug ) { if ( ! $this->cls( 'Router' )->is_admin_ip() ) { defined( 'LSCWP_LOG_BYPASS_NOTADMIN' ) || define( 'LSCWP_LOG_BYPASS_NOTADMIN', true ); return; } } /** * Check if hit URI includes/excludes * This is after LSCWP_LOG_BYPASS_NOTADMIN to make `log_purge()` still work * * @since 3.0 */ $list = $this->conf( Base::O_DEBUG_INC ); if ( $list ) { $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; $result = Utility::str_hit_array( $request_uri, $list ); if ( ! $result ) { return; } } $list = $this->conf( Base::O_DEBUG_EXC ); if ( $list ) { $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; $result = Utility::str_hit_array( $request_uri, $list ); if ( $result ) { return; } } if ( ! defined( 'LSCWP_LOG' ) ) { $this->_init_request(); define( 'LSCWP_LOG', true ); } } /** * Create the initial log record with request context. * * @since 1.0.12 * @access private * * @param string|null $log_file Optional specific log file path. * @return void */ private function _init_request( $log_file = null ) { if ( ! $log_file ) { $log_file = self::$log_path; } // Rotate if exceeding configured size (MiB). $log_file_size = (int) $this->conf( Base::O_DEBUG_FILESIZE ); if ( file_exists( $log_file ) && filesize( $log_file ) > $log_file_size * 1000000 ) { File::save( $log_file, '' ); } // Add extra spacing if last write was > 2 seconds ago. if ( file_exists( $log_file ) && ( time() - filemtime( $log_file ) ) > 2 ) { File::append( $log_file, "\n\n\n\n" ); } if ( 'cli' === PHP_SAPI ) { return; } $servervars = array( 'Query String' => '', 'HTTP_ACCEPT' => '', 'HTTP_USER_AGENT' => '', 'HTTP_ACCEPT_ENCODING' => '', 'HTTP_COOKIE' => '', 'REQUEST_METHOD' => '', 'SERVER_PROTOCOL' => '', 'X-LSCACHE' => '', 'LSCACHE_VARY_COOKIE' => '', 'LSCACHE_VARY_VALUE' => '', 'ESI_CONTENT_TYPE' => '', ); $server = array_merge($servervars, $_SERVER); $params = array(); if ( isset( $_SERVER['HTTPS'] ) && 'on' === $_SERVER['HTTPS'] ) { $server['SERVER_PROTOCOL'] .= ' (HTTPS) '; } $param = sprintf('💓 ------%s %s %s', $server['REQUEST_METHOD'], $server['SERVER_PROTOCOL'], strtok($server['REQUEST_URI'], '?')); $qs = !empty($server['QUERY_STRING']) ? $server['QUERY_STRING'] : ''; if ( $this->conf( Base::O_DEBUG_COLLAPSE_QS ) ) { $qs = $this->_omit_long_message( $qs ); if ( $qs ) { $param .= ' ? ' . $qs; } $params[] = $param; } else { $params[] = $param; $params[] = 'Query String: ' . $qs; } if ( ! empty( $server['HTTP_REFERER'] ) ) { $params[] = 'HTTP_REFERER: ' . $this->_omit_long_message( $server['HTTP_REFERER'] ); } if ( defined( 'LSCWP_LOG_MORE' ) ) { $params[] = 'User Agent: ' . $this->_omit_long_message( $server['HTTP_USER_AGENT'] ); $params[] = 'Accept: ' . $server['HTTP_ACCEPT']; $params[] = 'Accept Encoding: ' . $server['HTTP_ACCEPT_ENCODING']; } if ( isset( $_COOKIE['_lscache_vary'] ) ) { $params[] = 'Cookie _lscache_vary: ' . sanitize_text_field( wp_unslash( $_COOKIE['_lscache_vary'] ) ); } if ( defined( 'LSCWP_LOG_MORE' ) ) { $params[] = 'X-LSCACHE: ' . ( ! empty( $server['X-LSCACHE'] ) ? 'true' : 'false' ); } if ( $server['LSCACHE_VARY_COOKIE'] ) { $params[] = 'LSCACHE_VARY_COOKIE: ' . $server['LSCACHE_VARY_COOKIE']; } if ( $server['LSCACHE_VARY_VALUE'] ) { $params[] = 'LSCACHE_VARY_VALUE: ' . $server['LSCACHE_VARY_VALUE']; } if ( $server['ESI_CONTENT_TYPE'] ) { $params[] = 'ESI_CONTENT_TYPE: ' . $server['ESI_CONTENT_TYPE']; } $request = array_map( __CLASS__ . '::format_message', $params ); File::append( $log_file, $request ); } /** * Trim long message to keep logs compact. * * @since 6.3 * @param string $msg Message. * @return string */ private function _omit_long_message( $msg ) { if ( strlen( $msg ) > 53 ) { $msg = substr( $msg, 0, 53 ) . '...'; } return $msg; } /** * Format a single log line with timestamp and prefix. * * @since 1.0.12 * @access private * * @param string $msg Message to log. * @return string Formatted line. */ private static function format_message( $msg ) { if ( ! defined( 'LSCWP_LOG_TAG' ) ) { return $msg . "\n"; } if ( ! isset( self::$_prefix ) ) { // address/identity. if ( 'cli' === PHP_SAPI ) { $addr = '=CLI='; if ( isset( $_SERVER['USER'] ) ) { $addr .= sanitize_text_field( wp_unslash( $_SERVER['USER'] ) ); } elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { $addr .= sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ); } } else { $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : ''; $port = isset( $_SERVER['REMOTE_PORT'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_PORT'] ) ) : ''; $addr = "$ip:$port"; } self::$_prefix = sprintf( ' [%s %s %s] ', $addr, LSCWP_LOG_TAG, Str::rrand( 3 ) ); } list( $usec, $sec ) = explode( ' ', microtime() ); // Use gmdate to avoid tz-related warnings; apply offset if defined. $ts = gmdate( 'm/d/y H:i:s', (int) $sec + ( defined( 'LITESPEED_TIME_OFFSET' ) ? (int) LITESPEED_TIME_OFFSET : 0 ) ); return $ts . substr( $usec, 1, 4 ) . self::$_prefix . $msg . "\n"; } /** * Log a debug message. * * @since 1.1.3 * @access public * * @param string $msg Message to write. * @param int|array $backtrace_limit Depth for backtrace or payload to append. * @return void */ public static function debug( $msg, $backtrace_limit = false ) { if ( ! defined( 'LSCWP_LOG' ) ) { return; } if ( defined( 'LSCWP_DEBUG_EXC_STRINGS' ) && Utility::str_hit_array( $msg, LSCWP_DEBUG_EXC_STRINGS ) ) { return; } if ( false !== $backtrace_limit ) { if ( ! is_numeric( $backtrace_limit ) ) { $backtrace_limit = self::trim_longtext( $backtrace_limit ); if ( is_array( $backtrace_limit ) && 1 === count( $backtrace_limit ) && ! empty( $backtrace_limit[0] ) ) { $msg .= ' --- ' . $backtrace_limit[0]; } else { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export $msg .= ' --- ' . var_export( $backtrace_limit, true ); } self::push( $msg ); return; } self::push( $msg, (int) $backtrace_limit + 1 ); return; } self::push( $msg ); } /** * Trim strings inside arrays/object dumps to reasonable length. * * @since 3.3 * @param mixed $backtrace_limit Data to trim. * @return mixed */ public static function trim_longtext( $backtrace_limit ) { if ( is_array( $backtrace_limit ) ) { $backtrace_limit = array_map( __CLASS__ . '::trim_longtext', $backtrace_limit ); } if ( is_string( $backtrace_limit ) && strlen( $backtrace_limit ) > 500 ) { $backtrace_limit = substr( $backtrace_limit, 0, 1000 ) . '...'; } return $backtrace_limit; } /** * Log a verbose debug message (requires O_DEBUG_LEVEL). * * @since 1.2.0 * @access public * * @param string $msg Message. * @param int|array $backtrace_limit Backtrace depth or payload to append. * @return void */ public static function debug2( $msg, $backtrace_limit = false ) { if ( ! defined( 'LSCWP_LOG_MORE' ) ) { return; } self::debug( $msg, $backtrace_limit ); } /** * Append a message to the active log file. * * @since 1.1.0 * @access private * * @param string $msg Message. * @param int|bool $backtrace_limit Backtrace depth. * @return void */ private static function push( $msg, $backtrace_limit = false ) { if ( defined( 'LSCWP_LOG_MORE' ) && false !== $backtrace_limit ) { $msg .= self::_backtrace_info( (int) $backtrace_limit ); } File::append( self::$log_path, self::format_message( $msg ) ); } /** * Create a compact backtrace string. * * @since 2.7 * @access private * * @param int $backtrace_limit Depth. * @return string */ private static function _backtrace_info( $backtrace_limit ) { $msg = ''; $limit = (int) $backtrace_limit; // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace $trace = debug_backtrace( false, $limit + 3 ); for ( $i = 2; $i <= $limit + 2; $i++ ) { // 0 => _backtrace_info(), 1 => push(). if ( empty( $trace[ $i ]['class'] ) ) { if ( empty( $trace[ $i ]['file'] ) ) { break; } $log = "\n" . $trace[ $i ]['file']; } else { if ( __CLASS__ === $trace[ $i ]['class'] ) { continue; } $args = ''; if ( ! empty( $trace[ $i ]['args'] ) ) { foreach ( $trace[ $i ]['args'] as $v ) { if ( is_array( $v ) ) { $v = 'ARRAY'; } if ( is_string( $v ) || is_numeric( $v ) ) { $args .= $v . ','; } } $args = substr( $args, 0, strlen( $args ) > 100 ? 100 : -1 ); } $log = str_replace( 'Core', 'LSC', $trace[ $i ]['class'] ) . $trace[ $i ]['type'] . $trace[ $i ]['function'] . '(' . $args . ')'; } if ( ! empty( $trace[ $i - 1 ]['line'] ) ) { $log .= '@' . $trace[ $i - 1 ]['line']; } $msg .= " => $log"; } return $msg; } /** * Clear all log files (debug|purge|crawler). * * @since 1.6.6 * @access private * @return void */ private function _clear_log() { $logs = [ 'debug', 'purge', 'crawler' ]; foreach ( $logs as $log ) { File::save( $this->path( $log ), '' ); } } /** * Handle requests routed to this class. * * @since 1.6.6 * @access public * @return void */ public function handler() { $type = Router::verify_type(); switch ( $type ) { case self::TYPE_CLEAR_LOG: $this->_clear_log(); break; case self::TYPE_BETA_TEST: $this->beta_test(); break; default: break; } Admin::redirect(); } } src/optimizer.cls.php 0000777 00000022650 15251157102 0010661 0 ustar 00 <?php // phpcs:ignoreFile /** * The optimize4 class. * * @since 1.9 * @package LiteSpeed */ namespace LiteSpeed; defined('WPINC') || exit(); class Optimizer extends Root { private $_conf_css_font_display; /** * Init optimizer * * @since 1.9 */ public function __construct() { $this->_conf_css_font_display = $this->conf(Base::O_OPTM_CSS_FONT_DISPLAY); } /** * Run HTML minify process and return final content * * @since 1.9 * @access public */ public function html_min( $content, $force_inline_minify = false ) { if (!apply_filters('litespeed_html_min', true)) { Debug2::debug2('[Optmer] html_min bypassed via litespeed_html_min filter'); return $content; } $options = array(); if ($force_inline_minify) { $options['jsMinifier'] = __CLASS__ . '::minify_js'; } $skip_comments = $this->conf(Base::O_OPTM_HTML_SKIP_COMMENTS); if ($skip_comments) { $options['skipComments'] = $skip_comments; } /** * Added exception capture when minify * * @since 2.2.3 */ try { $obj = new Lib\HTML_MIN($content, $options); $content_final = $obj->process(); // check if content from minification is empty if ($content_final == '') { Debug2::debug('Failed to minify HTML: HTML minification resulted in empty HTML'); return $content; } if (!defined('LSCACHE_ESI_SILENCE')) { $content_final .= "\n" . '<!-- Page optimized by LiteSpeed Cache @' . date('Y-m-d H:i:s', time() + LITESPEED_TIME_OFFSET) . ' -->'; } return $content_final; } catch (\Exception $e) { Debug2::debug('******[Optmer] html_min failed: ' . $e->getMessage()); error_log('****** LiteSpeed Optimizer html_min failed: ' . $e->getMessage()); return $content; } } /** * Run minify process and save content * * @since 1.9 * @access public */ public function serve( $request_url, $file_type, $minify, $src_list ) { // Try Unique CSS if ($file_type == 'css') { $content = false; if (defined('LITESPEED_GUEST_OPTM') || $this->conf(Base::O_OPTM_UCSS)) { $filename = $this->cls('UCSS')->load($request_url); if ($filename) { return array( $filename, 'ucss' ); } } } // Before generated, don't know the contented hash filename yet, so used url hash as tmp filename $file_path_prefix = $this->_build_filepath_prefix($file_type); $url_tag = $request_url; $url_tag_for_file = md5($request_url); if (is_404()) { $url_tag_for_file = $url_tag = '404'; } elseif ($file_type == 'css' && apply_filters('litespeed_ucss_per_pagetype', false)) { $url_tag_for_file = $url_tag = Utility::page_type(); } $static_file = LITESPEED_STATIC_DIR . $file_path_prefix . $url_tag_for_file . '.' . $file_type; // Create tmp file to avoid conflict $tmp_static_file = $static_file . '.tmp'; if (file_exists($tmp_static_file) && time() - filemtime($tmp_static_file) <= 600) { // some other request is generating return false; } // File::save( $tmp_static_file, '/* ' . ( is_404() ? '404' : $request_url ) . ' */', true ); // Can't use this bcos this will get filecon md5 changed File::save($tmp_static_file, '', true); // Load content $real_files = array(); foreach ($src_list as $src_info) { $is_min = false; if (!empty($src_info['inl'])) { // Load inline $content = $src_info['src']; } else { // Load file $content = $this->load_file($src_info['src'], $file_type); if (!$content) { continue; } $is_min = $this->is_min($src_info['src']); } $content = $this->optm_snippet($content, $file_type, $minify && !$is_min, $src_info['src'], !empty($src_info['media']) ? $src_info['media'] : false); // Write to file File::save($tmp_static_file, $content, true, true); } // if CSS - run the minification on the saved file. // Will move imports to the top of file and remove extra spaces. if ($file_type == 'css') { $obj = new Lib\CSS_JS_MIN\Minify\CSS(); $file_content_combined = $obj->moveImportsToTop(File::read($tmp_static_file)); File::save($tmp_static_file, $file_content_combined); } // validate md5 $filecon_md5 = md5_file($tmp_static_file); $final_file_path = $file_path_prefix . $filecon_md5 . '.' . $file_type; $realfile = LITESPEED_STATIC_DIR . $final_file_path; if (!file_exists($realfile)) { rename($tmp_static_file, $realfile); Debug2::debug2('[Optmer] Saved static file [path] ' . $realfile); } else { unlink($tmp_static_file); } $vary = $this->cls('Vary')->finalize_full_varies(); Debug2::debug2("[Optmer] Save URL to file for [file_type] $file_type [file] $filecon_md5 [vary] $vary "); $this->cls('Data')->save_url($url_tag, $vary, $file_type, $filecon_md5, dirname($realfile)); return array( $filecon_md5 . '.' . $file_type, $file_type ); } /** * Load a single file * * @since 4.0 */ public function optm_snippet( $content, $file_type, $minify, $src, $media = false ) { // CSS related features if ($file_type == 'css') { // Font optimize if ($this->_conf_css_font_display) { $content = preg_replace('#(@font\-face\s*\{)#isU', '${1}font-display:swap;', $content); } $content = preg_replace('/@charset[^;]+;\\s*/', '', $content); if ($media) { $content = '@media ' . $media . '{' . $content . "\n}"; } if ($minify) { $content = self::minify_css($content); } $content = $this->cls('CDN')->finalize($content); if ((defined('LITESPEED_GUEST_OPTM') || $this->conf(Base::O_IMG_OPTM_WEBP)) && $this->cls('Media')->webp_support()) { $content = $this->cls('Media')->replace_background_webp($content); } } else { if ($minify) { $content = self::minify_js($content); } else { $content = $this->_null_minifier($content); } $content .= "\n;"; } // Add filter $content = apply_filters('litespeed_optm_cssjs', $content, $file_type, $src); return $content; } /** * Load remote resource from cache if existed * * @since 4.7 */ private function load_cached_file( $url, $file_type ) { $file_path_prefix = $this->_build_filepath_prefix($file_type); $folder_name = LITESPEED_STATIC_DIR . $file_path_prefix; $to_be_deleted_folder = $folder_name . date('Ymd', strtotime('-2 days')); if (file_exists($to_be_deleted_folder)) { Debug2::debug('[Optimizer] ❌ Clearing folder [name] ' . $to_be_deleted_folder); File::rrmdir($to_be_deleted_folder); } $today_file = $folder_name . date('Ymd') . '/' . md5($url); if (file_exists($today_file)) { return File::read($today_file); } // Write file $res = wp_safe_remote_get($url); $res_code = wp_remote_retrieve_response_code($res); if (is_wp_error($res) || $res_code != 200) { Debug2::debug2('[Optimizer] ❌ Load Remote error [code] ' . $res_code); return false; } $con = wp_remote_retrieve_body($res); if (!$con) { return false; } Debug2::debug('[Optimizer] ✅ Save remote file to cache [name] ' . $today_file); File::save($today_file, $con, true); return $con; } /** * Load remote/local resource * * @since 3.5 */ public function load_file( $src, $file_type = 'css' ) { $real_file = Utility::is_internal_file($src); $postfix = pathinfo(parse_url($src, PHP_URL_PATH), PATHINFO_EXTENSION); if (!$real_file || $postfix != $file_type) { Debug2::debug2('[CSS] Load Remote [' . $file_type . '] ' . $src); $this_url = substr($src, 0, 2) == '//' ? set_url_scheme($src) : $src; $con = $this->load_cached_file($this_url, $file_type); if ($file_type == 'css') { $dirname = dirname($this_url) . '/'; $con = Lib\UriRewriter::prepend($con, $dirname); } } else { Debug2::debug2('[CSS] Load local [' . $file_type . '] ' . $real_file[0]); $con = File::read($real_file[0]); if ($file_type == 'css') { $dirname = dirname($real_file[0]); $con = Lib\UriRewriter::rewrite($con, $dirname); } } return $con; } /** * Minify CSS * * @since 2.2.3 * @access private */ public static function minify_css( $data ) { try { $obj = new Lib\CSS_JS_MIN\Minify\CSS(); $obj->add($data); return $obj->minify(); } catch (\Exception $e) { Debug2::debug('******[Optmer] minify_css failed: ' . $e->getMessage()); error_log('****** LiteSpeed Optimizer minify_css failed: ' . $e->getMessage()); return $data; } } /** * Minify JS * * Added exception capture when minify * * @since 2.2.3 * @access private */ public static function minify_js( $data, $js_type = '' ) { // For inline JS optimize, need to check if it's js type if ($js_type) { preg_match('#type=([\'"])(.+)\g{1}#isU', $js_type, $matches); if ($matches && $matches[2] != 'text/javascript') { Debug2::debug('******[Optmer] minify_js bypass due to type: ' . $matches[2]); return $data; } } try { $obj = new Lib\CSS_JS_MIN\Minify\JS(); $obj->add($data); return $obj->minify(); } catch (\Exception $e) { Debug2::debug('******[Optmer] minify_js failed: ' . $e->getMessage()); // error_log( '****** LiteSpeed Optimizer minify_js failed: ' . $e->getMessage() ); return $data; } } /** * Basic minifier * * @access private */ private function _null_minifier( $content ) { $content = str_replace("\r\n", "\n", $content); return trim($content); } /** * Check if the file is already min file * * @since 1.9 */ public function is_min( $filename ) { $basename = basename($filename); if (preg_match('/[-\.]min\.(?:[a-zA-Z]+)$/i', $basename)) { return true; } return false; } } src/task.cls.php 0000777 00000016063 15251157102 0007602 0 ustar 00 <?php /** * The cron task class. * * @since 1.1.3 * @package LiteSpeed */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Schedules and runs LiteSpeed Cache background tasks. */ class Task extends Root { /** * Tag for debug logs. * * @var string */ const LOG_TAG = '⏰'; /** * Map of option id => cron hook registration. * * @var array<string,array{name:string,hook:callable|string}> */ private static $_triggers = [ Base::O_IMG_OPTM_CRON => [ 'name' => 'litespeed_task_imgoptm_pull', 'hook' => 'LiteSpeed\Img_Optm::start_async_cron', ], // always fetch immediately Base::O_OPTM_CSS_ASYNC => [ 'name' => 'litespeed_task_ccss', 'hook' => 'LiteSpeed\CSS::cron_ccss', ], Base::O_OPTM_UCSS => [ 'name' => 'litespeed_task_ucss', 'hook' => 'LiteSpeed\UCSS::cron', ], Base::O_MEDIA_VPI_CRON => [ 'name' => 'litespeed_task_vpi', 'hook' => 'LiteSpeed\VPI::cron', ], Base::O_MEDIA_PLACEHOLDER_RESP_ASYNC => [ 'name' => 'litespeed_task_lqip', 'hook' => 'LiteSpeed\Placeholder::cron', ], Base::O_DISCUSS_AVATAR_CRON => [ 'name' => 'litespeed_task_avatar', 'hook' => 'LiteSpeed\Avatar::cron', ], Base::O_IMG_OPTM_AUTO => [ 'name' => 'litespeed_task_imgoptm_req', 'hook' => 'LiteSpeed\Img_Optm::cron_auto_request', ], Base::O_GUEST => [ 'name' => 'litespeed_task_guest_sync', 'hook' => 'LiteSpeed\Guest::cron', ], // Daily sync Guest Mode IP/UA lists Base::O_CRAWLER => [ 'name' => 'litespeed_task_crawler', 'hook' => 'LiteSpeed\Crawler::start_async_cron', ], // Set crawler to last one to use above results ]; /** * Options allowed to run for guest optimization. * * @var array<int,string> */ private static $_guest_options = [ Base::O_OPTM_CSS_ASYNC, Base::O_OPTM_UCSS, Base::O_MEDIA_VPI ]; /** * Schedule id for crawler. * * @var string */ const FILTER_CRAWLER = 'litespeed_crawl_filter'; /** * Schedule id for general tasks. * * @var string */ const FILTER = 'litespeed_filter'; /** * Keep all tasks in cron. * * @since 3.0 * @access public * @return void */ public function init() { self::debug2( 'Init' ); add_filter( 'cron_schedules', [ $this, 'lscache_cron_filter' ] ); $guest_optm = $this->conf( Base::O_GUEST ) && $this->conf( Base::O_GUEST_OPTM ); foreach ( self::$_triggers as $id => $trigger ) { if ( Base::O_IMG_OPTM_CRON === $id ) { if ( ! Img_Optm::need_pull() ) { continue; } } elseif ( ! $this->conf( $id ) ) { if ( ! $guest_optm || ! in_array( $id, self::$_guest_options, true ) ) { continue; } } // Special check for crawler. if ( Base::O_CRAWLER === $id ) { if ( ! Router::can_crawl() ) { continue; } add_filter( 'cron_schedules', [ $this, 'lscache_cron_filter_crawler' ] ); // phpcs:ignore WordPress.WP.CronInterval.ChangeDetected } if ( ! wp_next_scheduled( $trigger['name'] ) ) { self::debug( 'Cron hook register [name] ' . $trigger['name'] ); // Determine schedule: crawler uses its own, guest uses daily, others use 15min if ( Base::O_CRAWLER === $id ) { $schedule = self::FILTER_CRAWLER; } elseif ( Base::O_GUEST === $id ) { $schedule = 'daily'; } else { $schedule = self::FILTER; } wp_schedule_event( time(), $schedule, $trigger['name'] ); } add_action( $trigger['name'], $trigger['hook'] ); } } /** * Handle all async noabort requests. * * @since 5.5 * @return void */ public static function async_litespeed_handler() { $hash_data = self::get_option( 'async_call-hash', [] ); if ( ! $hash_data || ! is_array( $hash_data ) || empty( $hash_data['hash'] ) || empty( $hash_data['ts'] ) ) { self::debug( 'async_litespeed_handler no hash data', $hash_data ); return; } $nonce = isset( $_GET['nonce'] ) ? sanitize_text_field( wp_unslash( $_GET['nonce'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( 120 < time() - (int) $hash_data['ts'] || '' === $nonce || $nonce !== $hash_data['hash'] ) { self::debug( 'async_litespeed_handler nonce mismatch' ); return; } self::delete_option( 'async_call-hash' ); $type = Router::verify_type(); self::debug( 'type=' . $type ); // Don't lock up other requests while processing. session_write_close(); switch ( $type ) { case 'crawler': Crawler::async_handler(); break; case 'crawler_force': Crawler::async_handler( true ); break; case 'imgoptm': Img_Optm::async_handler(); break; case 'imgoptm_force': Img_Optm::async_handler( true ); break; default: break; } } /** * Async caller wrapper func. * * @since 5.5 * * @param string $type Async operation type. * @return void */ public static function async_call( $type ) { $hash = Str::rrand( 32 ); self::update_option( 'async_call-hash', [ 'hash' => $hash, 'ts' => time(), ] ); $args = [ 'timeout' => 0.01, 'blocking' => false, 'sslverify' => false, // 'cookies' => $_COOKIE, ]; $qs = [ 'action' => 'async_litespeed', 'nonce' => $hash, Router::TYPE => $type, ]; $url = add_query_arg( $qs, admin_url( 'admin-ajax.php' ) ); self::debug( 'async call to ' . $url ); wp_safe_remote_post( esc_url_raw( $url ), $args ); } /** * Clean all potential existing crons. * * @since 3.0 * @access public * @return void */ public static function destroy() { Utility::compatibility(); array_map( 'wp_clear_scheduled_hook', array_column( self::$_triggers, 'name' ) ); } /** * Try to clean the crons if disabled. * * @since 3.0 * @access public * * @param string $id Option id of cron trigger. * @return void */ public function try_clean( $id ) { if ( $id && ! empty( self::$_triggers[ $id ] ) ) { if ( ! $this->conf( $id ) || ( Base::O_CRAWLER === $id && ! Router::can_crawl() ) ) { self::debug( 'Cron clear [id] ' . $id . ' [hook] ' . self::$_triggers[ $id ]['name'] ); wp_clear_scheduled_hook( self::$_triggers[ $id ]['name'] ); } return; } self::debug( '❌ Unknown cron [id] ' . $id ); } /** * Register cron interval for general tasks. * * @since 1.6.1 * @access public * * @param array $schedules Existing schedules. * @return array */ public function lscache_cron_filter( $schedules ) { if ( ! array_key_exists( self::FILTER, $schedules ) ) { $schedules[ self::FILTER ] = [ 'interval' => 900, 'display' => __( 'Every 15 Minutes', 'litespeed-cache' ), ]; } return $schedules; } /** * Register cron interval for crawler. * * @since 1.1.0 * @access public * * @param array $schedules Existing schedules. * @return array */ public function lscache_cron_filter_crawler( $schedules ) { $crawler_run_interval = defined( 'LITESPEED_CRAWLER_RUN_INTERVAL' ) ? (int) constant( 'LITESPEED_CRAWLER_RUN_INTERVAL' ) : 600; if ( ! array_key_exists( self::FILTER_CRAWLER, $schedules ) ) { $schedules[ self::FILTER_CRAWLER ] = [ 'interval' => $crawler_run_interval, 'display' => __( 'LiteSpeed Crawler Cron', 'litespeed-cache' ), ]; } return $schedules; } } src/tag.cls.php 0000777 00000022411 15251157102 0007405 0 ustar 00 <?php // phpcs:ignoreFile /** * The plugin cache-tag class for X-LiteSpeed-Tag * * @since 1.1.3 */ namespace LiteSpeed; defined('WPINC') || exit(); class Tag extends Root { const TYPE_FEED = 'FD'; const TYPE_FRONTPAGE = 'F'; const TYPE_HOME = 'H'; const TYPE_PAGES = 'PGS'; const TYPE_PAGES_WITH_RECENT_POSTS = 'PGSRP'; const TYPE_HTTP = 'HTTP.'; const TYPE_POST = 'Po.'; // Post. Cannot use P, reserved for litemage. const TYPE_ARCHIVE_POSTTYPE = 'PT.'; const TYPE_ARCHIVE_TERM = 'T.'; // for is_category|is_tag|is_tax const TYPE_AUTHOR = 'A.'; const TYPE_ARCHIVE_DATE = 'D.'; const TYPE_BLOG = 'B.'; const TYPE_LOGIN = 'L'; const TYPE_URL = 'URL.'; const TYPE_WIDGET = 'W.'; const TYPE_ESI = 'ESI.'; const TYPE_REST = 'REST'; const TYPE_AJAX = 'AJAX.'; const TYPE_LIST = 'LIST'; const TYPE_MIN = 'MIN'; const TYPE_LOCALRES = 'LOCALRES'; const X_HEADER = 'X-LiteSpeed-Tag'; private static $_tags = array(); private static $_tags_priv = array( 'tag_priv' ); public static $error_code_tags = array( 403, 404, 500 ); /** * Initialize * * @since 4.0 */ public function init() { // register recent posts widget tag before theme renders it to make it work add_filter('widget_posts_args', array( $this, 'add_widget_recent_posts' )); } /** * Check if the login page is cacheable. * If not, unset the cacheable member variable. * * NOTE: This is checked separately because login page doesn't go through WP logic. * * @since 1.0.0 * @access public */ public function check_login_cacheable() { if (!$this->conf(Base::O_CACHE_PAGE_LOGIN)) { return; } if (Control::isset_notcacheable()) { return; } if (!empty($_GET)) { Control::set_nocache('has GET request'); return; } $this->cls('Control')->set_cacheable(); self::add(self::TYPE_LOGIN); // we need to send lsc-cookie manually to make it be sent to all other users when is cacheable $list = headers_list(); if (empty($list)) { return; } foreach ($list as $hdr) { if (strncasecmp($hdr, 'set-cookie:', 11) == 0) { $cookie = substr($hdr, 12); @header('lsc-cookie: ' . $cookie, false); } } } /** * Register purge tag for pages with recent posts widget * of the plugin. * * @since 1.0.15 * @access public * @param array $params [WordPress params for widget_posts_args] */ public function add_widget_recent_posts( $params ) { self::add(self::TYPE_PAGES_WITH_RECENT_POSTS); return $params; } /** * Adds cache tags to the list of cache tags for the current page. * * @since 1.0.5 * @access public * @param mixed $tags A string or array of cache tags to add to the current list. */ public static function add( $tags ) { if (!is_array($tags)) { $tags = array( $tags ); } Debug2::debug('💰 [Tag] Add ', $tags); self::$_tags = array_merge(self::$_tags, $tags); // Send purge header immediately $tag_header = self::cls()->output(true); @header($tag_header); } /** * Add a post id to cache tag * * @since 3.0 * @access public */ public static function add_post( $pid ) { self::add(self::TYPE_POST . $pid); } /** * Add a widget id to cache tag * * @since 3.0 * @access public */ public static function add_widget( $id ) { self::add(self::TYPE_WIDGET . $id); } /** * Add a private ESI to cache tag * * @since 3.0 * @access public */ public static function add_private_esi( $tag ) { self::add_private(self::TYPE_ESI . $tag); } /** * Adds private cache tags to the list of cache tags for the current page. * * @since 1.6.3 * @access public * @param mixed $tags A string or array of cache tags to add to the current list. */ public static function add_private( $tags ) { if (!is_array($tags)) { $tags = array( $tags ); } self::$_tags_priv = array_merge(self::$_tags_priv, $tags); } /** * Return tags for Admin QS * * @since 1.1.3 * @access public */ public static function output_tags() { return self::$_tags; } /** * Will get a hash of the URI. Removes query string and appends a '/' if it is missing. * * @since 1.0.12 * @access public * @param string $uri The uri to get the hash of. * @param boolean $ori Return the original url or not * @return bool|string False on input error, hash otherwise. */ public static function get_uri_tag( $uri, $ori = false ) { $no_qs = strtok($uri, '?'); if (empty($no_qs)) { return false; } $slashed = trailingslashit($no_qs); // If only needs uri tag if ($ori) { return $slashed; } if (defined('LSCWP_LOG')) { return self::TYPE_URL . $slashed; } return self::TYPE_URL . md5($slashed); } /** * Get the unique tag based on self url. * * @since 1.1.3 * @access public * @param boolean $ori Return the original url or not */ public static function build_uri_tag( $ori = false ) { return self::get_uri_tag(urldecode($_SERVER['REQUEST_URI']), $ori); } /** * Gets the cache tags to set for the page. * * This includes site wide post types (e.g. front page) as well as * any third party plugin specific cache tags. * * @since 1.0.0 * @access private * @return array The list of cache tags to set. */ private static function _build_type_tags() { $tags = array(); $tags[] = Utility::page_type(); $tags[] = self::build_uri_tag(); if (is_front_page()) { $tags[] = self::TYPE_FRONTPAGE; } elseif (is_home()) { $tags[] = self::TYPE_HOME; } global $wp_query; if (isset($wp_query)) { $queried_obj_id = get_queried_object_id(); if (is_archive()) { // An Archive is a Category, Tag, Author, Date, Custom Post Type or Custom Taxonomy based pages. if (is_category() || is_tag() || is_tax()) { $tags[] = self::TYPE_ARCHIVE_TERM . $queried_obj_id; } elseif (is_post_type_archive() && ($post_type = get_post_type())) { $tags[] = self::TYPE_ARCHIVE_POSTTYPE . $post_type; } elseif (is_author()) { $tags[] = self::TYPE_AUTHOR . $queried_obj_id; } elseif (is_date()) { global $post; if ($post && isset($post->post_date)) { $date = $post->post_date; $date = strtotime($date); if (is_day()) { $tags[] = self::TYPE_ARCHIVE_DATE . date('Ymd', $date); } elseif (is_month()) { $tags[] = self::TYPE_ARCHIVE_DATE . date('Ym', $date); } elseif (is_year()) { $tags[] = self::TYPE_ARCHIVE_DATE . date('Y', $date); } } } } elseif (is_singular()) { // $this->is_singular = $this->is_single || $this->is_page || $this->is_attachment; $tags[] = self::TYPE_POST . $queried_obj_id; if (is_page()) { $tags[] = self::TYPE_PAGES; } } elseif (is_feed()) { $tags[] = self::TYPE_FEED; } } // Check REST API if (REST::cls()->is_rest()) { $tags[] = self::TYPE_REST; $path = !empty($_SERVER['SCRIPT_URL']) ? $_SERVER['SCRIPT_URL'] : false; if ($path) { // posts collections tag if (substr($path, -6) == '/posts') { $tags[] = self::TYPE_LIST; // Not used for purge yet } // single post tag global $post; if (!empty($post->ID) && substr($path, -strlen($post->ID) - 1) === '/' . $post->ID) { $tags[] = self::TYPE_POST . $post->ID; } // pages collections & single page tag if (stripos($path, '/pages') !== false) { $tags[] = self::TYPE_PAGES; } } } // Append AJAX action tag if (Router::is_ajax() && !empty($_REQUEST['action'])) { $tags[] = self::TYPE_AJAX . $_REQUEST['action']; } return $tags; } /** * Generate all cache tags before output * * @access private * @since 1.1.3 */ private static function _finalize() { // run 3rdparty hooks to tag do_action('litespeed_tag_finalize'); // generate wp tags if (!defined('LSCACHE_IS_ESI')) { $type_tags = self::_build_type_tags(); self::$_tags = array_merge(self::$_tags, $type_tags); } if (defined('LITESPEED_GUEST') && LITESPEED_GUEST) { self::$_tags[] = 'guest'; } // append blog main tag self::$_tags[] = ''; // removed duplicates self::$_tags = array_unique(self::$_tags); } /** * Sets up the Cache Tags header. * ONLY need to run this if is cacheable * * @since 1.1.3 * @access public * @return string empty string if empty, otherwise the cache tags header. */ public function output( $no_finalize = false ) { if (defined('LSCACHE_NO_CACHE') && LSCACHE_NO_CACHE) { return; } if (!$no_finalize) { self::_finalize(); } $prefix_tags = array(); /** * Only append blog_id when is multisite * * @since 2.9.3 */ $prefix = LSWCP_TAG_PREFIX . (is_multisite() ? get_current_blog_id() : '') . '_'; // If is_private and has private tags, append them first, then specify prefix to `public` for public tags if (Control::is_private()) { foreach (self::$_tags_priv as $priv_tag) { $prefix_tags[] = $prefix . $priv_tag; } $prefix = 'public:' . $prefix; } foreach (self::$_tags as $tag) { $prefix_tags[] = $prefix . $tag; } $hdr = self::X_HEADER . ': ' . implode(',', $prefix_tags); return $hdr; } } src/metabox.cls.php 0000777 00000012453 15251157102 0010276 0 ustar 00 <?php /** * The class to operate post editor metabox settings. * * @since 4.7 * @package LiteSpeed */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Metabox * * Registers and handles LiteSpeed options shown in the post/page edit screen. */ class Metabox extends Root { const LOG_TAG = '📦'; const POST_NONCE_ACTION = 'post_nonce_action'; /** * Map of metabox settings keys to labels. * * @var array */ private $_postmeta_settings; /** * Init the setting list. * * @since 4.7 */ public function __construct() { // Append meta box. $this->_postmeta_settings = [ 'litespeed_no_cache' => __( 'Disable Cache', 'litespeed-cache' ), 'litespeed_no_image_lazy' => __( 'Disable Image Lazyload', 'litespeed-cache' ), 'litespeed_no_vpi' => __( 'Disable VPI', 'litespeed-cache' ), 'litespeed_vpi_list' => __( 'Viewport Images', 'litespeed-cache' ), 'litespeed_vpi_list_mobile' => __( 'Viewport Images', 'litespeed-cache' ) . ' - ' . __( 'Mobile', 'litespeed-cache' ), ]; } /** * Register post edit settings. * * @since 4.7 * @return void */ public function register_settings() { add_action( 'add_meta_boxes', [ $this, 'add_meta_boxes' ] ); add_action( 'save_post', [ $this, 'save_meta_box_settings' ], 15, 2 ); add_action( 'attachment_updated', [ $this, 'save_meta_box_settings' ], 15, 2 ); } /** * Register meta box. * * @since 4.7 * * @param string $post_type Current post type. * @return void */ public function add_meta_boxes( $post_type ) { if ( apply_filters( 'litespeed_bypass_metabox', false, $post_type ) ) { return; } $post_type_obj = get_post_type_object( $post_type ); if ( ! empty( $post_type_obj ) && ! $post_type_obj->public ) { self::debug( 'post type public=false, bypass add_meta_boxes' ); return; } add_meta_box( 'litespeed_meta_boxes', 'LiteSpeed', [ $this, 'meta_box_options' ], $post_type, 'side', 'core' ); } /** * Show meta box content. * * @since 4.7 * @return void */ public function meta_box_options() { require_once LSCWP_DIR . 'tpl/inc/metabox.php'; } /** * Save settings. * * @since 4.7 * * @param int $post_id Post ID. * @param \WP_Post $post Post object. * @return void */ public function save_meta_box_settings( $post_id, $post ) { global $pagenow; self::debug( 'Maybe save post2 [post_id] ' . $post_id ); if ( 'post.php' !== $pagenow || ! $post || ! is_object( $post ) ) { return; } if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } if ( ! $this->cls( 'Router' )->verify_nonce( self::POST_NONCE_ACTION ) ) { return; } self::debug( 'Saving post [post_id] ' . $post_id ); foreach ($this->_postmeta_settings as $k => $v) { // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput $val = isset($_POST[$k]) ? $_POST[$k] : false; $this->save($post_id, $k, $val); } } /** * Load setting per post. * * @since 4.7 * * @param string $conf Meta key to load. * @param int|bool $post_id Optional specific post ID, defaults to current query object. * @return mixed|null Meta value or null when not set. */ public function setting( $conf, $post_id = false ) { // Check if has metabox non-cacheable setting or not. if ( ! $post_id ) { $home_id = (int) get_option( 'page_for_posts' ); if ( is_singular() ) { $post_id = get_the_ID(); } elseif ( $home_id > 0 && is_home() ) { $post_id = $home_id; } } $val = $post_id ? get_post_meta( $post_id, $conf, true ) : null; if ( $val ) { return $val; } return null; } /** * Save a metabox value. * * @since 4.7 * * @param int $post_id Post ID. * @param string $name Meta key name. * @param string|bool $val Value to save. * @param bool $is_append If true, append to existing list values. * @return void */ public function save( $post_id, $name, $val, $is_append = false ) { if ( false !== strpos( $name, VPI::POST_META ) ) { $val = Utility::sanitize_lines( $val, 'basename,drop_webp' ); } // Load existing data if has set. if ( $is_append ) { $existing_data = $this->setting( $name, $post_id ); if ( $existing_data ) { $existing_data = Utility::sanitize_lines( $existing_data, 'basename' ); $val = array_unique( array_merge( $val, $existing_data ) ); } } if ( $val ) { update_post_meta( $post_id, $name, $val ); } else { delete_post_meta( $post_id, $name ); } } /** * Load exclude images per post. * * @since 4.7 * * @param array $exclude_list Current exclude list. * @return array Modified exclude list. */ public function lazy_img_excludes( $exclude_list ) { $is_mobile = $this->_separate_mobile(); $excludes = $this->setting( $is_mobile ? VPI::POST_META_MOBILE : VPI::POST_META ); if ( null !== $excludes ) { $excludes = Utility::sanitize_lines( $excludes, 'basename' ); if ( $excludes ) { // Check if contains `data:` (invalid result, need to clear existing result) or not. if ( Utility::str_hit_array( 'data:', $excludes ) ) { $this->cls( 'VPI' )->add_to_queue(); } else { return array_merge( $exclude_list, $excludes ); } } return $exclude_list; } $this->cls( 'VPI' )->add_to_queue(); return $exclude_list; } } src/data.cls.php 0000777 00000054322 15251157102 0007551 0 ustar 00 <?php /** * LiteSpeed persistent data manager. * * Handles DB tables, schema upgrades, URL-to-file mappings, and list loaders. * * @package LiteSpeed * @since 1.3.1 */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Data layer for LiteSpeed Cache. */ class Data extends Root { const LOG_TAG = '🚀'; /** * Versioned DB updaters for network-wide options. * * @var array<string,array<string>> */ private $_db_updater = [ '5.3-a5' => [ 'litespeed_update_5_3' ], '7.0-b26' => [ 'litespeed_update_7' ], '7.0.1-b1' => [ 'litespeed_update_7_0_1' ], '7.7-b28' => [ 'litespeed_update_7_7' ], ]; /** * Versioned DB updaters for per-site options in multisite. * * @var array<string,array<string>> */ private $_db_site_updater = [ // '2.0' => [ 'litespeed_update_site_2_0' ], ]; /** * Map from URL-file type to integer code. * * @var array<string,int> */ private $_url_file_types = [ 'css' => 1, 'js' => 2, 'ccss' => 3, 'ucss' => 4, ]; /** Table: image optimization results. */ const TB_IMG_OPTM = 'litespeed_img_optm'; /** Table: image optimization working queue. */ const TB_IMG_OPTMING = 'litespeed_img_optming'; /** Table: cached avatars. */ const TB_AVATAR = 'litespeed_avatar'; /** Table: crawler URLs. */ const TB_CRAWLER = 'litespeed_crawler'; /** Table: crawler blacklist. */ const TB_CRAWLER_BLACKLIST = 'litespeed_crawler_blacklist'; /** Table: logical URLs. */ const TB_URL = 'litespeed_url'; /** Table: URL → generated file mapping. */ const TB_URL_FILE = 'litespeed_url_file'; /** * Constructor. * * @since 1.3.1 */ public function __construct() {} /** * Ensure required tables exist based on current configuration. * * Called on activation and when options are (re)loaded. * * @since 3.0 * @access public * @return void */ public function correct_tb_existence() { // Gravatar. if ( $this->conf( Base::O_DISCUSS_AVATAR_CACHE ) ) { $this->tb_create( 'avatar' ); } // Crawler. if ( $this->conf( Base::O_CRAWLER ) ) { $this->tb_create( 'crawler' ); $this->tb_create( 'crawler_blacklist' ); } // URL mapping. $this->tb_create( 'url' ); $this->tb_create( 'url_file' ); // Image optm tables are managed on-demand. } /** * Upgrade global configuration/data to match plugin version. * * @since 3.0 * @access public * * @param string $ver Currently stored version string. * @return string|void 'upgrade' on success, or void if no-op. */ public function conf_upgrade( $ver ) { // Skip count check if `Use Primary Site Configurations` is on (deprecated note kept intentionally). if ( $this->_get_upgrade_lock() ) { return; } $this->_set_upgrade_lock( true ); require_once LSCWP_DIR . 'src/data.upgrade.func.php'; // Init log manually. if ( $this->conf( Base::O_DEBUG ) ) { $this->cls( 'Debug2' )->init(); } foreach ( $this->_db_updater as $k => $v ) { if ( version_compare( $ver, $k, '<' ) ) { foreach ( $v as $v2 ) { self::debug( "Updating [ori_v] $ver \t[to] $k \t[func] $v2" ); call_user_func( $v2 ); } } } // Reload options. $this->cls( 'Conf' )->load_options(); $this->correct_tb_existence(); // Update related files. $this->cls( 'Activation' )->update_files(); // Update version to latest. Conf::delete_option( Base::_VER ); Conf::add_option( Base::_VER, Core::VER ); self::debug( 'Updated version to ' . Core::VER ); $this->_set_upgrade_lock( false ); if ( ! defined( 'LSWCP_EMPTYCACHE' ) ) { define( 'LSWCP_EMPTYCACHE', true ); } Purge::purge_all(); return 'upgrade'; } /** * Upgrade per-site configuration/data to match plugin version (multisite). * * @since 3.0 * @access public * * @param string $ver Currently stored version string. * @return void */ public function conf_site_upgrade( $ver ) { if ( $this->_get_upgrade_lock() ) { return; } $this->_set_upgrade_lock( true ); require_once LSCWP_DIR . 'src/data.upgrade.func.php'; foreach ( $this->_db_site_updater as $k => $v ) { if ( version_compare( $ver, $k, '<' ) ) { foreach ( $v as $v2 ) { self::debug( "Updating site [ori_v] $ver \t[to] $k \t[func] $v2" ); call_user_func( $v2 ); } } } // Reload options. $this->cls( 'Conf' )->load_site_options(); Conf::delete_site_option( Base::_VER ); Conf::add_site_option( Base::_VER, Core::VER ); self::debug( 'Updated site_version to ' . Core::VER ); $this->_set_upgrade_lock( false ); if ( ! defined( 'LSWCP_EMPTYCACHE' ) ) { define( 'LSWCP_EMPTYCACHE', true ); } Purge::purge_all(); } /** * Whether an upgrade lock is in effect. * * @since 3.0.1 * @return int|false Timestamp if locked and recent, false otherwise. */ private function _get_upgrade_lock() { $is_upgrading = (int) get_option( 'litespeed.data.upgrading' ); if ( ! $is_upgrading ) { $this->_set_upgrade_lock( false ); // Seed option to avoid repeated DB reads later. } if ( $is_upgrading && ( time() - $is_upgrading ) < 3600 ) { return $is_upgrading; } return false; } /** * Show the upgrading banner if upgrade script is running. * * @since 3.0.1 * @return void */ public function check_upgrading_msg() { $is_upgrading = $this->_get_upgrade_lock(); if ( ! $is_upgrading ) { return; } Admin_Display::info( sprintf( /* translators: %s: time string */ __( 'The database has been upgrading in the background since %s. This message will disappear once upgrade is complete.', 'litespeed-cache' ), '<code>' . Utility::readable_time( $is_upgrading ) . '</code>' ) . ' [LiteSpeed]', true ); } /** * Set/clear the upgrade process lock. * * @since 3.0.1 * * @param bool $lock True to set, false to clear. * @return void */ private function _set_upgrade_lock( $lock ) { if ( ! $lock ) { update_option( 'litespeed.data.upgrading', -1 ); } else { update_option( 'litespeed.data.upgrading', time() ); } } /** * Get a fully-qualified table name by slug. * * @since 3.0 * @access public * * @param string $tb Table slug (e.g., 'url_file'). * @return string|null */ public function tb( $tb ) { global $wpdb; switch ( $tb ) { case 'img_optm': return $wpdb->prefix . self::TB_IMG_OPTM; case 'img_optming': return $wpdb->prefix . self::TB_IMG_OPTMING; case 'avatar': return $wpdb->prefix . self::TB_AVATAR; case 'crawler': return $wpdb->prefix . self::TB_CRAWLER; case 'crawler_blacklist': return $wpdb->prefix . self::TB_CRAWLER_BLACKLIST; case 'url': return $wpdb->prefix . self::TB_URL; case 'url_file': return $wpdb->prefix . self::TB_URL_FILE; default: return null; } } /** * Check if a table exists. * * @since 3.0 * @access public * * @param string $tb Table slug. * @return bool */ public function tb_exist( $tb ) { global $wpdb; $save_state = $wpdb->suppress_errors; $wpdb->suppress_errors( true ); $describe = $wpdb->get_var( 'DESCRIBE `' . $this->tb( $tb ) . '`' ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared $wpdb->suppress_errors( $save_state ); return null !== $describe; } /** * Get the SQL structure (columns/indexes) for a given table slug. * * @since 2.0 * @access private * * @param string $tb Table slug. * @return string SQL columns/indexes definition. */ private function _tb_structure( $tb ) { return File::read( LSCWP_DIR . 'src/data_structure/' . $tb . '.sql' ); } /** * Create a table by slug if it doesn't exist. * * @since 3.0 * @access public * * @param string $tb Table slug. * @return void */ public function tb_create( $tb ) { global $wpdb; self::debug2( '[Data] Checking table ' . $tb ); // Check if table exists first. if ( $this->tb_exist( $tb ) ) { self::debug2( '[Data] Existed' ); return; } self::debug( 'Creating ' . $tb ); $sql = sprintf( 'CREATE TABLE IF NOT EXISTS `%1$s` (%2$s) %3$s;', $this->tb( $tb ), $this->_tb_structure( $tb ), $wpdb->get_charset_collate() ); $res = $wpdb->query( $sql ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared if ( false === $res ) { self::debug( 'Warning! Creating table failed!', $sql ); Admin_Display::error( Error::msg( 'failed_tb_creation', [ '<code>' . $tb . '</code>', '<code>' . $sql . '</code>' ] ) ); } } /** * Drop a table by slug. * * @since 3.0 * @access public * * @param string $tb Table slug. * @return void */ public function tb_del( $tb ) { global $wpdb; if ( ! $this->tb_exist( $tb ) ) { return; } self::debug( 'Deleting table ' . $tb ); $q = 'DROP TABLE IF EXISTS ' . $this->tb( $tb ); $wpdb->query( $q ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared } /** * Drop all generated tables (except image optimization working tables). * * @since 3.0 * @access public * @return void */ public function tables_del() { $this->tb_del( 'avatar' ); $this->tb_del( 'crawler' ); $this->tb_del( 'crawler_blacklist' ); $this->tb_del( 'url' ); $this->tb_del( 'url_file' ); // Deleting img_optm only can be done when destroy all optm images } /** * TRUNCATE a table by slug. * * @since 4.0 * @access public * * @param string $tb Table slug. * @return void */ public function table_truncate( $tb ) { global $wpdb; $q = 'TRUNCATE TABLE ' . $this->tb( $tb ); $wpdb->query( $q ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared } /** * Clean URL-file rows for a given file type and prune orphaned URLs. * * @since 4.0 * @access public * * @param string $file_type One of 'css','js','ccss','ucss'. * @return void */ public function url_file_clean( $file_type ) { global $wpdb; if ( ! $this->tb_exist( 'url_file' ) ) { return; } if ( ! isset( $this->_url_file_types[ $file_type ] ) ) { return; } $type = $this->_url_file_types[ $file_type ]; $tb_url = $this->tb( 'url' ); $tb_url_file = $this->tb( 'url_file' ); // Delete all of this type. $q = "DELETE FROM `$tb_url_file` WHERE `type` = %d"; $wpdb->query( $wpdb->prepare( $q, $type ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared // Prune orphaned rows in URL table. $sql = "DELETE d FROM `{$tb_url}` AS d LEFT JOIN `{$tb_url_file}` AS f ON d.`id` = f.`url_id` WHERE f.`url_id` IS NULL"; $wpdb->query( $sql ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared } /** * Persist (or rotate) the mapping from URL+vary to a generated file. * * @since 4.0 * @access public * * @param string $request_url Full request URL. * @param string $vary Vary string (may be long; will be md5 if >32). * @param string $file_type One of 'css','js','ccss','ucss'. * @param string $filecon_md5 MD5 of the generated file content. * @param string $path Base path where files live. * @param bool $mobile Whether mapping is for mobile. * @param bool $webp Whether mapping is for webp. * @return void */ public function save_url( $request_url, $vary, $file_type, $filecon_md5, $path, $mobile = false, $webp = false ) { global $wpdb; if ( strlen( $vary ) > 32 ) { $vary = md5( $vary ); } if ( ! isset( $this->_url_file_types[ $file_type ] ) ) { return; } $type = $this->_url_file_types[ $file_type ]; $tb_url = $this->tb( 'url' ); $tb_url_file = $this->tb( 'url_file' ); // Ensure URL row exists. $q = "SELECT * FROM `$tb_url` WHERE url=%s"; $url_row = $wpdb->get_row( $wpdb->prepare( $q, $request_url ), ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared if ( ! $url_row ) { $q = "INSERT INTO `$tb_url` SET url=%s"; $wpdb->query( $wpdb->prepare( $q, $request_url ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared $url_id = (int) $wpdb->insert_id; } else { $url_id = (int) $url_row['id']; } // Active mapping (not expired). $q = "SELECT * FROM `$tb_url_file` WHERE url_id=%d AND vary=%s AND type=%d AND expired=0"; $file_row = $wpdb->get_row( $wpdb->prepare( $q, [ $url_id, $vary, $type ] ), ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared // No change needed if filename matches. if ( $file_row && $file_row['filename'] === $filecon_md5 ) { return; } // If the new file MD5 is currently marked expired elsewhere, clear those records. $q = "DELETE FROM `$tb_url_file` WHERE filename = %s AND expired > 0"; $wpdb->query( $wpdb->prepare( $q, $filecon_md5 ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared // If another live row already uses the same filename, switch current row to that filename. if ( $file_row ) { $q = "SELECT id FROM `$tb_url_file` WHERE filename = %s AND expired = 0 AND id != %d LIMIT 1"; $exists_id = $wpdb->get_var( $wpdb->prepare( $q, [ $file_row['filename'], (int) $file_row['id'] ] ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared if ( $exists_id ) { $q = "UPDATE `$tb_url_file` SET filename=%s WHERE id=%d"; $wpdb->query( $wpdb->prepare( $q, [ $filecon_md5, (int) $file_row['id'] ] ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared return; } } // Insert a new mapping row. $q = "INSERT INTO `$tb_url_file` SET url_id=%d, vary=%s, filename=%s, type=%d, mobile=%d, webp=%d, expired=0"; $wpdb->query( $wpdb->prepare( $q, [ $url_id, $vary, $filecon_md5, $type, $mobile ? 1 : 0, $webp ? 1 : 0 ] ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared // Mark previous mapping as expiring (to be deleted later). if ( $file_row ) { $q = "UPDATE `$tb_url_file` SET expired=%d WHERE id=%d"; $expired = time() + ( 86400 * apply_filters( 'litespeed_url_file_expired_days', 20 ) ); $wpdb->query( $wpdb->prepare( $q, [ $expired, (int) $file_row['id'] ] ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared // Delete already-expired files for this URL. $q = "SELECT * FROM `$tb_url_file` WHERE url_id = %d AND expired BETWEEN 1 AND %d"; $q = $wpdb->prepare( $q, [ $url_id, time() ] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared $list = $wpdb->get_results( $q, ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared if ( $list ) { foreach ( $list as $v ) { $ext = 'js' === $file_type ? 'js' : 'css'; $file_to_del = trailingslashit( $path ) . $v['filename'] . '.' . $ext; if ( file_exists( $file_to_del ) ) { self::debug( 'Delete expired unused file: ' . $file_to_del ); wp_delete_file( $file_to_del ); } } $q = "DELETE FROM `$tb_url_file` WHERE url_id = %d AND expired BETWEEN 1 AND %d"; $wpdb->query( $wpdb->prepare( $q, [ $url_id, time() ] ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared } } } /** * Load the stored filename (md5) for a given URL/vary/type, if active. * * @since 4.0 * @access public * * @param string $request_url Full request URL or tag. * @param string $vary Vary string (may be md5 if previously stored). * @param string $file_type One of 'css','js','ccss','ucss'. * @return string|false Filename md5 (without extension) or false if none. */ public function load_url_file( $request_url, $vary, $file_type ) { global $wpdb; if ( strlen( $vary ) > 32 ) { $vary = md5( $vary ); } if ( ! isset( $this->_url_file_types[ $file_type ] ) ) { return false; } $type = $this->_url_file_types[ $file_type ]; self::debug2( 'load url file: ' . $request_url ); $tb_url = $this->tb( 'url' ); $q = "SELECT * FROM `$tb_url` WHERE url=%s"; $url_row = $wpdb->get_row( $wpdb->prepare( $q, $request_url ), ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared if ( ! $url_row ) { return false; } $url_id = (int) $url_row['id']; $tb_url_file = $this->tb( 'url_file' ); $q = "SELECT * FROM `$tb_url_file` WHERE url_id=%d AND vary=%s AND type=%d AND expired=0"; $file_row = $wpdb->get_row( $wpdb->prepare( $q, [ $url_id, $vary, $type ] ), ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared if ( ! $file_row ) { return false; } return $file_row['filename']; } /** * Mark all UCSS entries of one URL as expired (optionally return existing rows). * * @since 4.5 * @access public * * @param string $request_url Target URL. * @param bool $auto_q If true, return existing active rows before expiring. * @return array Existing rows if $auto_q, otherwise empty array. */ public function mark_as_expired( $request_url, $auto_q = false ) { global $wpdb; $tb_url = $this->tb( 'url' ); self::debug( 'Try to mark as expired: ' . $request_url ); $q = "SELECT * FROM `$tb_url` WHERE url=%s"; $url_row = $wpdb->get_row( $wpdb->prepare( $q, $request_url ), ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared if ( ! $url_row ) { return []; } self::debug( 'Mark url_id=' . $url_row['id'] . ' as expired' ); $tb_url_file = $this->tb( 'url_file' ); $existing_url_files = []; if ( $auto_q ) { $q = "SELECT a.*, b.url FROM `$tb_url_file` a LEFT JOIN `$tb_url` b ON b.id=a.url_id WHERE a.url_id=%d AND a.type=%d AND a.expired=0"; $q = $wpdb->prepare( $q, [ (int) $url_row['id'], $this->_url_file_types['ucss'] ] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared $existing_url_files = $wpdb->get_results( $q, ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared } $q = "UPDATE `$tb_url_file` SET expired=%d WHERE url_id=%d AND type=%d AND expired=0"; $expired = time() + 86400 * apply_filters( 'litespeed_url_file_expired_days', 20 ); $wpdb->query( $wpdb->prepare( $q, [ $expired, (int) $url_row['id'], $this->_url_file_types['ucss'] ] ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared return $existing_url_files; } /** * Merge CSS excludes from file into the given list. * * @since 3.6 * * @param array $list_in Existing list. * @return array */ public function load_css_exc( $list_in ) { $data = $this->_load_per_line( 'css_excludes.txt' ); if ( $data ) { $list_in = array_unique( array_filter( array_merge( $list_in, $data ) ) ); } return $list_in; } /** * Merge CCSS selector whitelist from file into the given list. * * @since 7.1 * * @param array $list_in Existing list. * @return array */ public function load_ccss_whitelist( $list_in ) { $data = $this->_load_per_line( 'ccss_whitelist.txt' ); if ( $data ) { $list_in = array_unique( array_filter( array_merge( $list_in, $data ) ) ); } return $list_in; } /** * Merge UCSS whitelist from file into the given list. * * @since 4.0 * * @param array $list_in Existing list. * @return array */ public function load_ucss_whitelist( $list_in ) { $data = $this->_load_per_line( 'ucss_whitelist.txt' ); if ( $data ) { $list_in = array_unique( array_filter( array_merge( $list_in, $data ) ) ); } return $list_in; } /** * Merge JS excludes from file into the given list. * * @since 3.5 * * @param array $list_in Existing list. * @return array */ public function load_js_exc( $list_in ) { $data = $this->_load_per_line( 'js_excludes.txt' ); if ( $data ) { $list_in = array_unique( array_filter( array_merge( $list_in, $data ) ) ); } return $list_in; } /** * Merge JS defer excludes from file into the given list. * * @since 3.6 * * @param array $list_in Existing list. * @return array */ public function load_js_defer_exc( $list_in ) { $data = $this->_load_per_line( 'js_defer_excludes.txt' ); if ( $data ) { $list_in = array_unique( array_filter( array_merge( $list_in, $data ) ) ); } return $list_in; } /** * Merge OPTM URI excludes from file into the given list. * * @since 5.4 * * @param array $list_in Existing list. * @return array */ public function load_optm_uri_exc( $list_in ) { $data = $this->_load_per_line( 'optm_uri_exc.txt' ); if ( $data ) { $list_in = array_unique( array_filter( array_merge( $list_in, $data ) ) ); } return $list_in; } /** * Merge ESI nonces from file into the given list. * * @since 3.5 * * @param array $list_in Existing list. * @return array */ public function load_esi_nonces( $list_in ) { $data = $this->_load_per_line( 'esi.nonces.txt' ); if ( $data ) { $list_in = array_unique( array_filter( array_merge( $list_in, $data ) ) ); } return $list_in; } /** * Merge "nocacheable" cache keys from file into the given list. * * @since 6.3.0.1 * * @param array $list_in Existing list. * @return array */ public function load_cache_nocacheable( $list_in ) { $data = $this->_load_per_line( 'cache_nocacheable.txt' ); if ( $data ) { $list_in = array_unique( array_filter( array_merge( $list_in, $data ) ) ); } return $list_in; } /** * Load a data file and return non-empty lines, stripping comments. * * Supports: * - `# comment` * - `##comment` * * @since 3.5 * @access private * * @param string $file Relative filename under the plugin /data directory. * @return array<int,string> */ private function _load_per_line( $file ) { $data = File::read( LSCWP_DIR . 'data/' . $file ); $data = explode( PHP_EOL, $data ); $list = []; foreach ( $data as $v ) { // Drop two kinds of comments. if ( false !== strpos( $v, '##' ) ) { $v = trim( substr( $v, 0, strpos( $v, '##' ) ) ); } if ( false !== strpos( $v, '# ' ) ) { $v = trim( substr( $v, 0, strpos( $v, '# ' ) ) ); } if ( ! $v ) { continue; } $list[] = $v; } return $list; } } src/admin.cls.php 0000777 00000012046 15251157102 0007725 0 ustar 00 <?php /** * The admin-panel specific functionality of the plugin. * * @since 1.0.0 * @package LiteSpeed_Cache */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Admin * * Wires admin-side hooks, actions, and safe redirects. */ class Admin extends Root { const LOG_TAG = '👮'; const PAGE_EDIT_HTACCESS = 'litespeed-edit-htaccess'; /** * Initialize the class and set its properties. * Runs in hook `after_setup_theme` when is_admin(). * * @since 1.0.0 */ public function __construct() { // Define LSCWP_MU_PLUGIN if in mu-plugins. if ( defined( 'WPMU_PLUGIN_DIR' ) && dirname( LSCWP_DIR ) === WPMU_PLUGIN_DIR && ! defined( 'LSCWP_MU_PLUGIN' ) ) { define( 'LSCWP_MU_PLUGIN', true ); } self::debug( 'No cache due to Admin page' ); if ( ! defined( 'DONOTCACHEPAGE' ) ) { define( 'DONOTCACHEPAGE', true ); } // Additional LiteSpeed assets on admin display (also registers menus). $this->cls( 'Admin_Display' ); // Initialize admin actions. add_action( 'admin_init', [ $this, 'admin_init' ] ); // Add link to plugin list page. add_filter( 'plugin_action_links_' . LSCWP_BASENAME, [ $this->cls( 'Admin_Display' ), 'add_plugin_links' ] ); } /** * Callback that initializes the admin options for LiteSpeed Cache. * * @since 1.0.0 * @return void */ public function admin_init() { // Hook attachment upload auto optimization. if ( $this->conf( Base::O_IMG_OPTM_AUTO ) ) { add_filter( 'wp_update_attachment_metadata', [ $this, 'wp_update_attachment_metadata' ], 9999, 2 ); } $this->_proceed_admin_action(); // Terminate if user doesn't have access to settings. $capability = is_network_admin() ? 'manage_network_options' : 'manage_options'; if ( ! current_user_can( $capability ) ) { return; } // Add privacy policy (since 2.2.6). if ( function_exists( 'wp_add_privacy_policy_content' ) ) { wp_add_privacy_policy_content( Core::NAME, Doc::privacy_policy() ); } $this->cls( 'Media' )->after_admin_init(); do_action( 'litespeed_after_admin_init' ); if ( $this->cls( 'Router' )->esi_enabled() ) { add_action( 'in_widget_form', [ $this->cls( 'Admin_Display' ), 'show_widget_edit' ], 100, 3 ); add_filter( 'widget_update_callback', __NAMESPACE__ . '\Admin_Settings::validate_widget_save', 10, 4 ); } } /** * Handle attachment metadata update. * * @since 4.0 * * @param array $data Attachment meta. * @param int $post_id Attachment ID. * @return array Filtered meta. */ public function wp_update_attachment_metadata( $data, $post_id ) { $this->cls( 'Img_Optm' )->wp_update_attachment_metadata( $data, $post_id ); return $data; } /** * Run LiteSpeed admin actions routed via Router. * * @since 1.1.0 * @return void */ private function _proceed_admin_action() { $action = Router::get_action(); switch ( $action ) { case Router::ACTION_SAVE_SETTINGS: $this->cls( 'Admin_Settings' )->save( wp_unslash( $_POST ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing break; case Router::ACTION_SAVE_SETTINGS_NETWORK: $this->cls( 'Admin_Settings' )->network_save( wp_unslash( $_POST ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing break; default: break; } } /** * Clean up the input (array or scalar) of any extra slashes/spaces. * * @since 1.0.4 * * @param mixed $input The input value to clean. * @return mixed Cleaned value. */ public static function cleanup_text( $input ) { if ( is_array( $input ) ) { return array_map( __CLASS__ . '::cleanup_text', $input ); } return stripslashes(trim($input)); } /** * After a LSCWP_CTRL action, redirect back to same page * without nonce and action in the query string. * * If the redirect URL cannot be determined, redirects to the homepage. * * @since 1.0.12 * * @param string|false $url Optional destination URL. * @return void */ public static function redirect( $url = false ) { global $pagenow; // If originated, go back to referrer or home. if ( ! empty( $_GET['_litespeed_ori'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended $ref = wp_get_referer(); wp_safe_redirect( $ref ? $ref : get_home_url() ); exit; } if ( ! $url ) { $clean = []; // Sanitize current query args while removing our internals. if ( ! empty( $_GET ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended foreach ( $_GET as $k => $v ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( in_array( $k, [ Router::ACTION, Router::NONCE, Router::TYPE, 'litespeed_i', 'litespeed_tb' ], true ) ) { continue; } // Normalize to string for URL building. $clean[ $k ] = is_array( $v ) ? array_map( 'sanitize_text_field', wp_unslash( $v ) ) : sanitize_text_field( wp_unslash( $v ) ); } } $qs = ''; if ( ! empty( $clean ) ) { $qs = '?' . http_build_query( $clean ); } $url = is_network_admin() ? network_admin_url( $pagenow . $qs ) : admin_url( $pagenow . $qs ); } wp_safe_redirect( $url ); exit; } } src/conf.cls.php 0000777 00000047037 15251157102 0007572 0 ustar 00 <?php /** * The core plugin config class. * * This maintains all the options and settings for this plugin. * * @since 1.0.0 * @package LiteSpeed */ namespace LiteSpeed; defined('WPINC') || exit(); /** * Class Conf * * Maintains all LiteSpeed plugin configuration, including CRUD for single-site * and multisite options, upgrade flows, and side effects like purging/cron. */ class Conf extends Base { const TYPE_SET = 'set'; /** * IDs that were updated during a save cycle. * * @var array<string|int,mixed> */ private $_updated_ids = []; /** * Whether current blog is the network primary site. * * @var bool */ private $_is_primary = false; /** * Specify init logic to avoid infinite loop when calling conf.cls instance * * @since 3.0 * @access public * @return void */ public function init() { // Check if conf exists or not. If not, create them in DB (won't change version if is converting v2.9- data) // Conf may be stale, upgrade later $this->_conf_db_init(); /** * Detect if has quic.cloud set * * @since 2.9.7 */ if ( $this->conf( self::O_CDN_QUIC ) ) { if ( ! defined( 'LITESPEED_ALLOWED' ) ) { define( 'LITESPEED_ALLOWED', true ); } } add_action( 'litespeed_conf_append', [ $this, 'option_append' ], 10, 2 ); add_action( 'litespeed_conf_force', [ $this, 'force_option' ], 10, 2 ); $this->define_cache(); } /** * Init conf related data * * @since 3.0 * @access private * @return void */ private function _conf_db_init() { /** * Try to load options first, network sites can override this later * * NOTE: Load before run `conf_upgrade()` to avoid infinite loop when getting conf in `conf_upgrade()` */ $this->load_options(); // Check if debug is on // Init debug as early as possible if ( $this->conf( Base::O_DEBUG ) ) { $this->cls( 'Debug2' )->init(); } $ver = $this->conf( self::_VER ); /** * Version is less than v3.0, or, is a new installation */ $ver_check_tag = 'new'; if ( $ver ) { if ( ! defined( 'LSCWP_CUR_V' ) ) { define( 'LSCWP_CUR_V', $ver ); } /** * Upgrade conf */ if ( Core::VER !== $ver ) { // Plugin version will be set inside // Site plugin upgrade & version change will do in load_site_conf $ver_check_tag = Data::cls()->conf_upgrade( $ver ); } } /** * Sync latest new options */ if ( ! $ver || Core::VER !== $ver ) { // Load default values $this->load_default_vals(); if ( ! $ver ) { // New install $this->set_conf( self::$_default_options ); $ver_check_tag .= ' activate' . ( defined( 'LSCWP_REF' ) ? '_' . constant( 'LSCWP_REF' ) : '' ); } // Init new default/missing options foreach ( self::$_default_options as $k => $v ) { // If the option existed, bypass updating // Bcos we may ask clients to deactivate for debug temporarily, we need to keep the current cfg in deactivation, hence we need to only try adding default cfg when activating. self::add_option( $k, $v ); } // Force correct version in case a rare unexpected case that `_ver` exists but empty self::update_option( Base::_VER, Core::VER ); if ( $ver_check_tag ) { Cloud::version_check( $ver_check_tag ); } } /** * Network sites only * * Override conf if is network subsites and chose `Use Primary Config` */ $this->_try_load_site_options(); // Check if debug is on // Init debug as early as possible if ( $this->conf( Base::O_DEBUG ) ) { $this->cls( 'Debug2' )->init(); } // Mark as conf loaded if ( ! defined( 'LITESPEED_CONF_LOADED' ) ) { define( 'LITESPEED_CONF_LOADED', true ); } if ( ! $ver || Core::VER !== $ver ) { // Only trigger once in upgrade progress, don't run always $this->update_confs(); // Files only get corrected in activation or saving settings actions. } } /** * Load all latest options from DB * * @since 3.0 * @access public * * @param int|null $blog_id Blog ID to load from. Null for current. * @param bool $dry_run Return options instead of setting them. * @return array<string,mixed>|void */ public function load_options( $blog_id = null, $dry_run = false ) { $options = []; foreach ( self::$_default_options as $k => $v ) { if ( null !== $blog_id ) { $options[ $k ] = self::get_blog_option( $blog_id, $k, $v ); } else { $options[ $k ] = self::get_option( $k, $v ); } // Correct value type $options[ $k ] = $this->type_casting( $options[ $k ], $k ); } if ( $dry_run ) { return $options; } // Bypass site special settings if ( null !== $blog_id ) { // This is to load the primary settings ONLY // These options are the ones that can be overwritten by primary $options = array_diff_key( $options, array_flip( self::$single_site_options ) ); $this->set_primary_conf( $options ); } else { $this->set_conf( $options ); } // Append const options if ( defined( 'LITESPEED_CONF' ) && LITESPEED_CONF ) { foreach ( self::$_default_options as $k => $v ) { $const = Base::conf_const( $k ); if ( defined( $const ) ) { $this->set_const_conf( $k, $this->type_casting( constant( $const ), $k ) ); } } } } /** * For multisite installations, the single site options need to be updated with the network wide options. * * @since 1.0.13 * @access private * @return void */ private function _try_load_site_options() { if ( ! $this->_if_need_site_options() ) { return; } $this->_conf_site_db_init(); $this->_is_primary = BLOG_ID_CURRENT_SITE === get_current_blog_id(); // If network set to use primary setting if ( $this->network_conf( self::NETWORK_O_USE_PRIMARY ) && ! $this->_is_primary ) { // subsites or network admin // Get the primary site settings // If it's just upgraded, 2nd blog is being visited before primary blog, can just load default config (won't hurt as this could only happen shortly) $this->load_options( BLOG_ID_CURRENT_SITE ); } // Overwrite single blog options with site options foreach ( self::$_default_options as $k => $v ) { if ( ! $this->has_network_conf( $k ) ) { continue; } // $this->_options[ $k ] = $this->_network_options[ $k ]; // Special handler to `Enable Cache` option if the value is set to OFF if ( self::O_CACHE === $k ) { if ( $this->_is_primary ) { if ( $this->conf( $k ) !== $this->network_conf( $k ) ) { if ( self::VAL_ON2 !== $this->conf( $k ) ) { continue; } } } elseif ( $this->network_conf( self::NETWORK_O_USE_PRIMARY ) ) { if ( $this->has_primary_conf( $k ) && self::VAL_ON2 !== $this->primary_conf( $k ) ) { // This case will use primary_options override always continue; } } elseif ( self::VAL_ON2 !== $this->conf( $k ) ) { continue; } } // primary_options will store primary settings + network settings, OR, store the network settings for subsites $this->set_primary_conf( $k, $this->network_conf( $k ) ); } // var_dump($this->_options); } /** * Check if needs to load site_options for network sites * * @since 3.0 * @access private * @return bool */ private function _if_need_site_options() { if ( ! is_multisite() ) { return false; } // Check if needs to use site_options or not // todo: check if site settings are separate bcos it will affect .htaccess /** * In case this is called outside the admin page * * @see https://codex.wordpress.org/Function_Reference/is_plugin_active_for_network * @since 2.0 */ if ( ! function_exists( 'is_plugin_active_for_network' ) ) { require_once ABSPATH . '/wp-admin/includes/plugin.php'; } // If is not activated on network, it will not have site options if ( ! is_plugin_active_for_network( Core::PLUGIN_FILE ) ) { if ( self::VAL_ON2 === (int) $this->conf( self::O_CACHE ) ) { // Default to cache on $this->set_conf( self::_CACHE, true ); } return false; } return true; } /** * Init site conf and upgrade if necessary * * @since 3.0 * @access private * @return void */ private function _conf_site_db_init() { $this->load_site_options(); $ver = $this->network_conf( self::_VER ); /** * Don't upgrade or run new installations other than from backend visit * In this case, just use default conf */ if ( ! $ver || Core::VER !== $ver ) { if ( ! is_admin() && ! defined( 'LITESPEED_CLI' ) ) { $this->set_network_conf( $this->load_default_site_vals() ); return; } } /** * Upgrade conf */ if ( $ver && Core::VER !== $ver ) { // Site plugin version will change inside Data::cls()->conf_site_upgrade( $ver ); } /** * Is a new installation */ if ( ! $ver || Core::VER !== $ver ) { // Load default values $this->load_default_site_vals(); // Init new default/missing options foreach ( self::$_default_site_options as $k => $v ) { // If the option existed, bypass updating self::add_site_option( $k, $v ); } } } /** * Get the plugin's site wide options. * * If the site wide options are not set yet, set it to default. * * @since 1.0.2 * @access public * @return null|void */ public function load_site_options() { if ( ! is_multisite() ) { return null; } // Load all site options foreach ( self::$_default_site_options as $k => $v ) { $val = self::get_site_option( $k, $v ); $val = $this->type_casting( $val, $k, true ); $this->set_network_conf( $k, $val ); } } /** * Append a 3rd party option to default options * * This will not be affected by network use primary site setting. * * NOTE: If it is a multi switch option, need to call `_conf_multi_switch()` first * * @since 3.0 * @access public * * @param string $name Option name. * @param mixed $default_val Default value. * @return void */ public function option_append( $name, $default_val ) { self::$_default_options[ $name ] = $default_val; $this->set_conf( $name, self::get_option( $name, $default_val ) ); $this->set_conf( $name, $this->type_casting( $this->conf( $name ), $name ) ); } /** * Force an option to a certain value * * @since 2.6 * @access public * * @param string $k Option key. * @param mixed $v Option value. * @return void */ public function force_option( $k, $v ) { if ( ! $this->has_conf( $k ) ) { return; } $v = $this->type_casting( $v, $k ); if ( $this->conf( $k ) === $v ) { return; } // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export Debug2::debug( '[Conf] ** ' . $k . ' forced from ' . var_export( $this->conf( $k ), true ) . ' to ' . var_export( $v, true ) ); $this->set_conf( $k, $v ); } /** * Define `_CACHE` const in options ( for both single and network ) * * @since 3.0 * @access public * @return void */ public function define_cache() { // Init global const cache on setting $this->set_conf( self::_CACHE, false ); if ( self::VAL_ON === (int) $this->conf( self::O_CACHE ) || $this->conf( self::O_CDN_QUIC ) ) { $this->set_conf( self::_CACHE, true ); } // Check network if ( ! $this->_if_need_site_options() ) { // Set cache on $this->_define_cache_on(); return; } // If use network setting if ( self::VAL_ON2 === (int) $this->conf( self::O_CACHE ) && $this->network_conf( self::O_CACHE ) ) { $this->set_conf( self::_CACHE, true ); } $this->_define_cache_on(); } /** * Define `LITESPEED_ON` * * @since 2.1 * @access private * @return void */ private function _define_cache_on() { if ( ! $this->conf( self::_CACHE ) ) { return; } if ( defined( 'LITESPEED_ALLOWED' ) && ! defined( 'LITESPEED_ON' ) ) { define( 'LITESPEED_ON', true ); } } /** * Save option * * @since 3.0 * @access public * * @param array<string,mixed> $the_matrix Option-value map. * @return void */ public function update_confs( $the_matrix = [] ) { if ( $the_matrix ) { foreach ( $the_matrix as $id => $val ) { $this->update( $id, $val ); } } if ( $this->_updated_ids ) { foreach ( $this->_updated_ids as $id ) { // Check if need to do a purge all or not if ( $this->_conf_purge_all( $id ) ) { Purge::purge_all( 'conf changed [id] ' . $id ); } // Check if need to purge a tag $tag = $this->_conf_purge_tag( $id ); if ( $tag ) { Purge::add( $tag ); } // Update cron if ( $this->_conf_cron( $id ) ) { $this->cls( 'Task' )->try_clean( $id ); } // Reset crawler bypassed list when any of the options WebP replace, guest mode, or cache mobile got changed if ( self::O_IMG_OPTM_WEBP === $id || self::O_GUEST === $id || self::O_CACHE_MOBILE === $id ) { $this->cls( 'Crawler' )->clear_disabled_list(); } } } do_action( 'litespeed_update_confs', $the_matrix ); // Update related tables $this->cls( 'Data' )->correct_tb_existence(); // Update related files $this->cls( 'Activation' )->update_files(); /** * CDN related actions - Cloudflare */ $this->cls( 'CDN\Cloudflare' )->try_refresh_zone(); // If Server IP changed, must test echo if ( in_array( self::O_SERVER_IP, $this->_updated_ids, true ) ) { $this->cls( 'Cloud' )->init_qc_cli(); } // CDN related actions - QUIC.cloud $this->cls( 'CDN\Quic' )->try_sync_conf(); } /** * Save option * * Note: this is direct save, won't trigger corresponding file update or data sync. To save settings normally, always use `Conf->update_confs()` * * @since 3.0 * @access public * * @param string $id Option ID. * @param mixed $val Option value. * @return void */ public function update( $id, $val ) { // Bypassed this bcos $this->_options could be changed by force_option() // if ( $this->_options[ $id ] === $val ) { // return; // } if ( self::_VER === $id ) { return; } if ( self::O_SERVER_IP === $id ) { if ( $val && ! Utility::valid_ipv4( $val ) ) { $msg = sprintf( __( 'Saving option failed. IPv4 only for %s.', 'litespeed-cache' ), Lang::title( Base::O_SERVER_IP ) ); Admin_Display::error( $msg ); return; } } if ( ! array_key_exists( $id, self::$_default_options ) ) { if ( defined( 'LSCWP_LOG' ) ) { Debug2::debug( '[Conf] Invalid option ID ' . $id ); } return; } if ( $val && $this->_conf_pswd( $id ) && ! preg_match( '/[^\*]/', (string) $val ) ) { return; } // Special handler for CDN Original URLs if ( self::O_CDN_ORI === $id && ! $val ) { $site_url = site_url( '/' ); $parsed = wp_parse_url( $site_url ); if ( !empty( $parsed['scheme'] ) ) { $site_url = str_replace( $parsed['scheme'] . ':', '', $site_url ); } $val = $site_url; } // Validate type $val = $this->type_casting( $val, $id ); // Save data self::update_option( $id, $val ); // Handle purge if setting changed if ( $this->conf( $id ) !== $val ) { $this->_updated_ids[] = $id; // Check if need to fire a purge or not (Here has to stay inside `update()` bcos need comparing old value) if ( $this->_conf_purge( $id ) ) { $old = (array) $this->conf( $id ); $new = (array) $val; $diff = array_merge( array_diff( $new, $old ), array_diff( $old, $new ) ); // If has difference foreach ( $diff as $v ) { $v = ltrim( (string) $v, '^' ); $v = rtrim( (string) $v, '$' ); $this->cls( 'Purge' )->purge_url( $v ); } } } // Update in-memory data $this->set_conf( $id, $val ); } /** * Save network option * * @since 3.0 * @access public * * @param string $id Option ID. * @param mixed $val Option value. * @return void */ public function network_update( $id, $val ) { if ( ! array_key_exists( $id, self::$_default_site_options ) ) { if ( defined( 'LSCWP_LOG' ) ) { Debug2::debug( '[Conf] Invalid network option ID ' . $id ); } return; } if ( $val && $this->_conf_pswd( $id ) && ! preg_match( '/[^\*]/', (string) $val ) ) { return; } // Validate type if ( is_bool( self::$_default_site_options[ $id ] ) ) { $max = $this->_conf_multi_switch( $id ); if ( $max && $val > 1 ) { $val %= ( $max + 1 ); } else { $val = (bool) $val; } } elseif ( is_array( self::$_default_site_options[ $id ] ) ) { // from textarea input if ( ! is_array( $val ) ) { $val = Utility::sanitize_lines( $val, $this->_conf_filter( $id ) ); } } elseif ( ! is_string( self::$_default_site_options[ $id ] ) ) { $val = (int) $val; } else { // Check if the string has a limit set $val = $this->_conf_string_val( $id, $val ); } // Save data self::update_site_option( $id, $val ); // Handle purge if setting changed if ( $this->network_conf( $id ) !== $val ) { // Check if need to do a purge all or not if ( $this->_conf_purge_all( $id ) ) { Purge::purge_all( '[Conf] Network conf changed [id] ' . $id ); } // Update in-memory data $this->set_network_conf( $id, $val ); } // No need to update cron here, Cron will register in each init if ( $this->has_conf( $id ) ) { $this->set_conf( $id, $val ); } } /** * Check if one user role is in exclude optimization group settings * * @since 1.6 * @access public * * @param string|null $role The user role. * @return string|false The set value if already set, otherwise false. */ public function in_optm_exc_roles( $role = null ) { // Get user role if ( null === $role ) { $role = Router::get_role(); } if ( ! $role ) { return false; } $roles = explode( ',', $role ); $found = array_intersect( $roles, $this->conf( self::O_OPTM_EXC_ROLES ) ); return $found ? implode( ',', $found ) : false; } /** * Set one config value directly * * @since 2.9 * @access private * @return void */ private function _set_conf() { /** * NOTE: For URL Query String setting, * 1. If append lines to an array setting e.g. `cache-force_uri`, use `set[cache-force_uri][]=the_url`. * 2. If replace the array setting with one line, use `set[cache-force_uri]=the_url`. * 3. If replace the array setting with multi lines value, use 2 then 1. */ // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput $raw = !empty( $_GET[ self::TYPE_SET ] ) ? $_GET[ self::TYPE_SET ] : false; if ( !$raw || ! is_array( $raw ) ) { return; } // Sanitize the incoming matrix. $the_matrix = []; foreach ( $raw as $id => $v ) { if ( ! $this->has_conf( $id ) ) { continue; } // Append new item to array type settings if ( is_array( $v ) && is_array( $this->conf( $id ) ) ) { $v = array_merge( $this->conf( $id ), $v ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export Debug2::debug( '[Conf] Appended to settings [' . $id . ']: ' . var_export( $v, true ) ); } else { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export Debug2::debug( '[Conf] Set setting [' . $id . ']: ' . var_export( $v, true ) ); } $the_matrix[ $id ] = $v; } if ( !$the_matrix ) { return; } $this->update_confs( $the_matrix ); $msg = __( 'Changed setting successfully.', 'litespeed-cache' ); Admin_Display::success( $msg ); // Redirect if changed frontend URL // phpcs:ignore WordPress.Security.NonceVerification.Recommended $redirect = ! empty( $_GET['redirect'] ) ? sanitize_text_field( wp_unslash( $_GET['redirect'] ) ) : ''; if ( $redirect ) { wp_safe_redirect( $redirect ); exit; } } /** * Handle all request actions from main cls * * @since 2.9 * @access public * @return void */ public function handler() { $type = Router::verify_type(); switch ( $type ) { case self::TYPE_SET: $this->_set_conf(); break; default: break; } Admin::redirect(); } } src/core.cls.php 0000777 00000051742 15251157102 0007573 0 ustar 00 <?php /** * The core plugin class. * * This is the main class for the LiteSpeed Cache plugin, responsible for initializing * the plugin's core functionality, registering hooks, and handling cache-related operations. * * Note: Core doesn't allow $this->cls( 'Core' ) * * @since 1.0.0 * @package LiteSpeed */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Core * * @since 1.0.0 */ class Core extends Root { const NAME = 'LiteSpeed Cache'; const PLUGIN_NAME = 'litespeed-cache'; const PLUGIN_FILE = 'litespeed-cache/litespeed-cache.php'; const VER = LSCWP_V; const ACTION_DISMISS = 'dismiss'; const ACTION_PURGE_BY = 'PURGE_BY'; const ACTION_PURGE_EMPTYCACHE = 'PURGE_EMPTYCACHE'; const ACTION_QS_PURGE = 'PURGE'; const ACTION_QS_PURGE_SINGLE = 'PURGESINGLE'; // This will be same as `ACTION_QS_PURGE` (purge single URL only) const ACTION_QS_SHOW_HEADERS = 'SHOWHEADERS'; const ACTION_QS_PURGE_ALL = 'purge_all'; const ACTION_QS_PURGE_EMPTYCACHE = 'empty_all'; const ACTION_QS_NOCACHE = 'NOCACHE'; const HEADER_DEBUG = 'X-LiteSpeed-Debug'; /** * Whether to show debug headers. * * @var bool * @since 1.0.0 */ protected static $debug_show_header = false; /** * Footer comment buffer. * * @var string * @since 1.0.0 */ private $footer_comment = ''; /** * Define the core functionality of the plugin. * * Set the plugin name and the plugin version that can be used throughout the plugin. * Load the dependencies, define the locale, and set the hooks for the admin area and * the public-facing side of the site. * * @since 1.0.0 */ public function __construct() { ! defined( 'LSCWP_TS_0' ) && define( 'LSCWP_TS_0', microtime( true ) ); $this->cls( 'Conf' )->init(); /** * Load API hooks * * @since 3.0 */ $this->cls( 'API' )->init(); if ( defined( 'LITESPEED_ON' ) ) { // Load third party detection if lscache enabled. include_once LSCWP_DIR . 'thirdparty/entry.inc.php'; } if ( $this->conf( Base::O_DEBUG_DISABLE_ALL ) || Debug2::is_tmp_disable() ) { ! defined( 'LITESPEED_DISABLE_ALL' ) && define( 'LITESPEED_DISABLE_ALL', true ); } /** * Register plugin activate/deactivate/uninstall hooks * NOTE: this can't be moved under after_setup_theme, otherwise activation will be bypassed * * @since 2.7.1 Disabled admin&CLI check to make frontend able to enable cache too */ $plugin_file = LSCWP_DIR . 'litespeed-cache.php'; register_activation_hook( $plugin_file, [ __NAMESPACE__ . '\Activation', 'register_activation' ] ); register_deactivation_hook( $plugin_file, [ __NAMESPACE__ . '\Activation', 'register_deactivation' ] ); register_uninstall_hook( $plugin_file, __NAMESPACE__ . '\Activation::uninstall_litespeed_cache' ); if ( defined( 'LITESPEED_ON' ) ) { // Register purge_all actions $purge_all_events = $this->conf( Base::O_PURGE_HOOK_ALL ); // Purge all on upgrade if ( $this->conf( Base::O_PURGE_ON_UPGRADE ) ) { $purge_all_events[] = 'automatic_updates_complete'; $purge_all_events[] = 'upgrader_process_complete'; $purge_all_events[] = 'admin_action_do-plugin-upgrade'; } foreach ( $purge_all_events as $event ) { // Don't allow hook to update_option because purge_all will cause infinite loop of update_option if ( in_array( $event, [ 'update_option' ], true ) ) { continue; } add_action( $event, __NAMESPACE__ . '\Purge::purge_all' ); } // Add headers to site health check for full page cache // @since 5.4 add_filter( 'site_status_page_cache_supported_cache_headers', function ( $cache_headers ) { $is_cache_hit = function ( $header_value ) { return false !== strpos( strtolower( $header_value ), 'hit' ); }; $cache_headers['x-litespeed-cache'] = $is_cache_hit; $cache_headers['x-lsadc-cache'] = $is_cache_hit; $cache_headers['x-qc-cache'] = $is_cache_hit; return $cache_headers; } ); } add_action( 'after_setup_theme', [ $this, 'init' ] ); // Check if there is a purge request in queue if ( ! defined( 'LITESPEED_CLI' ) ) { $purge_queue = Purge::get_option( Purge::DB_QUEUE ); if ( $purge_queue && '-1' !== $purge_queue ) { $this->http_header( $purge_queue ); Debug2::debug( '[Core] Purge Queue found&sent: ' . $purge_queue ); } if ( '-1' !== $purge_queue ) { Purge::update_option( Purge::DB_QUEUE, '-1' ); // Use -1 to bypass purge while still enable db update as WP's update_option will check value===false to bypass update } $purge_queue = Purge::get_option( Purge::DB_QUEUE2 ); if ( $purge_queue && '-1' !== $purge_queue ) { $this->http_header( $purge_queue ); Debug2::debug( '[Core] Purge2 Queue found&sent: ' . $purge_queue ); } if ( '-1' !== $purge_queue ) { Purge::update_option( Purge::DB_QUEUE2, '-1' ); } } /** * Hook internal REST * * @since 2.9.4 */ $this->cls( 'REST' ); /** * Hook wpnonce function * * Note: ESI nonce won't be available until hook after_setup_theme ESI init due to Guest Mode concern * * @since 4.1 */ if ( $this->cls( 'Router' )->esi_enabled() && ! function_exists( 'wp_create_nonce' ) ) { Debug2::debug( '[ESI] Overwrite wp_create_nonce()' ); litespeed_define_nonce_func(); } } /** * The plugin initializer. * * This function checks if the cache is enabled and ready to use, then determines what actions need to be set up based on the type of user and page accessed. Output is buffered if the cache is enabled. * * NOTE: WP user doesn't init yet * * @since 1.0.0 */ public function init() { /** * Added hook before init * 3rd party preload hooks will be fired here too (e.g. Divi disable all in edit mode) * * @since 1.6.6 * @since 2.6 Added filter to all config values in Conf */ do_action( 'litespeed_init' ); add_action( 'wp_ajax_async_litespeed', 'LiteSpeed\Task::async_litespeed_handler' ); add_action( 'wp_ajax_nopriv_async_litespeed', 'LiteSpeed\Task::async_litespeed_handler' ); // In `after_setup_theme`, before `init` hook $this->cls( 'Activation' )->auto_update(); if ( is_admin() && ! wp_doing_ajax() ) { $this->cls( 'Admin' ); } if ( defined( 'LITESPEED_DISABLE_ALL' ) && LITESPEED_DISABLE_ALL ) { Debug2::debug( '[Core] Bypassed due to debug disable all setting' ); return; } do_action( 'litespeed_initing' ); ob_start( [ $this, 'send_headers_force' ] ); add_action( 'shutdown', [ $this, 'send_headers' ], 0 ); add_action( 'wp_footer', [ $this, 'footer_hook' ] ); /** * Check if is non-optimization simulator * * @since 2.9 */ // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( ! empty( $_GET[ Router::ACTION ] ) && 'before_optm' === $_GET[ Router::ACTION ] && ! apply_filters( 'litespeed_qs_forbidden', false ) ) { Debug2::debug( '[Core] ⛑️ bypass_optm due to QS CTRL' ); ! defined( 'LITESPEED_NO_OPTM' ) && define( 'LITESPEED_NO_OPTM', true ); } /** * Register vary filter * * @since 1.6.2 */ $this->cls( 'Control' )->init(); // Init Purge hooks $this->cls( 'Purge' )->init(); $this->cls( 'Tag' )->init(); // Load hooks that may be related to users add_action( 'init', [ $this, 'after_user_init' ], 5 ); // Load 3rd party hooks add_action( 'wp_loaded', [ $this, 'load_thirdparty' ], 2 ); } /** * Run hooks after user init * * @since 2.9.8 */ public function after_user_init() { $this->cls( 'Router' )->is_role_simulation(); // Detect if is Guest mode or not $this->cls( 'Vary' )->after_user_init(); // Register attachment delete hook $this->cls( 'Media' )->after_user_init(); /** * Preload ESI functionality for ESI request URI recovery * * @since 1.8.1 * @since 4.0 ESI init needs to be after Guest mode detection to bypass ESI if is under Guest mode */ $this->cls( 'ESI' )->init(); if ( ! is_admin() && ! defined( 'LITESPEED_GUEST_OPTM' ) ) { $result = $this->cls( 'Conf' )->in_optm_exc_roles(); if ( $result ) { Debug2::debug( '[Core] ⛑️ bypass_optm: hit Role Excludes setting: ' . $result ); ! defined( 'LITESPEED_NO_OPTM' ) && define( 'LITESPEED_NO_OPTM', true ); } } // Heartbeat control $this->cls( 'Tool' )->heartbeat(); if ( ! defined( 'LITESPEED_NO_OPTM' ) || ! LITESPEED_NO_OPTM ) { // Check missing static files $this->cls( 'Router' )->serve_static(); $this->cls( 'Media' )->init(); $this->cls( 'Placeholder' )->init(); $this->cls( 'Router' )->can_optm() && $this->cls( 'Optimize' )->init(); $this->cls( 'Localization' )->init(); // Hook CDN for attachments $this->cls( 'CDN' )->init(); // Load cron tasks $this->cls( 'Task' )->init(); } // Load litespeed actions $action = Router::get_action(); if ( $action ) { $this->proceed_action( $action ); } // Load frontend GUI if ( ! is_admin() ) { $this->cls( 'GUI' )->init(); } } /** * Run frontend actions * * @since 1.1.0 * @param string $action The action to proceed. */ public function proceed_action( $action ) { $msg = false; // Handle actions switch ( $action ) { case self::ACTION_QS_SHOW_HEADERS: self::$debug_show_header = true; break; case self::ACTION_QS_PURGE: case self::ACTION_QS_PURGE_SINGLE: Purge::set_purge_single(); break; case self::ACTION_QS_PURGE_ALL: Purge::purge_all(); break; case self::ACTION_PURGE_EMPTYCACHE: case self::ACTION_QS_PURGE_EMPTYCACHE: define( 'LSWCP_EMPTYCACHE', true ); // Clear all sites caches Purge::purge_all(); $msg = __( 'Notified LiteSpeed Web Server to purge everything.', 'litespeed-cache' ); break; case self::ACTION_PURGE_BY: $this->cls( 'Purge' )->purge_list(); $msg = __( 'Notified LiteSpeed Web Server to purge the list.', 'litespeed-cache' ); break; case self::ACTION_DISMISS: GUI::dismiss(); break; default: $msg = $this->cls( 'Router' )->handler( $action ); break; } if ( $msg && ! Router::is_ajax() ) { Admin_Display::add_notice( Admin_Display::NOTICE_GREEN, $msg ); Admin::redirect(); return; } if ( Router::is_ajax() ) { exit(); } } /** * Callback used to call the detect third party action. * * The detect action is used by third party plugin integration classes to determine if they should add the rest of their hooks. * * @since 1.0.5 */ public function load_thirdparty() { do_action( 'litespeed_load_thirdparty' ); } /** * Mark wp_footer called * * @since 1.3 */ public function footer_hook() { Debug2::debug( '[Core] Footer hook called' ); if ( ! defined( 'LITESPEED_FOOTER_CALLED' ) ) { define( 'LITESPEED_FOOTER_CALLED', true ); } } /** * Trigger comment info display hook * * @since 1.3 * @param string|null $buffer The buffer to check. * @return void */ private function check_is_html( $buffer = null ) { if ( ! defined( 'LITESPEED_FOOTER_CALLED' ) ) { Debug2::debug2( '[Core] CHK html bypass: miss footer const' ); return; } if ( wp_doing_ajax() ) { Debug2::debug2( '[Core] CHK html bypass: doing ajax' ); return; } if ( wp_doing_cron() ) { Debug2::debug2( '[Core] CHK html bypass: doing cron' ); return; } if ( empty( $_SERVER['REQUEST_METHOD'] ) || 'GET' !== $_SERVER['REQUEST_METHOD'] ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized Debug2::debug2( '[Core] CHK html bypass: not get method ' . wp_unslash( $_SERVER['REQUEST_METHOD'] ) ); return; } if ( null === $buffer ) { $buffer = ob_get_contents(); } // Double check to make sure it is an HTML file if ( strlen( $buffer ) > 300 ) { $buffer = substr( $buffer, 0, 300 ); } if ( false !== strstr( $buffer, '<!--' ) ) { $buffer = preg_replace( '/<!--.*?-->/s', '', $buffer ); } $buffer = trim( $buffer ); $buffer = File::remove_zero_space( $buffer ); $is_html = 0 === stripos( $buffer, '<html' ) || 0 === stripos( $buffer, '<!DOCTYPE' ); if ( ! $is_html ) { Debug2::debug( '[Core] Footer check failed: ' . ob_get_level() . '-' . substr( $buffer, 0, 100 ) ); return; } Debug2::debug( '[Core] Footer check passed' ); if ( ! defined( 'LITESPEED_IS_HTML' ) ) { define( 'LITESPEED_IS_HTML', true ); } } /** * For compatibility with plugins that have 'Bad' logic that forced all buffer output even if it is NOT their buffer. * * Usually this is called after send_headers() if following original WP process * * @since 1.1.5 * @param string $buffer The buffer to process. * @return string The processed buffer. */ public function send_headers_force( $buffer ) { $this->check_is_html( $buffer ); // Hook to modify buffer before $buffer = apply_filters( 'litespeed_buffer_before', $buffer ); /** * Media: Image lazyload && WebP * GUI: Clean wrapper mainly for ESI block NOTE: this needs to be before optimizer to avoid wrapper being removed * Optimize * CDN */ if ( ! defined( 'LITESPEED_NO_OPTM' ) || ! LITESPEED_NO_OPTM ) { Debug2::debug( '[Core] run hook litespeed_buffer_finalize' ); $buffer = apply_filters( 'litespeed_buffer_finalize', $buffer ); } /** * Replace ESI preserved list * * @since 3.3 Replace this in the end to avoid `Inline JS Defer` or other Page Optm features encoded ESI tags wrongly, which caused LSWS can't recognize ESI */ $buffer = $this->cls( 'ESI' )->finalize( $buffer ); $this->send_headers( true ); // Log ESI nonce buffer empty issue if ( defined( 'LSCACHE_IS_ESI' ) && 0 === strlen( $buffer ) && ! empty( $_SERVER['REQUEST_URI'] ) ) { // Log ref for debug purpose // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.PHP.DevelopmentFunctions.error_log_error_log error_log( 'ESI buffer empty ' . wp_unslash( $_SERVER['REQUEST_URI'] ) ); } // Init comment info $running_info_showing = defined( 'LITESPEED_IS_HTML' ) || defined( 'LSCACHE_IS_ESI' ); if ( defined( 'LSCACHE_ESI_SILENCE' ) ) { $running_info_showing = false; Debug2::debug( '[Core] ESI silence' ); } /** * Silence comment for JSON request * * @since 2.9.3 */ if ( REST::cls()->is_rest() || Router::is_ajax() ) { $running_info_showing = false; Debug2::debug( '[Core] Silence Comment due to REST/AJAX' ); } $running_info_showing = apply_filters( 'litespeed_comment', $running_info_showing ); if ( $running_info_showing && $this->footer_comment ) { $buffer .= $this->footer_comment; } /** * If ESI request is JSON, give the content JSON format * * @since 2.9.3 * @since 2.9.4 ESI request could be from internal REST call, so moved json_encode out of this condition */ if ( defined( 'LSCACHE_IS_ESI' ) ) { Debug2::debug( '[Core] ESI Start 👇' ); if ( strlen( $buffer ) > 500 ) { Debug2::debug( trim( substr( $buffer, 0, 500 ) ) . '.....' ); } else { Debug2::debug( $buffer ); } Debug2::debug( '[Core] ESI End 👆' ); } if ( apply_filters( 'litespeed_is_json', false ) ) { if ( null === \json_decode( $buffer, true ) ) { Debug2::debug( '[Core] Buffer converting to JSON' ); $buffer = wp_json_encode( $buffer ); $buffer = trim( $buffer, '"' ); } else { Debug2::debug( '[Core] JSON Buffer' ); } } // Hook to modify buffer after $buffer = apply_filters( 'litespeed_buffer_after', $buffer ); Debug2::ended(); return $buffer; } /** * Sends the headers out at the end of processing the request. * * This will send out all LiteSpeed Cache related response headers needed for the post. * * @since 1.0.5 * @param bool $is_forced If the header is sent following our normal finalizing logic. */ public function send_headers( $is_forced = false ) { // Make sure header output only runs once if ( defined( 'LITESPEED_DID_' . __FUNCTION__ ) ) { return; } define( 'LITESPEED_DID_' . __FUNCTION__, true ); // Avoid PHP warning for headers sent out already if ( headers_sent() ) { self::debug( '❌ !!! Err: Header sent out already' ); return; } $this->check_is_html(); // Cache control output needs to be done first, as some varies are added in 3rd party hook `litespeed_api_control`. $this->cls( 'Control' )->finalize(); $vary_header = $this->cls( 'Vary' )->finalize(); // If not cacheable but Admin QS is `purge` or `purgesingle`, `tag` still needs to be generated $tag_header = $this->cls( 'Tag' )->output(); if ( ! $tag_header && Control::is_cacheable() ) { Control::set_nocache( 'empty tag header' ); } // `Purge` output needs to be after `tag` output as Admin QS may need to send `tag` header $purge_header = Purge::output(); // Generate `control` header in the end in case control status is changed by other headers $control_header = $this->cls( 'Control' )->output(); // Give one more break to avoid Firefox crash if ( ! defined( 'LSCACHE_IS_ESI' ) ) { $this->footer_comment .= "\n"; } $cache_support = 'supported'; if ( defined( 'LITESPEED_ON' ) ) { $cache_support = Control::is_cacheable() ? 'cached' : 'uncached'; } $this->comment( sprintf( '%1$s %2$s by LiteSpeed Cache %4$s on %3$s', defined( 'LSCACHE_IS_ESI' ) ? 'Block' : 'Page', $cache_support, gmdate( 'Y-m-d H:i:s', time() + LITESPEED_TIME_OFFSET ), self::VER ) ); // Send Control header if ( defined( 'LITESPEED_ON' ) && $control_header ) { $this->http_header( $control_header ); if ( ! Control::is_cacheable() && !is_admin() ) { $ori_wp_header = wp_get_nocache_headers(); if ( isset( $ori_wp_header['Cache-Control'] ) ) { $this->http_header( 'Cache-Control: ' . $ori_wp_header['Cache-Control'] ); // @ref: https://github.com/litespeedtech/lscache_wp/issues/889 } } if ( defined( 'LSCWP_LOG' ) ) { $this->comment( $control_header ); } } // Send PURGE header (Always send regardless of cache setting disabled/enabled) if ( defined( 'LITESPEED_ON' ) && $purge_header ) { $this->http_header( $purge_header ); Debug2::log_purge( $purge_header ); if ( defined( 'LSCWP_LOG' ) ) { $this->comment( $purge_header ); } } // Send Vary header if ( defined( 'LITESPEED_ON' ) && $vary_header ) { $this->http_header( $vary_header ); if ( defined( 'LSCWP_LOG' ) ) { $this->comment( $vary_header ); } } if ( defined( 'LITESPEED_ON' ) && defined( 'LSCWP_LOG' ) ) { $vary = $this->cls( 'Vary' )->finalize_full_varies(); if ( $vary ) { $this->comment( 'Full varies: ' . $vary ); } } // Admin QS show header action if ( self::$debug_show_header ) { $debug_header = self::HEADER_DEBUG . ': '; if ( $control_header ) { $debug_header .= $control_header . '; '; } if ( $purge_header ) { $debug_header .= $purge_header . '; '; } if ( $tag_header ) { $debug_header .= $tag_header . '; '; } if ( $vary_header ) { $debug_header .= $vary_header . '; '; } $this->http_header( $debug_header ); } elseif ( defined( 'LITESPEED_ON' ) && Control::is_cacheable() && $tag_header ) { $this->http_header( $tag_header ); if ( defined( 'LSCWP_LOG' ) ) { $this->comment( $tag_header ); } } // Object cache comment if ( defined( 'LSCWP_LOG' ) && defined( 'LSCWP_OBJECT_CACHE' ) && method_exists( 'WP_Object_Cache', 'debug' ) ) { $this->comment( 'Object Cache ' . \WP_Object_Cache::get_instance()->debug() ); } if ( defined( 'LITESPEED_GUEST' ) && LITESPEED_GUEST ) { $this->comment( 'Guest Mode' ); } if ( ! empty( $this->footer_comment ) ) { self::debug( "[footer comment]\n" . trim( $this->footer_comment ) ); } if ( $is_forced ) { Debug2::debug( '--forced--' ); } // If CLI and contains Purge Header, issue an HTTP request to Purge if ( defined( 'LITESPEED_CLI' ) ) { $purge_queue = Purge::get_option( Purge::DB_QUEUE ); if ( ! $purge_queue || '-1' === $purge_queue ) { $purge_queue = Purge::get_option( Purge::DB_QUEUE2 ); } if ( $purge_queue && '-1' !== $purge_queue ) { self::debug( '[Core] Purge Queue found, issue an HTTP request to purge: ' . $purge_queue ); // Kick off HTTP request $url = admin_url( 'admin-ajax.php' ); $resp = wp_safe_remote_get( $url ); if ( is_wp_error( $resp ) ) { $error_message = $resp->get_error_message(); self::debug( '[URL]' . $url ); self::debug( 'failed to request: ' . $error_message ); } else { self::debug( 'HTTP request response: ' . $resp['body'] ); } } } } /** * Append one HTML comment * * @since 5.5 * @param string $data The comment data. */ public static function comment( $data ) { self::cls()->append_comment( $data ); } /** * Append one HTML comment * * @since 5.5 * @param string $data The comment data. */ private function append_comment( $data ) { $this->footer_comment .= "\n<!-- " . htmlspecialchars( $data ) . ' -->'; } /** * Send HTTP header * * @since 5.3 * @param string $header The header to send. */ private function http_header( $header ) { if ( defined( 'LITESPEED_CLI' ) ) { return; } if ( ! headers_sent() ) { header( $header ); } if ( ! defined( 'LSCWP_LOG' ) ) { return; } Debug2::debug( '💰 ' . $header ); } } src/object.lib.php 0000777 00000032475 15251157102 0010100 0 ustar 00 <?php /** * LiteSpeed Object Cache Library * * @since 1.8 * @package LiteSpeed */ defined( 'WPINC' ) || exit(); if (!function_exists('litespeed_exception_handler')) { /** * Handle exception * * Converts PHP errors into exceptions for better error handling. * * @since 1.8 * @access public * @param int $errno Error level. * @param string $errstr Error message. * @param string $errfile File where the error occurred. * @param int $errline Line number where the error occurred. * @throws \ErrorException Error msg. */ function litespeed_exception_handler( $errno, $errstr, $errfile, $errline ) { throw new \ErrorException( esc_html( $errstr ), 0, esc_html( $errno ), esc_html( $errfile ), esc_html( $errline ) ); } } require_once __DIR__ . '/object-cache.cls.php'; require_once __DIR__ . '/object-cache-wp.cls.php'; /** * Sets up Object Cache Global and assigns it. * * Initializes the global object cache instance. * * @since 1.8 * @access public * @global WP_Object_Cache $wp_object_cache Object cache global instance. */ function wp_cache_init() { // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited $GLOBALS['wp_object_cache'] = WP_Object_Cache::get_instance(); } /** * Adds data to the cache, if the cache key doesn't already exist. * * @since 1.8 * @access public * @see WP_Object_Cache::add() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param int|string $key The cache key to use for retrieval later. * @param mixed $data The data to add to the cache. * @param string $group Optional. The group to add the cache to. Enables the same key * to be used across groups. Default empty. * @param int $expire Optional. When the cache data should expire, in seconds. * Default 0 (no expiration). * @return bool True on success, false if cache key and group already exist. */ function wp_cache_add( $key, $data, $group = '', $expire = 0 ) { global $wp_object_cache; return $wp_object_cache->add( $key, $data, $group, (int) $expire ); } /** * Adds multiple values to the cache in one call. * * @since 5.4 * @access public * @see WP_Object_Cache::add_multiple() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param array $data Array of keys and values to be set. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool[] Array of return values, grouped by key. Each value is either * true on success, or false if cache key and group already exist. */ function wp_cache_add_multiple( array $data, $group = '', $expire = 0 ) { global $wp_object_cache; return $wp_object_cache->add_multiple( $data, $group, $expire ); } /** * Replaces the contents of the cache with new data. * * @since 1.8 * @access public * @see WP_Object_Cache::replace() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param int|string $key The key for the cache data that should be replaced. * @param mixed $data The new data to store in the cache. * @param string $group Optional. The group for the cache data that should be replaced. * Default empty. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool True if contents were replaced, false if original value does not exist. */ function wp_cache_replace( $key, $data, $group = '', $expire = 0 ) { global $wp_object_cache; return $wp_object_cache->replace( $key, $data, $group, (int) $expire ); } /** * Saves the data to the cache. * * Differs from wp_cache_add() and wp_cache_replace() in that it will always write data. * * @since 1.8 * @access public * @see WP_Object_Cache::set() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param int|string $key The cache key to use for retrieval later. * @param mixed $data The contents to store in the cache. * @param string $group Optional. Where to group the cache contents. Enables the same key * to be used across groups. Default empty. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool True on success, false on failure. */ function wp_cache_set( $key, $data, $group = '', $expire = 0 ) { global $wp_object_cache; return $wp_object_cache->set( $key, $data, $group, (int) $expire ); } /** * Sets multiple values to the cache in one call. * * @since 5.4 * @access public * @see WP_Object_Cache::set_multiple() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param array $data Array of keys and values to be set. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool[] Array of return values, grouped by key. Each value is either * true on success, or false on failure. */ function wp_cache_set_multiple( array $data, $group = '', $expire = 0 ) { global $wp_object_cache; return $wp_object_cache->set_multiple( $data, $group, $expire ); } /** * Retrieves the cache contents from the cache by key and group. * * @since 1.8 * @access public * @see WP_Object_Cache::get() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param int|string $key The key under which the cache contents are stored. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @param bool $force Optional. Whether to force an update of the local cache * from the persistent cache. Default false. * @param bool $found Optional. Whether the key was found in the cache (passed by reference). * Disambiguates a return of false, a storable value. Default null. * @return mixed|false The cache contents on success, false on failure to retrieve contents. */ function wp_cache_get( $key, $group = '', $force = false, &$found = null ) { global $wp_object_cache; return $wp_object_cache->get( $key, $group, $force, $found ); } /** * Retrieves multiple values from the cache in one call. * * @since 5.4 * @access public * @see WP_Object_Cache::get_multiple() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param array $keys Array of keys under which the cache contents are stored. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @param bool $force Optional. Whether to force an update of the local cache * from the persistent cache. Default false. * @return array Array of return values, grouped by key. Each value is either * the cache contents on success, or false on failure. */ function wp_cache_get_multiple( $keys, $group = '', $force = false ) { global $wp_object_cache; return $wp_object_cache->get_multiple( $keys, $group, $force ); } /** * Removes the cache contents matching key and group. * * @since 1.8 * @access public * @see WP_Object_Cache::delete() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param int|string $key What the contents in the cache are called. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @return bool True on successful removal, false on failure. */ function wp_cache_delete( $key, $group = '' ) { global $wp_object_cache; return $wp_object_cache->delete( $key, $group ); } /** * Deletes multiple values from the cache in one call. * * @since 5.4 * @access public * @see WP_Object_Cache::delete_multiple() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param array $keys Array of keys under which the cache to deleted. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @return bool[] Array of return values, grouped by key. Each value is either * true on success, or false if the contents were not deleted. */ function wp_cache_delete_multiple( array $keys, $group = '' ) { global $wp_object_cache; return $wp_object_cache->delete_multiple( $keys, $group ); } /** * Increments numeric cache item's value. * * @since 1.8 * @access public * @see WP_Object_Cache::incr() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param int|string $key The key for the cache contents that should be incremented. * @param int $offset Optional. The amount by which to increment the item's value. * Default 1. * @param string $group Optional. The group the key is in. Default empty. * @return int|false The item's new value on success, false on failure. */ function wp_cache_incr( $key, $offset = 1, $group = '' ) { global $wp_object_cache; return $wp_object_cache->incr( $key, $offset, $group ); } /** * Decrements numeric cache item's value. * * @since 1.8 * @access public * @see WP_Object_Cache::decr() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param int|string $key The cache key to decrement. * @param int $offset Optional. The amount by which to decrement the item's value. * Default 1. * @param string $group Optional. The group the key is in. Default empty. * @return int|false The item's new value on success, false on failure. */ function wp_cache_decr( $key, $offset = 1, $group = '' ) { global $wp_object_cache; return $wp_object_cache->decr( $key, $offset, $group ); } /** * Removes all cache items. * * @since 1.8 * @access public * @see WP_Object_Cache::flush() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @return bool True on success, false on failure. */ function wp_cache_flush() { global $wp_object_cache; return $wp_object_cache->flush(); } /** * Removes all cache items from the in-memory runtime cache. * * @since 5.4 * @access public * @see WP_Object_Cache::flush_runtime() * * @return bool True on success, false on failure. */ function wp_cache_flush_runtime() { global $wp_object_cache; return $wp_object_cache->flush_runtime(); } /** * Removes all cache items in a group, if the object cache implementation supports it. * * Before calling this function, always check for group flushing support using the * `wp_cache_supports( 'flush_group' )` function. * * @since 5.4 * @access public * @see WP_Object_Cache::flush_group() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param string $group Name of group to remove from cache. * @return bool True if group was flushed, false otherwise. */ function wp_cache_flush_group( $group ) { global $wp_object_cache; return $wp_object_cache->flush_group( $group ); } /** * Determines whether the object cache implementation supports a particular feature. * * @since 5.4 * @access public * * @param string $feature Name of the feature to check for. Possible values include: * 'add_multiple', 'set_multiple', 'get_multiple', 'delete_multiple', * 'flush_runtime', 'flush_group'. * @return bool True if the feature is supported, false otherwise. */ function wp_cache_supports( $feature ) { switch ( $feature ) { case 'add_multiple': case 'set_multiple': case 'get_multiple': case 'delete_multiple': case 'flush_runtime': return true; case 'flush_group': default: return false; } } /** * Closes the cache. * * This function has ceased to do anything since WordPress 2.5. The * functionality was removed along with the rest of the persistent cache. * * This does not mean that plugins can't implement this function when they need * to make sure that the cache is cleaned up after WordPress no longer needs it. * * @since 1.8 * @access public * * @return true Always returns true. */ function wp_cache_close() { return true; } /** * Adds a group or set of groups to the list of global groups. * * @since 1.8 * @access public * @see WP_Object_Cache::add_global_groups() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param string|string[] $groups A group or an array of groups to add. */ function wp_cache_add_global_groups( $groups ) { global $wp_object_cache; $wp_object_cache->add_global_groups( $groups ); } /** * Adds a group or set of groups to the list of non-persistent groups. * * @since 1.8 * @access public * * @param string|string[] $groups A group or an array of groups to add. */ function wp_cache_add_non_persistent_groups( $groups ) { global $wp_object_cache; $wp_object_cache->add_non_persistent_groups( $groups ); } /** * Switches the internal blog ID. * * This changes the blog id used to create keys in blog specific groups. * * @since 1.8 * @access public * @see WP_Object_Cache::switch_to_blog() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param int $blog_id Site ID. */ function wp_cache_switch_to_blog( $blog_id ) { global $wp_object_cache; $wp_object_cache->switch_to_blog( $blog_id ); } src/guest.cls.php 0000777 00000005405 15251157102 0007765 0 ustar 00 <?php /** * Guest mode management class. * * Handles syncing of Guest Mode IP and UA lists from QUIC.cloud. * * @package LiteSpeed * @since 7.7 */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Guest * * Extends Cloud class to provide Guest Mode related functionality. */ class Guest extends Cloud { const LOG_TAG = '👤'; const TYPE_SYNC = 'sync'; /** * Cron handler for daily Guest Mode sync. * * @since 7.7 * @return void */ public static function cron() { self::debug( 'Cron: starting daily sync' ); self::cls()->sync_lists(); } /** * Sync Guest Mode IP and UA lists. * * Fetches the latest IP and UA lists from QUIC.cloud API and saves them locally. * * @since 7.7 * @return array{success: bool, message: string} */ public function sync_lists() { self::debug( 'Starting Guest Mode lists sync' ); $cloud_dir = LITESPEED_STATIC_DIR . '/cloud'; $results = [ 'ips' => false, 'uas' => false, ]; foreach ( [ 'ips', 'uas' ] as $type ) { $data = $this->_fetch_api( $this->_cloud_server_wp . '/gm_' . $type ); if ( $data && File::save( $cloud_dir . '/gm_' . $type . '.txt', $data, true ) ) { self::debug( 'Guest Mode ' . $type . ' synced' ); $results[ $type ] = true; } } $success = $results['ips'] && $results['uas']; $message = $success ? __( 'Guest Mode lists synced successfully.', 'litespeed-cache' ) : __( 'Failed to sync Guest Mode lists.', 'litespeed-cache' ); return [ 'success' => $success, 'message' => $message, ]; } /** * Fetch data from API. * * @since 7.7 * @param string $url API URL. * @return string|false Data on success, false on failure. */ private function _fetch_api( $url ) { self::debug( 'Fetching: ' . $url ); $response = wp_remote_get( $url, [ 'timeout' => 15, ] ); if ( is_wp_error( $response ) ) { self::debug( 'Fetch error: ' . $response->get_error_message() ); return false; } $code = wp_remote_retrieve_response_code( $response ); if ( 200 !== $code ) { self::debug( 'Fetch failed with code: ' . $code ); return false; } $body = wp_remote_retrieve_body( $response ); if ( empty( $body ) ) { self::debug( 'Empty response body' ); return false; } return $body; } /** * Handle all request actions from main class. * * @since 7.7 * @return void */ public function handler() { $type = Router::verify_type(); switch ( $type ) { case self::TYPE_SYNC: $result = $this->sync_lists(); if ( Router::is_ajax() ) { wp_send_json( $result ); } if ( $result['success'] ) { Admin_Display::success( $result['message'] ); } else { Admin_Display::error( $result['message'] ); } break; default: break; } Admin::redirect(); } } src/router.cls.php 0000777 00000051247 15251157102 0010163 0 ustar 00 <?php // phpcs:ignoreFile /** * The core plugin router class. * * This generate the valid action. * * @since 1.1.0 */ namespace LiteSpeed; defined('WPINC') || exit(); class Router extends Base { const LOG_TAG = '[Router]'; const NONCE = 'LSCWP_NONCE'; const ACTION = 'LSCWP_CTRL'; const ACTION_SAVE_SETTINGS_NETWORK = 'save-settings-network'; const ACTION_DB_OPTM = 'db_optm'; const ACTION_PLACEHOLDER = 'placeholder'; const ACTION_AVATAR = 'avatar'; const ACTION_SAVE_SETTINGS = 'save-settings'; const ACTION_CLOUD = 'cloud'; const ACTION_IMG_OPTM = 'img_optm'; const ACTION_HEALTH = 'health'; const ACTION_CRAWLER = 'crawler'; const ACTION_PURGE = 'purge'; const ACTION_CONF = 'conf'; const ACTION_ACTIVATION = 'activation'; const ACTION_CSS = 'css'; const ACTION_UCSS = 'ucss'; const ACTION_VPI = 'vpi'; const ACTION_PRESET = 'preset'; const ACTION_IMPORT = 'import'; const ACTION_REPORT = 'report'; const ACTION_DEBUG2 = 'debug2'; const ACTION_CDN_CLOUDFLARE = 'CDN\Cloudflare'; const ACTION_ADMIN_DISPLAY = 'admin_display'; const ACTION_GUEST = 'guest'; const ACTION_TMP_DISABLE = 'tmp_disable'; // List all handlers here private static $_HANDLERS = array( self::ACTION_ADMIN_DISPLAY, self::ACTION_ACTIVATION, self::ACTION_AVATAR, self::ACTION_CDN_CLOUDFLARE, self::ACTION_CLOUD, self::ACTION_CONF, self::ACTION_CRAWLER, self::ACTION_CSS, self::ACTION_UCSS, self::ACTION_VPI, self::ACTION_DB_OPTM, self::ACTION_DEBUG2, self::ACTION_GUEST, self::ACTION_HEALTH, self::ACTION_IMG_OPTM, self::ACTION_PRESET, self::ACTION_IMPORT, self::ACTION_PLACEHOLDER, self::ACTION_PURGE, self::ACTION_REPORT, ); const TYPE = 'litespeed_type'; const ITEM_HASH = 'hash'; const ITEM_FLASH_HASH = 'flash_hash'; private static $_esi_enabled; private static $_is_ajax; private static $_is_logged_in; private static $_ip; private static $_action; private static $_is_admin_ip; private static $_frontend_path; /** * Redirect to self to continue operation * * Note: must return when use this func. CLI/Cron call won't die in this func. * * @since 3.0 * @access public */ public static function self_redirect( $action, $type ) { if (defined('LITESPEED_CLI') || wp_doing_cron()) { Admin_Display::success('To be continued'); // Show for CLI return; } // Add i to avoid browser too many redirected warning $i = !empty($_GET['litespeed_i']) ? $_GET['litespeed_i'] : 0; ++$i; $link = Utility::build_url($action, $type, false, null, array( 'litespeed_i' => $i )); $url = html_entity_decode($link); exit("<meta http-equiv='refresh' content='0;url=$url'>"); } /** * Check if can run optimize * * @since 1.3 * @since 2.3.1 Relocated from cdn.cls * @access public */ public function can_optm() { $can = true; if (is_user_logged_in() && $this->conf(self::O_OPTM_GUEST_ONLY)) { $can = false; } elseif (is_admin()) { $can = false; } elseif (is_feed()) { $can = false; } elseif (is_preview()) { $can = false; } elseif (self::is_ajax()) { $can = false; } if (self::_is_login_page()) { Debug2::debug('[Router] Optm bypassed: login/reg page'); $can = false; } $can_final = apply_filters('litespeed_can_optm', $can); if ($can_final != $can) { Debug2::debug('[Router] Optm bypassed: filter'); } return $can_final; } /** * Check referer page to see if its from admin * * @since 2.4.2.1 * @access public */ public static function from_admin() { return !empty($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], get_admin_url()) === 0; } /** * Check if it can use CDN replacement * * @since 1.2.3 * @since 2.3.1 Relocated from cdn.cls * @access public */ public static function can_cdn() { $can = true; if (is_admin()) { if (!self::is_ajax()) { Debug2::debug2('[Router] CDN bypassed: is not ajax call'); $can = false; } if (self::from_admin()) { Debug2::debug2('[Router] CDN bypassed: ajax call from admin'); $can = false; } } elseif (is_feed()) { $can = false; } elseif (is_preview()) { $can = false; } /** * Bypass cron to avoid deregister jq notice `Do not deregister the <code>jquery-core</code> script in the administration area.` * * @since 2.7.2 */ if (wp_doing_cron()) { $can = false; } /** * Bypass login/reg page * * @since 1.6 */ if (self::_is_login_page()) { Debug2::debug('[Router] CDN bypassed: login/reg page'); $can = false; } /** * Bypass post/page link setting * * @since 2.9.8.5 */ $rest_prefix = function_exists('rest_get_url_prefix') ? rest_get_url_prefix() : apply_filters('rest_url_prefix', 'wp-json'); if ( !empty($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'], $rest_prefix . '/wp/v2/media') !== false && isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'wp-admin') !== false ) { Debug2::debug('[Router] CDN bypassed: wp-json on admin page'); $can = false; } $can_final = apply_filters('litespeed_can_cdn', $can); if ($can_final != $can) { Debug2::debug('[Router] CDN bypassed: filter'); } return $can_final; } /** * Check if is login page or not * * @since 2.3.1 * @access protected */ protected static function _is_login_page() { if (in_array($GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ), true)) { return true; } return false; } /** * UCSS/Crawler role simulator * * @since 1.9.1 * @since 3.3 Renamed from `is_crawler_role_simulation` */ public function is_role_simulation() { if (is_admin()) { return; } if (empty($_COOKIE['litespeed_hash']) && empty($_COOKIE['litespeed_flash_hash'])) { return; } self::debug('🪪 starting role validation'); // Check if is from crawler // if ( empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) || strpos( $_SERVER[ 'HTTP_USER_AGENT' ], Crawler::FAST_USER_AGENT ) !== 0 ) { // Debug2::debug( '[Router] user agent not match' ); // return; // } $server_ip = $this->conf(self::O_SERVER_IP); if (!$server_ip || self::get_ip() !== $server_ip) { self::debug('❌❌ Role simulate uid denied! Not localhost visit!'); Control::set_nocache('Role simulate uid denied'); return; } // Flash hash validation if (!empty($_COOKIE['litespeed_flash_hash'])) { $hash_data = self::get_option(self::ITEM_FLASH_HASH, array()); if ($hash_data && is_array($hash_data) && !empty($hash_data['hash']) && !empty($hash_data['ts']) && !empty($hash_data['uid'])) { if (time() - $hash_data['ts'] < 120 && $_COOKIE['litespeed_flash_hash'] == $hash_data['hash']) { self::debug('🪪 Role simulator flash hash matched, escalating user to be uid=' . $hash_data['uid']); self::delete_option(self::ITEM_FLASH_HASH); wp_set_current_user($hash_data['uid']); return; } } } // Hash validation if (!empty($_COOKIE['litespeed_hash'])) { $hash_data = self::get_option(self::ITEM_HASH, array()); if ($hash_data && is_array($hash_data) && !empty($hash_data['hash']) && !empty($hash_data['ts']) && !empty($hash_data['uid'])) { $RUN_DURATION = $this->cls('Crawler')->get_crawler_duration(); if (time() - $hash_data['ts'] < $RUN_DURATION && $_COOKIE['litespeed_hash'] == $hash_data['hash']) { self::debug('🪪 Role simulator hash matched, escalating user to be uid=' . $hash_data['uid']); wp_set_current_user($hash_data['uid']); return; } } } self::debug('❌ WARNING: role simulator hash not match'); } /** * Get a short ttl hash (2mins) * * @since 6.4 */ public function get_flash_hash( $uid ) { $hash_data = self::get_option(self::ITEM_FLASH_HASH, array()); if ($hash_data && is_array($hash_data) && !empty($hash_data['hash']) && !empty($hash_data['ts'])) { if (time() - $hash_data['ts'] < 60) { return $hash_data['hash']; } } // Check if this user has editor access or not if (user_can($uid, 'edit_posts')) { self::debug('🛑 The user with id ' . $uid . ' has editor access, which is not allowed for the role simulator.'); return ''; } $hash = Str::rrand(32); self::update_option(self::ITEM_FLASH_HASH, array( 'hash' => $hash, 'ts' => time(), 'uid' => $uid, )); return $hash; } /** * Get a security hash * * @since 3.3 */ public function get_hash( $uid ) { // Check if this user has editor access or not if (user_can($uid, 'edit_posts')) { self::debug('🛑 The user with id ' . $uid . ' has editor access, which is not allowed for the role simulator.'); return ''; } // As this is called only when starting crawling, not per page, no need to reuse $hash = Str::rrand(32); self::update_option(self::ITEM_HASH, array( 'hash' => $hash, 'ts' => time(), 'uid' => $uid, )); return $hash; } /** * Get user role * * @since 1.6.2 */ public static function get_role( $uid = null ) { if (defined('LITESPEED_WP_ROLE')) { return LITESPEED_WP_ROLE; } if ($uid === null) { $uid = get_current_user_id(); } $role = false; if ($uid) { $user = get_userdata($uid); if (isset($user->roles) && is_array($user->roles)) { $tmp = array_values($user->roles); $role = implode(',', $tmp); // Combine for PHP5.3 const compatibility } } Debug2::debug('[Router] get_role: ' . $role); if (!$role) { return $role; // Guest user Debug2::debug('[Router] role: guest'); /** * Fix double login issue * The previous user init refactoring didn't fix this bcos this is in login process and the user role could change * * @see https://github.com/litespeedtech/lscache_wp/commit/69e7bc71d0de5cd58961bae953380b581abdc088 * @since 2.9.8 Won't assign const if in login process */ if (substr_compare(wp_login_url(), $GLOBALS['pagenow'], -strlen($GLOBALS['pagenow'])) === 0) { return $role; } } define('LITESPEED_WP_ROLE', $role); return LITESPEED_WP_ROLE; } /** * Get frontend path * * @since 1.2.2 * @access public * @return boolean */ public static function frontend_path() { // todo: move to htaccess.cls ? if (!isset(self::$_frontend_path)) { $frontend = rtrim(ABSPATH, '/'); // /home/user/public_html/frontend // get home path failed. Trac ticket #37668 (e.g. frontend:/blog backend:/wordpress) if (!$frontend) { Debug2::debug('[Router] No ABSPATH, generating from home option'); $frontend = parse_url(get_option('home')); $frontend = !empty($frontend['path']) ? $frontend['path'] : ''; $frontend = $_SERVER['DOCUMENT_ROOT'] . $frontend; } $frontend = realpath($frontend); self::$_frontend_path = $frontend; } return self::$_frontend_path; } /** * Check if ESI is enabled or not * * @since 1.2.0 * @access public * @return boolean */ public function esi_enabled() { if (!isset(self::$_esi_enabled)) { self::$_esi_enabled = defined('LITESPEED_ON') && $this->conf(self::O_ESI); if (!empty($_REQUEST[self::ACTION])) { self::$_esi_enabled = false; } } return self::$_esi_enabled; } /** * Check if crawler is enabled on server level * * @since 1.1.1 * @access public */ public static function can_crawl() { if (isset($_SERVER['X-LSCACHE']) && strpos($_SERVER['X-LSCACHE'], 'crawler') === false) { return false; } // CLI will bypass this check as crawler library can always do the 428 check if (defined('LITESPEED_CLI')) { return true; } return true; } /** * Check action * * @since 1.1.0 * @access public * @return string */ public static function get_action() { if (!isset(self::$_action)) { self::$_action = false; self::cls()->verify_action(); if (self::$_action) { defined('LSCWP_LOG') && Debug2::debug('[Router] LSCWP_CTRL verified: ' . var_export(self::$_action, true)); } } return self::$_action; } /** * Check if is logged in * * @since 1.1.3 * @access public * @return boolean */ public static function is_logged_in() { if (!isset(self::$_is_logged_in)) { self::$_is_logged_in = is_user_logged_in(); } return self::$_is_logged_in; } /** * Check if is ajax call * * @since 1.1.0 * @access public * @return boolean */ public static function is_ajax() { if (!isset(self::$_is_ajax)) { self::$_is_ajax = wp_doing_ajax(); } return self::$_is_ajax; } /** * Check if is admin ip * * @since 1.1.0 * @access public * @return boolean */ public function is_admin_ip() { if (!isset(self::$_is_admin_ip)) { $ips = $this->conf(self::O_DEBUG_IPS); self::$_is_admin_ip = $this->ip_access($ips); } return self::$_is_admin_ip; } /** * Get type value * * @since 1.6 * @access public */ public static function verify_type() { if (empty($_REQUEST[self::TYPE])) { Debug2::debug('[Router] no type', 2); return false; } Debug2::debug('[Router] parsed type: ' . $_REQUEST[self::TYPE], 2); return $_REQUEST[self::TYPE]; } /** * Check privilege and nonce for the action * * @since 1.1.0 * @access private */ private function verify_action() { if (empty($_REQUEST[self::ACTION])) { Debug2::debug2('[Router] LSCWP_CTRL bypassed empty'); return; } $action = stripslashes($_REQUEST[self::ACTION]); if (!$action) { return; } $_is_public_action = false; // Each action must have a valid nonce unless its from admin ip and is public action // Validate requests nonce (from admin logged in page or cli) if (!$this->verify_nonce($action)) { // check if it is from admin ip if (!$this->is_admin_ip()) { Debug2::debug('[Router] LSCWP_CTRL query string - did not match admin IP: ' . $action); return; } // check if it is public action if ( !in_array($action, array( Core::ACTION_QS_NOCACHE, Core::ACTION_QS_PURGE, Core::ACTION_QS_PURGE_SINGLE, Core::ACTION_QS_SHOW_HEADERS, Core::ACTION_QS_PURGE_ALL, Core::ACTION_QS_PURGE_EMPTYCACHE, )) ) { Debug2::debug('[Router] LSCWP_CTRL query string - did not match admin IP Actions: ' . $action); return; } if (apply_filters('litespeed_qs_forbidden', false)) { Debug2::debug('[Router] LSCWP_CTRL forbidden by hook litespeed_qs_forbidden'); return; } $_is_public_action = true; } /* Now it is a valid action, lets log and check the permission */ Debug2::debug('[Router] LSCWP_CTRL: ' . $action); // OK, as we want to do something magic, lets check if its allowed $_is_multisite = is_multisite(); $_is_network_admin = $_is_multisite && is_network_admin(); $_can_network_option = $_is_network_admin && current_user_can('manage_network_options'); $_can_option = current_user_can('manage_options'); switch ($action) { case self::ACTION_TMP_DISABLE: // Disable LSC for 24H Debug2::tmp_disable(); Admin::redirect("?page=litespeed-toolbox#settings-debug"); return; case self::ACTION_SAVE_SETTINGS_NETWORK: // Save network settings if ($_can_network_option) { self::$_action = $action; } return; case Core::ACTION_PURGE_BY: if (defined('LITESPEED_ON') && ($_can_network_option || $_can_option || self::is_ajax())) { // here may need more security self::$_action = $action; } return; case self::ACTION_DB_OPTM: if ($_can_network_option || $_can_option) { self::$_action = $action; } return; case Core::ACTION_PURGE_EMPTYCACHE: // todo: moved to purge.cls type action if ((defined('LITESPEED_ON') || $_is_network_admin) && ($_can_network_option || (!$_is_multisite && $_can_option))) { self::$_action = $action; } return; case Core::ACTION_QS_NOCACHE: case Core::ACTION_QS_PURGE: case Core::ACTION_QS_PURGE_SINGLE: case Core::ACTION_QS_SHOW_HEADERS: case Core::ACTION_QS_PURGE_ALL: case Core::ACTION_QS_PURGE_EMPTYCACHE: if (defined('LITESPEED_ON') && ($_is_public_action || self::is_ajax())) { self::$_action = $action; } return; case self::ACTION_ADMIN_DISPLAY: case self::ACTION_PLACEHOLDER: case self::ACTION_AVATAR: case self::ACTION_IMG_OPTM: case self::ACTION_CLOUD: case self::ACTION_CDN_CLOUDFLARE: case self::ACTION_CRAWLER: case self::ACTION_GUEST: case self::ACTION_PRESET: case self::ACTION_IMPORT: case self::ACTION_REPORT: case self::ACTION_CSS: case self::ACTION_UCSS: case self::ACTION_VPI: case self::ACTION_CONF: case self::ACTION_ACTIVATION: case self::ACTION_HEALTH: case self::ACTION_SAVE_SETTINGS: // Save settings if ($_can_option && !$_is_network_admin) { self::$_action = $action; } return; case self::ACTION_PURGE: case self::ACTION_DEBUG2: if ($_can_network_option || $_can_option) { self::$_action = $action; } return; case Core::ACTION_DISMISS: /** * Non ajax call can dismiss too * * @since 2.9 */ // if ( self::is_ajax() ) { self::$_action = $action; // } return; default: Debug2::debug('[Router] LSCWP_CTRL match failed: ' . $action); return; } } /** * Verify nonce * * @since 1.1.0 * @access public * @param string $action * @return bool */ public function verify_nonce( $action ) { if (!isset($_REQUEST[self::NONCE]) || !wp_verify_nonce($_REQUEST[self::NONCE], $action)) { return false; } else { return true; } } /** * Check if the ip is in the range * * @since 1.1.0 * @access public */ public function ip_access( $ip_list ) { if (!$ip_list) { return false; } if (!isset(self::$_ip)) { self::$_ip = self::get_ip(); } if (!self::$_ip) { return false; } // $uip = explode('.', $_ip); // if(empty($uip) || count($uip) != 4) Return false; // foreach($ip_list as $key => $ip) $ip_list[$key] = explode('.', trim($ip)); // foreach($ip_list as $key => $ip) { // if(count($ip) != 4) continue; // for($i = 0; $i <= 3; $i++) if($ip[$i] == '*') $ip_list[$key][$i] = $uip[$i]; // } return in_array(self::$_ip, $ip_list); } /** * Get client ip * * @since 1.1.0 * @since 1.6.5 changed to public * @access public * @return string */ public static function get_ip() { $_ip = ''; // if ( function_exists( 'apache_request_headers' ) ) { // $apache_headers = apache_request_headers(); // $_ip = ! empty( $apache_headers['True-Client-IP'] ) ? $apache_headers['True-Client-IP'] : false; // if ( ! $_ip ) { // $_ip = ! empty( $apache_headers['X-Forwarded-For'] ) ? $apache_headers['X-Forwarded-For'] : false; // $_ip = explode( ',', $_ip ); // $_ip = $_ip[ 0 ]; // } // } if (!$_ip) { $_ip = !empty($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : false; } return $_ip; } /** * Check if opcode cache is enabled * * @since 1.8.2 * @access public */ public static function opcache_enabled() { return function_exists('opcache_reset') && ini_get('opcache.enable'); } /** * Check if opcode cache is restricted and file that is requesting. * https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.restrict-api * * @since 7.3 * @access public */ public static function opcache_restricted($file) { $restrict_value = ini_get('opcache.restrict_api'); if ($restrict_value) { if ( !$file || false === strpos($restrict_value, $file) ) { return true; } } return false; } /** * Handle static files * * @since 3.0 */ public function serve_static() { if (!empty($_SERVER['SCRIPT_URI'])) { if (strpos($_SERVER['SCRIPT_URI'], LITESPEED_STATIC_URL . '/') !== 0) { return; } $path = substr($_SERVER['SCRIPT_URI'], strlen(LITESPEED_STATIC_URL . '/')); } elseif (!empty($_SERVER['REQUEST_URI'])) { $static_path = parse_url(LITESPEED_STATIC_URL, PHP_URL_PATH) . '/'; if (strpos($_SERVER['REQUEST_URI'], $static_path) !== 0) { return; } $path = substr(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), strlen($static_path)); } else { return; } $path = explode('/', $path, 2); if (empty($path[0]) || empty($path[1])) { return; } switch ($path[0]) { case 'avatar': $this->cls('Avatar')->serve_static($path[1]); break; case 'localres': $this->cls('Localization')->serve_static($path[1]); break; default: break; } } /** * Handle all request actions from main cls * * This is different than other handlers * * @since 3.0 * @access public */ public function handler( $cls ) { if (!in_array($cls, self::$_HANDLERS)) { return; } return $this->cls($cls)->handler(); } } src/localization.cls.php 0000777 00000006702 15251157102 0011327 0 ustar 00 <?php // phpcs:ignoreFile /** * The localization class. * * @since 3.3 */ namespace LiteSpeed; defined('WPINC') || exit(); class Localization extends Base { const LOG_TAG = '🛍️'; /** * Init optimizer * * @since 3.0 * @access protected */ public function init() { add_filter('litespeed_buffer_finalize', array( $this, 'finalize' ), 23); // After page optm } /** * Localize Resources * * @since 3.3 */ public function serve_static( $uri ) { $url = base64_decode($uri); if (!$this->conf(self::O_OPTM_LOCALIZE)) { // wp_redirect( $url ); exit('Not supported'); } if (substr($url, -3) !== '.js') { // wp_redirect( $url ); // exit( 'Not supported ' . $uri ); } $match = false; $domains = $this->conf(self::O_OPTM_LOCALIZE_DOMAINS); foreach ($domains as $v) { if (!$v || strpos($v, '#') === 0) { continue; } $type = 'js'; $domain = $v; // Try to parse space split value if (strpos($v, ' ')) { $v = explode(' ', $v); if (!empty($v[1])) { $type = strtolower($v[0]); $domain = $v[1]; } } if (strpos($domain, 'https://') !== 0) { continue; } if ($type != 'js') { continue; } // if ( strpos( $url, $domain ) !== 0 ) { if ($url != $domain) { continue; } $match = true; break; } if (!$match) { // wp_redirect( $url ); exit('Not supported2'); } header('Content-Type: application/javascript'); // Generate $this->_maybe_mk_cache_folder('localres'); $file = $this->_realpath($url); self::debug('localize [url] ' . $url); $response = wp_safe_remote_get($url, array( 'timeout' => 180, 'stream' => true, 'filename' => $file, )); // Parse response data if (is_wp_error($response)) { $error_message = $response->get_error_message(); file_exists($file) && unlink($file); self::debug('failed to get: ' . $error_message); wp_redirect($url); exit(); } $url = $this->_rewrite($url); wp_redirect($url); exit(); } /** * Get the final URL of local avatar * * @since 4.5 */ private function _rewrite( $url ) { return LITESPEED_STATIC_URL . '/localres/' . $this->_filepath($url); } /** * Generate realpath of the cache file * * @since 4.5 * @access private */ private function _realpath( $url ) { return LITESPEED_STATIC_DIR . '/localres/' . $this->_filepath($url); } /** * Get filepath * * @since 4.5 */ private function _filepath( $url ) { $filename = md5($url) . '.js'; if (is_multisite()) { $filename = get_current_blog_id() . '/' . $filename; } return $filename; } /** * Localize JS/Fonts * * @since 3.3 * @access public */ public function finalize( $content ) { if (is_admin()) { return $content; } if (!$this->conf(self::O_OPTM_LOCALIZE)) { return $content; } $domains = $this->conf(self::O_OPTM_LOCALIZE_DOMAINS); if (!$domains) { return $content; } foreach ($domains as $v) { if (!$v || strpos($v, '#') === 0) { continue; } $type = 'js'; $domain = $v; // Try to parse space split value if (strpos($v, ' ')) { $v = explode(' ', $v); if (!empty($v[1])) { $type = strtolower($v[0]); $domain = $v[1]; } } if (strpos($domain, 'https://') !== 0) { continue; } if ($type != 'js') { continue; } $content = str_replace($domain, LITESPEED_STATIC_URL . '/localres/' . base64_encode($domain), $content); } return $content; } } src/rest.cls.php 0000777 00000022125 15251157102 0007611 0 ustar 00 <?php /** * REST endpoints and helpers for LiteSpeed. * * @since 2.9.4 * @package LiteSpeed */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class REST * * Registers plugin REST endpoints and exposes helpers for REST detection. */ class REST extends Root { const LOG_TAG = '☎️'; /** * Whether current request is an internal REST call. * * @var bool */ private $_internal_rest_status = false; /** * Constructor. * * @since 2.9.4 */ public function __construct() { // Hook to internal REST call. add_filter( 'rest_request_before_callbacks', [ $this, 'set_internal_rest_on' ] ); add_filter( 'rest_request_after_callbacks', [ $this, 'set_internal_rest_off' ] ); add_action( 'rest_api_init', [ $this, 'rest_api_init' ] ); } /** * Register REST routes. * * @since 3.0 * @return void */ public function rest_api_init() { // Activate or deactivate a specific crawler callback register_rest_route( 'litespeed/v1', '/toggle_crawler_state', [ 'methods' => 'POST', 'callback' => [ $this, 'toggle_crawler_state' ], 'permission_callback' => function () { return current_user_can( 'manage_network_options' ) || current_user_can( 'manage_options' ); }, ] ); register_rest_route( 'litespeed/v1', '/tool/check_ip', [ 'methods' => 'GET', 'callback' => [ $this, 'check_ip' ], 'permission_callback' => function () { return current_user_can( 'manage_network_options' ) || current_user_can( 'manage_options' ); }, ] ); register_rest_route( 'litespeed/v1', '/guest/sync', [ 'methods' => 'GET', 'callback' => [ $this, 'guest_sync' ], 'permission_callback' => function () { return current_user_can( 'manage_network_options' ) || current_user_can( 'manage_options' ); }, ] ); // IP callback validate register_rest_route( 'litespeed/v3', '/ip_validate', [ 'methods' => 'POST', 'callback' => [ $this, 'ip_validate' ], 'permission_callback' => [ $this, 'is_from_cloud' ], ] ); // 1.2. WP REST Dryrun Callback register_rest_route( 'litespeed/v3', '/wp_rest_echo', [ 'methods' => 'POST', 'callback' => [ $this, 'wp_rest_echo' ], 'permission_callback' => [ $this, 'is_from_cloud' ], ] ); register_rest_route( 'litespeed/v3', '/ping', [ 'methods' => 'POST', 'callback' => [ $this, 'ping' ], 'permission_callback' => [ $this, 'is_from_cloud' ], ] ); // CDN setup callback notification register_rest_route( 'litespeed/v3', '/cdn_status', [ 'methods' => 'POST', 'callback' => [ $this, 'cdn_status' ], 'permission_callback' => [ $this, 'is_from_cloud' ], ] ); // Image optm notify_img // Need validation register_rest_route( 'litespeed/v1', '/notify_img', [ 'methods' => 'POST', 'callback' => [ $this, 'notify_img' ], 'permission_callback' => [ $this, 'is_from_cloud' ], ] ); register_rest_route( 'litespeed/v1', '/notify_ccss', [ 'methods' => 'POST', 'callback' => [ $this, 'notify_ccss' ], 'permission_callback' => [ $this, 'is_from_cloud' ], ] ); register_rest_route( 'litespeed/v1', '/notify_ucss', [ 'methods' => 'POST', 'callback' => [ $this, 'notify_ucss' ], 'permission_callback' => [ $this, 'is_from_cloud' ], ] ); register_rest_route( 'litespeed/v1', '/notify_vpi', [ 'methods' => 'POST', 'callback' => [ $this, 'notify_vpi' ], 'permission_callback' => [ $this, 'is_from_cloud' ], ] ); register_rest_route( 'litespeed/v3', '/err_domains', [ 'methods' => 'POST', 'callback' => [ $this, 'err_domains' ], 'permission_callback' => [ $this, 'is_from_cloud' ], ] ); // Image optm check_img // Need validation register_rest_route( 'litespeed/v1', '/check_img', [ 'methods' => 'POST', 'callback' => [ $this, 'check_img' ], 'permission_callback' => [ $this, 'is_from_cloud' ], ] ); } /** * Call to freeze or melt the crawler clicked * * @since 4.3 */ public function toggle_crawler_state() { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- REST API nonce verified by WordPress $crawler_id = isset( $_POST['crawler_id'] ) ? sanitize_text_field( wp_unslash( $_POST['crawler_id'] ) ) : ''; if ( '' !== $crawler_id ) { return $this->cls( 'Crawler' )->toggle_activeness( $crawler_id ) ? 1 : 0; } } /** * Check if the request is from cloud nodes. * * @since 4.2 * @since 4.4.7 Token/API key validation makes IP validation redundant. * @return bool */ public function is_from_cloud() { return $this->cls( 'Cloud' )->is_from_cloud(); } /** * Ping pong. * * @since 3.0.4 * @return mixed */ public function ping() { return $this->cls( 'Cloud' )->ping(); } /** * Launch IP check. * * @since 3.0 * @return mixed */ public function check_ip() { return Tool::cls()->check_ip(); } /** * Sync Guest Mode IP/UA lists. * * @since 7.7 * @return array */ public function guest_sync() { return Guest::cls()->sync_lists(); } /** * Validate IPs from cloud. * * @since 3.0 * @return mixed */ public function ip_validate() { return $this->cls( 'Cloud' )->ip_validate(); } /** * REST echo helper. * * @since 3.0 * @return mixed */ public function wp_rest_echo() { return $this->cls( 'Cloud' )->wp_rest_echo(); } /** * Endpoint to notify plugin of CDN status updates. * * @since 7.0 * @return mixed */ public function cdn_status() { return $this->cls( 'Cloud' )->update_cdn_status(); } /** * Image optimization notification. * * @since 3.0 * @return mixed */ public function notify_img() { return Img_Optm::cls()->notify_img(); } /** * Critical CSS notification. * * @since 7.1 * @return mixed */ public function notify_ccss() { self::debug( 'notify_ccss' ); return CSS::cls()->notify(); } /** * Unique CSS notification. * * @since 5.2 * @return mixed */ public function notify_ucss() { self::debug( 'notify_ucss' ); return UCSS::cls()->notify(); } /** * Viewport Images notification. * * @since 4.7 * @return mixed */ public function notify_vpi() { self::debug( 'notify_vpi' ); return VPI::cls()->notify(); } /** * Error domain report from cloud. * * @since 4.7 * @return mixed */ public function err_domains() { self::debug( 'err_domains' ); return $this->cls( 'Cloud' )->rest_err_domains(); } /** * Launch image check. * * @since 3.0 * @return mixed */ public function check_img() { return Img_Optm::cls()->check_img(); } /** * Return a standardized error payload. * * @since 5.7.0.1 * @param string|int $code Error code. * @return array */ public static function err( $code ) { return [ '_res' => 'err', '_msg' => $code, ]; } /** * Set internal REST tag to ON. * * @since 2.9.4 * @param mixed $not_used Passthrough value from the filter. * @return mixed */ public function set_internal_rest_on( $not_used = null ) { $this->_internal_rest_status = true; Debug2::debug2( '[REST] ✅ Internal REST ON [filter] rest_request_before_callbacks' ); return $not_used; } /** * Set internal REST tag to OFF. * * @since 2.9.4 * @param mixed $not_used Passthrough value from the filter. * @return mixed */ public function set_internal_rest_off( $not_used = null ) { $this->_internal_rest_status = false; Debug2::debug2( '[REST] ❎ Internal REST OFF [filter] rest_request_after_callbacks' ); return $not_used; } /** * Whether current request is an internal REST call. * * @since 2.9.4 * @return bool */ public function is_internal_rest() { return $this->_internal_rest_status; } /** * Check whether a URL or current page is a REST request. * * @since 2.9.3 * @since 2.9.4 Moved here from Utility, dropped static. * @param string|false $url URL to check; when false checks current request. * @return bool */ public function is_rest( $url = false ) { // For WP 4.4.0- compatibility. if ( ! function_exists( 'rest_get_url_prefix' ) ) { return ( defined( 'REST_REQUEST' ) && REST_REQUEST ); } $prefix = rest_get_url_prefix(); // Case #1: After WP_REST_Request initialization. if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { return true; } // Case #2: Support "plain" permalink settings. // phpcs:ignore WordPress.Security.NonceVerification.Recommended $route = isset( $_GET['rest_route'] ) ? sanitize_text_field( wp_unslash( $_GET['rest_route'] ) ) : ''; if ( $route && 0 === strpos( trim( $route, '\\/' ), $prefix, 0 ) ) { return true; } if ( !$url ) { return false; } // Case #3: URL path begins with wp-json/ (REST prefix) – safe for subfolder installs. $rest_url = wp_parse_url( site_url( $prefix ) ); $current_url = wp_parse_url( $url ); if ( false !== $current_url && ! empty( $current_url['path'] ) && false !== $rest_url && ! empty( $rest_url['path'] ) ) { return 0 === strpos( $current_url['path'], $rest_url['path'] ); } return false; } } src/css.cls.php 0000777 00000043306 15251157102 0007430 0 ustar 00 <?php /** * Optimize CSS handler. * * @package LiteSpeed * @since 2.3 */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Optimize CSS handler class. */ class CSS extends Base { const LOG_TAG = '[CSS]'; const TYPE_GEN_CCSS = 'gen_ccss'; const TYPE_CLEAR_Q_CCSS = 'clear_q_ccss'; /** * Summary cache. * * @var array */ protected $_summary; /** * Cached CCSS whitelist. * * @var array|null */ private $_ccss_whitelist; /** * Request queue. * * @var array */ private $_queue; /** * Init. * * @since 3.0 */ public function __construct() { $this->_summary = self::get_summary(); add_filter( 'litespeed_ccss_whitelist', [ $this->cls( 'Data' ), 'load_ccss_whitelist' ] ); } /** * HTML lazyload CSS. * * @since 4.0 * @return string */ public function prepare_html_lazy() { return '<style>' . implode( ',', $this->conf( self::O_OPTM_HTML_LAZY ) ) . '{content-visibility:auto;contain-intrinsic-size:1px 1000px;}</style>'; } /** * Output critical CSS. * * @since 1.3 * @access public * @return string|null */ public function prepare_ccss() { // Get critical css for current page // Note: need to consider mobile $rules = $this->_ccss(); if ( ! $rules ) { return null; } $error_tag = ''; if ( substr( $rules, 0, 2 ) === '/*' && substr( $rules, -2 ) === '*/' ) { Core::comment( 'QUIC.cloud CCSS bypassed due to generation error ❌' ); $error_tag = ' data-error="failed to generate"'; } // Append default critical css $rules .= $this->conf( self::O_OPTM_CCSS_CON ); return '<style id="litespeed-ccss"' . $error_tag . '>' . $rules . '</style>'; } /** * Generate CCSS url tag. * * @since 4.0 * @param string $request_url Current request URL. * @return string */ private function _gen_ccss_file_tag( $request_url ) { if ( is_404() ) { return '404'; } if ( $this->conf( self::O_OPTM_CCSS_PER_URL ) ) { return $request_url; } $sep_uri = $this->conf( self::O_OPTM_CCSS_SEP_URI ); $hit = false; if ( $sep_uri ) { $hit = Utility::str_hit_array( $request_url, $sep_uri ); } if ( $sep_uri && $hit ) { Debug2::debug( '[CCSS] Separate CCSS due to separate URI setting: ' . $hit ); return $request_url; } $pt = Utility::page_type(); $sep_pt = $this->conf( self::O_OPTM_CCSS_SEP_POSTTYPE ); if ( in_array( $pt, $sep_pt, true ) ) { Debug2::debug( '[CCSS] Separate CCSS due to posttype setting: ' . $pt ); return $request_url; } // Per posttype return $pt; } /** * The critical css content of the current page. * * @since 2.3 * @return string|null */ private function _ccss() { global $wp; // get current request url $permalink_structure = get_option( 'permalink_structure' ); if ( ! empty( $permalink_structure ) ) { $request_url = trailingslashit( home_url( $wp->request ) ); } else { $qs_add = $wp->query_string ? '?' . (string) $wp->query_string : '' ; $request_url = home_url( $wp->request ) . $qs_add; } $filepath_prefix = $this->_build_filepath_prefix( 'ccss' ); $url_tag = $this->_gen_ccss_file_tag( $request_url ); $vary = $this->cls( 'Vary' )->finalize_full_varies(); $filename = $this->cls( 'Data' )->load_url_file( $url_tag, $vary, 'ccss' ); if ( $filename ) { $static_file = LITESPEED_STATIC_DIR . $filepath_prefix . $filename . '.css'; if ( file_exists( $static_file ) ) { Debug2::debug2( '[CSS] existing ccss ' . $static_file ); Core::comment( 'QUIC.cloud CCSS loaded ✅ ' . $filepath_prefix . $filename . '.css' ); return File::read( $static_file ); } } $uid = get_current_user_id(); $ua = isset( $_SERVER['HTTP_USER_AGENT'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) : ''; // Store it to prepare for cron Core::comment( 'QUIC.cloud CCSS in queue' ); $this->_queue = $this->load_queue( 'ccss' ); if ( count( $this->_queue ) > 500 ) { self::debug( 'CCSS Queue is full - 500' ); return null; } $queue_k = ( strlen( $vary ) > 32 ? md5( $vary ) : $vary ) . ' ' . $url_tag; $this->_queue[ $queue_k ] = [ 'url' => apply_filters( 'litespeed_ccss_url', $request_url ), 'user_agent' => substr( $ua, 0, 200 ), 'is_mobile' => $this->_separate_mobile(), 'is_webp' => $this->cls( 'Media' )->webp_support() ? 1 : 0, 'uid' => $uid, 'vary' => $vary, 'url_tag' => $url_tag, ]; // Current UA will be used to request $this->save_queue( 'ccss', $this->_queue ); self::debug( 'Added queue_ccss [url_tag] ' . $url_tag . ' [UA] ' . $ua . ' [vary] ' . $vary . ' [uid] ' . $uid ); // Prepare cache tag for later purge Tag::add( 'CCSS.' . md5( $queue_k ) ); return null; } /** * Cron ccss generation. * * @since 2.3 * @access private * * @param bool $should_continue Continue processing multiple items. * @return mixed */ public static function cron_ccss( $should_continue = false ) { $_instance = self::cls(); return $_instance->_cron_handler( 'ccss', $should_continue ); } /** * Handle UCSS/CCSS cron. * * @since 4.2 * * @param string $type Job type: 'ccss' or 'ucss'. * @param bool $should_continue Continue processing multiple items. * @return void */ private function _cron_handler( $type, $should_continue ) { $this->_queue = $this->load_queue( $type ); if ( empty( $this->_queue ) ) { return; } $type_tag = strtoupper( $type ); // For cron, need to check request interval too if ( ! $should_continue ) { if ( ! empty( $this->_summary[ 'curr_request_' . $type ] ) && time() - (int) $this->_summary[ 'curr_request_' . $type ] < 300 && ! $this->conf( self::O_DEBUG ) ) { Debug2::debug( '[' . $type_tag . '] Last request not done' ); return; } } $i = 0; foreach ( $this->_queue as $k => $v ) { if ( ! empty( $v['_status'] ) ) { continue; } Debug2::debug( '[' . $type_tag . '] cron job [tag] ' . $k . ' [url] ' . $v['url'] . ( $v['is_mobile'] ? ' 📱 ' : '' ) . ' [UA] ' . $v['user_agent'] ); if ( 'ccss' === $type && empty( $v['url_tag'] ) ) { unset( $this->_queue[ $k ] ); $this->save_queue( $type, $this->_queue ); Debug2::debug( '[CCSS] wrong queue_ccss format' ); continue; } if ( ! isset( $v['is_webp'] ) ) { $v['is_webp'] = false; } ++$i; $res = $this->_send_req( $v['url'], $k, $v['uid'], $v['user_agent'], $v['vary'], $v['url_tag'], $type, $v['is_mobile'], $v['is_webp'] ); if ( ! $res ) { // Status is wrong, drop this this->_queue unset( $this->_queue[ $k ] ); $this->save_queue( $type, $this->_queue ); if ( ! $should_continue ) { return; } if ( $i > 3 ) { GUI::print_loading( count( $this->_queue ), $type_tag ); return Router::self_redirect( Router::ACTION_CSS, self::TYPE_GEN_CCSS ); } continue; } // Exit queue if out of quota or service is hot if ( 'out_of_quota' === $res || 'svc_hot' === $res ) { return; } $this->_queue[ $k ]['_status'] = 'requested'; $this->save_queue( $type, $this->_queue ); // only request first one if ( ! $should_continue ) { return; } if ( $i > 3 ) { GUI::print_loading( count( $this->_queue ), $type_tag ); return Router::self_redirect( Router::ACTION_CSS, self::TYPE_GEN_CCSS ); } } } /** * Send to QC API to generate CCSS/UCSS. * * @since 2.3 * @access private * * @param string $request_url Request URL. * @param string $queue_k Queue key. * @param int $uid WP User ID. * @param string $user_agent User agent string. * @param string $vary Vary string. * @param string $url_tag URL tag. * @param string $type Type: 'ccss' or 'ucss'. * @param bool $is_mobile Is mobile. * @param bool $is_webp Has webp support. * @return bool|string True on success, 'out_of_quota' / 'svc_hot' on special cases, false on failure. */ private function _send_req( $request_url, $queue_k, $uid, $user_agent, $vary, $url_tag, $type, $is_mobile, $is_webp ) { // Check if has credit to push or not $err = false; $allowance = $this->cls( 'Cloud' )->allowance( Cloud::SVC_CCSS, $err ); if ( ! $allowance ) { Debug2::debug( '[CCSS] ❌ No credit: ' . $err ); $err && Admin_Display::error( Error::msg( $err ) ); return 'out_of_quota'; } set_time_limit( 120 ); // Update css request status $this->_summary[ 'curr_request_' . $type ] = time(); self::save_summary(); // Gather guest HTML to send $html = $this->prepare_html( $request_url, $user_agent, $uid ); if ( ! $html ) { return false; } // Parse HTML to gather all CSS content before requesting list( $css, $html ) = $this->prepare_css( $html, $is_webp ); if ( ! $css ) { $type_tag = strtoupper( $type ); Debug2::debug( '[' . $type_tag . '] ❌ No combined css' ); return false; } // Generate critical css $data = [ 'url' => $request_url, 'queue_k' => $queue_k, 'user_agent' => $user_agent, 'is_mobile' => $is_mobile ? 1 : 0, // todo:compatible w/ tablet 'is_webp' => $is_webp ? 1 : 0, 'html' => $html, 'css' => $css, ]; if ( ! isset( $this->_ccss_whitelist ) ) { $this->_ccss_whitelist = $this->_filter_whitelist(); } $data['whitelist'] = $this->_ccss_whitelist; self::debug( 'Generating: ', $data ); $json = Cloud::post( Cloud::SVC_CCSS, $data, 30 ); if ( ! is_array( $json ) ) { return $json; } // Old version compatibility if ( empty( $json['status'] ) ) { if ( ! empty( $json[ $type ] ) ) { $this->_save_con( $type, $json[ $type ], $queue_k, $is_mobile, $is_webp ); } // Delete the row return false; } // Unknown status, remove this line if ( 'queued' !== $json['status'] ) { return false; } // Save summary data $this->_summary[ 'last_spent_' . $type ] = time() - (int) $this->_summary[ 'curr_request_' . $type ]; $this->_summary[ 'last_request_' . $type ] = $this->_summary[ 'curr_request_' . $type ]; $this->_summary[ 'curr_request_' . $type ] = 0; self::save_summary(); return true; } /** * Save CCSS/UCSS content. * * @since 4.2 * * @param string $type Type: 'ccss' or 'ucss'. * @param string $css CSS content. * @param string $queue_k Queue key. * @param bool $mobile Is mobile. * @param bool $webp Has webp support. * @return void */ private function _save_con( $type, $css, $queue_k, $mobile, $webp ) { // Add filters $css = apply_filters( 'litespeed_' . $type, $css, $queue_k ); Debug2::debug2( '[CSS] con: ' . $css ); if ( substr( $css, 0, 2 ) === '/*' && substr( $css, -2 ) === '*/' ) { self::debug( '❌ empty ' . $type . ' [content] ' . $css ); // continue; // Save the error info too } // Write to file $filecon_md5 = md5( $css ); $filepath_prefix = $this->_build_filepath_prefix( $type ); $static_file = LITESPEED_STATIC_DIR . $filepath_prefix . $filecon_md5 . '.css'; File::save( $static_file, $css, true ); $url_tag = $this->_queue[ $queue_k ]['url_tag']; $vary = $this->_queue[ $queue_k ]['vary']; Debug2::debug2( "[CSS] Save URL to file [file] $static_file [vary] $vary" ); $this->cls( 'Data' )->save_url( $url_tag, $vary, $type, $filecon_md5, dirname( $static_file ), $mobile, $webp ); Purge::add( strtoupper( $type ) . '.' . md5( $queue_k ) ); } /** * Play for fun. * * @since 3.4.3 * * @param string $request_url URL to test. * @return void */ public function test_url( $request_url ) { $user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) : ''; $html = $this->prepare_html( $request_url, $user_agent ); list( $css, $html ) = $this->prepare_css( $html, true, true ); $data = [ 'url' => $request_url, 'ccss_type' => 'test', 'user_agent' => $user_agent, 'is_mobile' => 0, 'html' => $html, 'css' => $css, 'type' => 'CCSS', ]; $json = Cloud::post( Cloud::SVC_CCSS, $data, 180 ); Debug2::debug2( '[CSS][test_url] response', $json ); } /** * Prepare HTML from URL. * * @since 3.4.3 * * @param string $request_url URL to fetch. * @param string $user_agent User agent to use. * @param int|bool $uid Optional user ID for simulation. * @return string|false */ public function prepare_html( $request_url, $user_agent, $uid = false ) { $html = $this->cls( 'Crawler' )->self_curl( add_query_arg( 'LSCWP_CTRL', 'before_optm', $request_url ), $user_agent, $uid ); Debug2::debug2( '[CSS] self_curl result....', $html ); if ( ! $html ) { return false; } $html = $this->cls( 'Optimizer' )->html_min( $html, true ); // Drop <noscript>xxx</noscript> $html = preg_replace( '#<noscript>.*</noscript>#isU', '', $html ); return $html; } /** * Prepare CSS from HTML for CCSS generation only. UCSS will use combined CSS directly. * Prepare refined HTML for both CCSS and UCSS. * * @since 3.4.3 * * @param string $html HTML content. * @param bool $is_webp Convert backgrounds to WebP when supported. * @param bool $dryrun If true, do not fetch external CSS files. * @return array{0:string,1:string} [combined CSS, refined HTML] */ public function prepare_css( $html, $is_webp = false, $dryrun = false ) { $css = ''; preg_match_all( '#<link ([^>]+)/?>|<style([^>]*)>([^<]+)</style>#isU', $html, $matches, PREG_SET_ORDER ); foreach ( $matches as $match ) { $debug_info = ''; if ( strpos( $match[0], '<link' ) === 0 ) { $attrs = Utility::parse_attr( $match[1] ); if ( empty( $attrs['rel'] ) ) { continue; } if ( 'stylesheet' !== $attrs['rel'] ) { if ( 'preload' !== $attrs['rel'] || empty( $attrs['as'] ) || 'style' !== $attrs['as'] ) { continue; } } if ( ! empty( $attrs['media'] ) && false !== strpos( $attrs['media'], 'print' ) ) { continue; } if ( empty( $attrs['href'] ) ) { continue; } // Check Google fonts hit if ( false !== strpos( $attrs['href'], 'fonts.googleapis.com' ) ) { $html = str_replace( $match[0], '', $html ); continue; } $debug_info = $attrs['href']; // Load CSS content if ( ! $dryrun ) { // Dryrun will not load CSS but just drop them $con = $this->cls( 'Optimizer' )->load_file( $attrs['href'] ); if ( ! $con ) { continue; } } else { $con = ''; } } else { // Inline style $attrs = Utility::parse_attr( $match[2] ); if ( ! empty( $attrs['media'] ) && false !== strpos( $attrs['media'], 'print' ) ) { continue; } Debug2::debug2( '[CSS] Load inline CSS ' . substr( $match[3], 0, 100 ) . '...', $attrs ); $con = $match[3]; $debug_info = '__INLINE__'; } $con = Optimizer::minify_css( $con ); if ( $is_webp && $this->cls( 'Media' )->webp_support() ) { $con = $this->cls( 'Media' )->replace_background_webp( $con ); } if ( ! empty( $attrs['media'] ) && 'all' !== $attrs['media'] ) { $con = '@media ' . $attrs['media'] . '{' . $con . "}\n"; } else { $con = $con . "\n"; } $con = '/* ' . $debug_info . ' */' . $con; $css .= $con; $html = str_replace( $match[0], '', $html ); } return [ $css, $html ]; } /** * Filter the comment content, add quotes to selector from whitelist. Return the json. * * @since 7.1 * @return array */ private function _filter_whitelist() { $whitelist = []; $list = apply_filters( 'litespeed_ccss_whitelist', $this->conf( self::O_OPTM_CCSS_SELECTOR_WHITELIST ) ); foreach ( $list as $v ) { if ( substr( $v, 0, 2 ) === '//' ) { continue; } $whitelist[] = $v; } return $whitelist; } /** * Notify finished from server. * * @since 7.1 * @return array */ public function notify() { // phpcs:ignore WordPress.Security.NonceVerification.Missing $post_data = \json_decode( file_get_contents( 'php://input' ), true ); if ( is_null( $post_data ) ) { // Fallback for form-encoded payloads // phpcs:ignore WordPress.Security.NonceVerification.Missing $post_data = $_POST; } self::debug( 'notify() data', $post_data ); $this->_queue = $this->load_queue( 'ccss' ); list( $post_data ) = $this->cls( 'Cloud' )->extract_msg( $post_data, 'ccss' ); $notified_data = $post_data['data']; if ( empty( $notified_data ) || ! is_array( $notified_data ) ) { self::debug( '❌ notify exit: no notified data' ); return Cloud::err( 'no notified data' ); } // Check if its in queue or not $valid_i = 0; foreach ( $notified_data as $v ) { if ( empty( $v['request_url'] ) ) { self::debug( '❌ notify bypass: no request_url', $v ); continue; } if ( empty( $v['queue_k'] ) ) { self::debug( '❌ notify bypass: no queue_k', $v ); continue; } if ( empty( $this->_queue[ $v['queue_k'] ] ) ) { self::debug( '❌ notify bypass: no this queue [q_k]' . $v['queue_k'] ); continue; } // Save data if ( ! empty( $v['data_ccss'] ) ) { $is_mobile = $this->_queue[ $v['queue_k'] ]['is_mobile']; $is_webp = $this->_queue[ $v['queue_k'] ]['is_webp']; $this->_save_con( 'ccss', $v['data_ccss'], $v['queue_k'], $is_mobile, $is_webp ); ++$valid_i; } unset( $this->_queue[ $v['queue_k'] ] ); self::debug( 'notify data handled, unset queue [q_k] ' . $v['queue_k'] ); } $this->save_queue( 'ccss', $this->_queue ); self::debug( 'notified' ); return Cloud::ok( [ 'count' => $valid_i ] ); } /** * Handle all request actions from main cls. * * @since 2.3 * @access public * @return void */ public function handler() { $type = Router::verify_type(); switch ( $type ) { case self::TYPE_GEN_CCSS: self::cron_ccss( true ); break; case self::TYPE_CLEAR_Q_CCSS: $this->clear_q( 'ccss' ); break; default: break; } Admin::redirect(); } } src/object-cache-wp.cls.php 0000777 00000061171 15251157102 0011573 0 ustar 00 <?php /** * WP Object Cache wrapper for LiteSpeed Cache. * * Provides a drop-in-compatible object cache implementation that proxies to * LiteSpeed's persistent cache while keeping a local runtime cache. * * @package LiteSpeed * @since 1.8 */ /** * Class WP_Object_Cache * * Implements the WordPress object cache for LiteSpeed Cache. * * @since 1.8 * @package LiteSpeed */ class WP_Object_Cache { /** * Singleton instance * * @since 1.8 * @access protected * @var WP_Object_Cache|null */ protected static $_instance; /** * Object cache instance * * @since 1.8 * @access private * @var \LiteSpeed\Object_Cache */ private $_object_cache; /** * Cache storage * * @since 1.8 * @access private * @var array */ private $_cache = []; /** * Cache for 404 keys * * @since 1.8 * @access private * @var array */ private $_cache_404 = []; /** * Total cache operations * * @since 1.8 * @access private * @var int */ private $cache_total = 0; /** * Cache hits within call * * @since 1.8 * @access private * @var int */ private $count_hit_incall = 0; /** * Cache hits * * @since 1.8 * @access private * @var int */ private $count_hit = 0; /** * Cache misses within call * * @since 1.8 * @access private * @var int */ private $count_miss_incall = 0; /** * Cache misses * * @since 1.8 * @access private * @var int */ private $count_miss = 0; /** * Cache set operations * * @since 1.8 * @access private * @var int */ private $count_set = 0; /** * Global cache groups * * @since 1.8 * @access protected * @var array */ protected $global_groups = []; /** * Blog prefix for cache keys * * @since 1.8 * @access private * @var string */ private $blog_prefix; /** * Multisite flag * * @since 1.8 * @access private * @var bool */ private $multisite; /** * Init. * * Initializes the object cache with LiteSpeed settings. * * @since 1.8 * @access public */ public function __construct() { $this->_object_cache = \LiteSpeed\Object_Cache::cls(); $this->multisite = is_multisite(); $this->blog_prefix = $this->multisite ? get_current_blog_id() . ':' : ''; /** * Fix multiple instance using same oc issue * * @since 1.8.2 */ if ( ! defined( 'LSOC_PREFIX' ) ) { define( 'LSOC_PREFIX', substr( md5( __FILE__ ), -5 ) ); } } /** * Makes private properties readable for backward compatibility. * * @since 5.4 * @access public * * @param string $name Property to get. * @return mixed Property. */ public function __get( $name ) { return $this->$name; } /** * Makes private properties settable for backward compatibility. * * @since 5.4 * @access public * * @param string $name Property to set. * @param mixed $value Property value. * @return mixed Newly-set property. */ public function __set( $name, $value ) { $this->$name = $value; return $this->$name; } /** * Makes private properties checkable for backward compatibility. * * @since 5.4 * @access public * * @param string $name Property to check if set. * @return bool Whether the property is set. */ public function __isset( $name ) { return isset( $this->$name ); } /** * Makes private properties un-settable for backward compatibility. * * @since 5.4 * @access public * * @param string $name Property to unset. */ public function __unset( $name ) { unset( $this->$name ); } /** * Serves as a utility function to determine whether a key is valid. * * @since 5.4 * @access protected * * @param int|string $key Cache key to check for validity. * @return bool Whether the key is valid. */ protected function is_valid_key( $key ) { if ( is_int( $key ) ) { return true; } if ( is_string( $key ) && '' !== trim( $key ) ) { return true; } $type = gettype( $key ); if ( ! function_exists( '__' ) ) { wp_load_translations_early(); } $message = is_string( $key ) ? __( 'Cache key must not be an empty string.' ) : sprintf( /* translators: %s: The type of the given cache key. */ __( 'Cache key must be integer or non-empty string, %s given.' ), $type ); _doing_it_wrong( esc_html( __METHOD__ ), esc_html( $message ), '6.1.0' ); return false; } /** * Get the final key. * * Generates a unique cache key based on group and prefix. * * @since 1.8 * @access private * @param int|string $key Cache key. * @param string $group Optional. Cache group. Default 'default'. * @return string The final cache key. */ private function _key( $key, $group = 'default' ) { if ( empty( $group ) ) { $group = 'default'; } $prefix = $this->_object_cache->is_global( $group ) ? '' : $this->blog_prefix; return LSOC_PREFIX . $prefix . $group . '.' . $key; } /** * Output debug info. * * Returns cache statistics for debugging purposes. * * @since 1.8 * @access public * @return string Cache statistics. */ public function debug() { return ' [total] ' . $this->cache_total . ' [hit_incall] ' . $this->count_hit_incall . ' [hit] ' . $this->count_hit . ' [miss_incall] ' . $this->count_miss_incall . ' [miss] ' . $this->count_miss . ' [set] ' . $this->count_set; } /** * Adds data to the cache if it doesn't already exist. * * @since 1.8 * @access public * @see WP_Object_Cache::set() * * @param int|string $key What to call the contents in the cache. * @param mixed $data The contents to store in the cache. * @param string $group Optional. Where to group the cache contents. Default 'default'. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool True on success, false if cache key and group already exist. */ public function add( $key, $data, $group = 'default', $expire = 0 ) { if ( wp_suspend_cache_addition() ) { return false; } if ( ! $this->is_valid_key( $key ) ) { return false; } if ( empty( $group ) ) { $group = 'default'; } $id = $this->_key( $key, $group ); if ( array_key_exists( $id, $this->_cache ) ) { return false; } return $this->set( $key, $data, $group, (int) $expire ); } /** * Adds multiple values to the cache in one call. * * @since 5.4 * @access public * * @param array $data Array of keys and values to be added. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool[] Array of return values, grouped by key. Each value is either * true on success, or false if cache key and group already exist. */ public function add_multiple( array $data, $group = '', $expire = 0 ) { $values = []; foreach ( $data as $key => $value ) { $values[ $key ] = $this->add( $key, $value, $group, $expire ); } return $values; } /** * Replaces the contents in the cache, if contents already exist. * * @since 1.8 * @access public * @see WP_Object_Cache::set() * * @param int|string $key What to call the contents in the cache. * @param mixed $data The contents to store in the cache. * @param string $group Optional. Where to group the cache contents. Default 'default'. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool True if contents were replaced, false if original value does not exist. */ public function replace( $key, $data, $group = 'default', $expire = 0 ) { if ( ! $this->is_valid_key( $key ) ) { return false; } if ( empty( $group ) ) { $group = 'default'; } $id = $this->_key( $key, $group ); if ( ! array_key_exists( $id, $this->_cache ) ) { return false; } return $this->set( $key, $data, $group, (int) $expire ); } /** * Sets the data contents into the cache. * * The cache contents are grouped by the $group parameter followed by the * $key. This allows for duplicate IDs in unique groups. Therefore, naming of * the group should be used with care and should follow normal function * naming guidelines outside of core WordPress usage. * * The $expire parameter is not used, because the cache will automatically * expire for each time a page is accessed and PHP finishes. The method is * more for cache plugins which use files. * * @since 1.8 * @since 5.4 Returns false if cache key is invalid. * @access public * * @param int|string $key What to call the contents in the cache. * @param mixed $data The contents to store in the cache. * @param string $group Optional. Where to group the cache contents. Default 'default'. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool True if contents were set, false if key is invalid. */ public function set( $key, $data, $group = 'default', $expire = 0 ) { if ( ! $this->is_valid_key( $key ) ) { return false; } if ( empty( $group ) ) { $group = 'default'; } $id = $this->_key( $key, $group ); if ( is_object( $data ) ) { $data = clone $data; } $this->_cache[ $id ] = $data; if ( array_key_exists( $id, $this->_cache_404 ) ) { unset( $this->_cache_404[ $id ] ); } if ( ! $this->_object_cache->is_non_persistent( $group ) ) { // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize $this->_object_cache->set( $id, serialize( array( 'data' => $data ) ), (int) $expire ); ++$this->count_set; } if ( $this->_object_cache->store_transients( $group ) ) { $this->_transient_set( $key, $data, $group, (int) $expire ); } return true; } /** * Sets multiple values to the cache in one call. * * @since 5.4 * @access public * * @param array $data Array of key and value to be set. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool[] Array of return values, grouped by key. Each value is always true. */ public function set_multiple( array $data, $group = '', $expire = 0 ) { $values = []; foreach ( $data as $key => $value ) { $values[ $key ] = $this->set( $key, $value, $group, $expire ); } return $values; } /** * Retrieves the cache contents, if it exists. * * The contents will be first attempted to be retrieved by searching by the * key in the cache group. If the cache is hit (success) then the contents * are returned. * * On failure, the number of cache misses will be incremented. * * @since 1.8 * @access public * * @param int|string $key The key under which the cache contents are stored. * @param string $group Optional. Where the cache contents are grouped. Default 'default'. * @param bool $force Optional. Unused. Whether to force an update of the local cache * from the persistent cache. Default false. * @param bool $found Optional. Whether the key was found in the cache (passed by reference). * Disambiguates a return of false, a storable value. Default null. * @return mixed|false The cache contents on success, false on failure to retrieve contents. */ public function get( $key, $group = 'default', $force = false, &$found = null ) { if ( ! $this->is_valid_key( $key ) ) { return false; } if ( empty( $group ) ) { $group = 'default'; } $id = $this->_key( $key, $group ); $found = false; $found_in_oc = false; $cache_val = false; if ( array_key_exists( $id, $this->_cache ) && ! $force ) { $found = true; $cache_val = $this->_cache[ $id ]; ++$this->count_hit_incall; } elseif ( ! array_key_exists( $id, $this->_cache_404 ) && ! $this->_object_cache->is_non_persistent( $group ) ) { $v = $this->_object_cache->get( $id ); if ( null !== $v ) { $v = maybe_unserialize( $v ); } // To be compatible with false val. if ( is_array( $v ) && array_key_exists( 'data', $v ) ) { ++$this->count_hit; $found = true; $found_in_oc = true; $cache_val = $v['data']; } else { // Can't find key, cache it to 404. $this->_cache_404[ $id ] = 1; ++$this->count_miss; } } else { ++$this->count_miss_incall; } if ( is_object( $cache_val ) ) { $cache_val = clone $cache_val; } // If not found but has `Store Transients` cfg on, still need to follow WP's get_transient() logic. if ( ! $found && $this->_object_cache->store_transients( $group ) ) { $cache_val = $this->_transient_get( $key, $group ); if ( $cache_val ) { $found = true; } } if ( $found_in_oc ) { $this->_cache[ $id ] = $cache_val; } ++$this->cache_total; return $cache_val; } /** * Retrieves multiple values from the cache in one call. * * @since 5.4 * @access public * * @param array $keys Array of keys under which the cache contents are stored. * @param string $group Optional. Where the cache contents are grouped. Default 'default'. * @param bool $force Optional. Whether to force an update of the local cache * from the persistent cache. Default false. * @return array Array of return values, grouped by key. Each value is either * the cache contents on success, or false on failure. */ public function get_multiple( $keys, $group = 'default', $force = false ) { $values = []; foreach ( $keys as $key ) { $values[ $key ] = $this->get( $key, $group, $force ); } return $values; } /** * Removes the contents of the cache key in the group. * * If the cache key does not exist in the group, then nothing will happen. * * @since 1.8 * @access public * * @param int|string $key What the contents in the cache are called. * @param string $group Optional. Where the cache contents are grouped. Default 'default'. * @return bool True on success, false if the contents were not deleted. */ public function delete( $key, $group = 'default' ) { if ( ! $this->is_valid_key( $key ) ) { return false; } if ( empty( $group ) ) { $group = 'default'; } $id = $this->_key( $key, $group ); if ( $this->_object_cache->store_transients( $group ) ) { $this->_transient_del( $key, $group ); } if ( array_key_exists( $id, $this->_cache ) ) { unset( $this->_cache[ $id ] ); } if ( $this->_object_cache->is_non_persistent( $group ) ) { return false; } return $this->_object_cache->delete( $id ); } /** * Deletes multiple values from the cache in one call. * * @since 5.4 * @access public * * @param array $keys Array of keys to be deleted. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @return bool[] Array of return values, grouped by key. Each value is either * true on success, or false if the contents were not deleted. */ public function delete_multiple( array $keys, $group = '' ) { $values = []; foreach ( $keys as $key ) { $values[ $key ] = $this->delete( $key, $group ); } return $values; } /** * Increments numeric cache item's value. * * @since 5.4 * @access public * * @param int|string $key The cache key to increment. * @param int $offset Optional. The amount by which to increment the item's value. * Default 1. * @param string $group Optional. The group the key is in. Default 'default'. * @return int|false The item's new value on success, false on failure. */ public function incr( $key, $offset = 1, $group = 'default' ) { return $this->incr_desr( $key, $offset, $group, true ); } /** * Decrements numeric cache item's value. * * @since 5.4 * @access public * * @param int|string $key The cache key to decrement. * @param int $offset Optional. The amount by which to decrement the item's value. * Default 1. * @param string $group Optional. The group the key is in. Default 'default'. * @return int|false The item's new value on success, false on failure. */ public function decr( $key, $offset = 1, $group = 'default' ) { return $this->incr_desr( $key, $offset, $group, false ); } /** * Increments or decrements numeric cache item's value. * * @since 1.8 * @access public * * @param int|string $key The cache key to increment or decrement. * @param int $offset The amount by which to adjust the item's value. * @param string $group Optional. The group the key is in. Default 'default'. * @param bool $incr True to increment, false to decrement. * @return int|false The item's new value on success, false on failure. */ public function incr_desr( $key, $offset = 1, $group = 'default', $incr = true ) { if ( ! $this->is_valid_key( $key ) ) { return false; } if ( empty( $group ) ) { $group = 'default'; } $cache_val = $this->get( $key, $group ); if ( false === $cache_val ) { return false; } if ( ! is_numeric( $cache_val ) ) { $cache_val = 0; } $offset = (int) $offset; if ( $incr ) { $cache_val += $offset; } else { $cache_val -= $offset; } if ( $cache_val < 0 ) { $cache_val = 0; } $this->set( $key, $cache_val, $group ); return $cache_val; } /** * Clears the object cache of all data. * * @since 1.8 * @access public * * @return true Always returns true. */ public function flush() { $this->flush_runtime(); $this->_object_cache->flush(); return true; } /** * Removes all cache items from the in-memory runtime cache. * * @since 5.4 * @access public * * @return true Always returns true. */ public function flush_runtime() { $this->_cache = []; $this->_cache_404 = []; return true; } /** * Removes all cache items in a group. * * @since 5.4 * @access public * * @return true Always returns true. */ public function flush_group() { return true; } /** * Sets the list of global cache groups. * * @since 1.8 * @access public * * @param string|string[] $groups List of groups that are global. */ public function add_global_groups( $groups ) { $groups = (array) $groups; $this->_object_cache->add_global_groups( $groups ); } /** * Sets the list of non-persistent cache groups. * * @since 1.8 * @access public * * @param string|string[] $groups A group or an array of groups to add. */ public function add_non_persistent_groups( $groups ) { $groups = (array) $groups; $this->_object_cache->add_non_persistent_groups( $groups ); } /** * Switches the internal blog ID. * * This changes the blog ID used to create keys in blog specific groups. * * @since 1.8 * @access public * * @param int $blog_id Blog ID. */ public function switch_to_blog( $blog_id ) { $blog_id = (int) $blog_id; $this->blog_prefix = $this->multisite ? $blog_id . ':' : ''; } /** * Get transient from wp table * * Retrieves transient data from WordPress options table. * * @since 1.8.3 * @access private * @see `wp-includes/option.php` function `get_transient`/`set_site_transient` * * @param string $transient Transient name. * @param string $group Transient group ('transient' or 'site-transient'). * @return mixed Transient value or false if not found. */ private function _transient_get( $transient, $group ) { if ( 'transient' === $group ) { /**** Ori WP func start */ $transient_option = '_transient_' . $transient; if ( ! wp_installing() ) { // If option is not in alloptions, it is not autoloaded and thus has a timeout $alloptions = wp_load_alloptions(); if ( ! isset( $alloptions[ $transient_option ] ) ) { $transient_timeout = '_transient_timeout_' . $transient; $timeout = get_option( $transient_timeout ); if ( false !== $timeout && $timeout < time() ) { delete_option( $transient_option ); delete_option( $transient_timeout ); $value = false; } } } if ( ! isset( $value ) ) { $value = get_option( $transient_option ); } /**** Ori WP func end */ } elseif ( 'site-transient' === $group ) { /**** Ori WP func start */ $no_timeout = [ 'update_core', 'update_plugins', 'update_themes' ]; $transient_option = '_site_transient_' . $transient; if ( ! in_array( $transient, $no_timeout, true ) ) { $transient_timeout = '_site_transient_timeout_' . $transient; $timeout = get_site_option( $transient_timeout ); if ( false !== $timeout && $timeout < time() ) { delete_site_option( $transient_option ); delete_site_option( $transient_timeout ); $value = false; } } if ( ! isset( $value ) ) { $value = get_site_option( $transient_option ); } /**** Ori WP func end */ } else { $value = false; } return $value; } /** * Set transient to WP table * * Stores transient data in WordPress options table. * * @since 1.8.3 * @access private * @see `wp-includes/option.php` function `set_transient`/`set_site_transient` * * @param string $transient Transient name. * @param mixed $value Transient value. * @param string $group Transient group ('transient' or 'site-transient'). * @param int $expiration Time until expiration in seconds. * @return bool True on success, false on failure. */ private function _transient_set( $transient, $value, $group, $expiration ) { if ( 'transient' === $group ) { /**** Ori WP func start */ $transient_timeout = '_transient_timeout_' . $transient; $transient_option = '_transient_' . $transient; if ( false === get_option( $transient_option ) ) { $autoload = 'yes'; if ( (int) $expiration ) { $autoload = 'no'; add_option( $transient_timeout, time() + (int) $expiration, '', 'no' ); } $result = add_option( $transient_option, $value, '', $autoload ); } else { // If expiration is requested, but the transient has no timeout option, // delete, then re-create transient rather than update. $update = true; if ( (int) $expiration ) { if ( false === get_option( $transient_timeout ) ) { delete_option( $transient_option ); add_option( $transient_timeout, time() + (int) $expiration, '', 'no' ); $result = add_option( $transient_option, $value, '', 'no' ); $update = false; } else { update_option( $transient_timeout, time() + (int) $expiration ); } } if ( $update ) { $result = update_option( $transient_option, $value ); } } /**** Ori WP func end */ } elseif ( 'site-transient' === $group ) { /**** Ori WP func start */ $transient_timeout = '_site_transient_timeout_' . $transient; $option = '_site_transient_' . $transient; if ( false === get_site_option( $option ) ) { if ( (int) $expiration ) { add_site_option( $transient_timeout, time() + (int) $expiration ); } $result = add_site_option( $option, $value ); } else { if ( (int) $expiration ) { update_site_option( $transient_timeout, time() + (int) $expiration ); } $result = update_site_option( $option, $value ); } /**** Ori WP func end */ } else { $result = null; } return $result; } /** * Delete transient from WP table * * Removes transient data from WordPress options table. * * @since 1.8.3 * @access private * @see `wp-includes/option.php` function `delete_transient`/`delete_site_transient` * * @param string $transient Transient name. * @param string $group Transient group ('transient' or 'site-transient'). */ private function _transient_del( $transient, $group ) { if ( 'transient' === $group ) { /**** Ori WP func start */ $option_timeout = '_transient_timeout_' . $transient; $option = '_transient_' . $transient; $result = delete_option( $option ); if ( $result ) { delete_option( $option_timeout ); } /**** Ori WP func end */ } elseif ( 'site-transient' === $group ) { /**** Ori WP func start */ $option_timeout = '_site_transient_timeout_' . $transient; $option = '_site_transient_' . $transient; $result = delete_site_option( $option ); if ( $result ) { delete_site_option( $option_timeout ); } /**** Ori WP func end */ } } /** * Get the current instance object. * * @since 1.8 * @access public * * @return WP_Object_Cache The current instance. */ public static function get_instance() { if ( ! isset( self::$_instance ) ) { self::$_instance = new self(); } return self::$_instance; } } src/cdn.cls.php 0000777 00000037654 15251157102 0007415 0 ustar 00 <?php /** * CDN handling for LiteSpeed Cache. * * Rewrites eligible asset URLs to configured CDN endpoints and integrates with WordPress filters. * * @since 1.2.3 * @package LiteSpeed */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class CDN * * Processes page content and WordPress asset URLs to map to CDN domains according to settings. */ class CDN extends Root { const LOG_TAG = '[CDN]'; const BYPASS = 'LITESPEED_BYPASS_CDN'; /** * The working HTML/content buffer being processed. * * @var string */ private $content; /** * Whether CDN feature is enabled. * * @var bool */ private $_cfg_cdn; /** * List of original site URLs (may include wildcards) to be replaced. * * @var string[] */ private $_cfg_url_ori; /** * List of directories considered internal/original for CDN rewriting. * * @var string[] */ private $_cfg_ori_dir; /** * CDN mapping rules; keys include mapping kinds or file extensions, values are URL(s). * * @var array<string,string|string[]> */ private $_cfg_cdn_mapping = []; /** * List of URL substrings/regex used to exclude items from CDN. * * @var string[] */ private $_cfg_cdn_exclude; /** * Hosts used by CDN mappings for quick membership checks. * * @var string[] */ private $cdn_mapping_hosts = []; /** * Initialize CDN integration and register filters if enabled. * * @since 1.2.3 * @return void */ public function init() { self::debug2( 'init' ); if ( defined( self::BYPASS ) ) { self::debug2( 'CDN bypass' ); return; } if ( ! Router::can_cdn() ) { if ( ! defined( self::BYPASS ) ) { define( self::BYPASS, true ); } return; } $this->_cfg_cdn = $this->conf( Base::O_CDN ); if ( ! $this->_cfg_cdn ) { if ( ! defined( self::BYPASS ) ) { define( self::BYPASS, true ); } return; } $this->_cfg_url_ori = $this->conf( Base::O_CDN_ORI ); // Parse cdn mapping data to array( 'filetype' => 'url' ) $mapping_to_check = [ Base::CDN_MAPPING_INC_IMG, Base::CDN_MAPPING_INC_CSS, Base::CDN_MAPPING_INC_JS ]; foreach ( $this->conf( Base::O_CDN_MAPPING ) as $v ) { if ( ! $v[ Base::CDN_MAPPING_URL ] ) { continue; } $this_url = $v[ Base::CDN_MAPPING_URL ]; $this_host = wp_parse_url( $this_url, PHP_URL_HOST ); // Check img/css/js foreach ( $mapping_to_check as $to_check ) { if ( $v[ $to_check ] ) { self::debug2( 'mapping ' . $to_check . ' -> ' . $this_url ); // If filetype to url is one to many, make url be an array $this->_append_cdn_mapping( $to_check, $this_url ); if ( ! in_array( $this_host, $this->cdn_mapping_hosts, true ) ) { $this->cdn_mapping_hosts[] = $this_host; } } } // Check file types if ( $v[ Base::CDN_MAPPING_FILETYPE ] ) { foreach ( $v[ Base::CDN_MAPPING_FILETYPE ] as $v2 ) { $this->_cfg_cdn_mapping[ Base::CDN_MAPPING_FILETYPE ] = true; // If filetype to url is one to many, make url be an array $this->_append_cdn_mapping( $v2, $this_url ); if ( ! in_array( $this_host, $this->cdn_mapping_hosts, true ) ) { $this->cdn_mapping_hosts[] = $this_host; } } self::debug2( 'mapping ' . implode( ',', $v[ Base::CDN_MAPPING_FILETYPE ] ) . ' -> ' . $this_url ); } } if ( ! $this->_cfg_url_ori || ! $this->_cfg_cdn_mapping ) { if ( ! defined( self::BYPASS ) ) { define( self::BYPASS, true ); } return; } $this->_cfg_ori_dir = $this->conf( Base::O_CDN_ORI_DIR ); // In case user customized upload path if ( defined( 'UPLOADS' ) ) { $this->_cfg_ori_dir[] = UPLOADS; } // Check if need preg_replace $this->_cfg_url_ori = Utility::wildcard2regex( $this->_cfg_url_ori ); $this->_cfg_cdn_exclude = $this->conf( Base::O_CDN_EXC ); if ( ! empty( $this->_cfg_cdn_mapping[ Base::CDN_MAPPING_INC_IMG ] ) ) { // Hook to srcset if ( function_exists( 'wp_calculate_image_srcset' ) ) { add_filter( 'wp_calculate_image_srcset', [ $this, 'srcset' ], 999 ); } // Hook to mime icon add_filter( 'wp_get_attachment_image_src', [ $this, 'attach_img_src' ], 999 ); add_filter( 'wp_get_attachment_url', [ $this, 'url_img' ], 999 ); } if ( ! empty( $this->_cfg_cdn_mapping[ Base::CDN_MAPPING_INC_CSS ] ) ) { add_filter( 'style_loader_src', [ $this, 'url_css' ], 999 ); } if ( ! empty( $this->_cfg_cdn_mapping[ Base::CDN_MAPPING_INC_JS ] ) ) { add_filter( 'script_loader_src', [ $this, 'url_js' ], 999 ); } add_filter( 'litespeed_buffer_finalize', [ $this, 'finalize' ], 30 ); } /** * Associate all filetypes with CDN URL. * * @since 2.0 * @access private * * @param string $filetype Mapping key (e.g., extension or mapping constant). * @param string $url CDN base URL to use for this mapping. * @return void */ private function _append_cdn_mapping( $filetype, $url ) { // If filetype to url is one to many, make url be an array if ( empty( $this->_cfg_cdn_mapping[ $filetype ] ) ) { $this->_cfg_cdn_mapping[ $filetype ] = $url; } elseif ( is_array( $this->_cfg_cdn_mapping[ $filetype ] ) ) { // Append url to filetype $this->_cfg_cdn_mapping[ $filetype ][] = $url; } else { // Convert _cfg_cdn_mapping from string to array $this->_cfg_cdn_mapping[ $filetype ] = [ $this->_cfg_cdn_mapping[ $filetype ], $url ]; } } /** * Whether the given type is included in CDN mappings. * * @since 1.6.2.1 * * @param string $type 'css' or 'js'. * @return bool True if included in CDN. */ public function inc_type( $type ) { if ( 'css' === $type && ! empty( $this->_cfg_cdn_mapping[ Base::CDN_MAPPING_INC_CSS ] ) ) { return true; } if ( 'js' === $type && ! empty( $this->_cfg_cdn_mapping[ Base::CDN_MAPPING_INC_JS ] ) ) { return true; } return false; } /** * Run CDN processing on finalized buffer. * NOTE: After cache finalized, cannot change cache control. * * @since 1.2.3 * @access public * * @param string $content The HTML/content buffer. * @return string The processed content. */ public function finalize( $content ) { $this->content = $content; $this->_finalize(); return $this->content; } /** * Replace eligible URLs with CDN URLs in the working buffer. * * @since 1.2.3 * @access private * @return void */ private function _finalize() { if ( defined( self::BYPASS ) ) { return; } self::debug( 'CDN _finalize' ); // Start replacing img src if ( ! empty( $this->_cfg_cdn_mapping[ Base::CDN_MAPPING_INC_IMG ] ) ) { $this->_replace_img(); $this->_replace_inline_css(); } if ( ! empty( $this->_cfg_cdn_mapping[ Base::CDN_MAPPING_FILETYPE ] ) ) { $this->_replace_file_types(); } } /** * Parse all file types and replace according to configured attributes. * * @since 1.2.3 * @access private * @return void */ private function _replace_file_types() { $ele_to_check = $this->conf( Base::O_CDN_ATTR ); foreach ( $ele_to_check as $v ) { if ( ! $v || false === strpos( $v, '.' ) ) { self::debug2( 'replace setting bypassed: no . attribute ' . $v ); continue; } self::debug2( 'replace attribute ' . $v ); $v = explode( '.', $v ); $attr = preg_quote( $v[1], '#' ); if ( $v[0] ) { $pattern = '#<' . preg_quote( $v[0], '#' ) . '([^>]+)' . $attr . '=([\'"])(.+)\g{2}#iU'; } else { $pattern = '# ' . $attr . '=([\'"])(.+)\g{1}#iU'; } preg_match_all( $pattern, $this->content, $matches ); if (empty($matches[$v[0] ? 3 : 2])) { continue; } foreach ($matches[$v[0] ? 3 : 2] as $k2 => $url) { // self::debug2( 'check ' . $url ); $postfix = '.' . pathinfo((string) wp_parse_url($url, PHP_URL_PATH), PATHINFO_EXTENSION); if (!array_key_exists($postfix, $this->_cfg_cdn_mapping)) { // self::debug2( 'non-existed postfix ' . $postfix ); continue; } self::debug2( 'matched file_type ' . $postfix . ' : ' . $url ); $url2 = $this->rewrite( $url, Base::CDN_MAPPING_FILETYPE, $postfix ); if ( ! $url2 ) { continue; } $attr_str = str_replace( $url, $url2, $matches[0][ $k2 ] ); $this->content = str_replace( $matches[0][ $k2 ], $attr_str, $this->content ); } } } /** * Parse all images and replace their src attributes. * * @since 1.2.3 * @access private * @return void */ private function _replace_img() { preg_match_all( '#<img([^>]+?)src=([\'"\\\]*)([^\'"\s\\\>]+)([\'"\\\]*)([^>]*)>#i', $this->content, $matches ); foreach ( $matches[3] as $k => $url ) { // Check if is a DATA-URI if ( false !== strpos( $url, 'data:image' ) ) { continue; } $url2 = $this->rewrite( $url, Base::CDN_MAPPING_INC_IMG ); if ( ! $url2 ) { continue; } $html_snippet = sprintf( '<img %1$s src=%2$s %3$s>', $matches[1][ $k ], $matches[2][ $k ] . $url2 . $matches[4][ $k ], $matches[5][ $k ] ); $this->content = str_replace( $matches[0][ $k ], $html_snippet, $this->content ); } } /** * Parse and replace all inline styles containing url(). * * @since 1.2.3 * @access private * @return void */ private function _replace_inline_css() { self::debug2( '_replace_inline_css', $this->_cfg_cdn_mapping ); /** * Excludes `\` from URL matching * * @see #959152 - WordPress LSCache CDN Mapping causing malformed URLS * @see #685485 * @since 3.0 */ preg_match_all( '/url\((?![\'"]?data)[\'"]?(.+?)[\'"]?\)/i', $this->content, $matches ); foreach ( $matches[1] as $k => $url ) { $url = str_replace( [ ' ', '\t', '\n', '\r', '\0', '\x0B', '"', "'", '"', ''' ], '', $url ); // Parse file postfix $parsed_url = wp_parse_url( $url, PHP_URL_PATH ); if ( ! $parsed_url ) { continue; } $postfix = '.' . pathinfo( $parsed_url, PATHINFO_EXTENSION ); if ( array_key_exists( $postfix, $this->_cfg_cdn_mapping ) ) { self::debug2( 'matched file_type ' . $postfix . ' : ' . $url ); $url2 = $this->rewrite( $url, Base::CDN_MAPPING_FILETYPE, $postfix ); if ( ! $url2 ) { continue; } } elseif ( in_array( $postfix, [ 'jpg', 'jpeg', 'png', 'gif', 'svg', 'webp', 'avif' ], true ) ) { $url2 = $this->rewrite( $url, Base::CDN_MAPPING_INC_IMG ); if ( ! $url2 ) { continue; } } else { continue; } $attr = str_replace( $matches[1][ $k ], $url2, $matches[0][ $k ] ); $this->content = str_replace( $matches[0][ $k ], $attr, $this->content ); } self::debug2( '_replace_inline_css done' ); } /** * Filter: wp_get_attachment_image_src. * * @since 1.2.3 * @since 1.7 Removed static from function. * @access public * * @param array{0:string,1:int,2:int} $img The URL of the attachment image src, the width, the height. * @return array{0:string,1:int,2:int} */ public function attach_img_src( $img ) { if ( $img ) { $url = $this->rewrite( $img[0], Base::CDN_MAPPING_INC_IMG ); if ( $url ) { $img[0] = $url; } } return $img; } /** * Try to rewrite one image URL with CDN. * * @since 1.7 * @access public * * @param string $url Original URL. * @return string URL after rewriting, or original if not applicable. */ public function url_img( $url ) { if ( $url ) { $url2 = $this->rewrite( $url, Base::CDN_MAPPING_INC_IMG ); if ( $url2 ) { $url = $url2; } } return $url; } /** * Try to rewrite one CSS URL with CDN. * * @since 1.7 * @access public * * @param string $url Original URL. * @return string URL after rewriting, or original if not applicable. */ public function url_css( $url ) { if ( $url ) { $url2 = $this->rewrite( $url, Base::CDN_MAPPING_INC_CSS ); if ( $url2 ) { $url = $url2; } } return $url; } /** * Try to rewrite one JS URL with CDN. * * @since 1.7 * @access public * * @param string $url Original URL. * @return string URL after rewriting, or original if not applicable. */ public function url_js( $url ) { if ( $url ) { $url2 = $this->rewrite( $url, Base::CDN_MAPPING_INC_JS ); if ( $url2 ) { $url = $url2; } } return $url; } /** * Filter responsive image sources for CDN. * * @since 1.2.3 * @since 1.7 Removed static from function. * @access public * * @param array<int,array{url:string}> $srcs Srcset array. * @return array<int,array{url:string}> */ public function srcset( $srcs ) { if ( $srcs ) { foreach ( $srcs as $w => $data ) { $url = $this->rewrite( $data['url'], Base::CDN_MAPPING_INC_IMG ); if ( ! $url ) { continue; } $srcs[ $w ]['url'] = $url; } } return $srcs; } /** * Replace an URL with mapped CDN URL, if applicable. * * @since 1.2.3 * @access public * * @param string $url Target URL. * @param string $mapping_kind Mapping kind (e.g., Base::CDN_MAPPING_INC_IMG or Base::CDN_MAPPING_FILETYPE). * @param string|false $postfix File extension (with dot) when mapping by file type. * @return string|false Replaced URL on success, false when not applicable. */ public function rewrite( $url, $mapping_kind, $postfix = false ) { self::debug2( 'rewrite ' . $url ); $url_parsed = wp_parse_url( $url ); if ( empty( $url_parsed['path'] ) ) { self::debug2( '-rewrite bypassed: no path' ); return false; } // Only images under wp-content/wp-includes can be replaced $is_internal_folder = Utility::str_hit_array( $url_parsed['path'], $this->_cfg_ori_dir ); if ( ! $is_internal_folder ) { self::debug2( '-rewrite failed: path not match: ' . LSCWP_CONTENT_FOLDER ); return false; } // Check if is external url if ( ! empty( $url_parsed['host'] ) ) { if ( ! Utility::internal( $url_parsed['host'] ) && ! $this->_is_ori_url( $url ) ) { self::debug2( '-rewrite failed: host not internal' ); return false; } } $exclude = Utility::str_hit_array( $url, $this->_cfg_cdn_exclude ); if ( $exclude ) { self::debug2( '-abort excludes ' . $exclude ); return false; } // Fill full url before replacement if ( empty( $url_parsed['host'] ) ) { $url = Utility::uri2url( $url ); self::debug2( '-fill before rewritten: ' . $url ); $url_parsed = wp_parse_url( $url ); } $scheme = ! empty( $url_parsed['scheme'] ) ? $url_parsed['scheme'] . ':' : ''; // Find the mapping url to be replaced to if ( empty( $this->_cfg_cdn_mapping[ $mapping_kind ] ) ) { return false; } if ( Base::CDN_MAPPING_FILETYPE !== $mapping_kind ) { $final_url = $this->_cfg_cdn_mapping[ $mapping_kind ]; } else { // select from file type $final_url = $this->_cfg_cdn_mapping[ $postfix ]; if ( ! $final_url ) { return false; } } // If filetype to url is one to many, need to random one if ( is_array( $final_url ) ) { $final_url = $final_url[ array_rand( $final_url ) ]; } // Now lets replace CDN url foreach ( $this->_cfg_url_ori as $v ) { if ( false !== strpos( $v, '*' ) ) { $url = preg_replace( '#' . $scheme . $v . '#iU', $final_url, $url ); } else { $url = str_replace( $scheme . $v, $final_url, $url ); } } self::debug2( '-rewritten: ' . $url ); return $url; } /** * Check if the given URL matches any configured "original" URLs for CDN. * * @since 2.1 * @access private * * @param string $url URL to test. * @return bool True if URL is one of the originals. */ private function _is_ori_url( $url ) { $url_parsed = wp_parse_url( $url ); $scheme = ! empty( $url_parsed['scheme'] ) ? $url_parsed['scheme'] . ':' : ''; foreach ( $this->_cfg_url_ori as $v ) { $needle = $scheme . $v; if ( false !== strpos( $v, '*' ) ) { if ( preg_match( '#' . $needle . '#iU', $url ) ) { return true; } } elseif ( 0 === strpos( $url, $needle ) ) { return true; } } return false; } /** * Check if the host is one of the CDN mapping hosts. * * @since 1.2.3 * * @param string $host Hostname to check. * @return bool False when bypassed, otherwise true if internal CDN host. */ public static function internal( $host ) { if ( defined( self::BYPASS ) ) { return false; } $instance = self::cls(); return in_array( $host, $instance->cdn_mapping_hosts, true ); // todo: can add $this->_is_ori_url() check in future } } src/import.preset.cls.php 0000777 00000013001 15251157102 0011440 0 ustar 00 <?php // phpcs:ignoreFile /** * The preset class. * * @since 5.3.0 */ namespace LiteSpeed; defined('WPINC') || exit(); class Preset extends Import { protected $_summary; const MAX_BACKUPS = 10; const TYPE_APPLY = 'apply'; const TYPE_RESTORE = 'restore'; const STANDARD_DIR = LSCWP_DIR . 'data/preset'; const BACKUP_DIR = LITESPEED_STATIC_DIR . '/auto-backup'; /** * Returns sorted backup names * * @since 5.3.0 * @access public */ public static function get_backups() { self::init_filesystem(); global $wp_filesystem; $backups = array_map( function ( $path ) { return self::basename($path['name']); }, $wp_filesystem->dirlist(self::BACKUP_DIR) ?: array() ); rsort($backups); return $backups; } /** * Removes extra backup files * * @since 5.3.0 * @access public */ public static function prune_backups() { $backups = self::get_backups(); global $wp_filesystem; foreach (array_slice($backups, self::MAX_BACKUPS) as $backup) { $path = self::get_backup($backup); $wp_filesystem->delete($path); Debug2::debug('[Preset] Deleted old backup from ' . $backup); } } /** * Returns a settings file's extensionless basename given its filesystem path * * @since 5.3.0 * @access public */ public static function basename( $path ) { return basename($path, '.data'); } /** * Returns a standard preset's path given its extensionless basename * * @since 5.3.0 * @access public */ public static function get_standard( $name ) { return path_join(self::STANDARD_DIR, $name . '.data'); } /** * Returns a backup's path given its extensionless basename * * @since 5.3.0 * @access public */ public static function get_backup( $name ) { return path_join(self::BACKUP_DIR, $name . '.data'); } /** * Initializes the global $wp_filesystem object and clears stat cache * * @since 5.3.0 */ static function init_filesystem() { require_once ABSPATH . '/wp-admin/includes/file.php'; \WP_Filesystem(); clearstatcache(); } /** * Init * * @since 5.3.0 */ public function __construct() { Debug2::debug('[Preset] Init'); $this->_summary = self::get_summary(); } /** * Applies a standard preset's settings given its extensionless basename * * @since 5.3.0 * @access public */ public function apply( $preset ) { $this->make_backup($preset); $path = self::get_standard($preset); $result = $this->import_file($path) ? $preset : 'error'; $this->log($result); } /** * Restores settings from the backup file with the given timestamp, then deletes the file * * @since 5.3.0 * @access public */ public function restore( $timestamp ) { $backups = array(); foreach (self::get_backups() as $backup) { if (preg_match('/^backup-' . $timestamp . '(-|$)/', $backup) === 1) { $backups[] = $backup; } } if (empty($backups)) { $this->log('error'); return; } $backup = $backups[0]; $path = self::get_backup($backup); if (!$this->import_file($path)) { $this->log('error'); return; } self::init_filesystem(); global $wp_filesystem; $wp_filesystem->delete($path); Debug2::debug('[Preset] Deleted most recent backup from ' . $backup); $this->log('backup'); } /** * Saves current settings as a backup file, then prunes extra backup files * * @since 5.3.0 * @access public */ public function make_backup( $preset ) { $backup = 'backup-' . time() . '-before-' . $preset; $data = $this->export(true); $path = self::get_backup($backup); File::save($path, $data, true); Debug2::debug('[Preset] Backup saved to ' . $backup); self::prune_backups(); } /** * Tries to import from a given settings file * * @since 5.3.0 */ function import_file( $path ) { $debug = function ( $result, $name ) { $action = $result ? 'Applied' : 'Failed to apply'; Debug2::debug('[Preset] ' . $action . ' settings from ' . $name); return $result; }; $name = self::basename($path); $contents = file_get_contents($path); if (false === $contents) { Debug2::debug('[Preset] ❌ Failed to get file contents'); return $debug(false, $name); } $parsed = array(); try { // Check if the data is v4+ if (strpos($contents, '["_version",') === 0) { $contents = explode("\n", $contents); foreach ($contents as $line) { $line = trim($line); if (empty($line)) { continue; } list($key, $value) = \json_decode($line, true); $parsed[$key] = $value; } } else { $parsed = \json_decode(base64_decode($contents), true); } } catch (\Exception $ex) { Debug2::debug('[Preset] ❌ Failed to parse serialized data'); return $debug(false, $name); } if (empty($parsed)) { Debug2::debug('[Preset] ❌ Nothing to apply'); return $debug(false, $name); } $this->cls('Conf')->update_confs($parsed); return $debug(true, $name); } /** * Updates the log * * @since 5.3.0 */ function log( $preset ) { $this->_summary['preset'] = $preset; $this->_summary['preset_timestamp'] = time(); self::save_summary(); } /** * Handles all request actions from main cls * * @since 5.3.0 * @access public */ public function handler() { $type = Router::verify_type(); switch ($type) { case self::TYPE_APPLY: $this->apply(!empty($_GET['preset']) ? $_GET['preset'] : false); break; case self::TYPE_RESTORE: $this->restore(!empty($_GET['timestamp']) ? $_GET['timestamp'] : false); break; default: break; } Admin::redirect(); } } src/object-cache.cls.php 0000777 00000050414 15251157102 0011145 0 ustar 00 <?php /** * The object cache class. * * @since 1.8 * @package LiteSpeed */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); require_once dirname( __DIR__ ) . '/autoload.php'; /** * Object cache handler using Redis or Memcached. * * NOTE: this class may be included without initialized core. * * @since 1.8 */ class Object_Cache extends Root { const LOG_TAG = '[Object_Cache]'; /** * Debug option key. * * @var string */ const O_DEBUG = 'debug'; /** * Object cache enable key. * * @var string */ const O_OBJECT = 'object'; /** * Object kind (Redis/Memcached). * * @var string */ const O_OBJECT_KIND = 'object-kind'; /** * Object host. * * @var string */ const O_OBJECT_HOST = 'object-host'; /** * Object port. * * @var string */ const O_OBJECT_PORT = 'object-port'; /** * Object life/TTL. * * @var string */ const O_OBJECT_LIFE = 'object-life'; /** * Persistent connection flag. * * @var string */ const O_OBJECT_PERSISTENT = 'object-persistent'; /** * Admin cache flag. * * @var string */ const O_OBJECT_ADMIN = 'object-admin'; /** * Transients store flag. * * @var string */ const O_OBJECT_TRANSIENTS = 'object-transients'; /** * DB index for Redis. * * @var string */ const O_OBJECT_DB_ID = 'object-db_id'; /** * Username for auth. * * @var string */ const O_OBJECT_USER = 'object-user'; /** * Password for auth. * * @var string */ const O_OBJECT_PSWD = 'object-pswd'; /** * Global groups list. * * @var string */ const O_OBJECT_GLOBAL_GROUPS = 'object-global_groups'; /** * Non-persistent groups list. * * @var string */ const O_OBJECT_NON_PERSISTENT_GROUPS = 'object-non_persistent_groups'; /** * Connection instance. * * @var \Redis|\Memcached|null */ private $_conn; /** * Debug config. * * @var bool */ private $_cfg_debug; /** * Whether OC is enabled. * * @var bool */ private $_cfg_enabled; /** * True => Redis, false => Memcached. * * @var bool */ private $_cfg_method; /** * Host name. * * @var string */ private $_cfg_host; /** * Port number. * * @var int|string */ private $_cfg_port; /** * TTL in seconds. * * @var int */ private $_cfg_life; /** * Use persistent connection. * * @var bool */ private $_cfg_persistent; /** * Cache admin pages. * * @var bool */ private $_cfg_admin; /** * Store transients. * * @var bool */ private $_cfg_transients; /** * Redis DB index. * * @var int */ private $_cfg_db; /** * Auth username. * * @var string */ private $_cfg_user; /** * Auth password. * * @var string */ private $_cfg_pswd; /** * Default TTL in seconds. * * @var int */ private $_default_life = 360; /** * 'Redis' or 'Memcached'. * * @var string */ private $_oc_driver = 'Memcached'; // Redis or Memcached. /** * Global groups. * * @var array */ private $_global_groups = []; /** * Non-persistent groups. * * @var array */ private $_non_persistent_groups = []; /** * Init. * * NOTE: this class may be included without initialized core. * * @since 1.8 * * @param array|false $cfg Optional configuration to bootstrap without core. */ public function __construct( $cfg = false ) { if ( $cfg ) { if ( ! is_array( $cfg[ Base::O_OBJECT_GLOBAL_GROUPS ] ) ) { $cfg[ Base::O_OBJECT_GLOBAL_GROUPS ] = explode( "\n", $cfg[ Base::O_OBJECT_GLOBAL_GROUPS ] ); } if ( ! is_array( $cfg[ Base::O_OBJECT_NON_PERSISTENT_GROUPS ] ) ) { $cfg[ Base::O_OBJECT_NON_PERSISTENT_GROUPS ] = explode( "\n", $cfg[ Base::O_OBJECT_NON_PERSISTENT_GROUPS ] ); } $this->_cfg_debug = $cfg[ Base::O_DEBUG ] ? $cfg[ Base::O_DEBUG ] : false; $this->_cfg_method = $cfg[ Base::O_OBJECT_KIND ] ? true : false; $this->_cfg_host = $cfg[ Base::O_OBJECT_HOST ]; $this->_cfg_port = $cfg[ Base::O_OBJECT_PORT ]; $this->_cfg_life = $cfg[ Base::O_OBJECT_LIFE ]; $this->_cfg_persistent = $cfg[ Base::O_OBJECT_PERSISTENT ]; $this->_cfg_admin = $cfg[ Base::O_OBJECT_ADMIN ]; $this->_cfg_transients = $cfg[ Base::O_OBJECT_TRANSIENTS ]; $this->_cfg_db = $cfg[ Base::O_OBJECT_DB_ID ]; $this->_cfg_user = $cfg[ Base::O_OBJECT_USER ]; $this->_cfg_pswd = $cfg[ Base::O_OBJECT_PSWD ]; $this->_global_groups = $cfg[ Base::O_OBJECT_GLOBAL_GROUPS ]; $this->_non_persistent_groups = $cfg[ Base::O_OBJECT_NON_PERSISTENT_GROUPS ]; if ( $this->_cfg_method ) { $this->_oc_driver = 'Redis'; } $this->_cfg_enabled = $cfg[ Base::O_OBJECT ] && class_exists( $this->_oc_driver ) && $this->_cfg_host; } elseif ( defined( 'LITESPEED_CONF_LOADED' ) ) { // If OC is OFF, will hit here to init OC after conf initialized $this->_cfg_debug = $this->conf( Base::O_DEBUG ) ? $this->conf( Base::O_DEBUG ) : false; $this->_cfg_method = $this->conf( Base::O_OBJECT_KIND ) ? true : false; $this->_cfg_host = $this->conf( Base::O_OBJECT_HOST ); $this->_cfg_port = $this->conf( Base::O_OBJECT_PORT ); $this->_cfg_life = $this->conf( Base::O_OBJECT_LIFE ); $this->_cfg_persistent = $this->conf( Base::O_OBJECT_PERSISTENT ); $this->_cfg_admin = $this->conf( Base::O_OBJECT_ADMIN ); $this->_cfg_transients = $this->conf( Base::O_OBJECT_TRANSIENTS ); $this->_cfg_db = $this->conf( Base::O_OBJECT_DB_ID ); $this->_cfg_user = $this->conf( Base::O_OBJECT_USER ); $this->_cfg_pswd = $this->conf( Base::O_OBJECT_PSWD ); $this->_global_groups = $this->conf( Base::O_OBJECT_GLOBAL_GROUPS ); $this->_non_persistent_groups = $this->conf( Base::O_OBJECT_NON_PERSISTENT_GROUPS ); if ( $this->_cfg_method ) { $this->_oc_driver = 'Redis'; } $this->_cfg_enabled = $this->conf( Base::O_OBJECT ) && class_exists( $this->_oc_driver ) && $this->_cfg_host; } elseif ( defined( 'self::CONF_FILE' ) && file_exists( WP_CONTENT_DIR . '/' . self::CONF_FILE ) ) { // Get cfg from _data_file. // Use self::const to avoid loading more classes. $cfg = \json_decode( file_get_contents( WP_CONTENT_DIR . '/' . self::CONF_FILE ), true ); if ( ! empty( $cfg[ self::O_OBJECT_HOST ] ) ) { $this->_cfg_debug = ! empty( $cfg[ Base::O_DEBUG ] ) ? $cfg[ Base::O_DEBUG ] : false; $this->_cfg_method = ! empty( $cfg[ self::O_OBJECT_KIND ] ) ? $cfg[ self::O_OBJECT_KIND ] : false; $this->_cfg_host = $cfg[ self::O_OBJECT_HOST ]; $this->_cfg_port = $cfg[ self::O_OBJECT_PORT ]; $this->_cfg_life = ! empty( $cfg[ self::O_OBJECT_LIFE ] ) ? $cfg[ self::O_OBJECT_LIFE ] : $this->_default_life; $this->_cfg_persistent = ! empty( $cfg[ self::O_OBJECT_PERSISTENT ] ) ? $cfg[ self::O_OBJECT_PERSISTENT ] : false; $this->_cfg_admin = ! empty( $cfg[ self::O_OBJECT_ADMIN ] ) ? $cfg[ self::O_OBJECT_ADMIN ] : false; $this->_cfg_transients = ! empty( $cfg[ self::O_OBJECT_TRANSIENTS ] ) ? $cfg[ self::O_OBJECT_TRANSIENTS ] : false; $this->_cfg_db = ! empty( $cfg[ self::O_OBJECT_DB_ID ] ) ? $cfg[ self::O_OBJECT_DB_ID ] : 0; $this->_cfg_user = ! empty( $cfg[ self::O_OBJECT_USER ] ) ? $cfg[ self::O_OBJECT_USER ] : ''; $this->_cfg_pswd = ! empty( $cfg[ self::O_OBJECT_PSWD ] ) ? $cfg[ self::O_OBJECT_PSWD ] : ''; $this->_global_groups = ! empty( $cfg[ self::O_OBJECT_GLOBAL_GROUPS ] ) ? $cfg[ self::O_OBJECT_GLOBAL_GROUPS ] : []; $this->_non_persistent_groups = ! empty( $cfg[ self::O_OBJECT_NON_PERSISTENT_GROUPS ] ) ? $cfg[ self::O_OBJECT_NON_PERSISTENT_GROUPS ] : []; if ( $this->_cfg_method ) { $this->_oc_driver = 'Redis'; } $this->_cfg_enabled = class_exists( $this->_oc_driver ) && $this->_cfg_host; } else { $this->_cfg_enabled = false; } } else { $this->_cfg_enabled = false; } } /** * Add debug. * * @since 6.3 * @access private * * @param string $text Log text. * @return void */ private function debug_oc( $text ) { if ( defined( 'LSCWP_LOG' ) ) { self::debug( $text ); return; } if ( Base::VAL_ON2 !== $this->_cfg_debug ) { return; } $litespeed_data_folder = defined( 'LITESPEED_DATA_FOLDER' ) ? LITESPEED_DATA_FOLDER : 'litespeed'; $lscwp_content_dir = defined( 'LSCWP_CONTENT_DIR' ) ? LSCWP_CONTENT_DIR : WP_CONTENT_DIR; $litespeed_static_dir = $lscwp_content_dir . '/' . $litespeed_data_folder; $log_path_prefix = $litespeed_static_dir . '/debug/'; $log_file = $log_path_prefix . Debug2::FilePath( 'debug' ); if ( file_exists( $log_path_prefix . 'index.php' ) && file_exists( $log_file ) ) { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log error_log(gmdate('m/d/y H:i:s') . ' - OC - ' . $text . PHP_EOL, 3, $log_file); } } /** * Get `Store Transients` setting value. * * @since 1.8.3 * @access public * * @param string $group Group name. * @return bool */ public function store_transients( $group ) { return $this->_cfg_transients && $this->_is_transients_group( $group ); } /** * Check if the group belongs to transients or not. * * @since 1.8.3 * @access private * * @param string $group Group name. * @return bool */ private function _is_transients_group( $group ) { return in_array( $group, [ 'transient', 'site-transient' ], true ); } /** * Update WP object cache file config. * * @since 1.8 * @access public * * @param array $options Options to apply after update. * @return void */ public function update_file( $options ) { $changed = false; // NOTE: When included in oc.php, `LSCWP_DIR` will show undefined, so this must be assigned/generated when used. $_oc_ori_file = LSCWP_DIR . 'lib/object-cache.php'; $_oc_wp_file = WP_CONTENT_DIR . '/object-cache.php'; // Update cls file. if ( ! file_exists( $_oc_wp_file ) || md5_file( $_oc_wp_file ) !== md5_file( $_oc_ori_file ) ) { $this->debug_oc( 'copying object-cache.php file to ' . $_oc_wp_file ); copy( $_oc_ori_file, $_oc_wp_file ); $changed = true; } /** * Clear object cache. */ if ( $changed ) { $this->_reconnect( $options ); } } /** * Remove object cache file. * * @since 1.8.2 * @access public * * @return void */ public function del_file() { // NOTE: When included in oc.php, `LSCWP_DIR` will show undefined, so this must be assigned/generated when used. $_oc_ori_file = LSCWP_DIR . 'lib/object-cache.php'; $_oc_wp_file = WP_CONTENT_DIR . '/object-cache.php'; if ( file_exists( $_oc_wp_file ) && md5_file( $_oc_wp_file ) === md5_file( $_oc_ori_file ) ) { $this->debug_oc( 'removing ' . $_oc_wp_file ); wp_delete_file( $_oc_wp_file ); } } /** * Try to build connection. * * @since 1.8 * @access public * * @return bool|null False on failure, true on success, null if unsupported. */ public function test_connection() { return $this->_connect(); } /** * Force to connect with this setting. * * @since 1.8 * @access private * * @param array $cfg Reconnect configuration. * @return void */ private function _reconnect( $cfg ) { $this->debug_oc( 'Reconnecting' ); if ( isset( $this->_conn ) ) { // error_log( 'Object: Quitting existing connection!' ); $this->debug_oc( 'Quitting existing connection' ); $this->flush(); $this->_conn = null; $this->cls( false, true ); } $cls = $this->cls( false, false, $cfg ); $cls->_connect(); if ( isset( $cls->_conn ) ) { $cls->flush(); } } /** * Connect to Memcached/Redis server. * * @since 1.8 * @access private * * @return bool|null False on failure, true on success, null if driver missing. */ private function _connect() { if ( isset( $this->_conn ) ) { // error_log( 'Object: _connected' ); return true; } if ( ! class_exists( $this->_oc_driver ) || ! $this->_cfg_host ) { $this->debug_oc( '_oc_driver cls non existed or _cfg_host missed: ' . $this->_oc_driver . ' [_cfg_host] ' . $this->_cfg_host . ':' . $this->_cfg_port ); return null; } if ( defined( 'LITESPEED_OC_FAILURE' ) ) { $this->debug_oc( 'LITESPEED_OC_FAILURE const defined' ); return false; } $this->debug_oc( 'Init ' . $this->_oc_driver . ' connection to ' . $this->_cfg_host . ':' . $this->_cfg_port ); $failed = false; /** * Connect to Redis. * * @since 1.8.1 * @see https://github.com/phpredis/phpredis/#example-1 */ if ( 'Redis' === $this->_oc_driver ) { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_set_error_handler set_error_handler( 'litespeed_exception_handler' ); try { $this->_conn = new \Redis(); // error_log( 'Object: _connect Redis' ); if ( $this->_cfg_persistent ) { if ( $this->_cfg_port ) { $this->_conn->pconnect( $this->_cfg_host, $this->_cfg_port ); } else { $this->_conn->pconnect( $this->_cfg_host ); } } elseif ( $this->_cfg_port ) { $this->_conn->connect( $this->_cfg_host, $this->_cfg_port ); } else { $this->_conn->connect( $this->_cfg_host ); } if ( $this->_cfg_pswd ) { if ( $this->_cfg_user ) { $this->_conn->auth( [ $this->_cfg_user, $this->_cfg_pswd ] ); } else { $this->_conn->auth( $this->_cfg_pswd ); } } if (defined('Redis::OPT_REPLY_LITERAL')) { $this->debug_oc( 'Redis set OPT_REPLY_LITERAL' ); $this->_conn->setOption(\Redis::OPT_REPLY_LITERAL, true); } if ( $this->_cfg_db ) { $this->_conn->select( $this->_cfg_db ); } $res = $this->_conn->rawCommand('PING'); if ( 'PONG' !== $res ) { $this->debug_oc( 'Redis resp is wrong: ' . $res ); $failed = true; } } catch ( \Exception $e ) { $this->debug_oc( 'Redis connect exception: ' . $e->getMessage() ); $failed = true; } catch ( \ErrorException $e ) { $this->debug_oc( 'Redis connect error: ' . $e->getMessage() ); $failed = true; } restore_error_handler(); } else { // Connect to Memcached. if ( $this->_cfg_persistent ) { $this->_conn = new \Memcached( $this->_get_mem_id() ); // Check memcached persistent connection. if ( $this->_validate_mem_server() ) { // error_log( 'Object: _validate_mem_server' ); $this->debug_oc( 'Got persistent ' . $this->_oc_driver . ' connection' ); return true; } $this->debug_oc( 'No persistent ' . $this->_oc_driver . ' server list!' ); } else { // error_log( 'Object: new memcached!' ); $this->_conn = new \Memcached(); } $this->_conn->addServer( $this->_cfg_host, (int) $this->_cfg_port ); /** * Add SASL auth. * * @since 1.8.1 * @since 2.9.6 Fixed SASL connection @see https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:lsmcd:new_sasl */ if ( $this->_cfg_user && $this->_cfg_pswd && method_exists( $this->_conn, 'setSaslAuthData' ) ) { $this->_conn->setOption( \Memcached::OPT_BINARY_PROTOCOL, true ); $this->_conn->setOption( \Memcached::OPT_COMPRESSION, false ); $this->_conn->setSaslAuthData( $this->_cfg_user, $this->_cfg_pswd ); } // Check connection. if ( ! $this->_validate_mem_server() ) { $failed = true; } } // If failed to connect. if ( $failed ) { $this->debug_oc( '❌ Failed to connect ' . $this->_oc_driver . ' server!' ); $this->_conn = null; $this->_cfg_enabled = false; ! defined( 'LITESPEED_OC_FAILURE' ) && define( 'LITESPEED_OC_FAILURE', true ); // error_log( 'Object: false!' ); return false; } $this->debug_oc( '✅ Connected to ' . $this->_oc_driver . ' server.' ); return true; } /** * Check if the connected memcached host is the one in cfg. * * @since 1.8 * @access private * * @return bool */ private function _validate_mem_server() { $mem_list = $this->_conn->getStats(); if ( empty( $mem_list ) ) { return false; } foreach ( $mem_list as $k => $v ) { if ( substr( $k, 0, strlen( $this->_cfg_host ) ) !== $this->_cfg_host ) { continue; } if ( ! empty( $v['pid'] ) || ! empty( $v['curr_connections'] ) ) { return true; } } return false; } /** * Get memcached unique id to be used for connecting. * * @since 1.8 * @access private * * @return string */ private function _get_mem_id() { $mem_id = 'litespeed'; if ( is_multisite() ) { $mem_id .= '_' . get_current_blog_id(); } return $mem_id; } /** * Get cache. * * @since 1.8 * @access public * * @param string $key Cache key. * @return mixed|null */ public function get( $key ) { if ( ! $this->_cfg_enabled ) { return null; } if ( ! $this->_can_cache() ) { return null; } if ( ! $this->_connect() ) { return null; } $res = $this->_conn->get( $key ); return $res; } /** * Set cache. * * @since 1.8 * @access public * * @param string $key Cache key. * @param mixed $data Data to store. * @param int $expire TTL seconds. * @return bool|null */ public function set( $key, $data, $expire ) { if ( ! $this->_cfg_enabled ) { return null; } /** * To fix the Cloud callback cached as its frontend call but the hash is generated in backend * Bug found by Stan at Jan/10/2020 */ // if ( ! $this->_can_cache() ) { // return null; // } if ( ! $this->_connect() ) { return null; } $ttl = $expire ? $expire : $this->_cfg_life; if ( 'Redis' === $this->_oc_driver ) { try { $res = $this->_conn->setEx( $key, $ttl, $data ); } catch ( \RedisException $ex ) { $res = false; $msg = sprintf( __( 'Redis encountered a fatal error: %1$s (code: %2$d)', 'litespeed-cache' ), $ex->getMessage(), $ex->getCode() ); $this->debug_oc( $msg ); Admin_Display::error( $msg ); } } else { $res = $this->_conn->set( $key, $data, $ttl ); } return $res; } /** * Check if can cache or not. * * @since 1.8 * @access private * * @return bool */ private function _can_cache() { if ( ! $this->_cfg_admin && defined( 'WP_ADMIN' ) ) { return false; } return true; } /** * Delete cache. * * @since 1.8 * @access public * * @param string $key Cache key. * @return bool|null */ public function delete( $key ) { if ( ! $this->_cfg_enabled ) { return null; } if ( ! $this->_connect() ) { return null; } if ( 'Redis' === $this->_oc_driver ) { $res = $this->_conn->del( $key ); } else { $res = $this->_conn->delete( $key ); } return (bool) $res; } /** * Clear all cache. * * @since 1.8 * @access public * * @return bool|null */ public function flush() { if ( ! $this->_cfg_enabled ) { $this->debug_oc( 'bypass flushing' ); return null; } if ( ! $this->_connect() ) { return null; } $this->debug_oc( 'flush!' ); if ( 'Redis' === $this->_oc_driver ) { $res = $this->_conn->flushDb(); } else { $res = $this->_conn->flush(); $this->_conn->resetServerList(); } return $res; } /** * Add global groups. * * @since 1.8 * @access public * * @param string|string[] $groups Group(s) to add. * @return void */ public function add_global_groups( $groups ) { if ( ! is_array( $groups ) ) { $groups = [ $groups ]; } $this->_global_groups = array_merge( $this->_global_groups, $groups ); $this->_global_groups = array_unique( $this->_global_groups ); } /** * Check if is in global groups or not. * * @since 1.8 * @access public * * @param string $group Group name. * @return bool */ public function is_global( $group ) { return in_array( $group, $this->_global_groups, true ); } /** * Add non persistent groups. * * @since 1.8 * @access public * * @param string|string[] $groups Group(s) to add. * @return void */ public function add_non_persistent_groups( $groups ) { if ( ! is_array( $groups ) ) { $groups = [ $groups ]; } $this->_non_persistent_groups = array_merge( $this->_non_persistent_groups, $groups ); $this->_non_persistent_groups = array_unique( $this->_non_persistent_groups ); } /** * Check if is in non persistent groups or not. * * @since 1.8 * @access public * * @param string $group Group name. * @return bool */ public function is_non_persistent( $group ) { return in_array( $group, $this->_non_persistent_groups, true ); } } src/file.cls.php 0000777 00000025107 15251157102 0007556 0 ustar 00 <?php // phpcs:ignoreFile /** * LiteSpeed File Operator Library Class * Append/Replace content to a file * * @since 1.1.0 */ namespace LiteSpeed; defined('WPINC') || exit(); class File { const MARKER = 'LiteSpeed Operator'; /** * Detect if an URL is 404 * * @since 3.3 */ public static function is_404( $url ) { $response = wp_safe_remote_get($url); $code = wp_remote_retrieve_response_code($response); if ($code == 404) { return true; } return false; } /** * Delete folder * * @since 2.1 */ public static function rrmdir( $dir ) { $files = array_diff(scandir($dir), array( '.', '..' )); foreach ($files as $file) { is_dir("$dir/$file") ? self::rrmdir("$dir/$file") : unlink("$dir/$file"); } return rmdir($dir); } public static function count_lines( $filename ) { if (!file_exists($filename)) { return 0; } $file = new \SplFileObject($filename); $file->seek(PHP_INT_MAX); return $file->key() + 1; } /** * Read data from file * * @since 1.1.0 * @param string $filename * @param int $start_line * @param int $lines */ public static function read( $filename, $start_line = null, $lines = null ) { if (!file_exists($filename)) { return ''; } if (!is_readable($filename)) { return false; } if ($start_line !== null) { $res = array(); $file = new \SplFileObject($filename); $file->seek($start_line); if ($lines === null) { while (!$file->eof()) { $res[] = rtrim($file->current(), "\n"); $file->next(); } } else { for ($i = 0; $i < $lines; $i++) { if ($file->eof()) { break; } $res[] = rtrim($file->current(), "\n"); $file->next(); } } unset($file); return $res; } $content = file_get_contents($filename); $content = self::remove_zero_space($content); return $content; } /** * Append data to file * * @since 1.1.5 * @access public * @param string $filename * @param string $data * @param boolean $mkdir * @param boolean $silence Used to avoid WP's functions are used */ public static function append( $filename, $data, $mkdir = false, $silence = true ) { return self::save($filename, $data, $mkdir, true, $silence); } /** * Save data to file * * @since 1.1.0 * @param string $filename * @param string $data * @param boolean $mkdir * @param boolean $append If the content needs to be appended * @param boolean $silence Used to avoid WP's functions are used */ public static function save( $filename, $data, $mkdir = false, $append = false, $silence = true ) { if (is_null($filename)) { return $silence ? false : __('Filename is empty!', 'litespeed-cache'); } $error = false; $folder = dirname($filename); // mkdir if folder does not exist if (!file_exists($folder)) { if (!$mkdir) { return $silence ? false : sprintf(__('Folder does not exist: %s', 'litespeed-cache'), $folder); } set_error_handler('litespeed_exception_handler'); try { mkdir($folder, 0755, true); // Create robots.txt file to forbid search engine indexes if (!file_exists(LITESPEED_STATIC_DIR . '/robots.txt')) { file_put_contents(LITESPEED_STATIC_DIR . '/robots.txt', "User-agent: *\nDisallow: /\n"); } } catch (\ErrorException $ex) { return $silence ? false : sprintf(__('Can not create folder: %1$s. Error: %2$s', 'litespeed-cache'), $folder, $ex->getMessage()); } restore_error_handler(); } if (!file_exists($filename)) { if (!is_writable($folder)) { return $silence ? false : sprintf(__('Folder is not writable: %s.', 'litespeed-cache'), $folder); } set_error_handler('litespeed_exception_handler'); try { touch($filename); } catch (\ErrorException $ex) { return $silence ? false : sprintf(__('File %s is not writable.', 'litespeed-cache'), $filename); } restore_error_handler(); } elseif (!is_writable($filename)) { return $silence ? false : sprintf(__('File %s is not writable.', 'litespeed-cache'), $filename); } $data = self::remove_zero_space($data); $ret = file_put_contents($filename, $data, $append ? FILE_APPEND : LOCK_EX); if ($ret === false) { return $silence ? false : sprintf(__('Failed to write to %s.', 'litespeed-cache'), $filename); } return true; } /** * Remove Unicode zero-width space <200b><200c> * * @since 2.1.2 * @since 2.9 changed to public */ public static function remove_zero_space( $content ) { if (is_array($content)) { $content = array_map(__CLASS__ . '::remove_zero_space', $content); return $content; } // Remove UTF-8 BOM if present if (substr($content, 0, 3) === "\xEF\xBB\xBF") { $content = substr($content, 3); } $content = str_replace("\xe2\x80\x8b", '', $content); $content = str_replace("\xe2\x80\x8c", '', $content); $content = str_replace("\xe2\x80\x8d", '', $content); return $content; } /** * Appends an array of strings into a file (.htaccess ), placing it between * BEGIN and END markers. * * Replaces existing marked info. Retains surrounding * data. Creates file if none exists. * * @param string $filename Filename to alter. * @param string $marker The marker to alter. * @param array|string|false $insertion The new content to insert. * @param bool $prepend Prepend insertion if not exist. * @return bool True on write success, false on failure. */ public static function insert_with_markers( $filename, $insertion = false, $marker = false, $prepend = false ) { if (!$marker) { $marker = self::MARKER; } if (!$insertion) { $insertion = array(); } return self::_insert_with_markers($filename, $marker, $insertion, $prepend); // todo: capture exceptions } /** * Return wrapped block data with marker * * @param string $insertion * @param string $marker * @return string The block data */ public static function wrap_marker_data( $insertion, $marker = false ) { if (!$marker) { $marker = self::MARKER; } $start_marker = "# BEGIN {$marker}"; $end_marker = "# END {$marker}"; $new_data = implode("\n", array_merge(array( $start_marker ), $insertion, array( $end_marker ))); return $new_data; } /** * Touch block data from file, return with marker * * @param string $filename * @param string $marker * @return string The current block data */ public static function touch_marker_data( $filename, $marker = false ) { if (!$marker) { $marker = self::MARKER; } $result = self::_extract_from_markers($filename, $marker); if (!$result) { return false; } $start_marker = "# BEGIN {$marker}"; $end_marker = "# END {$marker}"; $new_data = implode("\n", array_merge(array( $start_marker ), $result, array( $end_marker ))); return $new_data; } /** * Extracts strings from between the BEGIN and END markers in the .htaccess file. * * @param string $filename * @param string $marker * @return array An array of strings from a file (.htaccess ) from between BEGIN and END markers. */ public static function extract_from_markers( $filename, $marker = false ) { if (!$marker) { $marker = self::MARKER; } return self::_extract_from_markers($filename, $marker); } /** * Extracts strings from between the BEGIN and END markers in the .htaccess file. * * @param string $filename * @param string $marker * @return array An array of strings from a file (.htaccess ) from between BEGIN and END markers. */ private static function _extract_from_markers( $filename, $marker ) { $result = array(); if (!file_exists($filename)) { return $result; } if ($markerdata = explode("\n", implode('', file($filename)))) { $state = false; foreach ($markerdata as $markerline) { if (strpos($markerline, '# END ' . $marker) !== false) { $state = false; } if ($state) { $result[] = $markerline; } if (strpos($markerline, '# BEGIN ' . $marker) !== false) { $state = true; } } } return array_map('trim', $result); } /** * Inserts an array of strings into a file (.htaccess ), placing it between BEGIN and END markers. * * Replaces existing marked info. Retains surrounding data. Creates file if none exists. * * NOTE: will throw error if failed * * @since 3.0- * @since 3.0 Throw errors if failed * @access private */ private static function _insert_with_markers( $filename, $marker, $insertion, $prepend = false ) { if (!file_exists($filename)) { if (!is_writable(dirname($filename))) { Error::t('W', dirname($filename)); } set_error_handler('litespeed_exception_handler'); try { touch($filename); } catch (\ErrorException $ex) { Error::t('W', $filename); } restore_error_handler(); } elseif (!is_writable($filename)) { Error::t('W', $filename); } if (!is_array($insertion)) { $insertion = explode("\n", $insertion); } $start_marker = "# BEGIN {$marker}"; $end_marker = "# END {$marker}"; $fp = fopen($filename, 'r+'); if (!$fp) { Error::t('W', $filename); } // Attempt to get a lock. If the filesystem supports locking, this will block until the lock is acquired. flock($fp, LOCK_EX); $lines = array(); while (!feof($fp)) { $lines[] = rtrim(fgets($fp), "\r\n"); } // Split out the existing file into the preceding lines, and those that appear after the marker $pre_lines = $post_lines = $existing_lines = array(); $found_marker = $found_end_marker = false; foreach ($lines as $line) { if (!$found_marker && false !== strpos($line, $start_marker)) { $found_marker = true; continue; } elseif (!$found_end_marker && false !== strpos($line, $end_marker)) { $found_end_marker = true; continue; } if (!$found_marker) { $pre_lines[] = $line; } elseif ($found_marker && $found_end_marker) { $post_lines[] = $line; } else { $existing_lines[] = $line; } } // Check to see if there was a change if ($existing_lines === $insertion) { flock($fp, LOCK_UN); fclose($fp); return true; } // Check if need to prepend data if not exist if ($prepend && !$post_lines) { // Generate the new file data $new_file_data = implode("\n", array_merge(array( $start_marker ), $insertion, array( $end_marker ), $pre_lines)); } else { // Generate the new file data $new_file_data = implode("\n", array_merge($pre_lines, array( $start_marker ), $insertion, array( $end_marker ), $post_lines)); } // Write to the start of the file, and truncate it to that length fseek($fp, 0); $bytes = fwrite($fp, $new_file_data); if ($bytes) { ftruncate($fp, ftell($fp)); } fflush($fp); flock($fp, LOCK_UN); fclose($fp); return (bool) $bytes; } } src/api.cls.php 0000777 00000024564 15251157102 0007416 0 ustar 00 <?php /** * The plugin API class. * * @since 1.1.3 * @package LiteSpeed */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class API * * Provides API hooks and methods for LiteSpeed Cache integration. * * @since 1.1.3 */ class API extends Base { const VERSION = Core::VER; const TYPE_FEED = Tag::TYPE_FEED; const TYPE_FRONTPAGE = Tag::TYPE_FRONTPAGE; const TYPE_HOME = Tag::TYPE_HOME; const TYPE_PAGES = Tag::TYPE_PAGES; const TYPE_PAGES_WITH_RECENT_POSTS = Tag::TYPE_PAGES_WITH_RECENT_POSTS; const TYPE_HTTP = Tag::TYPE_HTTP; const TYPE_ARCHIVE_POSTTYPE = Tag::TYPE_ARCHIVE_POSTTYPE; const TYPE_ARCHIVE_TERM = Tag::TYPE_ARCHIVE_TERM; const TYPE_AUTHOR = Tag::TYPE_AUTHOR; const TYPE_ARCHIVE_DATE = Tag::TYPE_ARCHIVE_DATE; const TYPE_BLOG = Tag::TYPE_BLOG; const TYPE_LOGIN = Tag::TYPE_LOGIN; const TYPE_URL = Tag::TYPE_URL; const TYPE_ESI = Tag::TYPE_ESI; const PARAM_NAME = ESI::PARAM_NAME; const WIDGET_O_ESIENABLE = ESI::WIDGET_O_ESIENABLE; const WIDGET_O_TTL = ESI::WIDGET_O_TTL; /** * Instance * * Initializes the API class. * * @since 3.0 */ public function __construct() { } /** * Define hooks to be used in other plugins. * * The benefit to use hooks other than functions is no need to detach if LSCWP enabled and function existed or not anymore * * @since 3.0 */ public function init() { /** * Init */ // Action `litespeed_init` /** * Conf */ add_filter( 'litespeed_conf', [ $this, 'conf' ] ); // Action `litespeed_conf_append` add_action( 'litespeed_conf_multi_switch', __NAMESPACE__ . '\Base::set_multi_switch', 10, 2 ); // Action `litespeed_conf_force` add_action( 'litespeed_save_conf', [ $this, 'save_conf' ] ); /** * Cache Control Hooks */ // Action `litespeed_control_finalize` add_action( 'litespeed_control_set_private', __NAMESPACE__ . '\Control::set_private' ); add_action( 'litespeed_control_set_nocache', __NAMESPACE__ . '\Control::set_nocache' ); add_action( 'litespeed_control_set_cacheable', [ $this, 'set_cacheable' ] ); add_action( 'litespeed_control_force_cacheable', __NAMESPACE__ . '\Control::force_cacheable' ); add_action( 'litespeed_control_force_public', __NAMESPACE__ . '\Control::set_public_forced' ); add_filter( 'litespeed_control_cacheable', __NAMESPACE__ . '\Control::is_cacheable', 3 ); add_action( 'litespeed_control_set_ttl', __NAMESPACE__ . '\Control::set_custom_ttl', 10, 2 ); add_filter( 'litespeed_control_ttl', [ $this, 'get_ttl' ], 3 ); /** * Tag Hooks */ // Action `litespeed_tag_finalize` add_action( 'litespeed_tag', __NAMESPACE__ . '\Tag::add' ); add_action( 'litespeed_tag_post', __NAMESPACE__ . '\Tag::add_post' ); add_action( 'litespeed_tag_widget', __NAMESPACE__ . '\Tag::add_widget' ); add_action( 'litespeed_tag_private', __NAMESPACE__ . '\Tag::add_private' ); add_action( 'litespeed_tag_private_esi', __NAMESPACE__ . '\Tag::add_private_esi' ); add_action( 'litespeed_tag_add', __NAMESPACE__ . '\Tag::add' ); add_action( 'litespeed_tag_add_post', __NAMESPACE__ . '\Tag::add_post' ); add_action( 'litespeed_tag_add_widget', __NAMESPACE__ . '\Tag::add_widget' ); add_action( 'litespeed_tag_add_private', __NAMESPACE__ . '\Tag::add_private' ); add_action( 'litespeed_tag_add_private_esi', __NAMESPACE__ . '\Tag::add_private_esi' ); /** * Purge Hooks */ // Action `litespeed_purge_finalize` add_action( 'litespeed_purge', __NAMESPACE__ . '\Purge::add' ); add_action( 'litespeed_purge_all', __NAMESPACE__ . '\Purge::purge_all' ); add_action( 'litespeed_purge_post', [ $this, 'purge_post' ] ); add_action( 'litespeed_purge_posttype', __NAMESPACE__ . '\Purge::purge_posttype' ); add_action( 'litespeed_purge_url', [ $this, 'purge_url' ] ); add_action( 'litespeed_purge_widget', __NAMESPACE__ . '\Purge::purge_widget' ); add_action( 'litespeed_purge_esi', __NAMESPACE__ . '\Purge::purge_esi' ); add_action( 'litespeed_purge_private', __NAMESPACE__ . '\Purge::add_private' ); add_action( 'litespeed_purge_private_esi', __NAMESPACE__ . '\Purge::add_private_esi' ); add_action( 'litespeed_purge_private_all', __NAMESPACE__ . '\Purge::add_private_all' ); // Action `litespeed_api_purge_post` // Action `litespeed_purged_all` add_action( 'litespeed_purge_all_object', __NAMESPACE__ . '\Purge::purge_all_object' ); add_action( 'litespeed_purge_ucss', __NAMESPACE__ . '\Purge::purge_ucss' ); /** * ESI */ // Action `litespeed_nonce` add_filter( 'litespeed_esi_status', [ $this, 'esi_enabled' ] ); add_filter( 'litespeed_esi_url', [ $this, 'sub_esi_block' ], 10, 8 ); // Generate ESI block url // Filter `litespeed_widget_default_options` // Hook widget default settings value. Currently used in Woo 3rd // Filter `litespeed_esi_params` // Action `litespeed_tpl_normal` // Action `litespeed_esi_load-$block` // @usage add_action( 'litespeed_esi_load-' . $block, $hook ) add_action( 'litespeed_esi_combine', __NAMESPACE__ . '\ESI::combine' ); /** * Vary * * To modify default vary, There are two ways: Action `litespeed_vary_append` or Filter `litespeed_vary` */ add_action( 'litespeed_vary_ajax_force', __NAMESPACE__ . '\Vary::can_ajax_vary' ); // Force finalize vary even if its in an AJAX call // Filter `litespeed_vary_curr_cookies` to generate current in use vary, which will be used for response vary header. // Filter `litespeed_vary_cookies` to register the final vary cookies, which will be written to rewrite rule. (litespeed_vary_curr_cookies are always equal to or less than litespeed_vary_cookies) // Filter `litespeed_vary` add_action( 'litespeed_vary_no', __NAMESPACE__ . '\Control::set_no_vary' ); /** * Cloud */ add_filter( 'litespeed_is_from_cloud', [ $this, 'is_from_cloud' ] ); // Check if current request is from QC (usually its to check REST access) // @see https://wordpress.org/support/topic/image-optimization-not-working-3/ /** * Media */ add_action( 'litespeed_media_reset', __NAMESPACE__ . '\Media::delete_attachment' ); /** * GUI */ add_filter( 'litespeed_clean_wrapper_begin', __NAMESPACE__ . '\GUI::clean_wrapper_begin' ); add_filter( 'litespeed_clean_wrapper_end', __NAMESPACE__ . '\GUI::clean_wrapper_end' ); /** * Misc */ add_action( 'litespeed_debug', __NAMESPACE__ . '\Debug2::debug', 10, 2 ); add_action( 'litespeed_debug2', __NAMESPACE__ . '\Debug2::debug2', 10, 2 ); add_action( 'litespeed_disable_all', [ $this, 'disable_all' ] ); add_action( 'litespeed_after_admin_init', [ $this, 'after_admin_init' ] ); } /** * API for admin related * * Registers hooks for admin settings and UI elements. * * @since 3.0 * @access public */ public function after_admin_init() { /** * GUI */ add_action( 'litespeed_setting_enroll', [ $this->cls( 'Admin_Display' ), 'enroll' ], 10, 4 ); add_action( 'litespeed_build_switch', [ $this->cls( 'Admin_Display' ), 'build_switch' ] ); // Action `litespeed_settings_content` // Action `litespeed_settings_tab` } /** * Disable All * * Disables all LiteSpeed Cache features with a given reason. * * @since 2.9.7.2 * @access public * @param string $reason The reason for disabling all features. */ public function disable_all( $reason ) { do_action( 'litespeed_debug', '[API] Disabled_all due to ' . $reason ); ! defined( 'LITESPEED_DISABLE_ALL' ) && define( 'LITESPEED_DISABLE_ALL', true ); } /** * Append commenter vary * * Adds commenter vary to the cache vary cookies. * * @since 3.0 * @access public */ public static function vary_append_commenter() { Vary::cls()->append_commenter(); } /** * Check if is from Cloud * * Checks if the current request originates from QUIC.cloud. * * @since 4.2 * @access public * @return bool True if from QUIC.cloud, false otherwise. */ public function is_from_cloud() { return $this->cls( 'Cloud' )->is_from_cloud(); } /** * Purge post * * Purges the cache for a specific post. * * @since 3.0 * @access public * @param int $pid Post ID to purge. */ public function purge_post( $pid ) { $this->cls( 'Purge' )->purge_post( $pid ); } /** * Purge URL * * Purges the cache for a specific URL. * * @since 3.0 * @access public * @param string $url URL to purge. */ public function purge_url( $url ) { $this->cls( 'Purge' )->purge_url( $url ); } /** * Set cacheable * * Marks the current request as cacheable. * * @since 3.0 * @access public * @param string|bool $reason Optional reason for setting cacheable. */ public function set_cacheable( $reason = false ) { $this->cls( 'Control' )->set_cacheable( $reason ); } /** * Check ESI enabled * * Returns whether ESI is enabled. * * @since 3.0 * @access public * @return bool True if ESI is enabled, false otherwise. */ public function esi_enabled() { return $this->cls( 'Router' )->esi_enabled(); } /** * Get TTL * * Retrieves the cache TTL (time to live). * * @since 3.0 * @access public * @return int Cache TTL value. */ public function get_ttl() { return $this->cls( 'Control' )->get_ttl(); } /** * Generate ESI block URL * * Generates a URL for an ESI block. * * @since 3.0 * @access public * @param string $block_id ESI block ID. * @param string $wrapper Wrapper identifier. * @param array $params Parameters for the ESI block. * @param string $control Cache control settings. * @param bool $silence Silence output flag. * @param bool $preserved Preserved flag. * @param bool $svar Server variable flag. * @param array $inline_param Inline parameters. * @return string ESI block URL. */ public function sub_esi_block( $block_id, $wrapper, $params = [], $control = 'private,no-vary', $silence = false, $preserved = false, $svar = false, $inline_param = [] ) { return $this->cls( 'ESI' )->sub_esi_block( $block_id, $wrapper, $params, $control, $silence, $preserved, $svar, $inline_param ); } /** * Set and sync conf * * Updates and synchronizes configuration settings. * * @since 7.2 * @access public * @param bool|array $the_matrix Configuration data to update. */ public function save_conf( $the_matrix = false ) { $this->cls( 'Conf' )->update_confs( $the_matrix ); } } src/db-optm.cls.php 0000777 00000036545 15251157102 0010211 0 ustar 00 <?php /** * The admin optimize tool. * * @package LiteSpeed * @since 1.2.1 */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Database optimization utilities for LiteSpeed. */ class DB_Optm extends Root { /** * Whether there are more sites hidden in multisite counts. * * @var bool */ private static $_hide_more = false; /** * Supported cleanup types. * * @var string[] */ private static $types = [ 'revision', 'orphaned_post_meta', 'auto_draft', 'trash_post', 'spam_comment', 'trash_comment', 'trackback-pingback', 'expired_transient', 'all_transients', 'optimize_tables', ]; /** * Convert tables to InnoDB type identifier. */ const TYPE_CONV_TB = 'conv_innodb'; /** * Show if there are more sites in hidden. * * @since 3.0 * @return bool */ public static function hide_more() { return self::$_hide_more; } /** * Clean/Optimize WP tables. * * @since 1.2.1 * @access public * @param string $type The type to clean. * @param bool $ignore_multisite If ignoring multisite check. * @return int|string The rows that will be affected, or '-' on unknown. */ public function db_count( $type, $ignore_multisite = false ) { if ( 'all' === $type ) { $num = 0; foreach ( self::$types as $v ) { $num += (int) $this->db_count( $v ); } return $num; } if ( ! $ignore_multisite ) { if ( is_multisite() && is_network_admin() ) { $num = 0; $blogs = Activation::get_network_ids(); foreach ( $blogs as $k => $blog_id ) { if ( $k > 3 ) { self::$_hide_more = true; break; } switch_to_blog( $blog_id ); $num += (int) $this->db_count( $type, true ); restore_current_blog(); } return $num; } } global $wpdb; switch ( $type ) { case 'revision': $rev_max = (int) $this->conf( Base::O_DB_OPTM_REVISIONS_MAX ); $rev_age = (int) $this->conf( Base::O_DB_OPTM_REVISIONS_AGE ); $sql_add = ''; if ( $rev_age ) { $sql_add = $wpdb->prepare( ' AND post_modified < DATE_SUB( NOW(), INTERVAL %d DAY ) ', $rev_age ); } $sql = "SELECT COUNT(*) FROM `$wpdb->posts` WHERE post_type = 'revision' $sql_add"; if ( ! $rev_max ) { // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared return (int) $wpdb->get_var( $sql ); } // Has count limit. $sql = "SELECT COUNT(*) - %d FROM `$wpdb->posts` WHERE post_type = 'revision' $sql_add GROUP BY post_parent HAVING COUNT(*) > %d"; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared $res = (array) $wpdb->get_results( $wpdb->prepare( $sql, $rev_max, $rev_max ), ARRAY_N ); Utility::compatibility(); return array_sum( array_column( $res, 0 ) ); case 'orphaned_post_meta': // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery return (int) $wpdb->get_var( "SELECT COUNT(*) FROM `$wpdb->postmeta` a LEFT JOIN `$wpdb->posts` b ON b.ID=a.post_id WHERE b.ID IS NULL" ); case 'auto_draft': // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery return (int) $wpdb->get_var( "SELECT COUNT(*) FROM `$wpdb->posts` WHERE post_status = 'auto-draft'" ); case 'trash_post': // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery return (int) $wpdb->get_var( "SELECT COUNT(*) FROM `$wpdb->posts` WHERE post_status = 'trash'" ); case 'spam_comment': // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery return (int) $wpdb->get_var( "SELECT COUNT(*) FROM `$wpdb->comments` WHERE comment_approved = 'spam'" ); case 'trash_comment': // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery return (int) $wpdb->get_var( "SELECT COUNT(*) FROM `$wpdb->comments` WHERE comment_approved = 'trash'" ); case 'trackback-pingback': // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery return (int) $wpdb->get_var( "SELECT COUNT(*) FROM `$wpdb->comments` WHERE comment_type = 'trackback' OR comment_type = 'pingback'" ); case 'expired_transient': // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM `$wpdb->options` WHERE option_name LIKE %s AND option_value < %d", $wpdb->esc_like( '_transient_timeout_' ) . '%', time() ) ); case 'all_transients': // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM `$wpdb->options` WHERE option_name LIKE %s", $wpdb->esc_like( '_transient_' ) . '%' ) ); case 'optimize_tables': // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM information_schema.tables WHERE TABLE_SCHEMA = %s AND ENGINE <> 'InnoDB' AND DATA_FREE > 0", DB_NAME ) ); } return '-'; } /** * Clean/Optimize WP tables. * * @since 1.2.1 * @since 3.0 changed to private * @access private * @param string $type Cleanup type. * @return string Status message. */ private function _db_clean( $type ) { if ( 'all' === $type ) { foreach ( self::$types as $v ) { $this->_db_clean( $v ); } return __( 'Clean all successfully.', 'litespeed-cache' ); } global $wpdb; switch ( $type ) { case 'revision': $rev_max = (int) $this->conf( Base::O_DB_OPTM_REVISIONS_MAX ); $rev_age = (int) $this->conf( Base::O_DB_OPTM_REVISIONS_AGE ); $postmeta = "`$wpdb->postmeta`"; $posts = "`$wpdb->posts`"; $sql_postmeta_join = function ( $table ) use ( $postmeta, $posts ) { return " $postmeta CROSS JOIN $table ON $posts.ID = $postmeta.post_id "; }; $sql_where = "WHERE $posts.post_type = 'revision'"; // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared $sql_add = $rev_age ? $wpdb->prepare( ' AND ' . $posts . '.post_modified < DATE_SUB( NOW(), INTERVAL %d DAY )', $rev_age ) : ''; if ( ! $rev_max ) { $sql_where = "$sql_where $sql_add"; $sql_postmeta = $sql_postmeta_join( $posts ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared $wpdb->query( "DELETE $postmeta FROM $sql_postmeta $sql_where" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared $wpdb->query( "DELETE FROM $posts $sql_where" ); } else { // Has count limit. $sql = " SELECT COUNT(*) - %d AS del_max, post_parent FROM $posts WHERE post_type = 'revision' $sql_add GROUP BY post_parent HAVING COUNT(*) > %d "; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared $res = (array) $wpdb->get_results( $wpdb->prepare( $sql, $rev_max, $rev_max ) ); $sql_where = " $sql_where AND post_parent = %d ORDER BY ID LIMIT %d "; $sql_postmeta = $sql_postmeta_join( "(SELECT ID FROM $posts $sql_where) AS $posts" ); foreach ( $res as $v ) { $args = [ (int) $v->post_parent, (int) $v->del_max ]; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare $wpdb->query( $wpdb->prepare( "DELETE $postmeta FROM $sql_postmeta", $args ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare $wpdb->query( $wpdb->prepare( "DELETE FROM $posts $sql_where", $args ) ); } } return __( 'Clean post revisions successfully.', 'litespeed-cache' ); case 'orphaned_post_meta': // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery $wpdb->query( "DELETE a FROM `$wpdb->postmeta` a LEFT JOIN `$wpdb->posts` b ON b.ID=a.post_id WHERE b.ID IS NULL" ); return __( 'Clean orphaned post meta successfully.', 'litespeed-cache' ); case 'auto_draft': // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery $wpdb->query( "DELETE FROM `$wpdb->posts` WHERE post_status = 'auto-draft'" ); return __( 'Clean auto drafts successfully.', 'litespeed-cache' ); case 'trash_post': // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery $wpdb->query( "DELETE FROM `$wpdb->posts` WHERE post_status = 'trash'" ); return __( 'Clean trashed posts and pages successfully.', 'litespeed-cache' ); case 'spam_comment': // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery $wpdb->query( "DELETE FROM `$wpdb->comments` WHERE comment_approved = 'spam'" ); return __( 'Clean spam comments successfully.', 'litespeed-cache' ); case 'trash_comment': // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery $wpdb->query( "DELETE FROM `$wpdb->comments` WHERE comment_approved = 'trash'" ); return __( 'Clean trashed comments successfully.', 'litespeed-cache' ); case 'trackback-pingback': // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery $wpdb->query( "DELETE FROM `$wpdb->comments` WHERE comment_type = 'trackback' OR comment_type = 'pingback'" ); return __( 'Clean trackbacks and pingbacks successfully.', 'litespeed-cache' ); case 'expired_transient': $keys_to_delete = []; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery $transients = $wpdb->get_results( $wpdb->prepare( "SELECT option_name FROM `$wpdb->options` WHERE option_name LIKE %s AND option_value < %d", $wpdb->esc_like( '_transient_timeout_' ) . '%', time() ), ); foreach ( $transients as $transient ) { $keys_to_delete[] = $transient->option_name; $keys_to_delete[] = str_replace( '_transient_timeout_', '_transient_', $transient->option_name ); } if ( ! empty( $keys_to_delete ) ) { $placeholders = implode( ',', array_fill( 0, count( $keys_to_delete ), '%s' ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery $wpdb->query( $wpdb->prepare( // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare, WordPress.DB.PreparedSQL.InterpolatedNotPrepared "DELETE FROM `$wpdb->options` WHERE option_name IN ( $placeholders )", $keys_to_delete ) ); } return __( 'Clean expired transients successfully.', 'litespeed-cache' ); case 'all_transients': // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery $wpdb->query( $wpdb->prepare( "DELETE FROM `$wpdb->options` WHERE option_name LIKE %s", $wpdb->esc_like( '_transient_' ) . '%' ) ); return __( 'Clean all transients successfully.', 'litespeed-cache' ); case 'optimize_tables': // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery $result = (array) $wpdb->get_results( $wpdb->prepare( "SELECT table_name, DATA_FREE FROM information_schema.tables WHERE TABLE_SCHEMA = %s AND ENGINE <> 'InnoDB' AND DATA_FREE > 0", DB_NAME ) ); if ( $result ) { foreach ( $result as $row ) { // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared $wpdb->query( 'OPTIMIZE TABLE ' . esc_sql( $row->table_name ) ); } } return __( 'Optimized all tables.', 'litespeed-cache' ); } } /** * Get all MyISAM tables. * * @since 3.0 * @access public * @return array */ public function list_myisam() { global $wpdb; $like = $wpdb->esc_like( $wpdb->prefix ) . '%'; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery return (array) $wpdb->get_results( $wpdb->prepare( "SELECT TABLE_NAME as table_name, ENGINE as engine FROM information_schema.tables WHERE TABLE_SCHEMA = %s AND ENGINE = 'myisam' AND TABLE_NAME LIKE %s", DB_NAME, $like ) ); } /** * Convert tables to InnoDB. * * @since 3.0 * @access private * @return void */ private function _conv_innodb() { global $wpdb; $tb_param = isset( $_GET['litespeed_tb'] ) ? sanitize_text_field( wp_unslash( $_GET['litespeed_tb'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( ! $tb_param ) { Admin_Display::error( 'No table to convert or invalid nonce' ); return; } $tb = false; $list = $this->list_myisam(); $names = wp_list_pluck( $list, 'table_name' ); if ( in_array( $tb_param, $names, true ) ) { $tb = $tb_param; } if ( ! $tb ) { Admin_Display::error( 'No existing table' ); return; } // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.SchemaChange $wpdb->query( 'ALTER TABLE ' . esc_sql( DB_NAME ) . '.' . esc_sql( $tb ) . ' ENGINE = InnoDB' ); Debug2::debug( "[DB] Converted $tb to InnoDB" ); $msg = __( 'Converted to InnoDB successfully.', 'litespeed-cache' ); Admin_Display::success( $msg ); } /** * Count all autoload size. * * @since 3.0 * @access public * @return object Summary with size, entries, and toplist. */ public function autoload_summary() { global $wpdb; $autoload_values = function_exists( 'wp_autoload_values_to_autoload' ) ? wp_autoload_values_to_autoload() : [ 'yes', 'on', 'auto-on', 'auto' ]; $placeholders = implode( ',', array_fill( 0, count( $autoload_values ), '%s' ) ); // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare $summary = $wpdb->get_row( $wpdb->prepare( "SELECT SUM(LENGTH(option_value)) AS autoload_size, COUNT(*) AS autload_entries FROM `$wpdb->options` WHERE autoload IN ($placeholders)", $autoload_values ) ); // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare $summary->autoload_toplist = $wpdb->get_results( $wpdb->prepare( "SELECT option_name, LENGTH(option_value) AS option_value_length, autoload FROM `$wpdb->options` WHERE autoload IN ($placeholders) ORDER BY option_value_length DESC LIMIT 20", $autoload_values ) ); return $summary; } /** * Handle all request actions from main cls. * * @since 3.0 * @access public * @return void */ public function handler() { $type = Router::verify_type(); switch ($type) { case self::TYPE_CONV_TB: $this->_conv_innodb(); break; default: if ( 'all' === $type || in_array( $type, self::$types, true ) ) { if ( is_multisite() && is_network_admin() ) { $blogs = Activation::get_network_ids(); foreach ( $blogs as $blog_id ) { switch_to_blog( $blog_id ); $msg = $this->_db_clean( $type ); restore_current_blog(); } } else { $msg = $this->_db_clean( $type ); } Admin_Display::success( $msg ); } break; } Admin::redirect(); } /** * Clean DB via WP-CLI. * * @since 7.0 * @access public * @param string $args Cleanup type. * @return string|false */ public function handler_clean_db_cli( $args ) { if ( defined( 'WP_CLI' ) && constant('WP_CLI') ) { return $this->_db_clean( $args ); } return false; } } src/tool.cls.php 0000777 00000010254 15251157102 0007611 0 ustar 00 <?php /** * The tools * * @since 3.0 * @package LiteSpeed */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Class Tool * * Provides utility functions for LiteSpeed Cache, including IP detection and heartbeat control. * * @since 3.0 */ class Tool extends Root { const LOG_TAG = '[Tool]'; /** * Get public IP * * Retrieves the public IP address of the server. * * @since 3.0 * @access public * @return string The public IP address or an error message. */ public function check_ip() { self::debug( '✅ check_ip' ); $response = wp_safe_remote_get( 'https://cyberpanel.sh/?ip', [ 'headers' => [ 'User-Agent' => 'curl/8.7.1', ], ] ); if ( is_wp_error( $response ) ) { return esc_html__( 'Failed to detect IP', 'litespeed-cache' ); } $ip = trim( $response['body'] ); self::debug( 'result [ip] ' . $ip ); if ( Utility::valid_ipv4( $ip ) ) { return $ip; } return esc_html__( 'Failed to detect IP', 'litespeed-cache' ); } /** * Heartbeat Control * * Configures WordPress heartbeat settings for frontend, backend, and editor. * * @since 3.0 * @access public */ public function heartbeat() { add_action( 'wp_enqueue_scripts', [ $this, 'heartbeat_frontend' ] ); add_action( 'admin_enqueue_scripts', [ $this, 'heartbeat_backend' ] ); add_filter( 'heartbeat_settings', [ $this, 'heartbeat_settings' ] ); } /** * Heartbeat Control frontend control * * Manages heartbeat settings for the frontend. * * @since 3.0 * @access public */ public function heartbeat_frontend() { if ( ! $this->conf( Base::O_MISC_HEARTBEAT_FRONT ) ) { return; } if ( ! $this->conf( Base::O_MISC_HEARTBEAT_FRONT_TTL ) ) { wp_deregister_script( 'heartbeat' ); Debug2::debug( '[Tool] Deregistered frontend heartbeat' ); } } /** * Heartbeat Control backend control * * Manages heartbeat settings for the backend and editor. * * @since 3.0 * @access public */ public function heartbeat_backend() { if ( $this->is_editor() ) { if ( ! $this->conf( Base::O_MISC_HEARTBEAT_EDITOR ) ) { return; } if ( ! $this->conf( Base::O_MISC_HEARTBEAT_EDITOR_TTL ) ) { wp_deregister_script( 'heartbeat' ); Debug2::debug( '[Tool] Deregistered editor heartbeat' ); } } else { if ( ! $this->conf( Base::O_MISC_HEARTBEAT_BACK ) ) { return; } if ( ! $this->conf( Base::O_MISC_HEARTBEAT_BACK_TTL ) ) { wp_deregister_script( 'heartbeat' ); Debug2::debug( '[Tool] Deregistered backend heartbeat' ); } } } /** * Heartbeat Control settings * * Adjusts heartbeat interval settings based on configuration. * * @since 3.0 * @access public * @param array $settings Existing heartbeat settings. * @return array Modified heartbeat settings. */ public function heartbeat_settings( $settings ) { // Check editor first to make frontend editor valid too if ( $this->is_editor() ) { if ( $this->conf( Base::O_MISC_HEARTBEAT_EDITOR ) ) { $settings['interval'] = $this->conf( Base::O_MISC_HEARTBEAT_EDITOR_TTL ); Debug2::debug( '[Tool] Heartbeat interval set to ' . $this->conf( Base::O_MISC_HEARTBEAT_EDITOR_TTL ) ); } } elseif ( ! is_admin() ) { if ( $this->conf( Base::O_MISC_HEARTBEAT_FRONT ) ) { $settings['interval'] = $this->conf( Base::O_MISC_HEARTBEAT_FRONT_TTL ); Debug2::debug( '[Tool] Heartbeat interval set to ' . $this->conf( Base::O_MISC_HEARTBEAT_FRONT_TTL ) ); } } elseif ( $this->conf( Base::O_MISC_HEARTBEAT_BACK ) ) { $settings['interval'] = $this->conf( Base::O_MISC_HEARTBEAT_BACK_TTL ); Debug2::debug( '[Tool] Heartbeat interval set to ' . $this->conf( Base::O_MISC_HEARTBEAT_BACK_TTL ) ); } return $settings; } /** * Check if in editor * * Determines if the current request is within the WordPress editor. * * @since 3.0 * @access public * @return bool True if in editor, false otherwise. */ public function is_editor() { $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; $res = is_admin() && Utility::str_hit_array( $request_uri, [ 'post.php', 'post-new.php' ] ); return apply_filters( 'litespeed_is_editor', $res ); } } src/crawler.cls.php 0000777 00000131362 15251157102 0010277 0 ustar 00 <?php /** * The crawler class. * * @package LiteSpeed * @since 1.1.0 */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Handles sitemap crawling, blacklisting, and async operations. */ class Crawler extends Root { const LOG_TAG = '🕸️'; const TYPE_REFRESH_MAP = 'refresh_map'; const TYPE_EMPTY = 'empty'; const TYPE_BLACKLIST_EMPTY = 'blacklist_empty'; const TYPE_BLACKLIST_DEL = 'blacklist_del'; const TYPE_BLACKLIST_ADD = 'blacklist_add'; const TYPE_START = 'start'; const TYPE_RESET = 'reset'; const USER_AGENT = 'lscache_walker'; const FAST_USER_AGENT = 'lscache_runner'; const CHUNKS = 10000; const STATUS_WAIT = 'W'; const STATUS_HIT = 'H'; const STATUS_MISS = 'M'; const STATUS_BLACKLIST = 'B'; const STATUS_NOCACHE = 'N'; /** * Sitemeta file slug. * * @var string */ private $_sitemeta = 'meta.data'; /** * Reset file full path. * * @var string */ private $_resetfile; /** * Reason that ended current run. * * @var string */ private $_end_reason; /** * Number of CPU cores. * * @var int */ private $_ncpu = 1; /** * Server IP set in settings. * * @var string|null */ private $_server_ip; /** * Crawler configuration. * * @var array */ private $_crawler_conf = [ 'cookies' => [], 'headers' => [], 'ua' => '', ]; /** * Built crawler variants. * * @var array<int,array> */ private $_crawlers = []; /** * Current allowed worker threads. * * @var int */ private $_cur_threads = -1; /** * Max timestamp to run until. * * @var int */ private $_max_run_time; /** * Last time threads were adjusted. * * @var int */ private $_cur_thread_time; /** * Map-status list to batch-save. * * @var array */ private $_map_status_list = [ 'H' => [], 'M' => [], 'B' => [], 'N' => [], ]; /** * Summary cache. * * @var array */ protected $_summary; /** * Initialize crawler, assign sitemap path. * * @since 1.1.0 */ public function __construct() { if ( is_multisite() ) { $this->_sitemeta = 'meta' . get_current_blog_id() . '.data'; } $this->_resetfile = LITESPEED_STATIC_DIR . '/crawler/' . $this->_sitemeta . '.reset'; $this->_summary = self::get_summary(); $this->_ncpu = $this->_get_server_cpu(); $this->_server_ip = $this->conf( Base::O_SERVER_IP ); self::debug( 'Init w/ CPU cores=' . $this->_ncpu ); } /** * Try get server CPUs. * * @since 5.2 * @return int Number of cores detected. */ private function _get_server_cpu() { $cpuinfo_file = '/proc/cpuinfo'; $setting_open_dir = ini_get( 'open_basedir' ); if ( $setting_open_dir ) { return 1; // Server has limit. } try { // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged if (!@is_file($cpuinfo_file)) { return 1; } } catch ( \Exception $e ) { return 1; } // Local system read; no WP alternative. Suppress sniff. // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents $cpuinfo = file_get_contents( $cpuinfo_file ); preg_match_all( '/^processor/m', $cpuinfo, $matches ); $cnt = isset( $matches[0] ) ? count( $matches[0] ) : 0; return $cnt ? $cnt : 1; } /** * Check whether the current crawler is active. * * @since 4.3 * @param int $curr Crawler index. * @return bool Active state. */ public function is_active( $curr ) { $bypass_list = self::get_option( 'bypass_list', [] ); return ! in_array( (int) $curr, $bypass_list, true ); } /** * Toggle the current crawler's active state and return the updated state. * * @since 4.3 * @param int $curr Crawler index. * @return bool True if turned on, false if turned off. */ public function toggle_activeness( $curr ) { $bypass_list = self::get_option( 'bypass_list', [] ); if ( in_array( (int) $curr, $bypass_list, true ) ) { // Remove it. $key = array_search( (int) $curr, $bypass_list, true ); if ( false !== $key ) { unset( $bypass_list[ $key ] ); $bypass_list = array_values( $bypass_list ); self::update_option( 'bypass_list', $bypass_list ); } return true; } // Add it. $bypass_list[] = (int) $curr; self::update_option( 'bypass_list', $bypass_list ); return false; } /** * Clear bypassed list. * * @since 4.3 * @access public * @return void */ public function clear_disabled_list() { self::update_option( 'bypass_list', [] ); $msg = __( 'Crawler disabled list is cleared! All crawlers are set to active! ', 'litespeed-cache' ); Admin_Display::note( $msg ); self::debug( 'All crawlers are set to active...... ' ); } /** * Overwrite get_summary to init elements. * * @since 3.0 * @access public * * @param string|false $field Field name to fetch or false to get all. * @return mixed Summary value/array or null if not found. */ public static function get_summary( $field = false ) { $_default = [ 'list_size' => 0, 'last_update_time' => 0, 'curr_crawler' => 0, 'curr_crawler_beginning_time' => 0, 'last_pos' => 0, 'last_count' => 0, 'last_crawled' => 0, 'last_start_time' => 0, 'last_status' => '', 'is_running' => 0, 'end_reason' => '', 'meta_save_time' => 0, 'pos_reset_check' => 0, 'done' => 0, 'this_full_beginning_time' => 0, 'last_full_time_cost' => 0, 'last_crawler_total_cost' => 0, 'crawler_stats' => [], // this will store all crawlers hit/miss crawl status. ]; wp_cache_delete( 'alloptions', 'options' ); // ensure the summary is current. $summary = parent::get_summary(); $summary = array_merge( $_default, $summary ); if ( false === $field ) { return $summary; } if ( array_key_exists( $field, $summary ) ) { return $summary[ $field ]; } return null; } /** * Overwrite save_summary. * * @since 3.0 * @access public * * @param array|false $data Data to save or false to save current. * @param bool $reload Whether to reload after saving. * @param bool $overwrite Whether to overwrite completely. * @return void */ public static function save_summary( $data = false, $reload = false, $overwrite = false ) { $instance = self::cls(); $instance->_summary['meta_save_time'] = time(); if ( false === $data ) { $data = $instance->_summary; } parent::save_summary( $data, $reload, $overwrite ); File::save( LITESPEED_STATIC_DIR . '/crawler/' . $instance->_sitemeta, wp_json_encode( $data ), true ); } /** * Cron start async crawling. * * @since 5.5 * @return void */ public static function start_async_cron() { Task::async_call( 'crawler' ); } /** * Manually start async crawling. * * @since 5.5 * @return void */ public static function start_async() { Task::async_call( 'crawler_force' ); $msg = __( 'Started async crawling', 'litespeed-cache' ); Admin_Display::success( $msg ); } /** * Ajax crawl handler. * * @since 5.5 * @param bool $manually_run Whether manually triggered. * @return void */ public static function async_handler( $manually_run = false ) { self::debug( '------------async-------------start_async_handler' ); self::start( (bool) $manually_run ); } /** * Proceed crawling. * * @since 1.1.0 * @access public * * @param bool $manually_run Whether manually triggered. * @return bool|void */ public static function start( $manually_run = false ) { if ( ! Router::can_crawl() ) { self::debug( '......crawler is NOT allowed by the server admin......' ); return false; } if ( $manually_run ) { self::debug( '......crawler manually ran......' ); } self::cls()->_crawl_data( (bool) $manually_run ); } /** * Crawling start. * * @since 1.1.0 * @access private * * @param bool $manually_run Whether manually triggered. * @return void */ private function _crawl_data( $manually_run ) { if ( ! defined( 'LITESPEED_LANE_HASH' ) ) { define( 'LITESPEED_LANE_HASH', Str::rrand( 8 ) ); } if ( $this->_check_valid_lane() ) { $this->_take_over_lane(); } else { self::debug( '⚠️ lane in use' ); return; } self::debug( '......crawler started......' ); // for the first time running. if ( ! $this->_summary || ! Data::cls()->tb_exist( 'crawler' ) || ! Data::cls()->tb_exist( 'crawler_blacklist' ) ) { $this->cls( 'Crawler_Map' )->gen(); } // if finished last time, regenerate sitemap. if ( 'touchedEnd' === $this->_summary['done'] ) { // check whole crawling interval. $last_finished_at = (int) $this->_summary['last_full_time_cost'] + (int) $this->_summary['this_full_beginning_time']; if ( ! $manually_run && ( time() - $last_finished_at ) < $this->conf( Base::O_CRAWLER_CRAWL_INTERVAL ) ) { self::debug( 'Cron abort: cache warmed already.' ); $this->Release_lane(); return; } self::debug( 'TouchedEnd. regenerate sitemap....' ); $this->cls( 'Crawler_Map' )->gen(); } $crawlers = $this->list_crawlers(); $crawlers_count = count( $crawlers ); // Skip the crawlers that in bypassed list. while ( ! $this->is_active( $this->_summary['curr_crawler'] ) && $this->_summary['curr_crawler'] < $crawlers_count ) { self::debug( 'Skipped the Crawler #' . $this->_summary['curr_crawler'] . ' ......' ); $this->_summary['curr_crawler'] = (int) $this->_summary['curr_crawler'] + 1; } if ( $this->_summary['curr_crawler'] >= $crawlers_count ) { $this->_end_reason = 'end'; $this->_terminate_running(); $this->Release_lane(); return; } // In case crawlers are all done but not reload, reload it. if ( empty( $this->_summary['curr_crawler'] ) || empty( $this->_crawlers[ $this->_summary['curr_crawler'] ] ) ) { $this->_summary['curr_crawler'] = 0; $this->_summary['crawler_stats'][ $this->_summary['curr_crawler'] ] = []; } $res = $this->load_conf(); if ( ! $res ) { self::debug( 'Load conf failed' ); $this->_terminate_running(); $this->Release_lane(); return; } try { $this->_engine_start(); $this->Release_lane(); } catch ( \Exception $e ) { self::debug( '🛑 ' . $e->getMessage() ); } } /** * Load conf before running crawler. * * @since 3.0 * @access private * @return bool True on success. */ private function load_conf() { $this->_crawler_conf['base'] = site_url(); $current_crawler = $this->_crawlers[ $this->_summary['curr_crawler'] ]; // Cookies. foreach ( $current_crawler as $k => $v ) { if ( 0 !== strpos( $k, 'cookie:' ) ) { continue; } if ( '_null' === $v ) { continue; } $this->_crawler_conf['cookies'][ substr( $k, 7 ) ] = $v; } // WebP/AVIF simulation. if ( ! empty( $current_crawler['webp'] ) ) { $this->_crawler_conf['headers'][] = 'Accept: image/' . ( 2 === (int) $this->conf( Base::O_IMG_OPTM_WEBP ) ? 'avif' : 'webp' ) . ',*/*'; } // Mobile crawler. if ( ! empty( $current_crawler['mobile'] ) ) { $this->_crawler_conf['ua'] = 'Mobile iPhone'; } // Limit delay to use server setting. $this->_crawler_conf['run_delay'] = 500; // microseconds. if ( defined( 'LITESPEED_CRAWLER_USLEEP' ) && constant( 'LITESPEED_CRAWLER_USLEEP' ) > $this->_crawler_conf['run_delay'] ) { $this->_crawler_conf['run_delay'] = (int) constant( 'LITESPEED_CRAWLER_USLEEP' ); } if ( isset( $_SERVER[ Base::ENV_CRAWLER_USLEEP ] ) ) { $env_usleep = absint( wp_unslash( $_SERVER[ Base::ENV_CRAWLER_USLEEP ] ) ); if ( $env_usleep > (int) $this->_crawler_conf['run_delay'] ) { $this->_crawler_conf['run_delay'] = $env_usleep; } } $this->_crawler_conf['run_duration'] = $this->get_crawler_duration(); $this->_crawler_conf['load_limit'] = (int) $this->conf( Base::O_CRAWLER_LOAD_LIMIT ); if ( isset( $_SERVER[ Base::ENV_CRAWLER_LOAD_LIMIT_ENFORCE ] ) ) { $this->_crawler_conf['load_limit'] = absint( wp_unslash( $_SERVER[ Base::ENV_CRAWLER_LOAD_LIMIT_ENFORCE ] ) ); } elseif ( isset( $_SERVER[ Base::ENV_CRAWLER_LOAD_LIMIT ] ) ) { $env_limit = absint( wp_unslash( $_SERVER[ Base::ENV_CRAWLER_LOAD_LIMIT ] ) ); if ( $env_limit < (int) $this->_crawler_conf['load_limit'] ) { $this->_crawler_conf['load_limit'] = $env_limit; } } if ( 0 === (int) $this->_crawler_conf['load_limit'] ) { self::debug( '🛑 Terminated crawler due to load limit set to 0' ); return false; } // Role simulation. if ( ! empty( $current_crawler['uid'] ) ) { if ( empty( $this->_server_ip ) ) { self::debug( '🛑 Terminated crawler due to Server IP not set' ); return false; } $vary_name = $this->cls( 'Vary' )->get_vary_name(); $vary_val = $this->cls( 'Vary' )->finalize_default_vary( $current_crawler['uid'] ); $this->_crawler_conf['cookies'][ $vary_name ] = $vary_val; $this->_crawler_conf['cookies']['litespeed_hash'] = Router::cls()->get_hash( $current_crawler['uid'] ); } return true; } /** * Get crawler duration allowance. * * @since 7.0 * @return int Seconds. */ public function get_crawler_duration() { $run_duration = defined( 'LITESPEED_CRAWLER_DURATION' ) ? (int) constant( 'LITESPEED_CRAWLER_DURATION' ) : 900; if ( $run_duration > 900 ) { $run_duration = 900; // reset to default value if defined higher than 900 seconds. } return $run_duration; } /** * Start crawler. * * @since 1.1.0 * @access private * @return void */ private function _engine_start() { // check current load. $this->_adjust_current_threads(); if ( 0 === (int) $this->_cur_threads ) { $this->_end_reason = 'stopped_highload'; self::debug( 'Stopped due to heavy load.' ); return; } // log started time. self::save_summary( [ 'last_start_time' => time() ] ); // set time limit. $max_time = (int) ini_get( 'max_execution_time' ); self::debug( 'ini_get max_execution_time=' . $max_time ); if ( 0 === $max_time ) { $max_time = 300; // hardlimit. } else { $max_time -= 5; } if ( $max_time >= (int) $this->_crawler_conf['run_duration'] ) { $max_time = (int) $this->_crawler_conf['run_duration']; self::debug( 'Use run_duration setting as max_execution_time=' . $max_time ); // phpcs:ignore WordPress.PHP.IniSet.max_execution_time_Disallowed -- Required for crawler functionality. } elseif ( ini_set( 'max_execution_time', $this->_crawler_conf['run_duration'] + 15 ) !== false ) { $max_time = $this->_crawler_conf['run_duration']; self::debug( 'ini_set max_execution_time=' . $max_time ); } self::debug( 'final max_execution_time=' . $max_time ); $this->_max_run_time = $max_time + time(); // mark running. $this->_prepare_running(); // run crawler. $this->_do_running(); $this->_terminate_running(); } /** * Get server load. * * @since 5.5 * @return int Load or -1 if unsupported. */ public function get_server_load() { if ( ! function_exists( 'sys_getloadavg' ) ) { return -1; } $curload = sys_getloadavg(); $curload = (float) $curload[0]; self::debug( 'Server load: ' . $curload ); return $curload; } /** * Adjust threads dynamically. * * @since 1.1.0 * @access private * @return void */ private function _adjust_current_threads() { $curload = $this->get_server_load(); if ( -1 === (int) $curload ) { self::debug( 'set threads=0 due to func sys_getloadavg not exist!' ); $this->_cur_threads = 0; return; } $curload /= (float) $this->_ncpu; $crawler_threads = defined( 'LITESPEED_CRAWLER_THREADS' ) ? (int) constant( 'LITESPEED_CRAWLER_THREADS' ) : 3; $load_limit = (float) $this->_crawler_conf['load_limit']; $current_threads = (int) $this->_cur_threads; if ( -1 === $current_threads ) { // init. if ( $curload > $load_limit ) { $curthreads = 0; } elseif ( $curload >= ( $load_limit - 1 ) ) { $curthreads = 1; } else { $curthreads = (int) ( $load_limit - $curload ); if ( $curthreads > $crawler_threads ) { $curthreads = $crawler_threads; } } } else { // adjust. $curthreads = $current_threads; if ( $curload >= ( $load_limit + 1 ) ) { sleep( 5 ); // sleep 5 secs. if ( $curthreads >= 1 ) { --$curthreads; } } elseif ( $curload >= $load_limit ) { --$curthreads; } elseif ( ( $curload + 1 ) < $load_limit ) { if ( $curthreads < $crawler_threads ) { ++$curthreads; } } } $this->_cur_threads = (int) $curthreads; $this->_cur_thread_time = time(); } /** * Mark running status. * * @since 1.1.0 * @access private * @return void */ private function _prepare_running() { $this->_summary['is_running'] = time(); $this->_summary['done'] = 0; // reset done status. $this->_summary['last_status'] = 'prepare running'; $this->_summary['last_crawled'] = 0; // Current crawler starttime mark. if ( 0 === (int) $this->_summary['last_pos'] ) { $this->_summary['curr_crawler_beginning_time'] = time(); } if ( 0 === (int) $this->_summary['curr_crawler'] && 0 === (int) $this->_summary['last_pos'] ) { $this->_summary['this_full_beginning_time'] = time(); $this->_summary['list_size'] = $this->cls( 'Crawler_Map' )->count_map(); } if ( 'end' === $this->_summary['end_reason'] && 0 === (int) $this->_summary['last_pos'] ) { $this->_summary['crawler_stats'][ $this->_summary['curr_crawler'] ] = []; } self::save_summary(); } /** * Take over lane. * * @since 6.1 * @return void */ private function _take_over_lane() { self::debug( 'Take over lane as lane is free: ' . $this->json_local_path() . '.pid' ); File::save( $this->json_local_path() . '.pid', LITESPEED_LANE_HASH ); } /** * Update lane file mtime. * * @since 6.1 * @return void */ private function _touch_lane() { // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_touch touch( $this->json_local_path() . '.pid' ); } /** * Release lane file. * * @since 6.1 * @return void */ public function Release_lane() { $lane_file = $this->json_local_path() . '.pid'; if ( ! file_exists( $lane_file ) ) { return; } self::debug( 'Release lane' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.unlink_unlink unlink( $lane_file ); } /** * Check if lane is used by other crawlers. * * @since 6.1 * @param bool $strict_mode Strict check that file must exist. * @return bool True if valid lane. */ private function _check_valid_lane( $strict_mode = false ) { $lane_file = $this->json_local_path() . '.pid'; if ( $strict_mode ) { if ( ! file_exists( $lane_file ) ) { self::debug( 'lane file not existed, strict mode is false [file] ' . $lane_file ); return false; } } $pid = File::read( $lane_file ); if ( $pid && LITESPEED_LANE_HASH !== $pid ) { // If lane file is older than 1h, ignore. if ( ( time() - filemtime( $lane_file ) ) > 3600 ) { self::debug( 'Lane file is older than 1h, releasing lane' ); $this->Release_lane(); return true; } return false; } return true; } /** * Test port for simulator. * * @since 7.0 * @access private * @return bool true if success and can continue crawling, false otherwise. */ private function _test_port() { if ( empty( $this->_server_ip ) ) { if ( empty( $this->_crawlers[ $this->_summary['curr_crawler'] ]['uid'] ) ) { self::debug( 'Bypass test port as Server IP is not set' ); return true; } self::debug( '❌ Server IP not set' ); return false; } if ( defined( 'LITESPEED_CRAWLER_LOCAL_PORT' ) ) { self::debug( '✅ LITESPEED_CRAWLER_LOCAL_PORT already defined' ); return true; } // Don't repeat testing in 120s. if ( ! empty( $this->_summary['test_port_tts'] ) && ( time() - (int) $this->_summary['test_port_tts'] ) < 120 ) { if ( ! empty( $this->_summary['test_port'] ) ) { self::debug( '✅ Use tested local port: ' . $this->_summary['test_port'] ); define( 'LITESPEED_CRAWLER_LOCAL_PORT', (int) $this->_summary['test_port'] ); return true; } return false; } $this->_summary['test_port_tts'] = time(); self::save_summary(); $options = $this->_get_curl_options(); $home = home_url(); File::save( LITESPEED_STATIC_DIR . '/crawler/test_port.html', $home, true ); $url = LITESPEED_STATIC_URL . '/crawler/test_port.html'; $parsed_url = wp_parse_url( $url ); if ( empty( $parsed_url['host'] ) ) { self::debug( '❌ Test port failed, invalid URL: ' . $url ); return false; } $resolved = $parsed_url['host'] . ':443:' . $this->_server_ip; $options[ CURLOPT_RESOLVE ] = [ $resolved ]; $options[ CURLOPT_DNS_USE_GLOBAL_CACHE ] = false; $options[ CURLOPT_HEADER ] = false; self::debug( 'Test local 443 port for ' . $resolved ); // cURL is intentionally used for speed; suppress sniffs in this method. // phpcs:disable WordPress.WP.AlternativeFunctions $ch = curl_init(); curl_setopt_array( $ch, $options ); curl_setopt( $ch, CURLOPT_URL, $url ); $result = curl_exec( $ch ); $test_result = false; if ( curl_errno( $ch ) || $result !== $home ) { if ( curl_errno( $ch ) ) { self::debug( '❌ Test port curl error: [errNo] ' . curl_errno( $ch ) . ' [err] ' . curl_error( $ch ) ); } elseif ( $result !== $home ) { self::debug( '❌ Test port response is wrong: ' . $result ); } self::debug( '❌ Test local 443 port failed, try port 80' ); // Try port 80. $resolved = $parsed_url['host'] . ':80:' . $this->_server_ip; $options[ CURLOPT_RESOLVE ] = [ $resolved ]; $url = str_replace( 'https://', 'http://', $url ); if ( empty( $options[ CURLOPT_HTTPHEADER ] ) || ! in_array( 'X-Forwarded-Proto: https', $options[ CURLOPT_HTTPHEADER ], true ) ) { $options[ CURLOPT_HTTPHEADER ][] = 'X-Forwarded-Proto: https'; } $ch = curl_init(); curl_setopt_array( $ch, $options ); curl_setopt( $ch, CURLOPT_URL, $url ); $result = curl_exec( $ch ); if ( curl_errno( $ch ) ) { self::debug( '❌ Test port curl error: [errNo] ' . curl_errno( $ch ) . ' [err] ' . curl_error( $ch ) ); } elseif ( $result !== $home ) { self::debug( '❌ Test port response is wrong: ' . $result ); } else { self::debug( '✅ Test local 80 port successfully' ); define( 'LITESPEED_CRAWLER_LOCAL_PORT', 80 ); $this->_summary['test_port'] = 80; $test_result = true; } } else { self::debug( '✅ Tested local 443 port successfully' ); define( 'LITESPEED_CRAWLER_LOCAL_PORT', 443 ); $this->_summary['test_port'] = 443; $test_result = true; } self::save_summary(); curl_close( $ch ); // phpcs:enable return $test_result; } /** * Run crawler. * * @since 1.1.0 * @access private * @return void * @throws \Exception When lane becomes invalid during run. */ private function _do_running() { $options = $this->_get_curl_options( true ); // If is role simulator and not defined local port, check port once. $test_result = $this->_test_port(); if ( ! $test_result ) { $this->_end_reason = 'port_test_failed'; self::debug( '❌ Test port failed, crawler stopped.' ); return; } while ( true ) { $url_chunks = $this->cls( 'Crawler_Map' )->list_map( self::CHUNKS, $this->_summary['last_pos'] ); if ( empty( $url_chunks ) ) { break; } $url_chunks = array_chunk( $url_chunks, (int) $this->_cur_threads ); foreach ( $url_chunks as $rows ) { if ( ! $this->_check_valid_lane( true ) ) { $this->_end_reason = 'lane_invalid'; self::debug( '🛑 The crawler lane is used by newer crawler.' ); throw new \Exception( 'invalid crawler lane' ); } // Update time. $this->_touch_lane(); // multi curl. $rets = $this->_multi_request( $rows, $options ); // check result headers. foreach ( $rows as $row ) { if ( empty( $rets[ $row['id'] ] ) ) { continue; } if ( 428 === (int) $rets[ $row['id'] ]['code'] ) { // HTTP/1.1 428 Precondition Required (need to test) $this->_end_reason = 'crawler_disabled'; self::debug( 'crawler_disabled' ); return; } $status = $this->_status_parse( $rets[ $row['id'] ]['header'], $rets[ $row['id'] ]['code'], $row['url'] ); // B or H or M or N(nocache). self::debug( '[status] ' . $this->_status2title( $status ) . "\t\t [url] " . $row['url'] ); $this->_map_status_list[ $status ][ $row['id'] ] = [ 'url' => $row['url'], 'code' => (int) $rets[ $row['id'] ]['code'], // 201 or 200 or 404. ]; if ( empty( $this->_summary['crawler_stats'][ $this->_summary['curr_crawler'] ][ $status ] ) ) { $this->_summary['crawler_stats'][ $this->_summary['curr_crawler'] ][ $status ] = 0; } ++$this->_summary['crawler_stats'][ $this->_summary['curr_crawler'] ][ $status ]; } // update offset position. $_time = time(); $this->_summary['last_count'] = count( $rows ); $this->_summary['last_pos'] += $this->_summary['last_count']; $this->_summary['last_crawled'] += $this->_summary['last_count']; $this->_summary['last_update_time'] = $_time; $this->_summary['last_status'] = 'updated position'; // check duration. if ( $this->_summary['last_update_time'] > $this->_max_run_time ) { $this->_end_reason = 'stopped_maxtime'; self::debug( 'Terminated due to maxtime' ); return; } // make sure at least each 10s save meta & map status once. if ( $_time - $this->_summary['meta_save_time'] > 10 ) { $this->_map_status_list = $this->cls( 'Crawler_Map' )->save_map_status( $this->_map_status_list, $this->_summary['curr_crawler'] ); self::save_summary(); } // check if need to reset pos each 5s. if ( $_time > $this->_summary['pos_reset_check'] ) { $this->_summary['pos_reset_check'] = $_time + 5; if ( file_exists( $this->_resetfile ) && unlink( $this->_resetfile ) ) { // phpcs:ignore WordPress.WP.AlternativeFunctions.unlink_unlink self::debug( 'Terminated due to reset file' ); $this->_summary['last_pos'] = 0; $this->_summary['curr_crawler'] = 0; $this->_summary['crawler_stats'][ $this->_summary['curr_crawler'] ] = []; // reset done status. $this->_summary['done'] = 0; $this->_summary['this_full_beginning_time'] = 0; $this->_end_reason = 'stopped_reset'; return; } } // check loads. if ( ( $this->_summary['last_update_time'] - $this->_cur_thread_time ) > 60 ) { $this->_adjust_current_threads(); if ( 0 === (int) $this->_cur_threads ) { $this->_end_reason = 'stopped_highload'; self::debug( '🛑 Terminated due to highload' ); return; } } $this->_summary['last_status'] = 'sleeping ' . (int) $this->_crawler_conf['run_delay'] . 'ms'; usleep( (int) $this->_crawler_conf['run_delay'] ); } } // All URLs are done for current crawler. $this->_end_reason = 'end'; $this->_summary['crawler_stats'][ $this->_summary['curr_crawler'] ]['W'] = 0; self::debug( 'Crawler #' . $this->_summary['curr_crawler'] . ' touched end' ); } /** * If need to resolve DNS or not. * * @since 7.3.0.1 * @return bool */ private function _should_force_resolve_dns() { if ( ! empty( $this->_server_ip ) ) { return true; } if ( ! empty( $this->_crawler_conf['cookies'] ) && ! empty( $this->_crawler_conf['cookies']['litespeed_hash'] ) ) { return true; } return false; } /** * Send multi curl requests. * If res=B/N, bypass request and won't return. * * @since 1.1.0 * @access private * * @param array<int,array<string,mixed>> $rows Rows to crawl. * @param array $options cURL options. * @return array<int,array{header:string,code:int}> */ private function _multi_request( $rows, $options ) { if ( ! function_exists( 'curl_multi_init' ) ) { exit( 'curl_multi_init disabled' ); } // phpcs:disable WordPress.WP.AlternativeFunctions $mh = curl_multi_init(); $crawler_drop_domain = defined( 'LITESPEED_CRAWLER_DROP_DOMAIN' ) ? (bool) constant( 'LITESPEED_CRAWLER_DROP_DOMAIN' ) : false; $curls = []; foreach ( $rows as $row ) { if ( self::STATUS_BLACKLIST === substr( $row['res'], $this->_summary['curr_crawler'], 1 ) ) { continue; } if ( self::STATUS_NOCACHE === substr( $row['res'], $this->_summary['curr_crawler'], 1 ) ) { continue; } if (!function_exists('curl_init')) { exit('curl_init disabled'); } $curls[$row['id']] = curl_init(); // Append URL. $url = $row['url']; if ( $crawler_drop_domain ) { $url = $this->_crawler_conf['base'] . $row['url']; } // IP resolve. if ( $this->_should_force_resolve_dns() ) { $parsed_url = wp_parse_url( $url ); if ( ! empty( $parsed_url['host'] ) ) { $dom = $parsed_url['host']; $port = defined( 'LITESPEED_CRAWLER_LOCAL_PORT' ) ? (int) LITESPEED_CRAWLER_LOCAL_PORT : 443; $resolved = $dom . ':' . $port . ':' . $this->_server_ip; $options[ CURLOPT_RESOLVE ] = [ $resolved ]; $options[ CURLOPT_DNS_USE_GLOBAL_CACHE ] = false; if ( 80 === $port ) { $url = str_replace( 'https://', 'http://', $url ); if ( empty( $options[ CURLOPT_HTTPHEADER ] ) || ! in_array( 'X-Forwarded-Proto: https', $options[ CURLOPT_HTTPHEADER ], true ) ) { $options[ CURLOPT_HTTPHEADER ][] = 'X-Forwarded-Proto: https'; } } self::debug( 'Resolved DNS for ' . $resolved ); } } curl_setopt( $curls[ $row['id'] ], CURLOPT_URL, $url ); self::debug( 'Crawling [url] ' . $url . ( $url === $row['url'] ? '' : ' [ori] ' . $row['url'] ) ); curl_setopt_array( $curls[ $row['id'] ], $options ); curl_multi_add_handle( $mh, $curls[ $row['id'] ] ); } // execute curl. if ( $curls ) { do { $status = curl_multi_exec( $mh, $active ); if ( $active ) { curl_multi_select( $mh ); } } while ( $active && CURLM_OK === $status ); } // curl done. $ret = []; foreach ( $rows as $row ) { if ( self::STATUS_BLACKLIST === substr( $row['res'], $this->_summary['curr_crawler'], 1 ) ) { continue; } if ( self::STATUS_NOCACHE === substr( $row['res'], $this->_summary['curr_crawler'], 1 ) ) { continue; } $ch = $curls[ $row['id'] ]; // Parse header. $header_size = curl_getinfo( $ch, CURLINFO_HEADER_SIZE ); $content = curl_multi_getcontent( $ch ); $header = substr( $content, 0, $header_size ); $ret[ $row['id'] ] = [ 'header' => $header, 'code' => (int) curl_getinfo( $ch, CURLINFO_HTTP_CODE ), ]; curl_multi_remove_handle( $mh, $ch ); curl_close( $ch ); } curl_multi_close( $mh ); // phpcs:enable return $ret; } /** * Translate the status to title. * * @since 6.0 * @param string $status Status char. * @return string Human title. */ private function _status2title( $status ) { if ( self::STATUS_HIT === $status ) { return '✅ Hit'; } if ( self::STATUS_MISS === $status ) { return '😊 Miss'; } if ( self::STATUS_BLACKLIST === $status ) { return '😅 Blacklisted'; } if ( self::STATUS_NOCACHE === $status ) { return '😅 Blacklisted'; } return '🛸 Unknown'; } /** * Check returned curl header to find if cached or not. * * @since 2.0 * @access private * * @param string $header Response header. * @param int $code HTTP code. * @param string $url URL. * @return string One of status chars. */ private function _status_parse( $header, $code, $url ) { if ( 201 === (int) $code ) { return self::STATUS_HIT; } if ( false !== stripos( $header, 'X-Litespeed-Cache-Control: no-cache' ) ) { // If is from DIVI, taken as miss. if ( defined( 'LITESPEED_CRAWLER_IGNORE_NONCACHEABLE' ) && constant( 'LITESPEED_CRAWLER_IGNORE_NONCACHEABLE' ) ) { return self::STATUS_MISS; } // If blacklist is disabled. if ( ( defined( 'LITESPEED_CRAWLER_DISABLE_BLOCKLIST' ) && constant( 'LITESPEED_CRAWLER_DISABLE_BLOCKLIST' ) ) || apply_filters( 'litespeed_crawler_disable_blocklist', false, $url ) ) { return self::STATUS_MISS; } return self::STATUS_NOCACHE; // Blacklist. } $_cache_headers = [ 'x-litespeed-cache', 'x-qc-cache', 'x-lsadc-cache' ]; foreach ( $_cache_headers as $_header ) { if ( false !== stripos( $header, $_header ) ) { if ( false !== stripos( $header, $_header . ': bkn' ) ) { return self::STATUS_HIT; // Hit. } if ( false !== stripos( $header, $_header . ': miss' ) ) { return self::STATUS_MISS; // Miss. } return self::STATUS_HIT; // Hit. } } // If blacklist is disabled. if ( ( defined( 'LITESPEED_CRAWLER_DISABLE_BLOCKLIST' ) && constant( 'LITESPEED_CRAWLER_DISABLE_BLOCKLIST' ) ) || apply_filters( 'litespeed_crawler_disable_blocklist', false, $url ) ) { return self::STATUS_MISS; } return self::STATUS_BLACKLIST; // Blacklist. } /** * Get curl options. * * @since 1.1.0 * @access private * * @param bool $crawler_only Whether crawler-only UA. * @return array */ private function _get_curl_options( $crawler_only = false ) { $crawler_timeout = defined( 'LITESPEED_CRAWLER_TIMEOUT' ) ? (int) constant( 'LITESPEED_CRAWLER_TIMEOUT' ) : 30; $options = [ CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => true, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_FOLLOWLOCATION => false, CURLOPT_ENCODING => 'gzip', CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_TIMEOUT => $crawler_timeout, // Larger timeout to avoid incorrect blacklist addition #900171. CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_NOBODY => false, CURLOPT_HTTPHEADER => $this->_crawler_conf['headers'], ]; $options[ CURLOPT_HTTPHEADER ][] = 'Cache-Control: max-age=0'; $options[ CURLOPT_HTTP_VERSION ] = CURL_HTTP_VERSION_1_1; // if is walker // $options[ CURLOPT_FRESH_CONNECT ] = true; // Referer. if ( isset( $_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI'] ) ) { $host = sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ); $uri = sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ); $options[ CURLOPT_REFERER ] = 'http://' . $host . $uri; } // User Agent. if ( $crawler_only ) { if ( 0 !== strpos( (string) $this->_crawler_conf['ua'], self::FAST_USER_AGENT ) ) { $this->_crawler_conf['ua'] = self::FAST_USER_AGENT . ' ' . (string) $this->_crawler_conf['ua']; } } $options[ CURLOPT_USERAGENT ] = (string) $this->_crawler_conf['ua']; // Cookies. $cookies = []; foreach ( $this->_crawler_conf['cookies'] as $k => $v ) { if ( ! $v ) { continue; } $cookies[] = $k . '=' . rawurlencode( $v ); } if ( $cookies ) { $options[ CURLOPT_COOKIE ] = implode( '; ', $cookies ); } return $options; } /** * Self curl to get HTML content. * * @since 3.3 * * @param string $url URL. * @param string $ua User agent. * @param int|false $uid Optional user ID for simulation. * @param string|false $accept Optional Accept header value. * @return string|false HTML on success, false on failure. */ public function self_curl( $url, $ua, $uid = false, $accept = false ) { $this->_crawler_conf['base'] = site_url(); $this->_crawler_conf['ua'] = $ua; if ( $accept ) { $this->_crawler_conf['headers'] = [ 'Accept: ' . $accept ]; } $options = $this->_get_curl_options(); if ( $uid ) { $this->_crawler_conf['cookies']['litespeed_flash_hash'] = Router::cls()->get_flash_hash( $uid ); $parsed_url = wp_parse_url( $url ); if ( ! empty( $parsed_url['host'] ) ) { $dom = $parsed_url['host']; $port = defined( 'LITESPEED_CRAWLER_LOCAL_PORT' ) ? (int) LITESPEED_CRAWLER_LOCAL_PORT : 443; $resolved = $dom . ':' . $port . ':' . $this->_server_ip; $options[ CURLOPT_RESOLVE ] = [ $resolved ]; $options[ CURLOPT_DNS_USE_GLOBAL_CACHE ] = false; $options[ CURLOPT_PORT ] = $port; self::debug( 'Resolved DNS for ' . $resolved ); } } $options[ CURLOPT_HEADER ] = false; $options[ CURLOPT_FOLLOWLOCATION ] = true; // phpcs:disable WordPress.WP.AlternativeFunctions $ch = curl_init(); curl_setopt_array( $ch, $options ); curl_setopt( $ch, CURLOPT_URL, $url ); $result = curl_exec( $ch ); $code = (int) curl_getinfo( $ch, CURLINFO_HTTP_CODE ); curl_close( $ch ); // phpcs:enable if ( 200 !== $code ) { self::debug( '❌ Response code is not 200 in self_curl() [code] ' . $code ); return false; } return $result; } /** * Terminate crawling. * * @since 1.1.0 * @access private * @return void */ private function _terminate_running() { $this->_map_status_list = $this->cls( 'Crawler_Map' )->save_map_status( $this->_map_status_list, $this->_summary['curr_crawler'] ); if ( 'end' === $this->_end_reason ) { $this->_summary['curr_crawler'] = (int) $this->_summary['curr_crawler'] + 1; // Jump to next crawler. $this->_summary['last_pos'] = 0; // reset last position. $this->_summary['last_crawler_total_cost'] = time() - (int) $this->_summary['curr_crawler_beginning_time']; $count_crawlers = count( $this->list_crawlers() ); if ( $this->_summary['curr_crawler'] >= $count_crawlers ) { self::debug( '_terminate_running Touched end, whole crawled. Reload crawler!' ); $this->_summary['curr_crawler'] = 0; $this->_summary['done'] = 'touchedEnd'; // log done status. $this->_summary['last_full_time_cost'] = time() - (int) $this->_summary['this_full_beginning_time']; } } $this->_summary['last_status'] = 'stopped'; $this->_summary['is_running'] = 0; $this->_summary['end_reason'] = $this->_end_reason; self::save_summary(); } /** * List all crawlers ( tagA => [ valueA => titleA, ... ] ... ). * * @since 1.9.1 * @access public * @return array<int,array<string,mixed>> */ public function list_crawlers() { if ( $this->_crawlers ) { return $this->_crawlers; } $crawler_factors = []; // Add default Guest crawler. $crawler_factors['uid'] = [ 0 => __( 'Guest', 'litespeed-cache' ) ]; // WebP on/off. if ( $this->conf( Base::O_IMG_OPTM_WEBP ) ) { $crawler_factors['webp'] = [ 1 => $this->cls( 'Media' )->next_gen_image_title() ]; if ( apply_filters( 'litespeed_crawler_webp', false ) ) { $crawler_factors['webp'][0] = ''; } } // Guest Mode on/off. if ( $this->conf( Base::O_GUEST ) ) { $vary_name = $this->cls( 'Vary' )->get_vary_name(); $vary_val = 'guest_mode:1'; if ( ! defined( 'LSCWP_LOG' ) ) { $vary_val = md5( $this->conf( Base::HASH ) . $vary_val ); } $crawler_factors[ 'cookie:' . $vary_name ] = [ $vary_val => '', '_null' => '<font data-balloon-pos="up" aria-label="Guest Mode">👒</font>', ]; } // Mobile crawler. if ( $this->conf( Base::O_CACHE_MOBILE ) ) { $crawler_factors['mobile'] = [ 1 => '<font data-balloon-pos="up" aria-label="Mobile">📱</font>', 0 => '', ]; } // Get roles set. foreach ( $this->conf( Base::O_CRAWLER_ROLES ) as $v ) { $role_title = ''; $udata = get_userdata( $v ); if ( isset( $udata->roles ) && is_array( $udata->roles ) ) { $tmp = array_values( $udata->roles ); $role_title = array_shift( $tmp ); } if ( ! $role_title ) { continue; } $crawler_factors['uid'][ $v ] = ucfirst( $role_title ); } // Cookie crawler. foreach ( $this->conf( Base::O_CRAWLER_COOKIES ) as $v ) { if ( empty( $v['name'] ) ) { continue; } $this_cookie_key = 'cookie:' . $v['name']; $crawler_factors[ $this_cookie_key ] = []; foreach ( $v['vals'] as $v2 ) { $crawler_factors[ $this_cookie_key ][ $v2 ] = ( '_null' === $v2 ? '' : '<font data-balloon-pos="up" aria-label="Cookie">🍪</font>' . esc_html( $v['name'] ) . '=' . esc_html( $v2 ) ); } } // Crossing generate the crawler list. $this->_crawlers = $this->_recursive_build_crawler( $crawler_factors ); return $this->_crawlers; } /** * Build a crawler list recursively. * * @since 2.8 * @access private * * @param array<string,array> $crawler_factors Factors. * @param array $group Current group. * @param int $i Factor index. * @return array<int,array> */ private function _recursive_build_crawler( $crawler_factors, $group = [], $i = 0 ) { $current_factor_keys = array_keys( $crawler_factors ); $current_factor = $current_factor_keys[ $i ]; $if_touch_end = ( $i + 1 ) >= count( $crawler_factors ); $final_list = []; foreach ( $crawler_factors[ $current_factor ] as $k => $v ) { $item = $group; // Don't alter $group bcos of loop usage. $item['title'] = ! empty( $group['title'] ) ? $group['title'] : ''; if ( $v ) { if ( $item['title'] ) { $item['title'] .= ' - '; } $item['title'] .= $v; } $item[ $current_factor ] = $k; if ( $if_touch_end ) { $final_list[] = $item; } else { // Inception: next layer. $final_list = array_merge( $final_list, $this->_recursive_build_crawler( $crawler_factors, $item, $i + 1 ) ); } } return $final_list; } /** * Return crawler meta file local path. * * @since 6.1 * @access public * @return string */ public function json_local_path() { return LITESPEED_STATIC_DIR . '/crawler/' . $this->_sitemeta; } /** * Return crawler meta file URL. * * @since 1.1.0 * @access public * @return string|false */ public function json_path() { if ( ! file_exists( LITESPEED_STATIC_DIR . '/crawler/' . $this->_sitemeta ) ) { return false; } return LITESPEED_STATIC_URL . '/crawler/' . $this->_sitemeta; } /** * Create reset pos file. * * @since 1.1.0 * @access public * @return void */ public function reset_pos() { File::save( $this->_resetfile, time(), true ); self::save_summary( [ 'is_running' => 0 ] ); } /** * Display status based by matching crawlers order. * * @since 3.0 * @access public * * @param string $status_row Status string. * @param string $reason_set Comma separated reasons. * @return string HTML dots. */ public function display_status( $status_row, $reason_set ) { if ( ! $status_row ) { return ''; } $_status_list = [ '-' => 'default', self::STATUS_MISS => 'primary', self::STATUS_HIT => 'success', self::STATUS_BLACKLIST => 'danger', self::STATUS_NOCACHE => 'warning', ]; $reason_set = explode( ',', $reason_set ); $status = ''; foreach ( str_split( $status_row ) as $k => $v ) { $reason = isset( $reason_set[ $k ] ) ? $reason_set[ $k ] : ''; if ( 'Man' === $reason ) { $reason = __( 'Manually added to blocklist', 'litespeed-cache' ); } if ( 'Existed' === $reason ) { $reason = __( 'Previously existed in blocklist', 'litespeed-cache' ); } $reason_attr = $reason ? 'data-balloon-pos="up" aria-label="' . esc_attr( $reason ) . '"' : ''; $status .= '<i class="litespeed-dot litespeed-bg-' . esc_attr( $_status_list[ $v ] ) . '" ' . $reason_attr . '>' . ( $k + 1 ) . '</i>'; } return $status; } /** * Handle all request actions from main cls. * * @since 3.0 * @access public * @return void */ public function handler() { $type = Router::verify_type(); switch ( $type ) { case self::TYPE_REFRESH_MAP: $this->cls( 'Crawler_Map' )->gen( true ); break; case self::TYPE_EMPTY: $this->cls( 'Crawler_Map' )->empty_map(); break; case self::TYPE_BLACKLIST_EMPTY: $this->cls( 'Crawler_Map' )->blacklist_empty(); break; case self::TYPE_BLACKLIST_DEL: // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized if (!empty($_GET['id'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended $id = absint( wp_unslash( $_GET['id'] ) ); $this->cls( 'Crawler_Map' )->blacklist_del( $id ); } break; case self::TYPE_BLACKLIST_ADD: // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized if (!empty($_GET['id'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended $id = absint( wp_unslash( $_GET['id'] ) ); $this->cls( 'Crawler_Map' )->blacklist_add( $id ); } break; case self::TYPE_START: // Handle the ajax request to proceed crawler manually by admin. self::start_async(); break; case self::TYPE_RESET: $this->reset_pos(); break; default: break; } Admin::redirect(); } } src/health.cls.php 0000777 00000005523 15251157102 0010104 0 ustar 00 <?php // phpcs:ignoreFile /** * The page health * * @since 3.0 * @package LiteSpeed */ namespace LiteSpeed; defined('WPINC') || exit(); class Health extends Base { const TYPE_SPEED = 'speed'; const TYPE_SCORE = 'score'; protected $_summary; /** * Init * * @since 3.0 */ public function __construct() { $this->_summary = self::get_summary(); } /** * Test latest speed * * @since 3.0 */ private function _ping( $type ) { $data = array( 'action' => $type ); $json = Cloud::post(Cloud::SVC_HEALTH, $data, 600); if (empty($json['data']['before']) || empty($json['data']['after'])) { Debug2::debug('[Health] ❌ no data'); return false; } $this->_summary[$type . '.before'] = $json['data']['before']; $this->_summary[$type . '.after'] = $json['data']['after']; self::save_summary(); Debug2::debug('[Health] saved result'); } /** * Generate scores * * @since 3.0 */ public function scores() { $speed_before = $speed_after = $speed_improved = 0; if (!empty($this->_summary['speed.before']) && !empty($this->_summary['speed.after'])) { // Format loading time $speed_before = $this->_summary['speed.before'] / 1000; if ($speed_before < 0.01) { $speed_before = 0.01; } $speed_before = number_format($speed_before, 2); $speed_after = $this->_summary['speed.after'] / 1000; if ($speed_after < 0.01) { $speed_after = number_format($speed_after, 3); } else { $speed_after = number_format($speed_after, 2); } $speed_improved = (($this->_summary['speed.before'] - $this->_summary['speed.after']) * 100) / $this->_summary['speed.before']; if ($speed_improved > 99) { $speed_improved = number_format($speed_improved, 2); } else { $speed_improved = number_format($speed_improved); } } $score_before = $score_after = $score_improved = 0; if (!empty($this->_summary['score.before']) && !empty($this->_summary['score.after'])) { $score_before = $this->_summary['score.before']; $score_after = $this->_summary['score.after']; // Format Score $score_improved = (($score_after - $score_before) * 100) / $score_after; if ($score_improved > 99) { $score_improved = number_format($score_improved, 2); } else { $score_improved = number_format($score_improved); } } return array( 'speed_before' => $speed_before, 'speed_after' => $speed_after, 'speed_improved' => $speed_improved, 'score_before' => $score_before, 'score_after' => $score_after, 'score_improved' => $score_improved, ); } /** * Handle all request actions from main cls * * @since 3.0 * @access public */ public function handler() { $type = Router::verify_type(); switch ($type) { case self::TYPE_SPEED: case self::TYPE_SCORE: $this->_ping($type); break; default: break; } Admin::redirect(); } } thirdparty/wc-pdf-product-vouchers.cls.php 0000777 00000001740 15251157102 0014731 0 ustar 00 <?php /** * The Third Party integration with WooCommerce PDF Product Vouchers. * * @since 5.1.0 * @package LiteSpeed * @subpackage LiteSpeed_Cache\Thirdparty */ namespace LiteSpeed\Thirdparty; defined('WPINC') || exit(); /** * Provides compatibility for WooCommerce PDF Product Vouchers. */ class WC_PDF_Product_Vouchers { /** * Disable caching for generated vouchers. * * @since 5.1.0 * @access public * @return void */ public static function detect() { if (!class_exists('\WC_PDF_Product_Vouchers_Loader')) { return; } // phpcs:ignore WordPress.Security.NonceVerification.Recommended $is_voucher = !empty($_GET['post_type']) && 'wc_voucher' === sanitize_text_field(wp_unslash($_GET['post_type'])); // phpcs:ignore WordPress.Security.NonceVerification.Recommended $has_key = !empty($_GET['voucher_key']) || !empty($_GET['key']); if ($is_voucher && $has_key) { do_action('litespeed_control_set_nocache', '3rd WC PDF Product Voucher'); } } } thirdparty/yith-wishlist.cls.php 0000777 00000012356 15251157102 0013065 0 ustar 00 <?php /** * The Third Party integration with the YITH WooCommerce Wishlist plugin. * * Hooks YITH Wishlist UI into LiteSpeed ESI and purges appropriately. * * @since 1.1.0 * @package LiteSpeed */ namespace LiteSpeed\Thirdparty; defined( 'WPINC' ) || exit(); use LiteSpeed\Tag; use LiteSpeed\Conf; use LiteSpeed\Base; /** * YITH WooCommerce Wishlist integration for LiteSpeed Cache. */ class Yith_Wishlist { const ESI_PARAM_POSTID = 'yith_pid'; /** * Current product ID captured for ESI rendering. * * @var int */ private static $_post_id; /** * Detects if YITH WooCommerce Wishlist and WooCommerce are installed. * * @since 1.1.0 * @return void */ public static function detect() { if ( ! defined( 'WOOCOMMERCE_VERSION' ) || ! defined( 'YITH_WCWL' ) ) { return; } if ( apply_filters( 'litespeed_esi_status', false ) ) { add_action( 'litespeed_tpl_normal', __CLASS__ . '::is_not_esi' ); add_action( 'litespeed_esi_load-yith_wcwl_add', __CLASS__ . '::load_add_to_wishlist' ); add_filter( 'litespeed_esi_inline-yith_wcwl_add', __CLASS__ . '::inline_add_to_wishlist', 20, 2 ); // Hook to add/delete wishlist. add_action( 'yith_wcwl_added_to_wishlist', __CLASS__ . '::purge' ); add_action( 'yith_wcwl_removed_from_wishlist', __CLASS__ . '::purge' ); } } /** * Purge ESI YITH cache when add/remove items. * * @since 1.2.0 * @return void */ public static function purge() { do_action( 'litespeed_purge_esi', 'yith_wcwl_add' ); } /** * Hooked to the litespeed_is_not_esi_template action. * * If the request is not an ESI request, hook to the add to wishlist button * filter to replace it as an ESI block. * * @since 1.1.0 * @return void */ public static function is_not_esi() { add_filter( 'yith_wcwl_add_to_wishlist_params', __CLASS__ . '::add_to_wishlist_params', 999, 2 ); add_filter( 'yith_wcwl_add_to_wishlisth_button_html', __CLASS__ . '::sub_add_to_wishlist', 999 ); } /** * Store the post id for later shortcode usage. * * @since 3.4.1 * * @param array $defaults Default parameters provided by YITH. * @param array $atts Shortcode attributes for add-to-wishlist. * @return array Unmodified defaults. */ public static function add_to_wishlist_params( $defaults, $atts ) { self::$_post_id = ! empty( $atts['product_id'] ) ? (int) $atts['product_id'] : (int) $defaults['product_id']; return $defaults; } /** * Replace the native button HTML with an ESI block. * * The add to wishlist button displays a different output when the item is already * in the wishlist/cart. For this reason, the button must be an ESI block. * * @since 1.1.0 * * @param string $template Original button HTML. * @return string ESI URL placeholder for rendering. */ public static function sub_add_to_wishlist( $template ) { $params = [ self::ESI_PARAM_POSTID => self::$_post_id, ]; $inline_tags = [ '', rtrim( Tag::TYPE_ESI, '.' ), Tag::TYPE_ESI . 'yith_wcwl_add' ]; $inline_tags = implode( ',', array_map( function ( $val ) { return 'public:' . LSWCP_TAG_PREFIX . '_' . $val; }, $inline_tags ) ); $inline_tags .= ',' . LSWCP_TAG_PREFIX . '_tag_priv'; do_action( 'litespeed_esi_combine', 'yith_wcwl_add' ); $inline_params = [ 'val' => $template, 'tag' => $inline_tags, 'control' => 'private,no-vary,max-age=' . Conf::cls()->conf( Base::O_CACHE_TTL_PRIV ), ]; return apply_filters( 'litespeed_esi_url', 'yith_wcwl_add', 'YITH ADD TO WISHLIST', $params, 'private,no-vary', false, false, false, $inline_params ); } /** * Load the add to wishlist button HTML for ESI output. * * @since 1.1.0 * * @param array $params ESI parameters, expects product id under ESI_PARAM_POSTID. * @return void */ public static function load_add_to_wishlist( $params ) { $pid = isset( $params[ self::ESI_PARAM_POSTID ] ) ? (int) $params[ self::ESI_PARAM_POSTID ] : 0; // Output the rendered shortcode safely. // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- wp_kses_post handles allowed HTML. echo wp_kses_post( \YITH_WCWL_Shortcode::add_to_wishlist( [ 'product_id' => $pid ] ) ); do_action( 'litespeed_control_set_private', 'yith wishlist' ); do_action( 'litespeed_vary_no' ); } /** * Generate ESI inline value. * * @since 3.4.2 * * @param mixed $res Current response (array or anything); will be normalized to array. * @param array $params ESI parameters that include product id. * @return array Inline ESI payload with value, control and tags. */ public static function inline_add_to_wishlist( $res, $params ) { if ( ! is_array( $res ) ) { $res = []; } $pid = isset( $params[ self::ESI_PARAM_POSTID ] ) ? (int) $params[ self::ESI_PARAM_POSTID ] : 0; $res['val'] = \YITH_WCWL_Shortcode::add_to_wishlist( [ 'product_id' => $pid ] ); $res['control'] = 'private,no-vary,max-age=' . Conf::cls()->conf( Base::O_CACHE_TTL_PRIV ); $inline_tags = [ '', rtrim( Tag::TYPE_ESI, '.' ), Tag::TYPE_ESI . 'yith_wcwl_add' ]; $inline_tags = implode( ',', array_map( function ( $val ) { return 'public:' . LSWCP_TAG_PREFIX . '_' . $val; }, $inline_tags ) ); $inline_tags .= ',' . LSWCP_TAG_PREFIX . '_tag_priv'; $res['tag'] = $inline_tags; return $res; } } thirdparty/caldera-forms.cls.php 0000777 00000001446 15251157102 0012761 0 ustar 00 <?php /** * The Third Party integration with Caldera Forms. * * @since 3.2.2 * @package LiteSpeed * @subpackage LiteSpeed_Cache/thirdparty */ namespace LiteSpeed\Thirdparty; defined('WPINC') || exit(); /** * Integration with Caldera Forms to ensure proper nonce handling for cached pages. */ class Caldera_Forms { /** * Detects if Caldera Forms is active and registers nonces accordingly. * * Hooks the plugin's frontend nonce pattern into LiteSpeed so cached pages * still validate form submissions. * * @since 3.2.2 * @return void */ public static function detect() { if (!defined('CFCORE_VER')) { return; } // plugins/caldera-forms/classes/render/nonce.php -> class Caldera_Forms_Render_Nonce do_action('litespeed_nonce', 'caldera_forms_front_*'); } } thirdparty/theme-my-login.cls.php 0000777 00000002012 15251157102 0013063 0 ustar 00 <?php /** * The Third Party integration with the Theme My Login plugin. * * @since 1.0.15 * @package LiteSpeed * @subpackage LiteSpeed_Cache\Thirdparty */ namespace LiteSpeed\Thirdparty; defined('WPINC') || exit(); /** * Provides compatibility for the Theme My Login plugin. */ class Theme_My_Login { /** * Detects if Better Theme My Login is active. * * @since 1.0.15 * @access public * @return void */ public static function detect() { if (defined('THEME_MY_LOGIN_PATH')) { add_action('litespeed_control_finalize', __CLASS__ . '::set_control'); } } /** * This filter is used to let the cache know if a page is cacheable. * * @since 1.0.15 * @access public * @return void */ public static function set_control() { if (!apply_filters('litespeed_control_cacheable', false)) { return; } // Check if this page is TML page or not. if (class_exists('Theme_My_Login') && \Theme_My_Login::is_tml_page()) { do_action('litespeed_control_set_nocache', 'Theme My Login'); } } } thirdparty/perfmatters.cls.php 0000777 00000001744 15251157102 0012577 0 ustar 00 <?php /** * The Third Party integration with the Perfmatters plugin. * * @since 4.4.5 * @package LiteSpeed * @subpackage LiteSpeed_Cache\Thirdparty */ namespace LiteSpeed\Thirdparty; defined('WPINC') || exit(); /** * Provides compatibility for the Perfmatters plugin. */ class Perfmatters { /** * Preload Perfmatters integration. * * @since 4.4.5 * @return void */ public static function preload() { if (!defined('PERFMATTERS_VERSION')) { return; } if (is_admin()) { return; } if (has_action('shutdown', 'perfmatters_script_manager') !== false) { add_action('init', __CLASS__ . '::disable_litespeed_esi', 4); } } /** * Disable LiteSpeed ESI when Perfmatters Script Manager is active. * * @since 4.4.5 * @return void */ public static function disable_litespeed_esi() { if (!defined('LITESPEED_ESI_OFF')) { define('LITESPEED_ESI_OFF', true); } do_action('litespeed_debug', 'Disable ESI due to Perfmatters script manager'); } } thirdparty/woocommerce.content.tpl.php 0000777 00000007637 15251157102 0014260 0 ustar 00 <?php /** * LiteSpeed Cache – WooCommerce settings template. * * Renders the WooCommerce integration settings within the LiteSpeed Cache admin. * * @package LiteSpeed\Thirdparty */ namespace LiteSpeed\Thirdparty; defined( 'WPINC' ) || exit; use LiteSpeed\Doc; ?> <div data-litespeed-layout="woocommerce"> <h3 class="litespeed-title-short"> <?php esc_html_e( 'WooCommerce Settings', 'litespeed-cache' ); ?> <?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#woocommerce-tab' ); ?> </h3> <div class="litespeed-callout notice notice-warning inline"> <h4><?php esc_html_e( 'NOTICE:', 'litespeed-cache' ); ?></h4> <p><?php esc_html_e( 'After verifying that the cache works in general, please test the cart.', 'litespeed-cache' ); ?></p> <p> <?php printf( /* translators: %s: link attributes */ esc_html__( 'To test the cart, visit the %sFAQ%s.', 'litespeed-cache' ), '<a href="https://docs.litespeedtech.com/lscache/lscwp/installation/#non-cacheable-pages" target="_blank">', '</a>' ); ?> </p> <p><?php esc_html_e( 'By default, the My Account, Checkout, and Cart pages are automatically excluded from caching. Misconfiguration of page associations in WooCommerce settings may cause some pages to be erroneously excluded.', 'litespeed-cache' ); ?></p> </div> <table class="wp-list-table striped litespeed-table"> <tbody> <tr> <th> <?php $setting_id = self::O_UPDATE_INTERVAL; ?> <?php esc_html_e( 'Product Update Interval', 'litespeed-cache' ); ?> </th> <td> <?php $options = [ self::O_PQS_CS => esc_html__( 'Purge product on changes to the quantity or stock status.', 'litespeed-cache' ) . ' ' . esc_html__( 'Purge categories only when stock status changes.', 'litespeed-cache' ), self::O_PS_CS => esc_html__( 'Purge product and categories only when the stock status changes.', 'litespeed-cache' ), self::O_PS_CN => esc_html__( 'Purge product only when the stock status changes.', 'litespeed-cache' ) . ' ' . esc_html__( 'Do not purge categories on changes to the quantity or stock status.', 'litespeed-cache' ), self::O_PQS_CQS => esc_html__( 'Always purge both product and categories on changes to the quantity or stock status.', 'litespeed-cache' ), ]; $conf = (int) apply_filters( 'litespeed_conf', $setting_id ); do_action( 'litespeed_setting_enroll', $setting_id ); foreach ( $options as $k => $v ) : $input_id = 'conf_' . $setting_id . '_' . $k; ?> <div class="litespeed-radio-row"> <input type="radio" autocomplete="off" name="<?php echo esc_attr( (string) $setting_id ); ?>" id="<?php echo esc_attr( $input_id ); ?>" value="<?php echo esc_attr( (string) $k ); ?>" <?php echo checked( $conf, (int) $k, false ); ?> /> <label for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_html( $v ); ?></label> </div> <?php endforeach; ?> <div class="litespeed-desc"> <?php esc_html_e( 'Determines how changes in product quantity and product stock status affect product pages and their associated category pages.', 'litespeed-cache' ); ?> </div> </td> </tr> <tr> <th> <?php $setting_id = self::O_CART_VARY; ?> <?php esc_html_e( 'Vary for Mini Cart', 'litespeed-cache' ); ?> </th> <td> <?php $conf = (int) apply_filters( 'litespeed_conf', $setting_id ); $this->cls( 'Admin_Display' )->build_switch( $setting_id ); ?> <div class="litespeed-desc"> <?php esc_html_e( 'Generate a separate vary cache copy for the mini cart when the cart is not empty.', 'litespeed-cache' ); ?> <?php esc_html_e( 'If your theme does not use JS to update the mini cart, you must enable this option to display the correct cart contents.', 'litespeed-cache' ); ?> <br /><?php Doc::notice_htaccess(); ?> </div> </td> </tr> </tbody> </table> </div> thirdparty/amp.cls.php 0000777 00000004704 15251157102 0011017 0 ustar 00 <?php /** * The Third Party integration with AMP plugin. * * @since 2.9.8.6 * @package LiteSpeed * @subpackage LiteSpeed_Cache/thirdparty */ namespace LiteSpeed\Thirdparty; defined( 'WPINC' ) || exit; /** * Integration helpers for AMP-compatible behaviour. * * Disables optimization features on AMP endpoints provided by popular AMP * plugins to ensure valid AMP output (no injected JS/lazy/CSS async, etc). */ class AMP { /** * Maybe mark current request as AMP and disable conflicting optimizations. * * @since 4.2 * * @param string $amp_function Callback/function name that returns whether current request is AMP. * @return void */ private static function _maybe_amp( $amp_function ) { if ( is_admin() ) { return; } // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( ! isset( $_GET['amp'] ) && ( ! function_exists( $amp_function ) || ! $amp_function() ) ) { return; } do_action( 'litespeed_debug', '[3rd] ❌ AMP disabled page optm/lazy' ); defined( 'LITESPEED_NO_PAGEOPTM' ) || define( 'LITESPEED_NO_PAGEOPTM', true ); defined( 'LITESPEED_NO_LAZY' ) || define( 'LITESPEED_NO_LAZY', true ); defined( 'LITESPEED_NO_OPTM' ) || define( 'LITESPEED_NO_OPTM', true ); // defined( 'LITESPEED_GUEST' ) || define( 'LITESPEED_GUEST', false ); } /** * Ampforwp_is_amp_endpoint() from Accelerated Mobile Pages. * * @since 4.2 * @return void */ public static function maybe_acc_mob_pages() { self::_maybe_amp( 'ampforwp_is_amp_endpoint' ); } /** * Google AMP fix. * * @since 4.2.0.1 * @return void */ public static function maybe_google_amp() { self::_maybe_amp( 'amp_is_request' ); } /** * Preload hooks to detect AMP requests and turn off conflicting features. * * CSS async will affect AMP result and Lazyload injects JS libraries which * AMP does not allow. Ensure those are disabled early on AMP endpoints. * * @since 2.9.8.6 * @access public * @return void */ public static function preload() { add_action( 'wp', __CLASS__ . '::maybe_acc_mob_pages' ); add_action( 'wp', __CLASS__ . '::maybe_google_amp' ); // amp_is_request() from AMP. // self::maybe_amp( 'amp_is_request' ); // add_filter( 'litespeed_can_optm', '__return_false' ); // do_action( 'litespeed_conf_force', API::O_OPTM_CSS_ASYNC, false ); // do_action( 'litespeed_conf_force', API::O_MEDIA_LAZY, false ); // do_action( 'litespeed_conf_force', API::O_MEDIA_IFRAME_LAZY, false ); } } thirdparty/wpml.cls.php 0000777 00000002025 15251157102 0011213 0 ustar 00 <?php /** * The Third Party integration with WPML. * * Adds WPML language domains to LiteSpeed's list of internal domains. * * @since 2.9.4 * @package LiteSpeed */ namespace LiteSpeed\Thirdparty; defined( 'WPINC' ) || exit(); /** * WPML integration for LiteSpeed Cache. */ class WPML { /** * Registers filters when WPML is active. * * @since 2.9.4 * @return void */ public static function detect() { if ( ! defined( 'WPML_PLUGIN_BASENAME' ) ) { return; } add_filter( 'litespeed_internal_domains', __CLASS__ . '::append_domains' ); } /** * Take language domains as internal domains. * * @since 2.9.4 * * @param array $domains Existing internal domains. * @return array Modified list of internal domains including WPML language domains. */ public static function append_domains( $domains ) { $wpml_domains = apply_filters( 'wpml_setting', false, 'language_domains' ); if ( $wpml_domains ) { $domains = array_merge( $domains, array_values( $wpml_domains ) ); } return $domains; } } thirdparty/facetwp.cls.php 0000777 00000002707 15251157102 0011674 0 ustar 00 <?php /** * The Third Party integration with FacetWP. * * @since 2.9.9 * @package LiteSpeed * @subpackage LiteSpeed_Cache\Thirdparty */ namespace LiteSpeed\Thirdparty; defined('WPINC') || exit(); /** * FacetWP compatibility hooks for LiteSpeed Cache. */ class Facetwp { /** * Detect FacetWP context and adjust ESI params when FacetWP returns buffered HTML via the "wp" template. * * Note: We only *read* POST data here to detect an AJAX context; no privileged action is performed. * Data is unslashed and sanitized before comparison. * * @since 2.9.9 * @return void */ public static function detect() { if ( ! defined( 'FACETWP_VERSION' ) ) { return; } /** * For Facetwp, if the template is "wp", return the buffered HTML * So marked as rest call to put is_json to ESI */ // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Reading POST to detect FacetWP AJAX; no state change or sensitive action performed. if ( ! empty( $_POST['action'] ) && ! empty( $_POST['data'] ) && ! empty( $_POST['data']['template'] ) && 'wp' === $_POST['data']['template'] ) { add_filter( 'litespeed_esi_params', __CLASS__ . '::set_is_json' ); } } /** * Mark ESI response as JSON for FacetWP's "wp" template refreshes. * * @since 2.9.9 * @param array $params Existing ESI params. * @return array Modified ESI params. */ public static function set_is_json( $params ) { $params['is_json'] = 1; return $params; } } thirdparty/wpdiscuz.cls.php 0000777 00000002272 15251157102 0012110 0 ustar 00 <?php /** * The Third Party integration with Wpdiscuz. * * @since 2.9.5 * @package LiteSpeed * @subpackage LiteSpeed_Cache/thirdparty */ namespace LiteSpeed\Thirdparty; defined( 'WPINC' ) || exit(); use LiteSpeed\API; /** * Wpdiscuz integration for LiteSpeed Cache. * * Appends commenter vary and disables pending-check when a commenter is detected. */ class Wpdiscuz { /** * Registers hooks when Wpdiscuz is active. * * @since 2.9.5 * @return void */ public static function detect() { if ( ! defined( 'WPDISCUZ_DS' ) ) { return; } self::check_commenter(); add_action( 'wpdiscuz_add_comment', __CLASS__ . '::add_comment' ); } /** * Appends the commenter vary on new Wpdiscuz comments. * * @since 2.9.5 * @return void */ public static function add_comment() { API::vary_append_commenter(); } /** * Checks current commenter and disables pending vary check if a name exists. * * @since 2.9.5 * @return void */ public static function check_commenter() { $commentor = wp_get_current_commenter(); if (strlen($commentor['comment_author']) > 0) { add_filter( 'litespeed_vary_check_commenter_pending', '__return_false' ); } } } thirdparty/woocommerce.cls.php 0000777 00000067632 15251157102 0012572 0 ustar 00 <?php /** * The Third Party integration with the WooCommerce plugin. * * @since 1.0.5 * @since 1.6.6 Added function_exists check for compatibility * @package LiteSpeed * @subpackage LiteSpeed_Cache/thirdparty */ namespace LiteSpeed\Thirdparty; defined('WPINC') || exit(); use LiteSpeed\API; use LiteSpeed\Base; use LiteSpeed\ESI; /** * WooCommerce third-party integration for LiteSpeed Cache. * * Handles ESI blocks, cache tags, purging behaviors, and settings integration * specific to WooCommerce. */ class WooCommerce extends Base { const O_CACHE_TTL_FRONTPAGE = Base::O_CACHE_TTL_FRONTPAGE; const CACHETAG_SHOP = 'WC_S'; const CACHETAG_TERM = 'WC_T.'; const O_UPDATE_INTERVAL = 'wc_update_interval'; const O_CART_VARY = 'wc_cart_vary'; const O_PQS_CS = 0; // flush product on quantity + stock change, categories on stock change const O_PS_CS = 1; // flush product and categories on stock change const O_PS_CN = 2; // flush product on stock change, categories no flush const O_PQS_CQS = 3; // flush product and categories on quantity + stock change const ESI_PARAM_ARGS = 'wc_args'; const ESI_PARAM_POSTID = 'wc_post_id'; const ESI_PARAM_NAME = 'wc_name'; const ESI_PARAM_PATH = 'wc_path'; const ESI_PARAM_LOCATED = 'wc_located'; /** * Whether ESI is enabled via litespeed_esi_status filter. * * @var bool */ private $esi_enabled; /** * Detects if WooCommerce is installed. * * @since 1.0.5 * @access public * @return void */ public static function detect() { if ( ! defined('WOOCOMMERCE_VERSION') ) { return; } self::cls()->add_hooks(); } /** * Add hooks to woo actions. * * @since 1.6.3 * @access public * @return void */ public function add_hooks() { $this->_option_append(); $this->esi_enabled = (bool) apply_filters('litespeed_esi_status', false); add_action('litespeed_control_finalize', [ $this, 'set_control' ]); add_action('litespeed_tag_finalize', [ $this, 'set_tag' ]); // Purging a product on stock change should only occur during product purchase. This function will add the purging callback when an order is complete. add_action('woocommerce_product_set_stock', [ $this, 'purge_product' ]); add_action('woocommerce_variation_set_stock', [ $this, 'purge_product' ]); // #984479 Update variations stock add_action('comment_post', [ $this, 'add_review' ], 10, 3); if ( $this->esi_enabled ) { if ( function_exists('is_shop') && ! is_shop() ) { add_action('litespeed_tpl_normal', [ $this, 'set_block_template' ]); // No need for add-to-cart button // add_action( 'litespeed_esi_load-wc-add-to-cart-form', [ $this, 'load_add_to_cart_form_block' ] ) ; add_action('litespeed_esi_load-storefront-cart-header', [ $this, 'load_cart_header' ]); add_action('litespeed_esi_load-widget', [ $this, 'register_post_view' ]); } if ( function_exists('is_product') && is_product() ) { add_filter('litespeed_esi_params', [ $this, 'add_post_id' ], 10, 2); } // #612331 - remove WooCommerce geolocation redirect on ESI page (PR#708) // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- ESI parameter detection, not processing user input. if (!empty($_GET[ESI::QS_ACTION]) && !empty($_GET[ESI::QS_PARAMS])) { remove_action( 'template_redirect', [ 'WC_Cache_Helper', 'geolocation_ajax_redirect' ], 10 ); } } if ( is_admin() ) { add_action('litespeed_api_purge_post', [ $this, 'backend_purge' ]); // todo add_action('delete_term_relationships', [ $this, 'delete_rel' ], 10, 2); add_action('litespeed_settings_tab', [ $this, 'settings_add_tab' ]); add_action('litespeed_settings_content', [ $this, 'settings_add_content' ]); add_filter('litespeed_widget_default_options', [ $this, 'wc_widget_default' ], 10, 2); } if ( apply_filters('litespeed_conf', self::O_CART_VARY) ) { add_filter( 'litespeed_vary_cookies', /** * Modify list of vary cookies. * * @param string[] $cookie_list List of vary cookies. * @return string[] */ function ( $cookie_list ) { $cookie_list[] = 'woocommerce_cart_hash'; return array_unique( $cookie_list ); } ); } } /** * Purge esi private tag. * * @since 1.6.3 * @access public * @return void */ public function purge_esi() { do_action('litespeed_debug', '3rd woo purge ESI in action: ' . current_filter()); do_action('litespeed_purge_private_esi', 'storefront-cart-header'); } /** * Purge private all. * * @since 3.0 * @access public * @return void */ public function purge_private_all() { do_action('litespeed_purge_private_all'); } /** * Check if need to give an ESI block for cart. * * @since 1.7.2 * @access public * * @param string $template Template path. * @return string Template path. */ public function check_if_need_esi( $template ) { if ( $this->vary_needed() ) { do_action('litespeed_debug', 'API: 3rd woo added ESI'); add_action('litespeed_tpl_normal', [ $this, 'set_swap_header_cart' ]); } return $template; } /** * Keep vary on if cart is not empty. * * @since 1.7.2 * @access public * * @param array $vary Vary array. * @return array */ public function vary_maintain( $vary ) { if ( $this->vary_needed() ) { do_action('litespeed_debug', 'API: 3rd woo added vary due to cart not empty'); $vary['woo_cart'] = 1; } return $vary; } /** * Check if vary need to be on based on cart. * * @since 1.7.2 * @access private * @return bool True when cart has items. */ private function vary_needed() { if ( ! function_exists('WC') ) { return false; } $woocom = WC(); if ( ! $woocom ) { return false; } if ( is_null( $woocom->cart ) ) { return false; } return $woocom->cart->get_cart_contents_count() > 0; } /** * Hooked to the litespeed_is_not_esi_template action. * If the request is not an esi request, set a hook in woocommerce_before_template_part to see if it's something we can ESI. * * @since 1.1.0 * @access public * @return void */ public function set_block_template() { add_action('woocommerce_before_template_part', [ $this, 'block_template' ], 999, 4); } /** * Hooked to the litespeed_is_not_esi_template action. * If the request is not an esi request, set a hook in storefront_header to see if it's something we can ESI. * * Will remove storefront_header_cart in storefront_header. * * @since 1.1.0 * @since 1.6.3 Removed static * @access public * @return void */ public function set_swap_header_cart() { $priority = has_action('storefront_header', 'storefront_header_cart'); if ( false !== $priority ) { remove_action('storefront_header', 'storefront_header_cart', $priority); add_action('storefront_header', [ $this, 'esi_cart_header' ], $priority); } } /** * Hooked to the woocommerce_before_template_part action. * Checks if the template contains 'add-to-cart'. If so, and if we want to ESI the request, block it and build the ESI code block. * * The function parameters will be passed to the ESI request. * * @since 1.1.0 * @access public * * @param string $template_name Template name. * @param string $template_path Template path. * @param string $located Located template path. * @param array $args Template args. * @return void */ public function block_template( $template_name, $template_path, $located, $args ) { if ( false === strpos( $template_name, 'add-to-cart' ) ) { if ( false !== strpos( $template_name, 'related.php' ) ) { remove_action('woocommerce_before_template_part', [ $this, 'block_template' ], 999); add_filter('woocommerce_related_products_args', [ $this, 'add_related_tags' ]); add_action('woocommerce_after_template_part', [ $this, 'end_template' ], 999); } return; } // Build ESI block for add-to-cart. // $post_obj = get_post( get_the_ID() ); // if ( ! $post_obj ) { // return; // } // $params = [ // self::ESI_PARAM_ARGS => $args, // self::ESI_PARAM_NAME => $template_name, // self::ESI_PARAM_POSTID => $post_obj->ID, // self::ESI_PARAM_PATH => $template_path, // self::ESI_PARAM_LOCATED => $located, // ]; // add_action('woocommerce_after_add_to_cart_form', [ $this, 'end_form' ]); // add_action('woocommerce_after_template_part', [ $this, 'end_form' ], 999); // // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Filter returns a URL; escaped below. // echo esc_url( apply_filters( 'litespeed_esi_url', 'wc-add-to-cart-form', 'WC_CART_FORM', $params ) ); // // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Allow basic wrapper markup. // echo wp_kses_post( apply_filters( 'litespeed_clean_wrapper_begin', '' ) ); } /** * Hooked to the woocommerce_after_add_to_cart_form action. * If this is hit first, clean the buffer and remove this function and end_template. * * @since 1.1.0 * @since 1.6.3 Removed static * @access public * * @param string $template_name Template name. * @return void */ public function end_form( $template_name = '' ) { if ( ! empty( $template_name ) && false === strpos( $template_name, 'add-to-cart' ) ) { return; } // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Allow basic wrapper markup. echo wp_kses_post( apply_filters( 'litespeed_clean_wrapper_end', '' ) ); remove_action('woocommerce_after_add_to_cart_form', [ $this, 'end_form' ]); remove_action('woocommerce_after_template_part', [ $this, 'end_form' ], 999); } /** * If related products are loaded, need to add the extra product ids. * * The page will be purged if any of the products are changed. * * @since 1.1.0 * @since 1.6.3 Removed static * @access public * * @param array $args The arguments used to build the related products section. * @return array The unchanged arguments. */ public function add_related_tags( $args ) { if ( empty( $args ) || ! isset( $args['post__in'] ) ) { return $args; } $related_posts = $args['post__in']; foreach ( $related_posts as $related ) { do_action('litespeed_tag_add_post', $related); } return $args; } /** * Hooked to the woocommerce_after_template_part action. * If the template contains 'related.php', restore block hook. * * @since 1.1.0 * @since 1.6.3 Removed static * @access public * * @param string $template_name Template name. * @return void */ public function end_template( $template_name ) { if ( false !== strpos( $template_name, 'related.php' ) ) { remove_action('woocommerce_after_template_part', [ $this, 'end_template' ], 999); $this->set_block_template(); } } /** * Hooked to the storefront_header header. * If we want to ESI the request, block it and build the ESI code block. * * @since 1.1.0 * @since 1.6.3 Removed static * @access public * @return void */ public function esi_cart_header() { // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Filter returns URL. echo apply_filters( 'litespeed_esi_url', 'storefront-cart-header', 'STOREFRONT_CART_HEADER' ); } /** * Hooked to the litespeed_esi_load-storefront-cart-header action. * Generates the cart header for ESI display. * * @since 1.1.0 * @since 1.6.3 Removed static * @access public * @return void */ public function load_cart_header() { storefront_header_cart(); } /** * Hooked to the litespeed_esi_load-wc-add-to-cart-form action. * Parses the ESI input parameters and generates the add to cart form for ESI display. * * @since 1.1.0 * @since 1.6.3 Removed static * @access public * * @param array $params ESI parameters. * @return void */ public function load_add_to_cart_form_block( $params ) { global $post, $wp_query; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- Intentional for WooCommerce template setup. $post = get_post($params[self::ESI_PARAM_POSTID]); $wp_query->setup_postdata($post); function_exists('wc_get_template') && wc_get_template($params[self::ESI_PARAM_NAME], $params[self::ESI_PARAM_ARGS], $params[self::ESI_PARAM_PATH]); } /** * Update WooCommerce when someone visits a product and has the recently viewed products widget. * * Currently, this widget should not be cached. * * @since 1.1.0 * @since 1.6.3 Removed static * @access public * * @param array $params Widget parameter array. * @return void */ public function register_post_view( $params ) { if ( 'WC_Widget_Recently_Viewed' !== $params[ API::PARAM_NAME ] ) { return; } if ( ! isset( $params[ self::ESI_PARAM_POSTID ] ) ) { return; } $id = (int) $params[ self::ESI_PARAM_POSTID ]; $esi_post = get_post( $id ); $product = function_exists('wc_get_product') ? wc_get_product( $esi_post ) : false; if ( empty( $product ) ) { return; } // Setup post data for tracking view without directly overriding $post. if ( $esi_post ) { setup_postdata( $esi_post ); } if ( function_exists('wc_track_product_view') ) { wc_track_product_view(); } } /** * Adds the post id to the widget ESI parameters for the Recently Viewed widget. * * This is needed in the ESI request to update the cookie properly. * * @since 1.1.0 * @access public * * @param array $params Existing ESI params. * @param string $block_id Block identifier. * @return array */ public function add_post_id( $params, $block_id ) { if ( 'widget' === $block_id ) { if ( 'WC_Widget_Recently_Viewed' === $params[ API::PARAM_NAME ] ) { $params[ self::ESI_PARAM_POSTID ] = get_the_ID(); } } return $params; } /** * Hooked to the litespeed_widget_default_options filter. * * The recently viewed widget must be ESI to function properly. * This function will set it to enable and no cache by default. * * @since 1.1.0 * @access public * * @param array $options Widget options. * @param mixed $widget Widget instance. * @return array */ public function wc_widget_default( $options, $widget ) { if ( ! is_array( $options ) ) { return $options; } $widget_name = get_class( $widget ); if ( 'WC_Widget_Recently_Viewed' === $widget_name ) { $options[ API::WIDGET_O_ESIENABLE ] = API::VAL_ON2; $options[ API::WIDGET_O_TTL ] = 0; } elseif ( 'WC_Widget_Recent_Reviews' === $widget_name ) { $options[ API::WIDGET_O_ESIENABLE ] = API::VAL_ON; $options[ API::WIDGET_O_TTL ] = 86400; } return $options; } /** * Set WooCommerce cache tags based on page type. * * @since 1.0.9 * @since 1.6.3 Removed static * @access public * @return void */ public function set_tag() { $id = get_the_ID(); if ( false === $id ) { return; } // Check if product has a cache ttl limit or not. $sale_from = (int) get_post_meta( $id, '_sale_price_dates_from', true ); $sale_to = (int) get_post_meta( $id, '_sale_price_dates_to', true ); // phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp.Requested -- Need local timestamp for WooCommerce sale dates. $now = current_time('timestamp'); $ttl = false; if ( $sale_from && $now < $sale_from ) { $ttl = $sale_from - $now; } elseif ( $sale_to && $now < $sale_to ) { $ttl = $sale_to - $now; } if ( $ttl && $ttl < apply_filters( 'litespeed_control_ttl', 0 ) ) { do_action( 'litespeed_control_set_ttl', $ttl, "WooCommerce set scheduled TTL to $ttl" ); } if ( function_exists('is_shop') && is_shop() ) { do_action('litespeed_tag_add', self::CACHETAG_SHOP); } if ( function_exists('is_product_taxonomy') && ! is_product_taxonomy() ) { return; } if ( isset( $GLOBALS['product_cat'] ) && is_string( $GLOBALS['product_cat'] ) ) { // todo: need to check previous woo version to find if its from old woo versions or not! $term = get_term_by( 'slug', $GLOBALS['product_cat'], 'product_cat' ); } elseif ( isset( $GLOBALS['product_tag'] ) && is_string( $GLOBALS['product_tag'] ) ) { $term = get_term_by( 'slug', $GLOBALS['product_tag'], 'product_tag' ); } else { $term = false; } if ( false === $term ) { return; } while ( isset( $term ) ) { do_action( 'litespeed_tag_add', self::CACHETAG_TERM . $term->term_id ); if ( 0 === (int) $term->parent ) { break; } $term = get_term( $term->parent ); } } /** * Check if the page is cacheable according to WooCommerce. * * @since 1.0.5 * @since 1.6.3 Removed static * @access public * * @param string $esi_id The ESI block id if a request is an ESI request. * @return void */ public function set_control( $esi_id ) { if ( ! apply_filters( 'litespeed_control_cacheable', false ) ) { return; } /** * Avoid possible 500 issue. * * @since 1.6.2.1 */ if ( ! function_exists( 'WC' ) ) { return; } $woocom = WC(); if ( ! $woocom || empty( $woocom->session ) ) { return; } // For later versions, DONOTCACHEPAGE should be set. // No need to check uri/qs. if ( version_compare( $woocom->version, '1.4.2', '>=' ) ) { if ( version_compare( $woocom->version, '3.2.0', '<' ) && defined('DONOTCACHEPAGE') && DONOTCACHEPAGE ) { do_action( 'litespeed_control_set_nocache', '3rd party woocommerce not cache by constant' ); return; } elseif ( version_compare( $woocom->version, '2.1.0', '>=' ) ) { $err = false; if ( ! function_exists( 'wc_get_page_id' ) ) { return; } /** * From woo/inc/class-wc-cache-helper.php:prevent_caching() * * @since 1.4 */ $page_ids = array_filter( [ wc_get_page_id( 'cart' ), wc_get_page_id( 'checkout' ), wc_get_page_id( 'myaccount' ) ] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( isset( $_GET['download_file'] ) || isset( $_GET['add-to-cart'] ) || is_page( $page_ids ) ) { $err = 'woo non cacheable pages'; } elseif ( function_exists( 'wc_notice_count' ) && wc_notice_count() > 0 ) { $err = 'has wc notice'; } if ( $err ) { do_action( 'litespeed_control_set_nocache', '3rd party woocommerce not cache due to ' . $err ); return; } } return; } if ( ! isset( $_SERVER['REQUEST_URI'] ) ) { return; } $uri = esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ); $uri_len = strlen( $uri ); if ( $uri_len < 5 ) { return; } if ( in_array( $uri, [ 'cart/', 'checkout/', 'my-account/', 'addons/', 'logout/', 'lost-password/', 'product/' ], true ) ) { // why contains `product`? do_action( 'litespeed_control_set_nocache', 'uri in cart/account/user pages' ); return; } if ( ! isset( $_SERVER['QUERY_STRING'] ) ) { return; } $qs = sanitize_text_field( wp_unslash( $_SERVER['QUERY_STRING'] ) ); $qs_len = strlen( $qs ); if ( ! empty( $qs ) && $qs_len >= 12 && 0 === strpos( $qs, 'add-to-cart=' ) ) { do_action( 'litespeed_control_set_nocache', 'qs contains add-to-cart' ); } } /** * Purge a product page and related pages (based on settings) on checkout. * * @since 1.0.9 * @since 1.6.3 Removed static * @access public * * @param \WC_Product $product Product object. * @return void */ public function purge_product( $product ) { do_action( 'litespeed_debug', '[3rd] Woo Purge [pid] ' . $product->get_id() ); $do_purge = function ( $action, $debug = '' ) use ( $product ) { $config = apply_filters( 'litespeed_conf', self::O_UPDATE_INTERVAL ); if ( is_null( $config ) ) { $config = self::O_PQS_CS; } if ( self::O_PQS_CQS === $config ) { $action(); if ( $debug ) { do_action( 'litespeed_debug', $debug ); } } elseif ( self::O_PQS_CS !== $config && $product->is_in_stock() ) { do_action( 'litespeed_debug', '[3rd] Woo No purge needed [option] ' . $config ); return false; } elseif ( self::O_PS_CN !== $config && ! $product->is_in_stock() ) { $action(); if ( $debug ) { do_action( 'litespeed_debug', $debug ); } } return true; }; if ( ! $do_purge( function () use ( $product ) { $this->backend_purge( $product->get_id() ); } ) ) { return; } do_action( 'litespeed_purge_post', $product->get_id() ); // Check if is variation, purge stock too #984479. if ( $product->is_type( 'variation' ) ) { do_action( 'litespeed_purge_post', $product->get_parent_id() ); } // Check if WPML is enabled ##972971. if ( defined( 'WPML_PLUGIN_BASENAME' ) ) { // Check if it is a variable product and get post/parent ID. $wpml_purge_id = $product->is_type( 'variation' ) ? $product->get_parent_id() : $product->get_id(); $type = apply_filters( 'wpml_element_type', get_post_type( $wpml_purge_id ) ); $trid = apply_filters( 'wpml_element_trid', false, $wpml_purge_id, $type ); $translations = apply_filters( 'wpml_get_element_translations', [], $trid, $type ); foreach ( $translations as $lang => $translation ) { do_action( 'litespeed_debug', '[3rd] Woo WPML purge language: ' . $translation->language_code . ' , post ID: ' . $translation->element_id ); do_action( 'litespeed_purge_post', $translation->element_id ); // use the $translation->element_id as it is post ID of other languages. } // Check other languages category and purge if configured. // wp_get_post_terms() only returns default language category ID. $default_cats = wp_get_post_terms( $wpml_purge_id, 'product_cat' ); $languages = apply_filters( 'wpml_active_languages', null ); foreach ( $default_cats as $default_cat ) { foreach ( $languages as $language ) { $tr_cat_id = icl_object_id( $default_cat->term_id, 'product_cat', false, $language['code'] ); $do_purge( function () use ( $tr_cat_id ) { do_action( 'litespeed_purge', self::CACHETAG_TERM . $tr_cat_id ); }, '[3rd] Woo Purge WPML category [language] ' . $language['code'] . ' [cat] ' . $tr_cat_id ); } } } } /** * Delete object-term relationship. If the post is a product and the term ids array is not empty, * will add purge tags to the deleted terms. * * @since 1.0.9 * @since 1.6.3 Removed static * @access public * * @param int $post_id Object ID. * @param array $term_ids An array of term taxonomy IDs. * @return void */ public function delete_rel( $post_id, $term_ids ) { if ( ! function_exists( 'wc_get_product' ) ) { return; } if ( empty( $term_ids ) || false === wc_get_product( $post_id ) ) { return; } foreach ( $term_ids as $term_id ) { do_action( 'litespeed_purge', self::CACHETAG_TERM . $term_id ); } } /** * Purge a product's categories and tags pages in case they are affected. * * @since 1.0.9 * @since 1.6.3 Removed static * @access public * * @param int $post_id Post id that is about to be purged. * @return void */ public function backend_purge( $post_id ) { if ( ! function_exists( 'wc_get_product' ) ) { return; } if ( ! isset( $post_id ) || false === wc_get_product( $post_id ) ) { return; } $cats = $this->get_cats( $post_id ); if ( ! empty( $cats ) ) { foreach ( $cats as $cat ) { do_action( 'litespeed_purge', self::CACHETAG_TERM . $cat ); } } if ( ! function_exists( 'wc_get_product_terms' ) ) { return; } $tags = wc_get_product_terms( $post_id, 'product_tag', [ 'fields' => 'ids' ] ); if ( ! empty( $tags ) ) { foreach ( $tags as $tag ) { do_action( 'litespeed_purge', self::CACHETAG_TERM . $tag ); } } } /** * When a product has a new review added, purge the recent reviews widget. * * @since 1.1.0 * @since 1.6.3 Removed static * @access public * * @param mixed $unused Unused. * @param integer $comment_approved Whether the comment is approved or not. * @param array $commentdata Information about the comment. * @return void */ public function add_review( $unused, $comment_approved, $commentdata ) { if ( ! function_exists( 'wc_get_product' ) ) { return; } $post_id = $commentdata['comment_post_ID']; if ( 1 !== (int) $comment_approved || ! isset( $post_id ) || false === wc_get_product( $post_id ) ) { return; } global $wp_widget_factory; if ( ! isset( $wp_widget_factory->widgets['WC_Widget_Recent_Reviews'] ) ) { return; } $recent_reviews = $wp_widget_factory->widgets['WC_Widget_Recent_Reviews']; if ( ! is_null( $recent_reviews ) ) { do_action( 'litespeed_tag_add_widget', $recent_reviews->id ); } } /** * Append new options. * * @since 1.6.3 Removed static * @since 3.0 new API * @return void */ private function _option_append() { // Append option save value filter. do_action( 'litespeed_conf_multi_switch', self::O_UPDATE_INTERVAL, 3 ); // This need to be before conf_append. do_action( 'litespeed_conf_append', self::O_UPDATE_INTERVAL, false ); do_action( 'litespeed_conf_append', self::O_CART_VARY, false ); } /** * Hooked to `litespeed_settings_tab` action. * Adds the integration configuration options (currently, to determine purge rules). * * @since 1.6.3 Removed static * * @param string $setting_page Setting page slug. * @return void */ public function settings_add_tab( $setting_page ) { if ( 'cache' !== $setting_page ) { return; } require 'woocommerce.tab.tpl.php'; } /** * Hook to show config content. * * @since 3.0 * * @param string $setting_page Setting page slug. * @return void */ public function settings_add_content( $setting_page ) { if ( 'cache' !== $setting_page ) { return; } require 'woocommerce.content.tpl.php'; } /** * Helper function to select the function(s) to use to get the product category ids. * * @since 1.0.10 * @since 1.6.3 Removed static * @access private * * @param int $product_id The product id. * @return array An array of category ids. */ private function get_cats( $product_id ) { if ( ! function_exists( 'WC' ) ) { return []; } $woocom = WC(); if ( isset( $woocom ) && version_compare( $woocom->version, '2.5.0', '>=' ) && function_exists( 'wc_get_product_cat_ids' ) ) { return wc_get_product_cat_ids( $product_id ); } $product_cats = wp_get_post_terms( $product_id, 'product_cat', [ 'fields' => 'ids' ] ); foreach ( $product_cats as $product_cat ) { $product_cats = array_merge( $product_cats, get_ancestors( $product_cat, 'product_cat' ) ); } return $product_cats; } /** * 3rd party preload. * * @since 2.9.8.4 * @return void */ public static function preload() { /** * Auto purge for WooCommerce Advanced Bulk Edit plugin, * Bulk edit hook needs to be added to preload as it will die before detect. */ add_action( 'wp_ajax_wpmelon_adv_bulk_edit', __CLASS__ . '::bulk_edit_purge', 1 ); } /** * Auto purge for WooCommerce Advanced Bulk Edit plugin. * * @since 2.9.8.4 * @return void */ public static function bulk_edit_purge() { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Third-party plugin action; cannot enforce here. if ( empty( $_POST['type'] ) || 'saveproducts' !== $_POST['type'] || empty( $_POST['data'] ) ) { return; } /* * admin-ajax form-data structure * array( * "type" => "saveproducts", * "data" => array( * "column1" => "464$###0$###2#^#463$###0$###4#^#462$###0$###6#^#", * "column2" => "464$###0$###2#^#463$###0$###4#^#462$###0$###6#^#" * ) * ) */ $stock_string_arr = []; // Ensure data is unslashed before processing. // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Third-party plugin may not send nonce. Data format defined by third-party plugin. $data = isset( $_POST['data'] ) ? wp_unslash( $_POST['data'] ) : []; foreach ( (array) $data as $stock_value ) { $stock_string_arr = array_merge( $stock_string_arr, explode( '#^#', (string) $stock_value ) ); } $lscwp_3rd_woocommerce = new self(); if ( count( $stock_string_arr ) < 1 ) { return; } foreach ( $stock_string_arr as $edited_stock ) { $product_id = (int) strtok( (string) $edited_stock, '$' ); $product = wc_get_product( $product_id ); if ( empty( $product ) ) { do_action( 'litespeed_debug', '3rd woo purge: ' . $product_id . ' not found.' ); continue; } $lscwp_3rd_woocommerce->purge_product( $product ); } } } thirdparty/wp-polls.cls.php 0000777 00000001447 15251157102 0012020 0 ustar 00 <?php /** * The Third Party integration with the WP-Polls plugin. * * Ensures WP-Polls pages are marked as non-cacheable in LiteSpeed Cache. * * @since 1.0.7 * @package LiteSpeed */ namespace LiteSpeed\Thirdparty; defined( 'WPINC' ) || exit; /** * WP-Polls integration. */ class Wp_Polls { /** * Register WP-Polls display filters to mark output as non-cacheable. * * @since 1.0.7 * @return void */ public static function detect() { add_filter( 'wp_polls_display_pollvote', __CLASS__ . '::set_control' ); add_filter( 'wp_polls_display_pollresult', __CLASS__ . '::set_control' ); } /** * Mark WP-Polls output as non-cacheable. * * @since 1.0.7 * @return void */ public static function set_control() { do_action( 'litespeed_control_set_nocache', 'wp polls' ); } } thirdparty/beaver-builder.cls.php 0000777 00000002167 15251157102 0013133 0 ustar 00 <?php /** * The Third Party integration with the Beaver Builder plugin. * * @since 3.0 * @package LiteSpeed * @subpackage LiteSpeed_Cache/thirdparty */ namespace LiteSpeed\Thirdparty; defined( 'WPINC' ) || exit; /** * Integration for Beaver Builder cache handling and purging. */ class Beaver_Builder { /** * Detects if Beaver_Builder is active. * * @since 3.0 * @access public * @return void */ public static function detect() { if ( ! defined( 'FL_BUILDER_VERSION' ) ) { return; } /** * Purge All hooks. * * @see beaver-builder/extensions/fi-builder-cache-helper/classes/class-fi-builder-cache-helper.php */ $actions = array( 'fl_builder_cache_cleared', 'fl_builder_after_save_layout', 'fl_builder_after_save_user_template', 'upgrader_process_complete', ); foreach ( $actions as $val ) { add_action( $val, __CLASS__ . '::purge' ); } } /** * Purges the cache when Beaver_Builder's cache is purged. * * @since 3.0 * @access public * @return void */ public static function purge() { do_action( 'litespeed_purge_all', '3rd Beaver_Builder' ); } } thirdparty/entry.inc.php 0000777 00000003012 15251157102 0011362 0 ustar 00 <?php /** * The registry for Third Party Plugins Integration files. * * This file is only used to include the integration files/classes. * This works as an entry point for the initial add_action for the * detect function. * * It is not required to add all integration files here, this just provides * a common place for plugin authors to append their file to. * * @package LiteSpeed * @subpackage LiteSpeed_Cache/thirdparty */ defined('WPINC') || exit(); $third_cls = array( 'Aelia_CurrencySwitcher', 'Autoptimize', 'Avada', 'BBPress', 'Beaver_Builder', 'Caldera_Forms', 'Divi_Theme_Builder', 'Facetwp', 'LiteSpeed_Check', 'Theme_My_Login', 'User_Switching', 'WCML', 'WooCommerce', 'WC_PDF_Product_Vouchers', 'Woo_Paypal', 'Wp_Polls', 'WP_PostRatings', 'Wpdiscuz', 'WPLister', 'WPML', 'WpTouch', 'Yith_Wishlist', ); foreach ($third_cls as $cls) { add_action('litespeed_load_thirdparty', 'LiteSpeed\Thirdparty\\' . $cls . '::detect'); } // Preload needed for certain thirdparty add_action('litespeed_init', 'LiteSpeed\Thirdparty\Divi_Theme_Builder::preload'); add_action('litespeed_init', 'LiteSpeed\Thirdparty\WooCommerce::preload'); add_action('litespeed_init', 'LiteSpeed\Thirdparty\NextGenGallery::preload'); add_action('litespeed_init', 'LiteSpeed\Thirdparty\AMP::preload'); add_action('litespeed_init', 'LiteSpeed\Thirdparty\Elementor::preload'); add_action('litespeed_init', 'LiteSpeed\Thirdparty\Gravity_Forms::preload'); add_action('litespeed_init', 'LiteSpeed\Thirdparty\Perfmatters::preload'); thirdparty/elementor.cls.php 0000777 00000006404 15251157102 0012233 0 ustar 00 <?php /** * The Third Party integration with the Elementor plugin. * * Detects Elementor editor/preview actions and safely disables LiteSpeed Cache features * that could interfere with live editing. Also hooks cache purge when Elementor regenerates * its CSS & data. * * @since 2.9.8.8 * @package LiteSpeed * @subpackage LiteSpeed_Cache/thirdparty */ namespace LiteSpeed\Thirdparty; defined('WPINC') || exit(); /** * Handles Elementor compatibility. */ class Elementor { /** * Preload hooks and disable caching features during Elementor edit/preview flows. * * This method only inspects query/server values to detect editor context. * No privileged actions are performed here, so nonce verification is not required. * * @since 2.9.8.8 * @return void */ public static function preload() { if ( ! defined( 'ELEMENTOR_VERSION' ) ) { return; } // If user explicitly opened the Elementor editor, disable all LSCWP features. $action = isset( $_GET['action'] ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( 'elementor' === $action ) { do_action( 'litespeed_disable_all', 'elementor edit mode' ); } // If the referrer indicates an Elementor editor context, inspect possible save actions. $http_referer = isset( $_SERVER['HTTP_REFERER'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_REFERER'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( '' !== $http_referer && false !== strpos( $http_referer, 'action=elementor' ) ) { // Elementor posts JSON in the 'actions' request field when saving from editor. // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized $actions_raw = isset( $_REQUEST['actions'] ) ? wp_unslash( $_REQUEST['actions'] ) : ''; if ( '' !== $actions_raw ) { // Use a forgiving sanitizer for JSON strings, then decode. $json = json_decode( sanitize_textarea_field( $actions_raw ), true ); // Debug2::debug( '3rd Elementor', $json ); if ( ! empty( $json['save_builder']['action'] ) && 'save_builder' === $json['save_builder']['action'] && ! empty( $json['save_builder']['data']['status'] ) && 'publish' === $json['save_builder']['data']['status'] ) { // Publishing from editor — allow normal flow so crawler/purge can run. return; } } // In all other editor-referrer cases, disable LSCWP features during edit. do_action( 'litespeed_disable_all', 'elementor edit mode in HTTP_REFERER' ); } // Clear LSC cache when Elementor regenerates CSS & Data. add_action( 'elementor/core/files/clear_cache', __CLASS__ . '::regenerate_litespeed_cache' ); } /** * Disable LiteSpeed ESI explicitly (kept for backward compatibility if re-enabled). * * @since 2.9.8.8 * @return void */ public static function disable_litespeed_esi() { if ( ! defined( 'LITESPEED_ESI_OFF' ) ) { define( 'LITESPEED_ESI_OFF', true ); } } /** * Purge LiteSpeed Cache when Elementor regenerates its CSS & Data. * * @since 2.9.8.8 * @return void */ public static function regenerate_litespeed_cache() { do_action( 'litespeed_purge_all', 'Elementor - Regenerate CSS & Data' ); } } thirdparty/avada.cls.php 0000777 00000001455 15251157102 0011316 0 ustar 00 <?php /** * The Third Party integration with the Avada plugin. * * @since 1.1.0 * @package LiteSpeed * @subpackage LiteSpeed_Cache/thirdparty */ namespace LiteSpeed\Thirdparty; defined( 'WPINC' ) || exit; /** * Integration for Avada cache flushing. */ class Avada { /** * Detects if Avada is installed. * * @since 1.1.0 * @access public * @return void */ public static function detect() { if ( ! defined( 'AVADA_VERSION' ) ) { return; } add_action( 'update_option_avada_dynamic_css_posts', __CLASS__ . '::flush' ); add_action( 'update_option_fusion_options', __CLASS__ . '::flush' ); } /** * Purges the cache. * * @since 1.1.0 * @access public * @return void */ public static function flush() { do_action( 'litespeed_purge_all', '3rd avada' ); } } thirdparty/nextgengallery.cls.php 0000777 00000015015 15251157102 0013267 0 ustar 00 <?php /** * The Third Party integration with the NextGen Gallery plugin. * * @since 1.0.5 * @package LiteSpeed * @subpackage LiteSpeed_Cache\Thirdparty */ namespace LiteSpeed\Thirdparty; defined('WPINC') || exit(); /** * Provides LiteSpeed Cache compatibility for NextGen Gallery. */ class NextGenGallery { const CACHETAG_ALBUMS = 'NGG_A.'; const CACHETAG_GALLERIES = 'NGG_G.'; const CACHETAG_TAGS = 'NGG_T.'; /** * Hook NextGen Gallery events for purging cache. * * @since 1.0.5 * @return void */ public static function preload() { add_action('ngg_added_new_image', __CLASS__ . '::add_image'); add_action('ngg_ajax_image_save', __CLASS__ . '::update_image'); add_action('ngg_delete_picture', __CLASS__ . '::delete_image'); add_action('ngg_moved_images', __CLASS__ . '::move_image', 10, 3); add_action('ngg_copied_images', __CLASS__ . '::copy_image', 10, 3); add_action('ngg_generated_image', __CLASS__ . '::gen_image'); add_action('ngg_recovered_image', __CLASS__ . '::gen_image'); add_action('ngg_gallery_sort', __CLASS__ . '::update_gallery'); add_action('ngg_delete_gallery', __CLASS__ . '::update_gallery'); add_action('ngg_update_album', __CLASS__ . '::update_album'); add_action('ngg_delete_album', __CLASS__ . '::update_album'); add_filter('ngg_displayed_gallery_cache_params', __CLASS__ . '::add_container'); } /** * Purge cache when an image is added. * * @since 1.0.5 * @param object $image The image object added. * @return void */ public static function add_image( $image ) { if (!$image || !method_exists($image, 'get_gallery')) { return; } $gallery = $image->get_gallery(); if ($gallery && $gallery->pageid) { do_action('litespeed_purge', self::CACHETAG_GALLERIES . $gallery->pageid); } } /** * Purge cache when an image is updated. * * @since 1.0.5 * @return void */ public static function update_image() { // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( isset( $_REQUEST['gallery_id'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended do_action( 'litespeed_purge', self::CACHETAG_GALLERIES . sanitize_key( wp_unslash( $_REQUEST['gallery_id'] ) ) ); return; } // phpcs:ignore WordPress.Security.NonceVerification.Missing if ( isset( $_POST['task_list'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing $task_list = str_replace( '\\', '', wp_unslash( $_POST['task_list'] ) ); $task_list = json_decode( $task_list, true ); if ( ! empty( $task_list[0]['query']['id'] ) ) { do_action( 'litespeed_purge', self::CACHETAG_GALLERIES . sanitize_key( $task_list[0]['query']['id'] ) ); return; } } // phpcs:ignore WordPress.Security.NonceVerification.Missing if ( isset( $_POST['id'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing $id = (int) $_POST['id']; // phpcs:ignore WordPress.Security.NonceVerification.Missing } elseif ( isset( $_POST['image'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing $id = (int) $_POST['image']; // phpcs:ignore WordPress.Security.NonceVerification.Recommended } elseif ( isset( $_GET['pid'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended $id = (int) $_GET['pid']; } else { error_log( 'LiteSpeed_Cache hit ngg_ajax_image_save with no post image id.' ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log return; } $image = \C_Image_Mapper::get_instance()->find($id); if ($image) { do_action('litespeed_purge', self::CACHETAG_GALLERIES . $image->galleryid); } } /** * Purge cache when an image is deleted. * * @since 1.0.5 * @return void */ public static function delete_image() { // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( isset( $_GET['gid'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended do_action( 'litespeed_purge', self::CACHETAG_GALLERIES . sanitize_key( wp_unslash( $_GET['gid'] ) ) ); } } /** * Purge cache when an image is moved. * * @since 1.0.8 * @param array $images Unused. * @param array $old_gallery_ids Source gallery IDs. * @param int $new_gallery_id Destination gallery ID. * @return void */ public static function move_image( $images, $old_gallery_ids, $new_gallery_id ) { foreach ($old_gallery_ids as $gid) { do_action('litespeed_purge', self::CACHETAG_GALLERIES . $gid); } do_action('litespeed_purge', self::CACHETAG_GALLERIES . $new_gallery_id); } /** * Purge cache when an image is copied. * * @since 1.0.8 * @param array $image_pid_map Unused. * @param array $old_gallery_ids Unused. * @param int $new_gallery_id Destination gallery ID. * @return void */ public static function copy_image( $image_pid_map, $old_gallery_ids, $new_gallery_id ) { do_action('litespeed_purge', self::CACHETAG_GALLERIES . $new_gallery_id); } /** * Purge cache when an image is regenerated or recovered. * * @since 1.0.8 * @param object $image The regenerated image object. * @return void */ public static function gen_image( $image ) { do_action('litespeed_purge', self::CACHETAG_GALLERIES . $image->galleryid); } /** * Purge cache when a gallery is updated. * * @since 1.0.5 * @param int|object $gid Gallery ID or object with gid. * @return void */ public static function update_gallery( $gid ) { if (is_object($gid) && !empty($gid->gid)) { $gid = $gid->gid; } do_action('litespeed_purge', self::CACHETAG_GALLERIES . $gid); } /** * Purge cache when an album is updated. * * @since 1.0.5 * @param int $aid Album ID. * @return void */ public static function update_album( $aid ) { do_action('litespeed_purge', self::CACHETAG_ALBUMS . $aid); } /** * Tag gallery/album/tag content during rendering. * * @since 1.0.5 * @param object $render_parms Render parameters. * @return mixed Null if $render_parms is null, otherwise same input. */ public static function add_container( $render_parms ) { if (is_null($render_parms)) { return null; } $src = $render_parms[0]->source; $container_ids = $render_parms[0]->container_ids; switch ($src) { case 'albums': $tag = self::CACHETAG_ALBUMS; break; case 'galleries': $tag = self::CACHETAG_GALLERIES; break; case 'tags': $tag = self::CACHETAG_TAGS; break; default: return $render_parms; } foreach ($container_ids as $id) { do_action('litespeed_tag_add', $tag . $id); } return $render_parms; } } thirdparty/wptouch.cls.php 0000777 00000001557 15251157102 0011736 0 ustar 00 <?php /** * The Third Party integration with the WPTouch Mobile plugin. * * Marks requests from mobile devices via WPTouch as mobile in LiteSpeed Cache. * * @since 1.0.7 * @package LiteSpeed */ namespace LiteSpeed\Thirdparty; defined( 'WPINC' ) || exit(); /** * WPTouch integration for LiteSpeed Cache. */ class WpTouch { /** * Detects if WPTouch is installed. * * @since 1.0.7 * @return void */ public static function detect() { global $wptouch_pro; if ( isset( $wptouch_pro ) ) { add_action( 'litespeed_control_finalize', __CLASS__ . '::set_control' ); } } /** * Check if the device is mobile. If so, set mobile. * * @since 1.0.7 * @return void */ public static function set_control() { global $wptouch_pro; if ( ! empty( $wptouch_pro->is_mobile_device ) ) { add_filter( 'litespeed_is_mobile', '__return_true' ); } } } thirdparty/wplister.cls.php 0000777 00000001546 15251157102 0012114 0 ustar 00 <?php /** * The Third Party integration with the WPLister plugin. * * Hooks WPLister inventory status updates to LiteSpeed WooCommerce backend purging. * * @since 1.1.0 * @package LiteSpeed */ namespace LiteSpeed\Thirdparty; defined( 'WPINC' ) || exit(); /** * WPLister integration for LiteSpeed Cache. */ class WPLister { /** * Detects if WooCommerce and WPLister are installed and registers hooks. * * @since 1.1.0 * @return void */ public static function detect() { if ( defined( 'WOOCOMMERCE_VERSION' ) && defined( 'WPLISTER_VERSION' ) ) { // User reported this will sync correctly. add_action( 'wplister_revise_inventory_status', [ WooCommerce::cls(), 'backend_purge' ] ); // Added as a safety measure for WPLister Pro only. add_action( 'wplister_inventory_status_changed', [ WooCommerce::cls(), 'backend_purge' ] ); } } } thirdparty/wcml.cls.php 0000777 00000003367 15251157102 0011210 0 ustar 00 <?php /** * The Third Party integration with WCML. * * @since 3.0 * @package LiteSpeed * @subpackage LiteSpeed_Cache\Thirdparty */ namespace LiteSpeed\Thirdparty; defined('WPINC') || exit(); /** * Provides compatibility with WCML for currency handling. */ class WCML { /** * Holds the current WCML currency. * * @var string */ private static $_currency = ''; /** * Detect if WCML is active and register hooks. * * @since 3.0 * @access public * @return void */ public static function detect() { if (!defined('WCML_VERSION')) { return; } add_filter('wcml_client_currency', __CLASS__ . '::apply_client_currency'); add_action('wcml_set_client_currency', __CLASS__ . '::set_client_currency'); } /** * Sets the client currency and triggers vary updates. * * @since 3.0 * @access public * @param string $currency The currency code to set. * @return void */ public static function set_client_currency( $currency ) { self::apply_client_currency($currency); do_action('litespeed_vary_ajax_force'); } /** * Applies the client currency and adjusts vary accordingly. * * @since 3.0 * @access public * @param string $currency The currency code to apply. * @return string The applied currency. */ public static function apply_client_currency( $currency ) { self::$_currency = $currency; add_filter('litespeed_vary', __CLASS__ . '::apply_vary'); return $currency; } /** * Appends WCML currency to vary list. * * @since 3.0 * @access public * @param array $vary_list The existing vary list. * @return array The updated vary list including WCML currency. */ public static function apply_vary( $vary_list ) { $vary_list['wcml_currency'] = self::$_currency; return $vary_list; } } thirdparty/autoptimize.cls.php 0000777 00000001616 15251157102 0012613 0 ustar 00 <?php /** * The Third Party integration with the Autoptimize plugin. * * @since 1.0.12 * @package LiteSpeed * @subpackage LiteSpeed_Cache/thirdparty */ namespace LiteSpeed\Thirdparty; defined( 'WPINC' ) || exit; /** * Integration for Autoptimize cache events. */ class Autoptimize { /** * Detects if Autoptimize is active. * * @since 1.0.12 * @access public * @return void */ public static function detect() { if ( defined( 'AUTOPTIMIZE_PLUGIN_DIR' ) ) { add_action( 'litespeed_purge_finalize', __CLASS__ . '::purge' ); } } /** * Purges LiteSpeed cache when Autoptimize's cache is purged. * * @since 1.0.12 * @access public * @return void */ public static function purge() { if ( defined( 'AUTOPTIMIZE_PURGE' ) || has_action( 'shutdown', 'autoptimize_do_cachepurged_action', 11 ) ) { do_action( 'litespeed_purge_all', '3rd Autoptimize' ); } } } thirdparty/divi-theme-builder.cls.php 0000777 00000007105 15251157102 0013717 0 ustar 00 <?php /** * The Third Party integration with DIVI Theme. * * Ensures Divi Builder edit/preview modes don't conflict with LiteSpeed Cache features, * and registers required nonces for Divi modules. * * @since 2.9.0 * @package LiteSpeed * @subpackage LiteSpeed_Cache/thirdparty */ namespace LiteSpeed\Thirdparty; defined('WPINC') || exit(); /** * Handles Divi Theme Builder compatibility. */ class Divi_Theme_Builder { // private static $js_comment_box = false; /** * If Divi front-end edit/preview mode is active, disable LSCWP features to avoid conflicts. * * Note: This reads query vars only to detect Divi edit states. Nonce verification * is not applicable here because no privileged action is performed. * * @since 2.9.7.2 #435538 #581740 #977284 * @since 2.9.9.1 Added 'et_pb_preview' for loading image from library in Divi page edit * @return void */ public static function preload() { if (!function_exists('et_setup_theme')) { return; } // Sanitize incoming query params before use. $et_fb = isset($_GET['et_fb']) ? sanitize_text_field(wp_unslash($_GET['et_fb'])) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended $et_pb_preview = isset($_GET['et_pb_preview']) ? sanitize_text_field(wp_unslash($_GET['et_pb_preview'])) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended $p = isset($_GET['p']) ? absint(wp_unslash($_GET['p'])) : 0; // phpcs:ignore WordPress.Security.NonceVerification.Recommended $preview = isset($_GET['preview']) ? sanitize_text_field(wp_unslash($_GET['preview'])) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( '' !== $et_fb || '' !== $et_pb_preview || ( $p && 'true' === $preview ) ) { do_action( 'litespeed_disable_all', 'divi edit mode' ); } } /** * Detect Divi and register required integrations. * * - Allows the crawler to ignore Divi's first-visit "no-cache" for CCSS generation. * - Adds nonces used by Divi modules so cached pages still validate requests. * * @since 2.9.0 * @return void */ public static function detect() { if (!defined('ET_CORE')) { return; } // As DIVI may set first visit to non-cacheable to generate CCSS, // instruct the crawler to ignore that flag. if (!defined('LITESPEED_CRAWLER_IGNORE_NONCACHEABLE')) { define('LITESPEED_CRAWLER_IGNORE_NONCACHEABLE', true); } /** * Add contact form to nonce. * * @since 2.9.7.1 #475461 */ do_action('litespeed_nonce', 'et-pb-contact-form-submit'); /** * Subscribe module and A/B logging. * * @since 3.0 */ do_action('litespeed_nonce', 'et_frontend_nonce'); do_action('litespeed_nonce', 'et_ab_log_nonce'); /* // the comment box fix is for user using theme builder, ESI will load the wrong json string // As we disabled all for edit mode, this is no more needed add_action( 'et_fb_before_comments_template', 'Divi_Theme_Builder::js_comment_box_on' ); add_action( 'et_fb_after_comments_template', 'Divi_Theme_Builder::js_comment_box_off' ); add_filter( 'litespeed_esi_params-comment-form', 'Divi_Theme_Builder::esi_comment_add_slash' );// Note: this is changed in v2.9.8.1 */ } /* * Enable comment box JS mode (legacy code - currently disabled). * public static function js_comment_box_on() { self::$js_comment_box = true; } public static function js_comment_box_off() { self::$js_comment_box = false; } public static function esi_comment_add_slash( $params ) { if ( self::$js_comment_box ) { $params['is_json'] = 1; $params['_ls_silence'] = 1; } return $params; } */ } thirdparty/woocommerce.tab.tpl.php 0000777 00000000346 15251157102 0013342 0 ustar 00 <?php /** * WooCommerce tab template for LiteSpeed Cache plugin. * * @package LiteSpeed */ defined( 'WPINC' ) || exit; ?> <a class='litespeed-tab nav-tab' href='#woocommerce' data-litespeed-tab='woocommerce'>WooCommerce</a> thirdparty/gravity-forms.cls.php 0000777 00000002223 15251157102 0013045 0 ustar 00 <?php /** * The Third Party integration with Gravity Forms. * * @since 4.1.0 * @package LiteSpeed * @subpackage LiteSpeed_Cache\Thirdparty */ namespace LiteSpeed\Thirdparty; defined('WPINC') || exit(); /** * Gravity Forms compatibility hooks for LiteSpeed Cache. */ class Gravity_Forms { /** * Check if GF is enabled and disable LSCWP on gf-download and gf-signature URI. * * Note: Query params are only read to detect special Gravity Forms endpoints. * Nonce verification is not applicable here as no privileged action is performed. * * @since 4.1.0 #900899 #827184 * @return void */ public static function preload() { if (class_exists('GFCommon')) { $gf_download = isset($_GET['gf-download']) ? sanitize_text_field(wp_unslash($_GET['gf-download'])) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended $gf_signature = isset($_GET['gf-signature']) ? sanitize_text_field(wp_unslash($_GET['gf-signature'])) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ('' !== $gf_download || '' !== $gf_signature) { do_action('litespeed_disable_all', 'Stopped for Gravity Form'); } } } } thirdparty/bbpress.cls.php 0000777 00000005115 15251157102 0011677 0 ustar 00 <?php /** * The Third Party integration with the bbPress plugin. * * @since 1.0.5 * @package LiteSpeed * @subpackage LiteSpeed_Cache/thirdparty */ namespace LiteSpeed\Thirdparty; defined( 'WPINC' ) || exit; use LiteSpeed\Router; /** * Integration for bbPress cache handling and purging. */ class BBPress { /** * Detect if bbPress is installed and if the page is a bbPress page. * * @since 1.0.5 * @access public * @return void */ public static function detect() { if ( function_exists( 'is_bbpress' ) ) { add_action( 'litespeed_api_purge_post', __CLASS__ . '::on_purge' ); // todo if ( apply_filters( 'litespeed_esi_status', false ) ) { // Don't consider private cache yet (will do if any feedback) add_action( 'litespeed_control_finalize', __CLASS__ . '::set_control' ); } } } /** * This filter is used to let the cache know if a page is cacheable. * * @since 1.2.0 * @access public * @return void */ public static function set_control() { if ( ! apply_filters( 'litespeed_control_cacheable', false ) ) { return; } // Set non ESI public if ( is_bbpress() && Router::is_logged_in() ) { do_action( 'litespeed_control_set_nocache', 'bbpress nocache due to loggedin' ); } } /** * When a bbPress page is purged, need to purge the forums list and * any/all ancestor pages. * * @since 1.0.5 * @access public * @param int $post_id The post id of the page being purged. * @return void */ public static function on_purge( $post_id ) { if ( ! is_bbpress() ) { if ( ! function_exists( 'bbp_is_forum' ) || ! function_exists( 'bbp_is_topic' ) || ! function_exists( 'bbp_is_reply' ) ) { return; } if ( ! bbp_is_forum( $post_id ) && ! bbp_is_topic( $post_id ) && ! bbp_is_reply( $post_id ) ) { return; } } // Need to purge base forums page, bbPress page was updated. do_action( 'litespeed_purge_posttype', bbp_get_forum_post_type() ); $ancestors = get_post_ancestors( $post_id ); // If there are ancestors, need to purge them as well. if ( ! empty( $ancestors ) ) { foreach ( $ancestors as $ancestor ) { do_action( 'litespeed_purge_post', $ancestor ); } } global $wp_widget_factory; $replies_widget = $wp_widget_factory->get_widget_object( 'BBP_Replies_Widget' ); if ( bbp_is_reply( $post_id ) && $replies_widget ) { do_action( 'litespeed_purge_widget', $replies_widget->id ); } $topic_widget = $wp_widget_factory->get_widget_object( 'BBP_Topics_Widget' ); if ( bbp_is_topic( $post_id ) && $topic_widget ) { do_action( 'litespeed_purge_widget', $topic_widget->id ); } } } thirdparty/user-switching.cls.php 0000777 00000001431 15251157102 0013207 0 ustar 00 <?php /** * The Third Party integration with User Switching. * * @since 3.0 * @package LiteSpeed * @subpackage LiteSpeed_Cache\Thirdparty */ namespace LiteSpeed\Thirdparty; defined('WPINC') || exit(); /** * Provides compatibility for the User Switching plugin. */ class User_Switching { /** * Detects if User Switching is active and registers required nonces. * * @since 3.0 * @access public * @return void */ public static function detect() { if (!class_exists('user_switching')) { return; } /** * Register switch back URL nonce. * * @since 3.0 */ if (function_exists('current_user_switched')) { $old_user = current_user_switched(); if ($old_user) { do_action('litespeed_nonce', 'switch_to_olduser_' . $old_user->ID); } } } } thirdparty/litespeed-check.cls.php 0000777 00000012645 15251157102 0013276 0 ustar 00 <?php /** * Check if any plugins that could conflict with LiteSpeed Cache are active. * * @since 4.7 * @package LiteSpeed * @subpackage LiteSpeed_Cache\Thirdparty */ namespace LiteSpeed\Thirdparty; defined('WPINC') || exit(); /** * Detects incompatible plugins and displays admin notices if needed. */ class LiteSpeed_Check { /** * Incompatible plugins list. * * @var array */ public static $_incompatible_plugins = array( // 'autoptimize/autoptimize.php', 'breeze/breeze.php', 'cache-enabler/cache-enabler.php', 'cachify/cachify.php', 'cloudflare/cloudflare.php', 'comet-cache/comet-cache.php', 'docket-cache/docket-cache.php', 'fast-velocity-minify/fvm.php', 'hummingbird-performance/wp-hummingbird.php', 'nginx-cache/nginx-cache.php', 'nitropack/main.php', 'pantheon-advanced-page-cache/pantheon-advanced-page-cache.php', 'powered-cache/powered-cache.php', 'psn-pagespeed-ninja/pagespeedninja.php', 'sg-cachepress/sg-cachepress.php', 'simple-cache/simple-cache.php', // 'redis-cache/redis-cache.php', 'w3-total-cache/w3-total-cache.php', 'wp-cloudflare-page-cache/wp-cloudflare-page-cache.php', 'wp-fastest-cache/wpFastestCache.php', 'wp-meteor/wp-meteor.php', 'wp-optimize/wp-optimize.php', 'wp-performance-score-booster/wp-performance-score-booster.php', 'wp-rocket/wp-rocket.php', 'wp-super-cache/wp-cache.php', ); /** * Option key for storing notice state. * * @var string */ private static $_option = 'thirdparty_litespeed_check'; /** * Admin notice HTML ID. * * @var string */ private static $_msg_id = 'id="lscwp-incompatible-plugin-notice"'; /** * Detect incompatible plugins and hook into plugin lifecycle. * * @since 4.7 * @return void */ public static function detect() { if (!is_admin()) { return; } /** * Check for incompatible plugins when `litespeed-cache` is first activated. */ $plugin = basename(LSCWP_DIR) . '/litespeed-cache.php'; register_deactivation_hook($plugin, function ( $network_wide ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found \LiteSpeed\Admin_Display::delete_option(self::$_option); }); if (!\LiteSpeed\Admin_Display::get_option(self::$_option)) { self::activated_plugin($plugin, null); \LiteSpeed\Admin_Display::add_option(self::$_option, true); } /** * Check for incompatible plugins when any plugin is (de)activated. */ add_action('activated_plugin', __CLASS__ . '::activated_plugin', 10, 2); add_action('deactivated_plugin', __CLASS__ . '::deactivated_plugin', 10, 2); if (class_exists('PagespeedNinja')) { \LiteSpeed\Admin_Display::error( '<div ' . self::$_msg_id . '>' . __('Please consider disabling the following detected plugins, as they may conflict with LiteSpeed Cache:', 'litespeed-cache') . '<p style="color: red; font-weight: 700;">' . 'PageSpeed Ninja' . '</p>' . '</div>' ); } } /** * Handle plugin activation. * * @since 4.7 * @param string $plugin Plugin path. * @param bool $network_wide Whether activated network-wide. * @return void */ public static function activated_plugin( $plugin, $network_wide ) { self::incompatible_plugin_notice($plugin, $network_wide, 'activated'); } /** * Handle plugin deactivation. * * @since 4.7 * @param string $plugin Plugin path. * @param bool $network_wide Whether deactivated network-wide. * @return void */ public static function deactivated_plugin( $plugin, $network_wide ) { self::incompatible_plugin_notice($plugin, $network_wide, 'deactivated'); } /** * Detect any incompatible plugins that are currently `active` and `valid`. * Show a notification if there are any. * * @since 4.7 * @param string $plugin Plugin path. * @param bool $_network_wide Whether action is network-wide. * @param string $action Action type (activated|deactivated). * @return void */ public static function incompatible_plugin_notice( $plugin, $_network_wide, $action ) { self::update_messages(); $deactivated = 'deactivated' === $action ? array( $plugin ) : array(); $incompatible_plugins = array_map(function ( $plugin ) { return WP_PLUGIN_DIR . '/' . $plugin; }, array_diff(self::$_incompatible_plugins, $deactivated)); $active_incompatible_plugins = array_map(function ( $plugin ) { $plugin = get_plugin_data($plugin, false, true); return $plugin['Name']; }, array_intersect($incompatible_plugins, wp_get_active_and_valid_plugins())); if (empty($active_incompatible_plugins)) { return; } \LiteSpeed\Admin_Display::error( '<div ' . self::$_msg_id . '>' . __('Please consider disabling the following detected plugins, as they may conflict with LiteSpeed Cache:', 'litespeed-cache') . '<p style="color: red; font-weight: 700;">' . implode(', ', $active_incompatible_plugins) . '</p>' . '</div>', false, true ); } /** * Prevent multiple incompatible plugin notices. * * @since 4.7 * @return void */ private static function update_messages() { $messages = \LiteSpeed\Admin_Display::get_option(\LiteSpeed\Admin_Display::DB_MSG_PIN, array()); if (is_array($messages)) { foreach ($messages as $index => $message) { if (strpos($message, self::$_msg_id) !== false) { unset($messages[$index]); if (!$messages) { $messages = -1; } \LiteSpeed\Admin_Display::update_option(\LiteSpeed\Admin_Display::DB_MSG_PIN, $messages); break; } } } } } thirdparty/aelia-currencyswitcher.cls.php 0000777 00000005255 15251157102 0014720 0 ustar 00 <?php /** * The Third Party integration with the Aelia CurrencySwitcher plugin. * * @since 1.0.13 * @since 2.6 Removed hook_vary as OLS supports vary header already * @package LiteSpeed * @subpackage LiteSpeed_Cache/thirdparty */ namespace LiteSpeed\Thirdparty; defined( 'WPINC' ) || exit(); /** * Integration layer for Aelia Currency Switcher. * * Registers the plugin cookies as Vary drivers so cached pages can differ by * selected currency / location. Hooks both the runtime vary list (headers) * and the rewrite-rules vary list (always needed). */ class Aelia_CurrencySwitcher { /** * Cookie names used by Aelia Currency Switcher to determine currency & geo. * * @var string[] */ private static $_cookies = array( 'aelia_cs_selected_currency', 'aelia_customer_country', 'aelia_customer_state', 'aelia_tax_exempt' ); /** * Detects if WooCommerce + Aelia Currency Switcher are present and registers hooks. * * @since 1.0.13 * @access public * @return void */ public static function detect() { if ( defined( 'WOOCOMMERCE_VERSION' ) && isset( $GLOBALS['woocommerce-aelia-currencyswitcher'] ) && is_object( $GLOBALS['woocommerce-aelia-currencyswitcher'] ) ) { // Not all pages need to add vary, so allow sites to restrict via filter. self::$_cookies = apply_filters( 'litespeed_3rd_aelia_cookies', self::$_cookies ); // Add cookies to the active vary header list (conditionally used at runtime). add_filter( 'litespeed_vary_curr_cookies', __CLASS__ . '::check_cookies' ); // Ensure rewrite rules are aware of these cookies (always include). add_filter( 'litespeed_vary_cookies', __CLASS__ . '::register_cookies' ); } } /** * Ensure Aelia cookies are part of the global vary cookie registry. * * @since 1.0.13 * * @param string[] $cookies Current list of vary cookies. * @return string[] Updated list including Aelia cookies. */ public static function register_cookies( $cookies ) { return array_merge( $cookies, self::$_cookies ); } /** * Conditionally append Aelia cookies to the vary header set for WooCommerce pages. * * If the page is not a WooCommerce page, leave the list unchanged. * Otherwise, append Aelia's cookies so responses vary correctly. * * @since 1.0.13 * @access public * * @param string[] $cookies Current list of vary cookies for the response. * @return string[] Potentially augmented list of vary cookies. */ public static function check_cookies( $cookies ) { // NOTE: is_cart and is_checkout are handled by WooCommerce itself. if ( ! function_exists( 'is_woocommerce' ) || ! is_woocommerce() ) { return $cookies; } return array_merge( $cookies, self::$_cookies ); } } thirdparty/wp-postratings.cls.php 0000777 00000001604 15251157102 0013237 0 ustar 00 <?php /** * The Third Party integration with the WP-PostRatings plugin. * * Hooks into rating events to purge related caches. * * @since 1.1.1 * @package LiteSpeed */ namespace LiteSpeed\Thirdparty; defined( 'WPINC' ) || exit(); /** * WP-PostRatings integration for LiteSpeed Cache. */ class WP_PostRatings { /** * Detects if the WP-PostRatings plugin is active and registers hooks. * * @since 1.1.1 * @return void */ public static function detect() { if ( defined( 'WP_POSTRATINGS_VERSION' ) ) { add_action( 'rate_post', __CLASS__ . '::flush', 10, 3 ); } } /** * Purge the cache for a rated post. * * @since 1.1.1 * * @param int $uid User ID who rated. * @param int $post_id The rated post ID. * @return void */ public static function flush( $uid, $post_id ) { do_action( 'litespeed_purge_post', (int) $post_id ); } } thirdparty/woo-paypal.cls.php 0000777 00000001545 15251157102 0012332 0 ustar 00 <?php /** * The Third Party integration with WooCommerce PayPal Checkout Gateway. * * @ref https://wordpress.org/plugins/woocommerce-gateway-paypal-express-checkout/ * * @since 3.0 * @package LiteSpeed * @subpackage LiteSpeed_Cache\Thirdparty */ namespace LiteSpeed\Thirdparty; defined('WPINC') || exit(); /** * Provides compatibility with WooCommerce PayPal Checkout. */ class Woo_Paypal { /** * Detect if WooCommerce PayPal Checkout is active and register nonces. * * @since 3.0 * @access public * @return void */ public static function detect() { if (!defined('WC_GATEWAY_PPEC_VERSION')) { return; } do_action('litespeed_nonce', '_wc_ppec_update_shipping_costs_nonce private'); do_action('litespeed_nonce', '_wc_ppec_start_checkout_nonce private'); do_action('litespeed_nonce', '_wc_ppec_generate_cart_nonce private'); } } security.md 0000777 00000000562 15251157102 0006746 0 ustar 00 # Security Policy ## Reporting Security Bugs We take security seriously. Please report potential vulnerabilities found in the LiteSpeed Cache plugin's source code via email to `support@litespeedtech.com` or open a ticket from your LiteSpeed Client Area. Please see [Reporting Vulnerabilities](https://www.litespeedtech.com/report-security-bugs) for more information. package-lock.json 0000777 00000006221 15251157102 0007767 0 ustar 00 { "name": "litespeed-cache", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "litespeed-cache", "license": "GPLv3", "devDependencies": { "@prettier/plugin-php": "^0.21.0", "prettier": "^3.0.3" } }, "node_modules/@prettier/plugin-php": { "version": "0.21.0", "resolved": "https://registry.npmjs.org/@prettier/plugin-php/-/plugin-php-0.21.0.tgz", "integrity": "sha512-vWC6HIUUfhvl/7F5IxVQ0ItGB/7ZY+jDlX7KsTqvfKMODW/zvzj8r1Ab4harS22+O3xxHykVVd5jvylmxMMctg==", "dev": true, "dependencies": { "linguist-languages": "^7.21.0", "mem": "^9.0.2", "php-parser": "^3.1.5" }, "peerDependencies": { "prettier": "^3.0.0" } }, "node_modules/linguist-languages": { "version": "7.27.0", "resolved": "https://registry.npmjs.org/linguist-languages/-/linguist-languages-7.27.0.tgz", "integrity": "sha512-Wzx/22c5Jsv2ag+uKy+ITanGA5hzvBZngrNGDXLTC7ZjGM6FLCYGgomauTkxNJeP9of353OM0pWqngYA180xgw==", "dev": true }, "node_modules/map-age-cleaner": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", "dev": true, "dependencies": { "p-defer": "^1.0.0" }, "engines": { "node": ">=6" } }, "node_modules/mem": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/mem/-/mem-9.0.2.tgz", "integrity": "sha512-F2t4YIv9XQUBHt6AOJ0y7lSmP1+cY7Fm1DRh9GClTGzKST7UWLMx6ly9WZdLH/G/ppM5RL4MlQfRT71ri9t19A==", "dev": true, "dependencies": { "map-age-cleaner": "^0.1.3", "mimic-fn": "^4.0.0" }, "engines": { "node": ">=12.20" }, "funding": { "url": "https://github.com/sindresorhus/mem?sponsor=1" } }, "node_modules/mimic-fn": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", "integrity": "sha512-wB3wfAxZpk2AzOfUMJNL+d36xothRSyj8EXOa4f6GMqYDN9BJaaSISbsk+wS9abmnebVw95C2Kb5t85UmpCxuw==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/php-parser": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/php-parser/-/php-parser-3.1.5.tgz", "integrity": "sha512-jEY2DcbgCm5aclzBdfW86GM6VEIWcSlhTBSHN1qhJguVePlYe28GhwS0yoeLYXpM2K8y6wzLwrbq814n2PHSoQ==", "dev": true }, "node_modules/prettier": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" }, "engines": { "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" } } } } data/optm_uri_exc.txt 0000777 00000000571 15251157102 0010724 0 ustar 00 # Predefined list for excluding URI from page optimization # # Comment can use `# `(there is a space following), or `##`, can use both as a new line or end of one line # If you want to predefine new items, please send a Pull Request to https://github.com/litespeedtech/lscache_wp/blob/dev/data/optm_uri_exc.txt We will merge into next plugin release # URI excludes .well-known data/const.default.json 0000777 00000013257 15251157102 0011137 0 ustar 00 { "auto_upgrade": "", "server_ip": "", "guest": "", "guest_optm": "", "news": "1", "cache-priv": "1", "cache-commenter": "1", "cache-rest": "1", "cache-page_login": "1", "cache-resources": "1", "cache-browser": "", "cache-mobile": "", "cache-mobile_rules": "Mobile\nAndroid\nSilk/\nKindle\nBlackBerry\nOpera Mini\nOpera Mobi", "cache-exc_useragents": "", "cache-exc_cookies": "", "cache-exc_qs": "", "cache-exc_cat": "", "cache-exc_tag": "", "cache-force_uri": "", "cache-force_pub_uri": "", "cache-priv_uri": "", "cache-exc": "", "cache-exc_roles": "", "cache-drop_qs": "fbclid\ngclid\nutm*\n_ga", "cache-ttl_pub": "604800", "cache-ttl_priv": "1800", "cache-ttl_frontpage": "604800", "cache-ttl_feed": "604800", "cache-ttl_rest": "604800", "cache-ttl_browser": "31557600", "cache-login_cookie": "", "cache-vary_group": "", "cache-ttl_status": "404 3600\n500 600", "purge-upgrade": "0", "purge-stale": "", "purge-post_all": "", "purge-post_f": "1", "purge-post_h": "1", "purge-post_p": "1", "purge-post_pwrp": "1", "purge-post_a": "1", "purge-post_y": "", "purge-post_m": "1", "purge-post_d": "", "purge-post_t": "1", "purge-post_pt": "1", "purge-timed_urls": "", "purge-timed_urls_time": "", "purge-hook_all": "switch_theme\nwp_create_nav_menu\nwp_update_nav_menu\nwp_delete_nav_menu\ncreate_term\nedit_terms\ndelete_term\nadd_link\nedit_link\ndelete_link", "esi": "", "esi-cache_admbar": "1", "esi-cache_commform": "1", "esi-nonce": "stats_nonce\nsubscribe_nonce", "util-heartbeat": "1", "util-instant_click": "", "util-no_https_vary": "", "debug-disable_all": "", "debug": "", "debug-ips": "127.0.0.1", "debug-level": "", "debug-filesize": "3", "debug-collapse_qs": "", "debug-inc": "", "debug-exc": "", "debug-exc_strings": "", "db_optm-revisions_max": "0", "db_optm-revisions_age": "0", "optm-css_min": "", "optm-css_comb": "", "optm-css_comb_ext_inl": "1", "optm-ucss": "", "optm-ucss_inline": "", "optm-ucss_file_exc_inline": "", "optm-ucss_whitelist": "", "optm-ucss_exc": "", "optm-css_exc": "", "optm-js_min": "", "optm-js_comb": "", "optm-js_comb_ext_inl": "1", "optm-js_exc": "jquery.js\njquery.min.js", "optm-html_min": "", "optm-html_lazy": "", "optm-qs_rm": "", "optm-ggfonts_rm": "", "optm-css_async": "", "optm-ccss_per_url": "", "optm-ccss_whitelist": "", "optm-css_async_inline": "1", "optm-css_font_display": "", "optm-js_defer": "", "optm-emoji_rm": "", "optm-noscript_rm": "", "optm-ggfonts_async": "", "optm-exc_roles": "", "optm-ccss_con": "", "optm-ccss_sep_posttype": "page", "optm-ccss_sep_uri": "", "optm-js_defer_exc": "jquery.js\njquery.min.js\ngtm.js\nanalytics.js", "optm-gm_js_exc": "", "optm-dns_prefetch": "", "optm-dns_prefetch_ctrl": "", "optm-dns_preconnect": "", "optm-exc": "", "optm-guest_only": "1", "object": "", "object-kind": "", "object-host": "localhost", "object-port": "11211", "object-life": "360", "object-persistent": "1", "object-admin": "1", "object-transients": "1", "object-db_id": "0", "object-user": "", "object-pswd": "", "object-global_groups": "users\nuserlogins\nuseremail\nuserslugs\nusermeta\nuser_meta\nsite-transient\nsite-options\nsite-lookup\nsite-details\nblog-lookup\nblog-details\nblog-id-cache\nrss\nglobal-posts\nglobal-cache-test", "object-non_persistent_groups": "comment\ncounts\nplugins\nwc_session_id", "discuss-avatar_cache": "", "discuss-avatar_cron": "", "discuss-avatar_cache_ttl": "604800", "optm-localize": "", "optm-localize_domains": "### Popular scripts ###\nhttps://platform.twitter.com/widgets.js\nhttps://connect.facebook.net/en_US/fbevents.js", "media-lazy": "", "media-lazy_placeholder": "", "media-placeholder_resp": "", "media-placeholder_resp_color": "#cfd4db", "media-placeholder_resp_svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"{width}\" height=\"{height}\" viewBox=\"0 0 {width} {height}\"><rect width=\"100%\" height=\"100%\" style=\"fill:{color};fill-opacity: 0.1;\"/></svg>", "media-lqip": "", "media-lqip_qual": "4", "media-lqip_min_w": "150", "media-lqip_min_h": "150", "media-placeholder_resp_async": "1", "media-iframe_lazy": "", "media-add_missing_sizes": "", "media-lazy_exc": "", "media-lazy_cls_exc": "wmu-preview-img", "media-lazy_parent_cls_exc": "", "media-iframe_lazy_cls_exc": "", "media-iframe_lazy_parent_cls_exc": "", "media-lazy_uri_exc": "", "media-lqip_exc": "", "media-vpi": "", "media-vpi_cron": "", "img_optm-auto": "", "img_optm-ori": "1", "img_optm-rm_bkup": "", "img_optm-webp": "", "img_optm-lossless": "", "img_optm-exif": "1", "img_optm-webp_attr": "img.src\ndiv.data-thumb\nimg.data-src\nimg.data-lazyload\ndiv.data-large_image\nimg.retina_logo_url\ndiv.data-parallax-image\ndiv.data-vc-parallax-image\nvideo.poster", "img_optm-webp_replace_srcset": "", "img_optm-jpg_quality": "82", "crawler": "", "crawler-crawl_interval": "302400", "crawler-load_limit": "1", "crawler-sitemap": "", "crawler-roles": "", "crawler-cookies": "", "misc-heartbeat_front": "", "misc-heartbeat_front_ttl": "60", "misc-heartbeat_back": "", "misc-heartbeat_back_ttl": "60", "misc-heartbeat_editor": "", "misc-heartbeat_editor_ttl": "15", "cdn": "", "cdn-attr": ".src\n.data-src\n.href\n.poster\nsource.srcset", "cdn-ori": "", "cdn-ori_dir": "", "cdn-exc": "", "cdn-quic": "", "cdn-quic_email": "", "cdn-quic_key": "", "cdn-cloudflare": "", "cdn-cloudflare_email": "", "cdn-cloudflare_key": "", "cdn-cloudflare_name": "", "cdn-cloudflare_zone": "", "cdn-cloudflare_clear": "", "cdn-mapping": { "url": [""], "inc_js": ["1"], "inc_css": ["1"], "inc_img": ["1"], "filetype": [".aac\n.css\n.eot\n.gif\n.jpeg\n.jpg\n.js\n.less\n.mp3\n.mp4\n.ogg\n.otf\n.pdf\n.png\n.svg\n.ttf\n.webp\n.woff\n.woff2"] } } data/preset/essentials.data 0000777 00000002712 15251157102 0011774 0 ustar 00 ["_version","5.3"] ["guest",false] ["guest_optm",false] ["cache",true] ["cache-priv",true] ["cache-commenter",true] ["cache-rest",true] ["cache-page_login",true] ["cache-resources",true] ["cache-mobile",false] ["cache-browser",true] ["esi",false] ["esi-cache_admbar",true] ["esi-cache_commform",true] ["util-instant_click",false] ["util-no_https_vary",false] ["optm-css_min",false] ["optm-css_comb",false] ["optm-css_comb_ext_inl",true] ["optm-ucss",false] ["optm-ucss_inline",false] ["optm-js_min",false] ["optm-js_comb",false] ["optm-js_comb_ext_inl",true] ["optm-html_min",false] ["optm-qs_rm",false] ["optm-ggfonts_rm",false] ["optm-css_async",false] ["optm-ccss_per_url",false] ["optm-css_async_inline",true] ["optm-css_font_display",false] ["optm-js_defer",0] ["optm-emoji_rm",false] ["optm-noscript_rm",false] ["optm-ggfonts_async",false] ["optm-dns_prefetch_ctrl",false] ["optm-guest_only",true] ["discuss-avatar_cache",false] ["discuss-avatar_cron",false] ["optm-localize",false] ["media-lazy",false] ["media-lazy_placeholder",""] ["media-placeholder_resp",false] ["media-lqip",false] ["media-placeholder_resp_async",true] ["media-iframe_lazy",false] ["media-add_missing_sizes",false] ["media-vpi",false] ["media-vpi_cron",false] ["img_optm-auto",false] ["img_optm-ori",true] ["img_optm-rm_bkup",false] ["img_optm-webp",false] ["img_optm-lossless",false] ["img_optm-exif",false] ["img_optm-webp_replace_srcset",false] data/preset/extreme.data 0000777 00000003000 15251157102 0011262 0 ustar 00 ["_version","5.3"] ["guest",true] ["guest_optm",true] ["cache",true] ["cache-priv",true] ["cache-commenter",true] ["cache-rest",true] ["cache-page_login",true] ["cache-resources",true] ["cache-mobile",true] ["cache-browser",true] ["esi",false] ["esi-cache_admbar",true] ["esi-cache_commform",true] ["util-instant_click",false] ["util-no_https_vary",false] ["optm-css_min",true] ["optm-css_comb",true] ["optm-css_comb_ext_inl",true] ["optm-ucss",true] ["optm-ucss_inline",false] ["optm-js_min",true] ["optm-js_comb",true] ["optm-js_comb_ext_inl",true] ["optm-html_min",true] ["optm-qs_rm",true] ["optm-ggfonts_rm",false] ["optm-css_async",true] ["optm-ccss_per_url",true] ["optm-css_async_inline",true] ["optm-css_font_display",true] ["optm-js_defer",2] ["optm-emoji_rm",true] ["optm-noscript_rm",true] ["optm-ggfonts_async",false] ["optm-dns_prefetch_ctrl",true] ["optm-guest_only",true] ["discuss-avatar_cache",true] ["discuss-avatar_cron",true] ["optm-localize",false] ["media-lazy",true] ["media-lazy_placeholder","data:image\/gif;base64,R0lGODlhAQABAIAAAAAAAP\/\/\/yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"] ["media-placeholder_resp",true] ["media-lqip",true] ["media-placeholder_resp_async",true] ["media-iframe_lazy",true] ["media-add_missing_sizes",true] ["media-vpi",true] ["media-vpi_cron",true] ["img_optm-auto",true] ["img_optm-ori",true] ["img_optm-rm_bkup",false] ["img_optm-webp",true] ["img_optm-lossless",false] ["img_optm-exif",false] ["img_optm-webp_replace_srcset",true] data/preset/advanced.data 0000777 00000002675 15251157102 0011377 0 ustar 00 ["_version","5.3"] ["guest",true] ["guest_optm",true] ["cache",true] ["cache-priv",true] ["cache-commenter",true] ["cache-rest",true] ["cache-page_login",true] ["cache-resources",true] ["cache-mobile",true] ["cache-browser",true] ["esi",false] ["esi-cache_admbar",true] ["esi-cache_commform",true] ["util-instant_click",false] ["util-no_https_vary",false] ["optm-css_min",true] ["optm-css_comb",false] ["optm-css_comb_ext_inl",false] ["optm-ucss",false] ["optm-ucss_inline",false] ["optm-js_min",true] ["optm-js_comb",false] ["optm-js_comb_ext_inl",false] ["optm-html_min",true] ["optm-qs_rm",true] ["optm-ggfonts_rm",false] ["optm-css_async",false] ["optm-ccss_per_url",false] ["optm-css_async_inline",false] ["optm-css_font_display",true] ["optm-js_defer",1] ["optm-emoji_rm",true] ["optm-noscript_rm",true] ["optm-ggfonts_async",false] ["optm-dns_prefetch_ctrl",true] ["optm-guest_only",true] ["discuss-avatar_cache",true] ["discuss-avatar_cron",true] ["optm-localize",false] ["media-lazy",false] ["media-lazy_placeholder",""] ["media-placeholder_resp",false] ["media-lqip",false] ["media-placeholder_resp_async",true] ["media-iframe_lazy",false] ["media-add_missing_sizes",false] ["media-vpi",false] ["media-vpi_cron",false] ["img_optm-auto",true] ["img_optm-ori",true] ["img_optm-rm_bkup",false] ["img_optm-webp",true] ["img_optm-lossless",false] ["img_optm-exif",false] ["img_optm-webp_replace_srcset",true] data/preset/aggressive.data 0000777 00000002666 15251157102 0011771 0 ustar 00 ["_version","5.3"] ["guest",true] ["guest_optm",true] ["cache",true] ["cache-priv",true] ["cache-commenter",true] ["cache-rest",true] ["cache-page_login",true] ["cache-resources",true] ["cache-mobile",true] ["cache-browser",true] ["esi",false] ["esi-cache_admbar",true] ["esi-cache_commform",true] ["util-instant_click",false] ["util-no_https_vary",false] ["optm-css_min",true] ["optm-css_comb",true] ["optm-css_comb_ext_inl",false] ["optm-ucss",true] ["optm-ucss_inline",false] ["optm-js_min",true] ["optm-js_comb",true] ["optm-js_comb_ext_inl",false] ["optm-html_min",true] ["optm-qs_rm",true] ["optm-ggfonts_rm",false] ["optm-css_async",true] ["optm-ccss_per_url",true] ["optm-css_async_inline",true] ["optm-css_font_display",true] ["optm-js_defer",1] ["optm-emoji_rm",true] ["optm-noscript_rm",true] ["optm-ggfonts_async",false] ["optm-dns_prefetch_ctrl",true] ["optm-guest_only",true] ["discuss-avatar_cache",true] ["discuss-avatar_cron",true] ["optm-localize",false] ["media-lazy",false] ["media-lazy_placeholder",""] ["media-placeholder_resp",false] ["media-lqip",false] ["media-placeholder_resp_async",true] ["media-iframe_lazy",true] ["media-add_missing_sizes",false] ["media-vpi",false] ["media-vpi_cron",false] ["img_optm-auto",true] ["img_optm-ori",true] ["img_optm-rm_bkup",false] ["img_optm-webp",true] ["img_optm-lossless",false] ["img_optm-exif",false] ["img_optm-webp_replace_srcset",true] data/preset/basic.data 0000777 00000002706 15251157102 0010706 0 ustar 00 ["_version","5.3"] ["guest",false] ["guest_optm",false] ["cache",true] ["cache-priv",true] ["cache-commenter",true] ["cache-rest",true] ["cache-page_login",true] ["cache-resources",true] ["cache-mobile",true] ["cache-browser",true] ["esi",false] ["esi-cache_admbar",true] ["esi-cache_commform",true] ["util-instant_click",false] ["util-no_https_vary",false] ["optm-css_min",false] ["optm-css_comb",false] ["optm-css_comb_ext_inl",true] ["optm-ucss",false] ["optm-ucss_inline",false] ["optm-js_min",false] ["optm-js_comb",false] ["optm-js_comb_ext_inl",true] ["optm-html_min",false] ["optm-qs_rm",false] ["optm-ggfonts_rm",false] ["optm-css_async",false] ["optm-ccss_per_url",false] ["optm-css_async_inline",true] ["optm-css_font_display",false] ["optm-js_defer",0] ["optm-emoji_rm",false] ["optm-noscript_rm",false] ["optm-ggfonts_async",false] ["optm-dns_prefetch_ctrl",false] ["optm-guest_only",true] ["discuss-avatar_cache",false] ["discuss-avatar_cron",false] ["optm-localize",false] ["media-lazy",false] ["media-lazy_placeholder",""] ["media-placeholder_resp",false] ["media-lqip",false] ["media-placeholder_resp_async",true] ["media-iframe_lazy",false] ["media-add_missing_sizes",false] ["media-vpi",false] ["media-vpi_cron",false] ["img_optm-auto",true] ["img_optm-ori",true] ["img_optm-rm_bkup",false] ["img_optm-webp",true] ["img_optm-lossless",false] ["img_optm-exif",false] ["img_optm-webp_replace_srcset",true] data/js_excludes.txt 0000777 00000002057 15251157102 0010540 0 ustar 00 # Predefined list for excluding JS files or inline JS codes # # Comment can use `# `(there is a space following), or `##`, can use both as a new line or end of one line # If you want to predefine new items, please send a Pull Request to https://github.com/litespeedtech/lscache_wp/blob/dev/data/js_excludes.txt We will merge into next plugin release # JS file URL excludes maps-api-ssl.google.com maps.google.com/maps maps.googleapis.com google.com/recaptcha google-analytics.com/analytics.js stats.wp.com js.stripe.com paypal.com/sdk/js cse.google.com/cse.js /syntaxhighlighter/ spotlight-social-photo-feeds ## https://docs.spotlightwp.com/article/757-autoptimize-compatibility @Tobolo userway.org # Inline JS excludes document.write gtag gtm dataLayer adsbygoogle block_tdi_ ## Theme: Newspaper by tagDiv.com data-view-breakpoint-pointer ## Plugin: The Events Calendar by Modern Tribe (https://theeventscalendar.com/) wp-json/wp-statistics ## WP Statistics ## JetPack Stats stats.wp.com/e- _stq # Cloudflare turnstile - Tobolo turnstile challenges.cloudflare.com data/cache_nocacheable.txt 0000777 00000000677 15251157102 0011605 0 ustar 00 # Predefined list for Do Not Cache URIs # # Comment can use `# `(there is a space following), or `##`, can use both as a new line or end of one line # If you want to predefine new items, please send a Pull Request to https://github.com/litespeedtech/lscache_wp/blob/dev/data/cache_nocacheable.txt We will merge into next plugin release # WP v6.6 Official Site Editor (Appearance >> Editor) ^/wp-json/wp/v2 # Elementor API ^/wp-json/elementor/v1 data/gm_ips.txt 0000777 00000001206 15251157102 0007501 0 ustar 00 66.102.0.0/20 66.249.64.0/19 74.125.0.0/16 142.250.0.0/15 172.255.48.128/27 172.255.61.32/28 208.70.247.157 52.229.122.240 104.214.72.101 13.66.7.11 13.85.24.83 13.85.24.90 13.85.82.26 40.74.242.253 40.74.243.13 40.74.243.176 104.214.48.247 157.55.189.189 104.214.110.135 70.37.83.240 65.52.36.250 13.78.216.56 52.162.212.163 23.96.34.105 65.52.113.236 104.41.2.19 191.235.98.164 191.235.99.221 191.232.194.51 52.237.235.185 52.237.250.73 52.237.236.145 104.211.143.8 104.211.165.53 52.172.14.87 40.83.89.214 52.175.57.81 20.188.63.151 20.52.36.49 52.246.165.153 51.144.102.233 13.76.97.224 102.133.169.66 52.231.199.170 13.53.162.7 40.123.218.94 data/ccss_whitelist.txt 0000777 00000000715 15251157102 0011256 0 ustar 00 # Predefined list for CCSS whitelist # # Comment can use `# `(there is a space following), or `##`, can use both as a new line or end of one line # If you want to predefine new items, please send a Pull Request to https://github.com/litespeedtech/lscache_wp/blob/dev/data/ccss_whitelist.txt We will merge into next plugin release ############# DoBar compatibility ############# .pace-inactive ############# DIVI ################ .et_pb_number_counter.active data/esi.nonces.txt 0000777 00000003173 15251157102 0010274 0 ustar 00 ## To predefine more list, please submit a PR to https://github.com/litespeedtech/lscache_wp/blob/dev/data/esi.nonces.txt ## Comment Format: ## 1. `# this is comment` ## 2. `##this is comment` ## Predefined elsewhere so not needed here: ## WordPress core # stats_nonce # subscribe_nonce # Divi Theme Builder # et-pb-contact-form-submit # et_frontend_nonce # et_ab_log_nonce # WooCommerce PayPal Checkout # _wc_ppec_update_shipping_costs_nonce private # _wc_ppec_start_checkout_nonce private # _wc_ppec_generate_cart_nonce private # User Switching # switch_to_olduser_'<ID>' # Caldera Forms # caldera_forms_front_* ## Predefined list of ESI nonces: # WordPress REST nonce wp_rest # CM Registration Pro cmreg_registration_nonce private role_nonce private # WooCommerce Delivery Area Pro #16843635 wdap-call-nonce private # SEOpress Cookie Consent seopress_cookies_user_consent_nonce # SearchWP Metrics swpmtxnonce # The Events Calendar _tec_view_rest_nonce_primary _tec_view_rest_nonce_secondary # wpDataTables #986128 wdt* # WPBakery gallery _vcnonce data-vc-public-nonce # Extra Theme rating_nonce timeline_nonce blog_feed_nonce # WS Form wsf_post # Easy Digital Download (EDD) edd-* private edd_* private # WP Menu Cart wpmenucart private # Advanced Custom Fields + Advanced Forms acf_nonce af_form_nonce af_submission_* # Woo nonce woocommerce-login # Premium Addons for Elementor pa-blog-widget-nonce # WPUF User Frontend wpuf* private # MetForm form_nonce # Mobile hamburger menu - jetMenu #306983 #163710 PR#419 tgmpa-* bulk-* # WP Data Access wpda-* # Elementor elementor-pro-frontend elementor-conversion-center-click data/js_defer_excludes.txt 0000777 00000000774 15251157102 0011711 0 ustar 00 # Predefined list for excluding deferred JS files or inline JS codes # # Comment can use `# `(there is a space following), or `##`, can use both as a new line or end of one line # If you want to predefine new items, please send a Pull Request to https://github.com/litespeedtech/lscache_wp/blob/dev/data/js_defer_excludes.txt We will merge into next plugin release # JS file URL excludes adsbygoogle ## JetPack Stats stats.wp.com/e- _stq # Cloudflare turnstile - Tobolo turnstile challenges.cloudflare.com data/.htaccess 0000777 00000000151 15251157102 0007256 0 ustar 00 Order Deny,Allow Deny from All <IfModule LiteSpeed> RewriteEngine on RewriteRule .* - [F,L] </IfModule> data/css_excludes.txt 0000777 00000001276 15251157102 0010716 0 ustar 00 # Predefined list for excluding CSS files or inline CSS codes # # Comment can use `# `(there is a space following), or `##`, can use both as a new line or end of one line # If you want to predefine new items, please send a Pull Request to https://github.com/litespeedtech/lscache_wp/blob/dev/data/css_excludes.txt We will merge into next plugin release # CSS file URL excludes # Inline CSS excludes ########## Flatsome theme random string excludes ############ #row- #col- #cats- #stack- #timer- #gap- #portfolio- #image_ #banner- #map- #text- #page-header- #section_ .tdi_ # Theme: Newspaper by tagDiv.com 2020 ######### WoodMart - Responsive WooCommerce WordPress Theme ######## .tabs-wd- #wd- data/gm_uas.txt 0000777 00000000101 15251157102 0007467 0 ustar 00 Lighthouse GTmetrix Google Pingdom bot spider PTST HeadlessChrome data/const.network_default.json 0000777 00000002304 15251157102 0012677 0 ustar 00 { "cache": false, "use_primary_settings": false, "auto_upgrade": false, "cache-resources": true, "cache-browser": false, "cache-mobile": false, "cache-mobile_rules": "Mobile\nAndroid\nSilk/\nKindle\nBlackBerry\nOpera Mini\nOpera Mobi", "cache-drop_qs": "fbclid\ngclid\nutm*\n_ga", "cache-login_cookie": "", "cache-exc_cookies": "", "cache-exc_useragents": "", "cache-ttl_browser": 31557600, "purge-upgrade": false, "object": false, "object-kind": false, "object-host": "localhost", "object-port": 11211, "object-life": 360, "object-persistent": true, "object-admin": true, "object-transients": true, "object-db_id": 0, "object-user": "", "object-pswd": "", "object-global_groups": "users\nuserlogins\nusermeta\nuser_meta\nuseremail\nuserslugs\nsites\nsite-details\nsite-transient\nsite-options\nsite-lookup\nblog-lookup\nblog-id-cache\nblog-details\nnetworks\nrss\nglobal-posts\nglobal-cache-test", "object-non_persistent_groups": "comment\ncounts\nplugins", "debug-disable_all": false, "debug": false, "debug-ips": "127.0.0.1", "debug-level": false, "debug-filesize": 3, "debug-collapse_qs": false, "debug-inc": "", "debug-exc": "", "debug-exc_strings": "", "img_optm-webp": false } data/esi.nonce.txt 0000777 00000001362 15251157102 0010107 0 ustar 00 # !!!!! Legacy file for v3.5.1- !!!!! ## Predefined elsewhere so not needed here: ## WordPress core #stats_nonce #subscribe_nonce # Divi Theme Builder #et-pb-contact-form-submit #et_frontend_nonce #et_ab_log_nonce # WooCommerce PayPal Checkout #_wc_ppec_update_shipping_costs_nonce private #_wc_ppec_start_checkout_nonce private #_wc_ppec_generate_cart_nonce private # User Switching #switch_to_olduser_'<ID>' # Caldera Forms #caldera_forms_front_* ## Predefined list of ESI nonces: # CM Registration Pro cmreg_registration_nonce private role_nonce private # WooCommerce Delivery Area Pro #16843635 wdap-call-nonce private # SEOpress Cookie Consent seopress_cookies_user_consent_nonce #SearchWP Metrics swpmtxnonce #wpDataTables #986128 wdt* data/ucss_whitelist.txt 0000777 00000000714 15251157102 0011277 0 ustar 00 # Predefined list for UCSS whitelist # # Comment can use `# `(there is a space following), or `##`, can use both as a new line or end of one line # If you want to predefine new items, please send a Pull Request to https://github.com/litespeedtech/lscache_wp/blob/dev/data/ucss_whitelist.txt We will merge into next plugin release ############# DoBar compatibility ############# .pace-inactive ############# DIVI ################ .et_pb_number_counter.active guest.vary.php 0000777 00000000261 15251157102 0007371 0 ustar 00 <?php /** * Lightweight script to update guest mode vary * * @since 4.1 */ require 'lib/guest.cls.php'; $guest = new \LiteSpeed\Lib\Guest(); $guest->update_guest_vary(); LICENSE 0000777 00000104515 15251157102 0005565 0 ustar 00 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: <program> Copyright (C) <year> <name of author> This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/licenses/why-not-lgpl.html>. assets/css/litespeed-dark-mode.css 0000777 00000101247 15251157102 0013202 0 ustar 00 /* ======================================= DARK MODE STYLES ======================================= */ /* Dark Mode Toggle Button */ .litespeed-dark-mode-toggle { position: fixed; top: 32px; right: 20px; z-index: 999999; background: none; border: none; width: auto; height: auto; color: inherit; cursor: pointer; font-size: 16px; } /* ======================================= DARK MODE STYLES Auto-applied based on browser preference OR manually toggled with .litespeed-darkmode class ======================================= */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) { background-color: #1e1e1e; color: #e0e0e0; } } body.litespeed-darkmode { background-color: #1e1e1e; color: #e0e0e0; } /* WordPress admin wrapper */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) #wpwrap { background-color: #1e1e1e; color: #e0e0e0; } } body.litespeed-darkmode #wpwrap { background-color: #1e1e1e; color: #e0e0e0; } /* Main content area */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) #wpcontent { background-color: #181818; color: #e0e0e0; } } body.litespeed-darkmode #wpcontent { background-color: #181818; color: #e0e0e0; } /* Form inputs */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) input[type='text'], body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) input[type='number'], body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) input[type='email'], body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) input[type='url'], body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) input[type='password'], body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) input[type='search'], body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) input[type='file'], body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) textarea, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) select { background-color: #2d2d30; border: 1px solid #3e3e42; color: #e0e0e0; } } body.litespeed-darkmode input[type='text'], body.litespeed-darkmode input[type='number'], body.litespeed-darkmode input[type='email'], body.litespeed-darkmode input[type='url'], body.litespeed-darkmode input[type='password'], body.litespeed-darkmode input[type='search'], body.litespeed-darkmode input[type='file'], body.litespeed-darkmode textarea, body.litespeed-darkmode select { background-color: #2d2d30; border: 1px solid #3e3e42; color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) input[type='text']:focus, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) input[type='number']:focus, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) input[type='email']:focus, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) input[type='url']:focus, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) input[type='password']:focus, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) input[type='search']:focus, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) input[type='file']:focus, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) textarea:focus, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) select:focus { background-color: #404043; border: 1px solid #5a5a5d; box-shadow: 0 0 0 1px #0073aa; } } body.litespeed-darkmode input[type='text']:focus, body.litespeed-darkmode input[type='number']:focus, body.litespeed-darkmode input[type='email']:focus, body.litespeed-darkmode input[type='url']:focus, body.litespeed-darkmode input[type='password']:focus, body.litespeed-darkmode input[type='search']:focus, body.litespeed-darkmode input[type='file']:focus, body.litespeed-darkmode textarea:focus, body.litespeed-darkmode select:focus { background-color: #404043; border: 1px solid #5a5a5d; box-shadow: 0 0 0 1px #0073aa; } /* Buttons */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .button, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .button-secondary { background-color: #3e3e42; border-color: #5a5a5d; color: #e0e0e0; } } body.litespeed-darkmode .button, body.litespeed-darkmode .button-secondary { background-color: #3e3e42; border-color: #5a5a5d; color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) circle.litespeed-pie_bg { stroke: #3e3e42; } } body.litespeed-darkmode circle.litespeed-pie_bg { stroke: #3e3e42; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) g.litespeed-pie_info text { fill: #e0e0e0; } } body.litespeed-darkmode g.litespeed-pie_info text { fill: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) g.litespeed-pie_info .litespeed-pie-done { fill: #6dd17e; } } body.litespeed-darkmode g.litespeed-pie_info .litespeed-pie-done { fill: #6dd17e; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-switch input:not(:checked) + label { background-color: #3e3e42; color: #e0e0e0; border: 1px solid #5a5a5d; } } body.litespeed-darkmode .litespeed-switch input:not(:checked) + label { background-color: #3e3e42; color: #e0e0e0; border: 1px solid #5a5a5d; } /* Column with boxes layout */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-column-with-boxes .postbox { border-color: #3e3e42; } } body.litespeed-darkmode .litespeed-column-with-boxes .postbox { border-color: #3e3e42; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-column-with-boxes > div.litespeed-column-right { background-color: #2d2d30; } } body.litespeed-darkmode .litespeed-column-with-boxes > div.litespeed-column-right { background-color: #2d2d30; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-image-optim-summary, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-column-left-inside { background-color: #1e1e1e; border: 1px solid #3e3e42; color: #e0e0e0; } } body.litespeed-darkmode .litespeed-image-optim-summary, body.litespeed-darkmode .litespeed-column-left-inside { background-color: #1e1e1e; border: 1px solid #3e3e42; color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed"]:not(.litespeed-lightmode).litespeed-cache_page_litespeed-img_optm [data-litespeed-layout='summary'], body[class*="litespeed"]:not(.litespeed-lightmode).litespeed-cache_page_litespeed-img_optm .litespeed-column-with-boxes > div.litespeed-column-right, body[class*="litespeed"]:not(.litespeed-lightmode).litespeed-cache_page_litespeed-cdn .litespeed-column-with-boxes > div.litespeed-column-right, body[class*="litespeed"]:not(.litespeed-lightmode).litespeed-cache_page_litespeed-cdn [data-litespeed-layout='qc'] { background-color: #181818; } } body.litespeed-darkmode.litespeed-cache_page_litespeed-img_optm [data-litespeed-layout='summary'], body.litespeed-darkmode.litespeed-cache_page_litespeed-img_optm .litespeed-column-with-boxes > div.litespeed-column-right, body.litespeed-darkmode.litespeed-cache_page_litespeed-cdn .litespeed-column-with-boxes > div.litespeed-column-right, body.litespeed-darkmode.litespeed-cache_page_litespeed-cdn [data-litespeed-layout='qc'] { background-color: #181818; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-image-optim-summary-footer, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-column-with-boxes-footer { border-top: 1px solid #373737; background: revert; } } body.litespeed-darkmode .litespeed-image-optim-summary-footer, body.litespeed-darkmode .litespeed-column-with-boxes-footer { border-top: 1px solid #373737; background: revert; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-column-with-boxes-footer { border-top: 1px solid #3e3e42; background-color: #353539; color: #e0e0e0; } } body.litespeed-darkmode .litespeed-column-with-boxes-footer{ border-top: 1px solid #3e3e42; background-color: #353539; color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .nav-tab:focus:not(.nav-tab-active), body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .nav-tab:hover:not(.nav-tab-active) { background-color: #4d4d51; border-color: #666; color: #fff } } body.litespeed-darkmode .nav-tab:focus:not(.nav-tab-active), body.litespeed-darkmode .nav-tab:hover:not(.nav-tab-active) { background-color: #4d4d51; border-color: #666; color: #fff } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .button:hover, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .button-secondary:hover { background-color: #484851; border-color: #666; } } body.litespeed-darkmode .button:hover, body.litespeed-darkmode .button-secondary:hover { background-color: #484851; border-color: #666; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .button-primary { background-color: #0073aa; border-color: #005a87; color: #ffffff; } } body.litespeed-darkmode .button-primary { background-color: #0073aa; border-color: #005a87; color: #ffffff; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .button-primary:hover { background-color: #005a87; border-color: #004a73; } } body.litespeed-darkmode .button-primary:hover { background-color: #005a87; border-color: #004a73; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .button-primary:disabled, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .button-primary[disabled] { background-color: #3e3e42; border-color: #5a5a5d; color: #8c8f94; cursor: not-allowed; opacity: 0.6; } } body.litespeed-darkmode .button-primary:disabled, body.litespeed-darkmode .button-primary[disabled] { background-color: #3e3e42; border-color: #5a5a5d; color: #8c8f94; cursor: not-allowed; opacity: 0.6; } /* Danger buttons */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-btn-danger-bg, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed .litespeed-btn-danger-bg, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-wrap .litespeed-btn-danger-bg { background-color: #dc3232; border-color: #b32d2e; color: #ffffff; box-shadow: 0 1px 0 rgba(179, 45, 46, 0.5); } } body.litespeed-darkmode .litespeed-btn-danger-bg, body.litespeed-darkmode .litespeed .litespeed-btn-danger-bg, body.litespeed-darkmode .litespeed-wrap .litespeed-btn-danger-bg { background-color: #dc3232; border-color: #b32d2e; color: #ffffff; box-shadow: 0 1px 0 rgba(179, 45, 46, 0.5); } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-btn-danger-bg:hover, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed .litespeed-btn-danger-bg:hover, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-wrap .litespeed-btn-danger-bg:hover { background-color: #b32d2e; border-color: #a02622; } } body.litespeed-darkmode .litespeed-btn-danger-bg:hover, body.litespeed-darkmode .litespeed .litespeed-btn-danger-bg:hover, body.litespeed-darkmode .litespeed-wrap .litespeed-btn-danger-bg:hover { background-color: #b32d2e; border-color: #a02622; } /* Notices */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .notice { background-color: #262626; border-left: 4px solid #72a9d3; color: #e0e0e0; } } body.litespeed-darkmode .notice { background-color: #262626; border-left: 4px solid #72a9d3; color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .notice-success { border-left-color: #46b450; } } body.litespeed-darkmode .notice-success { border-left-color: #46b450; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .notice-warning { border-left-color: #b28100; } } body.litespeed-darkmode .notice-warning { border-left-color: #b28100; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .notice-error { border-left-color: #dc3232; } } body.litespeed-darkmode .notice-error { border-left-color: #dc3232; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .notice-info { border-left-color: #00a0d2; } } body.litespeed-darkmode .notice-info { border-left-color: #00a0d2; } /* Striped table notices */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .striped > tbody > :nth-child(even) .notice { background-color: #3e3e42; box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.3); } } body.litespeed-darkmode .striped > tbody > :nth-child(even) .notice { background-color: #3e3e42; box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.3); } /* Postboxes */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .postbox { background-color: #2d2d30; border: 1px solid #767679; color: #e0e0e0; } } body.litespeed-darkmode .postbox { background-color: #2d2d30; border: 1px solid #767679; color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .postbox h3, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .postbox .hndle { color: #e0e0e0; } } body.litespeed-darkmode .postbox h3, body.litespeed-darkmode .postbox .hndle { color: #e0e0e0; } /* Tables */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) table, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .wp-list-table { background-color: #2d2d30; color: #e0e0e0; } } body.litespeed-darkmode table, body.litespeed-darkmode .wp-list-table { background-color: #2d2d30; color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .wp-list-table th { color: #e0e0e0; } } body.litespeed-darkmode .wp-list-table th { color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .wp-list-table td { border-bottom: 1px solid #3e3e42; color: #e0e0e0; } } body.litespeed-darkmode .wp-list-table td { border-bottom: 1px solid #3e3e42; color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .striped > tbody > :nth-child(odd) { background-color: #2d2d30; } } body.litespeed-darkmode .striped > tbody > :nth-child(odd) { background-color: #2d2d30; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .striped > tbody > :nth-child(even) { background-color: #353539; } } body.litespeed-darkmode .striped > tbody > :nth-child(even) { background-color: #353539; } /* Form tables */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .form-table { background: transparent; } } body.litespeed-darkmode .form-table { background: transparent; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .form-table th { background: transparent; color: #e0e0e0; } } body.litespeed-darkmode .form-table th { background: transparent; color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .form-table td { background: transparent; color: #e0e0e0; } } body.litespeed-darkmode .form-table td { background: transparent; color: #e0e0e0; } /* Links */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) a { color: #72aee6; } } body.litespeed-darkmode a { color: #72aee6; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) a:hover, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) a:focus { color: #9ec8f2; } } body.litespeed-darkmode a:hover, body.litespeed-darkmode a:focus { color: #9ec8f2; } /* Code blocks */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) code { background-color: #404043; color: #e0e0e0; } } body.litespeed-darkmode code { background-color: #404043; color: #e0e0e0; } /* Horizontal rules */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) hr { border-color: #5a5a5d; background-color: #5a5a5d; } } body.litespeed-darkmode hr { border-color: #5a5a5d; background-color: #5a5a5d; } /* Dashboard widgets */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .dashboard-widget { background-color: #2d2d30; border: 1px solid #3e3e42; } } body.litespeed-darkmode .dashboard-widget { background-color: #2d2d30; border: 1px solid #3e3e42; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .dashboard-widget .widget-top { background-color: #404043; border-bottom: 1px solid #5a5a5d; } } body.litespeed-darkmode .dashboard-widget .widget-top { background-color: #404043; border-bottom: 1px solid #5a5a5d; } /* Meta boxes */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .meta-box-sortables .postbox { background-color: #2d2d30; border: 1px solid #3e3e42; } } body.litespeed-darkmode .meta-box-sortables .postbox { background-color: #2d2d30; border: 1px solid #3e3e42; } /* LiteSpeed specific styles */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-header { border-bottom: 1px solid #5a5a5d; } } body.litespeed-darkmode .litespeed-header { border-bottom: 1px solid #5a5a5d; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-body { background-color: #1e1e1e; border-left: 1px solid #5a5a5d; border-right: 1px solid #5a5a5d; border-bottom: 1px solid #5a5a5d; color: #e0e0e0; } } body.litespeed-darkmode .litespeed-body { background-color: #1e1e1e; border-left: 1px solid #5a5a5d; border-right: 1px solid #5a5a5d; border-bottom: 1px solid #5a5a5d; color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-panel { background-color: #2d2d30; border: 1px solid #3e3e42; color: #e0e0e0; } } body.litespeed-darkmode .litespeed-panel { background-color: #2d2d30; border: 1px solid #3e3e42; color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-panel-wrapper { background: transparent; } } body.litespeed-darkmode .litespeed-panel-wrapper { background: transparent; } /* Dashboard titles */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-h1, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) h1.litespeed-h1 { color: #e0e0e0; } } body.litespeed-darkmode .litespeed-h1, body.litespeed-darkmode h1.litespeed-h1 { color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) h3 { color: #e0e0e0; } } body.litespeed-darkmode h3 { color: #e0e0e0; } /* LiteSpeed postboxes */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-postbox { background-color: #2d2d30; border: 1px solid #3e3e42; color: #e0e0e0; } } body.litespeed-darkmode .litespeed-postbox { background-color: #2d2d30; border: 1px solid #3e3e42; color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-postbox .inside { color: #e0e0e0; } } body.litespeed-darkmode .litespeed-postbox .inside { color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-postbox .inside .litespeed-title { border-bottom: 1px solid #5a5a5d; color: #e0e0e0; } } body.litespeed-darkmode .litespeed-postbox .inside .litespeed-title { border-bottom: 1px solid #5a5a5d; color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-postbox .inside.litespeed-postbox-footer { background-color: #353539; border-top: 1px solid #5a5a5d; } } body.litespeed-darkmode .litespeed-postbox .inside.litespeed-postbox-footer { background-color: #353539; border-top: 1px solid #5a5a5d; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-postbox p.litespeed-dashboard-stats-total { border-top: 1px dashed #5a5a5d; } } body.litespeed-darkmode .litespeed-postbox p.litespeed-dashboard-stats-total { border-top: 1px dashed #5a5a5d; } /* Dashboard stats */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-dashboard-stats .litespeed-desc { color: #b3b3b3; } } body.litespeed-darkmode .litespeed-dashboard-stats .litespeed-desc { color: #b3b3b3; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-dashboard-stats-payg { color: #b3b3b3; } } body.litespeed-darkmode .litespeed-dashboard-stats-payg { color: #b3b3b3; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-dashboard-stats-payg strong { color: #e0e0e0; } } body.litespeed-darkmode .litespeed-dashboard-stats-payg strong { color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-dashboard-stats-wrapper .litespeed-postbox:not(:first-child) { border-left-color: #3e3e42; } } body.litespeed-darkmode .litespeed-dashboard-stats-wrapper .litespeed-postbox:not(:first-child) { border-left-color: #3e3e42; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-postbox.litespeed-postbox-partner h3.litespeed-title { color: #b3b3b3; } } body.litespeed-darkmode .litespeed-postbox.litespeed-postbox-partner h3.litespeed-title { color: #b3b3b3; } /* QUIC.cloud postbox styling */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-postbox--quiccloud { border-color: #3e7cb3; } } body.litespeed-darkmode .litespeed-postbox--quiccloud { border-color: #3e7cb3; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-postbox--quiccloud.litespeed-postbox .inside .litespeed-title { background-color: #41464a; color: #ffffff; } } body.litespeed-darkmode .litespeed-postbox--quiccloud.litespeed-postbox .inside .litespeed-title { background-color: #41464a; color: #ffffff; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-postbox--quiccloud.litespeed-postbox .inside .litespeed-title a { color: #a5caf2; } } body.litespeed-darkmode .litespeed-postbox--quiccloud.litespeed-postbox .inside .litespeed-title a { color: #a5caf2; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-postbox--quiccloud.litespeed-postbox .inside .litespeed-title a:hover { color: #c2dcff; } } body.litespeed-darkmode .litespeed-postbox--quiccloud.litespeed-postbox .inside .litespeed-title a:hover { color: #c2dcff; } /* Dashboard unlock/promo styling */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-dashboard-unlock { background-color: #2d2d30; color: #e0e0e0; } } body.litespeed-darkmode .litespeed-dashboard-unlock { background-color: #2d2d30; color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-dashboard-unlock-desc { color: #e0e0e0; } } body.litespeed-darkmode .litespeed-dashboard-unlock-desc { color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-dashboard-unlock-desc span { color: #b3b3b3; } } body.litespeed-darkmode .litespeed-dashboard-unlock-desc span { color: #b3b3b3; } /* Navigation tabs */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .nav-tab { background-color: #3e3e42; border-color: #5a5a5d; color: #e0e0e0; } } body.litespeed-darkmode .nav-tab { background-color: #3e3e42; border-color: #5a5a5d; color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .nav-tab:hover { background-color: #1e1e1e; } } body.litespeed-darkmode .nav-tab:hover { background-color: #1e1e1e; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .nav-tab-active { background-color: #1e1e1e; border-bottom-color: #1e1e1e; color: #e0e0e0; } } body.litespeed-darkmode .nav-tab-active { background-color: #1e1e1e; border-bottom-color: #1e1e1e; color: #e0e0e0; } /* Status indicators */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-success { color: #46b450; } } body.litespeed-darkmode .litespeed-success { color: #46b450; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-error { color: #dc3232; } } body.litespeed-darkmode .litespeed-error { color: #dc3232; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-warning { color: #ffb900; } } body.litespeed-darkmode .litespeed-warning { color: #ffb900; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-warning-bg { background-color: #584007 !important; color: #ffffff; } } body.litespeed-darkmode .litespeed-warning-bg { background-color: #584007 !important; color: #ffffff; } /* Footer */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) #wpfooter { background-color: #2d2d30; color: #e0e0e0; } } body.litespeed-darkmode #wpfooter { background-color: #2d2d30; color: #e0e0e0; } /* Checkbox and radio inputs */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) input[type="checkbox"], body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) input[type="radio"] { background-color: #2d2d30; border: 1px solid #3e3e42; } } body.litespeed-darkmode input[type="checkbox"], body.litespeed-darkmode input[type="radio"] { background-color: #2d2d30; border: 1px solid #3e3e42; } /* Progress bars */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-progress { background-color: #3e3e42; } } body.litespeed-darkmode .litespeed-progress { background-color: #3e3e42; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-progress-bar { background-color: #0073aa; } } body.litespeed-darkmode .litespeed-progress-bar { background-color: #0073aa; } /* Litespeed tick buttons */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-tick { background-color: #2d2d30; border: 1px solid #3e3e42; padding: 8px 10px; } } body.litespeed-darkmode .litespeed-tick { background-color: #2d2d30; border: 1px solid #3e3e42; padding: 8px 10px; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-tick:hover { background-color: #404043; border-color: #5a5a5d; } } body.litespeed-darkmode .litespeed-tick:hover { background-color: #404043; border-color: #5a5a5d; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-tick label { color: #e0e0e0; padding: 4px 8px; } } body.litespeed-darkmode .litespeed-tick label { color: #e0e0e0; padding: 4px 8px; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-tick label:hover { color: #72aee6; } } body.litespeed-darkmode .litespeed-tick label:hover { color: #72aee6; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-tick input[type='checkbox'] { background-color: #2d2d30; border: 2px solid #5a5a5d; } } body.litespeed-darkmode .litespeed-tick input[type='checkbox'] { background-color: #2d2d30; border: 2px solid #5a5a5d; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-tick input[type='checkbox']:checked { background-color: #0073aa; border-color: #0073aa; } } body.litespeed-darkmode .litespeed-tick input[type='checkbox']:checked { background-color: #0073aa; border-color: #0073aa; } /* Card headers */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-card-header { background-color: #404043; border-bottom: 1px solid #5a5a5d; color: #e0e0e0; } } body.litespeed-darkmode .litespeed-card-header { background-color: #404043; border-bottom: 1px solid #5a5a5d; color: #e0e0e0; } /* Card action buttons */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-card-action .button-secondary:hover { background-color: #484851; border-color: #666; color: #e0e0e0; } } body.litespeed-darkmode .litespeed-card-action .button-secondary:hover { background-color: #484851; border-color: #666; color: #e0e0e0; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-card-action .button-primary:hover { background-color: #005a87; border-color: #004a73; color: #ffffff; } } body.litespeed-darkmode .litespeed-card-action .button-primary:hover { background-color: #005a87; border-color: #004a73; color: #ffffff; } @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-h3, body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-panel-para { color: revert; } } body.litespeed-darkmode .litespeed-h3, body.litespeed-darkmode .litespeed-panel-para { color: revert; } /* Text gradient for QUIC.cloud branding */ @media (prefers-color-scheme: dark) { body[class*="litespeed-cache_page_litespeed"]:not(.litespeed-lightmode) .litespeed-qc-text-gradient { background: -webkit-linear-gradient(130deg, #ff69b4, #4db3e6 60%, #a5e7ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } } body.litespeed-darkmode .litespeed-qc-text-gradient { background: -webkit-linear-gradient(130deg, #ff69b4, #4db3e6 60%, #a5e7ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } assets/css/litespeed.css 0000777 00000256425 15251157102 0011352 0 ustar 00 @font-face { font-family: "litespeedfont"; src: url(data:application/font-woff;base64,d09GRgABAAAAAAd8AAsAAAAABzAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIFKmNtYXAAAAFoAAAAVAAAAFQXVtKHZ2FzcAAAAbwAAAAIAAAACAAAABBnbHlmAAABxAAAAywAAAMsC7+w5mhlYWQAAATwAAAANgAAADYNxQCSaGhlYQAABSgAAAAkAAAAJAe+A8ZobXR4AAAFTAAAABQAAAAUCgAABWxvY2EAAAVgAAAADAAAAAwAKAGqbWF4cAAABWwAAAAgAAAAIAAOAX5uYW1lAAAFjAAAAc4AAAHOiN8uy3Bvc3QAAAdcAAAAIAAAACAAAwAAAAMDAAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA6QADwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADgAAAAKAAgAAgACAAEAIOkA//3//wAAAAAAIOkA//3//wAB/+MXBAADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAACAAF/8QD/AO7AIAAxAFEAWkBbgFyAXcBewAAATA0MTQmMTA0JzgBNSImOQEBOAExLgEjIgYHOAE5AQEwBiMUMDEGFDEwBhUwFDEcARUcARUwFDEUFjEwFBc4ARUyFjkBATAWFTAyMTAWMzAyFTAyMzIWMzI2MzoBMTQyMTI2MTAyMTQ2OQEBMDYzNDAxNjQxMDY1MDQxNDY1JjQ1BzEVBzgBMQE4ATEwBjEjMCIxMCIxMCIxMCYxOAExATgBMSc1MDQxMDQ5ATUxNzgBMQEwNjMyFjEBOAExFxUwFDEwFDEnMCIxMDQxMDQxMCIxNDAnMSc4ATEuASMiBgc4ATEHBjAVMCIxMBQxMBQxMCIxHAExMBQVMDIxMBQxMBQxMDIxFDAXMRcWMDM4ARUwMjE4ATEyMBU6ATEwMjM0MDM4ATEwMjE0MDEyMDcxNzYwNTAyMTA0MTA0MTgBMzwBMTA0NScHFzgBMRYUFxYGDwEOASMiJicmNj8BJyY2PwE+ATMyFhcWBgcFFxUBMxMHIwEBMwE1NzUnNQED+wEBAQH+FAIGAwMGAv4UAQEBAQEBAQEB7AIBAQEBAQEBAQEBAQEBAQEBAQECAewBAQEBAQFOAf5XAQEBAQEB/lcBAQGpAgEBAgGpAbABAQH0AgICAgIC9AEBAQEBAfQBAQEBAQEBAQEBAQH0AQEBoE8rAQEBAgSBAgQDBAYBAgEDTysFAwWBAgQEAwYBAgED/oz6/sw6+vo6ATQBNDb+zP7+ATgBwwEBAQEBAQIB7AICAgL+FAIBAQEBAQEBAQEBAQEBAQEBAQEC/hQBAQEBAQEBAQEBAewCAQEBAQEBAQEBAQEBBAEB/lcBAQGpAQEBAQEBAakBAf5XAQEBAQMBAQEB9AECAgH0AQEBAQEBAQEBAQEB9AEBAQEBAfQBAQEBAQEBAYRkPQECAQcLA2MCAgQDAwgDZD4GDgViAgIEAwMIA6P5OgEzATP6ATT+lP7MNv44/jb+zAABAAAAAQAAiK6LiV8PPPUACwQAAAAAANVU3gsAAAAA1VTeCwAA/8QD/AO7AAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAP8AAEAAAAAAAAAAAAAAAAAAAAFBAAAAAAAAAAAAAAAAgAAAAQAAAUAAAAAAAoAFAAeAZYAAQAAAAUBfAAIAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAA0AAAABAAAAAAACAAcAlgABAAAAAAADAA0ASAABAAAAAAAEAA0AqwABAAAAAAAFAAsAJwABAAAAAAAGAA0AbwABAAAAAAAKABoA0gADAAEECQABABoADQADAAEECQACAA4AnQADAAEECQADABoAVQADAAEECQAEABoAuAADAAEECQAFABYAMgADAAEECQAGABoAfAADAAEECQAKADQA7GxpdGVzcGVlZGZvbnQAbABpAHQAZQBzAHAAZQBlAGQAZgBvAG4AdFZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGxpdGVzcGVlZGZvbnQAbABpAHQAZQBzAHAAZQBlAGQAZgBvAG4AdGxpdGVzcGVlZGZvbnQAbABpAHQAZQBzAHAAZQBlAGQAZgBvAG4AdFJlZ3VsYXIAUgBlAGcAdQBsAGEAcmxpdGVzcGVlZGZvbnQAbABpAHQAZQBzAHAAZQBlAGQAZgBvAG4AdEZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=); font-weight: normal; font-style: normal; } #adminmenu #toplevel_page_lscache-settings .menu-icon-generic div.wp-menu-image:before, #adminmenu #toplevel_page_litespeed .menu-icon-generic div.wp-menu-image:before, .litespeed-top-toolbar .ab-icon::before { content: '\e900'; font-family: 'litespeedfont' !important; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } #wpadminbar .litespeed-top-toolbar .ab-icon.icon_disabled::before { color: #D9534F; } *[litespeed-accesskey]:not([data-litespeed-noprefix]):before { content: '[' attr(litespeed-accesskey) '] '; } /* ======================================= UTILITIES - toggle UI ======================================= */ input[type='checkbox'].litespeed-tiny-toggle { -webkit-appearance: none; -moz-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; width: auto; height: auto; vertical-align: middle; position: relative; border: 0; outline: 0; cursor: pointer; margin: 0 4px; background: none; box-shadow: none; } input[type='checkbox'].litespeed-tiny-toggle:focus { box-shadow: none; } input[type='checkbox'].litespeed-tiny-toggle:after { content: ''; font-size: 8px; font-weight: 400; line-height: 18px; text-indent: -14px; color: #ffffff; width: 36px; height: 18px; display: inline-block; background-color: #a7aaad; border-radius: 72px; box-shadow: 0 0 12px rgb(0 0 0 / 15%) inset; } input[type='checkbox'].litespeed-tiny-toggle:before { content: ''; width: 14px; height: 14px; display: block; position: absolute; top: 2px; left: 2px; margin: 0; border-radius: 50%; background-color: #ffffff; } input[type='checkbox'].litespeed-tiny-toggle:checked:before { left: 20px; margin: 0; background-color: #ffffff; } input[type='checkbox'].litespeed-tiny-toggle, input[type='checkbox'].litespeed-tiny-toggle:before, input[type='checkbox'].litespeed-tiny-toggle:after, input[type='checkbox'].litespeed-tiny-toggle:checked:before, input[type='checkbox'].litespeed-tiny-toggle:checked:after { transition: ease 0.15s; } input[type='checkbox'].litespeed-tiny-toggle:checked:after { /*content: 'ON';*/ background-color: #2271b1; } .block-editor__container input[type='checkbox'].litespeed-tiny-toggle { border: 0 !important; } .block-editor__container input[type='checkbox'].litespeed-tiny-toggle:before { top: 5px; left: 7px; } .block-editor__container input[type='checkbox'].litespeed-tiny-toggle:checked:before { left: 23px; } /* ======================================= UTILITIES - structure ======================================= */ .litespeed_icon:before { /* content: "\e900"; font-family: 'litespeedfont' !important; */ content: ''; background-image: url('../img/lscwp_grayscale_font-icon_22px.svg'); /* filter: grayscale(1); */ background-size: 22px; background-repeat: no-repeat; width: 22px; height: 22px; vertical-align: middle; display: inline-block; position: absolute; left: 5px; top: 8px; } .rtl .litespeed_icon:before { left: initial; right: 5px; } .litespeed_icon { padding-left: 30px !important; position: relative; } .rtl .litespeed_icon { padding-right: 40px; } .litespeed-quic-icon { background-image: url('../img/quic-cloud-icon-16x16.svg'); background-repeat: no-repeat; width: 16px; height: 16px; vertical-align: middle; display: inline-block; } .litespeed-row { margin-top: 5px; } .litespeed-reset { width: initial; } .litespeed-inline { display: inline-block; } .litespeed-flex { display: flex; } .litespeed-flex-container { display: flex; flex-wrap: wrap; width: 100%; height: auto; } .litespeed-flex-align-center { align-items: center; } .litespeed-flex-container > * { box-sizing: border-box; } .litespeed-flex-container--reverse { flex-direction: row-reverse; } .litespeed-flex-container .litespeed-icon-vertical-middle { margin-left: 0; } .litespeed-row-flex { display: inline-flex; } .litespeed-flex-wrap { flex-wrap: wrap; } .litespeed-align-right { margin-left: auto !important; } .litespeed-width-1-2 { width: 45%; padding: 20px; } .litespeed-width-1-3 { width: 30%; padding: 25px; } .litespeed-width-7-10 { width: 65%; padding: 20px; } .litespeed-width-3-10 { width: 35%; padding: 20px; } @media screen and (max-width: 814px) { .litespeed-width-7-10 { width: 100%; } .litespeed-width-3-10 { width: 100%; padding: 0; } } .litespeed-hide { display: none !important; } .litespeed-right { float: right !important; } .litespeed-relative { position: relative; } .litespeed-align-center { margin-left: auto; margin-right: auto; } /* ======================================= UTILITIES - spacing ======================================= */ .litespeed-left10 { margin-left: 10px !important; } .litespeed-left20 { margin-left: 20px !important; } .litespeed-right10 { margin-right: 10px !important; } .litespeed-right20 { margin-right: 20px !important; } .litespeed-right30 { margin-right: 30px !important; } .litespeed-right50 { margin-right: 50px !important; } .litespeed-top10 { margin-top: 10px !important; } .litespeed-top15 { margin-top: 15px !important; } .litespeed-top20 { margin-top: 20px !important; } .litespeed-top30 { margin-top: 30px !important; } .litespeed-margin-y5 { margin-top: 5px !important; margin-bottom: 5px !important; } .litespeed-margin-x5 { margin-left: 5px !important; margin-right: 5px !important; } .litespeed-wrap .litespeed-left20, .litespeed-left20 { margin-left: 20px; } .litespeed-wrap .litespeed-bg-quic-cloud { background: linear-gradient(rgba(230, 242, 242, 1) 10%, rgba(250, 255, 255, 1) 30%); } .litespeed-left50 { margin-left: 50px; } .litespeed-padding-space { padding: 5px 10px; } .litespeed-margin-bottom10 { margin-bottom: 10px !important; } .litespeed-margin-bottom20 { margin-bottom: 20px !important; } .litespeed-margin-bottom-remove { margin-bottom: 0px !important; } .litespeed-margin-top-remove { margin-top: 0px !important; } .litespeed-margin-left-remove { margin-left: 0px !important; } .litespeed-margin-y-remove { margin-top: 0px !important; margin-bottom: 0px !important; } .litespeed-empty-space-xlarge { margin-top: 8em; } .litespeed-empty-space-large { margin-top: 6em; } .litespeed-empty-space-medium { margin-top: 3em; } .litespeed-empty-space-small { margin-top: 2em; } .litespeed-empty-space-tiny { margin-top: 1em; } /* ======================================= UTILITIES - typography ======================================= */ .litespeed-text-jumbo { font-size: 3em !important; } .litespeed-text-large { font-size: 0.75em !important; } .litespeed-text-md { font-size: 1.2em; } .litespeed-text-right { text-align: right; } .litespeed-text-center { text-align: center; } .litespeed-text-bold, .litespeed-bold { font-weight: 600; } /* ======================================= COLORS ======================================= */ .litespeed-default { color: #a7a7a7 !important; } .litespeed-primary { color: #3366cc !important; } .litespeed-info { color: #3fbfbf !important; } .litespeed-success { color: #73b38d !important; } .litespeed-warning { color: #ff8c00 !important; } .litespeed-danger { color: #dc3545 !important; } a.litespeed-danger:hover, button.litespeed-danger:hover { color: #a00 !important; } .litespeed-text-success { color: #34b15d; } .litespeed-form-action { color: #1a9292 !important; } a.litespeed-form-action:hover, button.litespeed-form-action:hover { color: #36b0af !important; } .litespeed-bg-default { background-color: #a7a7a7 !important; } .litespeed-bg-primary { background-color: #3366cc !important; } .litespeed-bg-info { background-color: #d1ecf1 !important; } .litespeed-bg-success { background-color: #73b38d !important; } .litespeed-bg-warning { background-color: #ff8c00 !important; } .litespeed-bg-danger { background-color: #dc3545 !important; } .litespeed-bg-text-success { background-color: #34b15d; } /* ======================================= LAYOUT ======================================= */ .litespeed-wrap { margin: 10px 20px 0 2px; } @media screen and (max-width: 600px) { .litespeed-wrap h2 .nav-tab { border-bottom: 1px solid #c3c4c7; margin: 10px 10px 0 0; } .litespeed-wrap .nav-tab-wrapper { margin-bottom: 15px; } .litespeed-desc a, .litespeed-body p > a:not(.button) { word-break: break-word; } } .litespeed-wrap .nav-tab { border-bottom-color: inherit; border-bottom-style: solid; border-bottom-width: 1px; margin: 11px 10px -1px 0; } .litespeed-wrap .nav-tab-active { background: #fff; border-bottom-color: #fff; } .litespeed-wrap .nav-tab:focus:not(.nav-tab-active), .litespeed-wrap .nav-tab:hover:not(.nav-tab-active) { background-color: #f1f1f1; color: #444; } .litespeed-body { background: #fff; border: 1px solid #e5e5e5; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); padding: 1px 20px 20px 20px; } @media screen and (min-width: 681px) { .litespeed-header + .litespeed-body { border-top: none; } } .litespeed-body table { border-collapse: collapse; width: 100%; } .litespeed-body .litespeed-width-auto { width: auto; } /* outside stripped table */ .litespeed-description { color: #666; font-size: 13px; margin: 1.5rem 0; max-width: 960px; } .litespeed-desc-wrapper{ display: inline-block; margin-left: 10px; } /* inside stripped table */ .litespeed-desc { font-size: 12px; font-weight: normal; color: #7a919e; margin: 10px 0; line-height: 1.7; /*max-width: 840px;*/ } .litespeed-desc + .litespeed-desc { margin-top: -5px; } td > .litespeed-desc:first-child { margin-top: 0px; line-height: 2.24; } .litespeed-h3 { line-height: 18px; color: #264d73; font-size: 18px; font-weight: 600; margin: 2px 0; } .litespeed-div .submit { margin-top: 0; } @media screen and (min-width: 681px) { .litespeed-div { display: inline-block; min-width: 100px; } .litespeed-div .submit { margin: 5px; padding: 5px; } } @media screen and (max-width: 680px) { .litespeed-desc + .litespeed-desc.litespeed-left20 { margin-left: 0 !important; } .litespeed-desc .litespeed-callout.notice-warning.inline { word-break: break-word; } } .litespeed-h1 { display: inline-block; } h3 .litespeed-learn-more { font-size: 12px; font-weight: normal; color: #7a919e; margin-left: 30px; } .litespeed-wrap code { color: #666; background-color: #dde9f5; border-radius: 3px; font-size: 11px; font-style: normal; } .litespeed-wrap ul { margin-left: 2em; } .litespeed-wrap i { font-size: 13px; line-height: 16px; } .litespeed-wrap .litespeed-desc i { font-size: 12px; } .litespeed-wrap p { margin: 1em 0; } .litespeed-wrap p.submit { margin-bottom: 0; } .litespeed-desc p { margin-left: 0; } .litespeed-title, .litespeed-title-short { font-size: 18px; border-bottom: 1px solid #cccccc; margin: 2.5em 0px 1.5em 0; display: table; padding-right: 50px; padding-left: 3px; padding-bottom: 3px; } .litespeed-title .button { margin-left: 1rem; margin-bottom: 5px; vertical-align: middle; } .litespeed-title .litespeed-quic-icon { margin-right: 6px; } .litespeed-title a, .litespeed-title-short a { text-decoration: none; } .litespeed-title-short { padding-right: 20px; } .litespeed-title-section { margin: 2em -20px 12px -20px; padding: 12px 20px 12px 20px; border-bottom: 1px solid #eee; font-size: 1.2em; display: block; border-top: 1px solid #f1f1f1; } .litespeed-postbox .litespeed-title { display: flex; align-items: center; } .litespeed-title-right-icon { margin-left: auto; font-weight: normal; } .litespeed-list li:before { content: '>'; color: #cc3d6a; } .litespeed-wrap a.disabled { cursor: not-allowed; opacity: 0.5; text-decoration: none; color: #72777c; } /* ======================================= LAYOUT - table ======================================= */ .litespeed-table { font-size: 14px; } .litespeed-body tbody > tr > th { padding-left: 20px; } .litespeed-body tbody th { vertical-align: top; text-align: left; padding: 18px 10px 20px 0; width: 200px; font-weight: 600; } .litespeed-body td { padding: 15px 10px; line-height: 1.3; vertical-align: middle; } .litespeed-body .widefat td input + p { margin-top: 0.8em; } .litespeed-body .striped > tbody > :nth-child(even) .notice { background-color: #f9f9f9; box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.05); border-top: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5; border-right: 1px solid #e5e5e5; } .litespeed-body .striped > tbody > :nth-child(even) .notice:first-child { margin-top: 0; } /* small table inside */ .litespeed-body .litespeed-vary-table { margin-top: -5px; width: 250px; margin-bottom: 20px; } .litespeed-body .litespeed-vary-table td { width: 50%; padding: 5px 0px; } .litespeed-table-compact td, .litespeed-table-compact th { padding: 0.5rem 0.75rem; } /* ======================================= LAYOUT - block ======================================= */ .litespeed-block, .litespeed-block-tiny { border: 1px dotted #cccccc; border-radius: 5px; display: flex; flex-wrap: wrap; padding: 0.75rem 1.25rem; margin-bottom: 5px; } .litespeed-block-tiny { max-width: 670px; } .litespeed-col { flex: 0 0 30%; padding-right: 2rem; } .litespeed-col:last-child, .litespeed-col-auto:last-child { padding-right: 0; } .litespeed-col-auto { padding-right: 2rem; } .litespeed-col-br { flex: 0 0 100%; border-top: 1px dotted #cccccc; } .litespeed-col-inc { display: inline-block; margin-top: 16px; min-width: 150px; font-weight: bold; } .litespeed-block h4:first-child, .litespeed-block .litespeed-form-label:not(.litespeed-form-label--toggle):first-child { margin-top: 0.5rem; } .litespeed-block .litespeed-callout:last-child { margin-bottom: 0; } @media screen and (max-width: 600px) { .litespeed-block { flex-direction: column; } .litespeed-block .litespeed-col { padding-right: 0; } } /* ======================================= CARDS LINKS ======================================= */ .litespeed-cards-wrapper, .litespeed-panel-wrapper { display: flex; width: 100%; flex-flow: row wrap; justify-content: flex-start; } .litespeed-cards-wrapper { margin: -10px -15px -10px -15px; } .litespeed-panel { text-decoration: none; display: flex; justify-content: space-between; padding: 6px 8px 4px 5px; width: 322px; margin: 15px 5px 15px 15px; min-height: 75px; box-sizing: border-box; background: #f9fafc; transition: 0.25s; } .litespeed-panel:hover { border: 1px solid #6699cc; box-shadow: none; } .litespeed-panel-wrapper-icon { width: 25%; height: 100%; } [class*='litespeed-panel-icon-'] { background-size: contain; width: 60px; height: 60px; margin: 5px; background-repeat: no-repeat; display: inline-block; } .litespeed-panel-icon-all { background-image: url('../img/icons/all.svg'); } .litespeed-panel-icon-revision { background-image: url('../img/icons/revision.svg'); } .litespeed-panel-icon-orphaned_post_meta { background-image: url('../img/icons/revision.svg'); } .litespeed-panel-icon-auto_draft { background-image: url('../img/icons/auto_draft.svg'); } .litespeed-panel-icon-trash_post { background-image: url('../img/icons/trash_post.svg'); } .litespeed-panel-icon-spam_comment { background-image: url('../img/icons/spam_comment.svg'); } .litespeed-panel-icon-trash_comment { background-image: url('../img/icons/trash_comment.svg'); } .litespeed-panel-icon-trackback-pingback { background-image: url('../img/icons/trackback-pingback.svg'); } .litespeed-panel-icon-expired_transient { background-image: url('../img/icons/expired_transient.svg'); } .litespeed-panel-icon-all_transients { background-image: url('../img/icons/all_transients.svg'); } .litespeed-panel-icon-optimize_tables { background-image: url('../img/icons/optimize_tables.svg'); } .litespeed-panel-icon-purge-front { background-image: url('../img/icons/purge-front.svg'); } .litespeed-panel-icon-purge-pages { background-image: url('../img/icons/purge-pages.svg'); } .litespeed-panel-icon-purge-cssjs { background-image: url('../img/icons/purge-cssjs.svg'); } .litespeed-panel-icon-purge-object { background-image: url('../img/icons/purge-object.svg'); } .litespeed-panel-icon-purge-opcache { background-image: url('../img/icons/purge-opcache.svg'); } .litespeed-panel-icon-purge-all { background-image: url('../img/icons/purge-all.svg'); } .litespeed-panel-icon-empty-cache { background-image: url('../img/icons/empty-cache.svg'); } .litespeed-panel-icon-purge-403 { background-image: url('../img/icons/purge-403.svg'); } .litespeed-panel-icon-purge-404 { background-image: url('../img/icons/purge-404.svg'); } .litespeed-panel-icon-purge-500 { background-image: url('../img/icons/purge-500.svg'); } .litespeed-panel-top-right-icon-cross { background-image: url('../img/icons/cross_icon.svg'); } .litespeed-panel-top-right-icon-tick { background-image: url('../img/icons/success_icon.svg'); } .litespeed-panel-content { width: 75%; height: 100%; margin-top: 7px; } .litespeed-panel-para { color: #264d73; font-size: 12px; line-height: 1.45; } .litespeed-panel .litespeed-h3 { font-size: 14px; } .litespeed-panel-counter { color: #3abfbf; } .litespeed-panel-counter-red { color: #cc3d6a; } .litespeed-panel-wrapper-top-right { width: 10%; height: 100%; text-align: right; } .litespeed-panel-top-right-icon-tick, .litespeed-panel-top-right-icon-cross { background-size: contain; width: 20px; height: 20px; background-repeat: no-repeat; display: inline-block; } /* ======================================= BUTTONS ======================================= */ /* .litespeed-wrap .button{ background:#fff; } */ .litespeed-wrap .button-link { height: auto; line-height: inherit; font-size: inherit; box-shadow: none; } .litespeed-wrap .button-link:hover, .litespeed-wrap .button-link:focus { box-shadow: none; background: none; } .litespeed .litespeed-btn-danger-bg, .litespeed-wrap .litespeed-btn-danger-bg, .litespeed-btn-danger-bg { background: #dc3545; color: #fff; border: 1px solid #cc3d6a; box-shadow: 0 1px 0 rgba(177, 93, 93, 0.5); } .litespeed .litespeed-btn-danger, .litespeed-wrap .litespeed-btn-danger, .litespeed-btn-danger { background: #fff; color: #cc3d6a; border: 1px solid #cc3d6a; box-shadow: 0 1px 0 rgba(177, 93, 93, 0.5); } .litespeed .litespeed-btn-danger:hover, .litespeed-wrap .litespeed-btn-danger:hover, .litespeed-btn-danger:hover { border-color: #ab244e; background: #cc3d6a; color: #fff; } .litespeed .litespeed-btn-warning, .litespeed-wrap .litespeed-btn-warning, .litespeed-btn-warning { background: #fff; color: #e59544; border: 1px solid #e59544; box-shadow: 0 1px 0 rgba(249, 166, 82, 0.55); } .litespeed .litespeed-btn-warning:hover, .litespeed-wrap .litespeed-btn-warning:hover, .litespeed-btn-warning:hover { border-color: #e59544; background: #e59544; color: #fff; } .litespeed .litespeed-btn-success, .litespeed-wrap .litespeed-btn-success, .litespeed-btn-success { background: #fff; color: #36b0b0; border: 1px solid #36b0b0; box-shadow: 0 1px 0 rgba(73, 160, 160, 0.55); } .litespeed .litespeed-btn-success:hover, .litespeed-wrap .litespeed-btn-success:hover, .litespeed-btn-success:hover { border-color: #36b0b0; background: #36b0b0; color: #fff; } .litespeed-wrap .button-primary { background: #528ac6; border-color: #538ac6 #2264ad #2264ad; color: #fff; box-shadow: 0 1px 0 #2264ad; text-shadow: 0 -1px 1px #2264ad, 1px 0 1px #2264ad, 0 1px 1px #2264ad, -1px 0 1px #2264ad; } .litespeed-wrap .button-primary:focus, .litespeed-wrap .button-primary:hover { background: #5891ce; border-color: #2264ad; color: #fff; } .litespeed-wrap .button-primary:hover { box-shadow: 0 1px 0 #2264ad; } .litespeed-wrap .button-primary:focus { background: #5891ce; border-color: #2264ad; color: #fff; box-shadow: 0 1px 0 #0073aa, 0 0 2px 1px #33b3db; } .litespeed .litespeed-btn-primary, .litespeed-wrap .litespeed-btn-primary, .litespeed-btn-primary { color: #538ac6; border: 1px solid #538ac6; -moz-box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25); -webkit-box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25); box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25); } .litespeed .litespeed-btn-primary:hover, .litespeed-wrap .litespeed-btn-primary:hover, .litespeed-btn-primary:hover { background: #538ac6; border-color: #538ac6; color: #fff; } .litespeed-wrap .button:not(.litespeed-btn-large) .dashicons { position: relative; top: -0.075em; vertical-align: middle; } .litespeed-wrap .button:not(:first-child) { margin-left: 5px; } .litespeed-wrap .button + .button { margin-left: 10px; } .litespeed-info-button { color: #c8c8c8; padding: 0; -webkit-appearance: none; border: none; background: none; vertical-align: middle; line-height: inherit; text-decoration: none; } .litespeed-info-button .dashicons { font-size: 16px; vertical-align: middle; } .litespeed-btn-pie { -webkit-appearance: none; background: none; border: none; border-radius: 0; box-shadow: none; padding: 0; margin: 0; top: -0.125em; } /* ======================================= BUTTONS - sizes ======================================= */ .litespeed-wrap .litespeed-btn-tiny { padding: 2px 8px; line-height: 1.5; height: auto; } .litespeed-wrap .litespeed-btn-mini { padding: 0 8px 1px; font-size: 12px; font-weight: 600; margin: 5px 0; } .litespeed-wrap .litespeed-btn-mini .dashicons.dashicons-image-rotate { padding-top: 3px; font-size: 18px; } .litespeed-wrap .litespeed-btn-mini .dashicons { padding-top: 2px; } .litespeed-wrap .litespeed-btn-large { font-size: 1.5em; padding: 0.75em 1.5em; margin: 0 0.25em; height: auto; } .litespeed-wrap .litespeed-btn-large .dashicons { font-size: 1.25em; width: auto; } /* ======================================= SWITCH ======================================= */ .litespeed-switch { font-size: 14px; font-weight: 600; margin: 0 0 0; display: inline-flex; position: relative; } .rtl .litespeed-switch { flex-direction: row-reverse; } .litespeed-switch input:checked:active + label { box-shadow: 0 2px 0 rgba(27, 146, 146, 0.7), inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); } .litespeed-switch input:checked + label { background-color: #36b0b0; color: #fff; border: 1px solid #36b0b0; box-shadow: 0 2px 0 #1b9292; z-index: 2; text-shadow: 0 -1px 1px #1b9292, 1px 0 1px #1b9292, 0 1px 1px #1b9292, -1px 0 1px #1b9292; } .litespeed-switch label { font-size: 14px; display: inline-block; min-width: 72px; background-color: #f9fafc; font-weight: 400; text-align: center; padding: 6px 12px 5px 12px; cursor: pointer; border: 1px solid #ccc; border-bottom: none; box-shadow: 0 2px 0 #ccc; position: relative; } .litespeed-switch label:not(:last-child) { margin-right: -1px; } .litespeed-switch label:last-child { border-top-right-radius: 3px; border-bottom-right-radius: 3px; } .litespeed-switch label:first-of-type { border-top-left-radius: 3px; border-bottom-left-radius: 3px; } .litespeed-switch input:hover + label { border-color: #1a9292; box-shadow: 0 2px 0 #1a9292; z-index: 2; color: #117171; } .litespeed-switch input:focus + label { color: #117171; box-shadow: 0 0px 0px 2px rgba(28, 138, 128, 0.85); border-color: transparent; z-index: 2; } .litespeed-switch input:focus + label + input + input:hover + label, .litespeed-switch input:focus + label + input:hover + label { z-index: 1; } .litespeed-switch input:active + label { box-shadow: 0 2px 0 #1b9292, inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); } .litespeed-switch input:checked:hover + label, .litespeed-switch input:checked:focus + label { background-color: #36b0b0; color: #fff; } .litespeed-switch input { display: inline-block; position: absolute; z-index: -1; margin: 0; } .litespeed-cache-purgeby-text { margin: 0; display: inline-block; } /* ======================================= TOGGLE ======================================= */ .litespeed-toggle-stack { display: flex; flex-direction: column; } .litespeed-toggle-stack .litespeed-toggle-wrapper { justify-content: space-between; } .litespeed-toggle-wrapper { display: flex; align-items: center; } .litespeed-toggle-wrapper + .litespeed-toggle-wrapper { margin-top: 0.75rem; } .litespeed-toggle { position: relative; overflow: hidden; min-width: 58px; height: 21px; /*margin-left: 1.2rem;*/ } .litespeed-toggle-group { position: absolute; width: 200%; top: 0; bottom: 0; left: 0; transition: left 0.35s; -webkit-transition: left 0.35s; -moz-user-select: none; -webkit-user-select: none; } .litespeed-toggle-on { position: absolute; top: 0; bottom: 0; left: 0; right: 50%; margin: 0; border: 0; border-radius: 0; } .litespeed-toggle-on.litespeed-toggle-btn { padding-right: 24px; } .litespeed-toggle-off.litespeed-toggle-btn { padding-left: 24px; } .litespeed-toggle-handle { position: relative; margin: 0 auto; padding-top: 0px; padding-bottom: 0px; height: 100%; width: 0px; border-width: 0 1px; } .litespeed-toggle-off { position: absolute; top: 0; bottom: 0; left: 50%; right: 0; margin: 0; border: 0; border-radius: 0; } .litespeed-toggleoff .litespeed-toggle-group { left: -100%; } .litespeed-toggle-btn { display: inline-block; padding: 5px 10px; margin-bottom: 0; font-size: 14px; font-weight: 400; line-height: 1.42857143; text-align: center; white-space: nowrap; vertical-align: middle; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; background-image: none; border: 1px solid transparent; border-radius: 4px; } .litespeed-toggle-btn-primary { color: #fff; background-color: #36b0b0; border-color: #36b0b0; } .litespeed-toggle-btn-default { color: #333; background-color: #fff; border-color: #ccc; } .litespeed-toggle-btn-success:hover, .litespeed-toggle-btn-success:focus, .litespeed-toggle-btn-success:active, .litespeed-toggle-btn-success.litespeed-toggle-active { color: #fff; background-color: #00bfbf; border-color: #6699cc; } .litespeed-toggle-btn-default:hover, .litespeed-toggle-btn-default:focus, .litespeed-toggle-btn-default:active, .litespeed-toggle-btn-default.litespeed-toggle-active { color: #333; background-color: #e6e6e6; border-color: #adadad; } .litespeed-toggle-btn:active, .litespeed-toggle-btn.litespeed-toggle-active { background-image: none; outline: 0; -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } .litespeed-toggle-btn-default:active, .litespeed-toggle-btn-default.litespeed-toggle-active { background-image: none; } /* ======================================= LABEL/TAG ======================================= */ [class*='litespeed-label-'] { display: inline; padding: 0.2em 0.6em 0.3em; font-size: 75%; font-weight: bold; line-height: 1; color: #fff; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: 0.25em; } [class*='litespeed-label-']:hover, [class*='litespeed-label-']:focus { color: #fff; text-decoration: none; cursor: pointer; } [class*='litespeed-label-']:empty { display: none; } .litespeed-label-regular { font-size: 1em; } .litespeed-label-default { background-color: #777; } .litespeed-label-default[href]:hover, .litespeed-label-default[href]:focus { background-color: #5e5e5e; } .litespeed-label-primary { background-color: #337ab7; } .litespeed-label-primary[href]:hover, .litespeed-label-primary[href]:focus { background-color: #286090; } .litespeed-label-success { background-color: #5cb85c; } .litespeed-label-success[href]:hover, .litespeed-label-success[href]:focus { background-color: #449d44; } .litespeed-label-info { background-color: #5bc0de; } .litespeed-label-info[href]:hover, .litespeed-label-info[href]:focus { background-color: #31b0d5; } .litespeed-label-warning { background-color: #f0ad4e; } .litespeed-label-warning[href]:hover, .litespeed-label-warning[href]:focus { background-color: #ec971f; } .litespeed-label-danger { background-color: #d9534f; } .litespeed-label-danger[href]:hover, .litespeed-label-danger[href]:focus { background-color: #c9302c; } /* ======================================= SHELL ======================================= */ .litespeed-shell { width: 98%; background: #141414; margin: 20px auto 0 10px; box-shadow: 0 0 5px rgba(0, 0, 0, 0.4); -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; position: relative; height: 224px; } .litespeed-shell-header { z-index: 999; position: absolute; top: 0; right: 0; width: 50px; height: 34px; padding: 5px 0; } .litespeed-shell-header-bg { opacity: 0.4; background-color: #cccccc; position: absolute; top: 0; bottom: 0; right: 0; left: 0; z-index: 4; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-top-radius: 3px; } .litespeed-shell-header-bar { position: absolute; top: 0; left: 0; z-index: 10; height: 2px; background-color: #f48024; } .litespeed-shell-header-icon-container { position: absolute; top: 10px; right: 10px; width: 29px; height: 34px; z-index: 6; } ul.litespeed-shell-body { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow-y: scroll; margin: 0; padding: 5px; list-style: none; background: #141414; color: #45d40c; font: 0.8em 'Andale Mono', Consolas, 'Courier New'; line-height: 1.6em; -webkit-border-bottom-right-radius: 3px; -webkit-border-bottom-left-radius: 3px; -moz-border-radius-bottomright: 3px; -moz-border-radius-bottomleft: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .litespeed-shell-body li:before { content: '>'; position: absolute; left: 0; top: 0; } .litespeed-shell-body li { word-wrap: break-word; position: relative; padding: 0 0 0 15px; margin: 0; } .litespeed-widget-setting { background-color: #ecebdc; padding: 5px 14px; margin: 5px -15px; } /* ======================================= CALLOUT / NOTICE ======================================= */ .litespeed-callout { margin: 1.5rem 0; border-right: 1px solid #e5e5e5; border-top: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5; background: #f9f9f9; } .litespeed-callout h4:not(:last-child) { margin-bottom: 0.5rem; margin-top: 1em; } .litespeed-callout p { margin-left: 0; } .litespeed-callout ol, .litespeed-callout ul { margin-left: 1em; } .litespeed-callout.notice-warning h4 { color: #e59544; } .litespeed-callout.notice-error h4 { color: #dc3232; } .litespeed-callout-bg { margin: 1.5rem 0; background: #f9f9f9; border-top: none; border-bottom: none; border-right: none; } /* ======================================= TICK / CHECKBOX ======================================= */ .litespeed-tick-wrapper { margin-left: -5px; } .litespeed-tick { display: inline-block; /* min-width: 125px; */ background: #f2f9ff; padding: 5px 0 5px 0px; border-radius: 3px; cursor: pointer; margin: 5px 5px 5px 0; } .litespeed-tick-list .litespeed-tick { display: block; margin-bottom: 3px; margin-top: 0; background: none; } .litespeed-tick-list .litespeed-tick input[type='checkbox'] { margin-left: 0; } .litespeed-tick-list .litespeed-tick label { color: inherit; } .litespeed-tick input[type='checkbox'] { height: 18px; width: 18px; vertical-align: middle; margin: 0 10px; -webkit-appearance: none; -moz-appearance: none; appearance: none; -webkit-border-radius: 3px; border-radius: 3px; cursor: pointer; } .litespeed-tick input[type='checkbox']:not(:disabled):hover { border-color: #538ac6; } .litespeed-tick input[type='checkbox']:active:not(:disabled) { border-color: #538ac6; } .litespeed-tick input[type='checkbox']:focus { outline: none; } .litespeed-tick input[type='checkbox']:checked { border-color: #538ac6; background-color: #538ac6; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } .litespeed-tick input[type='checkbox']:checked:before { content: ''; display: block; width: 5px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; -webkit-transform: rotate(45deg); transform: rotate(45deg); margin-left: 5px; margin-top: -1px; cursor: pointer; } .litespeed-tick label { padding: 2px 0px 2px 0; font-size: 14px; color: #264d73; } .litespeed-tick label:hover { min-width: 115px; color: #6699cc; } /* ======================================= RADIO - vertical ======================================= */ .litespeed-radio-row { margin-bottom: 12px; position: relative; padding-left: 1.5rem; } .litespeed-radio-row input[type='radio'] { margin-top: 0; margin-bottom: 0; position: absolute; line-height: 1; left: 0; top: 0.7em; transform: translateY(-50%); } .litespeed-radio-row label { vertical-align: text-bottom; line-height: 1.4; } @media screen and (max-width: 782px) { .litespeed-radio-row { padding-left: 2rem; } } /* ======================================= FORM - layout ======================================= */ .litespeed-wrap .litespeed-float-submit { position: absolute; right: 0; top: -5px; margin-top: 0; } .rtl .litespeed-wrap .litespeed-float-submit { left: 10px; right: unset; } .litespeed-wrap .litespeed-float-resetbtn { position: absolute; right: 0; bottom: 20px; } .rtl .litespeed-wrap .litespeed-float-resetbtn { left: 10px; right: unset; } /* ======================================= FORM - utilities ======================================= */ .litespeed .litespeed-input-large { font-size: 20px; } .litespeed-input-long { width: 87%; } .litespeed-input-short2 { width: 150px; } .litespeed-input-short { width: 45px; } @media screen and (max-width: 680px) { .litespeed-input-short2 { width: 160px; } .litespeed-input-short { width: 50px; } } /* ======================================= FORM - elements ======================================= */ .litespeed-form-label { font-size: 1em; margin: 0.65rem 0; display: block; font-weight: 600; } .litespeed-form-label--toggle { margin: 0; display: inline-block; min-width: 110px; } input.litespeed-input[type='file'] { padding: 9px; min-width: 500px; border: 1px solid #ddd; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07); background-color: #fff; color: #32373c; outline: 0; transition: 50ms border-color ease-in-out; } .litespeed-body .litespeed-textarea-success { border-color: #6699cc; } input.litespeed-input-success { border-color: #28a745; } input.litespeed-input-warning { border-color: #e59544; } .litespeed-textarea { width: 60%; } .litespeed-textarea-recommended { display: flex; margin-top: -5px; } .litespeed-textarea-recommended .litespeed-desc { margin: 0; } .litespeed-textarea-recommended > div:first-child { margin-top: 1.7em; font-size: 12px; margin-right: 25px; } .litespeed-wrap .litespeed-collection-button { text-decoration: none; min-width: 30px; text-align: center; } .litespeed-collection-button[data-action='add'] { margin-top: -5px; margin-left: -5px; } .litespeed-collection-button .dashicons { vertical-align: baseline; } .litespeed-wrap .button:not(.litespeed-btn-large).litespeed-form-action .dashicons { font-size: 1.2em; vertical-align: middle; top: 0; } @media screen and (max-width: 680px) { .litespeed-body tbody > tr > th { display: block; padding: 18px 0 5px 12px; } .litespeed-body .litespeed-table td { display: block; max-width: 100%; } .litespeed-body .litespeed-table textarea, .litespeed-body .litespeed-table input.litespeed-regular-text { width: 100% !important; } .litespeed-wrap .litespeed-float-submit { display: none; } .litespeed-body { padding: 1px 10px 20px 15px; } .litespeed-body .regular-text:not(.litespeed-input-short) { width: 100%; } .litespeed-textarea-recommended { flex-direction: column; } .litespeed-textarea-recommended > div:first-child { margin-bottom: 1.7em; margin-top: 0; margin-right: 0; } .litespeed-switch { max-width: 100%; flex-wrap: wrap; } .litespeed-switch + .litespeed-warning { display: block; margin-top: 10px; } input.litespeed-input[type='file'] { max-width: calc(100% - 24px); min-width: 0; } .litespeed-body .litespeed-table .litespeed-row-flex { flex-direction: column; } } /* ======================================= ENTERPRISE NOTICE ======================================= */ .litespeed-ent-notice { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background-color: #333; z-index: 999; opacity: 0.8; text-align: center; font-size: 3rem; color: #1865c5; } .litespeed-ent-notice-desc { position: relative; top: 30%; transform: rotate(-20deg); text-shadow: 2px 2px 4px #000000; } /* ======================================= PROMO BANNER ======================================= */ .litespeed-banner-promo, .litespeed-banner-promo-full { display: flex; padding: 0px; } .litespeed-banner-promo-full { margin: 0px; padding: 0px; } .litespeed-banner-promo-logo { background-image: url(../img/lscwp-logo_90x90.png); background-size: contain; width: 90px; background-repeat: no-repeat; display: inline-block; } .litespeed-banner-promo-full .litespeed-banner-promo-logo { margin: 0px; width: 90px; height: 90px; } .litespeed-banner-promo-content { margin-left: 25px; } .litespeed-banner-promo-full .litespeed-banner-promo-content { width: 75%; } .litespeed-banner-promo-content h1 { font-weight: 600; color: #538ac6; margin-top: 10px; } .litespeed-banner-title { font-size: 1.3em; margin: 8px 0px 5px 0px; } .litespeed-banner-promo-slacklogo { background-image: url('../img/slack-logo.png'); background-size: contain; width: 75px; height: 75px; background-repeat: no-repeat; display: inline-block; padding: 0px; flex: 0 0 5%; } .litespeed-banner-promo .litespeed-banner-promo-slack-line1 { font-size: 18px; margin-top: 0px; line-height: 21px; } .litespeed-banner-promo .litespeed-banner-promo-slack-textlink { color: #e59544; text-decoration: none; } .litespeed-banner-promo .litespeed-banner-promo-slack-textlink:hover { opacity: 0.8; } .litespeed-banner-promo-slack-line2 { font-size: 15px; margin: 0px; line-height: 0.75em; } .litespeed-banner-promo-slack-link { color: #888888; } a.litespeed-btn-xs.litespeed-banner-promo-slack-btn { margin: 0px 5px; } /* ======================================= PROMO BANNER - QC ======================================= */ .litespeed-banner-promo-qc { display: flex; } .litespeed-banner-promo-qc h2 { line-height: 1.4; } .litespeed-banner-promo-qc-content { display: flex; align-items: center; } .litespeed-banner-promo-qc-description { flex-basis: 50%; padding-right: 2rem; } .litespeed-banner-promo-qc-description p { font-size: 14px; } .litespeed-banner-promo-qc-description .button { margin-right: 1.5rem; } .litespeed-tweet-preview { border-radius: 5px; line-height: 1.3125; box-shadow: 1px 1px 0.5em rgba(0, 0, 0, 0.3); margin: 0.5em 1em 1em 0; padding: 1em; max-width: 480px; display: flex; } .litespeed-tweet-preview:after { content: ''; display: block; clear: both; } .litespeed-tweet-preview p:first-child { margin-top: 0; } .litespeed-tweet-preview-title { color: #777; margin-top: 0.9em; font-weight: normal; font-size: 12px; margin-bottom: 0; margin-top: 0.9em; } .litespeed-tweet-text { font: 14px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif; line-height: 1.3125; } .litespeed-tweet-cta { text-align: right; margin-top: 1em; } .litespeed-tweet-cta a { background-color: #1da1f2; line-height: 1.3125; color: #fff; font-weight: bold; display: inline-flex; padding: 0.55em 1em; font-size: 14px; border-radius: 99em; text-decoration: none; } .litespeed-tweet-cta a:hover { background-color: #1e98e1; } .litespeed-tweet-cta a svg { width: 16px; height: 18px; margin-right: 0.5em; } .litespeed-tweet-cta a svg path { fill: currentColor; } .litespeed-tweet-img { width: calc(240px + 1rem); padding-right: 1rem; box-sizing: border-box; } .litespeed-tweet-img img { max-width: 100%; vertical-align: middle; } .litespeed-tweet-img + p { margin-top: 0; } /* ======================================= admin -> media lib icon ======================================= */ .litespeed-media-href { display: inline-table; } [class*='litespeed-icon-media-'] { background-size: contain; width: 25px; height: 25px; vertical-align: middle; margin: 0; background-repeat: no-repeat; display: inline-block; } [class*='litespeed-icon-media-']:hover { opacity: 0.7; } .litespeed-icon-media-webp { background-image: url('../img/icons/img_webp.svg'); } .litespeed-icon-media-webp-disabled { background-image: url('../img/icons/img_webp_disabled.svg'); } .litespeed-icon-media-optm { background-image: url('../img/icons/img_optm.svg'); } .litespeed-icon-media-optm-disabled { background-image: url('../img/icons/img_optm_disabled.svg'); } p.litespeed-media-p { margin-bottom: 1px !important; } p.litespeed-txt-webp { color: #83b04a; } p.litespeed-txt-ori { color: #5967b3; } p.litespeed-txt-disabled { color: #ced2d9; } .litespeed-media-svg { vertical-align: middle; margin: 5px; width: 25px; height: auto; } @keyframes litespeed-circle-chart-fill { to { stroke-dasharray: 0 100; } } /* ======================================= PIE chart ======================================= */ .litespeed-pie { vertical-align: middle; margin: 5px 5px 5px 0; } circle.litespeed-pie_bg { stroke: #efefef; stroke-width: 2; fill: none; } circle.litespeed-pie_circle { animation: litespeed-circle-chart-fill 2s reverse; transform: rotate(-90deg); transform-origin: center; animation: litespeed-pie-fill 2s reverse; /* 1 */ stroke: #28a745; stroke-width: 2; stroke-linecap: round; fill: none; } .litespeed-pie.litespeed-pie-tiny { margin: 0 2px 0 0; } .litespeed-pie.litespeed-pie-tiny text { font-weight: bold; fill: #828282; } .litespeed-pie.litespeed-pie-tiny circle { stroke-linecap: initial; } .litespeed-pie-tiny circle.litespeed-pie_bg, .litespeed-pie-tiny circle.litespeed-pie_circle { stroke-width: 3; } .litespeed-pie-tiny circle.litespeed-pie_bg { stroke: #eee; } .litespeed-pie-success circle.litespeed-pie_circle { stroke: #28a745; } .litespeed-pie-warning circle.litespeed-pie_circle { stroke: #e67700; } .litespeed-pie-danger circle.litespeed-pie_circle { stroke: #c7221f; } g.litespeed-pie_info text { dominant-baseline: central; text-anchor: middle; font-size: 11px; } .litespeed-promo-score g.litespeed-pie_info text { font-size: 14px; font-weight: 600; } .litespeed-pie-success g.litespeed-pie_info text { fill: #28a745; } .litespeed-pie-warning g.litespeed-pie_info text { fill: #e67700; } .litespeed-pie-danger g.litespeed-pie_info text { fill: #c7221f; } g.litespeed-pie_info .litespeed-pie-done { fill: #28a745; font-size: 15px; } /* ======================================= VIEW - multiple cdn mapping ======================================= */ [data-litespeed-cdn-mapping]:first-child [data-litespeed-cdn-mapping-del] { display: none; } .litespeed-cdn-mapping-col1 { padding-right: 2rem; max-width: 35%; } .litespeed-cdn-mapping-col1 .litespeed-input-long { width: 100%; } .litespeed-cdn-mapping-col2 { padding-top: 0.25rem; } .litespeed-cdn-mapping-col1 label { position: relative; } [data-litespeed-cdn-mapping-del] { position: absolute; right: -6px; top: -6px; } @media screen and (max-width: 600px) { .litespeed-cdn-mapping-col1 { max-width: 100%; } } /* ======================================= VIEW - crawler ======================================= */ .litespeed-crawler-curr { vertical-align: middle; height: 20px; margin-left: 10px; } #cookie_crawler > p:first-child { margin-top: 5px; } .litespeed-crawler-sitemap-nav { display: flex; justify-content: space-between; } .litespeed-crawler-sitemap-nav > div { margin-top: 10px; } @media screen and (max-width: 680px) { .litespeed-crawler-sitemap-nav { display: block; } .litespeed-table-responsive { clear: both; overflow-x: auto; -webkit-overflow-scrolling: touch; } .litespeed-table-responsive table { width: 100%; } .litespeed-table-responsive th { text-wrap: nowrap; } .litespeed-table-responsive [data-crawler-list].wp-list-table td:nth-child(2) { min-width: 115px; } .litespeed-wrap input[name='kw'] { width: 100% !important; } } /* ======================================= PROGRESS BAR ======================================= */ .litespeed-progress-bar { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; color: #fff; text-align: center; background-color: #007bff; transition: width 0.6s ease; } .litespeed-progress-bar-yellow { background-color: #fbe100; } .litespeed-progress { display: -webkit-box; display: -ms-flexbox; display: flex; height: 12px; overflow: hidden; font-size: 0.75rem; background-color: #e9ecef; border: 1px solid #dddddd; border-radius: 8px; width: 75%; margin: 5em 1em 1.5em 1em !important; } /* ======================================= PROGRESS BAR - modal ======================================= */ .litespeed-modal { margin-top: -8px; } .litespeed-modal .litespeed-progress { margin-left: -8px; margin-right: -8px; } /* ======================================= GUIDANCE ======================================= */ .litespeed-guide { border: 1px solid #73b38d; max-width: 50%; padding: 20px; } .litespeed-guide h2 { color: #73b38d; border-bottom: 1px solid #73b38d; display: table; padding-right: 50px; padding-left: 3px; padding-bottom: 3px; } .litespeed-guide li { font-size: 15px; line-height: 30px; margin: 10px 10px 10px 16px; } .litespeed-guide li.litespeed-guide-done:before { content: '\2713'; font-size: 26px; color: #73b38d; margin-left: -37px; margin-right: 18px; opacity: 1; } .litespeed-guide li.litespeed-guide-done { opacity: 0.9; } /* ======================================= VIEW - image optimization ======================================= */ .litespeed-image-optim-summary-wrapper { padding: 0; } .litespeed-cache_page_litespeed-img_optm .nav-tab-wrapper, .litespeed-cache_page_litespeed-cdn .nav-tab-wrapper { border-bottom-color: #e5e5e5; } .litespeed-cache_page_litespeed-img_optm .litespeed-body, .litespeed-cache_page_litespeed-cdn .litespeed-body { box-shadow: none; } .litespeed-cache_page_litespeed-img_optm .litespeed-wrap .nav-tab:not(.nav-tab-active), .litespeed-cache_page_litespeed-cdn .litespeed-wrap .nav-tab:not(.nav-tab-active) { border-bottom-color: #e5e5e5; } .litespeed-cache_page_litespeed-img_optm .nav-tab-active, .litespeed-cache_page_litespeed-cdn .nav-tab-active { border-left-color: #e5e5e5; border-right-color: #e5e5e5; border-top-color: #e5e5e5; position: relative; z-index: 2; } .litespeed-cache_page_litespeed-img_optm [data-litespeed-layout='summary'], .litespeed-cache_page_litespeed-cdn [data-litespeed-layout='qc'] { margin: -2px -21px -21px -21px; background: #f0f0f1; } .litespeed-column-secondary { background: #f9fafc; } .litespeed-column-with-boxes .postbox { border-color: #e5e5e5; } .litespeed-column-with-boxes .litespeed-width-7-10 { padding: 0; } @media screen and (min-width: 815px) { .litespeed-column-with-boxes > div.litespeed-column-left { padding-right: 25px; } } .litespeed-column-with-boxes > div.litespeed-column-right { background: #f1f1f1; padding-top: 0; padding-right: 0; padding-left: 0; } .litespeed-column-with-boxes > div.litespeed-column-right .litespeed-postbox:last-child { margin-bottom: 0; } .litespeed-image-optim-summary, .litespeed-column-left-inside { box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); position: relative; padding: 1px 20px 20px 20px; background: #fff; border: 1px solid #e5e5e5; } .litespeed-image-optim-summary-footer, .litespeed-column-with-boxes-footer { border-top: 1px solid #efefef; background: #f9f9f9; padding: 20px; margin: 20px -20px -20px; } .litespeed-help-btn-icon { text-decoration: none; margin-left: 10px; color: #c8c8c8; } .litespeed-postbox-imgopt-info .litespeed-flex-container { align-items: center; } .litespeed-postbox-imgopt-info .litespeed-flex-container:not(:last-child) { margin-bottom: 0.65em; } .litespeed-postbox-imgopt-info .litespeed-flex-container p:first-child { margin-top: 0; } .litespeed-image-optim-summary > h3:first-child, .litespeed-column-left-inside > h3:first-child { margin-top: 1.6em; font-size: 1.2em; } .litespeed-image-optim-summary > h3:first-child .litespeed-quic-icon, .litespeed-column-left-inside > h3:first-child .litespeed-quic-icon { width: 1.2em; height: 1.4em; background-size: contain; margin-right: 0.2rem; } .litespeed-img-optim-actions { margin-top: 1.65em; display: flex; align-items: flex-end; flex-wrap: wrap; } .litespeed-img-optim-actions .button-primary { font-size: 1.2em; margin-right: 1em; padding: 0.35em 0.85em; min-width: 210px; text-align: center; } @media screen and (max-width: 1079px) { .litespeed-postbox-imgopt-info svg { height: 50px; width: 50px; } } @media screen and (max-width: 814px) { .litespeed-column-with-boxes > div:first-child { padding-right: 0; margin-bottom: 1rem; } } @media screen and (max-width: 680px) { .litespeed-img-optim-actions .button + .button.button-secondary { margin-left: 0; margin-top: 10px; } } /* ======================================= VIEW - image optm media row ======================================= */ .imgoptm.column-imgoptm a[data-balloon-pos] { border-bottom: 1px dashed; } .imgoptm.column-imgoptm p { margin-bottom: 0.25em; margin-top: 0; } .imgoptm.column-imgoptm p + .row-actions { margin-top: 0.5em; } .fixed .column-lqip { width: 6rem; } .litespeed-media-lqip img { max-width: 62px; max-height: 62px; } .litespeed-media-href { font-size: 12px; } /* ======================================= VIEW - log view ======================================= */ .litespeed-log-view-wrapper { margin: 1.5em 0; } /* ======================================= VIEW - dashboard ======================================= */ .litespeed-dashboard-group { margin-bottom: 1rem; } .litespeed-dashboard-group > .litespeed-flex-container { margin: 0 -10px; min-width: 100%; width: auto; } .litespeed-dashboard .litespeed-postbox { margin: 10px; } .litespeed-dashboard-title a { text-decoration: none; margin-left: 0.25rem; } .litespeed-dashboard-title--w-btn { display: flex; align-items: center; } .litespeed-dashboard-title--w-btn .button { font-weight: normal; } .litespeed-postbox-footer .button-small { vertical-align: middle; } .litespeed-postbox .button.button-small .dashicons, .litespeed-dashboard-title--w-btn .button.button-small .dashicons { font-size: 1rem; top: 0.05em; vertical-align: middle; margin-left: -5px; } .litespeed-dashboard-header { display: flex; align-items: center; } .litespeed-postbox p.litespeed-dashboard-stats-total + p.litespeed-dashboard-stats-total { margin-top: 1.2em; } .litespeed-dashboard-header:first-child { margin-top: 1.5rem; } .litespeed-dashboard-header hr { align-self: center; flex-grow: 1; margin-left: 15px; margin-right: 15px; } .litespeed-dashboard-header hr:last-child { margin-right: 0; } .litespeed-dashboard-header .litespeed-learn-more { font-weight: normal; text-decoration: none; margin-top: -2px; color: #5e7380; } .litespeed-dashboard-stats h3 { text-transform: uppercase; font-size: 12px; font-weight: normal; margin-bottom: 0; margin-top: 1.2em; color: #777; } .litespeed-dashboard-stats h3 + p { margin-top: 0; margin-bottom: 0; } .litespeed-dashboard-stats .litespeed-desc { color: #777; } .litespeed-dashboard-stats p strong { font-size: 2em; font-weight: normal; margin-right: 5px; } .litespeed-dashboard-stats-wrapper { display: flex; position: relative; } .litespeed-dashboard-stats-wrapper .litespeed-postbox { margin: 0; min-width: 20%; } .litespeed-dashboard-stats-wrapper .litespeed-postbox .inside .litespeed-title, .litespeed-dashboard-group .litespeed-postbox .inside .litespeed-title { font-size: 14px; } .litespeed-postbox .inside .litespeed-title a { font-size: 13px; } .litespeed-dashboard-stats-wrapper .litespeed-postbox:not(:last-child) { margin-right: -1px; } .litespeed-dashboard-stats-wrapper .litespeed-postbox:not(:first-child) { border-left-color: #f9f9f9; } .litespeed-dashboard-stats-wrapper .litespeed-dashboard-stats p strong { font-size: 1.4rem; } .litespeed-dashboard-stats-wrapper .litespeed-pie { width: 60px; height: 60px; } .litespeed-dashboard-stats-wrapper .litespeed-flex-container + p:not(:last-child) { margin-bottom: 0.55em; } .litespeed-dashboard-stats-payg { color: #777; } .litespeed-dashboard-stats-payg strong { color: #444; } .postbox .inside > p.litespeed-dashboard-stats-payg { margin-top: 1.35em; } .postbox .inside > p.litespeed-dashboard-stats-payg:last-child { margin-bottom: -5px !important; } .litespeed-postbox p.litespeed-dashboard-stats-total { padding: 0.75em 20px 0 20px; border-top: 1px dashed #eee; margin-top: 0.55em; margin-left: -20px; margin-right: -20px; margin-bottom: -0.55em !important; } .litespeed-postbox.litespeed-postbox-partner .inside { margin: 11px 0; } .litespeed-dashboard-stats-wrapper .litespeed-postbox.litespeed-postbox-partner h3.litespeed-title { color: #777; font-weight: normal; font-size: 13px; } .litespeed-postbox.litespeed-postbox-partner a { font-size: 1.35rem; font-weight: bold; text-decoration: none; margin-top: 5px; max-width: 100%; display: inline-block; } .litespeed-postbox.litespeed-postbox-partner a:hover { text-decoration: underline; } .litespeed-postbox.litespeed-postbox-partner img { max-width: 12rem; } .litespeed-dashboard-group .litespeed-postbox { width: calc(25% - 20px); display: flex; flex-direction: column; justify-content: space-between; } .litespeed-dashboard-group .litespeed-postbox-double { min-width: calc(50% - 20px); display: flex; justify-content: space-between; } .litespeed-postbox-double-content { display: flex; align-items: flex-start; justify-content: space-between; } .litespeed-postbox-double-content .litespeed-postbox-double-col { width: 50%; } .litespeed-postbox-double-content .litespeed-postbox-double-col:nth-child(2) { padding-left: 10px; } .litespeed-dashboard-group hr { margin: 1.5rem 0 0.75rem 0; } .litespeed-postbox .litespeed-postbox-refresh { text-decoration: none; color: #36b0b0; line-height: 1; vertical-align: top; margin-left: 0.5rem; margin-bottom: 0; } .litespeed-postbox .litespeed-postbox-refresh.button .dashicons { font-size: 22px; top: 0.05em; } .litespeed-postbox p:last-child { margin-bottom: 0; } .litespeed-label-dashboard { font-size: 0.92em; padding: 0.3em 0.6em 0.35em 0.6em; font-weight: normal; display: inline-block; margin-left: 8px; min-width: 2em; } .litespeed-label-dashboard:first-child { margin-left: 0; margin-right: 0.35em; } .litespeed-postbox .inside { padding: 0 20px 5px; } .litespeed-postbox .inside .litespeed-title { margin: 0 -20px 12px -20px; padding: 0px 20px 7px 20px; border-bottom: 1px solid #eee; font-size: 1.2em; } .litespeed-postbox .inside.litespeed-postbox-footer { border-top: 1px solid #efefef; background: #f9f9f9; padding: 20px; margin-bottom: 0px; margin-top: 0; } .litespeed-postbox-footer a, a.litespeed-redetect { text-decoration: none; } .litespeed-postbox .inside.litespeed-postbox-footer--compact { padding: 7px 15px 8px 15px; font-size: 12px; } .litespeed-postbox-imgopt .litespeed-pie { width: 55px; height: 55px; } .litespeed-postbox-imgopt .litespeed-flex-container { align-items: center; margin-bottom: 10px; } .litespeed-postbox-imgopt .litespeed-flex-container .litespeed-icon-vertical-middle + div h3 { margin-top: 0; } .litespeed-postbox-imgopt .litespeed-flex-container .litespeed-icon-vertical-middle + div p { line-height: 1.2; } .litespeed-postbox-imgopt .litespeed-postbox-double-col:last-child > *:first-child { margin-top: 7px; } .litespeed-postbox-pagespeed p:first-child { margin-top: 0; margin-bottom: 0; } .litespeed-postbox-score-improve { line-height: 45px; margin-top: 7px; font-size: 42px; } .litespeed-postbox-pagespeed .litespeed-padding-space:first-child { padding-left: 5px; padding-right: 5px; } .litespeed-link-with-icon { text-decoration: underline; margin-right: 0.25em; } .litespeed-link-with-icon .dashicons { vertical-align: baseline; position: relative; top: 0.1em; font-size: 1em; text-decoration: none; width: auto; margin-right: 0.5em; } .litespeed-link-with-icon.litespeed-icon-right .dashicons { margin-left: 0.5em; margin-right: 0; } .litespeed-warning-bg { background-color: #b58a09; color: white; } .litespeed-links-group:not(:last-child) { margin-bottom: 1em; } .litespeed-links-group > span:not(:last-child):after { content: '|'; margin: 0 10px; color: #ddd; font-size: 13px; } .litespeed-wrap p.litespeed-qc-dashboard-link { margin-left: 1rem; } .litespeed-right.litespeed-qc-dashboard-link .dashicons { margin-left: 0.5em; margin-right: 0; } .litespeed-score-col { flex-grow: 1; padding-right: 15px; } .litespeed-score-col .litespeed-text-md { font-size: 1.35rem; } .litespeed-score-col.litespeed-score-col--imp { text-align: right; padding-right: 0; } .litespeed-score-col--imp .litespeed-text-jumbo { line-height: 1; } .litespeed-wrap span[data-balloon-pos] { border-bottom: 1px dashed; } .litespeed-wrap span[aria-label][data-balloon-pos] { cursor: default; } .litespeed-postbox--quiccloud { border-color: #253545; } .litespeed-postbox--quiccloud.litespeed-postbox .inside .litespeed-title { background: #253545; color: #e2e4e5; margin-top: -11px; padding: 10px 15px; margin-left: -15px; margin-right: -15px; } .litespeed-postbox--quiccloud.litespeed-postbox .inside .litespeed-title a { color: #8abff8; } .litespeed-postbox--quiccloud.litespeed-postbox .inside .litespeed-title a:hover { color: #a5caf2; } .litespeed-overwrite{ display: inline-block; margin-left: 10px; } @media screen and (min-width: 1401px) { .litespeed-postbox--quiccloud.litespeed-postbox .inside .litespeed-title { padding-left: 20px; padding-right: 20px; margin-left: -20px; margin-right: -20px; } .litespeed-postbox .inside.litespeed-postbox-footer--compact { padding-left: 20px; padding-right: 20px; } } @media screen and (max-width: 1400px) and (min-width: 1024px) { .litespeed-dashboard-stats-wrapper .litespeed-postbox { flex-grow: 1; } .litespeed-postbox .inside { padding: 0 15px 5px; } .litespeed-dashboard-group .litespeed-postbox { width: calc(33.3333% - 20px); } .litespeed-dashboard-group .litespeed-postbox-double { min-width: calc(66.6666% - 20px); } } @media screen and (max-width: 1023px) { .litespeed-dashboard-stats-wrapper { flex-wrap: wrap; } .litespeed-dashboard-stats-wrapper .litespeed-postbox:not(:first-child) { border-left-color: #ccd0d4; } .litespeed-dashboard-stats-wrapper .litespeed-postbox { margin-top: -1px; min-width: calc(33.3333% - 1px); } .litespeed-postbox .inside { padding: 0 15px 5px; } .litespeed-dashboard-group .litespeed-postbox { width: calc(50% - 20px); } .litespeed-dashboard-group .litespeed-postbox-double { min-width: calc(100% - 20px); } } @media screen and (max-width: 719px) and (min-width: 480px) { .litespeed-dashboard-stats-wrapper .litespeed-postbox { margin-top: -1px; min-width: calc(50% - 2px); } } @media screen and (max-width: 569px) { .litespeed-dashboard-stats-wrapper .litespeed-postbox { min-width: 100%; } .litespeed-dashboard-group .litespeed-postbox { width: 100%; } .litespeed-postbox-double-content .litespeed-postbox-double-col { width: 100%; } .litespeed-postbox-double-content .litespeed-postbox-double-col:nth-child(2) { padding-left: 0; margin-top: 7px; } .litespeed-postbox-double-content { flex-wrap: wrap; } } /* ======================================= VIEW - dashboard QC services ======================================= */ .litespeed-dashboard-qc { position: relative; } .litespeed-dashboard-unlock { text-align: center; background-color: #fff; box-shadow: 0 0.125rem 0.4rem -0.0625rem rgba(0, 0, 0, 0.03), 0px 3px 0px 0px rgba(0, 0, 0, 0.07); border-radius: 0.5rem; padding: 2rem; position: absolute; z-index: 5; left: 50%; transform: translate(-50%, 25%); top: 0; max-width: 96%; width: 540px; } .litespeed-dashboard-unlock.litespeed-dashboard-unlock--inline { position: relative; left: 50%; transform: translate(-50%, 0); border: 1px solid #e5e5e5; background: #fafafa; margin-top: 2rem; margin-bottom: 1rem; max-width: calc(100% - 4rem); } .litespeed-dashboard-unlock-title { font-size: 28px; } .litespeed-dashboard-unlock-desc { font-size: 17px; color: #000; } .litespeed-dashboard-unlock-desc span { font-size: 14px; color: #666; } p.litespeed-dashboard-unlock-footer { margin: 3em auto 0 auto; max-width: 500px; } .litespeed-qc-text-gradient { background: -webkit-linear-gradient(130deg, #ff2a91, #2295d8 60%, #161f29); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 800; } .litespeed-dashboard-unlock a.button.button-primary, .litespeed-wrap .button.litespeed-button-cta { font-size: 1.2em; padding: 0.35em 1em 0.35em 0.85em; min-width: 210px; text-align: center; } .litespeed-dashboard-unlock a.button.button-primary { margin-top: 10px; } .litespeed-dashboard-unlock a.button.button-primary .dashicons, .litespeed-wrap .button.litespeed-button-cta .dashicons { vertical-align: baseline; top: 0.25em; margin-right: 0.5em; } .litespeed-dashboard-unlock + .litespeed-dashboard-qc-enable { opacity: 0.75; filter: blur(2px); } .litespeed-dashboard-unlock + .litespeed-dashboard-qc-enable:before { content: ''; position: absolute; left: -10px; top: -5px; width: calc(100% + 20px); height: calc(100% + 10px); background: #161e29; z-index: 2; opacity: 0.55; filter: blur(2px); } @media screen and (min-width: 1400px) { .litespeed-dashboard-unlock { width: 800px; } } @media screen and (max-width: 640px) { .litespeed-dashboard-unlock { max-width: 80%; padding: 1rem 1.5rem 2rem 1.5rem; transform: translate(-50%, 10%); } .litespeed-dashboard-unlock-title { font-size: 22px; line-height: 1.2; } } @media screen and (max-width: 340px) { .litespeed-dashboard-unlock a.button.button-primary, .litespeed-wrap .button.litespeed-button-cta { padding: 0.35em 1em 0.35em 1em; } .litespeed-dashboard-unlock a.button.button-primary .dashicons, .litespeed-wrap .button.litespeed-button-cta .dashicons { display: none; } p.litespeed-dashboard-unlock-footer { margin-top: 2em; } } /********************************* todo *******************************/ /* image optimize page */ .litespeed-column-java { background: #5cadad !important; } .litespeed-text-shipgrey { color: #535342 !important; } .litespeed-text-dimgray { color: #666666 !important; } .litespeed-text-grey { color: #999999 !important; } .litespeed-text-whisper { color: #e6e6e6 !important; } .litespeed-text-malibu { color: #5cbdde !important; } .litespeed-text-morningglory { color: #99cccc !important; } .litespeed-text-fern { color: #66cc66 !important; } .litespeed-text-persiangreen { color: #009999 !important; } .litespeed-text-lead { font-size: 16px; } .litespeed-text-small { font-size: 12px; line-height: 14px; } .litespeed-text-thin { font-weight: 100; } .litespeed-contrast { color: white; } .litespeed-hr-dotted { border: 1px dotted #eeeeee; } .litespeed-hr { padding-bottom: 1.5em; border-bottom: 0.5px solid #97caca; } .litespeed-hr-with-space { border-top: 1px solid #eeeeee; margin: 2em 0; border-bottom: none; } .litespeed-icon-vertical-middle { vertical-align: middle; display: inline-block; margin: 0px 10px 0px 10px; } .litespeed-column-java .litespeed-danger { color: #c1c53a !important; } .litespeed-column-java .litespeed-desc { color: #bfbfbf; } .litespeed-column-java code { color: #c2f5bf; background-color: #238888; } .litespeed-column-java .litespeed-title { color: white; } .litespeed-width-7-10 .litespeed-progress { margin: 1em; } .litespeed-refresh:after { content: '⟳'; width: 20px; height: 20px; color: #40ad3a; } .litespeed-column-java .litespeed-refresh:after { color: #23ec17; } .litespeed-refresh:hover:after, .litespeed-refresh:focus:after, .litespeed-refresh:focus:active:after { color: #7ffbfb; } .litespeed-width-3-10 .litespeed-title { margin: 18px 0; } .litespeed-silence { color: #b1b1b1; } .litespeed-column-java .litespeed-congratulate { color: #c2f5bf; font-size: 20px; } .litespeed-light-code .litespeed-silence code { background-color: #f0f5fb; } .litespeed-column-java .litespeed-btn-danger { color: #f194a8; border-color: #f194a8; } .litespeed-column-java .litespeed-btn-danger:hover { background: #f194a8; } .litespeed-column-java svg.litespeed-pie circle.litespeed-pie_bg { stroke: #e8efe7; } .litespeed-column-java svg.litespeed-pie circle.litespeed-pie_circle { stroke: #97caca; } .litespeed-column-java svg .litespeed-pie_info text { fill: #f5ffeb; } .litespeed-column-java svg g.litespeed-pie_info .litespeed-pie-done { fill: #a5ffa0; } .litespeed-column-java a { color: #eaf8ff; } .litespeed-column-java a:hover { color: #ffffff; } .litespeed-progress-bar-blue { background-color: #33adff; } .litespeed-status-current { font-size: 3.5em; margin: 1.25em 0em 0.75em 0em; } /* .litespeed-title, .litespeed-title-short { margin: 18px 0; border-bottom: 1px solid #C1D5EA; margin: 2.5em 0px 1.5em 0 !important; } */ .litespeed-column-java .litespeed-desc { color: #cae4e4; } .litespeed-column-java .litespeed-warning { color: #ffd597 !important; } .litespeed-column-java .litespeed-btn-success { color: #ddf1e4; border: 1px solid #33ad5c; background: #33ad5c; } .litespeed-column-java .litespeed-btn-success:hover { color: #ffffff; border: 1px solid #7dca97; background: #009933; } .litespeed-column-java .litespeed-btn-warning { color: #fff1dd; border: 1px solid #ff9933; background-color: #ff9933; } .litespeed-column-java .litespeed-btn-warning:hover { color: #ffffff; border-color: #ffca7d; background: #ff9900; } .litespeed-column-java .litespeed-btn-danger { color: #ffeadd !important; border: 1px solid #ff6600 !important; background: #ff5c5c; } .litespeed-column-java .litespeed-btn-danger:hover { color: #ffffff; border: 1px solid #ff9797 !important; background: #ff0000; } .litespeed-column-java .litepseed-dash-icon-success, .litepseed-dash-icon-success { color: #5cdede; font-size: 2em; margin-top: -0.25em; } .litespeed-column-java .litepseed-dash-icon-success:hover, .litepseed-dash-icon-success:hover { color: #7de5e5; } .litespeed-dashicons-large { font-size: 2em; } .litespeed-column-java p { color: #ffffff; } .litespeed-body tbody > tr > th.litespeed-padding-left { padding-left: 3em; } @media screen and (max-width: 680px) { .litespeed-body tbody > tr > th.litespeed-padding-left { padding-left: 10px; } .litespeed-body tbody > tr > th.litespeed-padding-left:before { content: '\2014\2014'; color: #ccc; margin-right: 5px; } } .litespeed-txt-small { font-size: 12px; } .litespeed-txt-disabled .litespeed-text-dimgray { color: #aaaaaa; } .litespeed-txt-disabled svg { fill: #aaaaaa; } .litespeed-txt-disabled circle.litespeed-pie_circle { stroke: #cccccc; } .litespeed-txt-disabled g.litespeed-pie_info text { color: #cccccc; } a.litespeed-media-href svg:hover { border-radius: 50%; background: #f1fcff; fill: #5ccad7; box-shadow: 0 0 5px 1px #7dd5df; transition: all 0.2s ease-out; transform: scale(1.05); } .litespeed-media-p a .dashicons-trash { font-size: 2.25em; vertical-align: middle; display: inline; border-radius: 50%; line-height: 1.5em; } .litespeed-media-p a .dashicons-trash:hover { transition: all 0.2s ease-out; color: #ffa500 !important; background: #fff5e6; box-shadow: 0 0 10px 1px #ff8c00; } .litespeed-media-p div > svg circle.litespeed-pie_bg { stroke: #ecf2f9; } .litespeed-media-p div > svg circle.litespeed-pie_circle { stroke: #9fbfdf; } .litespeed-media-p div > svg { fill: #538cc6; background: rgba(236, 242, 249, 0.1); border-radius: 50%; } .litespeed-banner-description-padding-right-15 { padding-right: 15px; } .litespeed-banner-description { display: inline-flex; flex-wrap: wrap; } .litespeed-banner-description-content { margin: 0px; line-height: 1.25em; } .litespeed-banner-button-link { white-space: nowrap; margin: 0px; line-height: 1.5em; padding-bottom: 5px; } .litespeed-notice-dismiss { position: absolute; right: 25px; border: none; margin: 0; padding: 10px; background: none; cursor: pointer; color: #888888; display: block; height: 20px; text-align: center; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-weight: 600; text-decoration: none; } .litespeed-notice-dismiss:hover, .litespeed-notice-dismiss:active, .litespeed-notice-dismiss:focus { color: #cc2929; } .litespeed-dot { display: inline-block; border-radius: 50%; width: 20px; height: 20px; color: white; text-align: center; } .litespeed-badge { display: inline-block; border-radius: 20%; min-width: 50px; height: 20px; color: white; text-align: center; } /* ======================================= Comparison Cards - Presets ======================================= */ .litespeed-comparison-card { box-sizing: border-box; } .litespeed-comparison-card-rec .litespeed-card-content > div.litespeed-card-body { font-size: 14px; } .litespeed-comparison-card-rec .litespeed-card-action { margin-bottom: 0.25rem; } .litespeed-comparison-card-rec h3 { font-size: 20px; } .litespeed-card-content > div, .litespeed-card-action { padding: 0.85rem 1.25rem; } .litespeed-card-header { border-bottom: 1px solid #eee; background: #f9fafc; } .litespeed-card-content > div.litespeed-card-body { align-self: stretch; justify-content: flex-end; font-size: 15px; padding-bottom: 0.5rem; padding-top: 1rem; } .litespeed-card-content > div.litespeed-card-footer { align-self: stretch; justify-content: flex-end; padding-bottom: 0; padding-top: 0.25rem; } .litespeed-card-action { justify-content: flex-end; } .litespeed-comparison-card ul { padding-left: 20px; list-style: none; list-style-position: outside; margin: 0; } .litespeed-comparison-card li { margin-bottom: 0.5em; line-height: 1.4; } .litespeed-comparison-card li:last-child { margin-bottom: 0; } .litespeed-comparison-card ul li:before { content: '✓'; margin-left: -1em; margin-right: 0.35em; color: #329c74; } @media screen and (max-width: 1279px) { .litespeed-comparison-card { margin: 0 0 -1px 0; } } @media screen and (min-width: 640px) and (max-width: 1279px) { .litespeed-comparison-cards { max-width: 740px; } .litespeed-card-content { display: flex; flex-wrap: wrap; } .litespeed-card-content .litespeed-card-header { width: 100%; } .litespeed-card-content > div.litespeed-card-body { align-self: initial; width: 50%; box-sizing: border-box; } .litespeed-card-content > div.litespeed-card-footer { width: 50%; align-self: initial; box-sizing: border-box; } .litespeed-card-content > div.litespeed-card-footer h4 { margin-top: 1rem; } } @media screen and (min-width: 1280px) { .litespeed-comparison-cards { display: flex; margin: 3rem 0 2rem 0; max-width: 1720px; } .litespeed-comparison-card { width: 19%; min-width: 0; display: flex; flex-direction: column; margin-right: -1px; justify-content: space-between; } .litespeed-comparison-card:first-child { border-top-left-radius: 5px; border-bottom-left-radius: 5px; overflow: hidden; } .litespeed-comparison-card:last-child { border-top-right-radius: 5px; border-bottom-right-radius: 5px; overflow: hidden; } .litespeed-comparison-card-rec { width: 23%; padding-top: 1rem; padding-bottom: 0.75rem; margin-top: -1rem; margin-bottom: 0.25rem; border-radius: 5px; overflow: hidden; } .litespeed-comparison-card-rec .litespeed-card-header { margin-top: -1rem; padding-top: 1.75rem; padding-bottom: 0.95rem; } } /* ======================================= BALLOON PURE CSS TOOLTIPS ======================================= */ .litespeed-wrap { --balloon-color: rgba(16, 16, 16, 0.95); --balloon-font-size: 12px; --balloon-move: 4px; } .litespeed-wrap button[aria-label][data-balloon-pos] { overflow: visible; } .litespeed-wrap [aria-label][data-balloon-pos] { position: relative; cursor: pointer; } .litespeed-wrap [aria-label][data-balloon-pos]:after { opacity: 0; pointer-events: none; transition: all 0.2s ease 0.05s; text-indent: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; font-weight: normal; font-style: normal; text-shadow: none; font-size: var(--balloon-font-size); background: var(--balloon-color); border-radius: 2px; color: #fff; content: attr(aria-label); padding: 0.5em 1em; position: absolute; white-space: nowrap; z-index: 10; line-height: 1.4; } .litespeed-wrap [aria-label][data-balloon-pos]:before { width: 0; height: 0; border: 5px solid transparent; border-top-color: var(--balloon-color); opacity: 0; pointer-events: none; transition: all 0.2s ease 0.05s; content: ''; position: absolute; z-index: 10; } .litespeed-wrap [aria-label][data-balloon-pos]:hover:before, .litespeed-wrap [aria-label][data-balloon-pos]:hover:after, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-visible]:before, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-visible]:after, .litespeed-wrap [aria-label][data-balloon-pos]:not([data-balloon-nofocus]):focus:before, .litespeed-wrap [aria-label][data-balloon-pos]:not([data-balloon-nofocus]):focus:after { opacity: 1; pointer-events: none; } .litespeed-wrap [aria-label][data-balloon-pos].font-awesome:after { font-family: FontAwesome, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-break]:after { white-space: pre; } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-break][data-balloon-length]:after { white-space: pre-line; word-break: break-word; } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-blunt]:before, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-blunt]:after { transition: none; } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='up']:after { bottom: 100%; left: 50%; margin-bottom: 10px; transform: translate(-50%, var(--balloon-move)); transform-origin: top; } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='up']:before { bottom: 100%; left: 50%; transform: translate(-50%, var(--balloon-move)); transform-origin: top; } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='up']:hover:after, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='up'][data-balloon-visible]:after { transform: translate(-50%, 0); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='up']:hover:before, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='up'][data-balloon-visible]:before { transform: translate(-50%, 0); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='up-left']:after { bottom: 100%; left: 0; margin-bottom: 10px; transform: translate(0, var(--balloon-move)); transform-origin: top; } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='up-left']:before { bottom: 100%; left: 5px; transform: translate(0, var(--balloon-move)); transform-origin: top; } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='up-left']:hover:after, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='up-left'][data-balloon-visible]:after { transform: translate(0, 0); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='up-left']:hover:before, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='up-left'][data-balloon-visible]:before { transform: translate(0, 0); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='up-right']:after { bottom: 100%; right: 0; margin-bottom: 10px; transform: translate(0, var(--balloon-move)); transform-origin: top; } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='up-right']:before { bottom: 100%; right: 5px; transform: translate(0, var(--balloon-move)); transform-origin: top; } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='up-right']:hover:after, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='up-right'][data-balloon-visible]:after { transform: translate(0, 0); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='up-right']:hover:before, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='up-right'][data-balloon-visible]:before { transform: translate(0, 0); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='down']:after { left: 50%; margin-top: 10px; top: 100%; transform: translate(-50%, calc(var(--balloon-move) * -1)); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='down']:before { width: 0; height: 0; border: 5px solid transparent; border-bottom-color: var(--balloon-color); left: 50%; top: 100%; transform: translate(-50%, calc(var(--balloon-move) * -1)); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='down']:hover:after, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='down'][data-balloon-visible]:after { transform: translate(-50%, 0); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='down']:hover:before, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='down'][data-balloon-visible]:before { transform: translate(-50%, 0); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='down-left']:after { left: 0; margin-top: 10px; top: 100%; transform: translate(0, calc(var(--balloon-move) * -1)); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='down-left']:before { width: 0; height: 0; border: 5px solid transparent; border-bottom-color: var(--balloon-color); left: 5px; top: 100%; transform: translate(0, calc(var(--balloon-move) * -1)); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='down-left']:hover:after, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='down-left'][data-balloon-visible]:after { transform: translate(0, 0); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='down-left']:hover:before, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='down-left'][data-balloon-visible]:before { transform: translate(0, 0); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='down-right']:after { right: 0; margin-top: 10px; top: 100%; transform: translate(0, calc(var(--balloon-move) * -1)); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='down-right']:before { width: 0; height: 0; border: 5px solid transparent; border-bottom-color: var(--balloon-color); right: 5px; top: 100%; transform: translate(0, calc(var(--balloon-move) * -1)); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='down-right']:hover:after, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='down-right'][data-balloon-visible]:after { transform: translate(0, 0); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='down-right']:hover:before, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='down-right'][data-balloon-visible]:before { transform: translate(0, 0); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='left']:after { margin-right: 10px; right: 100%; top: 50%; transform: translate(var(--balloon-move), -50%); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='left']:before { width: 0; height: 0; border: 5px solid transparent; border-left-color: var(--balloon-color); right: 100%; top: 50%; transform: translate(var(--balloon-move), -50%); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='left']:hover:after, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='left'][data-balloon-visible]:after { transform: translate(0, -50%); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='left']:hover:before, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='left'][data-balloon-visible]:before { transform: translate(0, -50%); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='right']:after { left: 100%; margin-left: 10px; top: 50%; transform: translate(calc(var(--balloon-move) * -1), -50%); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='right']:before { width: 0; height: 0; border: 5px solid transparent; border-right-color: var(--balloon-color); left: 100%; top: 50%; transform: translate(calc(var(--balloon-move) * -1), -50%); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='right']:hover:after, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='right'][data-balloon-visible]:after { transform: translate(0, -50%); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='right']:hover:before, .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-pos='right'][data-balloon-visible]:before { transform: translate(0, -50%); } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-length='small']:after { white-space: normal; width: 80px; } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-length='medium']:after { white-space: normal; width: 150px; } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-length='large']:after { white-space: normal; width: 260px; } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-length='xlarge']:after { white-space: normal; width: 380px; } @media screen and (max-width: 768px) { .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-length='xlarge']:after { white-space: normal; width: 90vw; } } .litespeed-wrap [aria-label][data-balloon-pos][data-balloon-length='fit']:after { white-space: normal; width: 100%; } /* ======================================= Misc Mobile TWEAKS ======================================= */ @media screen and (max-width: 680px) { .litespeed-wrap .litespeed-body .field-col { margin-left: 0; } .litespeed-width-auto.litespeed-table-compact td { font-size: 12px; word-break: break-word; } .litespeed-body .litespeed-table td .litespeed-right { float: none !important; } .litespeed-title a.litespeed-learn-more, .litespeed-title-short a.litespeed-learn-more { display: block; margin-left: 0; margin-top: 5px; } } .litespeed-wrap .litespeed-redetect[aria-label][data-balloon-pos][data-balloon-pos='up']:after { left: auto; right: 0; transform: translate(0%, var(--balloon-move)); } .litespeed-wrap .litespeed-redetect[aria-label][data-balloon-pos][data-balloon-pos='up']:hover:after, .litespeed-wrap .litespeed-redetect[aria-label][data-balloon-pos][data-balloon-pos='up'][data-balloon-visible]:after { transform: translate(0, 0); } /* ======================================= QC ======================================= */ .litespeed-col-status-data h3, .litespeed-col-status-data h4 { margin-bottom: 0; margin-top: 20px; } .litespeed-col-status-data h3 .dashicons { vertical-align: bottom; } .litespeed-col-status-data h4 .dashicons { vertical-align: sub; } /* To use on dark bg */ .litespeed-wrap .litespeed-qc-button { background-color: #5efffc; border: 1px solid #00d0cb; box-shadow: 0px 2px 0px 0px #00d0cb; color: #161f29; font-weight: 600; font-size: 15px; padding: 12px 24px; border-radius: 3px; line-height: 1; display: inline-flex; align-items: center; transition: 0.25s; } .litespeed-wrap .litespeed-qc-button:hover { background: #21a29f21; color: #5efffc; border-color: #00d0cb; } .litespeed-wrap .litespeed-qc-button .dashicons { top: auto; } .litespeed-postbox.litespeed-qc-promo-box { background: #161e29 linear-gradient(110deg, #171c2fbd, #252766ab); border-radius: 5px; box-shadow: 0px 4px 0px 0px #161d2e; border: none; } .litespeed-postbox.litespeed-qc-promo-box .inside { padding: 25px; margin: 0; } .litespeed-dashboard-group .litespeed-postbox.litespeed-qc-promo-box { box-shadow: none; } .litespeed-dashboard-group .litespeed-postbox.litespeed-qc-promo-box .inside { padding: 20px 25px; } .litespeed-postbox.litespeed-qc-promo-box h3 { margin-top: 0; color: #fff; font-size: 24px; font-weight: 800; line-height: 1.4em; } .litespeed-postbox.litespeed-qc-promo-box h3 .litespeed-quic-icon { width: 24px; height: 28px; background-size: contain; margin-right: 10px; } .litespeed-postbox.litespeed-qc-promo-box p { color: #dbdbdb; font-size: 1rem; } /* ======================================= Deactivate modal ======================================= */ #litespeed-modal-deactivate { padding: 20px; } #litespeed-modal-deactivate h2 { margin: 0px; } #litespeed-modal-deactivate .litespeed-wrap { margin: 10px 0px; } #litespeed-modal-deactivate .deactivate-clear-settings-wrapper, #litespeed-modal-deactivate .deactivate-actions { margin-top: 30px; } #litespeed-modal-deactivate .deactivate-reason-wrapper label, #litespeed-modal-deactivate .deactivate-clear-settings-wrapper label { width: 100%; display: block; margin-bottom: 5px; } #litespeed-modal-deactivate .deactivate-actions { display: flex; justify-content: space-between; } assets/css/iziModal.min.css 0000777 00000247556 15251157102 0011733 0 ustar 00 /* * iziModal | v1.5.1 * http://izimodal.marcelodolce.com * by Marcelo Dolce. */ .iziModal{display:none;position:fixed;top:0;bottom:0;left:0;right:0;margin:auto;background:#fff;box-shadow:0 0 8px rgba(0,0,0,.3);transition:margin-top .3s ease,height .3s ease;transform:translateZ(0)}.iziModal *{-webkit-font-smoothing:antialiased}.iziModal::after{content:'';width:100%;height:0;opacity:0;position:absolute;left:0;bottom:0;z-index:1;background:-moz-linear-gradient(top,transparent 0%,rgba(0,0,0,.35) 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,transparent),color-stop(100%,rgba(0,0,0,.35)));background:-webkit-linear-gradient(top,transparent 0%,rgba(0,0,0,.35) 100%);background:-o-linear-gradient(top,transparent 0%,rgba(0,0,0,.35) 100%);background:-ms-linear-gradient(top,transparent 0%,rgba(0,0,0,.35) 100%);background:linear-gradient(to bottom,transparent 0%,rgba(0,0,0,.35) 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#59000000',GradientType=0 );transition:height .3s ease-in-out,opacity .3s ease-in-out;pointer-events:none}.iziModal.hasShadow::after{height:30px;opacity:1}.iziModal .iziModal-progressbar{position:absolute;left:0;top:0;width:100%;z-index:1}.iziModal .iziModal-progressbar>div{height:2px;width:100%}.iziModal .iziModal-header{background:#88a0b9;padding:14px 18px 15px;box-shadow:inset 0 -10px 15px -12px rgba(0,0,0,.3),0 0 0 #555;overflow:hidden;position:relative;z-index:10}.iziModal .iziModal-header-icon{font-size:40px;color:rgba(255,255,255,.5);padding:0 15px 0 0;margin:0;float:left}.iziModal .iziModal-header-title{color:#fff;font-size:18px;font-weight:600;line-height:1.3}.iziModal .iziModal-header-subtitle{color:rgba(255,255,255,.6);font-size:12px;line-height:1.45}.iziModal .iziModal-header-subtitle,.iziModal .iziModal-header-title{display:block;margin:0;padding:0;font-family:'Lato',Arial;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}.iziModal .iziModal-header-buttons{position:absolute;top:50%;right:10px;margin:-17px 0 0}.iziModal .iziModal-button{display:block;float:right;z-index:2;outline:0;height:34px;width:34px;border:0;padding:0;margin:0;opacity:.3;border-radius:50%;transition:transform .5s cubic-bezier(.16,.81,.32,1),opacity .5s ease;background-size:67%!important;-webkit-tap-highlight-color:transparent}.iziModal .iziModal-button-close{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTMyIDc5LjE1OTI4NCwgMjAxNi8wNC8xOS0xMzoxMzo0MCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUuNSAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODZCQkIzQ0I0RTg0MTFFNjlBODI4QTFBRTRBMkFCMDQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODZCQkIzQ0M0RTg0MTFFNjlBODI4QTFBRTRBMkFCMDQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4NkJCQjNDOTRFODQxMUU2OUE4MjhBMUFFNEEyQUIwNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4NkJCQjNDQTRFODQxMUU2OUE4MjhBMUFFNEEyQUIwNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsgTJLcAAALJSURBVHja3JnLS1VBHMfvQ7g9dBXRRrwEFRciAhMi1JRW1aIHVEIYEkW0iVpUhOD/ICK6cFMgSbUpC6VFkQa9NtpjkauriRY9Noa3pHT8/mIODMM5Or85o87pC5/NPf5mvmc8M7+Z36SFEKkY2gj2gUawF2wHW8A6+fwv+A6KYAQMg+dg2rbDtKXhGnAaHJIms4zYz9J4HxgAf1g9k2EGteAhWBBuNApaQNrUg6nRTaAbzIuV0RCocWW4DoyJlVcJXI5ruFk2tJqi/2TWxvA5sXbqA2Ucw01i7dVjargazAo/dE33p6/DlAheg50pP0SJpwG8CH7IaH/Q5pFZUhnoArkwwwVwJeWfdoMLYYZvqG+yTGo9CerAoIWBT+A4qAdPDWOugwo1NVcxJtpFZRLkwH3GJCqCghJfxVjnz1JMMMKnwAbGRAg0B5rAA4O4CblZ+qj8tkBjZthvSzDCtFIMM0ZpQhslk5Eej4jpZ/T7G+ygwG1ghrk+jjNMFy1eMPJzpOAzlou6iWmXZkm91EBHjEwUZXoQTDk2SxqhRh7HTJ9hpstB3rFZ0ldq6J2DnB9m2rXZfxOPlrX1DrJRXiaBXSHPaMHvB0cd9JPLpBImMvzLQTuUFA6A9yHPfoIjhsllOc1l5N4grtmDWgYrl5+JTUZcSjNkeMyxWdpA3ZN72IJj01OJTByJS82J2/wQVxmB5y1HK8x0JWMf/kzdD98FJcY5S51gdwyTQl6eUAraspo27PeWXgy8afim0+CELAwOWHyH9EkdkyWwJ4Yxk6BCP+bTm48anutWW5dAp34IpbW03UOzb0FPVEHbx0LKfvAyqpAyKw97JU8Mt6pml6rAJ6oY6Eu5NfvfF7QTeWWQyEsZr6694lwsNoPD8mKRo29gCNwGj7gXi7aGA1EBcY+8vq0GW8FmJb3Pgx9gEnwAr8Ab8MW2w0UBBgAVyyyaohV7ewAAAABJRU5ErkJggg==) no-repeat 50% 50%}.iziModal .iziModal-button-fullscreen{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTMyIDc5LjE1OTI4NCwgMjAxNi8wNC8xOS0xMzoxMzo0MCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUuNSAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RTBBOUI4RUM0RTg0MTFFNjk0NTY4NUNFRkZFNEFEQzIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RTBBOUI4RUQ0RTg0MTFFNjk0NTY4NUNFRkZFNEFEQzIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpFMEE5QjhFQTRFODQxMUU2OTQ1Njg1Q0VGRkU0QURDMiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpFMEE5QjhFQjRFODQxMUU2OTQ1Njg1Q0VGRkU0QURDMiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrQO6gAAAANmSURBVHjazJlbSBRRGMd3x92i0ForRRMiKiUoX4ouiFlJkRVBDxW9GJERwUasvdRT9FD00osRQtAFqegGBUHRBY0uaCVKEkSRpVR0tSwrQtp1+p/4Bk7D7M45M/Ot/uGHu+Psmf+c+eY753wnbJpmyIfGgvmgiv6WgkKQBwzwE3wBr0AnuAta6ZgnhT0aFuY2ghoyGdH4bS+4Dc6CZjCkdWVhWIPF4JoZnB6CDToeVE8sBidNPt0E5UEZrgG9Jr8GwHa/huMgaWZXDSDsxfBuc/jUBAwdw3Fz+NWoang5SJkjQwm7P3seLqQEX2LLfgfBdZcMORMcBqNDwekPqASP0uXhpjR3Ok0x/fUw9HIHGGVdw5DuRtzJpgxDsJui2qOWmuaAOuuLbHivz4YLwLgQj/aAXNmwuItlHhtbA7pAG5jEZHgKWCcbrhUTIY+NPQVjqFFObbYMi/hc6aOhl2AJ9TKnFoIyYXgemKEzJQXVVkyR3oFVzKZFuqw2qHdyFPKhrHPgMoWC3fRjRtNVVg+7SR5IiqmXxUt60cG0CK/vTIZniZVCmcKJF0C3ZNjKBqvJ9Hrwm46tsN1EkCoRQ/M3fBjvs6GrYAvdwHEfGcd1qBaGkwoxrKI+xjz83yJ0iLFHApd46X4xX+M+WECh4lepCNUIcpnMijrEWtAvTRHrbOd8FZNG8uA2Nf0hpmwtjBPwpQ5T0GPS/+tBAZhIq+b3Lu09EyHRwRgO+0C+7dhWcII+PwCf6Sk/Aa9d2vtn+A7nyASugJiD6YSDQcOlvVbxiCaAN8xrs3sgprBiac/QhlhnzjUo6JuZM0UlDS5FPtoQIdNlPYJTWUihFaDex+9Pg6T1KHJAJ2NI7ASllA28hEQ/KJIXoSlwgKlnh+jFe+GjLtwIPtjfyktUt+UaUZWqvw7H3oJD1peI7eQdoF1xWa+zQikHH13OmwqmOxxP0EiZtgK/DRwNuIcHwSeXc2K01WAPhbhKBb5hBNTVbskVH7fqpZGhbJUNtYF83fqwQSXPbOsGjb6etwx2gcEsmT3iFAZeNmUqaMeHSz2qu0k6W15Rqsx3B2i0D+xXGAHTFrRVlEeFuVoqH+ku6VNUbDkPzlAtg30nVK66i8rRIjAbTKaSQVQyN0DD6nOqcLZQld9TLfmvAAMAeMcvp3eCFqQAAAAASUVORK5CYII=) no-repeat 50% 50%}.iziModal.isFullscreen .iziModal-button-fullscreen{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTMyIDc5LjE1OTI4NCwgMjAxNi8wNC8xOS0xMzoxMzo0MCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUuNSAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MkFFRTU5NDA0RTg1MTFFNjk0NEZFQzBGMkVBMDYyRDkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MkFFRTU5NDE0RTg1MTFFNjk0NEZFQzBGMkVBMDYyRDkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyQUVFNTkzRTRFODUxMUU2OTQ0RkVDMEYyRUEwNjJEOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoyQUVFNTkzRjRFODUxMUU2OTQ0RkVDMEYyRUEwNjJEOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PuDFfX8AAANASURBVHjazJlZSBVRGMfHcWlB0xZM68GKukQLYaGkmEUR2EsvRfQS+BSJPUQE+lTR8hqIZY8hFS0ERVCRoW3gpUApghYpszLTVnCB3O70/+K7MAwzc78Z58z4hx8XzpzvzJ+Zc+d85ztphmFoU9BsUAoq+XcFyAc5QAfD4BfoBp3gCWjnNl9K82mYzO0FVWwyw0NsD3gIroBWkPB0ZzLsgc3grhGcnoE9XjxIOxaCC4Y6tYC1QRmuAj2Geg2CA1M1XAsmjHDVANL8GK4zolMz0L0YrjWiV5PU8HYw6TBIf8imD6UynA96HYKPg3mgMUTDY6DUzXCzQ+AxSz+r6QEQZz4HbLoDZNkZrnAIoOlRZjN1Gk3XS0zty/gTFaRq7Ay3uAR8BcU2ps/z9QJTWw74HrDhTyDbbHg9SKQI+sb9rKa3mV8ZmAt+KJjP1TS+zinFPkqEUqQdBeAOKLa0UwIzpqlXtcYpIKWIO4RBZPoRKNfC10YQI8MlYLkwaAB8ABsiMDwDbKU8dgtIFwRMgJ3guRadKpNPWBMa7tOi1WoyHJPuTsC4oN+IQsOLM3gPJlEWqOE/neMGBqwDeYoMz6G8c0I4h6eFyHBC8A2eVoaH8JutaPwuUA/+uvSht1sHKgTjTWZwjUCVYdrK3xT0iwkND+lc5FClUQ9fINHCRYY7FBrWPSz5Er2lAR9H9P+hpfYGl64OCmPadQ7ojcDwOJetysBMQX/6mrWS4d+cIoYtMnAEnBT2fwVeJufYxZBMFoKFlrajQtOX/uczvEtIB50Kdgn1lt3JGdANltjsXE64jPMnuQ1LPuFJcFrBE11gzQXAUnAPFNk86esO4zSBfmu5lVa9toCf8DC4Ba6C22DEdO01KDLdP5fLr1Z94X2ibV1ilWVQ1XrDpvPAU4c+u1KVqvaHXI7q43ltp3PSYmDDNCgGPrCUD1wN6y5lqzAUN89baX1Y55Jn2LrPRUffRwaHwWhIZs/aTQM/hzLlDp+coPRReprk5cgrkyvz7wM0+hOcAvOlPvwcLNIp526ux1H5aJbHeFpVX4Br4LLXWoffk9CkVnLlaBNYAxaBXJBpMjfIy+o7EAdtfIyb8HPDfwIMAM1WPs8F9tcxAAAAAElFTkSuQmCC) no-repeat 50% 50%}.iziModal .iziModal-button-close:hover{transform:rotate(180deg)}.iziModal .iziModal-button:hover{opacity:.8}.iziModal .iziModal-header.iziModal-noSubtitle{height:auto;padding:10px 15px 12px}.iziModal .iziModal-header.iziModal-noSubtitle .iziModal-header-icon{font-size:23px;padding-right:13px}.iziModal .iziModal-header.iziModal-noSubtitle .iziModal-header-title{font-size:15px;margin:3px 0 0;font-weight:400}.iziModal .iziModal-header.iziModal-noSubtitle .iziModal-header-buttons{right:6px;margin:-16px 0 0}.iziModal .iziModal-header.iziModal-noSubtitle .iziModal-button{height:30px;width:30px}.iziModal-rtl{direction:rtl}.iziModal-rtl .iziModal-header{padding:14px 18px 15px 40px}.iziModal-rtl .iziModal-header-icon{float:right;padding:0 0 0 15px}.iziModal-rtl .iziModal-header-buttons{right:initial;left:10px}.iziModal-rtl .iziModal-button{float:left}.iziModal-rtl .iziModal-header-subtitle,.iziModal-rtl .iziModal-header-title{text-align:right;font-family:Tahoma,'Lato',Arial;font-weight:500}.iziModal-rtl .iziModal-header.iziModal-noSubtitle{padding:10px 15px 12px 40px}.iziModal-rtl .iziModal-header.iziModal-noSubtitle .iziModal-header-icon{padding:0 0 0 13px}.iziModal.iziModal-light .iziModal-header-icon{color:rgba(0,0,0,.5)}.iziModal.iziModal-light .iziModal-header-title{color:#000}.iziModal.iziModal-light .iziModal-header-subtitle{color:rgba(0,0,0,.6)}.iziModal.iziModal-light .iziModal-button-close{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4JpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDoyQTU1RUZDNzRFODQxMUU2ODAxOEUwQzg0QjBDQjI3OSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo1NEM4MTU1MEI4QUExMUU2QjNGOEVBMjg4OTRBRTg2NyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0RTNFNENDMkI4QUExMUU2QjNGOEVBMjg4OTRBRTg2NyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxNyAoTWFjaW50b3NoKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjZjYzMwMmE1LWFlMjEtNDI3ZS1hMmE4LTJlYjhlMmZlY2E3NSIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjdmYmU3NGE3LTAxMDUtMTE3YS1hYmM3LWEzNWNkOWU1Yzc4NyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Po24QssAAANtSURBVHja3JlJaBRBFIa7ZxyTSXADHUkikuAawZNLEOOGGrwJQYko8R4RBQ+OICoqghJQUVwPYjzFY0QUBQU1kogoKO6CG0pcIwbiNibj/8JraNvu6Xo9NTOtP3xzSKe6/65+Ve9VlWlkp2IwGUwFE0E5GA4G8/U+0APegWfgHrgPuq0bpNNp0QPNgEYngHlgGpuMCNp2s+kr4BYM/8ql4WqwHEzP4mXteg7awOW0YlerPnQIaARLNBl1ikLlBDw/1WF4ClgHKozc6idogekz2RheANbaBlE+dB4chfF+qeHF3LOF0FWwF6b7nBe8RvecApolzQVr3C64GR4H1huFV51pmvV+hikRbABFRji0GqarMxluAGON8CgKmmA65mZ4DFhqhE9VPP//ZXgZiCmm1t1gI6XWAAY+gF0gCe4qtqlHL8fthkeBWsXGreA6eMgPviEw+x5sBZ3gAdjPCcNPI8Fsu+FawUCzz40psEfRNJndBl7b/pZmVLTQMkzJo0bQSys43iWm3cxS+DUJOmoSwqKCRmEZWKkYv6RSMBPc5lqXRGm0A1Q6XiaT2aSwo8jrK/qZwZlFIlXTusxa6iXDddTdARpnMj2ek9AWjWYH7h/lubcs4A28THdyAdOl0ezAmKNBNyLLiT0Btjti9zuHg06zpJKIprohwXNypcu1OIdGjYbnxCLGPyYy/EPDfejzbwYvXK59AzuFGdFLKTL8WYNZ59RVzGESJCNm0teI40E6zNIA2wSaA2REP32iaW0omKXRbJKTUVyYEVV0J8oxvEiQmiUZrFSz6XNkuJe3nBKCelaSbjOZrhLsd1BInYxweSeJq9YA6dYtuZCBI4JZ6jGW/W+sebhd0DAaMIO5mTYFW1+X6GeQ7TO3W0WyQj3cw0ulBg4nSUbcAY7zPVYp7ip95FXOH29Hb35AOPjypWMIh7PORSjFZVsIzdKW7AWvfYnTVNWHyCytHw+jd1Nehqks3KepvtChUzD7yGvE2/cduqxldQF1EWZb/PbWLF3jAVgo0WrlkN+c6hSd+rzlaSuaR7O0oX0wyIa2pVAdGaj0HCUVOqIq4dVwrg5lmmG2w+8f/9tjL6foYHE+Gy8Xtv3CPUpf7WauDxadKuIwoeNbOmoYDYbZ0ns/1wxUC7ykigs8sS/LpEe3vwUYALiKDDDSgEiSAAAAAElFTkSuQmCC) no-repeat 50% 50%}.iziModal.iziModal-light .iziModal-button-fullscreen{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4JpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpEQTg1NTA2NTRFODQxMUU2OTQ0N0VERjY2Q0M5ODYwRCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo0RTNFNENCQkI4QUExMUU2QjNGOEVBMjg4OTRBRTg2NyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0RTNFNENCQUI4QUExMUU2QjNGOEVBMjg4OTRBRTg2NyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxNyAoTWFjaW50b3NoKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFlNTQwYzczLTVhZmEtNDJlYi04YzJlLWMwMzFlYmFiYmIyNiIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOmVkYmRiMzM1LTAxMDUtMTE3YS1hYmM3LWEzNWNkOWU1Yzc4NyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvIicdUAAAOvSURBVHjaxJlZbA1hFMe/qaItUUsspakg1laJ7UUisQuRvvTFA15sQSRCLBFrQryhHqxNHxEPtaQ8CCUkIrVVRbVBJdZYSrXVonr9/3pGxnTunZk78/X+k1+aO+1899/vnnvO+c4YKpi6ghEgW34OBD1BKjBAM6gH78Fz8BhUyrW/ikQivt7QiNMozU0DE8RkJx/3fgCPwA1QHvHp2K/hHJAPJqpwVA2K4flW2IZ7gyVgptKjh6AQxl+GYZi7uRr0U3rVBIpg+nIQwwvACpCkOk4XwYlosR3LMGN1qUqMroGDTqaNGDu7SiVWl+D3iP2i00c9HqxUidd8wzDy3HY4HRwCfWzXz4L7Lm+QKfHeOUTTLWAzdro6muH1YIbDjculWrmpUEM2YYXcCNMt9pAYE8WsWYLdlAxaNYTGMDDHKYYXBVy4B0jTFM/5iOcUc1fM/2JcnItNAYtBNzGtQ33BVHDV3OHpARqhV6CLLKpTs8yQYHxOCrDQO7AV1Gg2PBJhMYiGh4MMnx1eLkixXKsFuzSbZrrMpeGxHnqFFtvrTWCbhILd9AuNpnPMHXaTtZD0kl1mRdwSxXSjJsNZfONjcmqIJR5p3lp6Y+sXrAzsBz/lNXvmtZYMFKbqafi0pKQgKpOSPhmsC5BxXEs1Fz4fUr/7TWMe/q9bC2s3tJs1Df/Q/B5PwAZwJYS1WpPlo0zRZJZziL2gQU7I1GyHL7QSD26taVOytI26DpinxKypApvpk+C6dHlMnXskbUbT1yTpN3WJHWB327UCS3hUoc+tA/VyxP/ost5rGq7QWZnAdoe0eZgnYweDbgmgkoafgk8aTfNgsMNmmqfhC+Czj3V4T3mSBH255kxB0ztd4tNNDJkas2CUdkAKHQ3yAtxfijj/bdb7Cumyhmoyexzcs6Qwv2qUbPKvJDOtnNFklrF3R5qneA2XYHe/2A+ht1Xb3FZXRY1XTAjFTgtxJ45qKtWDpZK1g6dhIQuvBzjcy8FgQ6y8Nw+sCdnwL1Dn8jdMe6m2a+3ma9ESNUdOC1VixSH3bnPiYyraswnO0fqDIQkyW8WmCWab7b+I9TCF3+x0j2e+MPUA7LPGrVfD1F3VNsrPVR0zhS8BB5x21muzYa1Sy1Tb4y4d4qOwIi9Pk/wcj1gV50p5zQjJKAsJH8KcY4vpdYrjV0w9HMxxHjfKNpfwdMyRNuAmyy2M1vq5OegBNFMmR9lSHDizSLPMJGjuO2BZfSOtLKvpMylUvh/d/hFgAOH4+ibxGTZuAAAAAElFTkSuQmCC) no-repeat 50% 50%}.iziModal.iziModal-light.isFullscreen .iziModal-button-fullscreen{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3BpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDoyRUUxMkYxODRFODUxMUU2Qjc3RDk0MUUzMzJDRjBEOCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo0RTNFNENCRkI4QUExMUU2QjNGOEVBMjg4OTRBRTg2NyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0RTNFNENCRUI4QUExMUU2QjNGOEVBMjg4OTRBRTg2NyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxNyAoTWFjaW50b3NoKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjgzM2MwOWZiLWJjOTEtNGVlZS05MDM1LTRkMmU2ZmE1ZjBmMiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoyRUUxMkYxODRFODUxMUU2Qjc3RDk0MUUzMzJDRjBEOCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv1Q9Z8AAAOXSURBVHjaxJlLbA1RGMfPjIs+EvoIRYt4FVUl2EkkRTxKUqQbG0SEho2FjUQ8YtEICbEgTdFYeK1KaGvVeoUltyStt0UlNE17aWhV2+v/9X5XJpMzc8/0zpn5kl+aO3Nm7r/fnPu9xhDp2URQDJbw3xkgB2QCAwyAPvANfARvQDsfG7V4PO7pC40xCiVxa8AKFjnOw7VdoA08BtG4R8VeBZeCKrBS+GPvQAM0P/NbcB7YBdYJPfYKXIXwL34IJm8eBFOFXusH9RDdnI7gLWA/MEVwdh/UOe1tN8G0V3eLcKwFXJCJNl08G5ZYsrWgWnZCJng5OOBwo1iAoisMw6hMJXgyOOywVW7xj+9BgKL3QHSxm+C9IF9y4U2GMlStRPQP8Jbp9lFwhJwE0RHrgaSV8N6xG238l7Zjtfx3K58/Bd7zsWngIqdnP2we2ACa7B7e6RL6joK5EtHNfL7b5u1Bn7dGFbycYRVM/8WyFJnuJK+z2iVwzFrMcF1h+Cx4ClhtFVyu8CW54ITE01EwFMAPcH1SMJWIqxQvItE1YHEIsXkhtkUhCV4ApiteFOPadn4IgseDMooSSxVrhWFwmkvCsKw06WGhKLhHhGuzSHChh9pZ5cc1oFFwfoTTsWrWqQCvXdZQEpkDsjUJziSv3Qu43k3LTA1BXqvRY/4DMjTd/yu4niJVm9wslCjcb4QE/9Qo+Al44baAmgpKCIqC+01OBLrsr8/de8zkiYwuUxWSq7iuM8JhantIqfYItkOepKBysnbycIfPXYKqURL6DhaBCQrrKcZHTa5loyEIJgHXwG3F9TQV+pxMGK0BiaTHn2OLEjcURbdi7XBSMO3jTxoEjtg+7wDnhG3spSD6F3hk7Tjoxnc0CJ5k+5wFCrhplYl2mmI24nyvvWumAE9z2zIfBW8WifnxIHc2yb6xiHtEoms0/hlGtpAPHCkgNDjFyZngPN88COvkPpEe+XGHbFcD7z53C+ybwKEAo0UPZ8QCybkmiL3sNvkheygSI08RYOSQiaUhd52sUpIZLWwJsYqkkdcZeHfIS66nc9XcZQRpNBY7C7F9Yy1OtonErDgSgNhGcEXmWa/VFA1O9onE6y4dRqGtXuVtkpf2iDy8EVR6GLykMnrsNFC867QF0hH8v3MVicFcuYdKy56uqQx4SukWQj3NOtJtQIt4ckSvbmdziMqy7HcS9xv0cn/Xwdn0A1drnl/d/hNgAGQa6Lgarp6BAAAAAElFTkSuQmCC) no-repeat 50% 50%}.iziModal .iziModal-loader{background:#fff url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDQiIGhlaWdodD0iNDQiIHZpZXdCb3g9IjAgMCA0NCA0NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiM5OTkiPiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS13aWR0aD0iMiI+ICAgICAgICA8Y2lyY2xlIGN4PSIyMiIgY3k9IjIyIiByPSIxIj4gICAgICAgICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJyIiAgICAgICAgICAgICAgICBiZWdpbj0iMHMiIGR1cj0iMS40cyIgICAgICAgICAgICAgICAgdmFsdWVzPSIxOyAyMCIgICAgICAgICAgICAgICAgY2FsY01vZGU9InNwbGluZSIgICAgICAgICAgICAgICAga2V5VGltZXM9IjA7IDEiICAgICAgICAgICAgICAgIGtleVNwbGluZXM9IjAuMTY1LCAwLjg0LCAwLjQ0LCAxIiAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgLz4gICAgICAgICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJzdHJva2Utb3BhY2l0eSIgICAgICAgICAgICAgICAgYmVnaW49IjBzIiBkdXI9IjEuNHMiICAgICAgICAgICAgICAgIHZhbHVlcz0iMTsgMCIgICAgICAgICAgICAgICAgY2FsY01vZGU9InNwbGluZSIgICAgICAgICAgICAgICAga2V5VGltZXM9IjA7IDEiICAgICAgICAgICAgICAgIGtleVNwbGluZXM9IjAuMywgMC42MSwgMC4zNTUsIDEiICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiAvPiAgICAgICAgPC9jaXJjbGU+ICAgICAgICA8Y2lyY2xlIGN4PSIyMiIgY3k9IjIyIiByPSIxIj4gICAgICAgICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJyIiAgICAgICAgICAgICAgICBiZWdpbj0iLTAuOXMiIGR1cj0iMS40cyIgICAgICAgICAgICAgICAgdmFsdWVzPSIxOyAyMCIgICAgICAgICAgICAgICAgY2FsY01vZGU9InNwbGluZSIgICAgICAgICAgICAgICAga2V5VGltZXM9IjA7IDEiICAgICAgICAgICAgICAgIGtleVNwbGluZXM9IjAuMTY1LCAwLjg0LCAwLjQ0LCAxIiAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgLz4gICAgICAgICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJzdHJva2Utb3BhY2l0eSIgICAgICAgICAgICAgICAgYmVnaW49Ii0wLjlzIiBkdXI9IjEuNHMiICAgICAgICAgICAgICAgIHZhbHVlcz0iMTsgMCIgICAgICAgICAgICAgICAgY2FsY01vZGU9InNwbGluZSIgICAgICAgICAgICAgICAga2V5VGltZXM9IjA7IDEiICAgICAgICAgICAgICAgIGtleVNwbGluZXM9IjAuMywgMC42MSwgMC4zNTUsIDEiICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiAvPiAgICAgICAgPC9jaXJjbGU+ICAgIDwvZz48L3N2Zz4=) no-repeat 50% 50%;position:absolute;left:0;right:0;top:0;bottom:0;z-index:9}.iziModal .iziModal-content-loader{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDQiIGhlaWdodD0iNDQiIHZpZXdCb3g9IjAgMCA0NCA0NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiM5OTkiPiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS13aWR0aD0iMiI+ICAgICAgICA8Y2lyY2xlIGN4PSIyMiIgY3k9IjIyIiByPSIxIj4gICAgICAgICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJyIiAgICAgICAgICAgICAgICBiZWdpbj0iMHMiIGR1cj0iMS40cyIgICAgICAgICAgICAgICAgdmFsdWVzPSIxOyAyMCIgICAgICAgICAgICAgICAgY2FsY01vZGU9InNwbGluZSIgICAgICAgICAgICAgICAga2V5VGltZXM9IjA7IDEiICAgICAgICAgICAgICAgIGtleVNwbGluZXM9IjAuMTY1LCAwLjg0LCAwLjQ0LCAxIiAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgLz4gICAgICAgICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJzdHJva2Utb3BhY2l0eSIgICAgICAgICAgICAgICAgYmVnaW49IjBzIiBkdXI9IjEuNHMiICAgICAgICAgICAgICAgIHZhbHVlcz0iMTsgMCIgICAgICAgICAgICAgICAgY2FsY01vZGU9InNwbGluZSIgICAgICAgICAgICAgICAga2V5VGltZXM9IjA7IDEiICAgICAgICAgICAgICAgIGtleVNwbGluZXM9IjAuMywgMC42MSwgMC4zNTUsIDEiICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiAvPiAgICAgICAgPC9jaXJjbGU+ICAgICAgICA8Y2lyY2xlIGN4PSIyMiIgY3k9IjIyIiByPSIxIj4gICAgICAgICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJyIiAgICAgICAgICAgICAgICBiZWdpbj0iLTAuOXMiIGR1cj0iMS40cyIgICAgICAgICAgICAgICAgdmFsdWVzPSIxOyAyMCIgICAgICAgICAgICAgICAgY2FsY01vZGU9InNwbGluZSIgICAgICAgICAgICAgICAga2V5VGltZXM9IjA7IDEiICAgICAgICAgICAgICAgIGtleVNwbGluZXM9IjAuMTY1LCAwLjg0LCAwLjQ0LCAxIiAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgLz4gICAgICAgICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJzdHJva2Utb3BhY2l0eSIgICAgICAgICAgICAgICAgYmVnaW49Ii0wLjlzIiBkdXI9IjEuNHMiICAgICAgICAgICAgICAgIHZhbHVlcz0iMTsgMCIgICAgICAgICAgICAgICAgY2FsY01vZGU9InNwbGluZSIgICAgICAgICAgICAgICAga2V5VGltZXM9IjA7IDEiICAgICAgICAgICAgICAgIGtleVNwbGluZXM9IjAuMywgMC42MSwgMC4zNTUsIDEiICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiAvPiAgICAgICAgPC9jaXJjbGU+ICAgIDwvZz48L3N2Zz4=) no-repeat 50% 50%}.iziModal .iziModal-content:after,.iziModal .iziModal-content:before{content:'';display:table}.iziModal .iziModal-content:after{clear:both}.iziModal .iziModal-content{zoom:1;width:100%;-webkit-overflow-scrolling:touch}.iziModal .iziModal-wrap{width:100%;position:relative;-webkit-overflow-scrolling:touch;overflow-scrolling:touch}.iziModal .iziModal-iframe{border:0;margin:0 0 -6px;width:100%;transition:height .3s ease}.iziModal-overlay{display:block;position:fixed;top:0;left:0;height:100%;width:100%}.iziModal-navigate{position:fixed;left:0;right:0;top:0;bottom:0;pointer-events:none}.iziModal-navigate-caption{position:absolute;left:10px;top:10px;color:#fff;line-height:16px;font-size:9px;font-family:'Lato',Arial;letter-spacing:.1em;text-indent:0;text-align:center;width:70px;padding:5px 0;text-transform:uppercase;display:none}.iziModal-navigate-caption::after,.iziModal-navigate-caption::before{position:absolute;top:2px;width:20px;height:20px;text-align:center;line-height:14px;font-size:12px;content:'';background-size:100%!important}.iziModal-navigate-caption:before{left:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAoCAYAAACFFRgXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTMyIDc5LjE1OTI4NCwgMjAxNi8wNC8xOS0xMzoxMzo0MCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDoyNmFjNjAyMy04OWU0LWE0NDAtYmMxMy1kOTA5MTQ3MmYzYjAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDREQ0YwRjA1MzQzMTFFNkE5NUNDRDkyQzEwMzM5RTMiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDREQ0YwRUY1MzQzMTFFNkE5NUNDRDkyQzEwMzM5RTMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUuNSAoV2luZG93cykiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpmNmM0Nzk3Ni1mNzE3LTk5NDAtYTgyYS1mNTdjNmNiYmU0NWMiIHN0UmVmOmRvY3VtZW50SUQ9ImFkb2JlOmRvY2lkOnBob3Rvc2hvcDowZGVmYTEyZC01MzM0LTExZTYtYWRkYi04Y2NmYjI5ZTAxNjYiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7oo0ptAAACWklEQVR42uyZTWsTYRSFZybxo4kWk5g2NC5qTAU3Kq30A9udi1oXolV/hWuhv6R/Q6utioi4LbbVFHemamlRU0OCEk0wZjwXzwtDoBDopHMHcuFJMplZnLm5ue+589qu61qeOApyYAjEgG0FEyLqN/gKiqBuTtgewWlwCZw056xgwwirgU3wxSv4NJgCUV5YBRXQDEhsBJwCSSauBVZFdJRlIJk9Av7wbj577jDIOENtRmPVwcsw6KfAAvikRKzEDlhnhuU/lRPBWaa9wsxqC6ndPX7OiOA4D8qW3vjO9z7H0w3+KhZstNmOFbLoCQ6DYGmL+bAInmGfLFC4asFXwRJIgB+goVmw+I7HXO+/gevGnGgUPEGxktkSmAMbWmt4HDwBKS6XN1jDKrvEFYoVK7oLroE3h93Woh1eNwqWafJ/gQV65vM+ail34mc6EZwBK2CAx8fAIjjeBYMzDT4cVHCEXtRbRvEu/Nr9HCIOnGGp15vgEec9KYn74B0nAT/CZnv86FcNvwK3wENwAjwAs2Bbs5d4CW5zir0AXvv8p+tKH34B5lkW4h2egRHtbu05uMMHHWfB0zC4NRF5l09kzvE4rd2tyUJyjy4tz7akZqXbL8QETbJ/FsMgWOJtb6brCQ5YsBsC8Uab63DVkkgqFpzie93h8OhScFah2LTHi5ccWroaLd5l6//+hpYQoWP05LKqFs2WQYbTsNxAi+5fxpWmdfh7HS7XhwSzG+H3a2JnvZsyktmLbdOFhpDMvrf4sN1u2/aK0cwMcmYLcturweceW+CnOfFPgAEA8uWFFylBJYoAAAAASUVORK5CYII=) no-repeat 50% 50%}.iziModal-navigate-caption:after{right:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAoCAYAAACFFRgXAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAADhmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxMzIgNzkuMTU5Mjg0LCAyMDE2LzA0LzE5LTEzOjEzOjQwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjI2YWM2MDIzLTg5ZTQtYTQ0MC1iYzEzLWQ5MDkxNDcyZjNiMCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo0NERDRjBGMDUzNDMxMUU2QTk1Q0NEOTJDMTAzMzlFMyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0NERDRjBFRjUzNDMxMUU2QTk1Q0NEOTJDMTAzMzlFMyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxNS41IChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOmY2YzQ3OTc2LWY3MTctOTk0MC1hODJhLWY1N2M2Y2JiZTQ1YyIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjBkZWZhMTJkLTUzMzQtMTFlNi1hZGRiLThjY2ZiMjllMDE2NiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PuijSm0AAAKbSURBVFhH7ZnJj0xRGEerzFoIMTaCZmOIedhaiJj55yz8DaYdNhIJEUMQbCTG3rQ02hDSiEY553XdTpHS3nv96taV9ElO6lVt6peb7933fffVG41GrYW5uBaX4EysYzcw1Fd8hc/wM2a0Bl6Nm3BW9i0dDPsQX/olBF6FO72AH/gG3+N3jL3KBpqGC3ERTsGfeAsHDTyHi71oCXzBe/gaU2A5bscZOIxXTb8OLQNX9i6mElYsg/voqruwfQb2BhODWgqpMYDv0NLsNXC4yd42P1PEwNJj4HBTWdipErLVDfxfMRm408QMvBu3jV6WJ1Zg9/rbeBOP+UNZYgX+iE/Rp+lpPIKliBXYB9IhtPNy3z/T/F6YmDXsChvyBc7Gs3gACxEzsDzBg9iPPXgO92NuYgeWx2h3+AhtaM7jPsyF7aV37XR8gNZYO/pwKY51+xPkG27Fk2joT3gCr2A7NuJ6HMkTeAPadlp3VeMChF7G0P6X3dmfjAXOUxIj6LZkv1ylNuStDZejkL+PS96ScFzRqnDAtI5PoTefvbg7iNNOOwqVRCfYghdxBbpHH8Y7+DcKlUTV7MLLaNghPIrjhf2N2IF34AVcjE44hrXHyE3MwE6/loEzpEcIlqKjeyFiBe7FS+he/gENewMLEyuwXdo8dGWP43UsRazA9g7uDNbwNX8oS8watlsz+ISIGbgSJgN3GgOHlnFq8zNFQraGgT1iFc9iUyU0XsMGHhy9zh6XbvCp4ZuBBWglDBj4OdqLeu0+uRJTwMZ+Dbp/e21P3m97yWe2snsw1LTHmz5C/9lQdwhfGbiq89GwvrrwUT4UAouhN6MzloTRpVuEYI5O9urZYXtrYPGQw2OlZegM163QhrJMfWVgyTq0Qq32C/N7uPz9OknWAAAAAElFTkSuQmCC) no-repeat 50% 50%}.iziModal-navigate>button{position:fixed;bottom:0;top:0;border:0;height:100%;width:84px;background-size:100%!important;cursor:pointer;padding:0;opacity:.2;transition:opacity .3s ease;pointer-events:all;margin:0;outline:0}.iziModal-navigate>button:hover{opacity:1}.iziModal-navigate-prev{left:50%;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALwAAAC8CAYAAADCScSrAAAACXBIWXMAAAsTAAALEwEAmpwYAAA5sGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxMzIgNzkuMTU5Mjg0LCAyMDE2LzA0LzE5LTEzOjEzOjQwICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgICAgICAgICB4bWxuczpwaG90b3Nob3A9Imh0dHA6Ly9ucy5hZG9iZS5jb20vcGhvdG9zaG9wLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIgogICAgICAgICAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyI+CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDo2NDkyYzcxMy05ZDM0LTZlNGQtYmUwNi1hMDMyY2Q4NDVjNGU8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkRvY3VtZW50SUQ+eG1wLmRpZDo1QjIzMUMxODU3RjcxMUU2ODUzRkRBRjE5RDhDQjZBRDwveG1wTU06RG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDpjZmMwNzVmNC1kODA3LWI0NDMtYWIwYS02YWVhZjRjMDgxZWE8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgICAgIDx4bXBNTTpEZXJpdmVkRnJvbSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgIDxzdFJlZjppbnN0YW5jZUlEPnhtcC5paWQ6NjQ5MmM3MTMtOWQzNC02ZTRkLWJlMDYtYTAzMmNkODQ1YzRlPC9zdFJlZjppbnN0YW5jZUlEPgogICAgICAgICAgICA8c3RSZWY6ZG9jdW1lbnRJRD54bXAuZGlkOjY0OTJjNzEzLTlkMzQtNmU0ZC1iZTA2LWEwMzJjZDg0NWM0ZTwvc3RSZWY6ZG9jdW1lbnRJRD4KICAgICAgICAgPC94bXBNTTpEZXJpdmVkRnJvbT4KICAgICAgICAgPHhtcE1NOkhpc3Rvcnk+CiAgICAgICAgICAgIDxyZGY6U2VxPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5zYXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6aW5zdGFuY2VJRD54bXAuaWlkOmNmYzA3NWY0LWQ4MDctYjQ0My1hYjBhLTZhZWFmNGMwODFlYTwvc3RFdnQ6aW5zdGFuY2VJRD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OndoZW4+MjAxNi0wOC0wMVQxMTo1ODowNC0wMzowMDwvc3RFdnQ6d2hlbj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OnNvZnR3YXJlQWdlbnQ+QWRvYmUgUGhvdG9zaG9wIENDIDIwMTUuNSAoV2luZG93cyk8L3N0RXZ0OnNvZnR3YXJlQWdlbnQ+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDpjaGFuZ2VkPi88L3N0RXZ0OmNoYW5nZWQ+CiAgICAgICAgICAgICAgIDwvcmRmOmxpPgogICAgICAgICAgICA8L3JkZjpTZXE+CiAgICAgICAgIDwveG1wTU06SGlzdG9yeT4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNS41IChXaW5kb3dzKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNi0wOC0wMVQwOTo0MDo1Ni0wMzowMDwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE2LTA4LTAxVDExOjU4OjA0LTAzOjAwPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPHhtcDpNZXRhZGF0YURhdGU+MjAxNi0wOC0wMVQxMTo1ODowNC0wMzowMDwveG1wOk1ldGFkYXRhRGF0ZT4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xvck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHRpZmY6T3JpZW50YXRpb24+MTwvdGlmZjpPcmllbnRhdGlvbj4KICAgICAgICAgPHRpZmY6WFJlc29sdXRpb24+NzIwMDAwLzEwMDAwPC90aWZmOlhSZXNvbHV0aW9uPgogICAgICAgICA8dGlmZjpZUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WVJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOlJlc29sdXRpb25Vbml0PjI8L3RpZmY6UmVzb2x1dGlvblVuaXQ+CiAgICAgICAgIDxleGlmOkNvbG9yU3BhY2U+NjU1MzU8L2V4aWY6Q29sb3JTcGFjZT4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjE4ODwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4xODg8L2V4aWY6UGl4ZWxZRGltZW5zaW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAKPD94cGFja2V0IGVuZD0idyI/PvAvv7QAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAmdJREFUeNrs1LsJQkEQhtH/mtmBgQ8QA7tQK1e7MBBBMbADwzUZEyuQveeDCXbD4TBDay3SWJpYgYCXgJeAl4CXgJeAl4CXgJeAl4CXgJeAF/AS8BLwEvAS8BLwEvAS8BLwEvAS8BLwAl4CXgJeAl4CXv/WJskpyQJ4jQH7Mcmu0C+BV+/Y5/VeF/oV8Ood+7dpDfDqHvsrySHJBXjBDrxgB16wAy/YgRfswAt24AU78IIdeMEOPOywAw+7gIcdeMEOvGAHXrADL9iBF+zAC3bgBTvwsMMOPOwCHnYBD7uAhx14wQ68YAdesAMv2IEX7MDDDjvwsAt42AU87AIedgEPu4CHXcDDDrxgB16wAw877MDDDjvwsAt42AU87AIedgEPu4CHXcDDLuBhB16wAw877MDDLuBhF/CwC3jYBTzsAh52AQ+7gIddwEtjB3+tS/78+Z/V5d9iATz0Ah56AQ+9gIdewEMv4KEX8NALeOgFPPQCHnoBDz3wgh54QQ889NADDz30wEMv4KEX8NALeOgFPPQCHnoBD72Ahx54QQ+8oAde0AMv6IEX9MBDDz3w0EMPPPQCHnoBD72Ah17AQw+8FUAPvKAHXtADL+iBF/TAC3rgBT3wgh546KEHHnrogYdewEMv4KEHXtADL+iBF/TAC3rgBT3wgh54QQ+8oAde0AMv6IGHHnrgoU/yrgFe3aO/JdknuQOv3tGfC/tjjEsYWmsoyIWXgJeAl4CXgJeAl4CXgJeAl4CXgJeAF/AS8BLwEvAS8BLwEvAS8BLwEvAS8BLwAl4CXgJeAl4CXvqnPgAAAP//AwCEcoCBRabYzAAAAABJRU5ErkJggg==) no-repeat 50% 50%}.iziModal-navigate-next{right:50%;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALwAAAC8CAYAAADCScSrAAAACXBIWXMAAB3SAAAd0gEUasEwAAA7pGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxMzIgNzkuMTU5Mjg0LCAyMDE2LzA0LzE5LTEzOjEzOjQwICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgICAgICAgICAgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNS41IChXaW5kb3dzKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNi0wOC0wMVQwOTo0MDoxNC0wMzowMDwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE2LTA4LTAxVDExOjU4OjEyLTAzOjAwPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPHhtcDpNZXRhZGF0YURhdGU+MjAxNi0wOC0wMVQxMTo1ODoxMi0wMzowMDwveG1wOk1ldGFkYXRhRGF0ZT4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xvck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDphZjljN2Q2MC00MTg2LWE3NGQtYTBiMS1mMGU5ODUwYzg2ZGY8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgICAgIDx4bXBNTTpEb2N1bWVudElEPnhtcC5kaWQ6NjQ5MmM3MTMtOWQzNC02ZTRkLWJlMDYtYTAzMmNkODQ1YzRlPC94bXBNTTpEb2N1bWVudElEPgogICAgICAgICA8eG1wTU06T3JpZ2luYWxEb2N1bWVudElEPnhtcC5kaWQ6NjQ5MmM3MTMtOWQzNC02ZTRkLWJlMDYtYTAzMmNkODQ1YzRlPC94bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+CiAgICAgICAgIDx4bXBNTTpIaXN0b3J5PgogICAgICAgICAgICA8cmRmOlNlcT4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+Y3JlYXRlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6aW5zdGFuY2VJRD54bXAuaWlkOjY0OTJjNzEzLTlkMzQtNmU0ZC1iZTA2LWEwMzJjZDg0NWM0ZTwvc3RFdnQ6aW5zdGFuY2VJRD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OndoZW4+MjAxNi0wOC0wMVQwOTo0MDoxNC0wMzowMDwvc3RFdnQ6d2hlbj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OnNvZnR3YXJlQWdlbnQ+QWRvYmUgUGhvdG9zaG9wIENDIDIwMTUuNSAoV2luZG93cyk8L3N0RXZ0OnNvZnR3YXJlQWdlbnQ+CiAgICAgICAgICAgICAgIDwvcmRmOmxpPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5zYXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6aW5zdGFuY2VJRD54bXAuaWlkOjAxNjJjMmE3LWZmMjYtYzE0ZC05Yjg4LTc2MGM2NzAxYjYzNzwvc3RFdnQ6aW5zdGFuY2VJRD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OndoZW4+MjAxNi0wOC0wMVQxMTo1MTowNy0wMzowMDwvc3RFdnQ6d2hlbj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OnNvZnR3YXJlQWdlbnQ+QWRvYmUgUGhvdG9zaG9wIENDIDIwMTUuNSAoV2luZG93cyk8L3N0RXZ0OnNvZnR3YXJlQWdlbnQ+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDpjaGFuZ2VkPi88L3N0RXZ0OmNoYW5nZWQ+CiAgICAgICAgICAgICAgIDwvcmRmOmxpPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5zYXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6aW5zdGFuY2VJRD54bXAuaWlkOmFmOWM3ZDYwLTQxODYtYTc0ZC1hMGIxLWYwZTk4NTBjODZkZjwvc3RFdnQ6aW5zdGFuY2VJRD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OndoZW4+MjAxNi0wOC0wMVQxMTo1ODoxMi0wMzowMDwvc3RFdnQ6d2hlbj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OnNvZnR3YXJlQWdlbnQ+QWRvYmUgUGhvdG9zaG9wIENDIDIwMTUuNSAoV2luZG93cyk8L3N0RXZ0OnNvZnR3YXJlQWdlbnQ+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDpjaGFuZ2VkPi88L3N0RXZ0OmNoYW5nZWQ+CiAgICAgICAgICAgICAgIDwvcmRmOmxpPgogICAgICAgICAgICA8L3JkZjpTZXE+CiAgICAgICAgIDwveG1wTU06SGlzdG9yeT4KICAgICAgICAgPHRpZmY6T3JpZW50YXRpb24+MTwvdGlmZjpPcmllbnRhdGlvbj4KICAgICAgICAgPHRpZmY6WFJlc29sdXRpb24+MTkzOTAzNi8xMDAwMDwvdGlmZjpYUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6WVJlc29sdXRpb24+MTkzOTAzNi8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTg4PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjE4ODwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIAo8P3hwYWNrZXQgZW5kPSJ3Ij8+nbt1mgAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAACQklEQVR42uzSsQ3CQAAEQTdiOyGg/wrciJ0QUMYSECEKAP3PSdvAaZZqkWbJCQJeAl4CXgJeAl4CXgJeAl4CXgJeAl4CXsBLwEvAS8BLwEvAS8BLwEvAS8BLwEvAC3gJeAl4CXgJ+D9vrY7qBgLwo7dVZ+89oAd+5Pbq6nPQAz9s9+rZ96AHHnoBD72Ah17AQy/goRfw0At46AU89AIeegEPvYCHHnhBD7ygBx566IGHHnrgoRfw0At46AU89AIeegEPvYCHXsBDL+ChB17QAy/ogRf0wAt64KGHHnjooQceegEPvYCHXsBDL+ChF/DQAy/ogRf0wAt64AU98IIeeEEPvKAHXtADDz30wEPvI+ChF/DQAy/ogRf0wAt64AU98IIeeEEPvKAHXtADL+iBF/TAC3rgoZ8ePRDAAy/YgRfswAt24AU78IIdeMEOvGAHXrADL9iBhx124GEX8LADL9iBF+zAC3bgBTvwgh14wQ68YAcedtiBh13Awy7gYRfwsAMv2IEX7MALduAFO/CCHXjYYQcedgEPu4CHXcDDLuBhF/CwA+8E2IEX7MALduAFO/Cwww487AIedgEPu4CHXcDDLuBhF/CwC3jYgRfswMMOO/CwC3jYBTzsAh52AQ+7gIddwMMu4GEX8LBravB7dcEO/Ext1Qk78DO1VgfswEvAS8BLwEvAS8BLwEvAS8BLwEvAS8ALeAl4CXgJeAl4CXgJeAl4CXgJeAl4CXgBLwEvAS8BLwEvAS/9shcAAAD//wMAtAygvJrkwJUAAAAASUVORK5CYII=) no-repeat 50% 50%}.iziModal.isAttachedTop .iziModal-header{border-top-left-radius:0;border-top-right-radius:0}.iziModal.isAttachedTop{margin-top:0!important;margin-bottom:auto!important;border-top-left-radius:0!important;border-top-right-radius:0!important}.iziModal.isAttachedBottom{margin-top:auto!important;margin-bottom:0!important;border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.iziModal.isFullscreen{max-width:100%!important;margin:0!important;height:100%!important}.iziModal.isAttached,.iziModal.isFullscreen{border-radius:0!important}.iziModal.hasScroll .iziModal-wrap{overflow-y:auto;overflow-x:hidden}html.iziModal-isAttached,html.iziModal-isOverflow{overflow:hidden}html.iziModal-isAttached body,html.iziModal-isOverflow body{overflow-y:scroll;position:relative}.iziModal ::-webkit-scrollbar{overflow:visible;height:7px;width:7px}.iziModal ::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.2);background-clip:padding-box;border:solid transparent;border-width:0;min-height:28px;padding:100px 0 0;box-shadow:inset 1px 1px 0 rgba(0,0,0,.1),inset 0 -1px 0 rgba(0,0,0,.07)}.iziModal ::-webkit-scrollbar-thumb:active{background-color:rgba(0,0,0,.4)}.iziModal ::-webkit-scrollbar-button{height:0;width:0}.iziModal ::-webkit-scrollbar-track{background-clip:padding-box;border:solid transparent;border-width:0 0 0 2px}.iziModal.transitionIn .iziModal-header{-webkit-animation:iziM-slideDown .7s cubic-bezier(.7,0,.3,1);-moz-animation:iziM-slideDown .7s cubic-bezier(.7,0,.3,1);animation:iziM-slideDown .7s cubic-bezier(.7,0,.3,1)}.iziModal.transitionIn .iziModal-header .iziModal-header-icon{-webkit-animation:iziM-revealIn 1s cubic-bezier(.16,.81,.32,1) both;-moz-animation:iziM-revealIn 1s cubic-bezier(.16,.81,.32,1) both;animation:iziM-revealIn 1s cubic-bezier(.16,.81,.32,1) both}.iziModal.transitionIn .iziModal-header .iziModal-header-subtitle,.iziModal.transitionIn .iziModal-header .iziModal-header-title{-webkit-animation:iziM-slideIn 1s cubic-bezier(.16,.81,.32,1) both;-moz-animation:iziM-slideIn 1s cubic-bezier(.16,.81,.32,1) both;animation:iziM-slideIn 1s cubic-bezier(.16,.81,.32,1) both}.iziModal.transitionIn .iziModal-header .iziModal-button{-webkit-animation:iziM-revealIn 1.2s cubic-bezier(.7,0,.3,1);-moz-animation:iziM-revealIn 1.2s cubic-bezier(.7,0,.3,1);animation:iziM-revealIn 1.2s cubic-bezier(.7,0,.3,1)}.iziModal.transitionIn .iziModal-iframe,.iziModal.transitionIn .iziModal-wrap{-webkit-animation:iziM-fadeIn 1.3s;-moz-animation:iziM-fadeIn 1.3s;animation:iziM-fadeIn 1.3s}.iziModal.transitionIn .iziModal-header{-webkit-animation-delay:0s;-moz-animation:0s;animation-delay:0s}.iziModal.transitionIn .iziModal-header .iziModal-header-icon,.iziModal.transitionIn .iziModal-header .iziModal-header-title{-webkit-animation-delay:.4s;-moz-animation:.4s;animation-delay:.4s}.iziModal.transitionIn .iziModal-header .iziModal-header-subtitle{-webkit-animation-delay:.5s;-moz-animation:.5s;animation-delay:.5s}.iziModal.transitionOut .iziModal-header,.iziModal.transitionOut .iziModal-header *{transition:none!important}.iziModal .fadeOut,.iziModal-navigate.fadeOut,.iziModal-overlay.fadeOut,.iziModal.fadeOut{-webkit-animation:iziM-fadeOut .5s;-moz-animation:iziM-fadeOut .5s;animation:iziM-fadeOut .5s;animation-fill-mode:forwards}.iziModal .fadeIn,.iziModal-navigate.fadeIn,.iziModal-overlay.fadeIn,.iziModal.fadeIn{-webkit-animation:iziM-fadeIn .5s;-moz-animation:iziM-fadeIn .5s;animation:iziM-fadeIn .5s}.iziModal-overlay.comingIn,.iziModal.comingIn{-webkit-animation:iziM-comingIn .5s ease;-moz-animation:iziM-comingIn .5s ease;animation:iziM-comingIn .5s ease}.iziModal-overlay.comingOut,.iziModal.comingOut{-webkit-animation:iziM-comingOut .5s cubic-bezier(.16,.81,.32,1);-moz-animation:iziM-comingOut .5s cubic-bezier(.16,.81,.32,1);animation:iziM-comingOut .5s cubic-bezier(.16,.81,.32,1);animation-fill-mode:forwards}.iziModal-overlay.bounceInDown,.iziModal.bounceInDown{-webkit-animation:iziM-bounceInDown .7s ease;animation:iziM-bounceInDown .7s ease}.iziModal-overlay.bounceOutDown,.iziModal.bounceOutDown{-webkit-animation:iziM-bounceOutDown .7s ease;animation:iziM-bounceOutDown .7s ease}.iziModal-overlay.bounceInUp,.iziModal.bounceInUp{-webkit-animation:iziM-bounceInUp .7s ease;animation:iziM-bounceInUp .7s ease}.iziModal-overlay.bounceOutUp,.iziModal.bounceOutUp{-webkit-animation:iziM-bounceOutUp .7s ease;animation:iziM-bounceOutUp .7s ease}.iziModal-overlay.fadeInDown,.iziModal.fadeInDown{-webkit-animation:iziM-fadeInDown .7s cubic-bezier(.16,.81,.32,1);animation:iziM-fadeInDown .7s cubic-bezier(.16,.81,.32,1)}.iziModal-overlay.fadeOutDown,.iziModal.fadeOutDown{-webkit-animation:iziM-fadeOutDown .5s ease;animation:iziM-fadeOutDown .5s ease}.iziModal-overlay.fadeInUp,.iziModal.fadeInUp{-webkit-animation:iziM-fadeInUp .7s cubic-bezier(.16,.81,.32,1);animation:iziM-fadeInUp .7s cubic-bezier(.16,.81,.32,1)}.iziModal-overlay.fadeOutUp,.iziModal.fadeOutUp{-webkit-animation:iziM-fadeOutUp .5s ease;animation:iziM-fadeOutUp .5s ease}.iziModal-overlay.fadeInLeft,.iziModal.fadeInLeft{-webkit-animation:iziM-fadeInLeft .7s cubic-bezier(.16,.81,.32,1);animation:iziM-fadeInLeft .7s cubic-bezier(.16,.81,.32,1)}.iziModal-overlay.fadeOutLeft,.iziModal.fadeOutLeft{-webkit-animation:iziM-fadeOutLeft .5s ease;animation:iziM-fadeOutLeft .5s ease}.iziModal-overlay.fadeInRight,.iziModal.fadeInRight{-webkit-animation:iziM-fadeInRight .7s cubic-bezier(.16,.81,.32,1);animation:iziM-fadeInRight .7s cubic-bezier(.16,.81,.32,1)}.iziModal-overlay.fadeOutRight,.iziModal.fadeOutRight{-webkit-animation:iziM-fadeOutRight .5s ease;animation:iziM-fadeOutRight .5s ease}.iziModal-overlay.flipInX,.iziModal.flipInX{-webkit-animation:iziM-flipInX .7s ease;animation:iziM-flipInX .7s ease}.iziModal-overlay.flipOutX,.iziModal.flipOutX{-webkit-animation:iziM-flipOutX .7s ease;animation:iziM-flipOutX .7s ease}@-webkit-keyframes iziM-comingIn{0%{opacity:0;transform:scale(.9) translateY(-20px) perspective(600px) rotateX(10deg)}to{opacity:1;transform:scale(1) translateY(0) perspective(600px) rotateX(0)}}@-moz-keyframes iziM-comingIn{0%{opacity:0;transform:scale(.9) translateY(-20px) perspective(600px) rotateX(10deg)}to{opacity:1;transform:scale(1) translateY(0) perspective(600px) rotateX(0)}}@keyframes iziM-comingIn{0%{opacity:0;transform:scale(.9) translateY(-20px) perspective(600px) rotateX(10deg)}to{opacity:1;transform:scale(1) translateY(0) perspective(600px) rotateX(0)}}@-webkit-keyframes iziM-comingOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@-moz-keyframes iziM-comingOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes iziM-comingOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@-webkit-keyframes iziM-fadeOut{0%{opacity:1}to{opacity:0}}@-moz-keyframes iziM-fadeOut{0%{opacity:1}to{opacity:0}}@keyframes iziM-fadeOut{0%{opacity:1}to{opacity:0}}@-webkit-keyframes iziM-fadeIn{0%{opacity:0}to{opacity:1}}@-moz-keyframes iziM-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes iziM-fadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes iziM-slideIn{0%{opacity:0;-webkit-transform:translateX(50px)}to{opacity:1;-webkit-transform:translateX(0)}}@-moz-keyframes iziM-slideIn{0%{opacity:0;-moz-transform:translateX(50px)}to{opacity:1;-moz-transform:translateX(0)}}@keyframes iziM-slideIn{0%{opacity:0;transform:translateX(50px)}to{opacity:1;transform:translateX(0)}}@-webkit-keyframes iziM-slideDown{0%{opacity:0;-webkit-transform:scale(1,0) translateY(-40px);-webkit-transform-origin:center top}}@-moz-keyframes iziM-slideDown{0%{opacity:0;-moz-transform:scale(1,0) translateY(-40px);-moz-transform-origin:center top}}@keyframes iziM-slideDown{0%{opacity:0;transform:scale(1,0) translateY(-40px);transform-origin:center top}}@-webkit-keyframes iziM-revealIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,1)}}@-moz-keyframes iziM-revealIn{0%{opacity:0;-moz-transform:scale3d(.3,.3,1)}}@keyframes iziM-revealIn{0%{opacity:0;transform:scale3d(.3,.3,1)}}@-webkit-keyframes iziM-bounceInDown{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:translate3d(0,-1000px,0);transform:translate3d(0,-1000px,0)}60%{opacity:1;-webkit-transform:translate3d(0,25px,0);transform:translate3d(0,25px,0)}75%{-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}90%{-webkit-transform:translate3d(0,5px,0);transform:translate3d(0,5px,0)}to{-webkit-transform:none;transform:none}}@keyframes iziM-bounceInDown{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:translate3d(0,-1000px,0);transform:translate3d(0,-1000px,0)}60%{opacity:1;-webkit-transform:translate3d(0,25px,0);transform:translate3d(0,25px,0)}75%{-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}90%{-webkit-transform:translate3d(0,5px,0);transform:translate3d(0,5px,0)}to{-webkit-transform:none;transform:none}}@-webkit-keyframes iziM-bounceOutDown{20%{-webkit-transform:translate3d(0,10px,0);transform:translate3d(0,10px,0)}40%,45%{opacity:1;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:0;-webkit-transform:translate3d(0,1000px,0);transform:translate3d(0,1000px,0)}}@keyframes iziM-bounceOutDown{20%{-webkit-transform:translate3d(0,10px,0);transform:translate3d(0,10px,0)}40%,45%{opacity:1;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:0;-webkit-transform:translate3d(0,1000px,0);transform:translate3d(0,1000px,0)}}@-webkit-keyframes iziM-bounceInUp{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:translate3d(0,1000px,0);transform:translate3d(0,1000px,0)}60%{opacity:1;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}75%{-webkit-transform:translate3d(0,10px,0);transform:translate3d(0,10px,0)}90%{-webkit-transform:translate3d(0,-5px,0);transform:translate3d(0,-5px,0)}to{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes iziM-bounceInUp{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:translate3d(0,1000px,0);transform:translate3d(0,1000px,0)}60%{opacity:1;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}75%{-webkit-transform:translate3d(0,10px,0);transform:translate3d(0,10px,0)}90%{-webkit-transform:translate3d(0,-5px,0);transform:translate3d(0,-5px,0)}to{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@-webkit-keyframes iziM-bounceOutUp{20%{-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}40%,45%{opacity:1;-webkit-transform:translate3d(0,20px,0);transform:translate3d(0,20px,0)}to{opacity:0;-webkit-transform:translate3d(0,-2000px,0);transform:translate3d(0,-2000px,0)}}@keyframes iziM-bounceOutUp{20%{-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}40%,45%{opacity:1;-webkit-transform:translate3d(0,20px,0);transform:translate3d(0,20px,0)}to{opacity:0;-webkit-transform:translate3d(0,-1000px,0);transform:translate3d(0,-1000px,0)}}@-webkit-keyframes iziM-fadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-100px,0);transform:translate3d(0,-100px,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes iziM-fadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-100px,0);transform:translate3d(0,-100px,0)}to{opacity:1;-webkit-transform:none;transform:none}}@-webkit-keyframes iziM-fadeOutDown{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,100px,0);transform:translate3d(0,100px,0)}}@keyframes iziM-fadeOutDown{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,100px,0);transform:translate3d(0,100px,0)}}@-webkit-keyframes iziM-fadeInUp{0%{opacity:0;-webkit-transform:translate3d(0,100px,0);transform:translate3d(0,100px,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes iziM-fadeInUp{0%{opacity:0;-webkit-transform:translate3d(0,100px,0);transform:translate3d(0,100px,0)}to{opacity:1;-webkit-transform:none;transform:none}}@-webkit-keyframes iziM-fadeOutUp{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,-100px,0);transform:translate3d(0,-100px,0)}}@keyframes iziM-fadeOutUp{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,-100px,0);transform:translate3d(0,-100px,0)}}@-webkit-keyframes iziM-fadeInLeft{0%{opacity:0;-webkit-transform:translate3d(-200px,0,0);transform:translate3d(-200px,0,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes iziM-fadeInLeft{0%{opacity:0;-webkit-transform:translate3d(-200px,0,0);transform:translate3d(-200px,0,0)}to{opacity:1;-webkit-transform:none;transform:none}}@-webkit-keyframes iziM-fadeOutLeft{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(-200px,0,0);transform:translate3d(-200px,0,0)}}@keyframes iziM-fadeOutLeft{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(-200px,0,0);transform:translate3d(-200px,0,0)}}@-webkit-keyframes iziM-fadeInRight{0%{opacity:0;-webkit-transform:translate3d(200px,0,0);transform:translate3d(200px,0,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes iziM-fadeInRight{0%{opacity:0;-webkit-transform:translate3d(200px,0,0);transform:translate3d(200px,0,0)}to{opacity:1;-webkit-transform:none;transform:none}}@-webkit-keyframes iziM-fadeOutRight{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(200px,0,0);transform:translate3d(200px,0,0)}}@keyframes iziM-fadeOutRight{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(200px,0,0);transform:translate3d(200px,0,0)}}@-webkit-keyframes iziM-flipInX{0%{-webkit-transform:perspective(400px) rotateX(60deg);opacity:0}40%{-webkit-transform:perspective(400px) rotateX(-10deg)}70%{-webkit-transform:perspective(400px) rotateX(10deg)}to{-webkit-transform:perspective(400px) rotateX(0deg);opacity:1}}@keyframes iziM-flipInX{0%{transform:perspective(400px) rotateX(60deg);opacity:0}40%{transform:perspective(400px) rotateX(-10deg)}70%{transform:perspective(400px) rotateX(10deg)}to{transform:perspective(400px) rotateX(0deg);opacity:1}}@-webkit-keyframes iziM-flipOutX{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-20deg);transform:perspective(400px) rotate3d(1,0,0,-20deg);opacity:1}to{-webkit-transform:perspective(400px) rotate3d(1,0,0,40deg);transform:perspective(400px) rotate3d(1,0,0,40deg);opacity:0}}@keyframes iziM-flipOutX{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-20deg);transform:perspective(400px) rotate3d(1,0,0,-20deg);opacity:1}to{-webkit-transform:perspective(400px) rotate3d(1,0,0,40deg);transform:perspective(400px) rotate3d(1,0,0,40deg);opacity:0}} assets/css/litespeed-dummy.css 0000777 00000000074 15251157102 0012466 0 ustar 00 /* To be replaced in `head` to control optm data location */ assets/css/litespeed-legacy.css 0000777 00000002111 15251157102 0012571 0 ustar 00 .litespeed-wrap h2.nav-tab-wrapper, .litespeed-wrap h3.nav-tab-wrapper { margin-bottom: 0; } .litespeed-wrap h2 .nav-tab { font-size: 14px; } .litespeed-wrap .striped > tbody > :nth-child(odd), .litespeed-wrap ul.striped > :nth-child(odd), .litespeed-wrap .alternate { background-color: #f9f9f9; } .litespeed-wrap .notice, .litespeed-wrap div.updated, .litespeed-wrap div.error { border-left: 4px solid #fff; box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1); padding: 1px 12px; } .litespeed-wrap .notice-success, .litespeed-wrap div.updated { border-left-color: #46b450; } .litespeed-wrap .notice-success.notice-alt { background-color: #ecf7ed; } .litespeed-wrap .notice-warning { border-left-color: #ffb900; } .litespeed-wrap .notice-warning.notice-alt { background-color: #fff8e5; } .litespeed-wrap .notice-error, .litespeed-wrap div.error { border-left-color: #dc3232; } .litespeed-wrap .notice-error.notice-alt { background-color: #fbeaea; } .litespeed-wrap .notice-info { border-left-color: #00a0d2; } .litespeed-wrap .notice-info.notice-alt { background-color: #e5f5fa; } assets/img/lscwp_blue_font-icon_22px.svg 0000777 00000003166 15251157102 0014345 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="22px" height="22px" viewBox="0 0 22 22" enable-background="new 0 0 22 22" xml:space="preserve"> <path fill="#00749C" d="M13.039,7.954c-0.063-0.128-0.193-0.21-0.336-0.21c-0.119,0-0.207,0.054-0.268,0.102L9.84,9.838 c-0.208,0.158-0.254,0.461-0.104,0.675l0.813,1.17l-1.521,1.93c-0.141,0.18-0.113,0.336-0.065,0.434 c0.06,0.125,0.194,0.209,0.334,0.209c0.123,0,0.208-0.055,0.271-0.102l2.593-1.992c0.158-0.121,0.211-0.33,0.145-0.578 c-0.011-0.041-0.027-0.076-0.051-0.114l-0.803-1.154l1.52-1.93C13.111,8.207,13.086,8.052,13.039,7.954z"/> <path fill="#00749C" d="M21.771,10.677L11.323,0.229c-0.088-0.086-0.202-0.135-0.324-0.135c-0.123,0-0.236,0.048-0.324,0.134 L0.228,10.677c-0.086,0.088-0.134,0.201-0.134,0.324c0,0.122,0.048,0.236,0.134,0.324l10.448,10.446 c0.087,0.088,0.202,0.135,0.324,0.135s0.237-0.047,0.324-0.135l10.446-10.447c0.088-0.085,0.136-0.201,0.136-0.323 C21.905,10.879,21.856,10.765,21.771,10.677z M11.424,1.625l8.956,8.956h-2.99c-0.016,0-0.035,0.001-0.051,0.003l-5.915-5.913V1.625 z M10.584,1.617v3.045l-5.92,5.919H1.62L10.584,1.617z M10.584,20.387L1.62,11.421h3.044l5.92,5.918V20.387z M10.999,16.504 l-5.501-5.502L10.999,5.5l5.503,5.502L10.999,16.504z M11.424,20.377v-3.045l5.913-5.914c0.018,0.001,0.037,0.003,0.053,0.003h2.99 L11.424,20.377z"/> </svg> assets/img/lscwp_gray-yellow_font-icon_22px.svg 0000777 00000003170 15251157102 0015664 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="22px" height="22px" viewBox="0 0 22 22" enable-background="new 0 0 22 22" xml:space="preserve"> <path fill="#FFCC00" d="M13.039,7.954c-0.063-0.128-0.193-0.21-0.336-0.21c-0.119,0-0.207,0.054-0.268,0.102L9.84,9.838 c-0.208,0.158-0.254,0.461-0.104,0.675l0.813,1.17l-1.521,1.93c-0.141,0.18-0.113,0.336-0.065,0.434 c0.06,0.125,0.194,0.209,0.334,0.209c0.123,0,0.208-0.055,0.271-0.102l2.593-1.992c0.157-0.121,0.211-0.33,0.146-0.578 c-0.012-0.041-0.027-0.076-0.052-0.114l-0.803-1.154l1.521-1.93C13.111,8.207,13.086,8.052,13.039,7.954z"/> <path fill="#777777" d="M21.771,10.677L11.323,0.229c-0.088-0.086-0.202-0.135-0.324-0.135c-0.123,0-0.236,0.048-0.324,0.134 L0.228,10.677c-0.086,0.088-0.134,0.201-0.134,0.324c0,0.122,0.048,0.236,0.134,0.324l10.448,10.446 c0.087,0.088,0.202,0.135,0.324,0.135s0.237-0.047,0.324-0.135L21.77,11.324c0.088-0.085,0.137-0.201,0.137-0.323 C21.904,10.879,21.855,10.765,21.771,10.677z M11.424,1.625l8.956,8.956h-2.989c-0.017,0-0.035,0.001-0.052,0.003l-5.915-5.913 V1.625z M10.584,1.617v3.045l-5.92,5.919H1.62L10.584,1.617z M10.584,20.387L1.62,11.421h3.044l5.92,5.918V20.387z M10.999,16.504 l-5.501-5.502L10.999,5.5l5.503,5.502L10.999,16.504z M11.424,20.377v-3.045l5.913-5.914c0.019,0.001,0.037,0.003,0.054,0.003h2.989 L11.424,20.377z"/> </svg> assets/img/slack-logo.png 0000777 00000002271 15251157102 0011373 0 ustar 00 �PNG IHDR K K ��� �PLTEGpL��8��;��9��:��:��9��:�����;O��O��O��O��P��O��O�詟8O�� �� �� �� ��Ԫ8v�6f��t�M��]�� ��,��k�zO��U�� �� �� �� ����{ ��2���9��:�V��T��T��T��T��R��U�/���4�e)�9�GU��.�E-�P{�T��S�Gsw]=U,��UYg�Jpu@\�Ny�p��Eh�mG�De ����� HtRNS '@[���a�8����P[��������� ���9������'��Ga�����������������p "� HIDATx���8EV�A��a~4���ʶǾՕ^e�Yx�p �n_�R��$���~L�tƐN�C� H�V%3!���F�\\WP{t��JӯT�X,���i�m�E�\�P-~ݕGWNj�O�__��W+@Ñh�\�m7�EqP?<<���-a��Ḃ������Hĩݥ<7���'ѵ���++�H?R�,#<'�S�<�.������a$��)�������V�8Wؾ�t�F��Ŏ#�BW�DBx�e���P4����?�8ځi�aZA���A&��hR$b�"h���!�<�D̘�"Y��T��>d?�d?�T�<��X��Bn�}�����Z.�1i�/T`Hh��s� �*!cdDb["���%�ۧH*���%k�"EH�B_n����bC���܉�_��Zk����E"���?�u�9랂Q$<ݤ�M�� YT��#�yu}��5_����2��ۻk�F��kmD�b��B�&��hH�G�}�D�Y]'�@B��5r�g�t�����7���s�����6��`��ۧH��k��>E"`Hhߧ���G�>�\9�����o?x��_������O��n��~�R�?��l��r���G��g>$E2&�ܦZ�|^5�D���x��oS��(��H��~�O�q"���4�*h�q�d�S�}_����?�o��BS:�'o�"��.x[X�&��Ϩ�WP=�ȧnZY\���x�`����F�%9���5�si�����̗M�+^�)��H=���`�;�z^���k�Ψ���Lm��x|�ѥb� h���c2.M�*�����*� ����{-�� IEND�B`� assets/img/quic-cloud-logo.svg 0000777 00000027160 15251157102 0012362 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [ <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/"> <!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/"> <!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/"> <!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/"> ]> <svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/" x="0px" y="0px" width="600px" height="400px" viewBox="0 -125 600 400" enable-background="new 0 -125 600 400" xml:space="preserve"> <g> <g> <path fill="#5C6B73" d="M461.045-49.469c-13.746-18.064-33.701-29.694-56.178-32.739c-17.676-2.396-35.33,0.73-51.08,9.056 c-2.104,1.107-4.16,2.307-6.145,3.575l-7.078,5.321l18.271,24.019l5.572-4.232c1.121-0.701,2.289-1.375,3.479-2.007 c10.148-5.354,21.523-7.373,32.912-5.834c14.51,1.972,27.369,9.47,36.232,21.117c8.871,11.647,12.662,26.047,10.693,40.55 c-4.064,29.937-31.746,50.981-61.664,46.925c-11.383-1.543-21.818-6.526-30.17-14.401c-0.998-0.947-1.939-1.905-2.813-2.851 l-68.845-90.48l-0.023,0.283l-7.256-9.53l-0.784-0.954c-1.647-1.833-3.396-3.62-5.175-5.291 c-13.519-12.753-30.406-20.811-48.829-23.319c-48.422-6.575-93.197,27.483-99.769,75.922 c-6.575,48.428,27.48,93.187,75.916,99.754c18.43,2.507,36.847-0.757,53.292-9.446c0.671-0.351,1.313-0.729,1.969-1.09 l-18.559-24.393c-10.197,4.793-21.403,6.56-32.642,5.034c-31.951-4.343-54.41-33.854-50.075-65.801 c4.338-31.951,33.827-54.404,65.807-50.077c12.145,1.649,23.276,6.962,32.2,15.379c1.041,0.979,2.059,2.011,3.035,3.067 l54.112,71.125l0.025-0.288l21.975,28.879l0.756,0.92c1.545,1.725,3.219,3.448,4.982,5.112 C348.148,76.053,364.338,83.777,382,86.177c3.865,0.533,7.695,0.78,11.494,0.78c41.813-0.009,78.352-30.991,84.137-73.548 C480.678-9.075,474.787-31.406,461.045-49.469z"/> <path fill="#66CCCA" d="M313.695,70.07c-0.279-0.289-0.586-0.577-0.854-0.866l-34.862-45.783 c-1.517-1.696-3.168-3.388-4.907-5.031C260.115,6.169,243.928-1.554,226.262-3.957c-1.688-0.225-3.364-0.39-5.052-0.513h-2.586 l12.864,16.837c0.274,0.28,0.587,0.575,0.851,0.86l34.866,45.787c1.521,1.694,3.168,3.387,4.909,5.023 c12.959,12.22,29.142,19.95,46.806,22.342c1.689,0.236,3.369,0.395,5.055,0.521h2.58L313.695,70.07z"/> </g> <g> <path fill="#66CCCA" d="M305.638,230.569c-1.197-1.176-2.656-1.771-4.332-1.771c-1.672,0-3.13,0.598-4.329,1.774 c-1.213,1.192-1.827,2.652-1.827,4.346c0,1.718,0.614,3.191,1.827,4.384c1.199,1.177,2.657,1.772,4.329,1.772 c1.681,0,3.14-0.596,4.338-1.775c1.209-1.194,1.822-2.668,1.822-4.381C307.465,233.219,306.851,231.756,305.638,230.569z"/> <g> <path fill="#5C6B73" d="M385.161,157.189v-0.129v-0.412h-0.106c-0.146-0.635-0.459-1.222-0.913-1.715 c-0.102-0.122-0.262-0.309-0.476-0.477c-0.064-0.049-0.136-0.089-0.206-0.126l-0.007-0.003l-0.141-0.077 c-0.18-0.104-0.325-0.181-0.475-0.238c-0.255-0.11-0.54-0.192-0.833-0.239c-0.059-0.019-0.106-0.03-0.156-0.035 c-0.147-0.02-0.262-0.022-0.381-0.022h-0.001h-0.078c-0.01,0-0.021,0-0.032,0c-0.171,0-0.281,0.003-0.393,0.018 c-0.074,0.01-0.123,0.021-0.173,0.034c-0.298,0.053-0.581,0.135-0.854,0.248c-0.138,0.053-0.282,0.132-0.426,0.211l-0.131,0.076 c-0.125,0.064-0.194,0.103-0.259,0.154c-0.215,0.164-0.377,0.352-0.491,0.493c-0.443,0.477-0.751,1.062-0.898,1.695h-0.068 l-0.037,0.412v0.129v0.206c-0.007,0.026-0.01,0.06-0.01,0.097v0.031l0.008,0.08l0.002,0.859v27.892v0.127h0.001l-0.001,0.309 v0.119l0.008,9.874l-0.008,9.864v0.129l0.001,0.31h-0.001v0.129v27.841v0.923c-0.007,0.024-0.01,0.06-0.01,0.099v0.028 l0.008,0.081l0.002,0.193v0.129v0.412h0.105c0.147,0.634,0.458,1.222,0.914,1.715c0.151,0.187,0.303,0.342,0.476,0.474 c0.064,0.052,0.135,0.09,0.206,0.126l0.149,0.087c0.2,0.109,0.334,0.184,0.476,0.236c0.257,0.11,0.543,0.192,0.833,0.24 c0.04,0.015,0.101,0.031,0.161,0.036c0.137,0.016,0.253,0.019,0.374,0.019h0.148c0.119,0,0.235-0.003,0.355-0.018 c0.078-0.008,0.138-0.024,0.197-0.04c0.269-0.044,0.556-0.126,0.833-0.242c0.122-0.045,0.256-0.119,0.388-0.193l0.165-0.093 c0.124-0.066,0.194-0.104,0.259-0.155c0.171-0.134,0.324-0.286,0.493-0.496c0.441-0.477,0.75-1.062,0.896-1.693h0.069 l0.037-0.412v-0.129v-0.207c0.006-0.023,0.01-0.06,0.01-0.098v-0.029l-0.009-0.08l-0.001-0.861v-27.89v-0.129h-0.002l0.002-0.309 v-0.119l-0.009-9.874l0.009-9.864v-0.129l-0.002-0.31h0.002v-0.129v-27.841v-0.921c0.006-0.026,0.01-0.06,0.01-0.097v-0.031 l-0.009-0.08L385.161,157.189z"/> <path fill="#5C6B73" d="M363.642,223.593c-1.639,0-2.675,1.138-3.592,2.145c-0.222,0.245-0.444,0.488-0.67,0.714 c-4.262,4.264-9.473,6.425-15.491,6.425c-5.988,0-11.18-2.161-15.434-6.422c-4.259-4.25-6.418-9.46-6.418-15.484 c0-6.016,2.159-11.215,6.417-15.456c4.265-4.241,9.456-6.394,15.435-6.394c6.017,0,11.23,2.147,15.498,6.377 c0.248,0.249,0.483,0.513,0.715,0.773c0.901,1.009,1.831,2.057,3.505,2.057c2.104,0,3.817-1.711,3.817-3.815 c0-1.115-0.523-2.211-1.4-2.933l-0.148-0.173c-0.374-0.419-0.747-0.84-1.138-1.229c-5.729-5.727-12.744-8.63-20.849-8.63 c-8.073,0-15.071,2.903-20.799,8.63c-5.726,5.726-8.629,12.722-8.629,20.796c0,8.108,2.905,15.124,8.629,20.853 c5.723,5.725,12.721,8.627,20.799,8.627c8.108,0,15.124-2.903,20.851-8.627l0.327-0.326c1.121-1.104,2.391-2.357,2.391-4.088 C367.457,225.304,365.746,223.593,363.642,223.593z"/> <path fill="#5C6B73" d="M576.27,235.708l0.005-77.972l0.01-0.044c0.016-0.117,0.03-0.235,0.03-0.354 c0-2.021-1.642-3.662-3.661-3.662c-1.51,0-2.883,0.955-3.417,2.376c-0.148,0.326-0.23,0.693-0.23,1.067v0.106 c-0.007,0.03-0.012,0.07-0.012,0.109v0.029l0.01,0.092l-0.024,33.375c-0.196-0.216-0.397-0.429-0.603-0.638 c-5.741-5.738-12.758-8.644-20.866-8.644c-8.074,0-15.071,2.903-20.796,8.629c-5.525,5.519-8.324,12.534-8.324,20.846 c0,8.285,2.799,15.281,8.322,20.801c5.722,5.725,12.72,8.627,20.796,8.627c8.111,0,15.127-2.903,20.853-8.627 c0.214-0.221,0.427-0.446,0.643-0.681v4.9c-0.007,0.032-0.011,0.072-0.011,0.113v0.028l0.009,0.094l0.002,0.099 c0,0.375,0.082,0.744,0.243,1.099c0.535,1.41,1.876,2.34,3.405,2.34c2.019,0,3.66-1.641,3.66-3.658 c0-0.122-0.014-0.24-0.03-0.359L576.27,235.708z M547.511,232.874c-6.016,0-11.228-2.153-15.486-6.393 c-4.258-4.239-6.417-9.44-6.417-15.46c0-6.014,2.159-11.224,6.418-15.483c4.262-4.259,9.472-6.418,15.485-6.418 c6.017,0,11.229,2.159,15.488,6.418c3.182,3.182,5.206,6.927,6.018,11.134l-0.016,8.857c-0.798,4.045-2.821,7.747-6.006,10.925 C558.741,230.715,553.528,232.874,547.511,232.874z"/> <path fill="#5C6B73" d="M424.079,181.547c-8.077,0-15.075,2.903-20.804,8.629c-5.724,5.723-8.625,12.737-8.625,20.846 c0,8.082,2.901,15.082,8.625,20.799c5.729,5.729,12.729,8.632,20.804,8.632c8.107,0,15.113-2.903,20.825-8.627 c5.707-5.735,8.602-12.734,8.602-20.804c0-8.103-2.895-15.114-8.602-20.843C439.195,184.45,432.188,181.547,424.079,181.547z M424.079,232.874c-6.021,0-11.235-2.153-15.492-6.393c-4.256-4.242-6.415-9.443-6.415-15.46c0-6.014,2.161-11.224,6.42-15.483 c4.257-4.259,9.468-6.418,15.487-6.418c6.016,0,11.225,2.159,15.485,6.418c4.257,4.262,6.415,9.47,6.415,15.483 c0,6.017-2.158,11.218-6.412,15.46C435.309,230.721,430.098,232.874,424.079,232.874z"/> <path fill="#5C6B73" d="M505.793,185.807c-2.018,0-3.659,1.644-3.659,3.661c0,0.059,0.007,0.113,0.015,0.168l0.005,29.258 c0,3.874-1.421,7.229-4.227,9.972c-2.92,2.854-8.329,4.393-11.938,4.393c-4.44,0-9.219-1.772-11.887-4.412 c-2.829-2.736-4.262-6.083-4.262-9.952v-29.282c0.011-0.052,0.016-0.099,0.016-0.144v-0.032l-0.013-0.106v-0.064l-0.013-0.056 c-0.15-1.925-1.735-3.402-3.637-3.402c-2.018,0-3.659,1.641-3.659,3.661c0,0.109,0.013,0.22,0.027,0.325l0.015,0.091 l-0.004,29.413c0.106,6.019,2.166,11.069,6.12,15.02c3.827,3.83,10.474,6.208,17.346,6.208c6.608,0,13.547-2.494,17.264-6.207 c3.954-3.954,6.014-8.996,6.122-14.988v-29.542l0.01-0.045c0.011-0.091,0.023-0.179,0.023-0.274 C509.454,187.45,507.813,185.807,505.793,185.807z"/> </g> <path fill="#3E5059" d="M115.191,239.357c-0.092-0.095-0.187-0.206-0.283-0.318c-0.152-0.178-0.31-0.358-0.465-0.506 c-2.794-2.598-6.042-4.749-9.574-6.449c-4.631-2.231-9.765-3.672-15.143-4.138c-0.95-0.082-1.949-0.122-2.963-0.122 c-3.878,0-7.742,0.603-11.48,1.185c-3.692,0.575-7.51,1.169-11.292,1.169c-1.788,0-3.438-0.129-5.043-0.393 c-8.268-1.365-15.592-5.88-20.096-12.395c-4.826-6.981-6.526-16.369-4.662-25.756c0.082-0.409,0.211-0.807,0.309-1.213 c1.856-7.615,6.706-14.472,13.219-18.495c4.822-3.003,10.729-4.591,17.084-4.591c2.812,0,5.616,0.314,8.339,0.939 c6.824,1.563,13.078,5.532,17.159,10.885l0.264,0.371l0.187,0.263l0.011-0.009c0.871,1.217,1.636,2.493,2.275,3.807 c2.363,4.676,3.521,10.303,3.422,15.948c-0.062,3.489-0.596,6.985-1.633,10.272c-0.406,1.286-0.928,2.533-1.505,3.753 c-0.891,1.88-1.947,3.669-3.18,5.268c-0.273,0.353-0.589,0.715-0.896,1.076c0.507,0.022,1.028,0.022,1.513,0.064 c3.187,0.273,6.28,0.909,9.245,1.822c0.109-0.169,0.224-0.342,0.322-0.501c3.759-6.126,5.757-13.316,6.038-20.6 c0.346-8.969-1.918-18.08-6.795-25.52c-7.132-10.883-20.513-17.642-34.919-17.642c-2.055,0-4.119,0.139-6.136,0.413 c-16.93,2.294-30.066,14.405-33.725,30.625c-0.271,1.198-0.5,2.413-0.663,3.654c-1.302,9.836,0.305,19.577,4.524,27.428 c4.163,7.747,11.03,13.889,19.333,17.288c5.054,2.065,10.708,3.115,16.811,3.115c1.157,0,2.345-0.037,3.525-0.115l0.008-0.207 c0.005-0.002,0.009-0.002,0.014-0.002l0.033,0.206l0.264-0.03l0.265-0.027c0.653-0.066,1.303-0.138,1.953-0.211 c1.326-0.155,2.584-0.408,4.077-0.824c0.109-0.03,0.22-0.058,0.33-0.085l0.256-0.063c3.198-0.934,6.821-1.425,10.492-1.425 c4.505,0,8.798,0.714,12.416,2.061l0.248,0.081l1.345,0.435l0.549,0.186l0.064,0.024h0.069h14.189h0.974L115.191,239.357z"/> <path fill="#3E5059" d="M170.995,157.525h-0.413v0.412v41.64c0,7.277-0.683,13.11-4.088,19.699 c-3.266,6.63-11.279,10.91-20.414,10.91c-12.482,0-18.392-7.86-20.354-11.237c-1.823-3.121-3.919-8.141-3.919-19.375v-41.637 v-0.412h-0.413h-9.037h-0.413v0.412v40.507c0,9.531,0,16.418,5.929,26.577c6.166,10.83,18.849,14.688,28.66,14.688 c16.931,0,25.332-10.377,28.155-14.84c4.892-7.563,5.754-14.546,5.754-26.426v-40.508v-0.412h-0.413h-9.034V157.525z"/> <path fill="#3E5059" d="M253.379,167.907c0.047,0,0.095-0.002,0.144-0.005l0.098-0.004c10.505,0,18.071,4.435,24.683,9.224 l3.85,2.93l0.662,0.504v-0.831l0.005-9.931v-0.173l-0.121-0.121c-6.664-6.632-15.13-10.422-25.164-11.263 c-1.29-0.108-2.65-0.164-4.157-0.171h-0.001h-0.002c-1.505,0.007-2.865,0.063-4.159,0.171 c-10.033,0.841-18.499,4.631-25.164,11.263l-0.003,0.004l-0.066,0.061l0.11,0.186l-0.047,0.047l-0.156-0.136 c-7.635,7.635-11.505,17.603-11.505,29.63c0,12.029,3.87,21.997,11.505,29.635l0.102,0.104l0.063,0.058 c6.666,6.636,15.132,10.423,25.164,11.264c1.281,0.109,2.643,0.166,4.159,0.171c1.52-0.007,2.879-0.062,4.16-0.171 c10.03-0.841,18.496-4.631,25.162-11.264l0.121-0.12v-0.173l-0.005-9.931v-0.831l-0.662,0.504l-3.857,2.935 c-6.604,4.785-14.17,9.218-24.675,9.218l-0.098-0.004c-0.049-0.002-0.097-0.005-0.146-0.005c-9.03-0.052-16.544-2.994-22.34-8.743 c-5.848-5.857-8.813-13.476-8.813-22.646c0-9.172,2.967-16.79,8.817-22.649C236.834,170.899,244.349,167.96,253.379,167.907z"/> <polygon fill="#3E5059" points="201.011,157.506 194.607,157.506 194.607,157.509 193.18,157.506 192.768,157.506 192.768,157.918 192.768,238.304 192.768,238.717 193.18,238.717 194.568,238.717 194.604,238.717 194.675,238.705 200.865,238.694 200.867,238.694 200.985,238.712 202.441,238.717 202.854,238.717 202.854,238.304 202.854,157.918 202.854,157.506 202.441,157.506 "/> </g> </g> </svg> assets/img/quic-cloud-icon-16x16.svg 0000777 00000003764 15251157102 0013141 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve"> <g> <path fill="#889EAA" d="M15.222,5.874c-0.616-0.81-1.511-1.331-2.52-1.468c-0.793-0.108-1.584,0.033-2.29,0.406 c-0.095,0.05-0.188,0.103-0.276,0.161L9.819,5.211l0.819,1.077l0.25-0.189c0.05-0.032,0.103-0.062,0.155-0.09 c0.455-0.24,0.965-0.331,1.476-0.262c0.65,0.088,1.228,0.425,1.625,0.947c0.397,0.522,0.567,1.168,0.479,1.818 c-0.183,1.343-1.424,2.286-2.765,2.104c-0.511-0.069-0.979-0.294-1.354-0.646c-0.044-0.042-0.087-0.086-0.126-0.128L7.292,5.785 L7.292,5.798L6.967,5.371L6.931,5.328C6.857,5.246,6.779,5.165,6.699,5.09C6.093,4.518,5.335,4.157,4.51,4.045 C2.338,3.75,0.331,5.277,0.036,7.449c-0.295,2.171,1.232,4.178,3.404,4.473c0.827,0.113,1.652-0.034,2.39-0.423 c0.03-0.017,0.058-0.033,0.088-0.05l-0.833-1.093c-0.457,0.214-0.959,0.294-1.463,0.225c-1.432-0.194-2.439-1.518-2.245-2.95 c0.195-1.433,1.517-2.439,2.95-2.245c0.545,0.074,1.044,0.312,1.444,0.69c0.047,0.043,0.092,0.09,0.136,0.137l2.426,3.189 l0.001-0.014l0.985,1.295l0.034,0.042c0.069,0.077,0.145,0.154,0.224,0.229c0.581,0.549,1.307,0.895,2.099,1.002 c0.173,0.023,0.345,0.035,0.515,0.035c1.876,0,3.514-1.39,3.773-3.298C16.103,7.685,15.838,6.684,15.222,5.874z"/> <path fill="#00CCCC" d="M8.614,11.234c-0.013-0.014-0.026-0.026-0.038-0.039L7.012,9.143C6.944,9.066,6.87,8.99,6.792,8.916 C6.211,8.368,5.485,8.023,4.693,7.915c-0.076-0.01-0.151-0.017-0.227-0.023H4.351l0.577,0.755C4.94,8.659,4.954,8.673,4.966,8.686 l1.563,2.053c0.068,0.076,0.142,0.152,0.22,0.225c0.581,0.549,1.306,0.896,2.099,1.003c0.075,0.01,0.15,0.018,0.227,0.023H9.19 L8.614,11.234z"/> </g> </svg> assets/img/lscwp_gray_font-icon_22px.svg 0000777 00000003166 15251157102 0014360 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="22px" height="22px" viewBox="0 0 22 22" enable-background="new 0 0 22 22" xml:space="preserve"> <path fill="#777777" d="M13.039,7.954c-0.063-0.128-0.193-0.21-0.336-0.21c-0.119,0-0.207,0.054-0.268,0.102L9.84,9.838 c-0.208,0.158-0.254,0.461-0.104,0.675l0.813,1.17l-1.521,1.93c-0.141,0.18-0.113,0.336-0.065,0.434 c0.06,0.125,0.194,0.209,0.334,0.209c0.123,0,0.208-0.055,0.271-0.102l2.593-1.992c0.158-0.121,0.211-0.33,0.145-0.578 c-0.011-0.041-0.027-0.076-0.051-0.114l-0.803-1.154l1.52-1.93C13.111,8.207,13.086,8.052,13.039,7.954z"/> <path fill="#777777" d="M21.771,10.677L11.323,0.229c-0.088-0.086-0.202-0.135-0.324-0.135c-0.123,0-0.236,0.048-0.324,0.134 L0.228,10.677c-0.086,0.088-0.134,0.201-0.134,0.324c0,0.122,0.048,0.236,0.134,0.324l10.448,10.446 c0.087,0.088,0.202,0.135,0.324,0.135s0.237-0.047,0.324-0.135l10.446-10.447c0.088-0.085,0.136-0.201,0.136-0.323 C21.905,10.879,21.856,10.765,21.771,10.677z M11.424,1.625l8.956,8.956h-2.99c-0.016,0-0.035,0.001-0.051,0.003l-5.915-5.913V1.625 z M10.584,1.617v3.045l-5.92,5.919H1.62L10.584,1.617z M10.584,20.387L1.62,11.421h3.044l5.92,5.918V20.387z M10.999,16.504 l-5.501-5.502L10.999,5.5l5.503,5.502L10.999,16.504z M11.424,20.377v-3.045l5.913-5.914c0.018,0.001,0.037,0.003,0.053,0.003h2.99 L11.424,20.377z"/> </svg> assets/img/icons/revision.svg 0000777 00000005522 15251157102 0012326 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="#6699CC" d="M60.912,72.441H14.087c-1.493,0-2.708-1.214-2.708-2.708V5.266c0-1.493,1.215-2.708,2.708-2.708h46.827 c1.492,0,2.708,1.215,2.708,2.708v64.468C63.62,71.228,62.406,72.441,60.912,72.441z M14.087,4.206c-0.584,0-1.06,0.476-1.06,1.06 v64.468c0,0.584,0.476,1.061,1.06,1.061h46.827c0.583,0,1.06-0.477,1.06-1.061V5.266c0-0.583-0.477-1.06-1.06-1.06H14.087z"/> </g> <g> <path fill="#6699CC" d="M53.625,16.858h-32.25c-0.483,0-0.875-0.392-0.875-0.875s0.392-0.875,0.875-0.875h32.25 c0.482,0,0.875,0.392,0.875,0.875S54.107,16.858,53.625,16.858z"/> </g> <g> <path fill="#6699CC" d="M53.625,27.617h-32.25c-0.483,0-0.875-0.392-0.875-0.875c0-0.483,0.392-0.875,0.875-0.875h32.25 c0.482,0,0.875,0.392,0.875,0.875C54.5,27.225,54.107,27.617,53.625,27.617z"/> </g> <g> <path fill="#6699CC" d="M53.625,38.375h-32.25c-0.483,0-0.875-0.392-0.875-0.875s0.392-0.875,0.875-0.875h32.25 c0.482,0,0.875,0.392,0.875,0.875S54.107,38.375,53.625,38.375z"/> </g> <g> <path fill="#6699CC" d="M29.373,49.133h-7.998c-0.483,0-0.875-0.392-0.875-0.875c0-0.482,0.392-0.875,0.875-0.875h7.998 c0.483,0,0.875,0.393,0.875,0.875C30.248,48.741,29.856,49.133,29.373,49.133z"/> </g> <g> <path fill="#6699CC" d="M27.763,59.893h-6.388c-0.483,0-0.875-0.392-0.875-0.875c0-0.482,0.392-0.875,0.875-0.875h6.388 c0.483,0,0.875,0.393,0.875,0.875C28.638,59.501,28.247,59.893,27.763,59.893z"/> </g> <g> <path fill="#6699CC" d="M35.727,49.516"/> </g> <g> <path fill="#6699CC" d="M50.613,64.8"/> </g> <g> <g> <path fill="#6699CC" d="M44.561,67.521c-6.457,0-11.709-5.254-11.709-11.711c0-0.719,0.066-1.438,0.195-2.141l1.721,0.318 c-0.11,0.597-0.166,1.21-0.166,1.822c0,5.491,4.467,9.959,9.959,9.959c1.992,0,3.916-0.586,5.563-1.696l0.979,1.45 C49.165,66.831,46.902,67.521,44.561,67.521z"/> </g> <g> <g> <polygon fill="#6699CC" points="30.879,53.666 35.572,49.759 36.61,55.777 "/> </g> </g> </g> <g> <g> <path fill="#6699CC" d="M56.075,57.952l-1.722-0.316c0.11-0.6,0.166-1.214,0.166-1.823c0-5.492-4.468-9.961-9.959-9.961 c-1.994,0-3.918,0.588-5.564,1.698l-0.979-1.45c1.937-1.308,4.198-1.998,6.543-1.998c6.457,0,11.709,5.254,11.709,11.711 C56.271,56.527,56.205,57.248,56.075,57.952z"/> </g> <g> <g> <polygon fill="#6699CC" points="58.242,57.958 53.548,61.865 52.512,55.848 "/> </g> </g> </g> <g> <path fill="#6699CC" d="M38.507,46.824"/> </g> </svg> assets/img/icons/img_optm.svg 0000777 00000013002 15251157102 0012273 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve"> <path fill="#5968B3" d="M17.181,20.485H2.421l12.867-8.158l3.352,3.626l0.637,0.018c0.034-0.048,0.069-0.097,0.105-0.144 l-0.293-0.826c-0.12-0.34-0.023-0.713,0.248-0.951c0.308-0.27,0.642-0.512,0.99-0.72c0.137-0.081,0.291-0.123,0.448-0.123 c0.191,0,0.381,0.064,0.532,0.18l0.694,0.534c0.058-0.02,0.115-0.039,0.173-0.057l0.248-0.84c0.102-0.346,0.399-0.591,0.759-0.624 c0.146-0.014,0.298-0.017,0.448-0.021V6.147H1.62V21.29h15.78c-0.071-0.215-0.155-0.416-0.207-0.647 C17.181,20.59,17.183,20.538,17.181,20.485z M10.705,8.189c0.956,0,1.731,0.775,1.731,1.731c0,0.956-0.775,1.73-1.731,1.73 c-0.956,0-1.731-0.774-1.731-1.73C8.974,8.964,9.75,8.189,10.705,8.189z M2.368,9.563l7.593,5.435l-7.593,4.729V9.563z M23.63,17.247v3.792c-0.466-0.04-0.886-0.239-1.196-0.554h0.395l-0.911-0.986c-0.021-0.115-0.036-0.233-0.036-0.355 C21.881,18.145,22.653,17.332,23.63,17.247z M24.298,20.979v-3.673c0.335,0.092,0.634,0.268,0.869,0.511v2.652 C24.932,20.712,24.633,20.888,24.298,20.979z M19.383,22.458l-0.163,0.458H0.083V4.582h25.084v8.451l-0.003-0.008 c-0.102-0.346-0.399-0.591-0.759-0.625c-0.035-0.003-0.071-0.002-0.107-0.005V5.451H0.952v16.596h16.776 c0.163,0.176,0.397,0.286,0.666,0.291l0.883-0.024C19.311,22.362,19.346,22.41,19.383,22.458z M23.794,25.418 c-0.191,0-0.378-0.012-0.563-0.027c-0.154-0.014-0.284-0.119-0.328-0.268l-0.326-1.106c-0.224-0.058-0.444-0.13-0.659-0.217 l-0.913,0.702c-0.122,0.094-0.29,0.104-0.422,0.024c-0.326-0.195-0.634-0.419-0.916-0.666c-0.115-0.102-0.157-0.263-0.106-0.408 l0.387-1.088c-0.149-0.179-0.286-0.365-0.408-0.559l-1.158,0.032c-0.149-0.003-0.294-0.086-0.354-0.227 c-0.143-0.331-0.259-0.694-0.346-1.078c-0.033-0.149,0.027-0.305,0.154-0.392l0.95-0.65c-0.009-0.115-0.014-0.231-0.014-0.349 s0.005-0.232,0.014-0.348l-0.95-0.65c-0.127-0.087-0.188-0.242-0.154-0.393c0.087-0.382,0.203-0.745,0.346-1.078 c0.061-0.143,0.19-0.232,0.354-0.228l1.158,0.032c0.122-0.193,0.259-0.38,0.408-0.557l-0.387-1.088 c-0.051-0.145-0.009-0.306,0.106-0.408c0.285-0.25,0.594-0.474,0.917-0.666c0.133-0.078,0.299-0.068,0.421,0.025l0.913,0.702 c0.219-0.088,0.439-0.161,0.659-0.216l0.326-1.105c0.043-0.147,0.172-0.253,0.325-0.268c0.371-0.035,0.758-0.035,1.132,0 c0.153,0.014,0.282,0.12,0.325,0.268l0.326,1.104c0.22,0.056,0.44,0.128,0.659,0.217l0.914-0.702 c0.121-0.094,0.288-0.104,0.421-0.024c0.325,0.194,0.633,0.418,0.916,0.666c0.116,0.101,0.158,0.263,0.106,0.408l-0.387,1.088 c0.149,0.177,0.286,0.363,0.408,0.557l1.158-0.032c0.137-0.004,0.294,0.085,0.354,0.228c0.144,0.334,0.26,0.696,0.347,1.078 c0.034,0.149-0.027,0.306-0.154,0.393l-0.95,0.65c0.009,0.115,0.013,0.23,0.013,0.348s-0.004,0.233-0.013,0.349l0.95,0.65 c0.127,0.087,0.188,0.242,0.154,0.393c-0.087,0.383-0.203,0.745-0.347,1.077c-0.062,0.141-0.214,0.228-0.354,0.227l-1.158-0.032 c-0.121,0.193-0.258,0.38-0.408,0.559l0.387,1.088c0.052,0.146,0.01,0.307-0.106,0.408c-0.283,0.248-0.592,0.472-0.916,0.666 c-0.132,0.08-0.299,0.07-0.421-0.024L25.67,23.8c-0.215,0.087-0.436,0.159-0.659,0.217l-0.326,1.106 c-0.044,0.148-0.174,0.254-0.328,0.268C24.171,25.406,23.983,25.418,23.794,25.418z M23.548,24.661c0.162,0.008,0.328,0.008,0.491,0 l0.314-1.067c0.039-0.133,0.148-0.232,0.284-0.261c0.317-0.065,0.631-0.169,0.93-0.306c0.125-0.061,0.273-0.043,0.385,0.044 l0.882,0.677c0.137-0.091,0.271-0.188,0.399-0.29l-0.374-1.05c-0.046-0.132-0.017-0.277,0.078-0.38 c0.225-0.245,0.419-0.51,0.576-0.788c0.068-0.121,0.191-0.206,0.337-0.19l1.115,0.031c0.056-0.15,0.105-0.306,0.149-0.468 l-0.919-0.629c-0.115-0.079-0.177-0.216-0.16-0.355c0.02-0.159,0.03-0.321,0.03-0.486s-0.011-0.326-0.03-0.485 c-0.017-0.139,0.045-0.276,0.16-0.355l0.919-0.629c-0.044-0.162-0.094-0.318-0.149-0.47l-1.115,0.031 c-0.143-0.006-0.268-0.069-0.337-0.189c-0.158-0.279-0.352-0.544-0.576-0.787c-0.095-0.102-0.124-0.248-0.078-0.38l0.374-1.049 c-0.129-0.103-0.262-0.199-0.399-0.29l-0.882,0.677c-0.11,0.084-0.258,0.101-0.383,0.044c-0.309-0.14-0.622-0.242-0.931-0.305 c-0.136-0.028-0.246-0.128-0.285-0.262l-0.314-1.067c-0.164-0.009-0.328-0.008-0.491,0l-0.314,1.067 c-0.039,0.133-0.149,0.234-0.285,0.262c-0.309,0.063-0.622,0.165-0.931,0.305c-0.128,0.055-0.274,0.04-0.384-0.044l-0.881-0.677 c-0.137,0.09-0.271,0.188-0.398,0.29l0.373,1.05c0.046,0.132,0.017,0.277-0.078,0.38c-0.224,0.243-0.418,0.508-0.577,0.787 c-0.067,0.12-0.204,0.18-0.336,0.189l-1.115-0.031c-0.056,0.15-0.105,0.308-0.148,0.47l0.918,0.629 c0.115,0.079,0.178,0.216,0.16,0.354c-0.019,0.159-0.03,0.321-0.03,0.486s0.012,0.327,0.031,0.487 c0.017,0.139-0.046,0.275-0.161,0.354l-0.919,0.629c0.044,0.162,0.094,0.318,0.149,0.468l1.115-0.031 c0.135-0.012,0.269,0.069,0.337,0.189c0.158,0.279,0.352,0.544,0.577,0.789c0.094,0.103,0.123,0.249,0.077,0.38l-0.373,1.05 c0.128,0.102,0.262,0.199,0.399,0.29l0.88-0.677c0.11-0.085,0.259-0.103,0.385-0.044c0.3,0.137,0.613,0.24,0.932,0.306 c0.135,0.028,0.244,0.128,0.283,0.261L23.548,24.661z M23.794,22.306c-1.744,0-3.163-1.419-3.163-3.162 c0-1.744,1.419-3.163,3.163-3.163c1.743,0,3.162,1.419,3.162,3.163C26.956,20.887,25.537,22.306,23.794,22.306z M23.794,16.73 c-1.33,0-2.413,1.082-2.413,2.413c0,1.33,1.083,2.412,2.413,2.412s2.412-1.082,2.412-2.412C26.206,17.813,25.124,16.73,23.794,16.73 z"/> </svg> assets/img/icons/all.svg 0000777 00000015710 15251157102 0011240 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="#6699CC" d="M56.164,37.484c-0.059-0.082-0.122-0.162-0.212-0.215c-0.005-0.002-0.01-0.001-0.015-0.004 c-0.004-0.002-0.005-0.006-0.009-0.008l-2.159-1.183c-0.606-4.582-3.073-8.809-6.781-11.605c-0.079-0.059-0.167-0.093-0.256-0.123 v-2.987c0-0.135-0.037-0.264-0.104-0.376c-0.021-0.037-0.061-0.057-0.088-0.09c-0.055-0.064-0.102-0.135-0.177-0.179 c-0.004-0.002-0.009-0.001-0.013-0.003c-0.004-0.002-0.005-0.007-0.009-0.009l-8.482-4.647c-0.225-0.123-0.496-0.123-0.721,0 l-8.483,4.647c-0.004,0.002-0.005,0.006-0.009,0.008c-0.004,0.002-0.009,0.001-0.013,0.004c-0.075,0.044-0.124,0.115-0.178,0.181 c-0.026,0.032-0.066,0.053-0.087,0.088c-0.065,0.113-0.103,0.242-0.103,0.376v3.111c-0.087,0.03-0.174,0.063-0.251,0.121 c-3.66,2.766-6.112,6.938-6.745,11.458l-2.203,1.207c-0.004,0.002-0.005,0.007-0.009,0.009c-0.004,0.002-0.009,0.001-0.013,0.003 c-0.075,0.044-0.122,0.114-0.176,0.179c-0.027,0.033-0.067,0.053-0.089,0.09c-0.065,0.113-0.103,0.242-0.103,0.376v10.221 c0,0.272,0.148,0.524,0.387,0.656l8.483,4.695c0.113,0.063,0.238,0.094,0.363,0.094s0.25-0.031,0.363-0.094l2.121-1.174 c0.097,0.127,0.215,0.239,0.376,0.3c2.006,0.758,4.12,1.143,6.283,1.143c2.454,0,4.83-0.491,7.061-1.459 c0.079-0.034,0.14-0.089,0.202-0.142l2.406,1.332c0.113,0.063,0.238,0.094,0.363,0.094s0.25-0.031,0.363-0.094l8.482-4.696 c0.238-0.132,0.387-0.384,0.387-0.656v-10.22c0-0.136-0.039-0.266-0.105-0.379C56.202,37.515,56.179,37.503,56.164,37.484z M39.354,47.691v-8.511l6.984,3.824v8.553L39.354,47.691z M47.775,41.328l-0.688,0.376l-6.923-3.79l6.923-3.792l6.92,3.792 L47.775,41.328z M29.767,22.625l6.983,3.825v8.554l-6.983-3.867V22.625z M38.251,26.449l6.981-3.825v8.512l-6.981,3.867V26.449z M37.5,17.566l6.921,3.792L37.5,25.15l-6.922-3.792L37.5,17.566z M28.927,41.148l-1.015,0.556l-6.922-3.79l6.922-3.792l6.921,3.792 L28.927,41.148z M20.179,39.181l6.983,3.823v8.554l-6.983-3.865V39.181z M28.662,43.004l6.983-3.824v8.513l-6.983,3.865V43.004z M32.29,51.265l4.469-2.474c0.239-0.132,0.387-0.384,0.387-0.656V37.914c0-0.136-0.038-0.265-0.104-0.377 c-0.017-0.028-0.048-0.043-0.068-0.069c-0.057-0.073-0.113-0.149-0.195-0.198c-0.004-0.002-0.01-0.001-0.014-0.004 c-0.003-0.002-0.005-0.007-0.009-0.009l-8.482-4.647c-0.225-0.123-0.496-0.123-0.721,0l-4.299,2.355 c0.743-3.207,2.516-6.133,5.015-8.303v4.917c0,0.273,0.148,0.524,0.387,0.656l8.483,4.697c0.113,0.063,0.238,0.094,0.363,0.094 s0.25-0.031,0.363-0.094l8.482-4.697c0.238-0.132,0.387-0.383,0.387-0.656v-5.045c2.547,2.205,4.339,5.188,5.065,8.46l-4.35-2.384 c-0.225-0.123-0.496-0.123-0.721,0l-8.484,4.647c-0.004,0.002-0.006,0.007-0.009,0.009c-0.005,0.002-0.01,0.001-0.014,0.004 c-0.075,0.044-0.123,0.115-0.177,0.18c-0.027,0.032-0.066,0.053-0.087,0.088c-0.065,0.113-0.103,0.242-0.103,0.376v10.22 c0,0.272,0.148,0.524,0.387,0.656l4.14,2.291C39.143,52.218,35.566,52.28,32.29,51.265z M54.82,47.691l-6.982,3.866v-8.554 l4.363-2.39l2.619-1.435V47.691z"/> <path fill="#6699CC" d="M66.554,43.38l-4.544-3.116c0.121-1.014,0.178-1.903,0.178-2.765c0-0.859-0.057-1.75-0.178-2.769 l4.543-3.11c0.297-0.203,0.439-0.567,0.358-0.918c-0.412-1.793-0.948-3.472-1.594-4.992c-0.141-0.331-0.435-0.543-0.83-0.532 l-5.511,0.151c-0.905-1.59-2.004-3.092-3.274-4.478l1.841-5.181c0.121-0.339,0.021-0.717-0.25-0.953 c-1.303-1.134-2.73-2.171-4.244-3.083c-0.307-0.186-0.699-0.165-0.984,0.056l-4.357,3.352c-1.702-0.773-3.47-1.349-5.269-1.714 l-1.552-5.281c-0.103-0.346-0.405-0.594-0.765-0.625c-1.425-0.122-3.825-0.122-5.243,0c-0.359,0.031-0.663,0.279-0.764,0.625 l-1.555,5.281c-1.798,0.365-3.565,0.94-5.266,1.714l-4.355-3.352c-0.286-0.22-0.676-0.243-0.983-0.057 c-1.515,0.908-2.946,1.945-4.253,3.084c-0.271,0.236-0.37,0.614-0.25,0.953l1.844,5.18c-1.275,1.391-2.375,2.893-3.277,4.478 l-5.509-0.151c-0.358-0.016-0.689,0.202-0.829,0.533c-0.652,1.535-1.173,3.167-1.593,4.991c-0.081,0.351,0.061,0.715,0.358,0.918 l4.543,3.11c-0.119,0.998-0.177,1.909-0.177,2.769c0,0.858,0.058,1.768,0.177,2.767L8.446,43.38 c-0.296,0.203-0.438,0.566-0.358,0.917c0.41,1.786,0.945,3.464,1.593,4.987c0.14,0.332,0.474,0.531,0.829,0.533l5.51-0.151 c0.902,1.586,2.001,3.09,3.276,4.481l-1.843,5.181c-0.121,0.339-0.021,0.717,0.25,0.953c1.297,1.129,2.727,2.166,4.251,3.084 c0.309,0.188,0.7,0.164,0.985-0.056l4.356-3.355c1.701,0.775,3.467,1.351,5.265,1.715l1.553,5.28 c0.102,0.345,0.403,0.593,0.761,0.624c1.039,0.094,1.849,0.135,2.625,0.135c0.776,0,1.585-0.041,2.625-0.135 c0.357-0.031,0.66-0.279,0.762-0.624l1.552-5.28c1.8-0.365,3.565-0.94,5.263-1.715l4.363,3.355c0.285,0.22,0.677,0.241,0.985,0.056 c1.521-0.917,2.949-1.955,4.249-3.085c0.271-0.236,0.371-0.614,0.25-0.954l-1.845-5.18c1.272-1.391,2.372-2.895,3.277-4.48 l5.506,0.151c0.401-0.007,0.688-0.202,0.829-0.532c0.646-1.516,1.182-3.193,1.595-4.987C66.992,43.947,66.85,43.583,66.554,43.38z M63.932,48.051l-5.433-0.149c-0.369-0.005-0.637,0.169-0.794,0.459c-0.961,1.778-2.185,3.451-3.637,4.975 c-0.229,0.238-0.303,0.586-0.191,0.897l1.82,5.112c-0.951,0.792-1.972,1.532-3.045,2.21l-4.307-3.313 c-0.261-0.202-0.617-0.238-0.913-0.095c-1.871,0.902-3.835,1.542-5.837,1.901c-0.326,0.059-0.592,0.297-0.686,0.614l-1.533,5.217 c-1.425,0.108-2.333,0.106-3.754,0l-1.535-5.217c-0.093-0.318-0.359-0.556-0.685-0.614c-2-0.358-3.964-0.998-5.839-1.901 c-0.298-0.145-0.651-0.107-0.914,0.095l-4.3,3.313c-1.076-0.678-2.096-1.418-3.046-2.209l1.819-5.114 c0.111-0.312,0.037-0.658-0.191-0.897c-1.456-1.523-2.678-3.196-3.634-4.973c-0.157-0.29-0.467-0.472-0.794-0.46l-5.438,0.149 c-0.44-1.112-0.821-2.308-1.134-3.567l4.489-3.076c0.273-0.187,0.417-0.512,0.373-0.84c-0.155-1.135-0.23-2.139-0.23-3.068 c0-0.932,0.075-1.937,0.23-3.07c0.044-0.328-0.1-0.653-0.373-0.84l-4.488-3.072c0.318-1.28,0.692-2.458,1.135-3.573l5.437,0.149 c0.326,0.02,0.637-0.169,0.794-0.459c0.957-1.774,2.18-3.446,3.635-4.969c0.229-0.239,0.303-0.586,0.192-0.898l-1.82-5.114 c0.956-0.796,1.976-1.536,3.045-2.207l4.299,3.309c0.262,0.202,0.616,0.239,0.913,0.095c1.875-0.902,3.841-1.542,5.842-1.901 c0.326-0.059,0.591-0.296,0.685-0.614l1.536-5.216c1.131-0.084,2.618-0.084,3.753,0l1.533,5.215 c0.094,0.318,0.358,0.556,0.685,0.615c2.002,0.36,3.968,1,5.845,1.901c0.297,0.143,0.651,0.106,0.912-0.095l4.301-3.309 c1.068,0.673,2.087,1.413,3.04,2.207l-1.817,5.114c-0.111,0.312-0.037,0.659,0.191,0.897c1.449,1.516,2.672,3.188,3.632,4.969 c0.157,0.291,0.414,0.481,0.795,0.459l5.438-0.149c0.44,1.111,0.82,2.308,1.136,3.573l-4.487,3.072 c-0.272,0.187-0.417,0.511-0.373,0.839c0.157,1.169,0.23,2.146,0.23,3.072c0,0.929-0.073,1.903-0.23,3.067 c-0.044,0.327,0.1,0.652,0.372,0.839l4.488,3.077C64.752,45.747,64.371,46.943,63.932,48.051z"/> </g> </svg> assets/img/icons/purge-403.svg 0000777 00000011104 15251157102 0012107 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="#6699CC" d="M30.075,34.094H28.1v-9.829c0-0.138-0.112-0.25-0.25-0.25h-1.805c-0.082,0-0.158,0.04-0.205,0.106 l-7.116,10.142c-0.03,0.042-0.045,0.092-0.045,0.144v1.486c0,0.138,0.112,0.25,0.25,0.25h7.041v3.195c0,0.138,0.112,0.25,0.25,0.25 h1.63c0.138,0,0.25-0.112,0.25-0.25v-3.195h1.975c0.138,0,0.25-0.112,0.25-0.25v-1.549C30.325,34.206,30.213,34.094,30.075,34.094z M25.97,29.361v4.732h-4.857l4.413-6.275c0.16-0.241,0.328-0.517,0.5-0.826C25.988,27.85,25.97,28.644,25.97,29.361z"/> <path fill="#6699CC" d="M40.443,37.76c0.839-1.313,1.264-3.31,1.264-5.938c0-2.539-0.439-4.513-1.305-5.867 c-0.891-1.389-2.209-2.094-3.918-2.094c-1.751,0-3.074,0.677-3.933,2.011c-0.836,1.3-1.26,3.301-1.26,5.95 c0,2.566,0.438,4.548,1.301,5.892c0.886,1.379,2.195,2.079,3.892,2.079C38.248,39.793,39.58,39.109,40.443,37.76z M38.726,36.452 c-0.467,0.925-1.2,1.375-2.242,1.375c-1.029,0-1.758-0.443-2.229-1.356c-0.492-0.955-0.741-2.519-0.741-4.648 c0-2.131,0.25-3.691,0.741-4.638c0.47-0.906,1.199-1.347,2.229-1.347c1.042,0,1.776,0.447,2.243,1.365 c0.489,0.961,0.737,2.515,0.737,4.619C39.464,33.925,39.216,35.483,38.726,36.452z"/> <path fill="#6699CC" d="M53.068,27.874c0-1.234-0.438-2.222-1.301-2.936c-0.85-0.702-2.045-1.057-3.553-1.057 c-0.913,0-1.794,0.145-2.619,0.43c-0.824,0.283-1.564,0.681-2.201,1.183c-0.107,0.084-0.127,0.238-0.046,0.346l0.861,1.148 c0.078,0.105,0.224,0.131,0.335,0.061c0.723-0.463,1.371-0.785,1.928-0.956c0.556-0.169,1.155-0.255,1.783-0.255 c0.798,0,1.432,0.191,1.886,0.567c0.446,0.37,0.663,0.871,0.663,1.53c0,0.84-0.303,1.478-0.926,1.949 c-0.636,0.48-1.521,0.723-2.629,0.723h-1.496c-0.138,0-0.25,0.112-0.25,0.25v1.467c0,0.138,0.112,0.25,0.25,0.25h1.477 c2.715,0,4.035,0.811,4.035,2.478c0,1.881-1.189,2.796-3.636,2.796c-0.635,0-1.318-0.083-2.031-0.246 c-0.713-0.162-1.393-0.402-2.021-0.713c-0.077-0.038-0.17-0.034-0.243,0.012s-0.118,0.126-0.118,0.212v1.619 c0,0.096,0.055,0.184,0.141,0.225c0.639,0.311,1.308,0.529,1.987,0.652c0.669,0.122,1.417,0.184,2.224,0.184 c1.873,0,3.346-0.405,4.378-1.206c1.051-0.815,1.583-1.991,1.583-3.494c0-1.06-0.316-1.932-0.939-2.592 c-0.466-0.493-1.12-0.849-1.951-1.062c0.637-0.243,1.16-0.595,1.563-1.051C52.776,29.735,53.068,28.889,53.068,27.874z"/> <path fill="#6699CC" d="M17.361,5h-0.05c-0.483,0-0.85,0.392-0.85,0.875s0.417,0.875,0.9,0.875c0.483,0,0.875-0.392,0.875-0.875 S17.845,5,17.361,5z"/> <path fill="#6699CC" d="M20.898,5h-0.086c-0.483,0-0.832,0.392-0.832,0.875s0.435,0.875,0.918,0.875s0.875-0.392,0.875-0.875 S21.382,5,20.898,5z"/> <path fill="#6699CC" d="M24.398,5h-0.05c-0.483,0-0.85,0.392-0.85,0.875s0.417,0.875,0.9,0.875s0.875-0.392,0.875-0.875 S24.882,5,24.398,5z"/> <path fill="#6699CC" d="M37.626,59.27c0,5.621,4.574,10.195,10.196,10.195c5.623,0,10.197-4.574,10.197-10.195 c0-5.623-4.574-10.197-10.197-10.197C42.2,49.07,37.626,53.646,37.626,59.27z M56.27,59.27c0,4.656-3.789,8.445-8.446,8.445 s-8.446-3.789-8.446-8.445c0-4.658,3.789-8.447,8.446-8.447C52.48,50.82,56.27,54.609,56.27,59.27z"/> <path fill="#6699CC" d="M42.833,64.257c0.171,0.171,0.396,0.257,0.619,0.257c0.223,0,0.448-0.086,0.618-0.257l3.753-3.752 l3.752,3.752c0.171,0.171,0.396,0.257,0.618,0.257c0.224,0,0.449-0.086,0.619-0.257c0.342-0.342,0.342-0.896,0-1.237l-3.752-3.752 l3.752-3.752c0.342-0.343,0.342-0.896,0-1.238s-0.896-0.342-1.237,0l-3.752,3.752l-3.753-3.752c-0.342-0.342-0.896-0.342-1.237,0 c-0.341,0.342-0.341,0.896,0,1.238l3.752,3.752l-3.752,3.752C42.492,63.361,42.492,63.915,42.833,64.257z"/> <path fill="#6699CC" d="M62.77,13.878c-0.041-0.079-0.082-0.158-0.148-0.225L50.535,1.569c-0.004-0.003-0.01-0.004-0.012-0.008 c-0.08-0.076-0.17-0.138-0.272-0.181c-0.106-0.044-0.222-0.067-0.335-0.067H14.812c-1.585,0-2.875,1.29-2.875,2.875v66.625 c0,1.586,1.29,2.875,2.875,2.875h45.377c1.584,0,2.875-1.289,2.875-2.875v-56.29C63.063,14.265,62.947,14.039,62.77,13.878z M50.791,4.3l9.348,9.348h-8.223c-0.62,0-1.125-0.505-1.125-1.125V4.3z M13.687,4.188c0-0.621,0.504-1.125,1.125-1.125h34.229 v6.126H13.687V4.188z M61.313,70.813c0,0.621-0.504,1.125-1.125,1.125H14.812c-0.62,0-1.125-0.504-1.125-1.125V10.938h35.354v1.584 c0,1.585,1.29,2.875,2.875,2.875h9.396V70.813z"/> </g> </svg> assets/img/icons/purge-404.svg 0000777 00000007735 15251157102 0012127 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="#6699CC" d="M30.075,34.093H28.1v-9.829c0-0.138-0.112-0.25-0.25-0.25h-1.805c-0.082,0-0.158,0.04-0.205,0.106 l-7.116,10.142c-0.03,0.042-0.045,0.092-0.045,0.144v1.486c0,0.138,0.112,0.25,0.25,0.25h7.041v3.195c0,0.138,0.112,0.25,0.25,0.25 h1.63c0.138,0,0.25-0.112,0.25-0.25v-3.195h1.975c0.138,0,0.25-0.112,0.25-0.25v-1.549C30.325,34.205,30.213,34.093,30.075,34.093z M21.113,34.093l4.413-6.275c0.16-0.241,0.328-0.517,0.5-0.826c-0.037,0.857-0.056,1.651-0.056,2.369v4.732H21.113z"/> <path fill="#6699CC" d="M40.443,37.759c0.839-1.313,1.264-3.31,1.264-5.938c0-2.539-0.439-4.513-1.305-5.867 c-0.891-1.389-2.209-2.094-3.918-2.094c-1.751,0-3.074,0.677-3.933,2.011c-0.836,1.3-1.26,3.301-1.26,5.95 c0,2.566,0.438,4.548,1.301,5.892c0.886,1.379,2.195,2.079,3.892,2.079C38.248,39.792,39.58,39.108,40.443,37.759z M36.484,37.825 c-1.029,0-1.758-0.443-2.229-1.356c-0.492-0.955-0.741-2.519-0.741-4.648c0-2.131,0.25-3.691,0.741-4.638 c0.47-0.906,1.199-1.347,2.229-1.347c1.042,0,1.776,0.447,2.243,1.365c0.489,0.961,0.737,2.515,0.737,4.619 c0,2.103-0.248,3.661-0.738,4.629C38.259,37.375,37.526,37.825,36.484,37.825z"/> <path fill="#6699CC" d="M50.061,24.014c-0.081,0-0.158,0.04-0.205,0.106l-7.117,10.142c-0.029,0.042-0.045,0.092-0.045,0.144v1.486 c0,0.138,0.112,0.25,0.25,0.25h7.041v3.195c0,0.138,0.112,0.25,0.25,0.25h1.631c0.138,0,0.25-0.112,0.25-0.25v-3.195h1.975 c0.138,0,0.25-0.112,0.25-0.25v-1.549c0-0.138-0.112-0.25-0.25-0.25h-1.975v-9.829c0-0.138-0.112-0.25-0.25-0.25H50.061z M45.128,34.093l4.412-6.275c0.16-0.241,0.327-0.517,0.5-0.826c-0.037,0.857-0.056,1.651-0.056,2.369v4.732H45.128z"/> <path fill="#6699CC" d="M17.361,5h-0.05c-0.483,0-0.85,0.392-0.85,0.875s0.417,0.875,0.9,0.875c0.483,0,0.875-0.392,0.875-0.875 S17.845,5,17.361,5z"/> <path fill="#6699CC" d="M20.898,5h-0.086c-0.483,0-0.832,0.392-0.832,0.875s0.435,0.875,0.918,0.875s0.875-0.392,0.875-0.875 S21.382,5,20.898,5z"/> <path fill="#6699CC" d="M24.398,5h-0.05c-0.483,0-0.85,0.392-0.85,0.875s0.417,0.875,0.9,0.875s0.875-0.392,0.875-0.875 S24.882,5,24.398,5z"/> <path fill="#6699CC" d="M37.626,59.27c0,5.621,4.574,10.195,10.196,10.195c5.623,0,10.197-4.574,10.197-10.195 c0-5.623-4.574-10.197-10.197-10.197C42.2,49.07,37.626,53.646,37.626,59.27z M56.27,59.27c0,4.656-3.789,8.445-8.446,8.445 s-8.446-3.789-8.446-8.445c0-4.658,3.789-8.447,8.446-8.447C52.48,50.82,56.27,54.609,56.27,59.27z"/> <path fill="#6699CC" d="M42.833,64.257c0.171,0.171,0.396,0.257,0.619,0.257c0.223,0,0.448-0.086,0.618-0.257l3.753-3.752 l3.752,3.752c0.171,0.171,0.396,0.257,0.618,0.257c0.224,0,0.449-0.086,0.619-0.257c0.342-0.342,0.342-0.896,0-1.237l-3.752-3.752 l3.752-3.752c0.342-0.343,0.342-0.896,0-1.238s-0.896-0.342-1.237,0l-3.752,3.752l-3.753-3.752c-0.342-0.342-0.896-0.342-1.237,0 c-0.341,0.342-0.341,0.896,0,1.238l3.752,3.752l-3.752,3.752C42.492,63.361,42.492,63.915,42.833,64.257z"/> <path fill="#6699CC" d="M62.77,13.878c-0.041-0.079-0.082-0.158-0.148-0.225L50.535,1.569c-0.004-0.003-0.01-0.004-0.012-0.008 c-0.08-0.076-0.17-0.138-0.272-0.181c-0.106-0.044-0.222-0.067-0.335-0.067H14.812c-1.585,0-2.875,1.29-2.875,2.875v66.625 c0,1.586,1.29,2.875,2.875,2.875h45.377c1.584,0,2.875-1.289,2.875-2.875v-56.29C63.063,14.265,62.947,14.039,62.77,13.878z M50.791,4.3l9.348,9.348h-8.223c-0.62,0-1.125-0.505-1.125-1.125V4.3z M13.687,4.188c0-0.621,0.504-1.125,1.125-1.125h34.229 v6.126H13.687V4.188z M61.313,70.813c0,0.621-0.504,1.125-1.125,1.125H14.812c-0.62,0-1.125-0.504-1.125-1.125V10.938h35.354v1.584 c0,1.585,1.29,2.875,2.875,2.875h9.396V70.813z"/> </g> </svg> assets/img/icons/purge-object.svg 0000777 00000014213 15251157102 0013053 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="#6699CC" d="M56.841,27.021h-2.944l3.079-8.461c0.108-0.299,0.047-0.634-0.162-0.874l-7.001-8.046 c-0.019-0.021-0.042-0.036-0.063-0.055c-0.033-0.032-0.065-0.065-0.104-0.091c-0.017-0.011-0.035-0.018-0.053-0.029 c-0.049-0.028-0.098-0.056-0.15-0.075c-0.01-0.003-0.02-0.004-0.029-0.007c-0.062-0.02-0.124-0.035-0.189-0.04 c-0.02-0.002-0.04,0.002-0.06,0.001c-0.05,0-0.1-0.003-0.149,0.005L38.48,11.014c-0.314,0.05-0.577,0.266-0.686,0.565 l-3.846,10.563c-0.027,0.075-0.043,0.152-0.049,0.229c0,0.003,0,0.006,0,0.01c-0.005,0.073-0.001,0.146,0.012,0.217 c0.003,0.017,0.011,0.032,0.015,0.048c0.014,0.058,0.03,0.114,0.056,0.168c0.01,0.021,0.025,0.038,0.036,0.058 c0.024,0.042,0.045,0.084,0.076,0.123c0.003,0.003,0.008,0.005,0.011,0.008c0.003,0.004,0.005,0.01,0.009,0.014l3.515,4.003h-0.583 l-3.372-3.876c-0.021-0.025-0.049-0.042-0.073-0.064c-0.03-0.027-0.057-0.057-0.09-0.08c-0.028-0.02-0.06-0.032-0.089-0.048 c-0.037-0.02-0.072-0.041-0.11-0.055c-0.027-0.01-0.056-0.013-0.084-0.02c-0.045-0.012-0.089-0.024-0.136-0.029 c-0.029-0.002-0.06,0.002-0.089,0.002c-0.042,0.001-0.083-0.003-0.125,0.004L22.34,24.521c-0.314,0.05-0.577,0.266-0.686,0.565 l-0.705,1.936h-2.79c-1.549,0-2.809,1.26-2.809,2.809c0,0.034,0.002,0.068,0.006,0.103l4.831,40.993 c0.03,1.523,1.278,2.753,2.808,2.753h29.007c1.53,0,2.778-1.229,2.808-2.753l4.833-40.993c0.004-0.034,0.006-0.068,0.006-0.103 C59.649,28.281,58.39,27.021,56.841,27.021z M52.035,27.021h-0.145l-5.603-6.378l2.925-8.036l0.254-0.698l5.688,6.537 L52.035,27.021z M39.262,12.662l8.561-1.351l-0.254,0.698l-2.925,8.036l-8.545,1.309L39.262,12.662z M36.483,23.064l8.464-1.296 l1.982,2.257l2.631,2.996h-9.604L36.483,23.064z M33.264,25.588l0.063-0.174l1.398,1.607h-1.983L33.264,25.588z M23.123,26.168 l8.56-1.353l-0.544,1.494l-0.259,0.712h-8.067L23.123,26.168z M53.067,70.768c-0.004,0.034-0.006,0.068-0.006,0.103 c0,0.584-0.475,1.059-1.059,1.059H22.996c-0.583,0-1.059-0.475-1.059-1.059c0-0.034-0.002-0.068-0.006-0.103l-4.829-40.981 c0.023-0.563,0.489-1.015,1.058-1.015h3.402h9.93h5.154h2.914h11.934h1.153h4.193c0.569,0,1.034,0.451,1.058,1.015L53.067,70.768z" /> <path fill="#6699CC" d="M28.884,63.444c-0.48,0.054-0.826,0.486-0.772,0.967l0.326,2.908c0.05,0.447,0.429,0.777,0.869,0.777 c0.032,0,0.065-0.002,0.099-0.006c0.48-0.054,0.826-0.486,0.772-0.967l-0.326-2.908C29.797,63.735,29.364,63.382,28.884,63.444z"/> <path fill="#6699CC" d="M26.532,42.486c0.48-0.054,0.826-0.486,0.772-0.967l-0.759-6.771c-0.054-0.479-0.479-0.819-0.967-0.772 c-0.48,0.054-0.826,0.487-0.772,0.967l0.759,6.771c0.05,0.447,0.429,0.777,0.869,0.777C26.466,42.492,26.499,42.49,26.532,42.486z" /> <path fill="#6699CC" d="M46.116,63.446c-0.485-0.057-0.914,0.291-0.967,0.771l-0.326,2.906c-0.055,0.48,0.291,0.913,0.771,0.967 c0.033,0.004,0.066,0.006,0.099,0.006c0.439,0,0.818-0.33,0.868-0.777l0.326-2.906C46.942,63.933,46.597,63.5,46.116,63.446z"/> <path fill="#6699CC" d="M49.421,33.976c-0.488-0.052-0.913,0.292-0.967,0.772l-0.732,6.525c-0.055,0.48,0.291,0.913,0.771,0.967 c0.033,0.004,0.066,0.006,0.099,0.006c0.439,0,0.818-0.33,0.868-0.777l0.732-6.525C50.247,34.463,49.901,34.03,49.421,33.976z"/> <path fill="#6699CC" d="M37.306,64.894c-0.483,0-0.875,0.392-0.875,0.875v1.453c0,0.483,0.392,0.875,0.875,0.875 s0.875-0.392,0.875-0.875v-1.453C38.181,65.285,37.789,64.894,37.306,64.894z"/> <path fill="#6699CC" d="M37.306,37.75c0.483,0,0.875-0.392,0.875-0.875v-2.029c0-0.483-0.392-0.875-0.875-0.875 s-0.875,0.392-0.875,0.875v2.029C36.431,37.358,36.822,37.75,37.306,37.75z"/> <path fill="#6699CC" d="M37.5,40.496c-6.108,0-11.078,4.97-11.078,11.079c0,6.108,4.97,11.078,11.078,11.078 c6.109,0,11.079-4.97,11.079-11.078C48.578,45.466,43.608,40.496,37.5,40.496z M37.5,60.903c-5.144,0-9.328-4.185-9.328-9.328 c0-5.145,4.185-9.329,9.328-9.329c5.144,0,9.329,4.185,9.329,9.329C46.828,56.719,42.644,60.903,37.5,60.903z"/> <path fill="#6699CC" d="M42.904,46.171c-0.342-0.342-0.896-0.342-1.238,0L37.5,50.336l-4.166-4.165 c-0.342-0.342-0.896-0.342-1.237,0s-0.342,0.896,0,1.238l4.165,4.165l-4.165,4.165c-0.342,0.342-0.342,0.896,0,1.238 c0.171,0.171,0.395,0.256,0.619,0.256s0.448-0.085,0.619-0.256l4.166-4.165l4.166,4.165c0.171,0.171,0.396,0.256,0.619,0.256 s0.448-0.085,0.619-0.256c0.341-0.342,0.341-0.896,0-1.238l-4.165-4.165l4.165-4.165C43.245,47.067,43.245,46.513,42.904,46.171z" /> <path fill="#6699CC" d="M21.312,23.8c0.167,0.191,0.408,0.298,0.658,0.298c0.044,0,0.088-0.003,0.132-0.01l10.519-1.611 c0.004,0,0.007-0.002,0.011-0.003c0.006-0.001,0.012-0.001,0.019-0.002c0.041-0.007,0.077-0.025,0.115-0.038 c0.03-0.01,0.062-0.017,0.091-0.03c0.042-0.02,0.08-0.047,0.118-0.073c0.024-0.017,0.052-0.029,0.074-0.048 c0.038-0.032,0.069-0.071,0.102-0.109c0.017-0.02,0.038-0.037,0.053-0.059c0.044-0.063,0.081-0.131,0.107-0.205l3.845-10.564 c0.109-0.299,0.047-0.634-0.162-0.874L29.99,2.426c-0.023-0.026-0.052-0.045-0.077-0.068c-0.028-0.025-0.054-0.054-0.085-0.075 c-0.034-0.023-0.071-0.039-0.108-0.058c-0.031-0.015-0.059-0.034-0.091-0.045c-0.036-0.013-0.073-0.018-0.11-0.026 c-0.037-0.008-0.072-0.02-0.11-0.023c-0.035-0.003-0.071,0.001-0.106,0.003c-0.036,0.001-0.072-0.003-0.108,0.003L18.66,3.799 c-0.314,0.05-0.577,0.266-0.686,0.565l-3.845,10.563c-0.027,0.075-0.043,0.153-0.049,0.23c0,0.005,0,0.009,0,0.014 c-0.005,0.071-0.001,0.143,0.011,0.213c0.004,0.021,0.014,0.041,0.019,0.062c0.014,0.052,0.027,0.104,0.05,0.153 c0.013,0.027,0.031,0.05,0.047,0.075c0.021,0.036,0.039,0.074,0.066,0.107c0.002,0.003,0.007,0.004,0.009,0.007 c0.004,0.005,0.006,0.011,0.011,0.016L21.312,23.8z M22.311,22.285l-5.648-6.435l8.462-1.297l5.651,6.435L22.311,22.285z M32.171,19.924l-2.026-2.306l-3.679-4.189l3.178-8.734l5.69,6.538L32.171,19.924z M19.442,5.447L28,4.096l-3.178,8.734 l-8.543,1.309L19.442,5.447z"/> </g> </svg> assets/img/icons/trash_post.svg 0000777 00000011716 15251157102 0012660 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="#6699CC" d="M48.201,23.882l-17.297-7.355c-0.446-0.188-0.959,0.018-1.147,0.463c-0.189,0.445,0.018,0.958,0.463,1.147 l17.295,7.355c0.112,0.047,0.229,0.07,0.344,0.07c0.34,0,0.664-0.2,0.806-0.533C48.854,24.585,48.646,24.071,48.201,23.882z"/> <path fill="#6699CC" d="M34.828,23.886l-5.931-2.612c-0.445-0.195-0.959,0.006-1.153,0.448c-0.195,0.442,0.006,0.958,0.448,1.153 l5.931,2.612c0.115,0.05,0.234,0.074,0.352,0.074c0.336,0,0.657-0.195,0.801-0.522C35.471,24.597,35.271,24.081,34.828,23.886z"/> <path fill="#6699CC" d="M54.087,26.923h-0.974l2.484-5.843c0.545-1.285-0.057-2.775-1.341-3.322l-2.211-0.94l1.563-5.534 c0.379-1.344-0.405-2.746-1.75-3.125l-24.201-6.84c-1.35-0.379-2.748,0.405-3.127,1.75l-3.207,11.346 c-0.021,0.075-0.016,0.149-0.017,0.224l-0.816-0.103c-1.38-0.168-2.655,0.812-2.83,2.198l-1.28,10.189h-0.976 c-1.549,0-2.809,1.26-2.809,2.809c0,0.034,0.002,0.068,0.006,0.103l4.831,40.993c0.03,1.523,1.278,2.753,2.808,2.753H49.25 c1.529,0,2.777-1.229,2.809-2.753l4.832-40.993c0.004-0.034,0.006-0.068,0.006-0.103C56.896,28.183,55.637,26.923,54.087,26.923z M53.986,20.396l-2.555,6.01c-0.072,0.171-0.07,0.348-0.035,0.517H22.179L29.4,9.941c0.169-0.397,0.63-0.584,1.028-0.415 l20.28,8.623c0.017,0.006,0.028,0.019,0.046,0.024c0.005,0.001,0.01,0,0.016,0.002l2.804,1.192 C53.971,19.537,54.156,19.999,53.986,20.396z M26.216,3.543c0.118-0.416,0.549-0.661,0.968-0.541l24.201,6.839 c0.416,0.118,0.659,0.552,0.543,0.967l-1.504,5.318l-19.311-8.21c-1.285-0.547-2.776,0.055-3.323,1.34l-2.517,5.918 c-0.063-0.023-0.12-0.054-0.188-0.063l-2.065-0.259L26.216,3.543z M19.399,16.952c0.054-0.429,0.439-0.733,0.875-0.68l4.303,0.54 l-4.037,9.495c-0.087,0.205-0.082,0.421-0.017,0.617h-2.377L19.399,16.952z M50.314,70.669c-0.004,0.034-0.006,0.067-0.006,0.103 c0,0.584-0.476,1.06-1.06,1.06H20.243c-0.583,0-1.059-0.476-1.059-1.06c0-0.033-0.002-0.067-0.006-0.103l-4.83-40.981 c0.023-0.563,0.489-1.015,1.058-1.015h38.68c0.568,0,1.034,0.451,1.059,1.015L50.314,70.669z"/> <path fill="#6699CC" d="M32.34,58.307h-4.416c-1.123,0-1.969-0.352-2.322-0.964s-0.234-1.521,0.328-2.491l0.327-0.565l1.131,0.653 l0.001-4.362l-3.779,2.18l1.131,0.653l-0.326,0.564c-0.896,1.551-1.013,3.058-0.329,4.242c0.685,1.188,2.048,1.84,3.838,1.84h4.416 c0.483,0,0.875-0.392,0.875-0.875C33.215,58.699,32.824,58.307,32.34,58.307z"/> <path fill="#6699CC" d="M39.508,46.949l-0.003-4.362l-1.13,0.653l-0.365-0.631c-0.549-0.951-1.248-1.637-2.074-2.035 c-0.927-0.45-1.947-0.451-2.874-0.004c-0.831,0.402-1.53,1.088-2.079,2.037l-2.222,3.843c-0.242,0.419-0.099,0.954,0.319,1.196 c0.138,0.078,0.289,0.117,0.437,0.117c0.302,0,0.596-0.156,0.758-0.438l2.222-3.844c0.371-0.642,0.816-1.092,1.325-1.336 c0.448-0.217,0.902-0.217,1.35,0.002c0.506,0.244,0.951,0.692,1.322,1.336l0.365,0.631l-1.131,0.654L39.508,46.949z"/> <path fill="#6699CC" d="M42.328,50.08c-0.241-0.419-0.776-0.561-1.195-0.32c-0.419,0.242-0.563,0.777-0.32,1.195l2.252,3.896 c0.562,0.971,0.682,1.879,0.328,2.49c-0.354,0.613-1.199,0.965-2.322,0.965h-0.637V57l-3.779,2.182l3.779,2.183v-1.308h0.637 c1.791,0,3.154-0.652,3.839-1.841c0.684-1.187,0.565-2.692-0.33-4.241L42.328,50.08z"/> <path fill="#6699CC" d="M26.13,63.346c-0.48,0.055-0.826,0.486-0.772,0.967l0.327,2.908c0.05,0.447,0.429,0.777,0.869,0.777 c0.033,0,0.065-0.002,0.099-0.006c0.48-0.055,0.826-0.486,0.772-0.967l-0.327-2.908C27.043,63.637,26.613,63.294,26.13,63.346z"/> <path fill="#6699CC" d="M24.216,47.162c0.032,0,0.065-0.002,0.099-0.006c0.48-0.055,0.826-0.486,0.772-0.967l-1.294-11.541 c-0.054-0.48-0.482-0.826-0.967-0.772c-0.48,0.054-0.826,0.487-0.772,0.967l1.294,11.54C23.398,46.832,23.777,47.162,24.216,47.162 z"/> <path fill="#6699CC" d="M43.361,63.348c-0.489-0.058-0.912,0.291-0.967,0.771l-0.326,2.906c-0.055,0.479,0.291,0.912,0.771,0.967 c0.033,0.004,0.066,0.006,0.1,0.006c0.438,0,0.817-0.33,0.867-0.777l0.326-2.906C44.188,63.834,43.843,63.4,43.361,63.348z"/> <path fill="#6699CC" d="M46.668,33.877c-0.486-0.053-0.913,0.292-0.967,0.772l-1.297,11.563c-0.055,0.479,0.291,0.913,0.771,0.968 c0.033,0.004,0.066,0.006,0.099,0.006c0.439,0,0.818-0.33,0.869-0.777l1.297-11.563C47.494,34.364,47.148,33.931,46.668,33.877z"/> <path fill="#6699CC" d="M34.553,63.373c-0.483,0-0.875,0.393-0.875,0.875v2.875c0,0.482,0.392,0.875,0.875,0.875 c0.483,0,0.875-0.393,0.875-0.875v-2.875C35.428,63.766,35.037,63.373,34.553,63.373z"/> <path fill="#6699CC" d="M34.553,37.435c0.483,0,0.875-0.392,0.875-0.875v-1.813c0-0.483-0.392-0.875-0.875-0.875 c-0.483,0-0.875,0.392-0.875,0.875v1.813C33.678,37.043,34.07,37.435,34.553,37.435z"/> </g> </svg> assets/img/icons/img_webp_disabled.svg 0000777 00000007011 15251157102 0014103 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve"> <circle fill="none" cx="15" cy="15.894" r="5.317"/> <path fill="#D3D9CE" d="M8.71,5.417H4.312V5.124c0-0.608,0.492-1.101,1.1-1.101h2.198c0.607,0,1.101,0.492,1.101,1.101V5.417z M29.481,8.01v15.766c0,1.217-0.984,2.201-2.199,2.201H2.719c-1.215,0-2.2-0.984-2.2-2.201V8.01c0-1.215,0.985-2.2,2.2-2.2h17.311 l0.06,0.041l-0.596,0.408c-0.273,0.188-0.392,0.539-0.288,0.85c0.096,0.296,0.368,0.5,0.733,0.519l0.722-0.021l-0.241,0.679 c-0.111,0.312-0.001,0.665,0.266,0.858c0.128,0.093,0.28,0.143,0.439,0.143c0.162,0,0.323-0.053,0.458-0.155l0.57-0.439l0.205,0.695 c0.097,0.319,0.386,0.534,0.719,0.534s0.622-0.215,0.72-0.538L24,8.691l0.574,0.442c0.13,0.098,0.291,0.152,0.454,0.152 c0.158,0,0.31-0.048,0.442-0.143c0.266-0.194,0.374-0.547,0.264-0.857l-0.241-0.68l0.752,0.021c0.336-0.012,0.605-0.212,0.701-0.514 c0.104-0.314-0.014-0.665-0.288-0.854L26.063,5.85l0.06-0.041h1.159C28.497,5.81,29.481,6.795,29.481,8.01z M20.317,15.894 c0-2.937-2.38-5.317-5.317-5.317c-2.936,0-5.316,2.381-5.316,5.317s2.381,5.317,5.316,5.317 C17.938,21.211,20.317,18.83,20.317,15.894z M26.376,6.67c0.091,0.063,0.131,0.178,0.096,0.283 c-0.033,0.105-0.121,0.168-0.244,0.173l-1.45-0.041l0.486,1.367c0.037,0.104,0.001,0.221-0.088,0.286 c-0.09,0.064-0.212,0.063-0.3-0.004L23.727,7.85l-0.41,1.392c-0.032,0.106-0.13,0.179-0.24,0.179s-0.208-0.073-0.24-0.179 l-0.41-1.392l-1.148,0.885c-0.089,0.066-0.211,0.068-0.299,0.004c-0.09-0.065-0.126-0.182-0.089-0.286l0.486-1.367l-1.451,0.041 c-0.114-0.006-0.21-0.067-0.244-0.173c-0.035-0.105,0.005-0.221,0.096-0.283l1.197-0.82l-0.06-0.041l-1.138-0.78 c-0.091-0.063-0.131-0.178-0.096-0.283c0.034-0.105,0.132-0.163,0.244-0.173l1.451,0.041L20.89,3.248 c-0.037-0.104-0.001-0.221,0.089-0.286c0.088-0.065,0.21-0.063,0.299,0.004l1.148,0.884l0.41-1.392c0.064-0.213,0.416-0.213,0.48,0 l0.41,1.392l1.149-0.885c0.088-0.068,0.21-0.069,0.3-0.004c0.089,0.065,0.125,0.182,0.088,0.286l-0.486,1.366l1.45-0.04 c0.121,0.008,0.211,0.067,0.244,0.173c0.035,0.105-0.005,0.221-0.096,0.283l-1.138,0.78l-0.06,0.041L26.376,6.67z M25.393,6.603 l-0.798-0.547c-0.067-0.046-0.108-0.124-0.108-0.206c0-0.014,0.008-0.027,0.01-0.041c0.012-0.066,0.043-0.127,0.099-0.166 l0.798-0.547l-0.967,0.027c-0.069,0.017-0.16-0.036-0.209-0.103s-0.061-0.153-0.033-0.231l0.324-0.911l-0.766,0.589 c-0.064,0.051-0.15,0.066-0.229,0.04c-0.078-0.025-0.14-0.088-0.163-0.167l-0.273-0.929l-0.273,0.929 c-0.023,0.079-0.085,0.142-0.163,0.167c-0.078,0.026-0.164,0.012-0.229-0.04L21.646,3.88l0.324,0.91 c0.027,0.078,0.016,0.164-0.033,0.231c-0.048,0.066-0.142,0.101-0.209,0.103L20.76,5.097l0.798,0.547 c0.056,0.039,0.087,0.1,0.099,0.166c0.002,0.014,0.01,0.026,0.01,0.041c0,0.083-0.041,0.16-0.108,0.206L20.76,6.603l0.968-0.027 c0.086,0,0.161,0.037,0.209,0.103c0.049,0.067,0.061,0.153,0.033,0.231l-0.324,0.91l0.765-0.589 c0.044-0.034,0.098-0.052,0.152-0.052c0.026,0,0.052,0.004,0.077,0.012c0.078,0.025,0.14,0.088,0.163,0.167l0.273,0.929l0.273-0.929 c0.023-0.079,0.085-0.142,0.163-0.167c0.079-0.024,0.165-0.011,0.229,0.04l0.766,0.589l-0.324-0.91 c-0.027-0.078-0.016-0.164,0.033-0.231c0.048-0.067,0.121-0.122,0.209-0.103L25.393,6.603z"/> </svg> assets/img/icons/auto_draft.svg 0000777 00000013031 15251157102 0012612 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="#6699CC" d="M61.821,13.089c-0.041-0.114-0.104-0.222-0.197-0.311L51.641,3.19c-0.032-0.03-0.071-0.042-0.104-0.066 c-0.054-0.039-0.103-0.08-0.166-0.104c-0.07-0.029-0.145-0.036-0.219-0.044c-0.032-0.004-0.063-0.02-0.097-0.02h-0.015 c-0.002,0-0.004,0-0.004,0H15.826c-1.506,0-2.731,1.224-2.731,2.729v63.631c0,1.505,1.225,2.729,2.731,2.729h43.351 c1.506,0,2.729-1.225,2.729-2.729V13.441C61.906,13.314,61.872,13.196,61.821,13.089z M51.899,5.776l7.105,6.823h-7.004 c-0.058,0-0.102-0.044-0.102-0.101V5.776L51.899,5.776z M60.222,69.315c0,0.576-0.47,1.045-1.045,1.045H15.826 c-0.578,0-1.046-0.469-1.046-1.045V5.684c0-0.576,0.469-1.043,1.046-1.043h34.388v7.857c0,0.985,0.801,1.786,1.785,1.786h8.221 v55.031H60.222z"/> <path fill="#6699CC" d="M42.681,38.698l-7.151-4.129c-0.261-0.15-0.582-0.15-0.843,0c-0.26,0.15-0.421,0.428-0.421,0.73v8.257 c0,0.302,0.161,0.579,0.421,0.73c0.13,0.074,0.277,0.112,0.422,0.112c0.146,0,0.291-0.038,0.422-0.112l7.152-4.13 c0.261-0.149,0.424-0.428,0.424-0.729C43.105,39.126,42.94,38.847,42.681,38.698z M35.951,42.096v-5.338l4.624,2.669L35.951,42.096 z"/> <path fill="#6699CC" d="M48.729,29.417l1.035-2.911c0.116-0.326,0.021-0.691-0.239-0.918c-0.797-0.69-1.664-1.32-2.581-1.872 c-0.297-0.179-0.672-0.157-0.947,0.054l-2.448,1.885c-0.924-0.406-1.877-0.717-2.846-0.928l-0.873-2.968 c-0.099-0.333-0.39-0.572-0.736-0.601c-0.861-0.074-2.321-0.074-3.185,0c-0.346,0.029-0.637,0.269-0.736,0.601l-0.874,2.968 c-0.969,0.21-1.923,0.521-2.846,0.928l-2.447-1.885c-0.276-0.212-0.651-0.234-0.948-0.055c-0.92,0.552-1.789,1.183-2.582,1.873 c-0.261,0.228-0.358,0.592-0.241,0.918l1.036,2.911c-0.678,0.757-1.271,1.568-1.771,2.421l-3.096-0.084 c-0.34-0.009-0.663,0.193-0.799,0.512c-0.39,0.918-0.716,1.937-0.969,3.03c-0.078,0.338,0.059,0.688,0.345,0.885l2.552,1.747 c-0.058,0.539-0.085,1.024-0.085,1.499c0,0.474,0.028,0.958,0.085,1.497l-2.552,1.748c-0.287,0.196-0.423,0.546-0.345,0.884 c0.25,1.089,0.577,2.106,0.968,3.03c0.136,0.32,0.436,0.505,0.8,0.513l3.096-0.085c0.5,0.853,1.093,1.664,1.771,2.422l-1.035,2.912 c-0.117,0.326-0.02,0.689,0.241,0.918c0.785,0.683,1.653,1.313,2.58,1.872c0.297,0.18,0.675,0.157,0.95-0.055l2.448-1.886 c0.922,0.405,1.874,0.716,2.844,0.929l0.875,2.968c0.098,0.332,0.39,0.571,0.735,0.602c0.428,0.037,0.996,0.078,1.592,0.078 c0.596,0,1.163-0.041,1.592-0.078c0.347-0.03,0.638-0.27,0.737-0.602l0.873-2.968c0.969-0.213,1.921-0.521,2.843-0.929l2.45,1.885 c0.275,0.213,0.653,0.233,0.949,0.056c0.928-0.561,1.798-1.191,2.583-1.876c0.261-0.227,0.356-0.592,0.239-0.916l-1.035-2.91 c0.677-0.758,1.271-1.569,1.771-2.422l3.098,0.085c0.394-0.011,0.663-0.192,0.798-0.513c0.393-0.926,0.719-1.945,0.969-3.03 c0.078-0.338-0.06-0.688-0.345-0.884l-2.553-1.749c0.06-0.536,0.087-1.028,0.087-1.496c0-0.476-0.027-0.962-0.086-1.499 l2.552-1.747c0.286-0.197,0.423-0.547,0.345-0.884c-0.251-1.09-0.577-2.11-0.971-3.031c-0.132-0.311-0.437-0.512-0.775-0.512 c-0.008,0-0.015,0-0.022,0l-3.098,0.084C49.998,30.983,49.404,30.172,48.729,29.417z M53.587,35.12l-2.494,1.708 c-0.263,0.18-0.4,0.493-0.358,0.809c0.092,0.676,0.135,1.243,0.135,1.791c0,0.545-0.043,1.114-0.135,1.787 c-0.042,0.316,0.096,0.629,0.358,0.81l2.494,1.708c-0.152,0.583-0.33,1.141-0.528,1.667l-3.019-0.084 c-0.352-0.007-0.612,0.163-0.765,0.443c-0.559,1.035-1.271,2.011-2.118,2.896c-0.221,0.229-0.292,0.564-0.184,0.864l1.01,2.841 c-0.448,0.361-0.926,0.708-1.425,1.03l-2.39-1.839c-0.25-0.193-0.591-0.229-0.878-0.091c-1.092,0.525-2.236,0.899-3.402,1.106 c-0.314,0.059-0.57,0.287-0.66,0.593l-0.852,2.899c-0.55,0.034-1.203,0.034-1.752,0l-0.854-2.899 c-0.091-0.306-0.345-0.535-0.66-0.593c-1.167-0.207-2.312-0.581-3.403-1.106c-0.287-0.14-0.626-0.103-0.879,0.091l-2.388,1.84 c-0.497-0.322-0.974-0.668-1.424-1.03l1.01-2.842c0.107-0.301,0.036-0.635-0.185-0.864c-0.849-0.887-1.562-1.862-2.119-2.896 c-0.152-0.281-0.438-0.45-0.766-0.444l-3.018,0.084c-0.199-0.526-0.375-1.083-0.528-1.667l2.493-1.706 c0.263-0.18,0.402-0.492,0.359-0.809c-0.092-0.68-0.135-1.25-0.135-1.79c0-0.544,0.042-1.111,0.135-1.791 c0.042-0.316-0.097-0.628-0.359-0.808l-2.493-1.707c0.154-0.586,0.33-1.145,0.528-1.667l3.019,0.083 c0.316,0.025,0.613-0.161,0.765-0.442c0.558-1.035,1.271-2.009,2.12-2.896c0.22-0.229,0.292-0.564,0.185-0.865l-1.011-2.84 c0.452-0.364,0.928-0.709,1.423-1.03l2.388,1.838c0.253,0.194,0.593,0.229,0.879,0.091c1.093-0.526,2.239-0.9,3.404-1.108 c0.314-0.057,0.569-0.285,0.66-0.591l0.854-2.898c0.551-0.035,1.199-0.035,1.752,0l0.852,2.898c0.092,0.306,0.345,0.535,0.66,0.591 c1.165,0.208,2.311,0.582,3.405,1.108c0.285,0.138,0.625,0.102,0.879-0.091l2.387-1.838c0.494,0.321,0.971,0.666,1.423,1.031 l-1.01,2.84c-0.108,0.301-0.036,0.636,0.184,0.864c0.845,0.882,1.558,1.857,2.12,2.896c0.146,0.274,0.43,0.442,0.741,0.442 c0.007,0,0.014,0,0.021,0l3.02-0.083C53.257,33.978,53.435,34.536,53.587,35.12z"/> <path fill="#6699CC" d="M37.5,29.626c-5.404,0-9.801,4.396-9.801,9.799c0,5.402,4.397,9.803,9.801,9.803s9.8-4.398,9.8-9.803 C47.3,34.022,42.904,29.626,37.5,29.626z M37.5,47.543c-4.475,0-8.116-3.641-8.116-8.117c0-4.475,3.642-8.114,8.116-8.114 c4.474,0,8.114,3.639,8.114,8.114S41.974,47.543,37.5,47.543z"/> </g> </svg> assets/img/icons/expired_transient.svg 0000777 00000007250 15251157102 0014217 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="#6699CC" d="M62.406,13.464c-0.043-0.11-0.104-0.216-0.195-0.303L52.215,3.56c-0.026-0.026-0.062-0.038-0.092-0.059 c-0.057-0.041-0.109-0.085-0.177-0.111c-0.064-0.026-0.136-0.032-0.204-0.042c-0.035-0.004-0.067-0.021-0.104-0.021h-0.017H51.62 H15.233c-1.502,0-2.724,1.222-2.724,2.723v63.723c0,1.501,1.222,2.723,2.724,2.723h44.535c1.501,0,2.723-1.222,2.723-2.723V13.818 C62.491,13.69,62.458,13.573,62.406,13.464z M52.471,6.117l7.151,6.868h-7.041c-0.062,0-0.11-0.049-0.11-0.112V6.117z M60.825,69.773c0,0.582-0.475,1.056-1.057,1.056H15.233c-0.583,0-1.057-0.474-1.057-1.056V6.05c0-0.583,0.474-1.057,1.057-1.057 h35.571v7.879c0,0.98,0.798,1.778,1.776,1.778h8.244V69.773z"/> <path fill="#6699CC" d="M48.729,51.256c0-0.625-0.237-1.467-1.205-2.305c-1.33-2.633-2.331-4.074-4.078-6.423 c-0.821-1.105-1.484-1.938-2.035-2.611c0.551-0.672,1.21-1.505,2.035-2.613c2.146-2.881,3.215-4.476,5.181-8.708 c0.103-0.222,0.098-0.472,0.002-0.686c0-0.006,0.002-0.012,0.002-0.018c0-3.198-9.991-3.292-11.13-3.292 s-11.129,0.092-11.129,3.292c0,0.004,0.001,0.008,0.001,0.011c-0.097,0.217-0.103,0.468,0,0.691 c1.964,4.232,3.034,5.828,5.178,8.709c0.819,1.102,1.481,1.935,2.037,2.611c-0.553,0.675-1.215,1.51-2.037,2.612 c-1.747,2.35-2.747,3.791-4.079,6.427c-0.961,0.834-1.202,1.675-1.202,2.301c0,0.1,0.022,0.193,0.034,0.291 c-0.004,0.089,0.006,0.177,0.03,0.261c0.628,2.83,6.047,4.35,11.167,4.35c5.116,0,10.532-1.518,11.165-4.345 c0.026-0.091,0.039-0.184,0.033-0.279C48.709,51.44,48.729,51.351,48.729,51.256z M41.804,49.128 c-1.129,1.13-2.541,1.291-4.304,1.291s-3.12-0.108-4.303-1.291c0.818-1.763,1.247-2.388,2.112-3.55 c0.865-1.164,1.309-1.616,2.19-2.693c0.88,1.077,1.325,1.529,2.189,2.693C40.555,46.742,40.983,47.366,41.804,49.128z M32.099,50.228c1.612,1.611,3.474,1.746,5.401,1.746c1.769,0,3.79-0.135,5.4-1.746c0.395-0.395,0.524-0.96,0.387-1.486 c0.854,0.238,1.614,0.524,2.225,0.852c0.263,0.142,0.489,0.289,0.69,0.438c0.21,0.421,0.428,0.87,0.66,1.365 c-2.329,2.055-5.235,2.472-9.362,2.472c-3.839,0-6.8-0.185-9.363-2.47c0.233-0.497,0.452-0.946,0.663-1.37 c0.21-0.155,0.453-0.31,0.732-0.456c0,0,0-0.001,0.001-0.001s0,0,0,0c0.6-0.316,1.345-0.594,2.18-0.827 C31.576,49.268,31.706,49.833,32.099,50.228z M46.795,27.78c-3.325,1.332-5.402,1.703-9.295,1.703c-3.892,0-5.968-0.37-9.293-1.702 c0.833-0.623,4.14-1.513,9.294-1.513C42.653,26.267,45.96,27.156,46.795,27.78z M32.887,43.522c1.029-1.38,1.801-2.328,2.421-3.073 c0.257-0.31,0.257-0.758,0-1.066c-0.622-0.747-1.396-1.698-2.421-3.074c-1.672-2.246-2.638-3.645-3.91-6.153 c3.044,0.983,7.762,1.026,8.523,1.026s5.476-0.043,8.52-1.025c-1.271,2.509-2.238,3.907-3.911,6.153 c-1.033,1.388-1.803,2.333-2.42,3.073c-0.257,0.309-0.257,0.757,0,1.066c0.619,0.741,1.391,1.688,2.42,3.073 c1.122,1.507,1.924,2.636,2.714,3.963c-0.712-0.258-1.497-0.481-2.347-0.656l0,0h-0.004c-0.002,0-0.002-0.001-0.004-0.001 c0,0,0,0-0.001,0l-0.093-0.02c-0.437-0.782-0.845-1.358-1.438-2.157c-0.606-0.814-1.013-1.292-1.482-1.849 c-0.225-0.266-0.465-0.548-0.753-0.901c-0.589-0.72-1.814-0.72-2.405,0c-0.289,0.354-0.53,0.64-0.754,0.903 c-0.469,0.557-0.874,1.034-1.479,1.847c-0.595,0.801-1.002,1.375-1.438,2.157c-0.89,0.179-1.711,0.409-2.452,0.679 C30.963,46.158,31.766,45.031,32.887,43.522z"/> </g> </svg> assets/img/icons/img_optm_disabled.svg 0000777 00000013002 15251157102 0014122 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve"> <path fill="#CED1D9" d="M17.181,20.485H2.421l12.867-8.158l3.352,3.626l0.637,0.018c0.034-0.048,0.069-0.097,0.105-0.144 l-0.293-0.826c-0.12-0.34-0.023-0.713,0.248-0.951c0.308-0.27,0.642-0.512,0.99-0.72c0.137-0.081,0.291-0.123,0.448-0.123 c0.191,0,0.381,0.064,0.532,0.18l0.694,0.534c0.058-0.02,0.115-0.039,0.173-0.057l0.248-0.84c0.102-0.346,0.399-0.591,0.759-0.624 c0.146-0.014,0.298-0.017,0.448-0.021V6.147H1.62V21.29h15.78c-0.071-0.215-0.155-0.416-0.207-0.647 C17.181,20.59,17.183,20.538,17.181,20.485z M10.705,8.189c0.956,0,1.731,0.775,1.731,1.731c0,0.956-0.775,1.73-1.731,1.73 c-0.956,0-1.731-0.774-1.731-1.73C8.974,8.964,9.75,8.189,10.705,8.189z M2.368,9.563l7.593,5.435l-7.593,4.729V9.563z M23.63,17.247v3.792c-0.466-0.04-0.886-0.239-1.196-0.554h0.395l-0.911-0.986c-0.021-0.115-0.036-0.233-0.036-0.355 C21.881,18.145,22.653,17.332,23.63,17.247z M24.298,20.979v-3.673c0.335,0.092,0.634,0.268,0.869,0.511v2.652 C24.932,20.712,24.633,20.888,24.298,20.979z M19.383,22.458l-0.163,0.458H0.083V4.582h25.084v8.451l-0.003-0.008 c-0.102-0.346-0.399-0.591-0.759-0.625c-0.035-0.003-0.071-0.002-0.107-0.005V5.451H0.952v16.596h16.776 c0.163,0.176,0.397,0.286,0.666,0.291l0.883-0.024C19.311,22.362,19.346,22.41,19.383,22.458z M23.794,25.418 c-0.191,0-0.378-0.012-0.563-0.027c-0.154-0.014-0.284-0.119-0.328-0.268l-0.326-1.106c-0.224-0.058-0.444-0.13-0.659-0.217 l-0.913,0.702c-0.122,0.094-0.29,0.104-0.422,0.024c-0.326-0.195-0.634-0.419-0.916-0.666c-0.115-0.102-0.157-0.263-0.106-0.408 l0.387-1.088c-0.149-0.179-0.286-0.365-0.408-0.559l-1.158,0.032c-0.149-0.003-0.294-0.086-0.354-0.227 c-0.143-0.331-0.259-0.694-0.346-1.078c-0.033-0.149,0.027-0.305,0.154-0.392l0.95-0.65c-0.009-0.115-0.014-0.231-0.014-0.349 s0.005-0.232,0.014-0.348l-0.95-0.65c-0.127-0.087-0.188-0.242-0.154-0.393c0.087-0.382,0.203-0.745,0.346-1.078 c0.061-0.143,0.19-0.232,0.354-0.228l1.158,0.032c0.122-0.193,0.259-0.38,0.408-0.557l-0.387-1.088 c-0.051-0.145-0.009-0.306,0.106-0.408c0.285-0.25,0.594-0.474,0.917-0.666c0.133-0.078,0.299-0.068,0.421,0.025l0.913,0.702 c0.219-0.088,0.439-0.161,0.659-0.216l0.326-1.105c0.043-0.147,0.172-0.253,0.325-0.268c0.371-0.035,0.758-0.035,1.132,0 c0.153,0.014,0.282,0.12,0.325,0.268l0.326,1.104c0.22,0.056,0.44,0.128,0.659,0.217l0.914-0.702 c0.121-0.094,0.288-0.104,0.421-0.024c0.325,0.194,0.633,0.418,0.916,0.666c0.116,0.101,0.158,0.263,0.106,0.408l-0.387,1.088 c0.149,0.177,0.286,0.363,0.408,0.557l1.158-0.032c0.137-0.004,0.294,0.085,0.354,0.228c0.144,0.334,0.26,0.696,0.347,1.078 c0.034,0.149-0.027,0.306-0.154,0.393l-0.95,0.65c0.009,0.115,0.013,0.23,0.013,0.348s-0.004,0.233-0.013,0.349l0.95,0.65 c0.127,0.087,0.188,0.242,0.154,0.393c-0.087,0.383-0.203,0.745-0.347,1.077c-0.062,0.141-0.214,0.228-0.354,0.227l-1.158-0.032 c-0.121,0.193-0.258,0.38-0.408,0.559l0.387,1.088c0.052,0.146,0.01,0.307-0.106,0.408c-0.283,0.248-0.592,0.472-0.916,0.666 c-0.132,0.08-0.299,0.07-0.421-0.024L25.67,23.8c-0.215,0.087-0.436,0.159-0.659,0.217l-0.326,1.106 c-0.044,0.148-0.174,0.254-0.328,0.268C24.171,25.406,23.983,25.418,23.794,25.418z M23.548,24.661c0.162,0.008,0.328,0.008,0.491,0 l0.314-1.067c0.039-0.133,0.148-0.232,0.284-0.261c0.317-0.065,0.631-0.169,0.93-0.306c0.125-0.061,0.273-0.043,0.385,0.044 l0.882,0.677c0.137-0.091,0.271-0.188,0.399-0.29l-0.374-1.05c-0.046-0.132-0.017-0.277,0.078-0.38 c0.225-0.245,0.419-0.51,0.576-0.788c0.068-0.121,0.191-0.206,0.337-0.19l1.115,0.031c0.056-0.15,0.105-0.306,0.149-0.468 l-0.919-0.629c-0.115-0.079-0.177-0.216-0.16-0.355c0.02-0.159,0.03-0.321,0.03-0.486s-0.011-0.326-0.03-0.485 c-0.017-0.139,0.045-0.276,0.16-0.355l0.919-0.629c-0.044-0.162-0.094-0.318-0.149-0.47l-1.115,0.031 c-0.143-0.006-0.268-0.069-0.337-0.189c-0.158-0.279-0.352-0.544-0.576-0.787c-0.095-0.102-0.124-0.248-0.078-0.38l0.374-1.049 c-0.129-0.103-0.262-0.199-0.399-0.29l-0.882,0.677c-0.11,0.084-0.258,0.101-0.383,0.044c-0.309-0.14-0.622-0.242-0.931-0.305 c-0.136-0.028-0.246-0.128-0.285-0.262l-0.314-1.067c-0.164-0.009-0.328-0.008-0.491,0l-0.314,1.067 c-0.039,0.133-0.149,0.234-0.285,0.262c-0.309,0.063-0.622,0.165-0.931,0.305c-0.128,0.055-0.274,0.04-0.384-0.044l-0.881-0.677 c-0.137,0.09-0.271,0.188-0.398,0.29l0.373,1.05c0.046,0.132,0.017,0.277-0.078,0.38c-0.224,0.243-0.418,0.508-0.577,0.787 c-0.067,0.12-0.204,0.18-0.336,0.189l-1.115-0.031c-0.056,0.15-0.105,0.308-0.148,0.47l0.918,0.629 c0.115,0.079,0.178,0.216,0.16,0.354c-0.019,0.159-0.03,0.321-0.03,0.486s0.012,0.327,0.031,0.487 c0.017,0.139-0.046,0.275-0.161,0.354l-0.919,0.629c0.044,0.162,0.094,0.318,0.149,0.468l1.115-0.031 c0.135-0.012,0.269,0.069,0.337,0.189c0.158,0.279,0.352,0.544,0.577,0.789c0.094,0.103,0.123,0.249,0.077,0.38l-0.373,1.05 c0.128,0.102,0.262,0.199,0.399,0.29l0.88-0.677c0.11-0.085,0.259-0.103,0.385-0.044c0.3,0.137,0.613,0.24,0.932,0.306 c0.135,0.028,0.244,0.128,0.283,0.261L23.548,24.661z M23.794,22.306c-1.744,0-3.163-1.419-3.163-3.162 c0-1.744,1.419-3.163,3.163-3.163c1.743,0,3.162,1.419,3.162,3.163C26.956,20.887,25.537,22.306,23.794,22.306z M23.794,16.73 c-1.33,0-2.413,1.082-2.413,2.413c0,1.33,1.083,2.412,2.413,2.412s2.412-1.082,2.412-2.412C26.206,17.813,25.124,16.73,23.794,16.73 z"/> </svg> assets/img/icons/purge-pages.svg 0000777 00000007664 15251157102 0012720 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="#6699CC" d="M47.423,47.475c-6.108,0-11.078,4.971-11.078,11.08c0,6.107,4.969,11.077,11.078,11.077 c6.109,0,11.079-4.97,11.079-11.077C58.502,52.443,53.532,47.475,47.423,47.475z M47.423,67.882c-5.144,0-9.327-4.185-9.327-9.327 c0-5.146,4.184-9.33,9.327-9.33c5.146,0,9.329,4.186,9.329,9.33C56.752,63.697,52.566,67.882,47.423,67.882z"/> <path fill="#6699CC" d="M52.827,53.148c-0.343-0.342-0.896-0.342-1.238,0l-4.165,4.166l-4.165-4.166 c-0.342-0.342-0.896-0.342-1.237,0c-0.342,0.343-0.342,0.896,0,1.238l4.164,4.165l-4.164,4.165c-0.342,0.342-0.342,0.896,0,1.238 c0.17,0.171,0.396,0.256,0.619,0.256c0.223,0,0.447-0.085,0.618-0.256l4.165-4.165l4.165,4.165 c0.171,0.171,0.396,0.256,0.619,0.256s0.448-0.085,0.619-0.256c0.341-0.342,0.341-0.896,0-1.238l-4.165-4.165l4.165-4.165 C53.168,54.046,53.168,53.491,52.827,53.148z"/> <path fill="#6699CC" d="M64.166,21.332c-0.045-0.116-0.109-0.225-0.205-0.316l-8.912-8.56c-0.029-0.028-0.066-0.04-0.1-0.063 c-0.059-0.042-0.113-0.087-0.182-0.115c-0.072-0.029-0.147-0.036-0.225-0.045c-0.035-0.004-0.064-0.021-0.102-0.021h-0.018 c-0.001,0-0.002,0-0.003,0h-2.938c-0.023-0.032-0.037-0.07-0.067-0.099l-5.149-4.946c-0.031-0.031-0.072-0.044-0.107-0.069 c-0.057-0.04-0.107-0.083-0.172-0.109c-0.071-0.029-0.146-0.036-0.223-0.045c-0.035-0.004-0.066-0.021-0.104-0.021h-0.018 c0,0,0,0-0.002,0h-2.832c-0.045-0.119-0.108-0.232-0.207-0.326L36.901,1.12c0,0-0.001,0-0.001-0.001l-0.012-0.012 c-0.027-0.026-0.061-0.036-0.09-0.057c-0.061-0.046-0.12-0.093-0.191-0.122c-0.064-0.026-0.132-0.03-0.2-0.04 c-0.042-0.006-0.081-0.025-0.125-0.025H10.139c-1.364,0-2.474,1.11-2.474,2.474V57.23c0,1.362,1.11,2.473,2.474,2.473h3.38 c0.139,0,0.266-0.039,0.383-0.098v4.953c0,1.385,1.126,2.51,2.51,2.51h4.018v4.509c0,1.411,1.148,2.56,2.56,2.56h38.701 c1.41,0,2.559-1.147,2.559-2.56V21.695C64.25,21.564,64.217,21.443,64.166,21.332z M55.316,15.14l5.924,5.689l-5.924,0.023V15.14z M46.536,9.852l2.457,2.36h-2.457V9.852z M37.157,3.792l3.26,3.131h-3.26V3.792z M13.902,9.432v48.619 c-0.117-0.059-0.244-0.098-0.383-0.098h-3.38c-0.399,0-0.724-0.324-0.724-0.723V3.337c0-0.399,0.325-0.724,0.724-0.724h25.268v4.31 H16.413C15.028,6.923,13.902,8.048,13.902,9.432z M16.413,65.318c-0.419,0-0.76-0.34-0.76-0.76V9.432 c0-0.418,0.341-0.759,0.76-0.759h28.374v3.539H22.99c-1.411,0-2.56,1.148-2.56,2.56V65.32h-4.017V65.318z M62.5,71.577 c0,0.446-0.361,0.81-0.809,0.81H22.99c-0.446,0-0.81-0.363-0.81-0.81V14.771c0-0.446,0.363-0.81,0.81-0.81h30.576v6.891 c0,0.947,0.771,1.718,1.718,1.718H62.5V71.577z"/> <path fill="#6699CC" d="M27.498,28.501h26.625c0.482,0,0.875-0.392,0.875-0.875s-0.393-0.875-0.875-0.875H27.498 c-0.483,0-0.875,0.392-0.875,0.875S27.015,28.501,27.498,28.501z"/> <path fill="#6699CC" d="M27.498,36.757h26.625c0.482,0,0.875-0.392,0.875-0.875c0-0.483-0.393-0.875-0.875-0.875H27.498 c-0.483,0-0.875,0.392-0.875,0.875C26.623,36.365,27.015,36.757,27.498,36.757z"/> <path fill="#6699CC" d="M27.498,45.014h26.625c0.482,0,0.875-0.393,0.875-0.875c0-0.484-0.393-0.875-0.875-0.875H27.498 c-0.483,0-0.875,0.391-0.875,0.875C26.623,44.621,27.015,45.014,27.498,45.014z"/> <path fill="#6699CC" d="M32.999,51.52h-5.501c-0.483,0-0.875,0.393-0.875,0.875c0,0.483,0.392,0.875,0.875,0.875h5.501 c0.483,0,0.875-0.392,0.875-0.875C33.874,51.912,33.482,51.52,32.999,51.52z"/> <path fill="#6699CC" d="M31.124,59.775h-3.626c-0.483,0-0.875,0.392-0.875,0.875c0,0.482,0.392,0.875,0.875,0.875h3.626 c0.483,0,0.875-0.393,0.875-0.875C31.999,60.167,31.607,59.775,31.124,59.775z"/> </g> </svg> assets/img/icons/purge-opcache.svg 0000777 00000010564 15251157102 0013214 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="none" stroke="#21A0DF" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d=" M52.641,66.489"/> </g> <g> <path fill="none" stroke="#21A0DF" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d=" M57.921,65.491"/> </g> <g> <g> <path fill="none" stroke="#21A0DF" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d=" M53.936,70.87c0,1.066-0.863,1.934-1.934,1.934H22.996c-1.067,0-1.934-0.867-1.934-1.934l-4.836-41.04 c0-1.068,0.865-1.934,1.934-1.934h38.68c1.066,0,1.934,0.865,1.934,1.934L53.936,70.87z"/> <g> <line fill="none" stroke="#21A0DF" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="28.981" y1="64.313" x2="29.308" y2="67.222"/> <line fill="none" stroke="#21A0DF" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="25.676" y1="34.846" x2="26.435" y2="41.617"/> <line fill="none" stroke="#21A0DF" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="46.018" y1="64.315" x2="45.691" y2="67.222"/> <line fill="none" stroke="#21A0DF" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="49.322" y1="34.846" x2="48.59" y2="41.371"/> <line fill="none" stroke="#21A0DF" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="37.306" y1="65.769" x2="37.306" y2="67.222"/> <line fill="none" stroke="#21A0DF" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="37.306" y1="34.846" x2="37.306" y2="36.875"/> </g> </g> </g> <g> <circle fill="none" stroke="#21A0DF" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="37.5" cy="51.575" r="10.203"/> <g> <line fill="none" stroke="#21A0DF" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="32.717" y1="46.79" x2="42.285" y2="56.358"/> <line fill="none" stroke="#21A0DF" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="32.717" y1="56.358" x2="42.285" y2="46.79"/> </g> </g> <g> <g> <path fill="#21A0DF" stroke="#21A0DF" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M30.396,27.369 l-3.276-7.024l2.402-1.121c2.317-1.08,3.895-0.719,4.733,1.081c0.438,0.939,0.455,1.809,0.05,2.612 c-0.405,0.803-1.203,1.481-2.396,2.039l-1.089,0.508l0.857,1.838 M30.39,24.54l0.97-0.453c0.955-0.445,1.573-0.922,1.857-1.429 c0.282-0.508,0.265-1.101-0.052-1.781c-0.286-0.613-0.699-0.976-1.24-1.089c-0.543-0.112-1.237,0.029-2.086,0.425l-1.204,0.562 L30.39,24.54z"/> <path fill="#21A0DF" stroke="#21A0DF" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M46.293,22.687 l-1.076,0.502l-2.033-4.36l-4.883,2.276l2.034,4.361l-1.078,0.501L34.936,16.7l1.078-0.502l1.839,3.943l4.88-2.276l-1.838-3.943 l1.076-0.501L46.293,22.687z"/> <path fill="#21A0DF" stroke="#21A0DF" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M51.648,12.196 c0.436,0.938,0.454,1.808,0.049,2.611c-0.406,0.804-1.203,1.483-2.395,2.039l-1.09,0.509L49.911,21l-1.076,0.502l-4.322-9.266 l2.401-1.121C49.23,10.036,50.809,10.396,51.648,12.196z M47.781,16.43l0.969-0.453c0.954-0.445,1.574-0.921,1.857-1.429 c0.281-0.506,0.266-1.101-0.053-1.781c-0.285-0.612-0.698-0.976-1.239-1.088c-0.542-0.112-1.237,0.029-2.087,0.425l-1.203,0.56 L47.781,16.43z"/> </g> <path fill="none" stroke="#21A0DF" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d=" M20.102,27.406c-0.618-4.872,5.762-11.804,15.299-16.251c10.491-4.893,20.834-4.923,23.098-0.07 c2.069,4.442-3.342,11.436-12.312,16.34"/> </g> </svg> assets/img/icons/empty-cache.svg 0000777 00000014224 15251157102 0012666 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="#6699CC" d="M61.125,33.733h-1.583V11.637c0-0.003-0.002-0.007-0.002-0.01c-0.001-0.077-0.024-0.151-0.046-0.227 c-0.01-0.035-0.01-0.074-0.023-0.107c-0.01-0.023-0.029-0.04-0.041-0.062c-0.043-0.079-0.089-0.156-0.152-0.219 c-0.002-0.002-0.004-0.005-0.006-0.007L50.12,2.247h-0.001l-0.014-0.013c-0.028-0.027-0.065-0.039-0.098-0.061 c-0.059-0.043-0.113-0.089-0.183-0.116s-0.14-0.033-0.212-0.042C49.575,2.008,49.541,1.99,49.5,1.99H18.478 c-1.585,0-2.875,1.29-2.875,2.875v28.868h-1.478c-1.585,0-2.875,1.29-2.875,2.875v6.028c0,1.585,1.29,2.875,2.875,2.875h1.876 c0.037,0,0.067-0.017,0.103-0.021c0.081,3.687-0.345,7.248-0.771,10.725c-0.626,5.098-1.273,10.367-0.339,16.061 c0.07,0.43,0.441,0.733,0.862,0.733c0.047,0,0.095-0.004,0.143-0.012c0.477-0.078,0.8-0.528,0.722-1.005 c-0.894-5.446-0.262-10.59,0.349-15.563c0.621-5.06,1.259-10.289,0.356-15.933h1.765c-0.001,0.053-0.014,0.103-0.005,0.155 c0.893,5.445,0.261,10.588-0.35,15.562c-0.626,5.097-1.274,10.367-0.338,16.062c0.07,0.43,0.441,0.733,0.862,0.733 c0.047,0,0.095-0.004,0.143-0.012c0.477-0.078,0.8-0.528,0.722-1.005c-0.895-5.446-0.262-10.592,0.349-15.565 c0.621-5.058,1.26-10.286,0.356-15.93h1.767c-0.001,0.053-0.015,0.103-0.006,0.155c0.893,5.447,0.261,10.591-0.35,15.563 c-0.626,5.097-1.273,10.366-0.34,16.06c0.07,0.429,0.441,0.732,0.862,0.732c0.047,0,0.095-0.004,0.143-0.012 c0.477-0.078,0.8-0.528,0.722-1.005c-0.893-5.445-0.261-10.589,0.351-15.562c0.621-5.06,1.26-10.289,0.356-15.935h1.764 c-0.001,0.053-0.015,0.103-0.006,0.155c0.893,5.445,0.261,10.589-0.35,15.563c-0.626,5.098-1.273,10.367-0.339,16.061 c0.07,0.43,0.441,0.733,0.862,0.733c0.047,0,0.095-0.004,0.143-0.012c0.477-0.078,0.8-0.528,0.722-1.005 c-0.894-5.446-0.262-10.59,0.349-15.563c0.621-5.059,1.259-10.288,0.356-15.932H29.7c-0.001,0.053-0.015,0.103-0.006,0.155 c0.891,5.443,0.259,10.586-0.351,15.559c-0.626,5.1-1.274,10.37-0.339,16.064c0.07,0.429,0.441,0.732,0.862,0.732 c0.047,0,0.095-0.004,0.143-0.012c0.477-0.078,0.8-0.528,0.722-1.005c-0.894-5.447-0.262-10.593,0.35-15.567 c0.621-5.057,1.259-10.285,0.357-15.928h1.764c-0.001,0.053-0.015,0.104-0.006,0.156c0.894,5.445,0.262,10.59-0.349,15.563 c-0.626,5.098-1.274,10.366-0.339,16.059c0.07,0.43,0.441,0.733,0.862,0.733c0.047,0,0.095-0.004,0.143-0.012 c0.477-0.078,0.8-0.528,0.722-1.005c-0.894-5.445-0.262-10.588,0.35-15.563c0.622-5.059,1.26-10.289,0.355-15.934h1.766 c-0.001,0.053-0.015,0.104-0.006,0.156c0.893,5.444,0.261,10.59-0.35,15.563c-0.626,5.097-1.273,10.365-0.34,16.058 c0.07,0.43,0.441,0.733,0.862,0.733c0.047,0,0.095-0.004,0.143-0.012c0.477-0.078,0.8-0.528,0.722-1.005 c-0.892-5.444-0.261-10.588,0.35-15.563c0.621-5.059,1.259-10.289,0.356-15.934h1.767c-0.001,0.053-0.015,0.103-0.006,0.156 c0.892,5.443,0.26,10.588-0.351,15.562c-0.625,5.099-1.271,10.368-0.34,16.062c0.07,0.429,0.441,0.732,0.862,0.732 c0.047,0,0.095-0.004,0.144-0.012c0.477-0.078,0.799-0.527,0.722-1.006c-0.892-5.444-0.261-10.588,0.35-15.563 c0.62-5.058,1.259-10.288,0.356-15.931h1.765c-0.001,0.053-0.015,0.103-0.006,0.156c0.894,5.444,0.262,10.59-0.349,15.564 c-0.625,5.096-1.271,10.365-0.34,16.057c0.07,0.43,0.441,0.733,0.862,0.733c0.047,0,0.095-0.004,0.144-0.012 c0.477-0.078,0.799-0.527,0.722-1.005c-0.892-5.443-0.261-10.588,0.351-15.562c0.619-5.06,1.258-10.29,0.354-15.935h1.765 c-0.001,0.053-0.015,0.103-0.006,0.156c0.894,5.445,0.263,10.592-0.349,15.567c-0.625,5.097-1.271,10.363-0.342,16.054 c0.07,0.43,0.441,0.733,0.862,0.733c0.047,0,0.095-0.004,0.144-0.013c0.477-0.077,0.799-0.526,0.722-1.004 c-0.89-5.442-0.259-10.584,0.351-15.558c0.621-5.061,1.26-10.293,0.355-15.938h1.768c-0.001,0.054-0.015,0.104-0.006,0.156 c0.891,5.445,0.26,10.59-0.352,15.565c-0.625,5.097-1.271,10.365-0.34,16.058c0.069,0.428,0.44,0.732,0.861,0.732 c0.047,0,0.096-0.004,0.143-0.012c0.478-0.078,0.801-0.527,0.723-1.006c-0.891-5.442-0.26-10.586,0.352-15.561 c0.621-5.061,1.258-10.29,0.356-15.936h1.769c-0.002,0.053-0.016,0.103-0.007,0.156c0.89,5.442,0.259,10.586-0.352,15.56 c-0.626,5.099-1.272,10.37-0.341,16.063c0.07,0.428,0.441,0.732,0.863,0.732c0.047,0,0.094-0.004,0.143-0.012 c0.477-0.078,0.8-0.527,0.722-1.006c-0.892-5.444-0.261-10.59,0.351-15.566c0.619-5.057,1.258-10.287,0.357-15.928h1.764 c0,0.052-0.015,0.102-0.006,0.154c0.889,5.443,0.258,10.586-0.352,15.561c-0.626,5.099-1.271,10.369-0.34,16.063 c0.07,0.43,0.44,0.733,0.861,0.733c0.047,0,0.096-0.004,0.144-0.013c0.477-0.078,0.8-0.526,0.722-1.004 c-0.893-5.445-0.261-10.592,0.35-15.567c0.434-3.524,0.863-7.14,0.787-10.914h1.236c1.585,0,2.875-1.29,2.875-2.875v-6.028 C64,35.023,62.71,33.733,61.125,33.733z M50.375,4.913l6.111,5.849H51.5c-0.62,0-1.125-0.505-1.125-1.125V4.913z M17.353,4.865 c0-0.62,0.505-1.125,1.125-1.125h30.147v5.896c0,1.585,1.29,2.875,2.875,2.875h6.292v21.222H17.353V4.865z M62.25,42.637 c0,0.62-0.505,1.125-1.125,1.125h-1.313c-0.07-1.085-0.179-2.181-0.356-3.296c0.403-0.077,0.715-0.416,0.715-0.843 c0-0.482-0.392-0.875-0.875-0.875H15.139c-0.483,0-0.875,0.393-0.875,0.875s0.392,0.875,0.875,0.875h0.548 c-0.001,0.053-0.015,0.104-0.006,0.156c0.172,1.05,0.273,2.084,0.343,3.111c-0.008,0-0.015-0.005-0.023-0.005h-1.876 c-0.62,0-1.125-0.505-1.125-1.125v-6.028c0-0.62,0.505-1.125,1.125-1.125h47c0.62,0,1.125,0.505,1.125,1.125V42.637z"/> <path fill="#6699CC" d="M21.625,17.888H52.25c0.482,0,0.875-0.392,0.875-0.875s-0.393-0.875-0.875-0.875H21.625 c-0.483,0-0.875,0.392-0.875,0.875S21.142,17.888,21.625,17.888z"/> <path fill="#6699CC" d="M52.25,29.148H21.625c-0.483,0-0.875,0.392-0.875,0.875s0.392,0.875,0.875,0.875H52.25 c0.482,0,0.875-0.392,0.875-0.875S52.732,29.148,52.25,29.148z"/> <path fill="#6699CC" d="M52.25,22.644H21.625c-0.483,0-0.875,0.392-0.875,0.875s0.392,0.875,0.875,0.875H52.25 c0.482,0,0.875-0.392,0.875-0.875S52.732,22.644,52.25,22.644z"/> </g> </svg> assets/img/icons/all_transients.svg 0000777 00000006441 15251157102 0013513 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="#6699CC" d="M65.485,21.85c-0.045-0.113-0.106-0.219-0.2-0.308l-8.679-8.336c-0.027-0.026-0.063-0.038-0.096-0.059 c-0.057-0.043-0.112-0.088-0.18-0.115c-0.068-0.028-0.138-0.033-0.21-0.042c-0.036-0.005-0.068-0.021-0.106-0.021h-0.017h-0.002 h-2.861c-0.022-0.031-0.037-0.068-0.066-0.096l-5.014-4.817c-0.03-0.029-0.069-0.041-0.103-0.065 c-0.056-0.04-0.106-0.082-0.171-0.108c-0.069-0.028-0.142-0.034-0.214-0.043c-0.035-0.004-0.066-0.021-0.104-0.021h-0.017 c-0.001,0-0.001,0-0.002,0h-2.758c-0.045-0.116-0.107-0.226-0.202-0.317l-5.566-5.346c-0.027-0.028-0.063-0.039-0.095-0.062 c-0.059-0.042-0.112-0.086-0.178-0.113c-0.071-0.029-0.146-0.036-0.222-0.045c-0.032-0.004-0.063-0.02-0.097-0.02h-0.016 c0,0-0.002,0-0.004,0H12.87c-1.328,0-2.409,1.081-2.409,2.409v52.485c0,1.327,1.081,2.407,2.409,2.407h3.292 c0.135,0,0.258-0.037,0.373-0.095v4.823c0,1.349,1.097,2.445,2.444,2.445h3.913v4.391c0,1.374,1.118,2.492,2.493,2.492h37.689 c1.374,0,2.492-1.117,2.492-2.492V22.204C65.566,22.077,65.532,21.959,65.485,21.85z M56.867,15.82l5.768,5.541l-5.768,0.022V15.82 z M48.315,10.67l2.393,2.298h-2.393V10.67z M39.182,4.769l3.175,3.049h-3.175V4.769z M16.535,10.262v47.348 c-0.114-0.058-0.238-0.096-0.373-0.096H12.87c-0.389,0-0.705-0.315-0.705-0.703V4.326c0-0.388,0.316-0.705,0.705-0.705h24.607 v4.197H18.979C17.631,7.818,16.535,8.914,16.535,10.262z M18.979,64.688c-0.408,0-0.74-0.332-0.74-0.741V10.262 c0-0.407,0.332-0.739,0.74-0.739h27.632v3.446H25.385c-1.375,0-2.493,1.118-2.493,2.493v49.226L18.979,64.688L18.979,64.688z M63.862,70.782c0,0.435-0.354,0.788-0.788,0.788H25.385c-0.435,0-0.789-0.353-0.789-0.788V15.461c0-0.435,0.354-0.789,0.789-0.789 h29.777v6.71c0,0.922,0.752,1.673,1.673,1.673h7.027V70.782z"/> <path fill="#6699CC" d="M44.111,31.051c-5.154,0-9.888,2.696-12.542,7.079l-2.011-0.76l0.963,5.869l4.603-3.769l-1.931-0.729 c2.222-3.477,5.952-5.688,10.066-5.958v0.826c0,0.47,0.382,0.852,0.852,0.852c0.471,0,0.853-0.382,0.853-0.852v-0.811 c6.473,0.423,11.653,5.604,12.077,12.078H56.3c-0.47,0-0.852,0.381-0.852,0.852c0,0.47,0.382,0.853,0.852,0.853h0.741 c-0.422,6.433-5.542,11.593-11.959,12.071v-0.85c0-0.472-0.382-0.852-0.853-0.852c-0.47,0-0.852,0.38-0.852,0.852v0.868 c-5.945-0.335-10.939-4.687-12.017-10.604c-0.084-0.464-0.529-0.767-0.992-0.687c-0.463,0.084-0.77,0.528-0.686,0.991 c1.27,6.975,7.338,12.036,14.428,12.036c0.031,0,0.063-0.006,0.095-0.006c0.009,0,0.016,0.006,0.023,0.006 c0.015,0,0.024-0.009,0.04-0.009c8.019-0.086,14.519-6.631,14.519-14.67C58.788,37.636,52.204,31.051,44.111,31.051z"/> <path fill="#6699CC" d="M43.238,53.289c0,0.471,0.383,0.852,0.853,0.852s0.853-0.381,0.853-0.852v-7.206l4.024-4.023 c0.331-0.333,0.333-0.872,0-1.204c-0.334-0.334-0.875-0.334-1.206-0.002l-4.272,4.273c-0.079,0.079-0.142,0.173-0.184,0.277 c-0.044,0.104-0.066,0.215-0.066,0.325l0,0L43.238,53.289L43.238,53.289z"/> </g> </svg> assets/img/icons/spam_comment.svg 0000777 00000006656 15251157102 0013163 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="#6699CC" d="M65.631,35.152c-0.053-0.112-0.125-0.216-0.227-0.3l-3.545-2.941l2.103-1.267 c0.263-0.157,0.422-0.438,0.425-0.743c0.002-0.304-0.154-0.588-0.412-0.749l-3.882-2.417l1.966-3.417 c0.799-1.297,0.395-3.003-0.92-3.815L36.428,5.109c-1.296-0.803-3.003-0.4-3.815,0.913L21.069,25.613 c-0.146,0.025-0.288,0.074-0.41,0.175l-11.062,9.19c-0.031,0.026-0.046,0.062-0.073,0.09c-0.958,0.463-1.625,1.436-1.625,2.569 v33.007c0,1.578,1.284,2.862,2.862,2.862h53.477c1.578,0,2.861-1.284,2.861-2.862V37.637 C67.102,36.567,66.504,35.643,65.631,35.152z M33.131,55.07L9.671,70.753c-0.004-0.037-0.022-0.069-0.022-0.106V37.637 c0-0.21,0.075-0.396,0.177-0.565c-0.004,0.271,0.101,0.539,0.333,0.714L33.131,55.07z M35.793,55.396 c0.047-0.032,0.092-0.068,0.132-0.109c0.876-0.875,2.404-0.875,3.277,0c0.041,0.041,0.086,0.078,0.134,0.109L63.87,71.758H11.317 L35.793,55.396z M65.331,70.63L41.773,54.92l23.502-17.647c0.041,0.115,0.074,0.235,0.074,0.365v33.008v0.002 C65.343,70.645,65.339,70.635,65.331,70.63z M60.342,32.925l3.71,3.079l-17.312,13l7.267-12.359l6.281-3.786 C60.309,32.879,60.318,32.906,60.342,32.925z M34.111,6.927c0.295-0.476,0.922-0.623,1.416-0.318l24.709,14.395 c0.477,0.294,0.625,0.921,0.318,1.42l-2.4,4.171c-0.234,0.409-0.104,0.93,0.296,1.179l3.386,2.108l-8.922,5.377 c-0.125,0.075-0.229,0.181-0.303,0.306L43.25,51.488c-0.034,0.059-0.044,0.121-0.063,0.185l-2.944,2.21 c-1.532-1.338-4.009-1.313-5.489,0.104l-0.081,0.055L15.049,39.275L34.111,6.927z M13.642,38.217l-2.431-1.829 c-0.118-0.089-0.252-0.132-0.389-0.153l7.812-6.489L13.642,38.217z"/> <path fill="#6699CC" d="M28.153,46.658c1.823,1.126,3.914,1.721,6.046,1.721c4.031,0,7.701-2.045,9.814-5.47 c1.617-2.619,2.119-5.711,1.411-8.707s-2.54-5.537-5.159-7.154c-1.822-1.126-3.914-1.721-6.045-1.721 c-4.03,0-7.699,2.045-9.814,5.47C21.066,36.201,22.747,43.316,28.153,46.658z M42.523,41.989c-1.793,2.905-4.905,4.64-8.325,4.64 c-1.808,0-3.58-0.505-5.126-1.459c-2.025-1.252-3.431-3.129-4.129-5.229l18.938-4.476C44.21,37.732,43.742,40.02,42.523,41.989z M25.894,31.716c1.794-2.905,4.907-4.64,8.326-4.64c1.807,0,3.58,0.505,5.125,1.46c1.973,1.217,3.413,3.053,4.135,5.227 l-18.938,4.473C24.226,36.048,24.643,33.741,25.894,31.716z"/> <path fill="#6699CC" d="M32.743,20.526c0.139,0.082,0.292,0.121,0.442,0.121c0.3,0,0.592-0.154,0.755-0.432l3.168-5.388 c0.245-0.417,0.105-0.953-0.311-1.198c-0.417-0.247-0.954-0.105-1.198,0.311l-3.168,5.388 C32.188,19.745,32.327,20.281,32.743,20.526z"/> <path fill="#6699CC" d="M42.586,23.268c0.141,0.082,0.292,0.121,0.441,0.121c0.301,0,0.593-0.154,0.756-0.432l1.838-3.125 c0.245-0.417,0.105-0.953-0.311-1.198c-0.416-0.244-0.953-0.106-1.197,0.311l-1.838,3.125 C42.029,22.487,42.169,23.023,42.586,23.268z"/> <path fill="#6699CC" d="M49.389,31.182c0.139,0.082,0.291,0.121,0.441,0.121c0.3,0,0.592-0.154,0.755-0.432l3.548-6.034 c0.245-0.417,0.105-0.953-0.311-1.198c-0.418-0.246-0.953-0.105-1.197,0.311l-3.548,6.034 C48.832,30.401,48.971,30.937,49.389,31.182z"/> </g> </svg> assets/img/icons/purge-all.svg 0000777 00000011415 15251157102 0012356 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="#6699CC" d="M50.955,23.981l-17.298-7.355c-0.446-0.19-0.959,0.018-1.147,0.463c-0.189,0.445,0.018,0.958,0.463,1.147 l17.296,7.355c0.112,0.047,0.229,0.07,0.344,0.07c0.34,0,0.664-0.2,0.806-0.533C51.605,24.684,51.398,24.17,50.955,23.981z"/> <path fill="#6699CC" d="M37.581,23.984l-5.931-2.612c-0.443-0.195-0.959,0.006-1.153,0.448c-0.195,0.442,0.006,0.958,0.448,1.153 l5.931,2.612c0.115,0.05,0.234,0.074,0.352,0.074c0.336,0,0.657-0.195,0.801-0.522C38.225,24.695,38.023,24.179,37.581,23.984z"/> <path fill="#6699CC" d="M56.841,27.021h-0.973l2.483-5.843c0.545-1.285-0.057-2.775-1.34-3.322l-2.213-0.94l1.564-5.533 c0.379-1.344-0.406-2.746-1.75-3.125l-24.202-6.84c-1.341-0.379-2.748,0.405-3.127,1.75l-3.206,11.346 c-0.021,0.075-0.016,0.149-0.017,0.224l-0.817-0.103c-0.67-0.085-1.336,0.098-1.87,0.513c-0.535,0.416-0.875,1.014-0.958,1.685 l-1.28,10.189H18.16c-1.549,0-2.809,1.26-2.809,2.809c0,0.034,0.002,0.068,0.006,0.103l4.831,40.993 c0.03,1.523,1.278,2.753,2.808,2.753h29.007c1.53,0,2.778-1.229,2.808-2.753l4.834-40.993c0.004-0.034,0.006-0.068,0.006-0.103 C59.648,28.281,58.391,27.021,56.841,27.021z M56.328,19.466c0.396,0.169,0.581,0.631,0.412,1.028l-2.555,6.01 c-0.072,0.171-0.07,0.348-0.035,0.517H24.933l7.222-16.982c0.082-0.192,0.233-0.341,0.427-0.419c0.195-0.079,0.408-0.077,0.6,0.005 l20.276,8.621c0.019,0.006,0.03,0.021,0.05,0.026c0.006,0.001,0.012,0.001,0.016,0.002L56.328,19.466z M28.969,3.642 c0.118-0.416,0.549-0.659,0.968-0.541L54.139,9.94c0.416,0.118,0.658,0.552,0.543,0.967l-1.505,5.318l-19.311-8.21 c-0.624-0.265-1.312-0.271-1.939-0.018c-0.628,0.253-1.119,0.736-1.383,1.358l-2.517,5.918c-0.062-0.023-0.12-0.054-0.188-0.063 l-2.065-0.259L28.969,3.642z M22.152,17.049c0.026-0.208,0.131-0.393,0.296-0.521c0.166-0.128,0.374-0.185,0.579-0.159l4.304,0.54 l-4.037,9.495c-0.087,0.205-0.082,0.421-0.017,0.617H20.9L22.152,17.049z M53.066,70.768c-0.004,0.034-0.006,0.068-0.006,0.104 c0,0.584-0.475,1.059-1.059,1.059H22.996c-0.583,0-1.059-0.475-1.059-1.059c0-0.034-0.002-0.068-0.006-0.104l-4.829-40.98 c0.023-0.563,0.489-1.015,1.058-1.015h38.681c0.569,0,1.034,0.451,1.058,1.015L53.066,70.768z"/> <path fill="#6699CC" d="M28.884,63.443c-0.48,0.055-0.826,0.486-0.772,0.968l0.326,2.907c0.05,0.447,0.429,0.777,0.869,0.777 c0.032,0,0.065-0.002,0.099-0.006c0.48-0.054,0.826-0.486,0.772-0.967l-0.326-2.908C29.797,63.734,29.364,63.382,28.884,63.443z"/> <path fill="#6699CC" d="M26.532,42.486c0.48-0.055,0.826-0.486,0.772-0.967l-0.759-6.771c-0.054-0.479-0.479-0.819-0.967-0.772 c-0.48,0.054-0.826,0.487-0.772,0.967l0.759,6.771c0.05,0.447,0.429,0.777,0.869,0.777C26.466,42.492,26.499,42.49,26.532,42.486z" /> <path fill="#6699CC" d="M46.116,63.445c-0.485-0.057-0.914,0.291-0.968,0.771l-0.325,2.906c-0.056,0.48,0.29,0.913,0.771,0.967 c0.033,0.004,0.066,0.006,0.1,0.006c0.438,0,0.818-0.33,0.867-0.777l0.326-2.905C46.941,63.934,46.598,63.5,46.116,63.445z"/> <path fill="#6699CC" d="M49.421,33.976c-0.487-0.052-0.913,0.292-0.967,0.772l-0.731,6.525c-0.056,0.479,0.291,0.912,0.771,0.967 c0.032,0.004,0.065,0.006,0.099,0.006c0.439,0,0.818-0.33,0.868-0.777l0.731-6.525C50.247,34.463,49.9,34.03,49.421,33.976z"/> <path fill="#6699CC" d="M37.306,64.895c-0.483,0-0.875,0.392-0.875,0.875v1.453c0,0.482,0.392,0.875,0.875,0.875 s0.875-0.393,0.875-0.875V65.77C38.182,65.285,37.789,64.895,37.306,64.895z"/> <path fill="#6699CC" d="M37.306,37.75c0.483,0,0.875-0.392,0.875-0.875v-2.029c0-0.483-0.393-0.875-0.875-0.875 s-0.875,0.392-0.875,0.875v2.029C36.431,37.358,36.822,37.75,37.306,37.75z"/> <path fill="#6699CC" d="M37.5,40.496c-6.108,0-11.078,4.97-11.078,11.079c0,6.108,4.97,11.077,11.078,11.077 c6.109,0,11.079-4.969,11.079-11.077C48.578,45.466,43.607,40.496,37.5,40.496z M37.5,60.902c-5.144,0-9.328-4.185-9.328-9.327 c0-5.146,4.185-9.329,9.328-9.329c5.145,0,9.329,4.186,9.329,9.329C46.828,56.719,42.645,60.902,37.5,60.902z"/> <path fill="#6699CC" d="M38.74,51.574l4.164-4.165c0.341-0.343,0.341-0.896,0-1.238c-0.342-0.342-0.896-0.342-1.238,0L37.5,50.336 l-4.166-4.165c-0.342-0.342-0.896-0.342-1.237,0c-0.341,0.343-0.342,0.896,0,1.238l4.165,4.165l-4.165,4.165 c-0.342,0.342-0.342,0.896,0,1.237c0.171,0.172,0.395,0.256,0.619,0.256c0.224,0,0.448-0.084,0.619-0.256l4.166-4.164l4.166,4.164 c0.171,0.172,0.396,0.256,0.619,0.256c0.223,0,0.448-0.084,0.618-0.256c0.342-0.342,0.342-0.896,0-1.237L38.74,51.574z"/> </g> </svg> assets/img/icons/success_icon.svg 0000777 00000007225 15251157102 0013152 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20px" height="20px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve"> <g id="Layer_1_1_" display="none"> <path display="inline" fill="#E8AE4A" d="M10,0C4.477,0,0,4.478,0,10c0,5.521,4.477,10,10,10c5.521,0,10-4.479,10-10 C20,4.478,15.521,0,10,0z M11.329,16.83c-0.362,0.361-0.804,0.545-1.313,0.545s-0.949-0.184-1.312-0.545 c-0.361-0.362-0.544-0.805-0.544-1.313c0-0.509,0.18-0.951,0.537-1.316c0.357-0.363,0.802-0.551,1.318-0.551 c0.512,0,0.953,0.184,1.313,0.543c0.359,0.361,0.542,0.808,0.542,1.324C11.871,16.027,11.688,16.468,11.329,16.83z M11.389,7.468 l-0.535,2.207c-0.185,0.771-0.322,1.7-0.409,2.763c-0.01,0.111-0.104,0.198-0.216,0.198H9.783c-0.114,0-0.209-0.089-0.216-0.202 c-0.046-0.754-0.201-1.683-0.46-2.759L8.58,7.467C8.257,6.115,8.099,5.169,8.099,4.572c0-0.576,0.177-1.049,0.527-1.406 c0.351-0.358,0.813-0.541,1.37-0.541c0.543,0,1.004,0.183,1.363,0.544c0.358,0.36,0.541,0.822,0.541,1.373 C11.9,5.077,11.734,6.033,11.389,7.468z"/> </g> <g id="Layer_1_copy_3" display="none"> <path display="inline" fill="#4675B8" d="M10,0C4.477,0,0,4.478,0,10c0,5.521,4.477,10,10,10c5.521,0,10-4.479,10-10 C20,4.478,15.521,0,10,0z M11.329,16.83c-0.362,0.361-0.804,0.545-1.313,0.545s-0.949-0.184-1.312-0.545 c-0.361-0.362-0.544-0.805-0.544-1.313c0-0.509,0.18-0.951,0.537-1.316c0.357-0.363,0.802-0.551,1.318-0.551 c0.512,0,0.953,0.184,1.313,0.543c0.359,0.361,0.542,0.808,0.542,1.324C11.871,16.027,11.688,16.468,11.329,16.83z M11.389,7.468 l-0.535,2.207c-0.185,0.771-0.322,1.7-0.409,2.763c-0.01,0.111-0.104,0.198-0.216,0.198H9.783c-0.114,0-0.209-0.089-0.216-0.202 c-0.046-0.754-0.201-1.683-0.46-2.759L8.58,7.467C8.257,6.115,8.099,5.169,8.099,4.572c0-0.576,0.177-1.049,0.527-1.406 c0.351-0.358,0.813-0.541,1.37-0.541c0.543,0,1.004,0.183,1.363,0.544c0.358,0.36,0.541,0.822,0.541,1.373 C11.9,5.077,11.734,6.033,11.389,7.468z"/> </g> <g id="Layer_1_copy" display="none"> <path display="inline" fill="#A32430" d="M10,0C4.477,0,0,4.478,0,10c0,5.521,4.477,10,10,10c5.521,0,10-4.479,10-10 C20,4.478,15.521,0,10,0z M15.159,13.764c0.187,0.188,0.288,0.437,0.288,0.697c0,0.262-0.102,0.51-0.288,0.695 c-0.185,0.184-0.438,0.289-0.698,0.289c-0.262,0-0.518-0.105-0.697-0.291L10,11.393l-3.764,3.765c-0.361,0.36-1.033,0.36-1.393,0 c-0.187-0.185-0.29-0.433-0.29-0.695s0.103-0.512,0.289-0.696l3.764-3.767L4.842,6.234c-0.385-0.384-0.385-1.01,0-1.394 c0.359-0.361,1.032-0.361,1.394,0L10,8.604l3.766-3.765c0.356-0.359,1.033-0.361,1.395,0c0.188,0.185,0.288,0.433,0.288,0.697 c0.001,0.264-0.103,0.511-0.288,0.697l-3.766,3.764L15.159,13.764z"/> </g> <g id="Layer_1_copy_2"> <path fill="#3ABFBF" d="M10,0C4.477,0,0,4.478,0,10c0,5.521,4.477,10,10,10c5.521,0,10-4.479,10-10C20,4.478,15.521,0,10,0z M15.458,6.018l-5.944,9.089c-0.031,0.048-0.07,0.088-0.115,0.121l-0.088,0.063c-0.03,0.021-0.063,0.04-0.097,0.053l-0.189,0.075 c-0.048,0.019-0.1,0.03-0.152,0.032l-0.146,0.004c-0.005,0-0.009,0-0.014,0c-0.026,0-0.052-0.003-0.078-0.008l-0.309-0.096 c-0.058-0.022-0.11-0.058-0.154-0.101c-0.025-0.017-0.077-0.056-0.099-0.074l-3.381-3.133c-0.185-0.171-0.295-0.405-0.307-0.661 c-0.01-0.256,0.079-0.497,0.251-0.683c0.357-0.378,0.974-0.398,1.349-0.054l2.597,2.399l5.277-8.069 c0.277-0.426,0.895-0.558,1.322-0.276c0.211,0.137,0.357,0.352,0.41,0.602C15.645,5.554,15.596,5.807,15.458,6.018z"/> </g> </svg> assets/img/icons/trash_comment.svg 0000777 00000014532 15251157102 0013334 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="#6699CC" d="M62.324,17.893l2.085-2.085c0.366-0.367,0.569-0.855,0.569-1.374s-0.203-1.007-0.568-1.374L53.094,1.743 c-0.365-0.367-0.854-0.57-1.373-0.57c-0.519,0-1.007,0.202-1.373,0.569l-7.883,7.882c-0.064-0.08-0.141-0.154-0.234-0.21 l-7.519-4.431c-0.447-0.264-0.969-0.338-1.472-0.208c-0.503,0.13-0.924,0.448-1.188,0.896l-3.12,5.293l-1.2-2.208 c-0.249-0.457-0.66-0.789-1.159-0.936c-0.497-0.146-1.023-0.09-1.476,0.157L11.034,15.62c-0.938,0.511-1.287,1.692-0.778,2.634 l4.606,8.477c-1.289,0.254-2.264,1.391-2.264,2.753c0,0.034,0.002,0.068,0.006,0.103l4.831,40.993 c0.03,1.523,1.278,2.753,2.808,2.753H49.25c1.529,0,2.777-1.229,2.809-2.753l4.832-40.993c0.004-0.034,0.006-0.068,0.006-0.103 c0-1.549-1.26-2.809-2.81-2.809h-0.544l2.629-2.629l8.118-2.356c0.297-0.086,0.526-0.323,0.604-0.623 c0.076-0.3-0.011-0.618-0.229-0.836L62.324,17.893z M33.561,6.558c0.034-0.057,0.083-0.08,0.118-0.089 c0.033-0.01,0.087-0.013,0.145,0.021l7.408,4.367l-9.371,9.371c-0.757,0.757-0.756,1.99,0,2.747l3.7,3.701h-3.046l0.714-1.211 c0.245-0.417,0.106-0.953-0.31-1.198c-0.417-0.245-0.953-0.106-1.198,0.31l-1.163,1.973c-0.024,0.041-0.027,0.085-0.044,0.127 h-3.032L35.366,13.3c0.245-0.417,0.107-0.953-0.31-1.198s-0.953-0.107-1.198,0.31l-8.307,14.094 c-0.032,0.054-0.04,0.113-0.059,0.17h-3.789L33.561,6.558z M11.871,17.157l14.066-7.644c0.056-0.031,0.109-0.026,0.144-0.015 c0.035,0.011,0.083,0.035,0.115,0.093l1.266,2.328c0.138,0.254,0.386,0.397,0.653,0.434l-2.13,3.613l-0.291-0.535 c-0.23-0.424-0.763-0.582-1.187-0.351c-0.424,0.231-0.582,0.762-0.351,1.187l0.388,0.713c0.127,0.234,0.346,0.381,0.588,0.433 l-1.715,2.908L21.884,17.5c-0.23-0.424-0.762-0.582-1.187-0.351c-0.424,0.23-0.582,0.762-0.351,1.187l1.535,2.824 c0.158,0.292,0.459,0.457,0.77,0.457c0.001,0,0.002,0,0.003,0l-1.833,3.109c-0.017-0.077-0.03-0.155-0.07-0.228l-2.677-4.926 c-0.231-0.424-0.763-0.582-1.187-0.351c-0.424,0.231-0.582,0.762-0.351,1.187l2.677,4.926c0.159,0.292,0.459,0.457,0.77,0.457 c0.084,0,0.165-0.038,0.248-0.063l-0.269,0.457c-0.091,0.155-0.113,0.325-0.104,0.492h-3.034l-5.03-9.255 C11.743,17.326,11.778,17.208,11.871,17.157z M55.145,29.44l-4.83,40.981c-0.004,0.034-0.006,0.068-0.006,0.103 c0,0.584-0.475,1.06-1.059,1.06H20.243c-0.583,0-1.059-0.476-1.059-1.06c0-0.033-0.002-0.067-0.006-0.103l-4.83-40.981 c0.023-0.563,0.489-1.015,1.058-1.015h38.681C54.656,28.425,55.121,28.876,55.145,29.44z M55.468,22.428 c-0.142,0.041-0.271,0.117-0.375,0.222l-4.024,4.025h-3.877l10.588-10.586c0.341-0.342,0.341-0.896,0-1.237 c-0.342-0.342-0.896-0.342-1.238,0l-11.57,11.569c-0.076,0.075-0.128,0.163-0.17,0.254h-6.765l-4.937-4.938 c-0.075-0.075-0.075-0.197,0-0.272L51.585,2.979c0.047-0.046,0.101-0.056,0.136-0.056c0.036,0,0.088,0.01,0.135,0.057 l11.317,11.318c0.048,0.046,0.058,0.1,0.058,0.136c0,0.036-0.01,0.089-0.059,0.136l-2.704,2.705 c-0.163,0.164-0.256,0.387-0.256,0.619s0.093,0.455,0.257,0.619l1.911,1.911L55.468,22.428z"/> <path fill="#6699CC" d="M51.648,8.721c-0.342-0.342-0.896-0.342-1.238,0L38.84,20.289c-0.341,0.341-0.341,0.896,0,1.237 c0.172,0.171,0.396,0.256,0.619,0.256s0.448-0.085,0.619-0.256l11.57-11.568C51.988,9.617,51.99,9.063,51.648,8.721z"/> <path fill="#6699CC" d="M53.475,11.787L41.906,23.356c-0.342,0.342-0.342,0.896,0,1.237c0.171,0.171,0.396,0.256,0.619,0.256 c0.223,0,0.447-0.085,0.619-0.256l11.566-11.569c0.342-0.342,0.341-0.896,0-1.237C54.37,11.445,53.814,11.445,53.475,11.787z"/> <path fill="#6699CC" d="M26.256,54.037l1.131,0.652l0.001-4.361l-3.779,2.18l1.131,0.653l-0.326,0.565 c-0.896,1.549-1.013,3.057-0.329,4.242s2.047,1.84,3.838,1.84h4.415c0.483,0,0.875-0.393,0.875-0.875 c0-0.483-0.392-0.875-0.875-0.875h-4.415c-1.123,0-1.969-0.353-2.323-0.965c-0.354-0.611-0.234-1.521,0.328-2.492L26.256,54.037z" /> <path fill="#6699CC" d="M29.08,47.398c0.138,0.08,0.289,0.117,0.437,0.117c0.302,0,0.596-0.156,0.758-0.438l2.221-3.844 c0.371-0.641,0.817-1.09,1.325-1.336c0.454-0.221,0.896-0.222,1.35,0.002c0.506,0.244,0.95,0.692,1.322,1.336l0.366,0.632 l-1.131,0.653l3.779,2.18l-0.003-4.362l-1.13,0.653l-0.366-0.633c-0.55-0.95-1.248-1.635-2.073-2.034 c-0.926-0.449-1.946-0.45-2.875-0.003c-0.83,0.402-1.529,1.088-2.078,2.037l-2.221,3.844C28.519,46.622,28.662,47.157,29.08,47.398 z"/> <path fill="#6699CC" d="M36.654,58.934l3.778,2.183v-1.308h0.637c1.791,0,3.154-0.652,3.84-1.84 c0.684-1.187,0.566-2.693-0.33-4.242l-2.25-3.895c-0.241-0.419-0.776-0.561-1.195-0.32c-0.419,0.242-0.563,0.777-0.32,1.195 l2.252,3.896c0.562,0.971,0.682,1.879,0.328,2.492c-0.354,0.611-1.199,0.963-2.322,0.963h-0.637v-1.307L36.654,58.934z"/> <path fill="#6699CC" d="M26.13,63.1c-0.48,0.053-0.826,0.485-0.772,0.967l0.327,2.906c0.05,0.447,0.429,0.777,0.869,0.777 c0.033,0,0.065-0.002,0.099-0.006c0.48-0.055,0.826-0.486,0.772-0.967l-0.327-2.907C27.043,63.391,26.613,63.048,26.13,63.1z"/> <path fill="#6699CC" d="M24.216,46.914c0.032,0,0.065-0.002,0.099-0.006c0.48-0.055,0.826-0.486,0.772-0.967l-1.294-11.54 c-0.054-0.479-0.481-0.822-0.967-0.772c-0.48,0.054-0.826,0.487-0.772,0.967l1.294,11.539 C23.397,46.584,23.776,46.914,24.216,46.914z"/> <path fill="#6699CC" d="M43.361,63.1c-0.489-0.06-0.912,0.291-0.967,0.771l-0.326,2.906c-0.055,0.479,0.291,0.912,0.771,0.967 c0.033,0.004,0.066,0.006,0.1,0.006c0.438,0,0.817-0.33,0.867-0.777l0.326-2.906C44.188,63.586,43.843,63.152,43.361,63.1z"/> <path fill="#6699CC" d="M45.176,46.932c0.033,0.004,0.066,0.006,0.1,0.006c0.438,0,0.817-0.33,0.867-0.776l1.297-11.563 c0.056-0.48-0.291-0.914-0.771-0.967c-0.487-0.049-0.913,0.292-0.967,0.772l-1.298,11.563 C44.35,46.445,44.695,46.878,45.176,46.932z"/> <path fill="#6699CC" d="M34.552,63.125c-0.483,0-0.875,0.393-0.875,0.875v2.875c0,0.482,0.392,0.875,0.875,0.875 c0.483,0,0.875-0.393,0.875-0.875V64C35.427,63.518,35.036,63.125,34.552,63.125z"/> <path fill="#6699CC" d="M34.552,37.187c0.483,0,0.875-0.392,0.875-0.875V34.5c0-0.483-0.392-0.875-0.875-0.875 c-0.483,0-0.875,0.392-0.875,0.875v1.812C33.677,36.795,34.069,37.187,34.552,37.187z"/> </g> </svg> assets/img/icons/db.svg 0000777 00000004146 15251157102 0011056 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <path fill="#21A0DF" d="M66.478,27.294c0,0,0-0.001,0-0.001V11.727c0-0.054-0.006-0.107-0.017-0.159 c0-0.001-0.001-0.002-0.001-0.004c0.006-0.089,0.018-0.178,0.018-0.268c0-0.163-0.049-0.313-0.132-0.439 c-0.628-2.732-3.608-5.213-8.528-7.054c-5.19-1.943-12.039-3.013-19.281-3.013c-7.244,0-14.091,1.07-19.283,3.013 c-4.92,1.841-7.9,4.322-8.527,7.055c-0.083,0.126-0.132,0.276-0.132,0.438c0,0.089,0.012,0.178,0.017,0.267c0,0.001,0,0.003,0,0.004 c-0.011,0.052-0.017,0.105-0.017,0.161v50.829c0,0.057,0.006,0.111,0.017,0.164c0.505,6.453,12.718,11.491,27.925,11.491 c15.204,0,27.415-5.037,27.923-11.489c0.013-0.053,0.019-0.109,0.019-0.166v-17.66c0-0.002,0-0.002,0-0.003v-0.001V27.296 C66.478,27.296,66.478,27.295,66.478,27.294z M19.813,5.299c5.017-1.878,11.665-2.911,18.723-2.911 c7.057,0,13.706,1.033,18.722,2.911c4.615,1.727,7.365,4.025,7.598,6.326c-0.5,4.419-10.945,9.024-26.319,9.024 c-15.375,0-25.821-4.604-26.319-9.024C12.449,9.324,15.199,7.026,19.813,5.299z M38.536,22.248c12.32,0,22.537-2.975,26.343-7.232 v12.281c-0.004,5.589-12.066,10.311-26.343,10.311c-14.279,0-26.343-4.723-26.343-10.313V15.015 C15.999,19.272,26.216,22.248,38.536,22.248z M64.879,62.442c-0.004,0.023-0.006,0.047-0.008,0.068 c-0.142,2.551-2.929,5.097-7.648,6.987c-5.01,2.008-11.646,3.114-18.687,3.114c-7.041,0-13.678-1.106-18.687-3.114 c-4.72-1.891-7.507-4.437-7.65-6.987c-0.001-0.021-0.003-0.045-0.006-0.067V48.938c3.806,4.631,14.023,7.867,26.343,7.867 c12.32,0,22.537-3.236,26.343-7.866V62.442z M64.879,44.895c-0.004,5.59-12.066,10.313-26.343,10.313 c-14.279,0-26.343-4.724-26.343-10.314V31.34c3.806,4.63,14.023,7.865,26.343,7.865c12.32,0,22.537-3.235,26.343-7.865V44.895z"/> </svg> assets/img/icons/purge-cssjs.svg 0000777 00000011654 15251157102 0012740 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="#6699CC" d="M47.673,48.495c-5.733,0-10.4,4.666-10.4,10.401c0,5.733,4.667,10.398,10.4,10.398 c5.735,0,10.401-4.665,10.401-10.398C58.074,53.161,53.408,48.495,47.673,48.495z M47.673,67.546c-4.771,0-8.649-3.88-8.649-8.649 c0-4.771,3.881-8.65,8.649-8.65c4.771,0,8.651,3.881,8.651,8.65S52.443,67.546,47.673,67.546z"/> <path fill="#6699CC" d="M52.758,53.811c-0.34-0.343-0.896-0.341-1.236,0l-3.848,3.848l-3.847-3.848 c-0.343-0.343-0.897-0.343-1.237,0c-0.342,0.342-0.343,0.896-0.001,1.236l3.849,3.85l-3.849,3.849 c-0.342,0.341-0.341,0.896,0.001,1.237c0.17,0.17,0.395,0.256,0.618,0.256s0.448-0.086,0.619-0.256l3.847-3.849l3.848,3.849 c0.17,0.17,0.396,0.256,0.619,0.256c0.223,0,0.447-0.086,0.617-0.256c0.342-0.342,0.344-0.896,0.001-1.237l-3.848-3.849l3.848-3.85 C53.102,54.706,53.1,54.15,52.758,53.811z"/> <path fill="#6699CC" d="M64.165,17.493c-0.044-0.117-0.108-0.228-0.205-0.32l-9.576-9.197c-0.03-0.029-0.067-0.041-0.102-0.064 c-0.058-0.042-0.111-0.087-0.179-0.114c-0.076-0.031-0.156-0.04-0.236-0.048c-0.031-0.003-0.059-0.018-0.09-0.018h-0.015 c-0.003,0-0.005,0-0.007,0h-3.189c-0.029-0.041-0.047-0.088-0.086-0.124l-5.531-5.314c-0.03-0.029-0.067-0.04-0.102-0.064 c-0.058-0.042-0.111-0.087-0.18-0.114c-0.072-0.03-0.148-0.037-0.227-0.046c-0.034-0.004-0.064-0.02-0.101-0.02h-0.016 c-0.001,0-0.002,0-0.004,0H12.917c-1.451,0-2.632,1.18-2.632,2.631v59.231c0,1.449,1.181,2.631,2.632,2.631h4.382v4.909 c0,1.479,1.205,2.685,2.685,2.685h41.583c1.479,0,2.684-1.203,2.684-2.685V17.857C64.25,17.726,64.217,17.604,64.165,17.493z M54.652,10.661l6.574,6.314l-6.574-0.023V10.661z M45.218,4.979l2.866,2.753h-2.866V4.979z M12.917,64.793 c-0.486,0-0.882-0.396-0.882-0.881V4.681c0-0.486,0.396-0.881,0.882-0.881h30.551v3.932H19.984c-1.48,0-2.685,1.205-2.685,2.686 v54.375H12.917z M62.5,71.452c0,0.516-0.419,0.935-0.934,0.935H19.984c-0.516,0-0.935-0.419-0.935-0.935V10.417 c0-0.516,0.419-0.936,0.935-0.936h32.918v7.469c0,0.982,0.798,1.781,1.779,1.781H62.5V71.452z"/> <path fill="#6699CC" d="M28.199,23.273c-0.715,0.622-1.073,1.868-1.073,3.739v3.275c0,1.27-0.229,2.15-0.686,2.641 c-0.457,0.491-1.287,0.736-2.488,0.736h-0.774v1.333h0.774c1.202,0,2.031,0.246,2.488,0.736c0.457,0.49,0.686,1.371,0.686,2.641 v3.274c0,1.871,0.357,3.119,1.073,3.746c0.716,0.625,2.126,0.938,4.234,0.938h0.787V45h-0.863c-1.193,0-1.972-0.188-2.336-0.559 c-0.364-0.373-0.546-1.155-0.546-2.35V38.45c0-1.329-0.208-2.277-0.622-2.844s-1.181-0.995-2.298-1.282 c1.1-0.254,1.862-0.668,2.285-1.244s0.635-1.532,0.635-2.869v-3.644c0-1.193,0.182-1.976,0.546-2.349s1.143-0.559,2.336-0.559 h0.863v-1.32h-0.787C30.326,22.34,28.915,22.651,28.199,23.273z"/> <path fill="#6699CC" d="M38.425,43.136c0.091,0,0.181-0.024,0.263-0.073c1.3-0.803,2.289-1.768,2.94-2.869 c0.653-1.102,1.021-2.433,1.092-3.958c0.007-0.136-0.043-0.27-0.138-0.369c-0.094-0.099-0.225-0.155-0.361-0.155H39.72 c-0.276,0-0.5,0.224-0.5,0.5v0.47c0,1.045-0.172,1.941-0.511,2.662c-0.335,0.713-0.873,1.342-1.596,1.873 c-0.118,0.088-0.191,0.221-0.203,0.365c-0.012,0.145,0.042,0.288,0.145,0.393l1.016,1.016 C38.168,43.086,38.296,43.136,38.425,43.136z M39.614,39.77c0.398-0.848,0.603-1.875,0.605-3.058h1.464 c-0.113,1.14-0.422,2.138-0.916,2.972c-0.513,0.867-1.276,1.646-2.273,2.313l-0.336-0.335 C38.794,41.109,39.282,40.475,39.614,39.77z"/> <path fill="#6699CC" d="M40.914,31.685c0.609,0,1.132-0.214,1.553-0.635c0.422-0.421,0.637-0.944,0.637-1.554 c0-0.6-0.213-1.119-0.634-1.544c-0.842-0.853-2.264-0.854-3.108-0.009c-0.422,0.422-0.635,0.944-0.635,1.553 s0.213,1.131,0.635,1.554C39.782,31.471,40.307,31.685,40.914,31.685z M40.066,28.65c0.233-0.234,0.504-0.343,0.848-0.343 c0.338,0,0.613,0.113,0.844,0.347c0.231,0.235,0.346,0.51,0.346,0.842c0,0.344-0.108,0.612-0.344,0.846 c-0.464,0.464-1.229,0.464-1.691,0c-0.229-0.23-0.342-0.507-0.342-0.846S39.838,28.88,40.066,28.65z"/> <path fill="#6699CC" d="M54.563,27.012c0-1.871-0.354-3.117-1.062-3.739c-0.706-0.622-2.113-0.933-4.221-0.933h-0.8v1.32h0.889 c1.185,0,1.957,0.184,2.316,0.552s0.539,1.153,0.539,2.355v3.644c0,1.337,0.209,2.293,0.629,2.869 c0.418,0.576,1.179,0.99,2.278,1.244c-1.108,0.288-1.871,0.715-2.284,1.282c-0.416,0.567-0.623,1.515-0.623,2.844v3.644 c0,1.202-0.18,1.986-0.539,2.355c-0.359,0.367-1.133,0.552-2.316,0.552H48.48v1.333h0.8c2.106,0,3.515-0.313,4.221-0.939 c0.707-0.625,1.062-1.875,1.062-3.744v-3.275c0-1.27,0.229-2.15,0.686-2.641c0.457-0.491,1.286-0.736,2.488-0.736h0.787v-1.333 h-0.787c-1.202,0-2.031-0.246-2.488-0.736c-0.457-0.49-0.686-1.371-0.686-2.641V27.012z"/> </g> </svg> assets/img/icons/img_webp.svg 0000777 00000007011 15251157102 0012254 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve"> <circle fill="none" cx="15" cy="15.894" r="5.317"/> <path fill="#83B04A" d="M8.71,5.417H4.312V5.124c0-0.608,0.492-1.101,1.1-1.101h2.198c0.607,0,1.101,0.492,1.101,1.101V5.417z M29.481,8.01v15.766c0,1.217-0.984,2.201-2.199,2.201H2.719c-1.215,0-2.2-0.984-2.2-2.201V8.01c0-1.215,0.985-2.2,2.2-2.2h17.311 l0.06,0.041l-0.596,0.408c-0.273,0.188-0.392,0.539-0.288,0.85c0.096,0.296,0.368,0.5,0.733,0.519l0.722-0.021l-0.241,0.679 c-0.111,0.312-0.001,0.665,0.266,0.858c0.128,0.093,0.28,0.143,0.439,0.143c0.162,0,0.323-0.053,0.458-0.155l0.57-0.439l0.205,0.695 c0.097,0.319,0.386,0.534,0.719,0.534s0.622-0.215,0.72-0.538L24,8.691l0.574,0.442c0.13,0.098,0.291,0.152,0.454,0.152 c0.158,0,0.31-0.048,0.442-0.143c0.266-0.194,0.374-0.547,0.264-0.857l-0.241-0.68l0.752,0.021c0.336-0.012,0.605-0.212,0.701-0.514 c0.104-0.314-0.014-0.665-0.288-0.854L26.063,5.85l0.06-0.041h1.159C28.497,5.81,29.481,6.795,29.481,8.01z M20.317,15.894 c0-2.937-2.38-5.317-5.317-5.317c-2.936,0-5.316,2.381-5.316,5.317s2.381,5.317,5.316,5.317 C17.938,21.211,20.317,18.83,20.317,15.894z M26.376,6.67c0.091,0.063,0.131,0.178,0.096,0.283 c-0.033,0.105-0.121,0.168-0.244,0.173l-1.45-0.041l0.486,1.367c0.037,0.104,0.001,0.221-0.088,0.286 c-0.09,0.064-0.212,0.063-0.3-0.004L23.727,7.85l-0.41,1.392c-0.032,0.106-0.13,0.179-0.24,0.179s-0.208-0.073-0.24-0.179 l-0.41-1.392l-1.148,0.885c-0.089,0.066-0.211,0.068-0.299,0.004c-0.09-0.065-0.126-0.182-0.089-0.286l0.486-1.367l-1.451,0.041 c-0.114-0.006-0.21-0.067-0.244-0.173c-0.035-0.105,0.005-0.221,0.096-0.283l1.197-0.82l-0.06-0.041l-1.138-0.78 c-0.091-0.063-0.131-0.178-0.096-0.283c0.034-0.105,0.132-0.163,0.244-0.173l1.451,0.041L20.89,3.248 c-0.037-0.104-0.001-0.221,0.089-0.286c0.088-0.065,0.21-0.063,0.299,0.004l1.148,0.884l0.41-1.392c0.064-0.213,0.416-0.213,0.48,0 l0.41,1.392l1.149-0.885c0.088-0.068,0.21-0.069,0.3-0.004c0.089,0.065,0.125,0.182,0.088,0.286l-0.486,1.366l1.45-0.04 c0.121,0.008,0.211,0.067,0.244,0.173c0.035,0.105-0.005,0.221-0.096,0.283l-1.138,0.78l-0.06,0.041L26.376,6.67z M25.393,6.603 l-0.798-0.547c-0.067-0.046-0.108-0.124-0.108-0.206c0-0.014,0.008-0.027,0.01-0.041c0.012-0.066,0.043-0.127,0.099-0.166 l0.798-0.547l-0.967,0.027c-0.069,0.017-0.16-0.036-0.209-0.103s-0.061-0.153-0.033-0.231l0.324-0.911l-0.766,0.589 c-0.064,0.051-0.15,0.066-0.229,0.04c-0.078-0.025-0.14-0.088-0.163-0.167l-0.273-0.929l-0.273,0.929 c-0.023,0.079-0.085,0.142-0.163,0.167c-0.078,0.026-0.164,0.012-0.229-0.04L21.646,3.88l0.324,0.91 c0.027,0.078,0.016,0.164-0.033,0.231c-0.048,0.066-0.142,0.101-0.209,0.103L20.76,5.097l0.798,0.547 c0.056,0.039,0.087,0.1,0.099,0.166c0.002,0.014,0.01,0.026,0.01,0.041c0,0.083-0.041,0.16-0.108,0.206L20.76,6.603l0.968-0.027 c0.086,0,0.161,0.037,0.209,0.103c0.049,0.067,0.061,0.153,0.033,0.231l-0.324,0.91l0.765-0.589 c0.044-0.034,0.098-0.052,0.152-0.052c0.026,0,0.052,0.004,0.077,0.012c0.078,0.025,0.14,0.088,0.163,0.167l0.273,0.929l0.273-0.929 c0.023-0.079,0.085-0.142,0.163-0.167c0.079-0.024,0.165-0.011,0.229,0.04l0.766,0.589l-0.324-0.91 c-0.027-0.078-0.016-0.164,0.033-0.231c0.048-0.067,0.121-0.122,0.209-0.103L25.393,6.603z"/> </svg> assets/img/icons/optimize_tables.svg 0000777 00000005505 15251157102 0013663 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <polygon fill="#6699CC" points="33.496,19.622 41.335,23.493 48.044,17.635 49.146,18.897 50.775,14.133 45.835,15.104 46.937,16.367 41.075,21.487 33.354,17.676 22.786,24.961 23.741,26.347 "/> <path fill="#6699CC" d="M64.08,13.12c-0.041-0.11-0.104-0.216-0.195-0.303L53.709,3.043c-0.027-0.027-0.063-0.039-0.095-0.061 c-0.057-0.042-0.11-0.084-0.175-0.112c-0.067-0.027-0.138-0.033-0.209-0.042c-0.036-0.004-0.068-0.021-0.104-0.021h-0.017 c-0.002,0-0.002,0-0.002,0h-39.51c-1.524,0-2.765,1.241-2.765,2.765v64.853c0,1.525,1.24,2.765,2.765,2.765h47.807 c1.522,0,2.765-1.239,2.765-2.765V13.478C64.167,13.349,64.133,13.229,64.08,13.12z M53.968,5.625l7.3,7.011h-7.18 c-0.065,0-0.12-0.054-0.12-0.12V5.625z M62.483,70.427c0,0.597-0.484,1.082-1.081,1.082H13.598c-0.597,0-1.082-0.485-1.082-1.082 V5.574c0-0.596,0.485-1.082,1.082-1.082h38.688v8.025c0,0.995,0.809,1.803,1.803,1.803h8.396V70.427z"/> <path fill="#6699CC" d="M17.724,28.494c-0.464,0-0.842,0.377-0.842,0.842v28.058c0,0.465,0.377,0.841,0.842,0.841h39.185 c0.065,0,0.122-0.023,0.184-0.036c0.061,0.013,0.118,0.036,0.183,0.036c0.464,0,0.842-0.376,0.842-0.841V29.336 c0-0.465-0.378-0.842-0.842-0.842c-0.064,0-0.122,0.023-0.183,0.037c-0.062-0.014-0.118-0.037-0.184-0.037H17.724z M56.435,37.847 H41.649v-2.992h14.785V37.847z M18.565,34.854h4.931v2.992h-4.931V34.854z M18.565,39.529h4.931v2.993h-4.931V39.529z M39.966,47.199H25.18v-2.994h14.786V47.199z M41.649,44.205h14.785v2.994H41.649V44.205z M25.18,42.522v-2.993h14.786v2.993H25.18 z M23.497,44.205v2.994h-4.931v-2.994H23.497z M23.497,48.882v2.992h-4.931v-2.992H23.497z M25.18,48.882h14.786v2.992H25.18 V48.882z M41.649,48.882h14.785v2.992H41.649V48.882z M56.435,42.522H41.649v-2.993h14.785V42.522z M39.966,37.847H25.18v-2.992 h14.786V37.847z M25.18,33.171v-2.994h14.786v2.994H25.18z M23.497,33.171h-4.931v-2.994h4.931V33.171z M18.565,53.559h4.931v2.993 h-4.931V53.559z M25.18,53.559h14.786v2.993H25.18V53.559z M41.649,53.559h14.785v2.993H41.649V53.559z M56.435,33.171H41.649 v-2.994h14.785V33.171z"/> <path fill="#6699CC" d="M28.019,37.043h9.289c0.398,0,0.721-0.323,0.721-0.721s-0.323-0.721-0.721-0.721h-9.289 c-0.398,0-0.721,0.323-0.721,0.721S27.62,37.043,28.019,37.043z"/> <path fill="#6699CC" d="M44.5,37.043h9.29c0.397,0,0.721-0.323,0.721-0.721s-0.323-0.721-0.721-0.721H44.5 c-0.398,0-0.721,0.323-0.721,0.721S44.102,37.043,44.5,37.043z"/> </g> </svg> assets/img/icons/trackback-pingback.svg 0000777 00000005032 15251157102 0014165 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="#6699CC" d="M13.333,10.792c-0.483,0-0.875,0.392-0.875,0.875v2.167c0,0.483,0.392,0.875,0.875,0.875 s0.875-0.392,0.875-0.875v-2.167C14.208,11.183,13.817,10.792,13.333,10.792z"/> <path fill="#6699CC" d="M34.926,34.313V11.001c0-0.167-0.059-0.314-0.141-0.447c-0.044-0.108-0.109-0.21-0.198-0.297l-6.291-6.118 C28.267,4.111,28.23,4.1,28.199,4.077c-0.161-0.181-0.388-0.301-0.649-0.301H11.926c-1.034,0-1.875,0.841-1.875,1.875v28.662 c0,1.034,0.841,1.875,1.875,1.875h21.125C34.084,36.188,34.926,35.346,34.926,34.313z M28.425,6.706l3.517,3.42H28.55 c-0.069,0-0.125-0.056-0.125-0.125V6.706z M11.801,34.313V5.65c0-0.069,0.056-0.125,0.125-0.125h14.749v4.476 c0,1.034,0.841,1.875,1.875,1.875h4.626v22.437c0,0.069-0.056,0.125-0.125,0.125H11.926C11.857,34.438,11.801,34.381,11.801,34.313 z"/> <path fill="#6699CC" d="M64.809,45.588c-0.045-0.105-0.109-0.207-0.197-0.293l-6.291-6.119c-0.028-0.027-0.064-0.039-0.096-0.062 c-0.16-0.183-0.389-0.302-0.649-0.302H41.949c-1.034,0-1.875,0.84-1.875,1.875V69.35c0,1.034,0.841,1.875,1.875,1.875h21.125 c1.033,0,1.875-0.841,1.875-1.875V46.037C64.949,45.869,64.891,45.723,64.809,45.588z M58.449,41.743l3.515,3.419h-3.39 c-0.069,0-0.125-0.057-0.125-0.125V41.743z M63.199,69.35c0,0.069-0.057,0.125-0.125,0.125H41.949 c-0.069,0-0.125-0.056-0.125-0.125V40.688c0-0.068,0.056-0.125,0.125-0.125h14.75v4.476c0,1.034,0.841,1.875,1.875,1.875h4.625 V69.35z"/> <path fill="#6699CC" d="M44.533,44.016c-0.483,0-0.875,0.393-0.875,0.875v2.168c0,0.482,0.392,0.875,0.875,0.875 c0.482,0,0.875-0.393,0.875-0.875v-2.168C45.408,44.407,45.018,44.016,44.533,44.016z"/> <path fill="#6699CC" d="M47.535,44.016c-0.483,0-0.875,0.393-0.875,0.875v2.168c0,0.482,0.392,0.875,0.875,0.875 c0.482,0,0.875-0.393,0.875-0.875v-2.168C48.41,44.407,48.02,44.016,47.535,44.016z"/> <polygon fill="#6699CC" points="31.548,44.113 25.648,42.532 27.229,48.432 28.769,46.893 34.5,52.622 35.737,51.384 30.007,45.652 "/> <polygon fill="#6699CC" points="43.452,30.886 49.352,32.467 47.771,26.567 46.23,28.108 40.501,22.378 39.264,23.616 44.992,29.346 "/> </g> </svg> assets/img/icons/cross_icon.svg 0000777 00000006650 15251157102 0012634 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20px" height="20px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve"> <g id="Layer_1_1_" display="none"> <path display="inline" fill="#E8AE4A" d="M10,0C4.477,0,0,4.478,0,10c0,5.521,4.477,10,10,10c5.521,0,10-4.479,10-10 C20,4.478,15.521,0,10,0z M11.329,16.83c-0.362,0.361-0.804,0.545-1.313,0.545s-0.949-0.184-1.312-0.545 c-0.361-0.362-0.544-0.805-0.544-1.313c0-0.51,0.18-0.951,0.537-1.316c0.357-0.363,0.802-0.551,1.318-0.551 c0.512,0,0.953,0.184,1.313,0.543c0.359,0.361,0.542,0.808,0.542,1.324C11.871,16.027,11.688,16.468,11.329,16.83z M11.389,7.468 l-0.535,2.207c-0.185,0.771-0.321,1.7-0.409,2.763c-0.01,0.111-0.104,0.198-0.216,0.198H9.783c-0.114,0-0.209-0.089-0.216-0.202 c-0.046-0.754-0.201-1.683-0.46-2.759L8.58,7.467C8.257,6.115,8.099,5.169,8.099,4.572c0-0.576,0.177-1.049,0.527-1.406 c0.351-0.358,0.813-0.541,1.37-0.541c0.543,0,1.004,0.183,1.363,0.544c0.357,0.36,0.541,0.822,0.541,1.373 C11.9,5.077,11.734,6.033,11.389,7.468z"/> </g> <g id="Layer_1_copy_3" display="none"> <path display="inline" fill="#4675B8" d="M10,0C4.477,0,0,4.478,0,10c0,5.521,4.477,10,10,10c5.521,0,10-4.479,10-10 C20,4.478,15.521,0,10,0z M11.329,16.83c-0.362,0.361-0.804,0.545-1.313,0.545s-0.949-0.184-1.312-0.545 c-0.361-0.362-0.544-0.805-0.544-1.313c0-0.51,0.18-0.951,0.537-1.316c0.357-0.363,0.802-0.551,1.318-0.551 c0.512,0,0.953,0.184,1.313,0.543c0.359,0.361,0.542,0.808,0.542,1.324C11.871,16.027,11.688,16.468,11.329,16.83z M11.389,7.468 l-0.535,2.207c-0.185,0.771-0.321,1.7-0.409,2.763c-0.01,0.111-0.104,0.198-0.216,0.198H9.783c-0.114,0-0.209-0.089-0.216-0.202 c-0.046-0.754-0.201-1.683-0.46-2.759L8.58,7.467C8.257,6.115,8.099,5.169,8.099,4.572c0-0.576,0.177-1.049,0.527-1.406 c0.351-0.358,0.813-0.541,1.37-0.541c0.543,0,1.004,0.183,1.363,0.544c0.357,0.36,0.541,0.822,0.541,1.373 C11.9,5.077,11.734,6.033,11.389,7.468z"/> </g> <g id="Layer_1_copy" display="none"> <path display="inline" fill="#A32430" d="M10,0C4.477,0,0,4.478,0,10c0,5.521,4.477,10,10,10c5.521,0,10-4.479,10-10 C20,4.478,15.521,0,10,0z M15.159,13.764c0.187,0.188,0.288,0.438,0.288,0.697c0,0.262-0.102,0.51-0.288,0.695 c-0.185,0.184-0.438,0.289-0.698,0.289c-0.262,0-0.518-0.105-0.697-0.291L10,11.393l-3.764,3.766c-0.361,0.359-1.033,0.359-1.393,0 c-0.187-0.186-0.29-0.434-0.29-0.695s0.103-0.512,0.289-0.695L8.606,10L4.842,6.234c-0.385-0.384-0.385-1.01,0-1.394 c0.359-0.361,1.032-0.361,1.394,0L10,8.604l3.766-3.765c0.356-0.359,1.033-0.361,1.396,0c0.188,0.185,0.288,0.433,0.288,0.697 c0.001,0.264-0.104,0.511-0.288,0.697l-3.767,3.764L15.159,13.764z"/> </g> <g> <circle fill="#CC3D6A" cx="10" cy="10" r="9.967"/> </g> <path fill="#FFFFFF" d="M11.414,10l3.503-3.503c0.392-0.391,0.392-1.024,0-1.414c-0.392-0.391-1.022-0.391-1.414,0L10,8.586 L6.497,5.082c-0.391-0.391-1.023-0.391-1.414,0c-0.391,0.39-0.391,1.023,0,1.414L8.586,10l-3.503,3.504 c-0.391,0.391-0.391,1.023,0,1.414c0.195,0.195,0.451,0.293,0.707,0.293s0.512-0.098,0.707-0.293L10,11.414l3.502,3.503 c0.195,0.194,0.451,0.293,0.707,0.293s0.512-0.099,0.707-0.293c0.391-0.392,0.391-1.022,0-1.414L11.414,10z"/> </svg> assets/img/icons/purge-500.svg 0000777 00000010630 15251157102 0012110 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="#6699CC" d="M24.2,29.932c-0.686,0-1.381,0.061-2.071,0.18l0.333-3.945h5.769c0.138,0,0.25-0.112,0.25-0.25v-1.569 c0-0.138-0.112-0.25-0.25-0.25h-7.455c-0.13,0-0.239,0.1-0.249,0.23l-0.564,7.014c-0.008,0.092,0.037,0.181,0.114,0.23l0.882,0.563 c0.053,0.034,0.118,0.047,0.179,0.036c1.071-0.194,1.932-0.293,2.56-0.293c2.419,0,3.595,0.944,3.595,2.888 c0,1.005-0.298,1.748-0.912,2.271c-0.617,0.525-1.506,0.791-2.643,0.791c-0.667,0-1.354-0.085-2.042-0.253 c-0.683-0.168-1.258-0.4-1.708-0.691c-0.078-0.051-0.174-0.053-0.255-0.01c-0.081,0.044-0.13,0.128-0.13,0.22v1.641 c0,0.087,0.045,0.168,0.12,0.214c0.923,0.562,2.268,0.847,3.996,0.847c1.791,0,3.221-0.466,4.252-1.386 c1.039-0.928,1.565-2.219,1.565-3.837c0-1.43-0.486-2.576-1.445-3.404C27.143,30.347,25.834,29.932,24.2,29.932z"/> <path fill="#6699CC" d="M40.443,37.76c0.839-1.313,1.264-3.31,1.264-5.938c0-2.539-0.439-4.513-1.305-5.867 c-0.891-1.389-2.209-2.094-3.918-2.094c-1.751,0-3.074,0.677-3.933,2.011c-0.836,1.3-1.26,3.301-1.26,5.95 c0,2.566,0.438,4.548,1.301,5.892c0.886,1.379,2.195,2.079,3.892,2.079C38.248,39.793,39.58,39.109,40.443,37.76z M36.484,37.826 c-1.029,0-1.758-0.443-2.229-1.356c-0.492-0.955-0.741-2.519-0.741-4.648c0-2.131,0.25-3.691,0.741-4.638 c0.47-0.906,1.199-1.347,2.229-1.347c1.042,0,1.776,0.447,2.243,1.365c0.489,0.961,0.737,2.515,0.737,4.619 c0,2.103-0.248,3.661-0.738,4.629C38.259,37.376,37.526,37.826,36.484,37.826z"/> <path fill="#6699CC" d="M48.491,23.861c-1.752,0-3.074,0.677-3.932,2.011c-0.837,1.299-1.261,3.3-1.261,5.95 c0,2.567,0.438,4.55,1.302,5.892c0.884,1.38,2.193,2.079,3.891,2.079c1.765,0,3.097-0.685,3.959-2.033 c0.839-1.313,1.265-3.311,1.265-5.938c0-2.538-0.439-4.512-1.306-5.867C51.52,24.566,50.201,23.861,48.491,23.861z M48.491,37.826 c-1.029,0-1.759-0.443-2.229-1.356c-0.491-0.953-0.741-2.517-0.741-4.648c0-2.132,0.249-3.692,0.741-4.638 c0.47-0.906,1.198-1.346,2.229-1.346c1.042,0,1.775,0.447,2.243,1.365c0.488,0.96,0.736,2.514,0.736,4.619 c0,2.104-0.248,3.662-0.736,4.629C50.266,37.376,49.532,37.826,48.491,37.826z"/> <path fill="#6699CC" d="M17.361,5h-0.05c-0.483,0-0.85,0.392-0.85,0.875s0.417,0.875,0.9,0.875c0.483,0,0.875-0.392,0.875-0.875 S17.845,5,17.361,5z"/> <path fill="#6699CC" d="M20.898,5h-0.086c-0.483,0-0.832,0.392-0.832,0.875s0.435,0.875,0.918,0.875s0.875-0.392,0.875-0.875 S21.382,5,20.898,5z"/> <path fill="#6699CC" d="M24.398,5h-0.05c-0.483,0-0.85,0.392-0.85,0.875s0.417,0.875,0.9,0.875s0.875-0.392,0.875-0.875 S24.882,5,24.398,5z"/> <path fill="#6699CC" d="M37.626,59.27c0,5.621,4.574,10.195,10.196,10.195c5.623,0,10.197-4.574,10.197-10.195 c0-5.623-4.574-10.197-10.197-10.197C42.2,49.07,37.626,53.646,37.626,59.27z M56.27,59.27c0,4.656-3.789,8.445-8.446,8.445 s-8.446-3.789-8.446-8.445c0-4.658,3.789-8.447,8.446-8.447C52.48,50.82,56.27,54.609,56.27,59.27z"/> <path fill="#6699CC" d="M42.833,64.257c0.171,0.171,0.396,0.257,0.619,0.257c0.223,0,0.448-0.086,0.618-0.257l3.753-3.752 l3.752,3.752c0.171,0.171,0.396,0.257,0.618,0.257c0.224,0,0.449-0.086,0.619-0.257c0.342-0.342,0.342-0.896,0-1.237l-3.752-3.752 l3.752-3.752c0.342-0.343,0.342-0.896,0-1.238s-0.896-0.342-1.237,0l-3.752,3.752l-3.753-3.752c-0.342-0.342-0.896-0.342-1.237,0 c-0.341,0.342-0.341,0.896,0,1.238l3.752,3.752l-3.752,3.752C42.492,63.361,42.492,63.915,42.833,64.257z"/> <path fill="#6699CC" d="M62.77,13.878c-0.041-0.079-0.082-0.158-0.148-0.225L50.535,1.569c-0.004-0.003-0.01-0.004-0.012-0.008 c-0.08-0.076-0.17-0.138-0.272-0.181c-0.106-0.044-0.222-0.067-0.335-0.067H14.812c-1.585,0-2.875,1.29-2.875,2.875v66.625 c0,1.586,1.29,2.875,2.875,2.875h45.377c1.584,0,2.875-1.289,2.875-2.875v-56.29C63.063,14.265,62.947,14.039,62.77,13.878z M50.791,4.3l9.348,9.348h-8.223c-0.62,0-1.125-0.505-1.125-1.125V4.3z M13.687,4.188c0-0.621,0.504-1.125,1.125-1.125h34.229 v6.126H13.687V4.188z M61.313,70.813c0,0.621-0.504,1.125-1.125,1.125H14.812c-0.62,0-1.125-0.504-1.125-1.125V10.938h35.354v1.584 c0,1.585,1.29,2.875,2.875,2.875h9.396V70.813z"/> </g> </svg> assets/img/icons/purge-front.svg 0000777 00000005562 15251157102 0012744 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve"> <g> <path fill="#6699CC" d="M63.657,12.237c-0.046-0.116-0.109-0.227-0.205-0.318L52.954,1.835c-0.028-0.027-0.065-0.039-0.097-0.062 c-0.061-0.043-0.115-0.089-0.187-0.117c-0.067-0.027-0.144-0.034-0.215-0.043c-0.037-0.005-0.069-0.022-0.108-0.022H52.33h-0.001 H14.114c-1.577,0-2.86,1.283-2.86,2.859v66.923c0,1.577,1.283,2.859,2.86,2.859h46.773c1.575,0,2.858-1.282,2.858-2.859V12.608 C63.746,12.474,63.711,12.351,63.657,12.237z M53.223,4.52l7.51,7.213h-7.395c-0.064,0-0.115-0.052-0.115-0.118V4.52z M61.996,71.373c0,0.611-0.498,1.109-1.109,1.109H14.114c-0.612,0-1.11-0.498-1.11-1.109V4.45c0-0.612,0.498-1.109,1.11-1.109 h37.359v8.274c0,1.03,0.836,1.868,1.864,1.868h8.658L61.996,71.373L61.996,71.373z"/> <path fill="#6699CC" d="M45.43,44.486c-6.656,0-12.072,5.416-12.072,12.072c0,6.655,5.416,12.071,12.072,12.071 c6.655,0,12.071-5.415,12.071-12.071S52.085,44.486,45.43,44.486z M45.43,66.881c-5.691,0-10.322-4.63-10.322-10.32 s4.63-10.321,10.322-10.321c5.69,0,10.321,4.631,10.321,10.321S51.12,66.881,45.43,66.881z"/> <path fill="#6699CC" d="M51.299,50.689c-0.342-0.342-0.896-0.342-1.238,0L45.43,55.32l-4.631-4.631 c-0.342-0.342-0.896-0.342-1.238,0c-0.34,0.342-0.34,0.896,0,1.236l4.631,4.633l-4.631,4.631c-0.34,0.342-0.34,0.896,0,1.236 c0.172,0.172,0.396,0.258,0.619,0.258s0.448-0.086,0.619-0.258l4.631-4.631l4.631,4.631c0.172,0.172,0.396,0.258,0.619,0.258 s0.448-0.086,0.619-0.258c0.342-0.342,0.342-0.896,0-1.236l-4.631-4.631l4.631-4.633C51.641,51.586,51.641,51.031,51.299,50.689z" /> <path fill="#6699CC" d="M19.826,18.879c0,0.483,0.392,0.875,0.875,0.875h33.598c0.483,0,0.875-0.392,0.875-0.875 s-0.392-0.875-0.875-0.875H20.701C20.218,18.004,19.826,18.396,19.826,18.879z"/> <path fill="#6699CC" d="M20.701,29.511h33.598c0.483,0,0.875-0.392,0.875-0.875c0-0.483-0.392-0.875-0.875-0.875H20.701 c-0.483,0-0.875,0.392-0.875,0.875C19.826,29.119,20.218,29.511,20.701,29.511z"/> <path fill="#6699CC" d="M20.701,39.27h33.598c0.483,0,0.875-0.393,0.875-0.875s-0.392-0.875-0.875-0.875H20.701 c-0.483,0-0.875,0.392-0.875,0.875S20.218,39.27,20.701,39.27z"/> <path fill="#6699CC" d="M30.125,47.275h-9.423c-0.483,0-0.875,0.393-0.875,0.875s0.392,0.875,0.875,0.875h9.423 c0.483,0,0.875-0.393,0.875-0.875S30.608,47.275,30.125,47.275z"/> <path fill="#6699CC" d="M27.75,57.034h-7.049c-0.483,0-0.875,0.392-0.875,0.875s0.392,0.875,0.875,0.875h7.049 c0.483,0,0.875-0.392,0.875-0.875S28.233,57.034,27.75,57.034z"/> </g> </svg> assets/img/lscwp_grayscale_font-icon_22px.svg 0000777 00000003357 15251157102 0015372 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="22px" height="22px" viewBox="0 0 22 22" enable-background="new 0 0 22 22" xml:space="preserve"> <rect x="4" y="4" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -4.5563 11)" fill="#777777" width="14" height="14"/> <path fill="#FFFFFF" d="M13.039,7.954c-0.063-0.128-0.193-0.21-0.336-0.21c-0.119,0-0.207,0.054-0.268,0.102L9.84,9.838 c-0.208,0.158-0.254,0.461-0.104,0.675l0.813,1.17l-1.521,1.93c-0.141,0.18-0.113,0.336-0.065,0.434 c0.06,0.125,0.194,0.209,0.334,0.209c0.123,0,0.208-0.055,0.271-0.102l2.593-1.992c0.157-0.121,0.211-0.33,0.146-0.578 c-0.012-0.041-0.027-0.076-0.052-0.114l-0.803-1.154l1.521-1.93C13.111,8.207,13.086,8.052,13.039,7.954z"/> <path fill="#AAAAAA" d="M21.771,10.677L11.323,0.229c-0.088-0.086-0.202-0.135-0.324-0.135c-0.123,0-0.236,0.048-0.324,0.134 L0.228,10.677c-0.086,0.088-0.134,0.201-0.134,0.324c0,0.122,0.048,0.236,0.134,0.324l10.448,10.446 c0.087,0.088,0.202,0.135,0.324,0.135s0.237-0.047,0.324-0.135L21.77,11.324c0.088-0.085,0.138-0.201,0.138-0.323 C21.904,10.879,21.855,10.765,21.771,10.677z M11.424,1.625l8.956,8.956h-2.989c-0.017,0-0.035,0.001-0.052,0.003l-5.915-5.913 V1.625z M10.584,1.617v3.045l-5.92,5.919H1.62L10.584,1.617z M10.584,20.387L1.62,11.421h3.044l5.92,5.918V20.387z M10.999,16.504 l-5.501-5.502L10.999,5.5l5.503,5.502L10.999,16.504z M11.424,20.377v-3.045l5.913-5.914c0.019,0.001,0.037,0.003,0.054,0.003h2.989 L11.424,20.377z"/> </svg> assets/img/lscwp_font-icon_32px.svg 0000777 00000004632 15251157102 0013336 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve"> <path fill="#FFCE00" d="M18.955,11.586c-0.09-0.185-0.281-0.305-0.486-0.305c-0.174,0-0.301,0.079-0.389,0.147l-3.761,2.888 c-0.301,0.229-0.368,0.669-0.151,0.979l1.179,1.696l-2.204,2.796c-0.204,0.262-0.165,0.486-0.096,0.629 c0.086,0.181,0.281,0.303,0.484,0.303c0.178,0,0.302-0.081,0.391-0.149l3.76-2.887c0.229-0.173,0.305-0.478,0.209-0.836 c-0.016-0.059-0.039-0.111-0.074-0.166l-1.164-1.672l2.205-2.797C19.061,11.952,19.023,11.729,18.955,11.586z"/> <path fill="#00CCFF" d="M31.611,15.531L16.469,0.389C16.344,0.264,16.177,0.194,16,0.194c-0.178,0-0.344,0.069-0.47,0.194 L0.389,15.531C0.264,15.656,0.195,15.822,0.195,16c0,0.177,0.069,0.344,0.194,0.469L15.531,31.61 c0.126,0.126,0.292,0.194,0.47,0.194c0.177,0,0.344-0.068,0.469-0.194l15.142-15.142c0.125-0.124,0.195-0.291,0.195-0.469 C31.807,15.823,31.736,15.656,31.611,15.531z M16.616,2.412l12.98,12.979h-4.334c-0.023,0-0.051,0.002-0.074,0.005l-8.572-8.57 V2.412z M15.398,2.399v4.413l-8.579,8.578H2.406L15.398,2.399z M15.398,29.601L2.406,16.609h4.413l8.579,8.578V29.601z M16,23.974 L8.027,16L16,8.026L23.975,16L16,23.974z M16.616,29.587v-4.413l8.57-8.569c0.025,0.003,0.053,0.005,0.076,0.005h4.334 L16.616,29.587z"/> <path fill="#3399CC" d="M16,8.026L8.027,16L16,23.974L23.975,16L16,8.026z M17.816,16.681c0.035,0.055,0.059,0.107,0.074,0.166 c0.096,0.358,0.02,0.663-0.209,0.836l-3.76,2.887c-0.089,0.068-0.213,0.149-0.391,0.149c-0.203,0-0.398-0.122-0.484-0.303 c-0.069-0.143-0.108-0.367,0.096-0.629l2.204-2.796l-1.179-1.696c-0.217-0.31-0.149-0.749,0.151-0.979l3.761-2.888 c0.088-0.068,0.215-0.147,0.389-0.147c0.205,0,0.396,0.12,0.486,0.305c0.068,0.143,0.105,0.366-0.098,0.626l-2.205,2.797 L17.816,16.681z M25.188,15.396l-8.572-8.57V2.412l12.98,12.979h-4.334C25.238,15.391,25.211,15.393,25.188,15.396z M6.819,15.391 H2.406L15.398,2.399v4.413L6.819,15.391z M6.819,16.609l8.579,8.578v4.413L2.406,16.609H6.819z M25.262,16.609h4.334l-12.98,12.978 v-4.413l8.57-8.569C25.211,16.607,25.238,16.609,25.262,16.609z"/> </svg> assets/img/Litespeed.icon.svg 0000777 00000005167 15251157102 0012227 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 300 300" enable-background="new 0 0 300 300" xml:space="preserve"> <g> <path fill="#5E8CDA" d="M254.859,146.258l-68.508-68.516l-29.203,37.055l31.461,31.461c2.922,2.922,2.922,7.68,0,10.57 l-9.086,9.086c0,0,6.148,9.195,6.414,9.75c1.422,2.836,1.742,9.492-2.273,12.547l-71.57,54.969c0,18.422-0.016,56.336,0,56.344 c0.031,0,142.766-142.695,142.766-142.695C257.75,153.898,257.75,149.18,254.859,146.258z"/> <path fill="#093071" d="M95.703,154.891c-2.898-2.875-2.898-7.641,0-10.531l9.109-9.125l-6.219-8.938 c-2.977-4.219-2.039-10.203,2.055-13.344l71.602-54.938l0.023-56.328l-0.023-0.031l-0.039-0.047L29.477,144.359 c-2.922,2.891-2.922,7.656,0,10.539l68.5,68.508l29.219-37.055L95.703,154.891z"/> </g> <path fill="#5E8CDA" d="M208.297,35.727c1.092,0,2.147,0.654,2.624,1.624c0.804,1.658-0.217,3.189-1.236,4.495l-0.04,0.051 l-62.727,79.64c-0.829,1.05-0.891,3.144-0.132,4.218c0.339,0.491,33.879,49.111,35.027,50.794c1.342,1.918,1.425,7.623-1.657,9.978 L79.348,263.915c-1.305,0.993-2.252,1.535-3.492,1.546c-0.99-0.082-2.015-0.756-2.44-1.601c-0.783-1.612,0.143-3.176,1.253-4.616 l62.727-79.607c0.83-1.114,0.908-3.081,0.152-4.231l-35.019-50.348c-2.308-3.283-1.585-7.943,1.611-10.39l100.851-77.445 C206.396,36.146,207.321,35.727,208.297,35.727 M208.297,34.727c-1.211,0-2.336,0.492-3.914,1.703l-100.852,77.445 c-3.625,2.773-4.445,8.023-1.82,11.758l35.016,50.344c0.508,0.773,0.438,2.297-0.133,3.063l-62.711,79.586 c-0.813,1.055-2.523,3.289-1.367,5.672c0.594,1.18,1.945,2.07,3.305,2.164c1.555,0,2.695-0.656,4.133-1.75l100.813-77.391 c3.508-2.68,3.523-8.977,1.867-11.344c-1.156-1.695-35.023-50.789-35.023-50.789c-0.508-0.719-0.461-2.328,0.094-3.031 l62.727-79.641c0.805-1.031,2.555-3.203,1.391-5.602C211.172,35.594,209.766,34.727,208.297,34.727L208.297,34.727z"/> <path fill="#F5CD21" d="M178.992,176.898c0.82,1.25,1.563,5.867-0.477,7.422L77.641,261.75c-0.836,0.664-1.391,0.984-1.617,0.961 c-0.359,0.023-0.102-0.586,0.82-1.797l62.688-79.555c1.586-2.039,1.688-5.414,0.227-7.516l-34.977-50.367 C104.781,123.477,178.188,175.664,178.992,176.898z"/> <path fill="#FDDD75" d="M178.992,176.898l-34.461-49.555c-1.438-2.125-1.336-5.492,0.242-7.508l62.695-79.578 c0.945-1.203,1.164-1.781,0.828-1.781c-0.227,0-0.805,0.281-1.625,0.945l-100.875,77.422c-2.016,1.555-2.477,4.547-1.016,6.633 L178.992,176.898z"/> </svg> assets/img/iconlscwp.svg 0000777 00000002065 15251157102 0011355 0 ustar 00 <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg xmlns="http://www.w3.org/2000/svg"> <metadata>LiteSpeed Technologies</metadata> <defs> <font id="iconlscwp" horiz-adv-x="1000" > <font-face font-family="iconlscwp" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="848" descent="-152" /> <missing-glyph horiz-adv-x="1000" /> <glyph glyph-name="lscwp_font-icon" unicode="" d="M590 467l-69-88 36-52c1-2 2-4 3-6 3-11 0-20-7-26l-118-91c-3-2-7-4-13-4-6 0-12 3-15 9-2 5-3 12 3 20l69 88-37 53c-6 10-4 24 5 31l118 91c3 2 7 4 13 4 6 0 12-3 15-9 2-5 3-12-3-20z m407-119c0-6-2-11-6-15l-476-476c-4-4-9-6-15-6-6 0-11 2-15 6l-476 476c-4 4-6 9-6 15s2 11 6 15l476 476c4 4 9 6 15 6 6 0 11-2 15-6l476-476c4-4 6-9 6-15z m-478 427v-138l270-270c1 0 2 0 2 0h137l-409 408z m-19-176l-251-251 251-251 251 251-251 251z m-427-232h138l270 270v139l-408-409z m408-447v139l-270 270h-138l408-409z m447 409h-137c0 0-1 0-2 0l-270-269v-139l409 408z" horiz-adv-x="1000" /> </font> </defs> </svg> assets/img/lscwp-logo_90x90.png 0000777 00000003224 15251157102 0012276 0 ustar 00 �PNG IHDR Z Z v�0 �PLTEGpL�����������u������������������ռ�������а�������˝��������������z}jknsvy���Kdr s�3��hik c�5������ �� �� ��M�� ��efi �� S y�_�J��1 Ds��AԤ _ad���� ���ج ��;r�{����ss/:GQ 7im����,��X '\]_b J#Do[]`uI�� tRNS `���(��M lIDATx���!EQ,��_�w���r��yj��m��EF�� ��f@�1"�!�� �2�I[d��e���fӁCL)��I>��a���n��w��g/�i�p��I)�E�<B] ���mh.��Kپ�W���Bb��sǭ�c��#O����'8��Z�6P��o9�,C���ma�6�mk�:�i]�Æl��hz�m4� u \��\L�i؞�4t4���K����X�E4�~л_��??��Ū��<��A�L�w�jv������ ��p�Q�����i�ӏu�|hO���-ڸ��^ t��p<yj}%����{[w��9����I�sؕܠmՅtsy��<������������lz:���ZZv�LH���9mJt�܀�̦؍;��h�AM����^��sАn���GI�6�r��}�!kh�e�Z�yp�R�M�l��,���Bȋ�p�1��r0/��z�l?T�٫��8�<����52����f���feyq!�c�h{ui���=�3�Zؐ2�w\S�|<�&mD�$MrKE71�Z��acE�tb�\����Ey�M2�$����ֹ<�� ��k�ln^3�/�5�$m8~�u.� Os�:���$�䒝$�����n6aS�Tʳɕ�u��.֔7,����DV�6l�!o����F���xټ��ުf��F6hFT4�g��h4�8� �����l~,`�W��g�� �-��it����$�ɀ}X����u��r���ē$i<%�{��&EOG,�?���S#> d�ٛח�����2�Y���I�i�=ˆ8N�m���-dDʉ��,���F�;P���fR�tN�!��8��Q�������k�6mbDL��|<9��{;�8@>bB����Hʒ�i ��(2"m �GȘ]�=�m�l�oK��[6:�벌�T���+e�ە���bJrLr\Ƞ������\�%�X�b��I��E&��!��(-�?w� { �T�o�r��>.��O'��O�����p!��5EE�lG�/#m��<�:��]L!B6AW�6`��s\�|���͠wE�vN9�ʷi�fT�� ��2��D;Jڦe���;�3�^�A�ֶCt�U��Yv��7����hӁ�ֿ>�C�o�$���Վ^@�t4p��H��Ӭ�-����u�s�e������Y�܋"�|��?Xt�f��2l��t�{�FB���>�@%�,t���x��9C�+Y�Wuf�ŏ��n[�2ֻH�>'�Մ���O:j��ky^; ���9��.Q��,�����w�RL��S�N�vu4d��rK##�a�h��k:k�S' ��ɚX8��?}�y�mY���O���r���������yr��O��?��:�E�V IEND�B`� assets/img/quic-cloud-logo-light_stack_300px.png 0000777 00000007133 15251157102 0015571 0 ustar 00 �PNG IHDR , , N�~G �PLTE >PY>PY>PY>PY>PY>PY>PY>PY>PY>PY>PY>PY>PY>PY>PY\ks\ks\ks\ks\ks\ks\ks\ks\ks\ks\ks\ks\ks\ks\ksp��p��p��p��p��p��p��p��p��p��p��p��p��p��p��f��f��f��f��f��f��f��f��f��f��f��f��f��f��f��>PY\ksp��f��^ۧ_ =tRNS 0@P`p���������������p`P@0 0@P`p���������������p`P@0 ���, IDATx��k[�8�(2�"���P�@���x��UmmK�$4I�0�{�e�ҡ7o���� `�0����!��>6-���Y�����������'�Ge1F���t=&�`y�s���cjё���a�S��p2� ך���qU�q8#9={z\6��\,r����,4���9�N7��3AG�n{�сL�����AM���IX�O&/��6�ra"��wu��a�n�\\"���� �U7��\1l�=.Tm�����tٽ쮟U�~0�]��U��;��T���,���Z0�3j{�"2s��lM)�u�-tQ̎�ǖ�X�8tI�m������ǖ��x�T*3����E��mYA^�u�� �z�揭Yj!jD�G����� �m��"|������� y�P�%.�3V�9�Ѱ�q>D�� ��sE X�[6��G��Ä�ɖI�-F�g^&�,�;Ĕf�۹c�"�%0z��!����S��9�l�Y�v�H���jj������5C"���X��U��h*��2��ٱ%V�Aߎ#�bKw�����4+`9UpA~,�"l� G�;��)%G�.��sL��DKB+�bl�SKlHS 6V�S~l͕-�AV�%=���ޛ,�}z���Rm2=�W���f��}+����^>�������y�"uJ7��SK#we=ov<>�.�����Y�2�~�����?�Xʍ����>6O��V�7W,F�u��M��^S�%�+i���g=o�<�n`��b���i)��Af"����ñ������m� �md�����ų���I��w%�PM�z֟M���60\�V�&|�O�qlI��i��m�,��m���Ji�Rq�V�>(�fR�]MY.s���ǦD[2b��|cE2�]~�m-e�Z ���є:�1�-� C���7�������j�6�Bsg���M���y�����p_�o<�>�l`��ʲ8L��͌ؒ��;�o�`t��>i�5�-ݖ5������ �k<�㴥�BqW,�˿-�26�m�_n�^��W���MɈ-��Գ��S��G�濇���gⰄ}^}��[=,#�mN�f|��ؚy�Xa���Og ���x��w�J���U嫒�bQ,�Gƙ�GQ Nnz��&�xl��45w=���~̟�֖�����5�bl��#��/�-=��#p?.�A�_e��e�o`�|$�Ԃ(1)��Bb1�[:��9V���mوb�- v�akN��"Ŗ����� �ֻ[��wwD٦~Xƶ8�����5����lJ-x#��$��#����SzJ-��U��]�4_q�]�[��^���w���/�Ʀ��/6a����[F}>�M���-�}�>�]�*�ϗ�7��+6�7y47�#clʭ�ߞ�)uȘ�1̏"�Ҍ�KL��uE�a�04)�eO�ZQMv=�Ɂ������yZ+��9�����������_���d{N;�o-��� P�w� G��п��z�C3�\�� [� L����? �JrD���ZçV-�4��(���R�=*g����S=A(#�t�s��VN Y�@��O��G���zss^-!N�U�5Wi�e)�����.5d�6W4��eU�g>E<(!�NJ@�$(��$���8PAV}/����gIHV5q�F��h���9���"W�i9�~\ĶdE��_��D����_V53vO� ��/�䫈�X�d�����ٲ�ޖ[�qd����Cd���fQ[���*gnVQ�]V��Zѹ��\_�CZ��1�G�j(�]g���)�Aܓ�bK����+��,kp�ޣ�'�Һؑ1�u����f��]�.�s�=W�U^�T��uu���5�u�������!�0��;��� �Q&gAm�ɪ�� T�-����tWZ��^XN��푽N�_���v�|o�����>�Yez��|�GV�X� �7���Z�LV誋�1e%]�n#����Y�Y��Q�����3�=���M˺�/��wdǿ�e]�k{�~��>-�ɓ�� w8d�9 ��^m���A�t�� Y�u��6UVJ��P�CV�cRs����ZJ�Ut$f�58@� ��h-�� �ƍ��!�����3H|\��gW�du ��>E�I�H9��++ߔ�6"�t����_o��� ��ɲ�,Y�WVx8�B/�!��] j���)�6,@�,�����0Fز�G�Ou���Q+���,�m�e�]���K��+� bp���M�t��Ҟ�J����=b� ��(g�ˢ����w��#�Q$�d!�e�r�*�f�q;=��TFqY��TYmqY��d��*#?���eE��Q�#�,t�m����.R�j��%GVG4�Z<����N}��T�g)Y��A�ް�� qJM�5U�8?|��|����.ˬl��"u�E82z�%�<�h� %��d��:�Ӵ�ڊ�Z�s,�Ѹ\`����`#x<����䮝7|?q�\����������O2/�w�,�%�4��R�_S����4Y��j1��8�d���O8kb+m-�ઃ֎,�iYk@� �MhŴ���[����f�M�0���-�`�a?B�iI��?V�H� ��d���|�H�'��p�ޟ��+�E�� <�t��u=� 5X-g�FT��M��3^\ɍ87����Oy�YO�w=ț?X>����6�����Y��Л�ٷ�F{���CB㦈�dV�/��R�Y�fY�iQ�&����w+�Nk�� �4�S�^�)o�~�ſ�ԣ,�4�2&3S�V�2���lw�6��;x��B��f#Zu�ծ!B���$sQ�q�W����fe�˝��(�L�[&���� IS����Y-a$���� �BX��.�p��w�㙣���~z�[@Xb椇�g��MP��z��s��㠧^5�nd�S��R��H�u��8��"YR�f�W���Lq����b��?�S��d��n�T�A-ÂC����<���~�Q���94'̝腸7�,{V�hr��XԈ��e�d�����}���X>�i����?��Э�7\�ύ��|F�� M��$���Y�kԃ9ކv��d��15]�V��KVb�S���n��-F�+K�o���E�of�O��\�ԏ�rw|Џ�w��ꁎF"""""""""""""""""""""""""""""""""""""�z�Θ����c IEND�B`� assets/js/guest.docref.js 0000777 00000000367 15251157102 0011424 0 ustar 00 var litespeed_docref = sessionStorage.getItem('litespeed_docref'); if (litespeed_docref) { Object.defineProperty(document, 'referrer', { get: function () { return litespeed_docref; }, }); sessionStorage.removeItem('litespeed_docref'); } assets/js/guest.js 0000777 00000001344 15251157102 0010157 0 ustar 00 var litespeed_vary = document.cookie.replace(/(?:(?:^|.*;\s*)_lscache_vary\s*\=\s*([^;]*).*$)|^.*$/, '$1'); if (!litespeed_vary) { // Note: as the vary may be changed in Login Cookie option, even the visitor doesn't have this cookie, it doesn't mean the visitor doesn't have the vary, so still need PHP side to decide if need to set vary or not. fetch('litespeed_url', { method: 'POST', cache: 'no-cache', redirect: 'follow', }) .then(response => response.json()) .then(data => { console.log(data); if (data.hasOwnProperty('reload') && data.reload == 'yes') { // Save doc.ref for organic traffic usage sessionStorage.setItem('litespeed_docref', document.referrer); window.location.reload(true); } }); } assets/js/guest.docref.min.js 0000777 00000000327 15251157102 0012202 0 ustar 00 var litespeed_docref=sessionStorage.getItem("litespeed_docref");litespeed_docref&&(Object.defineProperty(document,"referrer",{get:function(){return litespeed_docref}}),sessionStorage.removeItem("litespeed_docref")); assets/js/litespeed-cache-admin.js 0000777 00000026001 15251157102 0013132 0 ustar 00 (function ($) { 'use strict'; /** * All of the code for your public-facing JavaScript source * should reside in this file. * * Note: It has been assumed you will write jQuery code here, so the * $ function reference has been prepared for usage within the scope * of this function. * * This enables you to define handlers, for when the DOM is ready: * * $(function() { * * }) ; * * When the window is loaded: * * $( window ).load(function() { * * }) ; * * ...and/or other possibilities. * * Ideally, it is not considered best practise to attach more than a * single DOM-ready or window-load handler for a particular page. * Although scripts in the WordPress core, Plugins and Themes may be * practising this, we should strive to set a better example in our own work. */ jQuery(document).ready(function () { /************** Common LiteSpeed JS **************/ // Link confirm $('[data-litespeed-cfm]').on('click', function (event) { var cfm_txt = $.trim($(this).data('litespeed-cfm')).replace(/\\n/g, '\n'); if (cfm_txt === '') { return true; } if (confirm(cfm_txt)) { return true; } event.preventDefault(); event.stopImmediatePropagation(); return false; }); /************** LSWCP JS ****************/ // page tab switch functionality (function () { var hash = window.location.hash.substr(1); var $tabs = $('[data-litespeed-tab]'); var $subtabs = $('[data-litespeed-subtab]'); // Handle tab and subtab events var tab_action = function ($elems, type) { type = litespeed_tab_type(type); var data = 'litespeed-' + type; $elems.on('click', function (_event) { litespeed_display_tab($(this).data(data), type); document.cookie = 'litespeed_' + type + '=' + $(this).data(data); $(this).blur(); }); }; tab_action($tabs); tab_action($subtabs, 'subtab'); if (!$tabs.length > 0) { // No tabs exist return; } // Find hash in tabs and subtabs var $hash_tab = $tabs.filter('[data-litespeed-tab="' + hash + '"]:first'); var $hash_subtab = $subtabs.filter('[data-litespeed-subtab="' + hash + '"]:first'); // Find tab name var $subtab; var $tab; var tab_name; if ($hash_subtab.length > 0) { // Hash is a subtab $tab = $hash_subtab.closest('[data-litespeed-layout]'); if ($tab.length > 0) { $subtab = $hash_subtab; tab_name = $tab.data('litespeed-layout'); } } if (typeof $tab === 'undefined' || $tab.length < 1) { // Maybe hash is a tab $tab = $hash_tab; if ($tab.length < 1) { // Maybe tab cookie exists $tab = litespeed_tab_cookie($tabs); if ($tab.length < 1) { // Use the first tab by default $tab = $tabs.first(); } } if (typeof tab_name === 'undefined') { tab_name = $tab.data('litespeed-tab'); } } // Always display a tab litespeed_display_tab(tab_name); // Find subtab name if (typeof $subtab === 'undefined' || $subtab.length < 1) { $subtab = litespeed_tab_cookie($subtabs, 'subtab'); } if ($subtab.length > 0) { var subtab_name = $subtab.data('litespeed-subtab'); // Display a subtab litespeed_display_tab(subtab_name, 'subtab'); } })(); /******************** Clear whm msg ********************/ $(document).on('click', '.lscwp-whm-notice .notice-dismiss', function () { $.get(litespeed_data.ajax_url_dismiss_whm); }); /******************** Clear rule conflict msg ********************/ $(document).on('click', '.lscwp-notice-ruleconflict .notice-dismiss', function () { $.get(litespeed_data.ajax_url_dismiss_ruleconflict); }); /** Accesskey **/ $('[litespeed-accesskey]').map(function () { var thiskey = $(this).attr('litespeed-accesskey'); if (thiskey == '') { return; } // Append shortcut info to existing title or set default var currentTitle = $(this).attr('title'); if (currentTitle) { $(this).attr('title', currentTitle + ' (Shortcut: ' + thiskey.toLocaleUpperCase() + ')'); } else { $(this).attr('title', 'Shortcut : ' + thiskey.toLocaleUpperCase()); } var that = this; $(document).on('keydown', function (e) { if ($(':input:focus').length) return; if (e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) return; if (e.key && e.key.toLowerCase() === thiskey.toLowerCase()) { $(that)[0].click(); } }); }); /** Lets copy one more submit button **/ if ($('input[name="LSCWP_CTRL"]').length > 0) { var btn = $('input.litespeed-duplicate-float'); btn.clone().addClass('litespeed-float-submit').removeAttr('id').insertAfter(btn); } if ($('input[id="LSCWP_NONCE"]').length > 0) { $('input[id="LSCWP_NONCE"]').removeAttr('id'); } /** * Human readable time conversation * @since 3.0 */ if ($('[data-litespeed-readable]').length > 0) { $('[data-litespeed-readable]').each(function (index, el) { var that = this; var $input = $(this).siblings('input[type="text"]'); var txt = litespeed_readable_time($input.val()); $(that).html(txt ? '= ' + txt : ''); $input.on('keyup', function (event) { var txt = litespeed_readable_time($(this).val()); $(that).html(txt ? '= ' + txt : ''); }); }); } /** * Click only once */ if ($('[data-litespeed-onlyonce]').length > 0) { $('[data-litespeed-onlyonce]').on('click', function (e) { if ($(this).hasClass('disabled')) { e.preventDefault(); } $(this).addClass('disabled'); }); } }); })(jQuery); /** * Plural handler */ function litespeed_plural($num, $txt) { if ($num > 1) return $num + ' ' + $txt + 's'; return $num + ' ' + $txt; } /** * Convert seconds to readable time */ function litespeed_readable_time(seconds) { if (seconds < 60) { return ''; } var second = Math.floor(seconds % 60); var minute = Math.floor((seconds / 60) % 60); var hour = Math.floor((seconds / 3600) % 24); var day = Math.floor((seconds / 3600 / 24) % 7); var week = Math.floor(seconds / 3600 / 24 / 7); var str = ''; if (week) str += ' ' + litespeed_plural(week, 'week'); if (day) str += ' ' + litespeed_plural(day, 'day'); if (hour) str += ' ' + litespeed_plural(hour, 'hour'); if (minute) str += ' ' + litespeed_plural(minute, 'minute'); if (second) str += ' ' + litespeed_plural(second, 'second'); return str; } /** * Normalize specified tab type * @since 4.7 */ function litespeed_tab_type(type) { return 'subtab' === type ? type : 'tab'; } /** * Sniff cookies for tab and subtab * @since 4.7 */ function litespeed_tab_cookie($elems, type) { type = litespeed_tab_type(type); var re = new RegExp('(?:^|.*;)\\s*litespeed_' + type + '\\s*=\\s*([^;]*).*$|^.*$', 'ms'); var name = document.cookie.replace(re, '$1'); return $elems.filter('[data-litespeed-' + type + '="' + name + '"]:first'); } function litespeed_display_tab(name, type) { type = litespeed_tab_type(type); var $tabs; var $layouts; var classname; var layout_type; if ('subtab' === type) { classname = 'focus'; layout_type = 'sublayout'; $tabs = jQuery('[data-litespeed-subtab="' + name + '"]') .siblings('[data-litespeed-subtab]') .addBack(); $layouts = jQuery('[data-litespeed-sublayout="' + name + '"]') .siblings('[data-litespeed-sublayout]') .addBack(); } else { // Maybe handle subtabs var $subtabs = jQuery('[data-litespeed-layout="' + name + '"] [data-litespeed-subtab]'); if ($subtabs.length > 0) { // Find subtab name var $subtab = litespeed_tab_cookie($subtabs, 'subtab'); if ($subtab.length < 1) { $subtab = jQuery('[data-litespeed-layout="' + name + '"] [data-litespeed-subtab]:first'); } if ($subtab.length > 0) { var subtab_name = $subtab.data('litespeed-subtab'); // Display a subtab litespeed_display_tab(subtab_name, 'subtab'); } } classname = 'nav-tab-active'; layout_type = 'layout'; $tabs = jQuery('[data-litespeed-tab]'); $layouts = jQuery('[data-litespeed-layout]'); } $tabs.removeClass(classname); $tabs.filter('[data-litespeed-' + type + '="' + name + '"]').addClass(classname); $layouts.hide(); $layouts.filter('[data-litespeed-' + layout_type + '="' + name + '"]').show(); } function litespeed_copy_to_clipboard(elementId, clickedElement) { var range = document.createRange(); range.selectNode(document.getElementById(elementId)); window.getSelection().removeAllRanges(); window.getSelection().addRange(range); document.execCommand('copy'); window.getSelection().removeAllRanges(); clickedElement.setAttribute('aria-label', 'Copied!'); } // Dark mode toggle functionality function litespeed_init_dark_mode() { 'use strict'; // Only add toggle on LiteSpeed pages if (window.location.search.indexOf('page=litespeed') === -1) return; // Create toggle button var toggleBtn = document.createElement('button'); toggleBtn.className = 'litespeed-dark-mode-toggle'; toggleBtn.setAttribute('title', 'Toggle Dark Mode'); toggleBtn.setAttribute('aria-label', 'Toggle Dark Mode'); toggleBtn.setAttribute('litespeed-accesskey', 'z'); toggleBtn.setAttribute('data-litespeed-noprefix', true); function applyDarkMode() { var prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; var savedPreference = localStorage.getItem('litespeed-dark-preference'); var isDark = savedPreference ? savedPreference === 'dark' : prefersDark; // Determine needed class (only when overriding browser preference) var needsClass; if (savedPreference === 'dark' && !prefersDark) { needsClass = 'litespeed-darkmode'; } else if (savedPreference === 'light' && prefersDark) { needsClass = 'litespeed-lightmode'; } // Only update DOM if class needs to change if (needsClass) { if (!document.body.classList.contains(needsClass)) { document.body.classList.remove('litespeed-darkmode', 'litespeed-lightmode'); document.body.classList.add(needsClass); } } else { if (document.body.classList.contains('litespeed-darkmode') || document.body.classList.contains('litespeed-lightmode')) { document.body.classList.remove('litespeed-darkmode', 'litespeed-lightmode'); } } // Update button icon toggleBtn.innerHTML = isDark ? '☀️' : '🌙'; } // Initialize applyDarkMode(); // Toggle handler toggleBtn.addEventListener('click', function() { var prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; var savedPreference = localStorage.getItem('litespeed-dark-preference'); var currentlyDark = savedPreference ? savedPreference === 'dark' : prefersDark; // Toggle and store only if different from browser preference if (!currentlyDark === prefersDark) { localStorage.removeItem('litespeed-dark-preference'); } else { localStorage.setItem('litespeed-dark-preference', currentlyDark ? 'light' : 'dark'); } applyDarkMode(); }); // Listen for system theme changes if (window.matchMedia) { window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', applyDarkMode); } // Add to page document.body.appendChild(toggleBtn); } // Initialize dark mode immediately (outside IIFE, runs without waiting for page ready) litespeed_init_dark_mode(); assets/js/instant_click.ori.js 0000777 00000040501 15251157102 0012443 0 ustar 00 /*! instant.page v5.2.0 - (C) 2019-2024 Alexandre Dieulot - https://instant.page/license */ let _chromiumMajorVersionInUserAgent = null , _speculationRulesType , _allowQueryString , _allowExternalLinks , _useWhitelist , _delayOnHover = 65 , _lastTouchstartEvent , _mouseoverTimer , _preloadedList = new Set() init() function init() { const supportCheckRelList = document.createElement('link').relList const isSupported = supportCheckRelList.supports('prefetch') && supportCheckRelList.supports('modulepreload') // instant.page is meant to be loaded with <script type=module> // (though sometimes webmasters load it as a regular script). // So it’s normally executed (and must not cause JavaScript errors) in: // - Chromium 61+ // - Gecko in Firefox 60+ // - WebKit in Safari 10.1+ (iOS 10.3+, macOS 10.10+) // // The check above used to check for IntersectionObserverEntry.isIntersecting // but module scripts support implies this compatibility — except in Safari // 10.1–12.0, but this prefetch check takes care of it. // // The modulepreload check is used to drop support for Firefox < 115 in order // to lessen maintenance. // This implies Safari 17+ (if it supported prefetch), if we ever support // fetch()-based preloading for Safari we might want to OR that check with // something that Safari 15.4 or 16.4 supports. // Also implies Chromium 66+. if (!isSupported) { return } const handleVaryAcceptHeader = 'instantVaryAccept' in document.body.dataset || 'Shopify' in window // The `Vary: Accept` header when received in Chromium 79–109 makes prefetches // unusable, as Chromium used to send a different `Accept` header. // It’s applied on all Shopify sites by default, as Shopify is very popular // and is the main source of this problem. // `window.Shopify` only exists on “classic” Shopify sites. Those using // Hydrogen (Remix SPA) aren’t concerned. const chromiumUserAgentIndex = navigator.userAgent.indexOf('Chrome/') if (chromiumUserAgentIndex > -1) { _chromiumMajorVersionInUserAgent = parseInt(navigator.userAgent.substring(chromiumUserAgentIndex + 'Chrome/'.length)) } // The user agent client hints API is a theoretically more reliable way to // get Chromium’s version… but it’s not available in Samsung Internet 20. // It also requires a secure context, which would make debugging harder, // and is only available in recent Chromium versions. // In practice, Chromium browsers never shy from announcing "Chrome" in // their regular user agent string, as that maximizes their compatibility. if (handleVaryAcceptHeader && _chromiumMajorVersionInUserAgent && _chromiumMajorVersionInUserAgent < 110) { return } _speculationRulesType = 'none' if (HTMLScriptElement.supports && HTMLScriptElement.supports('speculationrules')) { const speculationRulesConfig = document.body.dataset.instantSpecrules if (speculationRulesConfig == 'prerender') { _speculationRulesType = 'prerender' } else if (speculationRulesConfig != 'no') { _speculationRulesType = 'prefetch' } } const useMousedownShortcut = 'instantMousedownShortcut' in document.body.dataset _allowQueryString = 'instantAllowQueryString' in document.body.dataset _allowExternalLinks = 'instantAllowExternalLinks' in document.body.dataset _useWhitelist = 'instantWhitelist' in document.body.dataset let preloadOnMousedown = false let preloadOnlyOnMousedown = false let preloadWhenVisible = false if ('instantIntensity' in document.body.dataset) { const intensityParameter = document.body.dataset.instantIntensity if (intensityParameter == 'mousedown' && !useMousedownShortcut) { preloadOnMousedown = true } if (intensityParameter == 'mousedown-only' && !useMousedownShortcut) { preloadOnMousedown = true preloadOnlyOnMousedown = true } if (intensityParameter == 'viewport') { const isOnSmallScreen = document.documentElement.clientWidth * document.documentElement.clientHeight < 450000 // Smartphones are the most likely to have a slow connection, and // their small screen size limits the number of links (and thus // server load). // // Foldable phones (being expensive as of 2023), tablets and PCs // generally have a decent connection, and a big screen displaying // more links that would put more load on the server. // // iPhone 14 Pro Max (want): 430×932 = 400 760 // Samsung Galaxy S22 Ultra with display size set to 80% (want): // 450×965 = 434 250 // Small tablet (don’t want): 600×960 = 576 000 // Those number are virtual screen size, the viewport (used for // the check above) will be smaller with the browser’s interface. const isNavigatorConnectionSaveDataEnabled = navigator.connection && navigator.connection.saveData const isNavigatorConnectionLike2g = navigator.connection && navigator.connection.effectiveType && navigator.connection.effectiveType.includes('2g') const isNavigatorConnectionAdequate = !isNavigatorConnectionSaveDataEnabled && !isNavigatorConnectionLike2g if (isOnSmallScreen && isNavigatorConnectionAdequate) { preloadWhenVisible = true } } if (intensityParameter == 'viewport-all') { preloadWhenVisible = true } const intensityAsInteger = parseInt(intensityParameter) if (!isNaN(intensityAsInteger)) { _delayOnHover = intensityAsInteger } } const eventListenersOptions = { capture: true, passive: true, } if (preloadOnlyOnMousedown) { document.addEventListener('touchstart', touchstartEmptyListener, eventListenersOptions) } else { document.addEventListener('touchstart', touchstartListener, eventListenersOptions) } if (!preloadOnMousedown) { document.addEventListener('mouseover', mouseoverListener, eventListenersOptions) } if (preloadOnMousedown) { document.addEventListener('mousedown', mousedownListener, eventListenersOptions) } if (useMousedownShortcut) { document.addEventListener('mousedown', mousedownShortcutListener, eventListenersOptions) } if (preloadWhenVisible) { let requestIdleCallbackOrFallback = window.requestIdleCallback // Safari has no support as of 16.3: https://webkit.org/b/164193 if (!requestIdleCallbackOrFallback) { requestIdleCallbackOrFallback = (callback) => { callback() // A smarter fallback like setTimeout is not used because devices that // may eventually be eligible to a Safari version supporting prefetch // will be very powerful. // The weakest devices that could be eligible are the 2017 iPad and // the 2016 MacBook. } } requestIdleCallbackOrFallback(function observeIntersection() { const intersectionObserver = new IntersectionObserver((entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { const anchorElement = entry.target intersectionObserver.unobserve(anchorElement) preload(anchorElement.href) } }) }) document.querySelectorAll('a').forEach((anchorElement) => { if (isPreloadable(anchorElement)) { intersectionObserver.observe(anchorElement) } }) }, { timeout: 1500, }) } } function touchstartListener(event) { _lastTouchstartEvent = event const anchorElement = event.target.closest('a') if (!isPreloadable(anchorElement)) { return } preload(anchorElement.href, 'high') } function touchstartEmptyListener(event) { _lastTouchstartEvent = event } function mouseoverListener(event) { if (isEventLikelyTriggeredByTouch(event)) { // This avoids uselessly adding a mouseout event listener and setting a timer. return } if (!('closest' in event.target)) { return // Without this check sometimes an error “event.target.closest is not a function” is thrown, for unknown reasons // That error denotes that `event.target` isn’t undefined. My best guess is that it’s the Document. // // Details could be gleaned from throwing such an error: //throw new TypeError(`instant.page non-element event target: timeStamp=${~~event.timeStamp}, type=${event.type}, typeof=${typeof event.target}, nodeType=${event.target.nodeType}, nodeName=${event.target.nodeName}, viewport=${innerWidth}x${innerHeight}, coords=${event.clientX}x${event.clientY}, scroll=${scrollX}x${scrollY}`) } const anchorElement = event.target.closest('a') if (!isPreloadable(anchorElement)) { return } anchorElement.addEventListener('mouseout', mouseoutListener, {passive: true}) _mouseoverTimer = setTimeout(() => { preload(anchorElement.href, 'high') _mouseoverTimer = null }, _delayOnHover) } function mousedownListener(event) { if (isEventLikelyTriggeredByTouch(event)) { // When preloading only on mousedown, not touch, we need to stop there // because touches send compatibility mouse events including mousedown. // // (When preloading on touchstart, instructions below this block would // have no effect.) return } const anchorElement = event.target.closest('a') if (!isPreloadable(anchorElement)) { return } preload(anchorElement.href, 'high') } function mouseoutListener(event) { if (event.relatedTarget && event.target.closest('a') == event.relatedTarget.closest('a')) { return } if (_mouseoverTimer) { clearTimeout(_mouseoverTimer) _mouseoverTimer = null } } function mousedownShortcutListener(event) { if (isEventLikelyTriggeredByTouch(event)) { // Due to a high potential for complications with this mousedown shortcut // combined with other parties’ JavaScript code, we don’t want it to run // at all on touch devices, even though mousedown and click are triggered // at almost the same time on touch. return } const anchorElement = event.target.closest('a') if (event.which > 1 || event.metaKey || event.ctrlKey) { return } if (!anchorElement) { return } anchorElement.addEventListener('click', function (event) { if (event.detail == 1337) { return } event.preventDefault() }, {capture: true, passive: false, once: true}) const customEvent = new MouseEvent('click', {view: window, bubbles: true, cancelable: false, detail: 1337}) anchorElement.dispatchEvent(customEvent) } function isEventLikelyTriggeredByTouch(event) { // Touch devices fire “mouseover” and “mousedown” (and other) events after // a touch for compatibility reasons. // This function checks if it’s likely that we’re dealing with such an event. if (!_lastTouchstartEvent || !event) { return false } if (event.target != _lastTouchstartEvent.target) { return false } const now = event.timeStamp // Chromium (tested Chrome 95 and 122 on Android) sometimes uses the same // event.timeStamp value in touchstart, mouseover, and mousedown. // Testable in test/extras/delay-not-considered-touch.html // This is okay for our purpose: two equivalent timestamps will be less // than the max duration, which means they’re related events. // TODO: fill/find Chromium bug const durationBetweenLastTouchstartAndNow = now - _lastTouchstartEvent.timeStamp const MAX_DURATION_TO_BE_CONSIDERED_TRIGGERED_BY_TOUCHSTART = 2500 // How long after a touchstart event can a simulated mouseover/mousedown event fire? // /test/extras/delay-not-considered-touch.html tries to answer that question. // I saw up to 1450 ms on an overwhelmed Samsung Galaxy S2. // On the other hand, how soon can an unrelated mouseover event happen after an unrelated touchstart? // Meaning the user taps a link, then grabs their pointing device and clicks another/the same link. // That scenario could occur if a user taps a link, thinks it hasn’t worked, and thus fall back to their pointing device. // I do that in about 1200 ms on a Chromebook. In which case this function returns a false positive. // False positives are okay, as this function is only used to decide to abort handling mouseover/mousedown/mousedownShortcut. // False negatives could lead to unforeseen state, particularly in mousedownShortcutListener. return durationBetweenLastTouchstartAndNow < MAX_DURATION_TO_BE_CONSIDERED_TRIGGERED_BY_TOUCHSTART // TODO: Investigate if pointer events could be used. // https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType // TODO: Investigate if InputDeviceCapabilities could be used to make it // less hacky on Chromium browsers. // https://developer.mozilla.org/en-US/docs/Web/API/InputDeviceCapabilities_API // https://wicg.github.io/input-device-capabilities/ // Needs careful reading of the spec and tests (notably, what happens with a // mouse connected to an Android or iOS smartphone?) to make sure it’s solid. // Also need to judge if WebKit could implement it differently, as they // don’t mind doing when a spec gives room to interpretation. // It seems to work well on Chrome on ChromeOS. // TODO: Consider using event screen position as another heuristic. } function isPreloadable(anchorElement) { if (!anchorElement || !anchorElement.href) { return } if (_useWhitelist && !('instant' in anchorElement.dataset)) { return } if (anchorElement.origin != location.origin) { let allowed = _allowExternalLinks || 'instant' in anchorElement.dataset if (!allowed || !_chromiumMajorVersionInUserAgent) { // Chromium-only: see comment on “restrictive prefetch” and “cross-site speculation rules prefetch” return } } if (!['http:', 'https:'].includes(anchorElement.protocol)) { return } if (anchorElement.protocol == 'http:' && location.protocol == 'https:') { return } if (!_allowQueryString && anchorElement.search && !('instant' in anchorElement.dataset)) { return } if (anchorElement.hash && anchorElement.pathname + anchorElement.search == location.pathname + location.search) { return } if ('noInstant' in anchorElement.dataset) { return } return true } function preload(url, fetchPriority = 'auto') { if (_preloadedList.has(url)) { return } if (_speculationRulesType != 'none') { preloadUsingSpeculationRules(url) } else { preloadUsingLinkElement(url, fetchPriority) } _preloadedList.add(url) } function preloadUsingSpeculationRules(url) { const scriptElement = document.createElement('script') scriptElement.type = 'speculationrules' scriptElement.textContent = JSON.stringify({ [_speculationRulesType]: [{ source: 'list', urls: [url] }] }) // When using speculation rules, cross-site prefetch is supported, but will // only work if the user has no cookies for the destination site. The // prefetch will not be sent, if the user does have such cookies. document.head.appendChild(scriptElement) } function preloadUsingLinkElement(url, fetchPriority = 'auto') { const linkElement = document.createElement('link') linkElement.rel = 'prefetch' linkElement.href = url linkElement.fetchPriority = fetchPriority // By default, a prefetch is loaded with a low priority. // When there’s a fair chance that this prefetch is going to be used in the // near term (= after a touch/mouse event), giving it a high priority helps // make the page load faster in case there are other resources loading. // Prioritizing it implicitly means deprioritizing every other resource // that’s loading on the page. Due to HTML documents usually being much // smaller than other resources (notably images and JavaScript), and // prefetches happening once the initial page is sufficiently loaded, // this theft of bandwidth should rarely be detrimental. linkElement.as = 'document' // as=document is Chromium-only and allows cross-origin prefetches to be // usable for navigation. They call it “restrictive prefetch” and intend // to remove it: https://crbug.com/1352371 // // This document from the Chrome team dated 2022-08-10 // https://docs.google.com/document/d/1x232KJUIwIf-k08vpNfV85sVCRHkAxldfuIA5KOqi6M // claims (I haven’t tested) that data- and battery-saver modes as well as // the setting to disable preloading do not disable restrictive prefetch, // unlike regular prefetch. That’s good for prefetching on a touch/mouse // event, but might be bad when prefetching every link in the viewport. document.head.appendChild(linkElement) } assets/js/lazyload.min.js 0000777 00000017531 15251157102 0011436 0 ustar 00 !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).LazyLoad=e()}(this,function(){"use strict";function e(){return(e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n,a=arguments[e];for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t}).apply(this,arguments)}function o(t){return e({},at,t)}function l(t,e){return t.getAttribute(gt+e)}function c(t){return l(t,vt)}function s(t,e){return function(t,e,n){e=gt+e;null!==n?t.setAttribute(e,n):t.removeAttribute(e)}(t,vt,e)}function i(t){return s(t,null),0}function r(t){return null===c(t)}function u(t){return c(t)===_t}function d(t,e,n,a){t&&(void 0===a?void 0===n?t(e):t(e,n):t(e,n,a))}function f(t,e){et?t.classList.add(e):t.className+=(t.className?" ":"")+e}function _(t,e){et?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\s+)"+e+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")}function g(t){return t.llTempImage}function v(t,e){!e||(e=e._observer)&&e.unobserve(t)}function b(t,e){t&&(t.loadingCount+=e)}function p(t,e){t&&(t.toLoadCount=e)}function n(t){for(var e,n=[],a=0;e=t.children[a];a+=1)"SOURCE"===e.tagName&&n.push(e);return n}function h(t,e){(t=t.parentNode)&&"PICTURE"===t.tagName&&n(t).forEach(e)}function a(t,e){n(t).forEach(e)}function m(t){return!!t[lt]}function E(t){return t[lt]}function I(t){return delete t[lt]}function y(e,t){var n;m(e)||(n={},t.forEach(function(t){n[t]=e.getAttribute(t)}),e[lt]=n)}function L(a,t){var o;m(a)&&(o=E(a),t.forEach(function(t){var e,n;e=a,(t=o[n=t])?e.setAttribute(n,t):e.removeAttribute(n)}))}function k(t,e,n){f(t,e.class_loading),s(t,st),n&&(b(n,1),d(e.callback_loading,t,n))}function A(t,e,n){n&&t.setAttribute(e,n)}function O(t,e){A(t,rt,l(t,e.data_sizes)),A(t,it,l(t,e.data_srcset)),A(t,ot,l(t,e.data_src))}function w(t,e,n){var a=l(t,e.data_bg_multi),o=l(t,e.data_bg_multi_hidpi);(a=nt&&o?o:a)&&(t.style.backgroundImage=a,n=n,f(t=t,(e=e).class_applied),s(t,dt),n&&(e.unobserve_completed&&v(t,e),d(e.callback_applied,t,n)))}function x(t,e){!e||0<e.loadingCount||0<e.toLoadCount||d(t.callback_finish,e)}function M(t,e,n){t.addEventListener(e,n),t.llEvLisnrs[e]=n}function N(t){return!!t.llEvLisnrs}function z(t){if(N(t)){var e,n,a=t.llEvLisnrs;for(e in a){var o=a[e];n=e,o=o,t.removeEventListener(n,o)}delete t.llEvLisnrs}}function C(t,e,n){var a;delete t.llTempImage,b(n,-1),(a=n)&&--a.toLoadCount,_(t,e.class_loading),e.unobserve_completed&&v(t,n)}function R(i,r,c){var l=g(i)||i;N(l)||function(t,e,n){N(t)||(t.llEvLisnrs={});var a="VIDEO"===t.tagName?"loadeddata":"load";M(t,a,e),M(t,"error",n)}(l,function(t){var e,n,a,o;n=r,a=c,o=u(e=i),C(e,n,a),f(e,n.class_loaded),s(e,ut),d(n.callback_loaded,e,a),o||x(n,a),z(l)},function(t){var e,n,a,o;n=r,a=c,o=u(e=i),C(e,n,a),f(e,n.class_error),s(e,ft),d(n.callback_error,e,a),o||x(n,a),z(l)})}function T(t,e,n){var a,o,i,r,c;t.llTempImage=document.createElement("IMG"),R(t,e,n),m(c=t)||(c[lt]={backgroundImage:c.style.backgroundImage}),i=n,r=l(a=t,(o=e).data_bg),c=l(a,o.data_bg_hidpi),(r=nt&&c?c:r)&&(a.style.backgroundImage='url("'.concat(r,'")'),g(a).setAttribute(ot,r),k(a,o,i)),w(t,e,n)}function G(t,e,n){var a;R(t,e,n),a=e,e=n,(t=Et[(n=t).tagName])&&(t(n,a),k(n,a,e))}function D(t,e,n){var a;a=t,(-1<It.indexOf(a.tagName)?G:T)(t,e,n)}function S(t,e,n){var a;t.setAttribute("loading","lazy"),R(t,e,n),a=e,(e=Et[(n=t).tagName])&&e(n,a),s(t,_t)}function V(t){t.removeAttribute(ot),t.removeAttribute(it),t.removeAttribute(rt)}function j(t){h(t,function(t){L(t,mt)}),L(t,mt)}function F(t){var e;(e=yt[t.tagName])?e(t):m(e=t)&&(t=E(e),e.style.backgroundImage=t.backgroundImage)}function P(t,e){var n;F(t),n=e,r(e=t)||u(e)||(_(e,n.class_entered),_(e,n.class_exited),_(e,n.class_applied),_(e,n.class_loading),_(e,n.class_loaded),_(e,n.class_error)),i(t),I(t)}function U(t,e,n,a){var o;n.cancel_on_exit&&(c(t)!==st||"IMG"===t.tagName&&(z(t),h(o=t,function(t){V(t)}),V(o),j(t),_(t,n.class_loading),b(a,-1),i(t),d(n.callback_cancel,t,e,a)))}function $(t,e,n,a){var o,i,r=(i=t,0<=bt.indexOf(c(i)));s(t,"entered"),f(t,n.class_entered),_(t,n.class_exited),o=t,i=a,n.unobserve_entered&&v(o,i),d(n.callback_enter,t,e,a),r||D(t,n,a)}function q(t){return t.use_native&&"loading"in HTMLImageElement.prototype}function H(t,o,i){t.forEach(function(t){return(a=t).isIntersecting||0<a.intersectionRatio?$(t.target,t,o,i):(e=t.target,n=t,a=o,t=i,void(r(e)||(f(e,a.class_exited),U(e,n,a,t),d(a.callback_exit,e,n,t))));var e,n,a})}function B(e,n){var t;tt&&!q(e)&&(n._observer=new IntersectionObserver(function(t){H(t,e,n)},{root:(t=e).container===document?null:t.container,rootMargin:t.thresholds||t.threshold+"px"}))}function J(t){return Array.prototype.slice.call(t)}function K(t){return t.container.querySelectorAll(t.elements_selector)}function Q(t){return c(t)===ft}function W(t,e){return e=t||K(e),J(e).filter(r)}function X(e,t){var n;(n=K(e),J(n).filter(Q)).forEach(function(t){_(t,e.class_error),i(t)}),t.update()}function t(t,e){var n,a,t=o(t);this._settings=t,this.loadingCount=0,B(t,this),n=t,a=this,Y&&window.addEventListener("online",function(){X(n,a)}),this.update(e)}var Y="undefined"!=typeof window,Z=Y&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),tt=Y&&"IntersectionObserver"in window,et=Y&&"classList"in document.createElement("p"),nt=Y&&1<window.devicePixelRatio,at={elements_selector:".lazy",container:Z||Y?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_poster:"poster",class_applied:"applied",class_loading:"litespeed-loading",class_loaded:"litespeed-loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1},ot="src",it="srcset",rt="sizes",ct="poster",lt="llOriginalAttrs",st="loading",ut="loaded",dt="applied",ft="error",_t="native",gt="data-",vt="ll-status",bt=[st,ut,dt,ft],pt=[ot],ht=[ot,ct],mt=[ot,it,rt],Et={IMG:function(t,e){h(t,function(t){y(t,mt),O(t,e)}),y(t,mt),O(t,e)},IFRAME:function(t,e){y(t,pt),A(t,ot,l(t,e.data_src))},VIDEO:function(t,e){a(t,function(t){y(t,pt),A(t,ot,l(t,e.data_src))}),y(t,ht),A(t,ct,l(t,e.data_poster)),A(t,ot,l(t,e.data_src)),t.load()}},It=["IMG","IFRAME","VIDEO"],yt={IMG:j,IFRAME:function(t){L(t,pt)},VIDEO:function(t){a(t,function(t){L(t,pt)}),L(t,ht),t.load()}},Lt=["IMG","IFRAME","VIDEO"];return t.prototype={update:function(t){var e,n,a,o=this._settings,i=W(t,o);{if(p(this,i.length),!Z&&tt)return q(o)?(e=o,n=this,i.forEach(function(t){-1!==Lt.indexOf(t.tagName)&&S(t,e,n)}),void p(n,0)):(t=this._observer,o=i,t.disconnect(),a=t,void o.forEach(function(t){a.observe(t)}));this.loadAll(i)}},destroy:function(){this._observer&&this._observer.disconnect(),K(this._settings).forEach(function(t){I(t)}),delete this._observer,delete this._settings,delete this.loadingCount,delete this.toLoadCount},loadAll:function(t){var e=this,n=this._settings;W(t,n).forEach(function(t){v(t,e),D(t,n,e)})},restoreAll:function(){var e=this._settings;K(e).forEach(function(t){P(t,e)})}},t.load=function(t,e){e=o(e);D(t,e)},t.resetStatus=function(t){i(t)},t}),function(t,e){"use strict";function n(){e.body.classList.add("litespeed_lazyloaded")}function a(){console.log("[LiteSpeed] Start Lazy Load"),o=new LazyLoad(Object.assign({},t.lazyLoadOptions||{},{elements_selector:"[data-lazyloaded]",callback_finish:n})),i=function(){o.update()},t.MutationObserver&&new MutationObserver(i).observe(e.documentElement,{childList:!0,subtree:!0,attributes:!0})}var o,i;t.addEventListener?t.addEventListener("load",a,!1):t.attachEvent("onload",a)}(window,document); assets/js/js_delay.js 0000777 00000005310 15251157102 0010617 0 ustar 00 window.litespeed_ui_events = window.litespeed_ui_events || ['mouseover', 'click', 'keydown', 'wheel', 'touchmove', 'touchstart']; var urlCreator = window.URL || window.webkitURL; // const litespeed_js_delay_timer = setTimeout( litespeed_load_delayed_js, 70 ); litespeed_ui_events.forEach(e => { window.addEventListener(e, litespeed_load_delayed_js_force, { passive: true }); // Use passive to save GPU in interaction }); function litespeed_load_delayed_js_force() { console.log('[LiteSpeed] Start Load JS Delayed'); // clearTimeout( litespeed_js_delay_timer ); litespeed_ui_events.forEach(e => { window.removeEventListener(e, litespeed_load_delayed_js_force, { passive: true }); }); document.querySelectorAll('iframe[data-litespeed-src]').forEach(e => { e.setAttribute('src', e.getAttribute('data-litespeed-src')); }); // Prevent early loading if (document.readyState == 'loading') { window.addEventListener('DOMContentLoaded', litespeed_load_delayed_js); } else { litespeed_load_delayed_js(); } } async function litespeed_load_delayed_js() { let js_list = []; // Prepare all JS document.querySelectorAll('script[type="litespeed/javascript"]').forEach(e => { js_list.push(e); }); // Load by sequence for (let script in js_list) { await new Promise(resolve => litespeed_load_one(js_list[script], resolve)); } // Simulate doc.loaded document.dispatchEvent(new Event('DOMContentLiteSpeedLoaded')); window.dispatchEvent(new Event('DOMContentLiteSpeedLoaded')); } /** * Load one JS synchronously */ function litespeed_load_one(e, resolve) { console.log('[LiteSpeed] Load ', e); var e2 = document.createElement('script'); e2.addEventListener('load', resolve); e2.addEventListener('error', resolve); var attrs = e.getAttributeNames(); attrs.forEach(aname => { if (aname == 'type') return; e2.setAttribute(aname == 'data-src' ? 'src' : aname, e.getAttribute(aname)); }); e2.type = 'text/javascript'; let is_inline = false; // Inline script if (!e2.src && e.textContent) { e2.src = litespeed_inline2src(e.textContent); // e2.textContent = e.textContent; is_inline = true; } // Deploy to dom e.after(e2); e.remove(); // document.head.appendChild(e2); // e2 = e.cloneNode(true) // e2.setAttribute( 'type', 'text/javascript' ); // e2.setAttribute( 'data-delayed', '1' ); // Kick off resolve for inline if (is_inline) resolve(); } /** * Prepare inline script */ function litespeed_inline2src(data) { try { var src = urlCreator.createObjectURL( new Blob([data.replace(/^(?:<!--)?(.*?)(?:-->)?$/gm, '$1')], { type: 'text/javascript', }), ); } catch (e) { var src = 'data:text/javascript;base64,' + btoa(data.replace(/^(?:<!--)?(.*?)(?:-->)?$/gm, '$1')); } return src; } assets/js/lazyload.init.js 0000777 00000001611 15251157102 0011606 0 ustar 00 /** * Lazyload init js * * @author LiteSpeed * @since 1.4 * */ (function (window, document) { 'use strict'; var instance; var update_lazyload; var litespeed_finish_callback = function () { document.body.classList.add('litespeed_lazyloaded'); }; var init = function () { console.log('[LiteSpeed] Start Lazy Load'); instance = new LazyLoad( Object.assign( {}, window.lazyLoadOptions || {}, { elements_selector: '[data-lazyloaded]', callback_finish: litespeed_finish_callback, }, ) ); update_lazyload = function () { instance.update(); }; if (window.MutationObserver) { new MutationObserver(update_lazyload).observe(document.documentElement, { childList: true, subtree: true, attributes: true }); } }; window.addEventListener ? window.addEventListener('load', init, false) : window.attachEvent('onload', init); })(window, document); assets/js/webfontloader.min.js 0000777 00000027502 15251157102 0012451 0 ustar 00 !function(){function e(t,n,i){return t.call.apply(t.bind,arguments)}function o(n,i,t){if(!n)throw Error();if(2<arguments.length){var e=Array.prototype.slice.call(arguments,2);return function(){var t=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(t,e),n.apply(i,t)}}return function(){return n.apply(i,arguments)}}function d(t,n,i){return(d=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?e:o).apply(null,arguments)}var r=Date.now||function(){return+new Date};function n(t,n){this.a=t,this.o=n||t,this.c=this.o.document}var f=!!window.FontFace;function c(t,n,i,e){if(n=t.c.createElement(n),i)for(var o in i)i.hasOwnProperty(o)&&("style"==o?n.style.cssText=i[o]:n.setAttribute(o,i[o]));return e&&n.appendChild(t.c.createTextNode(e)),n}function h(t,n,i){(t=t.c.getElementsByTagName(n)[0])||(t=document.documentElement),t.insertBefore(i,t.lastChild)}function i(t){t.parentNode&&t.parentNode.removeChild(t)}function g(t,n,i){n=n||[],i=i||[];for(var e=t.className.split(/\s+/),o=0;o<n.length;o+=1){for(var a=!1,s=0;s<e.length;s+=1)if(n[o]===e[s]){a=!0;break}a||e.push(n[o])}for(n=[],o=0;o<e.length;o+=1){for(a=!1,s=0;s<i.length;s+=1)if(e[o]===i[s]){a=!0;break}a||n.push(e[o])}t.className=n.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function a(t,n){for(var i=t.className.split(/\s+/),e=0,o=i.length;e<o;e++)if(i[e]==n)return!0;return!1}function l(t,n,i){function e(){s&&o&&(s(a),s=null)}n=c(t,"link",{rel:"stylesheet",href:n,media:"all"});var o=!1,a=null,s=i||null;f?(n.onload=function(){o=!0,e()},n.onerror=function(){o=!0,a=Error("Stylesheet failed to load"),e()}):setTimeout(function(){o=!0,e()},0),h(t,"head",n)}function u(t,n,i,e){var o=t.c.getElementsByTagName("head")[0];if(o){var a=c(t,"script",{src:n}),s=!1;return a.onload=a.onreadystatechange=function(){s||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(s=!0,i&&i(null),a.onload=a.onreadystatechange=null,"HEAD"==a.parentNode.tagName&&o.removeChild(a))},o.appendChild(a),setTimeout(function(){s||(s=!0,i&&i(Error("Script load timeout")))},e||5e3),a}return null}function p(){this.a=0,this.c=null}function v(t){return t.a++,function(){t.a--,s(t)}}function w(t,n){t.c=n,s(t)}function s(t){0==t.a&&t.c&&(t.c(),t.c=null)}function m(t){this.a=t||"-"}function y(t,n){this.c=t,this.f=4,this.a="n";var i=(n||"n4").match(/^([nio])([1-9])$/i);i&&(this.a=i[1],this.f=parseInt(i[2],10))}function b(t){var n=[];t=t.split(/,\s*/);for(var i=0;i<t.length;i++){var e=t[i].replace(/['"]/g,"");-1!=e.indexOf(" ")||/^\d/.test(e)?n.push("'"+e+"'"):n.push(e)}return n.join(",")}function x(t){return t.a+t.f}function j(t){var n="normal";return"o"===t.a?n="oblique":"i"===t.a&&(n="italic"),n}function _(t,n){this.c=t,this.f=t.o.document.documentElement,this.h=n,this.a=new m("-"),this.j=!1!==n.events,this.g=!1!==n.classes}function k(t){if(t.g){var n=a(t.f,t.a.c("wf","active")),i=[],e=[t.a.c("wf","loading")];n||i.push(t.a.c("wf","inactive")),g(t.f,i,e)}T(t,"inactive")}function T(t,n,i){t.j&&t.h[n]&&(i?t.h[n](i.c,x(i)):t.h[n]())}function S(){this.c={}}function C(t,n){this.c=t,this.f=n,this.a=c(this.c,"span",{"aria-hidden":"true"},this.f)}function A(t){h(t.c,"body",t.a)}function N(t){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+b(t.c)+";font-style:"+j(t)+";font-weight:"+t.f+"00;"}function E(t,n,i,e,o,a){this.g=t,this.j=n,this.a=e,this.c=i,this.f=o||3e3,this.h=a||void 0}function W(t,n,i,e,o,a,s){this.v=t,this.B=n,this.c=i,this.a=e,this.s=s||"BESbswy",this.f={},this.w=o||3e3,this.u=a||null,this.m=this.j=this.h=this.g=null,this.g=new C(this.c,this.s),this.h=new C(this.c,this.s),this.j=new C(this.c,this.s),this.m=new C(this.c,this.s),t=N(t=new y(this.a.c+",serif",x(this.a))),this.g.a.style.cssText=t,t=N(t=new y(this.a.c+",sans-serif",x(this.a))),this.h.a.style.cssText=t,t=N(t=new y("serif",x(this.a))),this.j.a.style.cssText=t,t=N(t=new y("sans-serif",x(this.a))),this.m.a.style.cssText=t,A(this.g),A(this.h),A(this.j),A(this.m)}m.prototype.c=function(t){for(var n=[],i=0;i<arguments.length;i++)n.push(arguments[i].replace(/[\W_]+/g,"").toLowerCase());return n.join(this.a)},E.prototype.start=function(){var o=this.c.o.document,a=this,s=r(),t=new Promise(function(i,e){!function n(){var t;r()-s>=a.f?e():o.fonts.load((t=a.a,j(t)+" "+t.f+"00 300px "+b(t.c)),a.h).then(function(t){1<=t.length?i():setTimeout(n,25)},function(){e()})}()}),i=null,n=new Promise(function(t,n){i=setTimeout(n,a.f)});Promise.race([n,t]).then(function(){i&&(clearTimeout(i),i=null),a.g(a.a)},function(){a.j(a.a)})};var F={D:"serif",C:"sans-serif"},I=null;function O(){if(null===I){var t=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);I=!!t&&(parseInt(t[1],10)<536||536===parseInt(t[1],10)&&parseInt(t[2],10)<=11)}return I}function P(t,n,i){for(var e in F)if(F.hasOwnProperty(e)&&n===t.f[F[e]]&&i===t.f[F[e]])return!0;return!1}function B(t){var n,i=t.g.a.offsetWidth,e=t.h.a.offsetWidth;(n=i===t.f.serif&&e===t.f["sans-serif"])||(n=O()&&P(t,i,e)),n?r()-t.A>=t.w?O()&&P(t,i,e)&&(null===t.u||t.u.hasOwnProperty(t.a.c))?L(t,t.v):L(t,t.B):setTimeout(d(function(){B(this)},t),50):L(t,t.v)}function L(t,n){setTimeout(d(function(){i(this.g.a),i(this.h.a),i(this.j.a),i(this.m.a),n(this.a)},t),0)}function D(t,n,i){this.c=t,this.a=n,this.f=0,this.m=this.j=!1,this.s=i}W.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=r(),B(this)};var $=null;function q(t){0==--t.f&&t.j&&(t.m?((t=t.a).g&&g(t.f,[t.a.c("wf","active")],[t.a.c("wf","loading"),t.a.c("wf","inactive")]),T(t,"active")):k(t.a))}function t(t){this.j=t,this.a=new S,this.h=0,this.f=this.g=!0}function H(t,n){this.c=t,this.a=n}function M(t,n){this.c=t,this.a=n}function z(t,n){this.c=t||"https://fonts.googleapis.com/css",this.a=[],this.f=[],this.g=n||""}D.prototype.g=function(t){var n=this.a;n.g&&g(n.f,[n.a.c("wf",t.c,x(t).toString(),"active")],[n.a.c("wf",t.c,x(t).toString(),"loading"),n.a.c("wf",t.c,x(t).toString(),"inactive")]),T(n,"fontactive",t),this.m=!0,q(this)},D.prototype.h=function(t){var n=this.a;if(n.g){var i=a(n.f,n.a.c("wf",t.c,x(t).toString(),"active")),e=[],o=[n.a.c("wf",t.c,x(t).toString(),"loading")];i||e.push(n.a.c("wf",t.c,x(t).toString(),"inactive")),g(n.f,e,o)}T(n,"fontinactive",t),q(this)},t.prototype.load=function(t){this.c=new n(this.j,t.context||this.j),this.g=!1!==t.events,this.f=!1!==t.classes,function(o,t,n){var i=[],e=n.timeout;a=t,a.g&&g(a.f,[a.a.c("wf","loading")]),T(a,"loading");var a;var i=function(t,n,i){var e,o=[];for(e in n)if(n.hasOwnProperty(e)){var a=t.c[e];a&&o.push(a(n[e],i))}return o}(o.a,n,o.c),s=new D(o.c,t,e);for(o.h=i.length,t=0,n=i.length;t<n;t++)i[t].load(function(t,n,i){var e,c,h,l,u,p;c=s,h=t,l=n,u=i,p=0==--(e=o).h,(e.f||e.g)&&setTimeout(function(){var t=u||null,n=l||{};if(0===h.length&&p)k(c.a);else{c.f+=h.length,p&&(c.j=p);var i,e=[];for(i=0;i<h.length;i++){var o=h[i],a=n[o.c],s=c.a,r=o;if(s.g&&g(s.f,[s.a.c("wf",r.c,x(r).toString(),"loading")]),T(s,"fontloading",r),(s=null)===$)if(window.FontFace){var r=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent),f=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);$=r?42<parseInt(r[1],10):!f}else $=!1;s=$?new E(d(c.g,c),d(c.h,c),c.c,o,c.s,a):new W(d(c.g,c),d(c.h,c),c.c,o,c.s,t,a),e.push(s)}for(i=0;i<e.length;i++)e[i].start()}},0)})}(this,new _(this.c,t),t)},H.prototype.load=function(s){var n=this,r=n.a.projectId,t=n.a.version;if(r){var f=n.c.o;u(this.c,(n.a.api||"https://fast.fonts.net/jsapi")+"/"+r+".js"+(t?"?v="+t:""),function(t){t?s([]):(f["__MonotypeConfiguration__"+r]=function(){return n.a},function t(){if(f["__mti_fntLst"+r]){var n,i=f["__mti_fntLst"+r](),e=[];if(i)for(var o=0;o<i.length;o++){var a=i[o].fontfamily;null!=i[o].fontStyle&&null!=i[o].fontWeight?(n=i[o].fontStyle+i[o].fontWeight,e.push(new y(a,n))):e.push(new y(a))}s(e)}else setTimeout(function(){t()},50)}())}).id="__MonotypeAPIScript__"+r}else s([])},M.prototype.load=function(t){var n,i,e=this.a.urls||[],o=this.a.families||[],a=this.a.testStrings||{},s=new p;for(n=0,i=e.length;n<i;n++)l(this.c,e[n],v(s));var r=[];for(n=0,i=o.length;n<i;n++)if((e=o[n].split(":"))[1])for(var f=e[1].split(","),c=0;c<f.length;c+=1)r.push(new y(e[0],f[c]));else r.push(new y(e[0]));w(s,function(){t(r,a)})};function G(t){this.f=t,this.a=[],this.c={}}var K={latin:"BESbswy","latin-ext":"çöüğş",cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"},R={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},U={i:"i",italic:"i",n:"n",normal:"n"},V=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;function X(t,n){this.c=t,this.a=n}var J={Arimo:!0,Cousine:!0,Tinos:!0};function Q(t,n){this.c=t,this.a=n}function Y(t,n){this.c=t,this.f=n,this.a=[]}X.prototype.load=function(t){var n=new p,i=this.c,e=new z(this.a.api,this.a.text),o=this.a.families;!function(t,n){for(var i=n.length,e=0;e<i;e++){var o=n[e].split(":");3==o.length&&t.f.push(o.pop());var a="";2==o.length&&""!=o[1]&&(a=":"),t.a.push(o.join(a))}}(e,o);var a=new G(o);!function(t){for(var n=t.f.length,i=0;i<n;i++){var e=t.f[i].split(":"),o=e[0].replace(/\+/g," "),a=["n4"];if(2<=e.length){var s;if(s=[],r=e[1])for(var r,f=(r=r.split(",")).length,c=0;c<f;c++){var h;if((h=r[c]).match(/^[\w-]+$/))if(null==(u=V.exec(h.toLowerCase())))h="";else{if(h=null==(h=u[2])||""==h?"n":U[h],null==(u=u[1])||""==u)u="4";else var l=R[u],u=l||(isNaN(u)?"4":u.substr(0,1));h=[h,u].join("")}else h="";h&&s.push(h)}0<s.length&&(a=s),3==e.length&&(s=[],0<(e=(e=e[2])?e.split(","):s).length&&(e=K[e[0]])&&(t.c[o]=e))}for(t.c[o]||(e=K[o])&&(t.c[o]=e),e=0;e<a.length;e+=1)t.a.push(new y(o,a[e]))}}(a),l(i,function(t){if(0==t.a.length)throw Error("No fonts to load!");if(-1!=t.c.indexOf("kit="))return t.c;for(var n=t.a.length,i=[],e=0;e<n;e++)i.push(t.a[e].replace(/ /g,"+"));return n=t.c+"?family="+i.join("%7C"),0<t.f.length&&(n+="&subset="+t.f.join(",")),0<t.g.length&&(n+="&text="+encodeURIComponent(t.g)),n}(e),v(n)),w(n,function(){t(a.a,a.c,J)})},Q.prototype.load=function(s){var t=this.a.id,r=this.c.o;t?u(this.c,(this.a.api||"https://use.typekit.net")+"/"+t+".js",function(t){if(t)s([]);else if(r.Typekit&&r.Typekit.config&&r.Typekit.config.fn){t=r.Typekit.config.fn;for(var n=[],i=0;i<t.length;i+=2)for(var e=t[i],o=t[i+1],a=0;a<o.length;a++)n.push(new y(e,o[a]));try{r.Typekit.load({events:!1,classes:!1,async:!0})}catch(t){}s(n)}},2e3):s([])},Y.prototype.load=function(c){var t,n=this.f.id,i=this.c.o,h=this;n?(i.__webfontfontdeckmodule__||(i.__webfontfontdeckmodule__={}),i.__webfontfontdeckmodule__[n]=function(t,n){for(var i=0,e=n.fonts.length;i<e;++i){var o=n.fonts[i];h.a.push(new y(o.name,(a="font-weight:"+o.weight+";font-style:"+o.style,f=r=s=void 0,s=4,r="n",f=null,a&&((f=a.match(/(normal|oblique|italic)/i))&&f[1]&&(r=f[1].substr(0,1).toLowerCase()),(f=a.match(/([1-9]00|normal|bold)/i))&&f[1]&&(/bold/i.test(f[1])?s=7:/[1-9]00/.test(f[1])&&(s=parseInt(f[1].substr(0,1),10)))),r+s)))}var a,s,r,f;c(h.a)},u(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+((t=this.c).o.location.hostname||t.a.location.hostname)+"/"+n+".js",function(t){t&&c([])})):c([])};var Z=new t(window);Z.a.c.custom=function(t,n){return new M(n,t)},Z.a.c.fontdeck=function(t,n){return new Y(n,t)},Z.a.c.monotype=function(t,n){return new H(n,t)},Z.a.c.typekit=function(t,n){return new Q(n,t)},Z.a.c.google=function(t,n){return new X(n,t)};var tt={load:d(Z.load,Z)};"function"==typeof define&&define.amd?define(function(){return tt}):"undefined"!=typeof module&&module.exports?module.exports=tt:(window.WebFont=tt,window.WebFontConfig&&Z.load(window.WebFontConfig))}(); assets/js/react.min.js 0000777 00000401670 15251157102 0010716 0 ustar 00 /** @license React v17.0.1 * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ (function(){'use strict';(function(c,x){"object"===typeof exports&&"undefined"!==typeof module?x(exports):"function"===typeof define&&define.amd?define(["exports"],x):(c=c||self,x(c.React={}))})(this,function(c){function x(a){if(null===a||"object"!==typeof a)return null;a=Y&&a[Y]||a["@@iterator"];return"function"===typeof a?a:null}function y(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,e=1;e<arguments.length;e++)b+="&args[]="+encodeURIComponent(arguments[e]);return"Minified React error #"+ a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function v(a,b,e){this.props=a;this.context=b;this.refs=Z;this.updater=e||aa}function ba(){}function K(a,b,e){this.props=a;this.context=b;this.refs=Z;this.updater=e||aa}function ca(a,b,e){var l,f={},c=null,da=null;if(null!=b)for(l in void 0!==b.ref&&(da=b.ref),void 0!==b.key&&(c=""+b.key),b)ea.call(b,l)&&!fa.hasOwnProperty(l)&&(f[l]=b[l]);var k=arguments.length-2;if(1=== k)f.children=e;else if(1<k){for(var h=Array(k),d=0;d<k;d++)h[d]=arguments[d+2];f.children=h}if(a&&a.defaultProps)for(l in k=a.defaultProps,k)void 0===f[l]&&(f[l]=k[l]);return{$$typeof:w,type:a,key:c,ref:da,props:f,_owner:L.current}}function va(a,b){return{$$typeof:w,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function M(a){return"object"===typeof a&&null!==a&&a.$$typeof===w}function wa(a){var b={"=":"=0",":":"=2"};return"$"+a.replace(/[=:]/g,function(a){return b[a]})}function N(a,b){return"object"=== typeof a&&null!==a&&null!=a.key?wa(""+a.key):b.toString(36)}function C(a,b,e,l,f){var c=typeof a;if("undefined"===c||"boolean"===c)a=null;var d=!1;if(null===a)d=!0;else switch(c){case "string":case "number":d=!0;break;case "object":switch(a.$$typeof){case w:case ha:d=!0}}if(d)return d=a,f=f(d),a=""===l?"."+N(d,0):l,Array.isArray(f)?(e="",null!=a&&(e=a.replace(ia,"$&/")+"/"),C(f,b,e,"",function(a){return a})):null!=f&&(M(f)&&(f=va(f,e+(!f.key||d&&d.key===f.key?"":(""+f.key).replace(ia,"$&/")+"/")+ a)),b.push(f)),1;d=0;l=""===l?".":l+":";if(Array.isArray(a))for(var k=0;k<a.length;k++){c=a[k];var h=l+N(c,k);d+=C(c,b,e,h,f)}else if(h=x(a),"function"===typeof h)for(a=h.call(a),k=0;!(c=a.next()).done;)c=c.value,h=l+N(c,k++),d+=C(c,b,e,h,f);else if("object"===c)throw b=""+a,Error(y(31,"[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b));return d}function D(a,b,e){if(null==a)return a;var l=[],c=0;C(a,l,"","",function(a){return b.call(e,a,c++)});return l}function xa(a){if(-1=== a._status){var b=a._result;b=b();a._status=0;a._result=b;b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b)},function(b){0===a._status&&(a._status=2,a._result=b)})}if(1===a._status)return a._result;throw a._result;}function n(){var a=ja.current;if(null===a)throw Error(y(321));return a}function O(a,b){var e=a.length;a.push(b);a:for(;;){var c=e-1>>>1,f=a[c];if(void 0!==f&&0<E(f,b))a[c]=b,a[e]=f,e=c;else break a}}function p(a){a=a[0];return void 0===a?null:a}function F(a){var b= a[0];if(void 0!==b){var e=a.pop();if(e!==b){a[0]=e;a:for(var c=0,f=a.length;c<f;){var d=2*(c+1)-1,g=a[d],k=d+1,h=a[k];if(void 0!==g&&0>E(g,e))void 0!==h&&0>E(h,g)?(a[c]=h,a[k]=e,c=k):(a[c]=g,a[d]=e,c=d);else if(void 0!==h&&0>E(h,e))a[c]=h,a[k]=e,c=k;else break a}}return b}return null}function E(a,b){var e=a.sortIndex-b.sortIndex;return 0!==e?e:a.id-b.id}function P(a){for(var b=p(r);null!==b;){if(null===b.callback)F(r);else if(b.startTime<=a)F(r),b.sortIndex=b.expirationTime,O(q,b);else break;b=p(r)}} function Q(a){z=!1;P(a);if(!u)if(null!==p(q))u=!0,A(R);else{var b=p(r);null!==b&&G(Q,b.startTime-a)}}function R(a,b){u=!1;z&&(z=!1,S());H=!0;var e=g;try{P(b);for(m=p(q);null!==m&&(!(m.expirationTime>b)||a&&!T());){var c=m.callback;if("function"===typeof c){m.callback=null;g=m.priorityLevel;var f=c(m.expirationTime<=b);b=t();"function"===typeof f?m.callback=f:m===p(q)&&F(q);P(b)}else F(q);m=p(q)}if(null!==m)var d=!0;else{var n=p(r);null!==n&&G(Q,n.startTime-b);d=!1}return d}finally{m=null,g=e,H=!1}} var w=60103,ha=60106;c.Fragment=60107;c.StrictMode=60108;c.Profiler=60114;var ka=60109,la=60110,ma=60112;c.Suspense=60113;var na=60115,oa=60116;if("function"===typeof Symbol&&Symbol.for){var d=Symbol.for;w=d("react.element");ha=d("react.portal");c.Fragment=d("react.fragment");c.StrictMode=d("react.strict_mode");c.Profiler=d("react.profiler");ka=d("react.provider");la=d("react.context");ma=d("react.forward_ref");c.Suspense=d("react.suspense");na=d("react.memo");oa=d("react.lazy")}var Y="function"=== typeof Symbol&&Symbol.iterator,ya=Object.prototype.hasOwnProperty,U=Object.assign||function(a,b){if(null==a)throw new TypeError("Object.assign target cannot be null or undefined");for(var e=Object(a),c=1;c<arguments.length;c++){var d=arguments[c];if(null!=d){var g=void 0;d=Object(d);for(g in d)ya.call(d,g)&&(e[g]=d[g])}}return e},aa={isMounted:function(a){return!1},enqueueForceUpdate:function(a,b,c){},enqueueReplaceState:function(a,b,c,d){},enqueueSetState:function(a,b,c,d){}},Z={};v.prototype.isReactComponent= {};v.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error(y(85));this.updater.enqueueSetState(this,a,b,"setState")};v.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};ba.prototype=v.prototype;d=K.prototype=new ba;d.constructor=K;U(d,v.prototype);d.isPureReactComponent=!0;var L={current:null},ea=Object.prototype.hasOwnProperty,fa={key:!0,ref:!0,__self:!0,__source:!0},ia=/\/+/g,ja={current:null},V;if("object"===typeof performance&& "function"===typeof performance.now){var za=performance;var t=function(){return za.now()}}else{var pa=Date,Aa=pa.now();t=function(){return pa.now()-Aa}}if("undefined"===typeof window||"function"!==typeof MessageChannel){var B=null,qa=null,ra=function(){if(null!==B)try{var a=t();B(!0,a);B=null}catch(b){throw setTimeout(ra,0),b;}};var A=function(a){null!==B?setTimeout(A,0,a):(B=a,setTimeout(ra,0))};var G=function(a,b){qa=setTimeout(a,b)};var S=function(){clearTimeout(qa)};var T=function(){return!1}; d=V=function(){}}else{var Ba=window.setTimeout,Ca=window.clearTimeout;"undefined"!==typeof console&&(d=window.cancelAnimationFrame,"function"!==typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!==typeof d&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")); var I=!1,J=null,W=-1,sa=5,ta=0;T=function(){return t()>=ta};d=function(){};V=function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):sa=0<a?Math.floor(1E3/a):5};var ua=new MessageChannel,X=ua.port2;ua.port1.onmessage=function(){if(null!==J){var a=t();ta=a+sa;try{J(!0,a)?X.postMessage(null):(I=!1,J=null)}catch(b){throw X.postMessage(null),b;}}else I=!1};A=function(a){J=a;I||(I=!0,X.postMessage(null))};G= function(a,b){W=Ba(function(){a(t())},b)};S=function(){Ca(W);W=-1}}var q=[],r=[],Da=1,m=null,g=3,H=!1,u=!1,z=!1,Ea=0;d={ReactCurrentDispatcher:ja,ReactCurrentOwner:L,IsSomeRendererActing:{current:!1},ReactCurrentBatchConfig:{transition:0},assign:U,Scheduler:{__proto__:null,unstable_ImmediatePriority:1,unstable_UserBlockingPriority:2,unstable_NormalPriority:3,unstable_IdlePriority:5,unstable_LowPriority:4,unstable_runWithPriority:function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a= 3}var c=g;g=a;try{return b()}finally{g=c}},unstable_next:function(a){switch(g){case 1:case 2:case 3:var b=3;break;default:b=g}var c=g;g=b;try{return a()}finally{g=c}},unstable_scheduleCallback:function(a,b,c){var d=t();"object"===typeof c&&null!==c?(c=c.delay,c="number"===typeof c&&0<c?d+c:d):c=d;switch(a){case 1:var e=-1;break;case 2:e=250;break;case 5:e=1073741823;break;case 4:e=1E4;break;default:e=5E3}e=c+e;a={id:Da++,callback:b,priorityLevel:a,startTime:c,expirationTime:e,sortIndex:-1};c>d?(a.sortIndex= c,O(r,a),null===p(q)&&a===p(r)&&(z?S():z=!0,G(Q,c-d))):(a.sortIndex=e,O(q,a),u||H||(u=!0,A(R)));return a},unstable_cancelCallback:function(a){a.callback=null},unstable_wrapCallback:function(a){var b=g;return function(){var c=g;g=b;try{return a.apply(this,arguments)}finally{g=c}}},unstable_getCurrentPriorityLevel:function(){return g},get unstable_shouldYield(){return T},unstable_requestPaint:d,unstable_continueExecution:function(){u||H||(u=!0,A(R))},unstable_pauseExecution:function(){},unstable_getFirstCallbackNode:function(){return p(q)}, get unstable_now(){return t},get unstable_forceFrameRate(){return V},unstable_Profiling:null},SchedulerTracing:{__proto__:null,__interactionsRef:null,__subscriberRef:null,unstable_clear:function(a){return a()},unstable_getCurrent:function(){return null},unstable_getThreadID:function(){return++Ea},unstable_trace:function(a,b,c){return c()},unstable_wrap:function(a){return a},unstable_subscribe:function(a){},unstable_unsubscribe:function(a){}}};c.Children={map:D,forEach:function(a,b,c){D(a,function(){b.apply(this, arguments)},c)},count:function(a){var b=0;D(a,function(){b++});return b},toArray:function(a){return D(a,function(a){return a})||[]},only:function(a){if(!M(a))throw Error(y(143));return a}};c.Component=v;c.PureComponent=K;c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=d;c.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error(y(267,a));var d=U({},a.props),e=a.key,g=a.ref,n=a._owner;if(null!=b){void 0!==b.ref&&(g=b.ref,n=L.current);void 0!==b.key&&(e=""+b.key);if(a.type&&a.type.defaultProps)var k= a.type.defaultProps;for(h in b)ea.call(b,h)&&!fa.hasOwnProperty(h)&&(d[h]=void 0===b[h]&&void 0!==k?k[h]:b[h])}var h=arguments.length-2;if(1===h)d.children=c;else if(1<h){k=Array(h);for(var m=0;m<h;m++)k[m]=arguments[m+2];d.children=k}return{$$typeof:w,type:a.type,key:e,ref:g,props:d,_owner:n}};c.createContext=function(a,b){void 0===b&&(b=null);a={$$typeof:la,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:ka,_context:a};return a.Consumer= a};c.createElement=ca;c.createFactory=function(a){var b=ca.bind(null,a);b.type=a;return b};c.createRef=function(){return{current:null}};c.forwardRef=function(a){return{$$typeof:ma,render:a}};c.isValidElement=M;c.lazy=function(a){return{$$typeof:oa,_payload:{_status:-1,_result:a},_init:xa}};c.memo=function(a,b){return{$$typeof:na,type:a,compare:void 0===b?null:b}};c.useCallback=function(a,b){return n().useCallback(a,b)};c.useContext=function(a,b){return n().useContext(a,b)};c.useDebugValue=function(a, b){};c.useEffect=function(a,b){return n().useEffect(a,b)};c.useImperativeHandle=function(a,b,c){return n().useImperativeHandle(a,b,c)};c.useLayoutEffect=function(a,b){return n().useLayoutEffect(a,b)};c.useMemo=function(a,b){return n().useMemo(a,b)};c.useReducer=function(a,b,c){return n().useReducer(a,b,c)};c.useRef=function(a){return n().useRef(a)};c.useState=function(a){return n().useState(a)};c.version="17.0.1"}); })(); /** @license React v17.0.1 * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ (function(){/* Modernizr 3.0.0pre (Custom Build) | MIT */ 'use strict';(function(M,ha){"object"===typeof exports&&"undefined"!==typeof module?ha(exports,require("react")):"function"===typeof define&&define.amd?define(["exports","react"],ha):(M=M||self,ha(M.ReactDOM={},M.React))})(this,function(M,ha){function m(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."} function Ta(a,b){gb(a,b);gb(a+"Capture",b)}function gb(a,b){Ib[a]=b;for(a=0;a<b.length;a++)zf.add(b[a])}function li(a){if(Af.call(Bf,a))return!0;if(Af.call(Cf,a))return!1;if(mi.test(a))return Bf[a]=!0;Cf[a]=!0;return!1}function ni(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}}function oi(a,b,c,d){if(null=== b||"undefined"===typeof b||ni(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function Q(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}function Ed(a,b,c,d){var e=I.hasOwnProperty(b)?I[b]:null;var f=null!==e?0===e.type:d?!1:!(2<b.length)|| "o"!==b[0]&&"O"!==b[0]||"n"!==b[1]&&"N"!==b[1]?!1:!0;f||(oi(b,c,e,d)&&(c=null),d||null===e?li(b)&&(null===c?a.removeAttribute(b):a.setAttribute(b,""+c)):e.mustUseProperty?a[e.propertyName]=null===c?3===e.type?!1:"":c:(b=e.attributeName,d=e.attributeNamespace,null===c?a.removeAttribute(b):(e=e.type,c=3===e||4===e&&!0===c?"":""+c,d?a.setAttributeNS(d,b,c):a.setAttribute(b,c))))}function Jb(a){if(null===a||"object"!==typeof a)return null;a=Df&&a[Df]||a["@@iterator"];return"function"===typeof a?a:null} function Kb(a,b,c){if(void 0===Fd)try{throw Error();}catch(d){Fd=(b=d.stack.trim().match(/\n( *(at )?)/))&&b[1]||""}return"\n"+Fd+a}function Bc(a,b){if(!a||Gd)return"";Gd=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(b)if(b=function(){throw Error();},Object.defineProperty(b.prototype,"props",{set:function(){throw Error();}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(b,[])}catch(k){var d=k}Reflect.construct(a,[],b)}else{try{b.call()}catch(k){d=k}a.call(b.prototype)}else{try{throw Error(); }catch(k){d=k}a()}}catch(k){if(k&&d&&"string"===typeof k.stack){for(var e=k.stack.split("\n"),f=d.stack.split("\n"),g=e.length-1,h=f.length-1;1<=g&&0<=h&&e[g]!==f[h];)h--;for(;1<=g&&0<=h;g--,h--)if(e[g]!==f[h]){if(1!==g||1!==h){do if(g--,h--,0>h||e[g]!==f[h])return"\n"+e[g].replace(" at new "," at ");while(1<=g&&0<=h)}break}}}finally{Gd=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:"")?Kb(a):""}function pi(a){switch(a.tag){case 5:return Kb(a.type);case 16:return Kb("Lazy");case 13:return Kb("Suspense"); case 19:return Kb("SuspenseList");case 0:case 2:case 15:return a=Bc(a.type,!1),a;case 11:return a=Bc(a.type.render,!1),a;case 22:return a=Bc(a.type._render,!1),a;case 1:return a=Bc(a.type,!0),a;default:return""}}function hb(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case wa:return"Fragment";case Ua:return"Portal";case Lb:return"Profiler";case Hd:return"StrictMode";case Mb:return"Suspense";case Cc:return"SuspenseList"}if("object"=== typeof a)switch(a.$$typeof){case Id:return(a.displayName||"Context")+".Consumer";case Jd:return(a._context.displayName||"Context")+".Provider";case Dc:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+")":"ForwardRef");case Ec:return hb(a.type);case Kd:return hb(a._render);case Ld:b=a._payload;a=a._init;try{return hb(a(b))}catch(c){}}return null}function xa(a){switch(typeof a){case "boolean":case "number":case "object":case "string":case "undefined":return a; default:return""}}function Ef(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"===b)}function qi(a){var b=Ef(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a)}});Object.defineProperty(a, b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker=null;delete a[b]}}}}function Fc(a){a._valueTracker||(a._valueTracker=qi(a))}function Ff(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=Ef(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Gc(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement|| a.body}catch(b){return a.body}}function Md(a,b){var c=b.checked;return B({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Gf(a,b){var c=null==b.defaultValue?"":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=xa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}function Hf(a,b){b=b.checked;null!=b&&Ed(a,"checked", b,!1)}function Nd(a,b){Hf(a,b);var c=xa(b.value),d=b.type;if(null!=c)if("number"===d){if(0===c&&""===a.value||a.value!=c)a.value=""+c}else a.value!==""+c&&(a.value=""+c);else if("submit"===d||"reset"===d){a.removeAttribute("value");return}b.hasOwnProperty("value")?Od(a,b.type,c):b.hasOwnProperty("defaultValue")&&Od(a,b.type,xa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}function If(a,b,c){if(b.hasOwnProperty("value")||b.hasOwnProperty("defaultValue")){var d= b.type;if(!("submit"!==d&&"reset"!==d||void 0!==b.value&&null!==b.value))return;b=""+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;""!==c&&(a.name="");a.defaultChecked=!!a._wrapperState.initialChecked;""!==c&&(a.name=c)}function Od(a,b,c){if("number"!==b||Gc(a.ownerDocument)!==a)null==c?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+c&&(a.defaultValue=""+c)}function ri(a){var b="";ha.Children.forEach(a,function(a){null!=a&&(b+=a)});return b} function Pd(a,b){a=B({children:void 0},b);if(b=ri(b.children))a.children=b;return a}function ib(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e<c.length;e++)b["$"+c[e]]=!0;for(c=0;c<a.length;c++)e=b.hasOwnProperty("$"+a[c].value),a[c].selected!==e&&(a[c].selected=e),e&&d&&(a[c].defaultSelected=!0)}else{c=""+xa(c);b=null;for(e=0;e<a.length;e++){if(a[e].value===c){a[e].selected=!0;d&&(a[e].defaultSelected=!0);return}null!==b||a[e].disabled||(b=a[e])}null!==b&&(b.selected=!0)}}function Qd(a,b){if(null!= b.dangerouslySetInnerHTML)throw Error(m(91));return B({},b,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Jf(a,b){var c=b.value;if(null==c){c=b.children;b=b.defaultValue;if(null!=c){if(null!=b)throw Error(m(92));if(Array.isArray(c)){if(!(1>=c.length))throw Error(m(93));c=c[0]}b=c}null==b&&(b="");c=b}a._wrapperState={initialValue:xa(c)}}function Kf(a,b){var c=xa(b.value),d=xa(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!== c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d)}function Lf(a,b){b=a.textContent;b===a._wrapperState.initialValue&&""!==b&&null!==b&&(a.value=b)}function Mf(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Rd(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?Mf(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a}function Nf(a,b,c){return null== b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||Nb.hasOwnProperty(a)&&Nb[a]?(""+b).trim():b+"px"}function Of(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=Nf(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}function Sd(a,b){if(b){if(si[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(m(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(m(60));if(!("object"===typeof b.dangerouslySetInnerHTML&& "__html"in b.dangerouslySetInnerHTML))throw Error(m(61));}if(null!=b.style&&"object"!==typeof b.style)throw Error(m(62));}}function Td(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1;default:return!0}}function Ud(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement); return 3===a.nodeType?a.parentNode:a}function Pf(a){if(a=Ob(a)){if("function"!==typeof Vd)throw Error(m(280));var b=a.stateNode;b&&(b=Hc(b),Vd(a.stateNode,a.type,b))}}function Qf(a){jb?kb?kb.push(a):kb=[a]:jb=a}function Rf(){if(jb){var a=jb,b=kb;kb=jb=null;Pf(a);if(b)for(a=0;a<b.length;a++)Pf(b[a])}}function Wd(){if(null!==jb||null!==kb)Xd(),Rf()}function ti(a,b,c){if(Yd)return a(b,c);Yd=!0;try{return Sf(a,b,c)}finally{Yd=!1,Wd()}}function Pb(a,b){var c=a.stateNode;if(null===c)return null;var d=Hc(c); if(null===d)return null;c=d[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":case "onMouseEnter":(d=!d.disabled)||(a=a.type,d=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!d;break a;default:a=!1}if(a)return null;if(c&&"function"!==typeof c)throw Error(m(231,b,typeof c));return c}function ui(a,b,c,d,e, f,g,h,k){Qb=!1;Ic=null;vi.apply(wi,arguments)}function xi(a,b,c,d,e,f,g,h,k){ui.apply(this,arguments);if(Qb){if(Qb){var v=Ic;Qb=!1;Ic=null}else throw Error(m(198));Jc||(Jc=!0,Zd=v)}}function Va(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else{a=b;do b=a,0!==(b.flags&1026)&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function Tf(a){if(13===a.tag){var b=a.memoizedState;null===b&&(a=a.alternate,null!==a&&(b=a.memoizedState));if(null!==b)return b.dehydrated}return null}function Uf(a){if(Va(a)!== a)throw Error(m(188));}function yi(a){var b=a.alternate;if(!b){b=Va(a);if(null===b)throw Error(m(188));return b!==a?null:a}for(var c=a,d=b;;){var e=c.return;if(null===e)break;var f=e.alternate;if(null===f){d=e.return;if(null!==d){c=d;continue}break}if(e.child===f.child){for(f=e.child;f;){if(f===c)return Uf(e),a;if(f===d)return Uf(e),b;f=f.sibling}throw Error(m(188));}if(c.return!==d.return)c=e,d=f;else{for(var g=!1,h=e.child;h;){if(h===c){g=!0;c=e;d=f;break}if(h===d){g=!0;d=e;c=f;break}h=h.sibling}if(!g){for(h= f.child;h;){if(h===c){g=!0;c=f;d=e;break}if(h===d){g=!0;d=f;c=e;break}h=h.sibling}if(!g)throw Error(m(189));}}if(c.alternate!==d)throw Error(m(190));}if(3!==c.tag)throw Error(m(188));return c.stateNode.current===c?a:b}function Vf(a){a=yi(a);if(!a)return null;for(var b=a;;){if(5===b.tag||6===b.tag)return b;if(b.child)b.child.return=b,b=b.child;else{if(b===a)break;for(;!b.sibling;){if(!b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}}return null}function Wf(a,b){for(var c= a.alternate;null!==b;){if(b===a||b===c)return!0;b=b.return}return!1}function $d(a,b,c,d,e){return{blockedOn:a,domEventName:b,eventSystemFlags:c|16,nativeEvent:e,targetContainers:[d]}}function Xf(a,b){switch(a){case "focusin":case "focusout":ya=null;break;case "dragenter":case "dragleave":za=null;break;case "mouseover":case "mouseout":Aa=null;break;case "pointerover":case "pointerout":Rb.delete(b.pointerId);break;case "gotpointercapture":case "lostpointercapture":Sb.delete(b.pointerId)}}function Tb(a, b,c,d,e,f){if(null===a||a.nativeEvent!==f)return a=$d(b,c,d,e,f),null!==b&&(b=Ob(b),null!==b&&Yf(b)),a;a.eventSystemFlags|=d;b=a.targetContainers;null!==e&&-1===b.indexOf(e)&&b.push(e);return a}function zi(a,b,c,d,e){switch(b){case "focusin":return ya=Tb(ya,a,b,c,d,e),!0;case "dragenter":return za=Tb(za,a,b,c,d,e),!0;case "mouseover":return Aa=Tb(Aa,a,b,c,d,e),!0;case "pointerover":var f=e.pointerId;Rb.set(f,Tb(Rb.get(f)||null,a,b,c,d,e));return!0;case "gotpointercapture":return f=e.pointerId,Sb.set(f, Tb(Sb.get(f)||null,a,b,c,d,e)),!0}return!1}function Ai(a){var b=Wa(a.target);if(null!==b){var c=Va(b);if(null!==c)if(b=c.tag,13===b){if(b=Tf(c),null!==b){a.blockedOn=b;Bi(a.lanePriority,function(){ae(a.priority,function(){Ci(c)})});return}}else if(3===b&&c.stateNode.hydrate){a.blockedOn=3===c.tag?c.stateNode.containerInfo:null;return}}a.blockedOn=null}function Kc(a){if(null!==a.blockedOn)return!1;for(var b=a.targetContainers;0<b.length;){var c=be(a.domEventName,a.eventSystemFlags,b[0],a.nativeEvent); if(null!==c)return b=Ob(c),null!==b&&Yf(b),a.blockedOn=c,!1;b.shift()}return!0}function Zf(a,b,c){Kc(a)&&c.delete(b)}function Di(){for(ce=!1;0<ia.length;){var a=ia[0];if(null!==a.blockedOn){a=Ob(a.blockedOn);null!==a&&Ei(a);break}for(var b=a.targetContainers;0<b.length;){var c=be(a.domEventName,a.eventSystemFlags,b[0],a.nativeEvent);if(null!==c){a.blockedOn=c;break}b.shift()}null===a.blockedOn&&ia.shift()}null!==ya&&Kc(ya)&&(ya=null);null!==za&&Kc(za)&&(za=null);null!==Aa&&Kc(Aa)&&(Aa=null);Rb.forEach(Zf); Sb.forEach(Zf)}function Ub(a,b){a.blockedOn===b&&(a.blockedOn=null,ce||(ce=!0,$f(ag,Di)))}function bg(a){if(0<ia.length){Ub(ia[0],a);for(var b=1;b<ia.length;b++){var c=ia[b];c.blockedOn===a&&(c.blockedOn=null)}}null!==ya&&Ub(ya,a);null!==za&&Ub(za,a);null!==Aa&&Ub(Aa,a);b=function(b){return Ub(b,a)};Rb.forEach(b);Sb.forEach(b);for(b=0;b<Vb.length;b++)c=Vb[b],c.blockedOn===a&&(c.blockedOn=null);for(;0<Vb.length&&(b=Vb[0],null===b.blockedOn);)Ai(b),null===b.blockedOn&&Vb.shift()}function Lc(a,b){var c= {};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;return c}function Mc(a){if(de[a])return de[a];if(!lb[a])return a;var b=lb[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in cg)return de[a]=b[c];return a}function ee(a,b){for(var c=0;c<a.length;c+=2){var d=a[c],e=a[c+1];e="on"+(e[0].toUpperCase()+e.slice(1));fe.set(d,b);dg.set(d,e);Ta(e,[d])}}function mb(a){if(0!==(1&a))return w=15,1;if(0!==(2&a))return w=14,2;if(0!==(4&a))return w=13,4;var b=24&a;if(0!==b)return w=12,b; if(0!==(a&32))return w=11,32;b=192&a;if(0!==b)return w=10,b;if(0!==(a&256))return w=9,256;b=3584&a;if(0!==b)return w=8,b;if(0!==(a&4096))return w=7,4096;b=4186112&a;if(0!==b)return w=6,b;b=62914560&a;if(0!==b)return w=5,b;if(a&67108864)return w=4,67108864;if(0!==(a&134217728))return w=3,134217728;b=805306368&a;if(0!==b)return w=2,b;if(0!==(1073741824&a))return w=1,1073741824;w=8;return a}function Fi(a){switch(a){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}} function Gi(a){switch(a){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(m(358,a));}}function Wb(a,b){var c=a.pendingLanes;if(0===c)return w=0;var d=0,e=0,f=a.expiredLanes,g=a.suspendedLanes,h=a.pingedLanes;if(0!==f)d=f,e=w=15;else if(f=c&134217727,0!==f){var k=f&~g;0!==k?(d=mb(k),e=w):(h&=f,0!==h&&(d=mb(h),e=w))}else f=c&~g,0!==f?(d=mb(f),e=w):0!==h&&(d=mb(h), e=w);if(0===d)return 0;d=31-Ba(d);d=c&((0>d?0:1<<d)<<1)-1;if(0!==b&&b!==d&&0===(b&g)){mb(b);if(e<=w)return b;w=e}b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0<b;)c=31-Ba(b),e=1<<c,d|=a[c],b&=~e;return d}function eg(a){a=a.pendingLanes&-1073741825;return 0!==a?a:a&1073741824?1073741824:0}function Nc(a,b){switch(a){case 15:return 1;case 14:return 2;case 12:return a=nb(24&~b),0===a?Nc(10,b):a;case 10:return a=nb(192&~b),0===a?Nc(8,b):a;case 8:return a=nb(3584&~b),0===a&&(a=nb(4186112&~b), 0===a&&(a=512)),a;case 2:return b=nb(805306368&~b),0===b&&(b=268435456),b}throw Error(m(358,a));}function nb(a){return a&-a}function ge(a){for(var b=[],c=0;31>c;c++)b.push(a);return b}function Oc(a,b,c){a.pendingLanes|=b;var d=b-1;a.suspendedLanes&=d;a.pingedLanes&=d;a=a.eventTimes;b=31-Ba(b);a[b]=c}function Hi(a){return 0===a?32:31-(Ii(a)/Ji|0)|0}function Ki(a,b,c,d){Xa||Xd();var e=he,f=Xa;Xa=!0;try{fg(e,a,b,c,d)}finally{(Xa=f)||Wd()}}function Li(a,b,c,d){Mi(Ni,he.bind(null,a,b,c,d))}function he(a, b,c,d){if(Pc){var e;if((e=0===(b&4))&&0<ia.length&&-1<gg.indexOf(a))a=$d(null,a,b,c,d),ia.push(a);else{var f=be(a,b,c,d);if(null===f)e&&Xf(a,d);else{if(e){if(-1<gg.indexOf(a)){a=$d(f,a,b,c,d);ia.push(a);return}if(zi(f,a,b,c,d))return;Xf(a,d)}hg(a,b,d,null,c)}}}}function be(a,b,c,d){var e=Ud(d);e=Wa(e);if(null!==e){var f=Va(e);if(null===f)e=null;else{var g=f.tag;if(13===g){e=Tf(f);if(null!==e)return e;e=null}else if(3===g){if(f.stateNode.hydrate)return 3===f.tag?f.stateNode.containerInfo:null;e=null}else f!== e&&(e=null)}}hg(a,b,d,e,c);return null}function ig(){if(Qc)return Qc;var a,b=ie,c=b.length,d,e="value"in Ca?Ca.value:Ca.textContent,f=e.length;for(a=0;a<c&&b[a]===e[a];a++);var g=c-a;for(d=1;d<=g&&b[c-d]===e[f-d];d++);return Qc=e.slice(a,1<d?1-d:void 0)}function Rc(a){var b=a.keyCode;"charCode"in a?(a=a.charCode,0===a&&13===b&&(a=13)):a=b;10===a&&(a=13);return 32<=a||13===a?a:0}function Sc(){return!0}function jg(){return!1}function V(a){function b(b,d,e,f,g){this._reactName=b;this._targetInst=e;this.type= d;this.nativeEvent=f;this.target=g;this.currentTarget=null;for(var c in a)a.hasOwnProperty(c)&&(b=a[c],this[c]=b?b(f):f[c]);this.isDefaultPrevented=(null!=f.defaultPrevented?f.defaultPrevented:!1===f.returnValue)?Sc:jg;this.isPropagationStopped=jg;return this}B(b.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=Sc)},stopPropagation:function(){var a= this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=Sc)},persist:function(){},isPersistent:Sc});return b}function Oi(a){var b=this.nativeEvent;return b.getModifierState?b.getModifierState(a):(a=Pi[a])?!!b[a]:!1}function je(a){return Oi}function kg(a,b){switch(a){case "keyup":return-1!==Qi.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "focusout":return!0;default:return!1}} function lg(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}function Ri(a,b){switch(a){case "compositionend":return lg(b);case "keypress":if(32!==b.which)return null;mg=!0;return ng;case "textInput":return a=b.data,a===ng&&mg?null:a;default:return null}}function Si(a,b){if(ob)return"compositionend"===a||!ke&&kg(a,b)?(a=ig(),Qc=ie=Ca=null,ob=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1<b.char.length)return b.char; if(b.which)return String.fromCharCode(b.which)}return null;case "compositionend":return og&&"ko"!==b.locale?null:b.data;default:return null}}function pg(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return"input"===b?!!Ti[a.type]:"textarea"===b?!0:!1}function Ui(a){if(!oa)return!1;a="on"+a;var b=a in document;b||(b=document.createElement("div"),b.setAttribute(a,"return;"),b="function"===typeof b[a]);return b}function qg(a,b,c,d){Qf(d);b=Tc(b,"onChange");0<b.length&&(c=new le("onChange","change", null,c,d),a.push({event:c,listeners:b}))}function Vi(a){rg(a,0)}function Uc(a){var b=pb(a);if(Ff(b))return a}function Wi(a,b){if("change"===a)return b}function sg(){Xb&&(Xb.detachEvent("onpropertychange",tg),Yb=Xb=null)}function tg(a){if("value"===a.propertyName&&Uc(Yb)){var b=[];qg(b,Yb,a,Ud(a));a=Vi;if(Xa)a(b);else{Xa=!0;try{me(a,b)}finally{Xa=!1,Wd()}}}}function Xi(a,b,c){"focusin"===a?(sg(),Xb=b,Yb=c,Xb.attachEvent("onpropertychange",tg)):"focusout"===a&&sg()}function Yi(a,b){if("selectionchange"=== a||"keyup"===a||"keydown"===a)return Uc(Yb)}function Zi(a,b){if("click"===a)return Uc(b)}function $i(a,b){if("input"===a||"change"===a)return Uc(b)}function aj(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}function Zb(a,b){if(X(a,b))return!0;if("object"!==typeof a||null===a||"object"!==typeof b||null===b)return!1;var c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++)if(!bj.call(b,c[d])||!X(a[c[d]],b[c[d]]))return!1;return!0}function ug(a){for(;a&&a.firstChild;)a= a.firstChild;return a}function vg(a,b){var c=ug(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=ug(c)}}function wg(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?wg(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}function xg(){for(var a=window,b=Gc();b instanceof a.HTMLIFrameElement;){try{var c= "string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Gc(a.document)}return b}function ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)}function yg(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;oe||null==qb||qb!==Gc(d)||(d=qb,"selectionStart"in d&&ne(d)?d={start:d.selectionStart, end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),$b&&Zb($b,d)||($b=d,d=Tc(pe,"onSelect"),0<d.length&&(b=new le("onSelect","select",null,b,c),a.push({event:b,listeners:d}),b.target=qb)))}function zg(a,b,c){var d=a.type||"unknown-event";a.currentTarget=c;xi(d,b,void 0,a);a.currentTarget=null}function rg(a,b){b=0!==(b&4);for(var c=0;c<a.length;c++){var d= a[c],e=d.event;d=d.listeners;a:{var f=void 0;if(b)for(var g=d.length-1;0<=g;g--){var h=d[g],k=h.instance,v=h.currentTarget;h=h.listener;if(k!==f&&e.isPropagationStopped())break a;zg(e,h,v);f=k}else for(g=0;g<d.length;g++){h=d[g];k=h.instance;v=h.currentTarget;h=h.listener;if(k!==f&&e.isPropagationStopped())break a;zg(e,h,v);f=k}}}if(Jc)throw a=Zd,Jc=!1,Zd=null,a;}function z(a,b){var c=Ag(b),d=a+"__bubble";c.has(d)||(Bg(b,a,2,!1),c.add(d))}function Cg(a){a[Dg]||(a[Dg]=!0,zf.forEach(function(b){Eg.has(b)|| Fg(b,!1,a,null);Fg(b,!0,a,null)}))}function Fg(a,b,c,d){var e=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,f=c;"selectionchange"===a&&9!==c.nodeType&&(f=c.ownerDocument);if(null!==d&&!b&&Eg.has(a)){if("scroll"!==a)return;e|=2;f=d}var g=Ag(f),h=a+"__"+(b?"capture":"bubble");g.has(h)||(b&&(e|=4),Bg(f,a,e,b),g.add(h))}function Bg(a,b,c,d,e){e=fe.get(b);switch(void 0===e?2:e){case 0:e=Ki;break;case 1:e=Li;break;default:e=he}c=e.bind(null,b,c,a);e=void 0;!qe||"touchstart"!==b&&"touchmove"!== b&&"wheel"!==b||(e=!0);d?void 0!==e?a.addEventListener(b,c,{capture:!0,passive:e}):a.addEventListener(b,c,!0):void 0!==e?a.addEventListener(b,c,{passive:e}):a.addEventListener(b,c,!1)}function hg(a,b,c,d,e){var f=d;if(0===(b&1)&&0===(b&2)&&null!==d)a:for(;;){if(null===d)return;var g=d.tag;if(3===g||4===g){var h=d.stateNode.containerInfo;if(h===e||8===h.nodeType&&h.parentNode===e)break;if(4===g)for(g=d.return;null!==g;){var k=g.tag;if(3===k||4===k)if(k=g.stateNode.containerInfo,k===e||8===k.nodeType&& k.parentNode===e)return;g=g.return}for(;null!==h;){g=Wa(h);if(null===g)return;k=g.tag;if(5===k||6===k){d=f=g;continue a}h=h.parentNode}}d=d.return}ti(function(){var d=f,e=Ud(c),g=[];a:{var h=dg.get(a);if(void 0!==h){var k=le,m=a;switch(a){case "keypress":if(0===Rc(c))break a;case "keydown":case "keyup":k=cj;break;case "focusin":m="focus";k=re;break;case "focusout":m="blur";k=re;break;case "beforeblur":case "afterblur":k=re;break;case "click":if(2===c.button)break a;case "auxclick":case "dblclick":case "mousedown":case "mousemove":case "mouseup":case "mouseout":case "mouseover":case "contextmenu":k= Gg;break;case "drag":case "dragend":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "dragstart":case "drop":k=dj;break;case "touchcancel":case "touchend":case "touchmove":case "touchstart":k=ej;break;case Hg:case Ig:case Jg:k=fj;break;case Kg:k=gj;break;case "scroll":k=hj;break;case "wheel":k=ij;break;case "copy":case "cut":case "paste":k=jj;break;case "gotpointercapture":case "lostpointercapture":case "pointercancel":case "pointerdown":case "pointermove":case "pointerout":case "pointerover":case "pointerup":k= Lg}var l=0!==(b&4),C=!l&&"scroll"===a,x=l?null!==h?h+"Capture":null:h;l=[];for(var p=d,q;null!==p;){q=p;var u=q.stateNode;5===q.tag&&null!==u&&(q=u,null!==x&&(u=Pb(p,x),null!=u&&l.push(ac(p,u,q))));if(C)break;p=p.return}0<l.length&&(h=new k(h,m,null,c,e),g.push({event:h,listeners:l}))}}if(0===(b&7)){a:{h="mouseover"===a||"pointerover"===a;k="mouseout"===a||"pointerout"===a;if(h&&0===(b&16)&&(m=c.relatedTarget||c.fromElement)&&(Wa(m)||m[rb]))break a;if(k||h){h=e.window===e?e:(h=e.ownerDocument)?h.defaultView|| h.parentWindow:window;if(k){if(m=c.relatedTarget||c.toElement,k=d,m=m?Wa(m):null,null!==m&&(C=Va(m),m!==C||5!==m.tag&&6!==m.tag))m=null}else k=null,m=d;if(k!==m){l=Gg;u="onMouseLeave";x="onMouseEnter";p="mouse";if("pointerout"===a||"pointerover"===a)l=Lg,u="onPointerLeave",x="onPointerEnter",p="pointer";C=null==k?h:pb(k);q=null==m?h:pb(m);h=new l(u,p+"leave",k,c,e);h.target=C;h.relatedTarget=q;u=null;Wa(e)===d&&(l=new l(x,p+"enter",m,c,e),l.target=q,l.relatedTarget=C,u=l);C=u;if(k&&m)b:{l=k;x=m;p= 0;for(q=l;q;q=sb(q))p++;q=0;for(u=x;u;u=sb(u))q++;for(;0<p-q;)l=sb(l),p--;for(;0<q-p;)x=sb(x),q--;for(;p--;){if(l===x||null!==x&&l===x.alternate)break b;l=sb(l);x=sb(x)}l=null}else l=null;null!==k&&Mg(g,h,k,l,!1);null!==m&&null!==C&&Mg(g,C,m,l,!0)}}}a:{h=d?pb(d):window;k=h.nodeName&&h.nodeName.toLowerCase();if("select"===k||"input"===k&&"file"===h.type)var n=Wi;else if(pg(h))if(Ng)n=$i;else{n=Yi;var da=Xi}else(k=h.nodeName)&&"input"===k.toLowerCase()&&("checkbox"===h.type||"radio"===h.type)&&(n=Zi); if(n&&(n=n(a,d))){qg(g,n,c,e);break a}da&&da(a,h,d);"focusout"===a&&(da=h._wrapperState)&&da.controlled&&"number"===h.type&&Od(h,"number",h.value)}da=d?pb(d):window;switch(a){case "focusin":if(pg(da)||"true"===da.contentEditable)qb=da,pe=d,$b=null;break;case "focusout":$b=pe=qb=null;break;case "mousedown":oe=!0;break;case "contextmenu":case "mouseup":case "dragend":oe=!1;yg(g,c,e);break;case "selectionchange":if(kj)break;case "keydown":case "keyup":yg(g,c,e)}var Ea;if(ke)b:{switch(a){case "compositionstart":var F= "onCompositionStart";break b;case "compositionend":F="onCompositionEnd";break b;case "compositionupdate":F="onCompositionUpdate";break b}F=void 0}else ob?kg(a,c)&&(F="onCompositionEnd"):"keydown"===a&&229===c.keyCode&&(F="onCompositionStart");F&&(og&&"ko"!==c.locale&&(ob||"onCompositionStart"!==F?"onCompositionEnd"===F&&ob&&(Ea=ig()):(Ca=e,ie="value"in Ca?Ca.value:Ca.textContent,ob=!0)),da=Tc(d,F),0<da.length&&(F=new Og(F,a,null,c,e),g.push({event:F,listeners:da}),Ea?F.data=Ea:(Ea=lg(c),null!==Ea&& (F.data=Ea))));if(Ea=lj?Ri(a,c):Si(a,c))d=Tc(d,"onBeforeInput"),0<d.length&&(e=new mj("onBeforeInput","beforeinput",null,c,e),g.push({event:e,listeners:d}),e.data=Ea)}rg(g,b)})}function ac(a,b,c){return{instance:a,listener:b,currentTarget:c}}function Tc(a,b){for(var c=b+"Capture",d=[];null!==a;){var e=a,f=e.stateNode;5===e.tag&&null!==f&&(e=f,f=Pb(a,c),null!=f&&d.unshift(ac(a,f,e)),f=Pb(a,b),null!=f&&d.push(ac(a,f,e)));a=a.return}return d}function sb(a){if(null===a)return null;do a=a.return;while(a&& 5!==a.tag);return a?a:null}function Mg(a,b,c,d,e){for(var f=b._reactName,g=[];null!==c&&c!==d;){var h=c,k=h.alternate,v=h.stateNode;if(null!==k&&k===d)break;5===h.tag&&null!==v&&(h=v,e?(k=Pb(c,f),null!=k&&g.unshift(ac(c,k,h))):e||(k=Pb(c,f),null!=k&&g.push(ac(c,k,h))));c=c.return}0!==g.length&&a.push({event:b,listeners:g})}function Vc(){}function Pg(a,b){switch(a){case "button":case "input":case "select":case "textarea":return!!b.autoFocus}return!1}function se(a,b){return"textarea"===a||"option"=== a||"noscript"===a||"string"===typeof b.children||"number"===typeof b.children||"object"===typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&null!=b.dangerouslySetInnerHTML.__html}function te(a){1===a.nodeType?a.textContent="":9===a.nodeType&&(a=a.body,null!=a&&(a.textContent=""))}function tb(a){for(;null!=a;a=a.nextSibling){var b=a.nodeType;if(1===b||3===b)break}return a}function Qg(a){a=a.previousSibling;for(var b=0;a;){if(8===a.nodeType){var c=a.data;if("$"===c||"$!"===c||"$?"=== c){if(0===b)return a;b--}else"/$"===c&&b++}a=a.previousSibling}return null}function nj(a){return{$$typeof:ue,toString:a,valueOf:a}}function Wa(a){var b=a[Fa];if(b)return b;for(var c=a.parentNode;c;){if(b=c[rb]||c[Fa]){c=b.alternate;if(null!==b.child||null!==c&&null!==c.child)for(a=Qg(a);null!==a;){if(c=a[Fa])return c;a=Qg(a)}return b}a=c;c=a.parentNode}return null}function Ob(a){a=a[Fa]||a[rb];return!a||5!==a.tag&&6!==a.tag&&13!==a.tag&&3!==a.tag?null:a}function pb(a){if(5===a.tag||6===a.tag)return a.stateNode; throw Error(m(33));}function Hc(a){return a[Wc]||null}function Ag(a){var b=a[Rg];void 0===b&&(b=a[Rg]=new Set);return b}function Ga(a){return{current:a}}function t(a,b){0>ub||(a.current=ve[ub],ve[ub]=null,ub--)}function A(a,b,c){ub++;ve[ub]=a.current;a.current=b}function vb(a,b){var c=a.type.contextTypes;if(!c)return Ha;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext= b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function S(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Sg(a,b,c){if(D.current!==Ha)throw Error(m(168));A(D,b);A(J,c)}function Tg(a,b,c){var d=a.stateNode;a=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in a))throw Error(m(108,hb(b)||"Unknown",e));return B({},c,d)}function Xc(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Ha;Ya=D.current; A(D,a);A(J,J.current);return!0}function Ug(a,b,c){var d=a.stateNode;if(!d)throw Error(m(169));c?(a=Tg(a,b,Ya),d.__reactInternalMemoizedMergedChildContext=a,t(J),t(D),A(D,a)):t(J);A(J,c)}function wb(){switch(oj()){case Yc:return 99;case Vg:return 98;case Wg:return 97;case Xg:return 96;case Yg:return 95;default:throw Error(m(332));}}function Zg(a){switch(a){case 99:return Yc;case 98:return Vg;case 97:return Wg;case 96:return Xg;case 95:return Yg;default:throw Error(m(332));}}function Za(a,b){a=Zg(a); return pj(a,b)}function bc(a,b,c){a=Zg(a);return we(a,b,c)}function ja(){if(null!==Zc){var a=Zc;Zc=null;xe(a)}$g()}function $g(){if(!ye&&null!==pa){ye=!0;var a=0;try{var b=pa;Za(99,function(){for(;a<b.length;a++){var c=b[a];do c=c(!0);while(null!==c)}});pa=null}catch(c){throw null!==pa&&(pa=pa.slice(a+1)),we(Yc,ja),c;}finally{ye=!1}}}function ea(a,b){if(a&&a.defaultProps){b=B({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c]);return b}return b}function ze(){$c=xb=ad=null}function Ae(a){var b= bd.current;t(bd);a.type._context._currentValue=b}function ah(a,b){for(;null!==a;){var c=a.alternate;if((a.childLanes&b)===b)if(null===c||(c.childLanes&b)===b)break;else c.childLanes|=b;else a.childLanes|=b,null!==c&&(c.childLanes|=b);a=a.return}}function yb(a,b){ad=a;$c=xb=null;a=a.dependencies;null!==a&&null!==a.firstContext&&(0!==(a.lanes&b)&&(fa=!0),a.firstContext=null)}function Y(a,b){if($c!==a&&!1!==b&&0!==b){if("number"!==typeof b||1073741823===b)$c=a,b=1073741823;b={context:a,observedBits:b, next:null};if(null===xb){if(null===ad)throw Error(m(308));xb=b;ad.dependencies={lanes:0,firstContext:b,responders:null}}else xb=xb.next=b}return a._currentValue}function Be(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function bh(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Ia(a,b){return{eventTime:a, lane:b,tag:0,payload:null,callback:null,next:null}}function Ja(a,b){a=a.updateQueue;if(null!==a){a=a.shared;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}}function ch(a,b){var c=a.updateQueue,d=a.alternate;if(null!==d&&(d=d.updateQueue,c===d)){var e=null,f=null;c=c.firstBaseUpdate;if(null!==c){do{var g={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};null===f?e=f=g:f=f.next=g;c=c.next}while(null!==c);null===f?e=f=b:f=f.next=b}else e= f=b;c={baseState:d.baseState,firstBaseUpdate:e,lastBaseUpdate:f,shared:d.shared,effects:d.effects};a.updateQueue=c;return}a=c.lastBaseUpdate;null===a?c.firstBaseUpdate=b:a.next=b;c.lastBaseUpdate=b}function cc(a,b,c,d){var e=a.updateQueue;Ka=!1;var f=e.firstBaseUpdate,g=e.lastBaseUpdate,h=e.shared.pending;if(null!==h){e.shared.pending=null;var k=h,v=k.next;k.next=null;null===g?f=v:g.next=v;g=k;var m=a.alternate;if(null!==m){m=m.updateQueue;var l=m.lastBaseUpdate;l!==g&&(null===l?m.firstBaseUpdate= v:l.next=v,m.lastBaseUpdate=k)}}if(null!==f){l=e.baseState;g=0;m=v=k=null;do{h=f.lane;var r=f.eventTime;if((d&h)===h){null!==m&&(m=m.next={eventTime:r,lane:0,tag:f.tag,payload:f.payload,callback:f.callback,next:null});a:{var n=a,t=f;h=b;r=c;switch(t.tag){case 1:n=t.payload;if("function"===typeof n){l=n.call(r,l,h);break a}l=n;break a;case 3:n.flags=n.flags&-4097|64;case 0:n=t.payload;h="function"===typeof n?n.call(r,l,h):n;if(null===h||void 0===h)break a;l=B({},l,h);break a;case 2:Ka=!0}}null!==f.callback&& (a.flags|=32,h=e.effects,null===h?e.effects=[f]:h.push(f))}else r={eventTime:r,lane:h,tag:f.tag,payload:f.payload,callback:f.callback,next:null},null===m?(v=m=r,k=l):m=m.next=r,g|=h;f=f.next;if(null===f)if(h=e.shared.pending,null===h)break;else f=h.next,h.next=null,e.lastBaseUpdate=h,e.shared.pending=null}while(1);null===m&&(k=l);e.baseState=k;e.firstBaseUpdate=v;e.lastBaseUpdate=m;La|=g;a.lanes=g;a.memoizedState=l}}function dh(a,b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;b<a.length;b++){var d= a[b],e=d.callback;if(null!==e){d.callback=null;d=c;if("function"!==typeof e)throw Error(m(191,e));e.call(d)}}}function cd(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:B({},b,c);a.memoizedState=c;0===a.lanes&&(a.updateQueue.baseState=c)}function eh(a,b,c,d,e,f,g){a=a.stateNode;return"function"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!Zb(c,d)||!Zb(e,f):!0}function fh(a,b,c){var d=!1,e=Ha;var f=b.contextType;"object"=== typeof f&&null!==f?f=Y(f):(e=S(b)?Ya:D.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?vb(a,e):Ha);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=dd;a.stateNode=b;b._reactInternals=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b}function gh(a,b,c,d){a=b.state;"function"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);"function"===typeof b.UNSAFE_componentWillReceiveProps&& b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&dd.enqueueReplaceState(b,b.state,null)}function Ce(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs=hh;Be(a);var f=b.contextType;"object"===typeof f&&null!==f?e.context=Y(f):(f=S(b)?Ya:D.current,e.context=vb(a,f));cc(a,c,e,d);e.state=a.memoizedState;f=b.getDerivedStateFromProps;"function"===typeof f&&(cd(a,b,f,c),e.state=a.memoizedState);"function"===typeof b.getDerivedStateFromProps||"function"===typeof e.getSnapshotBeforeUpdate|| "function"!==typeof e.UNSAFE_componentWillMount&&"function"!==typeof e.componentWillMount||(b=e.state,"function"===typeof e.componentWillMount&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&dd.enqueueReplaceState(e,e.state,null),cc(a,c,e,d),e.state=a.memoizedState);"function"===typeof e.componentDidMount&&(a.flags|=4)}function dc(a,b,c){a=c.ref;if(null!==a&&"function"!==typeof a&&"object"!==typeof a){if(c._owner){c=c._owner;if(c){if(1!== c.tag)throw Error(m(309));var d=c.stateNode}if(!d)throw Error(m(147,a));var e=""+a;if(null!==b&&null!==b.ref&&"function"===typeof b.ref&&b.ref._stringRef===e)return b.ref;b=function(a){var b=d.refs;b===hh&&(b=d.refs={});null===a?delete b[e]:b[e]=a};b._stringRef=e;return b}if("string"!==typeof a)throw Error(m(284));if(!c._owner)throw Error(m(290,a));}return a}function ed(a,b){if("textarea"!==a.type)throw Error(m(31,"[object Object]"===Object.prototype.toString.call(b)?"object with keys {"+Object.keys(b).join(", ")+ "}":b));}function ih(a){function b(b,c){if(a){var d=b.lastEffect;null!==d?(d.nextEffect=c,b.lastEffect=c):b.firstEffect=b.lastEffect=c;c.nextEffect=null;c.flags=8}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b){a=Ma(a,b);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return c;d=b.alternate;if(null!==d)return d=d.index,d<c?(b.flags= 2,c):d;b.flags=2;return c}function g(b){a&&null===b.alternate&&(b.flags=2);return b}function h(a,b,c,d){if(null===b||6!==b.tag)return b=De(c,a.mode,d),b.return=a,b;b=e(b,c);b.return=a;return b}function k(a,b,c,d){if(null!==b&&b.elementType===c.type)return d=e(b,c.props),d.ref=dc(a,b,c),d.return=a,d;d=fd(c.type,c.key,c.props,null,a.mode,d);d.ref=dc(a,b,c);d.return=a;return d}function v(a,b,c,d){if(null===b||4!==b.tag||b.stateNode.containerInfo!==c.containerInfo||b.stateNode.implementation!==c.implementation)return b= Ee(c,a.mode,d),b.return=a,b;b=e(b,c.children||[]);b.return=a;return b}function l(a,b,c,d,f){if(null===b||7!==b.tag)return b=zb(c,a.mode,d,f),b.return=a,b;b=e(b,c);b.return=a;return b}function n(a,b,c){if("string"===typeof b||"number"===typeof b)return b=De(""+b,a.mode,c),b.return=a,b;if("object"===typeof b&&null!==b){switch(b.$$typeof){case ec:return c=fd(b.type,b.key,b.props,null,a.mode,c),c.ref=dc(a,null,b),c.return=a,c;case Ua:return b=Ee(b,a.mode,c),b.return=a,b}if(gd(b)||Jb(b))return b=zb(b, a.mode,c,null),b.return=a,b;ed(a,b)}return null}function r(a,b,c,d){var e=null!==b?b.key:null;if("string"===typeof c||"number"===typeof c)return null!==e?null:h(a,b,""+c,d);if("object"===typeof c&&null!==c){switch(c.$$typeof){case ec:return c.key===e?c.type===wa?l(a,b,c.props.children,d,e):k(a,b,c,d):null;case Ua:return c.key===e?v(a,b,c,d):null}if(gd(c)||Jb(c))return null!==e?null:l(a,b,c,d,null);ed(a,c)}return null}function t(a,b,c,d,e){if("string"===typeof d||"number"===typeof d)return a=a.get(c)|| null,h(b,a,""+d,e);if("object"===typeof d&&null!==d){switch(d.$$typeof){case ec:return a=a.get(null===d.key?c:d.key)||null,d.type===wa?l(b,a,d.props.children,e,d.key):k(b,a,d,e);case Ua:return a=a.get(null===d.key?c:d.key)||null,v(b,a,d,e)}if(gd(d)||Jb(d))return a=a.get(c)||null,l(b,a,d,e,null);ed(b,d)}return null}function w(e,g,h,k){for(var m=null,v=null,l=g,p=g=0,x=null;null!==l&&p<h.length;p++){l.index>p?(x=l,l=null):x=l.sibling;var C=r(e,l,h[p],k);if(null===C){null===l&&(l=x);break}a&&l&&null=== C.alternate&&b(e,l);g=f(C,g,p);null===v?m=C:v.sibling=C;v=C;l=x}if(p===h.length)return c(e,l),m;if(null===l){for(;p<h.length;p++)l=n(e,h[p],k),null!==l&&(g=f(l,g,p),null===v?m=l:v.sibling=l,v=l);return m}for(l=d(e,l);p<h.length;p++)x=t(l,e,p,h[p],k),null!==x&&(a&&null!==x.alternate&&l.delete(null===x.key?p:x.key),g=f(x,g,p),null===v?m=x:v.sibling=x,v=x);a&&l.forEach(function(a){return b(e,a)});return m}function z(e,g,h,k){var l=Jb(h);if("function"!==typeof l)throw Error(m(150));h=l.call(h);if(null== h)throw Error(m(151));for(var v=l=null,p=g,x=g=0,C=null,q=h.next();null!==p&&!q.done;x++,q=h.next()){p.index>x?(C=p,p=null):C=p.sibling;var Da=r(e,p,q.value,k);if(null===Da){null===p&&(p=C);break}a&&p&&null===Da.alternate&&b(e,p);g=f(Da,g,x);null===v?l=Da:v.sibling=Da;v=Da;p=C}if(q.done)return c(e,p),l;if(null===p){for(;!q.done;x++,q=h.next())q=n(e,q.value,k),null!==q&&(g=f(q,g,x),null===v?l=q:v.sibling=q,v=q);return l}for(p=d(e,p);!q.done;x++,q=h.next())q=t(p,e,x,q.value,k),null!==q&&(a&&null!== q.alternate&&p.delete(null===q.key?x:q.key),g=f(q,g,x),null===v?l=q:v.sibling=q,v=q);a&&p.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k="object"===typeof f&&null!==f&&f.type===wa&&null===f.key;k&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case ec:a:{l=f.key;for(k=d;null!==k;){if(k.key===l){switch(k.tag){case 7:if(f.type===wa){c(a,k.sibling);d=e(k,f.props.children);d.return=a;a=d;break a}break;default:if(k.elementType===f.type){c(a, k.sibling);d=e(k,f.props);d.ref=dc(a,k,f);d.return=a;a=d;break a}}c(a,k);break}else b(a,k);k=k.sibling}f.type===wa?(d=zb(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=fd(f.type,f.key,f.props,null,a.mode,h),h.ref=dc(a,d,f),h.return=a,a=h)}return g(a);case Ua:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d= d.sibling}d=Ee(f,a.mode,h);d.return=a;a=d}return g(a)}if("string"===typeof f||"number"===typeof f)return f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):(c(a,d),d=De(f,a.mode,h),d.return=a,a=d),g(a);if(gd(f))return w(a,d,f,h);if(Jb(f))return z(a,d,f,h);l&&ed(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 1:case 22:case 0:case 11:case 15:throw Error(m(152,hb(a.type)||"Component"));}return c(a,d)}}function $a(a){if(a===fc)throw Error(m(174));return a}function Fe(a,b){A(gc, b);A(hc,a);A(ka,fc);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:Rd(null,"");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=Rd(b,a)}t(ka);A(ka,b)}function Ab(a){t(ka);t(hc);t(gc)}function jh(a){$a(gc.current);var b=$a(ka.current);var c=Rd(b,a.type);b!==c&&(A(hc,a),A(ka,c))}function Ge(a){hc.current===a&&(t(ka),t(hc))}function hd(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||"$?"===c.data|| "$!"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&64))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}function kh(a,b){var c=Z(5,null,null,0);c.elementType="DELETED";c.type="DELETED";c.stateNode=b;c.return=a;c.flags=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect= a.lastEffect=c}function lh(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return!1;default:return!1}}function He(a){if(la){var b=Na;if(b){var c=b;if(!lh(a,b)){b=tb(c.nextSibling);if(!b||!lh(a,b)){a.flags=a.flags&-1025|2;la=!1;ra=a;return}kh(ra,c)}ra=a;Na=tb(b.firstChild)}else a.flags=a.flags&-1025|2,la=!1, ra=a}}function mh(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&13!==a.tag;)a=a.return;ra=a}function id(a){if(a!==ra)return!1;if(!la)return mh(a),la=!0,!1;var b=a.type;if(5!==a.tag||"head"!==b&&"body"!==b&&!se(b,a.memoizedProps))for(b=Na;b;)kh(a,b),b=tb(b.nextSibling);mh(a);if(13===a.tag){a=a.memoizedState;a=null!==a?a.dehydrated:null;if(!a)throw Error(m(317));a:{a=a.nextSibling;for(b=0;a;){if(8===a.nodeType){var c=a.data;if("/$"===c){if(0===b){Na=tb(a.nextSibling);break a}b--}else"$"!==c&&"$!"!== c&&"$?"!==c||b++}a=a.nextSibling}Na=null}}else Na=ra?tb(a.stateNode.nextSibling):null;return!0}function Ie(){Na=ra=null;la=!1}function Je(){for(var a=0;a<Bb.length;a++)Bb[a]._workInProgressVersionPrimary=null;Bb.length=0}function T(){throw Error(m(321));}function Ke(a,b){if(null===b)return!1;for(var c=0;c<b.length&&c<a.length;c++)if(!X(a[c],b[c]))return!1;return!0}function Le(a,b,c,d,e,f){ic=f;y=b;b.memoizedState=null;b.updateQueue=null;b.lanes=0;jc.current=null===a||null===a.memoizedState?qj:rj; a=c(d,e);if(kc){f=0;do{kc=!1;if(!(25>f))throw Error(m(301));f+=1;K=N=null;b.updateQueue=null;jc.current=sj;a=c(d,e)}while(kc)}jc.current=jd;b=null!==N&&null!==N.next;ic=0;K=N=y=null;kd=!1;if(b)throw Error(m(300));return a}function ab(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};null===K?y.memoizedState=K=a:K=K.next=a;return K}function bb(){if(null===N){var a=y.alternate;a=null!==a?a.memoizedState:null}else a=N.next;var b=null===K?y.memoizedState:K.next;if(null!== b)K=b,N=a;else{if(null===a)throw Error(m(310));N=a;a={memoizedState:N.memoizedState,baseState:N.baseState,baseQueue:N.baseQueue,queue:N.queue,next:null};null===K?y.memoizedState=K=a:K=K.next=a}return K}function ma(a,b){return"function"===typeof b?b(a):b}function lc(a,b,c){b=bb();c=b.queue;if(null===c)throw Error(m(311));c.lastRenderedReducer=a;var d=N,e=d.baseQueue,f=c.pending;if(null!==f){if(null!==e){var g=e.next;e.next=f.next;f.next=g}d.baseQueue=e=f;c.pending=null}if(null!==e){e=e.next;d=d.baseState; var h=g=f=null,k=e;do{var l=k.lane;if((ic&l)===l)null!==h&&(h=h.next={lane:0,action:k.action,eagerReducer:k.eagerReducer,eagerState:k.eagerState,next:null}),d=k.eagerReducer===a?k.eagerState:a(d,k.action);else{var n={lane:l,action:k.action,eagerReducer:k.eagerReducer,eagerState:k.eagerState,next:null};null===h?(g=h=n,f=d):h=h.next=n;y.lanes|=l;La|=l}k=k.next}while(null!==k&&k!==e);null===h?f=d:h.next=g;X(d,b.memoizedState)||(fa=!0);b.memoizedState=d;b.baseState=f;b.baseQueue=h;c.lastRenderedState= d}return[b.memoizedState,c.dispatch]}function mc(a,b,c){b=bb();c=b.queue;if(null===c)throw Error(m(311));c.lastRenderedReducer=a;var d=c.dispatch,e=c.pending,f=b.memoizedState;if(null!==e){c.pending=null;var g=e=e.next;do f=a(f,g.action),g=g.next;while(g!==e);X(f,b.memoizedState)||(fa=!0);b.memoizedState=f;null===b.baseQueue&&(b.baseState=f);c.lastRenderedState=f}return[f,d]}function nh(a,b,c){var d=b._getVersion;d=d(b._source);var e=b._workInProgressVersionPrimary;if(null!==e)a=e===d;else if(a=a.mutableReadLanes, a=(ic&a)===a)b._workInProgressVersionPrimary=d,Bb.push(b);if(a)return c(b._source);Bb.push(b);throw Error(m(350));}function oh(a,b,c,d){var e=R;if(null===e)throw Error(m(349));var f=b._getVersion,g=f(b._source),h=jc.current,k=h.useState(function(){return nh(e,b,c)}),l=k[1],n=k[0];k=K;var t=a.memoizedState,r=t.refs,w=r.getSnapshot,z=t.source;t=t.subscribe;var B=y;a.memoizedState={refs:r,source:b,subscribe:d};h.useEffect(function(){r.getSnapshot=c;r.setSnapshot=l;var a=f(b._source);if(!X(g,a)){a=c(b._source); X(n,a)||(l(a),a=Oa(B),e.mutableReadLanes|=a&e.pendingLanes);a=e.mutableReadLanes;e.entangledLanes|=a;for(var d=e.entanglements,h=a;0<h;){var k=31-Ba(h),m=1<<k;d[k]|=a;h&=~m}}},[c,b,d]);h.useEffect(function(){return d(b._source,function(){var a=r.getSnapshot,c=r.setSnapshot;try{c(a(b._source));var d=Oa(B);e.mutableReadLanes|=d&e.pendingLanes}catch(q){c(function(){throw q;})}})},[b,d]);X(w,c)&&X(z,b)&&X(t,d)||(a={pending:null,dispatch:null,lastRenderedReducer:ma,lastRenderedState:n},a.dispatch=l=Me.bind(null, y,a),k.queue=a,k.baseQueue=null,n=nh(e,b,c),k.memoizedState=k.baseState=n);return n}function ph(a,b,c){var d=bb();return oh(d,a,b,c)}function nc(a){var b=ab();"function"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue={pending:null,dispatch:null,lastRenderedReducer:ma,lastRenderedState:a};a=a.dispatch=Me.bind(null,y,a);return[b.memoizedState,a]}function ld(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};b=y.updateQueue;null===b?(b={lastEffect:null},y.updateQueue=b,b.lastEffect= a.next=a):(c=b.lastEffect,null===c?b.lastEffect=a.next=a:(d=c.next,c.next=a,a.next=d,b.lastEffect=a));return a}function qh(a){var b=ab();a={current:a};return b.memoizedState=a}function md(a){return bb().memoizedState}function Ne(a,b,c,d){var e=ab();y.flags|=a;e.memoizedState=ld(1|b,c,void 0,void 0===d?null:d)}function Oe(a,b,c,d){var e=bb();d=void 0===d?null:d;var f=void 0;if(null!==N){var g=N.memoizedState;f=g.destroy;if(null!==d&&Ke(d,g.deps)){ld(b,c,f,d);return}}y.flags|=a;e.memoizedState=ld(1| b,c,f,d)}function rh(a,b){return Ne(516,4,a,b)}function nd(a,b){return Oe(516,4,a,b)}function sh(a,b){return Oe(4,2,a,b)}function th(a,b){if("function"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}function uh(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Oe(4,2,th.bind(null,b,a),c)}function Pe(a,b){}function vh(a,b){var c=bb();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Ke(b,d[1]))return d[0]; c.memoizedState=[a,b];return a}function wh(a,b){var c=bb();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Ke(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a}function tj(a,b){var c=wb();Za(98>c?98:c,function(){a(!0)});Za(97<c?97:c,function(){var c=aa.transition;aa.transition=1;try{a(!1),b()}finally{aa.transition=c}})}function Me(a,b,c){var d=W(),e=Oa(a),f={lane:e,action:c,eagerReducer:null,eagerState:null,next:null},g=b.pending;null===g?f.next=f:(f.next=g.next,g.next=f); b.pending=f;g=a.alternate;if(a===y||null!==g&&g===y)kc=kd=!0;else{if(0===a.lanes&&(null===g||0===g.lanes)&&(g=b.lastRenderedReducer,null!==g))try{var h=b.lastRenderedState,k=g(h,c);f.eagerReducer=g;f.eagerState=k;if(X(k,h))return}catch(v){}finally{}Pa(a,e,d)}}function U(a,b,c,d){b.child=null===a?xh(b,null,c,d):od(b,a.child,c,d)}function yh(a,b,c,d,e){c=c.render;var f=b.ref;yb(b,e);d=Le(a,b,c,d,f,e);if(null!==a&&!fa)return b.updateQueue=a.updateQueue,b.flags&=-517,a.lanes&=~e,sa(a,b,e);b.flags|=1; U(a,b,d,e);return b.child}function zh(a,b,c,d,e,f){if(null===a){var g=c.type;if("function"===typeof g&&!Qe(g)&&void 0===g.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=g,Ah(a,b,g,d,e,f);a=fd(c.type,null,d,b,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(0===(e&f)&&(e=g.memoizedProps,c=c.compare,c=null!==c?c:Zb,c(e,d)&&a.ref===b.ref))return sa(a,b,f);b.flags|=1;a=Ma(g,d);a.ref=b.ref;a.return=b;return b.child=a}function Ah(a,b,c,d,e,f){if(null!==a&&Zb(a.memoizedProps, d)&&a.ref===b.ref)if(fa=!1,0!==(f&e))0!==(a.flags&16384)&&(fa=!0);else return b.lanes=a.lanes,sa(a,b,f);return Re(a,b,c,d,f)}function Se(a,b,c){var d=b.pendingProps,e=d.children,f=null!==a?a.memoizedState:null;if("hidden"===d.mode||"unstable-defer-without-hiding"===d.mode)if(0===(b.mode&4))b.memoizedState={baseLanes:0},pd(b,c);else if(0!==(c&1073741824))b.memoizedState={baseLanes:0},pd(b,null!==f?f.baseLanes:c);else return a=null!==f?f.baseLanes|c:c,b.lanes=b.childLanes=1073741824,b.memoizedState= {baseLanes:a},pd(b,a),null;else null!==f?(d=f.baseLanes|c,b.memoizedState=null):d=c,pd(b,d);U(a,b,e,c);return b.child}function Bh(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.flags|=128}function Re(a,b,c,d,e){var f=S(c)?Ya:D.current;f=vb(b,f);yb(b,e);c=Le(a,b,c,d,f,e);if(null!==a&&!fa)return b.updateQueue=a.updateQueue,b.flags&=-517,a.lanes&=~e,sa(a,b,e);b.flags|=1;U(a,b,c,e);return b.child}function Ch(a,b,c,d,e){if(S(c)){var f=!0;Xc(b)}else f=!1;yb(b,e);if(null===b.stateNode)null!== a&&(a.alternate=null,b.alternate=null,b.flags|=2),fh(b,c,d),Ce(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,l=c.contextType;"object"===typeof l&&null!==l?l=Y(l):(l=S(c)?Ya:D.current,l=vb(b,l));var m=c.getDerivedStateFromProps,n="function"===typeof m||"function"===typeof g.getSnapshotBeforeUpdate;n||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==d||k!==l)&&gh(b,g,d,l);Ka=!1;var r=b.memoizedState; g.state=r;cc(b,d,g,e);k=b.memoizedState;h!==d||r!==k||J.current||Ka?("function"===typeof m&&(cd(b,c,m,d),k=b.memoizedState),(h=Ka||eh(b,c,h,d,r,k,l))?(n||"function"!==typeof g.UNSAFE_componentWillMount&&"function"!==typeof g.componentWillMount||("function"===typeof g.componentWillMount&&g.componentWillMount(),"function"===typeof g.UNSAFE_componentWillMount&&g.UNSAFE_componentWillMount()),"function"===typeof g.componentDidMount&&(b.flags|=4)):("function"===typeof g.componentDidMount&&(b.flags|=4), b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=l,d=h):("function"===typeof g.componentDidMount&&(b.flags|=4),d=!1)}else{g=b.stateNode;bh(a,b);h=b.memoizedProps;l=b.type===b.elementType?h:ea(b.type,h);g.props=l;n=b.pendingProps;r=g.context;k=c.contextType;"object"===typeof k&&null!==k?k=Y(k):(k=S(c)?Ya:D.current,k=vb(b,k));var t=c.getDerivedStateFromProps;(m="function"===typeof t||"function"===typeof g.getSnapshotBeforeUpdate)||"function"!==typeof g.UNSAFE_componentWillReceiveProps&& "function"!==typeof g.componentWillReceiveProps||(h!==n||r!==k)&&gh(b,g,d,k);Ka=!1;r=b.memoizedState;g.state=r;cc(b,d,g,e);var w=b.memoizedState;h!==n||r!==w||J.current||Ka?("function"===typeof t&&(cd(b,c,t,d),w=b.memoizedState),(l=Ka||eh(b,c,l,d,r,w,k))?(m||"function"!==typeof g.UNSAFE_componentWillUpdate&&"function"!==typeof g.componentWillUpdate||("function"===typeof g.componentWillUpdate&&g.componentWillUpdate(d,w,k),"function"===typeof g.UNSAFE_componentWillUpdate&&g.UNSAFE_componentWillUpdate(d, w,k)),"function"===typeof g.componentDidUpdate&&(b.flags|=4),"function"===typeof g.getSnapshotBeforeUpdate&&(b.flags|=256)):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=256),b.memoizedProps=d,b.memoizedState=w),g.props=d,g.state=w,g.context=k,d=l):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=4),"function"!== typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=256),d=!1)}return Te(a,b,c,d,f,e)}function Te(a,b,c,d,e,f){Bh(a,b);var g=0!==(b.flags&64);if(!d&&!g)return e&&Ug(b,c,!1),sa(a,b,f);d=b.stateNode;uj.current=b;var h=g&&"function"!==typeof c.getDerivedStateFromError?null:d.render();b.flags|=1;null!==a&&g?(b.child=od(b,a.child,null,f),b.child=od(b,null,h,f)):U(a,b,h,f);b.memoizedState=d.state;e&&Ug(b,c,!0);return b.child}function Dh(a){var b=a.stateNode;b.pendingContext? Sg(a,b.pendingContext,b.pendingContext!==b.context):b.context&&Sg(a,b.context,!1);Fe(a,b.containerInfo)}function Eh(a,b,c){var d=b.pendingProps,e=E.current,f=!1,g;(g=0!==(b.flags&64))||(g=null!==a&&null===a.memoizedState?!1:0!==(e&2));g?(f=!0,b.flags&=-65):null!==a&&null===a.memoizedState||void 0===d.fallback||!0===d.unstable_avoidThisFallback||(e|=1);A(E,e&1);if(null===a){void 0!==d.fallback&&He(b);a=d.children;e=d.fallback;if(f)return a=Fh(b,a,e,c),b.child.memoizedState={baseLanes:c},b.memoizedState= qd,a;if("number"===typeof d.unstable_expectedLoadTime)return a=Fh(b,a,e,c),b.child.memoizedState={baseLanes:c},b.memoizedState=qd,b.lanes=33554432,a;c=Ue({mode:"visible",children:a},b.mode,c,null);c.return=b;return b.child=c}if(null!==a.memoizedState){if(f)return d=Gh(a,b,d.children,d.fallback,c),f=b.child,e=a.child.memoizedState,f.memoizedState=null===e?{baseLanes:c}:{baseLanes:e.baseLanes|c},f.childLanes=a.childLanes&~c,b.memoizedState=qd,d;c=Hh(a,b,d.children,c);b.memoizedState=null;return c}if(f)return d= Gh(a,b,d.children,d.fallback,c),f=b.child,e=a.child.memoizedState,f.memoizedState=null===e?{baseLanes:c}:{baseLanes:e.baseLanes|c},f.childLanes=a.childLanes&~c,b.memoizedState=qd,d;c=Hh(a,b,d.children,c);b.memoizedState=null;return c}function Fh(a,b,c,d){var e=a.mode,f=a.child;b={mode:"hidden",children:b};0===(e&2)&&null!==f?(f.childLanes=0,f.pendingProps=b):f=Ue(b,e,0,null);c=zb(c,e,d,null);f.return=a;c.return=a;f.sibling=c;a.child=f;return c}function Hh(a,b,c,d){var e=a.child;a=e.sibling;c=Ma(e, {mode:"visible",children:c});0===(b.mode&2)&&(c.lanes=d);c.return=b;c.sibling=null;null!==a&&(a.nextEffect=null,a.flags=8,b.firstEffect=b.lastEffect=a);return b.child=c}function Gh(a,b,c,d,e){var f=b.mode,g=a.child;a=g.sibling;var h={mode:"hidden",children:c};0===(f&2)&&b.child!==g?(c=b.child,c.childLanes=0,c.pendingProps=h,g=c.lastEffect,null!==g?(b.firstEffect=c.firstEffect,b.lastEffect=g,g.nextEffect=null):b.firstEffect=b.lastEffect=null):c=Ma(g,h);null!==a?d=Ma(a,d):(d=zb(d,f,e,null),d.flags|= 2);d.return=b;c.return=b;c.sibling=d;b.child=c;return d}function Ih(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);ah(a.return,b)}function Ve(a,b,c,d,e,f){var g=a.memoizedState;null===g?a.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:e,lastEffect:f}:(g.isBackwards=b,g.rendering=null,g.renderingStartTime=0,g.last=d,g.tail=c,g.tailMode=e,g.lastEffect=f)}function Jh(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;U(a,b,d.children,c);d=E.current; if(0!==(d&2))d=d&1|2,b.flags|=64;else{if(null!==a&&0!==(a.flags&64))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&&Ih(a,c);else if(19===a.tag)Ih(a,c);else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return}a.sibling.return=a.return;a=a.sibling}d&=1}A(E,d);if(0===(b.mode&2))b.memoizedState=null;else switch(e){case "forwards":c=b.child;for(e=null;null!==c;)a=c.alternate,null!==a&&null=== hd(a)&&(e=c),c=c.sibling;c=e;null===c?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null);Ve(b,!1,e,c,f,b.lastEffect);break;case "backwards":c=null;e=b.child;for(b.child=null;null!==e;){a=e.alternate;if(null!==a&&null===hd(a)){b.child=e;break}a=e.sibling;e.sibling=c;c=e;e=a}Ve(b,!0,c,null,f,b.lastEffect);break;case "together":Ve(b,!1,null,null,void 0,b.lastEffect);break;default:b.memoizedState=null}return b.child}function sa(a,b,c){null!==a&&(b.dependencies=a.dependencies);La|=b.lanes;if(0!==(c& b.childLanes)){if(null!==a&&b.child!==a.child)throw Error(m(153));if(null!==b.child){a=b.child;c=Ma(a,a.pendingProps);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=Ma(a,a.pendingProps),c.return=b;c.sibling=null}return b.child}return null}function oc(a,b){if(!la)switch(a.tailMode){case "hidden":b=a.tail;for(var c=null;null!==b;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case "collapsed":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&& (d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null}}function vj(a,b,c){var d=b.pendingProps;switch(b.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return S(b.type)&&(t(J),t(D)),null;case 3:Ab();t(J);t(D);Je();d=b.stateNode;d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null);if(null===a||null===a.child)id(b)?b.flags|=4:d.hydrate||(b.flags|=256);Kh(b);return null;case 5:Ge(b);var e=$a(gc.current); c=b.type;if(null!==a&&null!=b.stateNode)wj(a,b,c,d,e),a.ref!==b.ref&&(b.flags|=128);else{if(!d){if(null===b.stateNode)throw Error(m(166));return null}a=$a(ka.current);if(id(b)){d=b.stateNode;c=b.type;var f=b.memoizedProps;d[Fa]=b;d[Wc]=f;switch(c){case "dialog":z("cancel",d);z("close",d);break;case "iframe":case "object":case "embed":z("load",d);break;case "video":case "audio":for(a=0;a<pc.length;a++)z(pc[a],d);break;case "source":z("error",d);break;case "img":case "image":case "link":z("error",d); z("load",d);break;case "details":z("toggle",d);break;case "input":Gf(d,f);z("invalid",d);break;case "select":d._wrapperState={wasMultiple:!!f.multiple};z("invalid",d);break;case "textarea":Jf(d,f),z("invalid",d)}Sd(c,f);a=null;for(var g in f)f.hasOwnProperty(g)&&(e=f[g],"children"===g?"string"===typeof e?d.textContent!==e&&(a=["children",e]):"number"===typeof e&&d.textContent!==""+e&&(a=["children",""+e]):Ib.hasOwnProperty(g)&&null!=e&&"onScroll"===g&&z("scroll",d));switch(c){case "input":Fc(d);If(d, f,!0);break;case "textarea":Fc(d);Lf(d);break;case "select":case "option":break;default:"function"===typeof f.onClick&&(d.onclick=Vc)}d=a;b.updateQueue=d;null!==d&&(b.flags|=4)}else{g=9===e.nodeType?e:e.ownerDocument;"http://www.w3.org/1999/xhtml"===a&&(a=Mf(c));"http://www.w3.org/1999/xhtml"===a?"script"===c?(a=g.createElement("div"),a.innerHTML="<script>\x3c/script>",a=a.removeChild(a.firstChild)):"string"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),"select"===c&&(g=a,d.multiple? g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Fa]=b;a[Wc]=d;xj(a,b,!1,!1);b.stateNode=a;g=Td(c,d);switch(c){case "dialog":z("cancel",a);z("close",a);e=d;break;case "iframe":case "object":case "embed":z("load",a);e=d;break;case "video":case "audio":for(e=0;e<pc.length;e++)z(pc[e],a);e=d;break;case "source":z("error",a);e=d;break;case "img":case "image":case "link":z("error",a);z("load",a);e=d;break;case "details":z("toggle",a);e=d;break;case "input":Gf(a,d);e=Md(a,d);z("invalid", a);break;case "option":e=Pd(a,d);break;case "select":a._wrapperState={wasMultiple:!!d.multiple};e=B({},d,{value:void 0});z("invalid",a);break;case "textarea":Jf(a,d);e=Qd(a,d);z("invalid",a);break;default:e=d}Sd(c,e);var h=e;for(f in h)if(h.hasOwnProperty(f)){var k=h[f];"style"===f?Of(a,k):"dangerouslySetInnerHTML"===f?(k=k?k.__html:void 0,null!=k&&Lh(a,k)):"children"===f?"string"===typeof k?("textarea"!==c||""!==k)&&qc(a,k):"number"===typeof k&&qc(a,""+k):"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!== f&&"autoFocus"!==f&&(Ib.hasOwnProperty(f)?null!=k&&"onScroll"===f&&z("scroll",a):null!=k&&Ed(a,f,k,g))}switch(c){case "input":Fc(a);If(a,d,!1);break;case "textarea":Fc(a);Lf(a);break;case "option":null!=d.value&&a.setAttribute("value",""+xa(d.value));break;case "select":a.multiple=!!d.multiple;f=d.value;null!=f?ib(a,!!d.multiple,f,!1):null!=d.defaultValue&&ib(a,!!d.multiple,d.defaultValue,!0);break;default:"function"===typeof e.onClick&&(a.onclick=Vc)}Pg(c,d)&&(b.flags|=4)}null!==b.ref&&(b.flags|= 128)}return null;case 6:if(a&&null!=b.stateNode)yj(a,b,a.memoizedProps,d);else{if("string"!==typeof d&&null===b.stateNode)throw Error(m(166));c=$a(gc.current);$a(ka.current);id(b)?(d=b.stateNode,c=b.memoizedProps,d[Fa]=b,d.nodeValue!==c&&(b.flags|=4)):(d=(9===c.nodeType?c:c.ownerDocument).createTextNode(d),d[Fa]=b,b.stateNode=d)}return null;case 13:t(E);d=b.memoizedState;if(0!==(b.flags&64))return b.lanes=c,b;d=null!==d;c=!1;null===a?void 0!==b.memoizedProps.fallback&&id(b):c=null!==a.memoizedState; if(d&&!c&&0!==(b.mode&2))if(null===a&&!0!==b.memoizedProps.unstable_avoidThisFallback||0!==(E.current&1))0===L&&(L=3);else{if(0===L||3===L)L=4;null===R||0===(La&134217727)&&0===(Cb&134217727)||Db(R,O)}if(d||c)b.flags|=4;return null;case 4:return Ab(),Kh(b),null===a&&Cg(b.stateNode.containerInfo),null;case 10:return Ae(b),null;case 17:return S(b.type)&&(t(J),t(D)),null;case 19:t(E);d=b.memoizedState;if(null===d)return null;f=0!==(b.flags&64);g=d.rendering;if(null===g)if(f)oc(d,!1);else{if(0!==L||null!== a&&0!==(a.flags&64))for(a=b.child;null!==a;){g=hd(a);if(null!==g){b.flags|=64;oc(d,!1);f=g.updateQueue;null!==f&&(b.updateQueue=f,b.flags|=4);null===d.lastEffect&&(b.firstEffect=null);b.lastEffect=d.lastEffect;d=c;for(c=b.child;null!==c;)f=c,a=d,f.flags&=2,f.nextEffect=null,f.firstEffect=null,f.lastEffect=null,g=f.alternate,null===g?(f.childLanes=0,f.lanes=a,f.child=null,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=g.childLanes,f.lanes= g.lanes,f.child=g.child,f.memoizedProps=g.memoizedProps,f.memoizedState=g.memoizedState,f.updateQueue=g.updateQueue,f.type=g.type,a=g.dependencies,f.dependencies=null===a?null:{lanes:a.lanes,firstContext:a.firstContext}),c=c.sibling;A(E,E.current&1|2);return b.child}a=a.sibling}null!==d.tail&&P()>We&&(b.flags|=64,f=!0,oc(d,!1),b.lanes=33554432)}else{if(!f)if(a=hd(g),null!==a){if(b.flags|=64,f=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),oc(d,!0),null===d.tail&&"hidden"===d.tailMode&& !g.alternate&&!la)return b=b.lastEffect=d.lastEffect,null!==b&&(b.nextEffect=null),null}else 2*P()-d.renderingStartTime>We&&1073741824!==c&&(b.flags|=64,f=!0,oc(d,!1),b.lanes=33554432);d.isBackwards?(g.sibling=b.child,b.child=g):(c=d.last,null!==c?c.sibling=g:b.child=g,d.last=g)}return null!==d.tail?(c=d.tail,d.rendering=c,d.tail=c.sibling,d.lastEffect=b.lastEffect,d.renderingStartTime=P(),c.sibling=null,b=E.current,A(E,f?b&1|2:b&1),c):null;case 23:case 24:return ta=cb.current,t(cb),null!==a&&null!== a.memoizedState!==(null!==b.memoizedState)&&"unstable-defer-without-hiding"!==d.mode&&(b.flags|=4),null}throw Error(m(156,b.tag));}function zj(a,b){switch(a.tag){case 1:return S(a.type)&&(t(J),t(D)),b=a.flags,b&4096?(a.flags=b&-4097|64,a):null;case 3:Ab();t(J);t(D);Je();b=a.flags;if(0!==(b&64))throw Error(m(285));a.flags=b&-4097|64;return a;case 5:return Ge(a),null;case 13:return t(E),b=a.flags,b&4096?(a.flags=b&-4097|64,a):null;case 19:return t(E),null;case 4:return Ab(),null;case 10:return Ae(a), null;case 23:case 24:return ta=cb.current,t(cb),null;default:return null}}function Xe(a,b){try{var c="",d=b;do c+=pi(d),d=d.return;while(d);var e=c}catch(f){e="\nError generating stack: "+f.message+"\n"+f.stack}return{value:a,source:b,stack:e}}function Ye(a,b){try{console.error(b.value)}catch(c){setTimeout(function(){throw c;})}}function Mh(a,b,c){c=Ia(-1,c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){rd||(rd=!0,Ze=d);Ye(a,b)};return c}function Nh(a,b,c){c=Ia(-1,c);c.tag= 3;var d=a.type.getDerivedStateFromError;if("function"===typeof d){var e=b.value;c.payload=function(){Ye(a,b);return d(e)}}var f=a.stateNode;null!==f&&"function"===typeof f.componentDidCatch&&(c.callback=function(){"function"!==typeof d&&(null===na?na=new Set([this]):na.add(this),Ye(a,b));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:""})});return c}function Oh(a){var b=a.ref;if(null!==b)if("function"===typeof b)try{b(null)}catch(c){Qa(a,c)}else b.current=null}function Aj(a, b){switch(b.tag){case 0:case 11:case 15:case 22:return;case 1:if(b.flags&256&&null!==a){var c=a.memoizedProps,d=a.memoizedState;a=b.stateNode;b=a.getSnapshotBeforeUpdate(b.elementType===b.type?c:ea(b.type,c),d);a.__reactInternalSnapshotBeforeUpdate=b}return;case 3:b.flags&256&&te(b.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(m(163));}function Bj(a,b,c,d){switch(c.tag){case 0:case 11:case 15:case 22:b=c.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){a=b=b.next; do 3===(a.tag&3)&&(d=a.create,a.destroy=d()),a=a.next;while(a!==b)}b=c.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){a=b=b.next;do{var e=a;d=e.next;e=e.tag;0!==(e&4)&&0!==(e&1)&&(Ph(c,a),Cj(c,a));a=d}while(a!==b)}return;case 1:a=c.stateNode;c.flags&4&&(null===b?a.componentDidMount():(d=c.elementType===c.type?b.memoizedProps:ea(c.type,b.memoizedProps),a.componentDidUpdate(d,b.memoizedState,a.__reactInternalSnapshotBeforeUpdate)));b=c.updateQueue;null!==b&&dh(c,b,a);return;case 3:b=c.updateQueue; if(null!==b){a=null;if(null!==c.child)switch(c.child.tag){case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode}dh(c,b,a)}return;case 5:a=c.stateNode;null===b&&c.flags&4&&Pg(c.type,c.memoizedProps)&&a.focus();return;case 6:return;case 4:return;case 12:return;case 13:null===c.memoizedState&&(c=c.alternate,null!==c&&(c=c.memoizedState,null!==c&&(c=c.dehydrated,null!==c&&bg(c))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(m(163));}function Qh(a,b){for(var c=a;;){if(5=== c.tag){var d=c.stateNode;if(b)d=d.style,"function"===typeof d.setProperty?d.setProperty("display","none","important"):d.display="none";else{d=c.stateNode;var e=c.memoizedProps.style;e=void 0!==e&&null!==e&&e.hasOwnProperty("display")?e.display:null;d.style.display=Nf("display",e)}}else if(6===c.tag)c.stateNode.nodeValue=b?"":c.memoizedProps;else if((23!==c.tag&&24!==c.tag||null===c.memoizedState||c===a)&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===a)break;for(;null===c.sibling;){if(null=== c.return||c.return===a)return;c=c.return}c.sibling.return=c.return;c=c.sibling}}function Rh(a,b,c){if(db&&"function"===typeof db.onCommitFiberUnmount)try{db.onCommitFiberUnmount($e,b)}catch(f){}switch(b.tag){case 0:case 11:case 14:case 15:case 22:a=b.updateQueue;if(null!==a&&(a=a.lastEffect,null!==a)){c=a=a.next;do{var d=c,e=d.destroy;d=d.tag;if(void 0!==e)if(0!==(d&4))Ph(b,c);else{d=b;try{e()}catch(f){Qa(d,f)}}c=c.next}while(c!==a)}break;case 1:Oh(b);a=b.stateNode;if("function"===typeof a.componentWillUnmount)try{a.props= b.memoizedProps,a.state=b.memoizedState,a.componentWillUnmount()}catch(f){Qa(b,f)}break;case 5:Oh(b);break;case 4:Sh(a,b)}}function Th(a){a.alternate=null;a.child=null;a.dependencies=null;a.firstEffect=null;a.lastEffect=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.return=null;a.updateQueue=null}function Uh(a){return 5===a.tag||3===a.tag||4===a.tag}function Vh(a){a:{for(var b=a.return;null!==b;){if(Uh(b))break a;b=b.return}throw Error(m(160));}var c=b;b=c.stateNode;switch(c.tag){case 5:var d= !1;break;case 3:b=b.containerInfo;d=!0;break;case 4:b=b.containerInfo;d=!0;break;default:throw Error(m(161));}c.flags&16&&(qc(b,""),c.flags&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c.return||Uh(c.return)){c=null;break a}c=c.return}c.sibling.return=c.return;for(c=c.sibling;5!==c.tag&&6!==c.tag&&18!==c.tag;){if(c.flags&2)continue b;if(null===c.child||4===c.tag)continue b;else c.child.return=c,c=c.child}if(!(c.flags&2)){c=c.stateNode;break a}}d?af(a,c,b):bf(a,c,b)}function af(a,b,c){var d= a.tag,e=5===d||6===d;if(e)a=e?a.stateNode:a.stateNode.instance,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Vc));else if(4!==d&&(a=a.child,null!==a))for(af(a,b,c),a=a.sibling;null!==a;)af(a,b,c),a=a.sibling}function bf(a,b,c){var d=a.tag,e=5===d||6===d;if(e)a=e?a.stateNode:a.stateNode.instance,b?c.insertBefore(a,b):c.appendChild(a); else if(4!==d&&(a=a.child,null!==a))for(bf(a,b,c),a=a.sibling;null!==a;)bf(a,b,c),a=a.sibling}function Sh(a,b,c){c=b;for(var d=!1,e,f;;){if(!d){e=c.return;a:for(;;){if(null===e)throw Error(m(160));f=e.stateNode;switch(e.tag){case 5:e=f;f=!1;break a;case 3:e=f.containerInfo;f=!0;break a;case 4:e=f.containerInfo;f=!0;break a}e=e.return}d=!0}if(5===c.tag||6===c.tag){a:for(var g=a,h=c,k=h;;)if(Rh(g,k),null!==k.child&&4!==k.tag)k.child.return=k,k=k.child;else{if(k===h)break a;for(;null===k.sibling;){if(null=== k.return||k.return===h)break a;k=k.return}k.sibling.return=k.return;k=k.sibling}f?(g=e,h=c.stateNode,8===g.nodeType?g.parentNode.removeChild(h):g.removeChild(h)):e.removeChild(c.stateNode)}else if(4===c.tag){if(null!==c.child){e=c.stateNode.containerInfo;f=!0;c.child.return=c;c=c.child;continue}}else if(Rh(a,c),null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return;4===c.tag&&(d=!1)}c.sibling.return=c.return;c= c.sibling}}function cf(a,b){switch(b.tag){case 0:case 11:case 14:case 15:case 22:var c=b.updateQueue;c=null!==c?c.lastEffect:null;if(null!==c){var d=c=c.next;do 3===(d.tag&3)&&(a=d.destroy,d.destroy=void 0,void 0!==a&&a()),d=d.next;while(d!==c)}return;case 1:return;case 5:c=b.stateNode;if(null!=c){d=b.memoizedProps;var e=null!==a?a.memoizedProps:d;a=b.type;var f=b.updateQueue;b.updateQueue=null;if(null!==f){c[Wc]=d;"input"===a&&"radio"===d.type&&null!=d.name&&Hf(c,d);Td(a,e);b=Td(a,d);for(e=0;e<f.length;e+= 2){var g=f[e],h=f[e+1];"style"===g?Of(c,h):"dangerouslySetInnerHTML"===g?Lh(c,h):"children"===g?qc(c,h):Ed(c,g,h,b)}switch(a){case "input":Nd(c,d);break;case "textarea":Kf(c,d);break;case "select":a=c._wrapperState.wasMultiple,c._wrapperState.wasMultiple=!!d.multiple,f=d.value,null!=f?ib(c,!!d.multiple,f,!1):a!==!!d.multiple&&(null!=d.defaultValue?ib(c,!!d.multiple,d.defaultValue,!0):ib(c,!!d.multiple,d.multiple?[]:"",!1))}}}return;case 6:if(null===b.stateNode)throw Error(m(162));b.stateNode.nodeValue= b.memoizedProps;return;case 3:c=b.stateNode;c.hydrate&&(c.hydrate=!1,bg(c.containerInfo));return;case 12:return;case 13:null!==b.memoizedState&&(df=P(),Qh(b.child,!0));Wh(b);return;case 19:Wh(b);return;case 17:return;case 23:case 24:Qh(b,null!==b.memoizedState);return}throw Error(m(163));}function Wh(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Dj);b.forEach(function(b){var d=Ej.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}function Fj(a, b){return null!==a&&(a=a.memoizedState,null===a||null!==a.dehydrated)?(b=b.memoizedState,null!==b&&null===b.dehydrated):!1}function Eb(){We=P()+500}function W(){return 0!==(n&48)?P():-1!==sd?sd:sd=P()}function Oa(a){a=a.mode;if(0===(a&2))return 1;if(0===(a&4))return 99===wb()?1:2;0===ua&&(ua=Fb);if(0!==Gj.transition){0!==td&&(td=null!==ef?ef.pendingLanes:0);a=ua;var b=4186112&~td;b&=-b;0===b&&(a=4186112&~a,b=a&-a,0===b&&(b=8192));return b}a=wb();0!==(n&4)&&98===a?a=Nc(12,ua):(a=Fi(a),a=Nc(a,ua)); return a}function Pa(a,b,c){if(50<rc)throw rc=0,ff=null,Error(m(185));a=ud(a,b);if(null===a)return null;Oc(a,b,c);a===R&&(Cb|=b,4===L&&Db(a,O));var d=wb();1===b?0!==(n&8)&&0===(n&48)?gf(a):(ba(a,c),0===n&&(Eb(),ja())):(0===(n&4)||98!==d&&99!==d||(null===va?va=new Set([a]):va.add(a)),ba(a,c));ef=a}function ud(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);c=a;for(a=a.return;null!==a;)a.childLanes|=b,c=a.alternate,null!==c&&(c.childLanes|=b),c=a,a=a.return;return 3===c.tag?c.stateNode:null} function ba(a,b){for(var c=a.callbackNode,d=a.suspendedLanes,e=a.pingedLanes,f=a.expirationTimes,g=a.pendingLanes;0<g;){var h=31-Ba(g),k=1<<h,l=f[h];if(-1===l){if(0===(k&d)||0!==(k&e)){l=b;mb(k);var m=w;f[h]=10<=m?l+250:6<=m?l+5E3:-1}}else l<=b&&(a.expiredLanes|=k);g&=~k}d=Wb(a,a===R?O:0);b=w;if(0===d)null!==c&&(c!==hf&&xe(c),a.callbackNode=null,a.callbackPriority=0);else{if(null!==c){if(a.callbackPriority===b)return;c!==hf&&xe(c)}15===b?(c=gf.bind(null,a),null===pa?(pa=[c],Zc=we(Yc,$g)):pa.push(c), c=hf):14===b?c=bc(99,gf.bind(null,a)):(c=Gi(b),c=bc(c,Xh.bind(null,a)));a.callbackPriority=b;a.callbackNode=c}}function Xh(a){sd=-1;td=ua=0;if(0!==(n&48))throw Error(m(327));var b=a.callbackNode;if(Ra()&&a.callbackNode!==b)return null;var c=Wb(a,a===R?O:0);if(0===c)return null;var d=c;var e=n;n|=16;var f=Yh();if(R!==a||O!==d)Eb(),Gb(a,d);do try{Hj();break}catch(h){Zh(a,h)}while(1);ze();vd.current=f;n=e;null!==G?d=0:(R=null,O=0,d=L);if(0!==(Fb&Cb))Gb(a,0);else if(0!==d){2===d&&(n|=64,a.hydrate&&(a.hydrate= !1,te(a.containerInfo)),c=eg(a),0!==c&&(d=sc(a,c)));if(1===d)throw b=wd,Gb(a,0),Db(a,c),ba(a,P()),b;a.finishedWork=a.current.alternate;a.finishedLanes=c;switch(d){case 0:case 1:throw Error(m(345));case 2:eb(a);break;case 3:Db(a,c);if((c&62914560)===c&&(d=df+500-P(),10<d)){if(0!==Wb(a,0))break;e=a.suspendedLanes;if((e&c)!==c){W();a.pingedLanes|=a.suspendedLanes&e;break}a.timeoutHandle=$h(eb.bind(null,a),d);break}eb(a);break;case 4:Db(a,c);if((c&4186112)===c)break;d=a.eventTimes;for(e=-1;0<c;){var g= 31-Ba(c);f=1<<g;g=d[g];g>e&&(e=g);c&=~f}c=e;c=P()-c;c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3E3>c?3E3:4320>c?4320:1960*Ij(c/1960))-c;if(10<c){a.timeoutHandle=$h(eb.bind(null,a),c);break}eb(a);break;case 5:eb(a);break;default:throw Error(m(329));}}ba(a,P());return a.callbackNode===b?Xh.bind(null,a):null}function Db(a,b){b&=~jf;b&=~Cb;a.suspendedLanes|=b;a.pingedLanes&=~b;for(a=a.expirationTimes;0<b;){var c=31-Ba(b),d=1<<c;a[c]=-1;b&=~d}}function gf(a){if(0!==(n&48))throw Error(m(327));Ra(); if(a===R&&0!==(a.expiredLanes&O)){var b=O;var c=sc(a,b);0!==(Fb&Cb)&&(b=Wb(a,b),c=sc(a,b))}else b=Wb(a,0),c=sc(a,b);0!==a.tag&&2===c&&(n|=64,a.hydrate&&(a.hydrate=!1,te(a.containerInfo)),b=eg(a),0!==b&&(c=sc(a,b)));if(1===c)throw c=wd,Gb(a,0),Db(a,b),ba(a,P()),c;a.finishedWork=a.current.alternate;a.finishedLanes=b;eb(a);ba(a,P());return null}function Jj(){if(null!==va){var a=va;va=null;a.forEach(function(a){a.expiredLanes|=24&a.pendingLanes;ba(a,P())})}ja()}function ai(a,b){var c=n;n|=1;try{return a(b)}finally{n= c,0===n&&(Eb(),ja())}}function bi(a,b){var c=n;n&=-2;n|=8;try{return a(b)}finally{n=c,0===n&&(Eb(),ja())}}function pd(a,b){A(cb,ta);ta|=b;Fb|=b}function Gb(a,b){a.finishedWork=null;a.finishedLanes=0;var c=a.timeoutHandle;-1!==c&&(a.timeoutHandle=-1,Kj(c));if(null!==G)for(c=G.return;null!==c;){var d=c;switch(d.tag){case 1:d=d.type.childContextTypes;null!==d&&void 0!==d&&(t(J),t(D));break;case 3:Ab();t(J);t(D);Je();break;case 5:Ge(d);break;case 4:Ab();break;case 13:t(E);break;case 19:t(E);break;case 10:Ae(d); break;case 23:case 24:ta=cb.current,t(cb)}c=c.return}R=a;G=Ma(a.current,null);O=ta=Fb=b;L=0;wd=null;jf=Cb=La=0}function Zh(a,b){do{var c=G;try{ze();jc.current=jd;if(kd){for(var d=y.memoizedState;null!==d;){var e=d.queue;null!==e&&(e.pending=null);d=d.next}kd=!1}ic=0;K=N=y=null;kc=!1;kf.current=null;if(null===c||null===c.return){L=1;wd=b;G=null;break}a:{var f=a,g=c.return,h=c,k=b;b=O;h.flags|=2048;h.firstEffect=h.lastEffect=null;if(null!==k&&"object"===typeof k&&"function"===typeof k.then){var l=k; if(0===(h.mode&2)){var m=h.alternate;m?(h.updateQueue=m.updateQueue,h.memoizedState=m.memoizedState,h.lanes=m.lanes):(h.updateQueue=null,h.memoizedState=null)}var n=0!==(E.current&1),r=g;do{var t;if(t=13===r.tag){var w=r.memoizedState;if(null!==w)t=null!==w.dehydrated?!0:!1;else{var z=r.memoizedProps;t=void 0===z.fallback?!1:!0!==z.unstable_avoidThisFallback?!0:n?!1:!0}}if(t){var C=r.updateQueue;if(null===C){var x=new Set;x.add(l);r.updateQueue=x}else C.add(l);if(0===(r.mode&2)){r.flags|=64;h.flags|= 16384;h.flags&=-2981;if(1===h.tag)if(null===h.alternate)h.tag=17;else{var p=Ia(-1,1);p.tag=2;Ja(h,p)}h.lanes|=1;break a}k=void 0;h=b;var q=f.pingCache;null===q?(q=f.pingCache=new Lj,k=new Set,q.set(l,k)):(k=q.get(l),void 0===k&&(k=new Set,q.set(l,k)));if(!k.has(h)){k.add(h);var u=Mj.bind(null,f,l,h);l.then(u,u)}r.flags|=4096;r.lanes=b;break a}r=r.return}while(null!==r);k=Error((hb(h.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!== L&&(L=2);k=Xe(k,h);r=g;do{switch(r.tag){case 3:f=k;r.flags|=4096;b&=-b;r.lanes|=b;var B=Mh(r,f,b);ch(r,B);break a;case 1:f=k;var A=r.type,D=r.stateNode;if(0===(r.flags&64)&&("function"===typeof A.getDerivedStateFromError||null!==D&&"function"===typeof D.componentDidCatch&&(null===na||!na.has(D)))){r.flags|=4096;b&=-b;r.lanes|=b;var F=Nh(r,f,b);ch(r,F);break a}}r=r.return}while(null!==r)}ci(c)}catch(qa){b=qa;G===c&&null!==c&&(G=c=c.return);continue}break}while(1)}function Yh(){var a=vd.current;vd.current= jd;return null===a?jd:a}function sc(a,b){var c=n;n|=16;var d=Yh();R===a&&O===b||Gb(a,b);do try{Nj();break}catch(e){Zh(a,e)}while(1);ze();n=c;vd.current=d;if(null!==G)throw Error(m(261));R=null;O=0;return L}function Nj(){for(;null!==G;)di(G)}function Hj(){for(;null!==G&&!Oj();)di(G)}function di(a){var b=Pj(a.alternate,a,ta);a.memoizedProps=a.pendingProps;null===b?ci(a):G=b;kf.current=null}function ci(a){var b=a;do{var c=b.alternate;a=b.return;if(0===(b.flags&2048)){c=vj(c,b,ta);if(null!==c){G=c;return}c= b;if(24!==c.tag&&23!==c.tag||null===c.memoizedState||0!==(ta&1073741824)||0===(c.mode&4)){for(var d=0,e=c.child;null!==e;)d|=e.lanes|e.childLanes,e=e.sibling;c.childLanes=d}null!==a&&0===(a.flags&2048)&&(null===a.firstEffect&&(a.firstEffect=b.firstEffect),null!==b.lastEffect&&(null!==a.lastEffect&&(a.lastEffect.nextEffect=b.firstEffect),a.lastEffect=b.lastEffect),1<b.flags&&(null!==a.lastEffect?a.lastEffect.nextEffect=b:a.firstEffect=b,a.lastEffect=b))}else{c=zj(b);if(null!==c){c.flags&=2047;G=c; return}null!==a&&(a.firstEffect=a.lastEffect=null,a.flags|=2048)}b=b.sibling;if(null!==b){G=b;return}G=b=a}while(null!==b);0===L&&(L=5)}function eb(a){var b=wb();Za(99,Qj.bind(null,a,b));return null}function Qj(a,b){do Ra();while(null!==tc);if(0!==(n&48))throw Error(m(327));var c=a.finishedWork;if(null===c)return null;a.finishedWork=null;a.finishedLanes=0;if(c===a.current)throw Error(m(177));a.callbackNode=null;var d=c.lanes|c.childLanes,e=d,f=a.pendingLanes&~e;a.pendingLanes=e;a.suspendedLanes=0; a.pingedLanes=0;a.expiredLanes&=e;a.mutableReadLanes&=e;a.entangledLanes&=e;e=a.entanglements;for(var g=a.eventTimes,h=a.expirationTimes;0<f;){var k=31-Ba(f),v=1<<k;e[k]=0;g[k]=-1;h[k]=-1;f&=~v}null!==va&&0===(d&24)&&va.has(a)&&va.delete(a);a===R&&(G=R=null,O=0);1<c.flags?null!==c.lastEffect?(c.lastEffect.nextEffect=c,d=c.firstEffect):d=c:d=c.firstEffect;if(null!==d){e=n;n|=32;kf.current=null;lf=Pc;g=xg();if(ne(g)){if("selectionStart"in g)h={start:g.selectionStart,end:g.selectionEnd};else a:if(h= (h=g.ownerDocument)&&h.defaultView||window,(v=h.getSelection&&h.getSelection())&&0!==v.rangeCount){h=v.anchorNode;f=v.anchorOffset;k=v.focusNode;v=v.focusOffset;try{h.nodeType,k.nodeType}catch(qa){h=null;break a}var t=0,w=-1,r=-1,z=0,B=0,y=g,C=null;b:for(;;){for(var x;;){y!==h||0!==f&&3!==y.nodeType||(w=t+f);y!==k||0!==v&&3!==y.nodeType||(r=t+v);3===y.nodeType&&(t+=y.nodeValue.length);if(null===(x=y.firstChild))break;C=y;y=x}for(;;){if(y===g)break b;C===h&&++z===f&&(w=t);C===k&&++B===v&&(r=t);if(null!== (x=y.nextSibling))break;y=C;C=y.parentNode}y=x}h=-1===w||-1===r?null:{start:w,end:r}}else h=null;h=h||{start:0,end:0}}else h=null;mf={focusedElem:g,selectionRange:h};Pc=!1;uc=null;xd=!1;l=d;do try{Rj()}catch(qa){if(null===l)throw Error(m(330));Qa(l,qa);l=l.nextEffect}while(null!==l);uc=null;l=d;do try{for(g=a;null!==l;){var p=l.flags;p&16&&qc(l.stateNode,"");if(p&128){var q=l.alternate;if(null!==q){var u=q.ref;null!==u&&("function"===typeof u?u(null):u.current=null)}}switch(p&1038){case 2:Vh(l);l.flags&= -3;break;case 6:Vh(l);l.flags&=-3;cf(l.alternate,l);break;case 1024:l.flags&=-1025;break;case 1028:l.flags&=-1025;cf(l.alternate,l);break;case 4:cf(l.alternate,l);break;case 8:h=l;Sh(g,h);var A=h.alternate;Th(h);null!==A&&Th(A)}l=l.nextEffect}}catch(qa){if(null===l)throw Error(m(330));Qa(l,qa);l=l.nextEffect}while(null!==l);u=mf;q=xg();p=u.focusedElem;g=u.selectionRange;if(q!==p&&p&&p.ownerDocument&&wg(p.ownerDocument.documentElement,p)){null!==g&&ne(p)&&(q=g.start,u=g.end,void 0===u&&(u=q),"selectionStart"in p?(p.selectionStart=q,p.selectionEnd=Math.min(u,p.value.length)):(u=(q=p.ownerDocument||document)&&q.defaultView||window,u.getSelection&&(u=u.getSelection(),h=p.textContent.length,A=Math.min(g.start,h),g=void 0===g.end?A:Math.min(g.end,h),!u.extend&&A>g&&(h=g,g=A,A=h),h=vg(p,A),f=vg(p,g),h&&f&&(1!==u.rangeCount||u.anchorNode!==h.node||u.anchorOffset!==h.offset||u.focusNode!==f.node||u.focusOffset!==f.offset)&&(q=q.createRange(),q.setStart(h.node,h.offset),u.removeAllRanges(),A>g?(u.addRange(q),u.extend(f.node, f.offset)):(q.setEnd(f.node,f.offset),u.addRange(q))))));q=[];for(u=p;u=u.parentNode;)1===u.nodeType&&q.push({element:u,left:u.scrollLeft,top:u.scrollTop});"function"===typeof p.focus&&p.focus();for(p=0;p<q.length;p++)u=q[p],u.element.scrollLeft=u.left,u.element.scrollTop=u.top}Pc=!!lf;mf=lf=null;a.current=c;l=d;do try{for(p=a;null!==l;){var D=l.flags;D&36&&Bj(p,l.alternate,l);if(D&128){q=void 0;var E=l.ref;if(null!==E){var F=l.stateNode;switch(l.tag){case 5:q=F;break;default:q=F}"function"===typeof E? E(q):E.current=q}}l=l.nextEffect}}catch(qa){if(null===l)throw Error(m(330));Qa(l,qa);l=l.nextEffect}while(null!==l);l=null;Sj();n=e}else a.current=c;if(Sa)Sa=!1,tc=a,vc=b;else for(l=d;null!==l;)b=l.nextEffect,l.nextEffect=null,l.flags&8&&(D=l,D.sibling=null,D.stateNode=null),l=b;d=a.pendingLanes;0===d&&(na=null);1===d?a===ff?rc++:(rc=0,ff=a):rc=0;c=c.stateNode;if(db&&"function"===typeof db.onCommitFiberRoot)try{db.onCommitFiberRoot($e,c,void 0,64===(c.current.flags&64))}catch(qa){}ba(a,P());if(rd)throw rd= !1,a=Ze,Ze=null,a;if(0!==(n&8))return null;ja();return null}function Rj(){for(;null!==l;){var a=l.alternate;xd||null===uc||(0!==(l.flags&8)?Wf(l,uc)&&(xd=!0):13===l.tag&&Fj(a,l)&&Wf(l,uc)&&(xd=!0));var b=l.flags;0!==(b&256)&&Aj(a,l);0===(b&512)||Sa||(Sa=!0,bc(97,function(){Ra();return null}));l=l.nextEffect}}function Ra(){if(90!==vc){var a=97<vc?97:vc;vc=90;return Za(a,Tj)}return!1}function Cj(a,b){nf.push(b,a);Sa||(Sa=!0,bc(97,function(){Ra();return null}))}function Ph(a,b){of.push(b,a);Sa||(Sa= !0,bc(97,function(){Ra();return null}))}function Tj(){if(null===tc)return!1;var a=tc;tc=null;if(0!==(n&48))throw Error(m(331));var b=n;n|=32;var c=of;of=[];for(var d=0;d<c.length;d+=2){var e=c[d],f=c[d+1],g=e.destroy;e.destroy=void 0;if("function"===typeof g)try{g()}catch(k){if(null===f)throw Error(m(330));Qa(f,k)}}c=nf;nf=[];for(d=0;d<c.length;d+=2){e=c[d];f=c[d+1];try{var h=e.create;e.destroy=h()}catch(k){if(null===f)throw Error(m(330));Qa(f,k)}}for(h=a.current.firstEffect;null!==h;)a=h.nextEffect, h.nextEffect=null,h.flags&8&&(h.sibling=null,h.stateNode=null),h=a;n=b;ja();return!0}function ei(a,b,c){b=Xe(c,b);b=Mh(a,b,1);Ja(a,b);b=W();a=ud(a,1);null!==a&&(Oc(a,1,b),ba(a,b))}function Qa(a,b){if(3===a.tag)ei(a,a,b);else for(var c=a.return;null!==c;){if(3===c.tag){ei(c,a,b);break}else if(1===c.tag){var d=c.stateNode;if("function"===typeof c.type.getDerivedStateFromError||"function"===typeof d.componentDidCatch&&(null===na||!na.has(d))){a=Xe(b,a);var e=Nh(c,a,1);Ja(c,e);e=W();c=ud(c,1);if(null!== c)Oc(c,1,e),ba(c,e);else if("function"===typeof d.componentDidCatch&&(null===na||!na.has(d)))try{d.componentDidCatch(b,a)}catch(f){}break}}c=c.return}}function Mj(a,b,c){var d=a.pingCache;null!==d&&d.delete(b);b=W();a.pingedLanes|=a.suspendedLanes&c;R===a&&(O&c)===c&&(4===L||3===L&&(O&62914560)===O&&500>P()-df?Gb(a,0):jf|=c);ba(a,b)}function Ej(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=0;0===b&&(b=a.mode,0===(b&2)?b=1:0===(b&4)?b=99===wb()?1:2:(0===ua&&(ua=Fb),b=nb(62914560&~ua),0===b&&(b=4194304))); c=W();a=ud(a,b);null!==a&&(Oc(a,b,c),ba(a,c))}function Uj(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.flags=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.childLanes=this.lanes=0;this.alternate=null}function Qe(a){a=a.prototype;return!(!a||!a.isReactComponent)}function Vj(a){if("function"=== typeof a)return Qe(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Dc)return 11;if(a===Ec)return 14}return 2}function Ma(a,b){var c=a.alternate;null===c?(c=Z(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null);c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue= a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}function fd(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)Qe(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case wa:return zb(c.children,e,f,b);case fi:g=8;e|=16;break;case Hd:g=8;e|=1;break;case Lb:return a=Z(12,c,b,e|8),a.elementType=Lb,a.type=Lb,a.lanes=f,a;case Mb:return a=Z(13,c,b,e),a.type=Mb,a.elementType=Mb,a.lanes= f,a;case Cc:return a=Z(19,c,b,e),a.elementType=Cc,a.lanes=f,a;case pf:return Ue(c,e,f,b);case qf:return a=Z(24,c,b,e),a.elementType=qf,a.lanes=f,a;default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case Jd:g=10;break a;case Id:g=9;break a;case Dc:g=11;break a;case Ec:g=14;break a;case Ld:g=16;d=null;break a;case Kd:g=22;break a}throw Error(m(130,null==a?a:typeof a,""));}b=Z(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function zb(a,b,c,d){a=Z(7,a,d,b);a.lanes=c;return a}function Ue(a, b,c,d){a=Z(23,a,d,b);a.elementType=pf;a.lanes=c;return a}function De(a,b,c){a=Z(6,a,null,b);a.lanes=c;return a}function Ee(a,b,c){b=Z(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}function Wj(a,b,c){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.pendingContext=this.context=null;this.hydrate=c;this.callbackNode= null;this.callbackPriority=0;this.eventTimes=ge(0);this.expirationTimes=ge(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=ge(0);this.mutableSourceEagerHydrationData=null}function Xj(a,b,c){var d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Ua,key:null==d?null:""+d,children:a,containerInfo:b,implementation:c}}function yd(a,b,c,d){var e=b.current,f=W(),g=Oa(e); a:if(c){c=c._reactInternals;b:{if(Va(c)!==c||1!==c.tag)throw Error(m(170));var h=c;do{switch(h.tag){case 3:h=h.stateNode.context;break b;case 1:if(S(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break b}}h=h.return}while(null!==h);throw Error(m(171));}if(1===c.tag){var k=c.type;if(S(k)){c=Tg(c,k,h);break a}}c=h}else c=Ha;null===b.context?b.context=c:b.pendingContext=c;b=Ia(f,g);b.payload={element:a};d=void 0===d?null:d;null!==d&&(b.callback=d);Ja(e,b);Pa(e,g,f);return g}function rf(a){a= a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function gi(a,b){a=a.memoizedState;if(null!==a&&null!==a.dehydrated){var c=a.retryLane;a.retryLane=0!==c&&c<b?c:b}}function sf(a,b){gi(a,b);(a=a.alternate)&&gi(a,b)}function Yj(a){a=Vf(a);return null===a?null:a.stateNode}function Zj(a){return null}function tf(a,b,c){var d=null!=c&&null!=c.hydrationOptions&&c.hydrationOptions.mutableSources||null;c=new Wj(a,b,null!=c&&!0===c.hydrate); b=Z(3,null,null,2===b?7:1===b?3:0);c.current=b;b.stateNode=c;Be(b);a[rb]=c.current;Cg(8===a.nodeType?a.parentNode:a);if(d)for(a=0;a<d.length;a++){b=d[a];var e=b._getVersion;e=e(b._source);null==c.mutableSourceEagerHydrationData?c.mutableSourceEagerHydrationData=[b,e]:c.mutableSourceEagerHydrationData.push(b,e)}this._internalRoot=c}function wc(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}function ak(a,b){b||(b=a?9=== a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute("data-reactroot")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new tf(a,0,b?{hydrate:!0}:void 0)}function zd(a,b,c,d,e){var f=c._reactRootContainer;if(f){var g=f._internalRoot;if("function"===typeof e){var h=e;e=function(){var a=rf(g);h.call(a)}}yd(b,g,a,e)}else{f=c._reactRootContainer=ak(c,d);g=f._internalRoot;if("function"===typeof e){var k=e;e=function(){var a=rf(g);k.call(a)}}bi(function(){yd(b, g,a,e)})}return rf(g)}function hi(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!wc(b))throw Error(m(200));return Xj(a,b,null,c)}if(!ha)throw Error(m(227));var zf=new Set,Ib={},oa=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),mi=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, Af=Object.prototype.hasOwnProperty,Cf={},Bf={},I={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){I[a]=new Q(a,0,!1,a,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];I[b]=new Q(b,1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){I[a]= new Q(a,2,!1,a.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){I[a]=new Q(a,2,!1,a,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){I[a]=new Q(a,3,!1,a.toLowerCase(),null,!1,!1)});["checked","multiple", "muted","selected"].forEach(function(a){I[a]=new Q(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){I[a]=new Q(a,4,!1,a,null,!1,!1)});["cols","rows","size","span"].forEach(function(a){I[a]=new Q(a,6,!1,a,null,!1,!1)});["rowSpan","start"].forEach(function(a){I[a]=new Q(a,5,!1,a.toLowerCase(),null,!1,!1)});var uf=/[\-:]([a-z])/g,vf=function(a){return a[1].toUpperCase()};"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b= a.replace(uf,vf);I[b]=new Q(b,1,!1,a,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(uf,vf);I[b]=new Q(b,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(uf,vf);I[b]=new Q(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(a){I[a]=new Q(a,1,!1,a.toLowerCase(),null,!1,!1)});I.xlinkHref=new Q("xlinkHref", 1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(a){I[a]=new Q(a,1,!1,a.toLowerCase(),null,!0,!0)});var B=ha.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,fb=ha.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ec=60103,Ua=60106,wa=60107,Hd=60108,Lb=60114,Jd=60109,Id=60110,Dc=60112,Mb=60113,Cc=60120,Ec=60115,Ld=60116,Kd=60121,ue=60128,fi=60129,pf=60130,qf=60131;if("function"===typeof Symbol&&Symbol.for){var H=Symbol.for;ec= H("react.element");Ua=H("react.portal");wa=H("react.fragment");Hd=H("react.strict_mode");Lb=H("react.profiler");Jd=H("react.provider");Id=H("react.context");Dc=H("react.forward_ref");Mb=H("react.suspense");Cc=H("react.suspense_list");Ec=H("react.memo");Ld=H("react.lazy");Kd=H("react.block");H("react.scope");ue=H("react.opaque.id");fi=H("react.debug_trace_mode");pf=H("react.offscreen");qf=H("react.legacy_hidden")}var Df="function"===typeof Symbol&&Symbol.iterator,Fd,Gd=!1,Ad,Lh=function(a){return"undefined"!== typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if("http://www.w3.org/2000/svg"!==a.namespaceURI||"innerHTML"in a)a.innerHTML=b;else{Ad=Ad||document.createElement("div");Ad.innerHTML="<svg>"+b.valueOf().toString()+"</svg>";for(b=Ad.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}}),qc=function(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue= b;return}}a.textContent=b},Nb={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0, zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},bk=["Webkit","ms","Moz","O"];Object.keys(Nb).forEach(function(a){bk.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);Nb[b]=Nb[a]})});var si=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),Vd=null,jb=null,kb=null,me=function(a,b){return a(b)},fg=function(a, b,c,d,e){return a(b,c,d,e)},Xd=function(){},Sf=me,Xa=!1,Yd=!1,qe=!1;if(oa)try{var xc={};Object.defineProperty(xc,"passive",{get:function(){qe=!0}});window.addEventListener("test",xc,xc);window.removeEventListener("test",xc,xc)}catch(a){qe=!1}var vi=function(a,b,c,d,e,f,g,h,k){var l=Array.prototype.slice.call(arguments,3);try{b.apply(c,l)}catch(Da){this.onError(Da)}},Qb=!1,Ic=null,Jc=!1,Zd=null,wi={onError:function(a){Qb=!0;Ic=a}},ca=ha.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler, ck=ca.unstable_cancelCallback,Bd=ca.unstable_now,$f=ca.unstable_scheduleCallback,dk=ca.unstable_shouldYield,ii=ca.unstable_requestPaint,ae=ca.unstable_runWithPriority,ek=ca.unstable_getCurrentPriorityLevel,fk=ca.unstable_ImmediatePriority,ji=ca.unstable_UserBlockingPriority,ag=ca.unstable_NormalPriority,gk=ca.unstable_LowPriority,hk=ca.unstable_IdlePriority,ce=!1,ia=[],ya=null,za=null,Aa=null,Rb=new Map,Sb=new Map,Vb=[],gg="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" "), lb={animationend:Lc("Animation","AnimationEnd"),animationiteration:Lc("Animation","AnimationIteration"),animationstart:Lc("Animation","AnimationStart"),transitionend:Lc("Transition","TransitionEnd")},de={},cg={};oa&&(cg=document.createElement("div").style,"AnimationEvent"in window||(delete lb.animationend.animation,delete lb.animationiteration.animation,delete lb.animationstart.animation),"TransitionEvent"in window||delete lb.transitionend.transition);var Hg=Mc("animationend"),Ig=Mc("animationiteration"), Jg=Mc("animationstart"),Kg=Mc("transitionend"),dg=new Map,fe=new Map,ik=["abort","abort",Hg,"animationEnd",Ig,"animationIteration",Jg,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing", "playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Kg,"transitionEnd","waiting","waiting"];Bd();var w=8,Ba=Math.clz32?Math.clz32:Hi,Ii=Math.log,Ji=Math.LN2,Ni=ji,Mi=ae,Pc=!0,Ca=null,ie=null,Qc=null,Hb={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},le=V(Hb),yc=B({},Hb,{view:0,detail:0}),hj=V(yc),wf,xf,zc,Cd=B({},yc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0, pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:je,button:0,buttons:0,relatedTarget:function(a){return void 0===a.relatedTarget?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){if("movementX"in a)return a.movementX;a!==zc&&(zc&&"mousemove"===a.type?(wf=a.screenX-zc.screenX,xf=a.screenY-zc.screenY):xf=wf=0,zc=a);return wf},movementY:function(a){return"movementY"in a?a.movementY:xf}}),Gg=V(Cd),jk=B({},Cd,{dataTransfer:0}),dj=V(jk),kk=B({}, yc,{relatedTarget:0}),re=V(kk),lk=B({},Hb,{animationName:0,elapsedTime:0,pseudoElement:0}),fj=V(lk),mk=B({},Hb,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),jj=V(mk),nk=B({},Hb,{data:0}),Og=V(nk),mj=Og,ok={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pk={8:"Backspace",9:"Tab",12:"Clear",13:"Enter", 16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Pi={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"},qk=B({},yc,{key:function(a){if(a.key){var b=ok[a.key]||a.key;if("Unidentified"!== b)return b}return"keypress"===a.type?(a=Rc(a),13===a?"Enter":String.fromCharCode(a)):"keydown"===a.type||"keyup"===a.type?pk[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:je,charCode:function(a){return"keypress"===a.type?Rc(a):0},keyCode:function(a){return"keydown"===a.type||"keyup"===a.type?a.keyCode:0},which:function(a){return"keypress"===a.type?Rc(a):"keydown"===a.type||"keyup"===a.type?a.keyCode:0}}),cj=V(qk),rk=B({}, Cd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lg=V(rk),sk=B({},yc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:je}),ej=V(sk),tk=B({},Hb,{propertyName:0,elapsedTime:0,pseudoElement:0}),gj=V(tk),uk=B({},Cd,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),ij=V(uk),Qi=[9,13,27,32],ke=oa&&"CompositionEvent"in window,Ac=null;oa&&"documentMode"in document&&(Ac=document.documentMode);var lj=oa&&"TextEvent"in window&&!Ac,og=oa&&(!ke||Ac&&8<Ac&&11>=Ac),ng=String.fromCharCode(32),mg=!1,ob=!1,Ti={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},Xb=null,Yb=null,Ng=!1;oa&&(Ng=Ui("input")&&(!document.documentMode||9<document.documentMode)); var X="function"===typeof Object.is?Object.is:aj,bj=Object.prototype.hasOwnProperty,kj=oa&&"documentMode"in document&&11>=document.documentMode,qb=null,pe=null,$b=null,oe=!1;ee("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "), 0);ee("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1);ee(ik,2);(function(a,b){for(var c=0;c<a.length;c++)fe.set(a[c],b)})("change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),0);gb("onMouseEnter",["mouseout","mouseover"]); gb("onMouseLeave",["mouseout","mouseover"]);gb("onPointerEnter",["pointerout","pointerover"]);gb("onPointerLeave",["pointerout","pointerover"]);Ta("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ta("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ta("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ta("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")); Ta("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ta("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Eg=new Set("cancel close invalid load scroll toggle".split(" ").concat(pc)), Dg="_reactListening"+Math.random().toString(36).slice(2),lf=null,mf=null,$h="function"===typeof setTimeout?setTimeout:void 0,Kj="function"===typeof clearTimeout?clearTimeout:void 0,yf=0,Dd=Math.random().toString(36).slice(2),Fa="__reactFiber$"+Dd,Wc="__reactProps$"+Dd,rb="__reactContainer$"+Dd,Rg="__reactEvents$"+Dd,ve=[],ub=-1,Ha={},D=Ga(Ha),J=Ga(!1),Ya=Ha,$e=null,db=null,pj=ae,we=$f,xe=ck,oj=ek,Yc=fk,Vg=ji,Wg=ag,Xg=gk,Yg=hk,hf={},Oj=dk,Sj=void 0!==ii?ii:function(){},pa=null,Zc=null,ye=!1,ki=Bd(), P=1E4>ki?Bd:function(){return Bd()-ki},Gj=fb.ReactCurrentBatchConfig,bd=Ga(null),ad=null,xb=null,$c=null,Ka=!1,hh=(new ha.Component).refs,dd={isMounted:function(a){return(a=a._reactInternals)?Va(a)===a:!1},enqueueSetState:function(a,b,c){a=a._reactInternals;var d=W(),e=Oa(a),f=Ia(d,e);f.payload=b;void 0!==c&&null!==c&&(f.callback=c);Ja(a,f);Pa(a,e,d)},enqueueReplaceState:function(a,b,c){a=a._reactInternals;var d=W(),e=Oa(a),f=Ia(d,e);f.tag=1;f.payload=b;void 0!==c&&null!==c&&(f.callback=c);Ja(a,f); Pa(a,e,d)},enqueueForceUpdate:function(a,b){a=a._reactInternals;var c=W(),d=Oa(a),e=Ia(c,d);e.tag=2;void 0!==b&&null!==b&&(e.callback=b);Ja(a,e);Pa(a,d,c)}},gd=Array.isArray,od=ih(!0),xh=ih(!1),fc={},ka=Ga(fc),hc=Ga(fc),gc=Ga(fc),E=Ga(0),ra=null,Na=null,la=!1,Bb=[],jc=fb.ReactCurrentDispatcher,aa=fb.ReactCurrentBatchConfig,ic=0,y=null,N=null,K=null,kd=!1,kc=!1,jd={readContext:Y,useCallback:T,useContext:T,useEffect:T,useImperativeHandle:T,useLayoutEffect:T,useMemo:T,useReducer:T,useRef:T,useState:T, useDebugValue:T,useDeferredValue:T,useTransition:T,useMutableSource:T,useOpaqueIdentifier:T,unstable_isNewReconciler:!1},qj={readContext:Y,useCallback:function(a,b){ab().memoizedState=[a,void 0===b?null:b];return a},useContext:Y,useEffect:rh,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Ne(4,2,th.bind(null,b,a),c)},useLayoutEffect:function(a,b){return Ne(4,2,a,b)},useMemo:function(a,b){var c=ab();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a, b,c){var d=ab();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={pending:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};a=a.dispatch=Me.bind(null,y,a);return[d.memoizedState,a]},useRef:qh,useState:nc,useDebugValue:Pe,useDeferredValue:function(a){var b=nc(a),c=b[0],d=b[1];rh(function(){var b=aa.transition;aa.transition=1;try{d(a)}finally{aa.transition=b}},[a]);return c},useTransition:function(){var a=nc(!1),b=a[0];a=tj.bind(null,a[1]);qh(a);return[a,b]},useMutableSource:function(a, b,c){var d=ab();d.memoizedState={refs:{getSnapshot:b,setSnapshot:null},source:a,subscribe:c};return oh(d,a,b,c)},useOpaqueIdentifier:function(){if(la){var a=!1,b=nj(function(){a||(a=!0,c("r:"+(yf++).toString(36)));throw Error(m(355));}),c=nc(b)[1];0===(y.mode&2)&&(y.flags|=516,ld(5,function(){c("r:"+(yf++).toString(36))},void 0,null));return b}b="r:"+(yf++).toString(36);nc(b);return b},unstable_isNewReconciler:!1},rj={readContext:Y,useCallback:vh,useContext:Y,useEffect:nd,useImperativeHandle:uh,useLayoutEffect:sh, useMemo:wh,useReducer:lc,useRef:md,useState:function(a){return lc(ma)},useDebugValue:Pe,useDeferredValue:function(a){var b=lc(ma),c=b[0],d=b[1];nd(function(){var b=aa.transition;aa.transition=1;try{d(a)}finally{aa.transition=b}},[a]);return c},useTransition:function(){var a=lc(ma)[0];return[md().current,a]},useMutableSource:ph,useOpaqueIdentifier:function(){return lc(ma)[0]},unstable_isNewReconciler:!1},sj={readContext:Y,useCallback:vh,useContext:Y,useEffect:nd,useImperativeHandle:uh,useLayoutEffect:sh, useMemo:wh,useReducer:mc,useRef:md,useState:function(a){return mc(ma)},useDebugValue:Pe,useDeferredValue:function(a){var b=mc(ma),c=b[0],d=b[1];nd(function(){var b=aa.transition;aa.transition=1;try{d(a)}finally{aa.transition=b}},[a]);return c},useTransition:function(){var a=mc(ma)[0];return[md().current,a]},useMutableSource:ph,useOpaqueIdentifier:function(){return mc(ma)[0]},unstable_isNewReconciler:!1},uj=fb.ReactCurrentOwner,fa=!1,qd={dehydrated:null,retryLane:0};var xj=function(a,b,c,d){for(c= b.child;null!==c;){if(5===c.tag||6===c.tag)a.appendChild(c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return=c.return;c=c.sibling}};var Kh=function(a){};var wj=function(a,b,c,d,e){var f=a.memoizedProps;if(f!==d){a=b.stateNode;$a(ka.current);e=null;switch(c){case "input":f=Md(a,f);d=Md(a,d);e=[];break;case "option":f=Pd(a,f);d=Pd(a,d);e=[];break;case "select":f= B({},f,{value:void 0});d=B({},d,{value:void 0});e=[];break;case "textarea":f=Qd(a,f);d=Qd(a,d);e=[];break;default:"function"!==typeof f.onClick&&"function"===typeof d.onClick&&(a.onclick=Vc)}Sd(c,d);var g;c=null;for(l in f)if(!d.hasOwnProperty(l)&&f.hasOwnProperty(l)&&null!=f[l])if("style"===l){var h=f[l];for(g in h)h.hasOwnProperty(g)&&(c||(c={}),c[g]="")}else"dangerouslySetInnerHTML"!==l&&"children"!==l&&"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(Ib.hasOwnProperty(l)? e||(e=[]):(e=e||[]).push(l,null));for(l in d){var k=d[l];h=null!=f?f[l]:void 0;if(d.hasOwnProperty(l)&&k!==h&&(null!=k||null!=h))if("style"===l)if(h){for(g in h)!h.hasOwnProperty(g)||k&&k.hasOwnProperty(g)||(c||(c={}),c[g]="");for(g in k)k.hasOwnProperty(g)&&h[g]!==k[g]&&(c||(c={}),c[g]=k[g])}else c||(e||(e=[]),e.push(l,c)),c=k;else"dangerouslySetInnerHTML"===l?(k=k?k.__html:void 0,h=h?h.__html:void 0,null!=k&&h!==k&&(e=e||[]).push(l,k)):"children"===l?"string"!==typeof k&&"number"!==typeof k||(e= e||[]).push(l,""+k):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&(Ib.hasOwnProperty(l)?(null!=k&&"onScroll"===l&&z("scroll",a),e||h===k||(e=[])):"object"===typeof k&&null!==k&&k.$$typeof===ue?k.toString():(e=e||[]).push(l,k))}c&&(e=e||[]).push("style",c);var l=e;if(b.updateQueue=l)b.flags|=4}};var yj=function(a,b,c,d){c!==d&&(b.flags|=4)};var Lj="function"===typeof WeakMap?WeakMap:Map,Dj="function"===typeof WeakSet?WeakSet:Set,Ij=Math.ceil,vd=fb.ReactCurrentDispatcher,kf= fb.ReactCurrentOwner,n=0,R=null,G=null,O=0,ta=0,cb=Ga(0),L=0,wd=null,Fb=0,La=0,Cb=0,jf=0,ef=null,df=0,We=Infinity,l=null,rd=!1,Ze=null,na=null,Sa=!1,tc=null,vc=90,nf=[],of=[],va=null,rc=0,ff=null,sd=-1,ua=0,td=0,uc=null,xd=!1;var Pj=function(a,b,c){var d=b.lanes;if(null!==a)if(a.memoizedProps!==b.pendingProps||J.current)fa=!0;else if(0!==(c&d))fa=0!==(a.flags&16384)?!0:!1;else{fa=!1;switch(b.tag){case 3:Dh(b);Ie();break;case 5:jh(b);break;case 1:S(b.type)&&Xc(b);break;case 4:Fe(b,b.stateNode.containerInfo); break;case 10:d=b.memoizedProps.value;var e=b.type._context;A(bd,e._currentValue);e._currentValue=d;break;case 13:if(null!==b.memoizedState){if(0!==(c&b.child.childLanes))return Eh(a,b,c);A(E,E.current&1);b=sa(a,b,c);return null!==b?b.sibling:null}A(E,E.current&1);break;case 19:d=0!==(c&b.childLanes);if(0!==(a.flags&64)){if(d)return Jh(a,b,c);b.flags|=64}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null,e.lastEffect=null);A(E,E.current);if(d)break;else return null;case 23:case 24:return b.lanes= 0,Se(a,b,c)}return sa(a,b,c)}else fa=!1;b.lanes=0;switch(b.tag){case 2:d=b.type;null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2);a=b.pendingProps;e=vb(b,D.current);yb(b,c);e=Le(null,b,d,a,e,c);b.flags|=1;if("object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof){b.tag=1;b.memoizedState=null;b.updateQueue=null;if(S(d)){var f=!0;Xc(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;Be(b);var g=d.getDerivedStateFromProps;"function"===typeof g&& cd(b,d,g,a);e.updater=dd;b.stateNode=e;e._reactInternals=b;Ce(b,d,a,c);b=Te(null,b,d,!0,f,c)}else b.tag=0,U(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;a:{null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2);a=b.pendingProps;f=e._init;e=f(e._payload);b.type=e;f=b.tag=Vj(e);a=ea(e,a);switch(f){case 0:b=Re(null,b,e,a,c);break a;case 1:b=Ch(null,b,e,a,c);break a;case 11:b=yh(null,b,e,a,c);break a;case 14:b=zh(null,b,e,ea(e.type,a),d,c);break a}throw Error(m(306,e,""));}return b;case 0:return d= b.type,e=b.pendingProps,e=b.elementType===d?e:ea(d,e),Re(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ea(d,e),Ch(a,b,d,e,c);case 3:Dh(b);d=b.updateQueue;if(null===a||null===d)throw Error(m(282));d=b.pendingProps;e=b.memoizedState;e=null!==e?e.element:null;bh(a,b);cc(b,d,null,c);d=b.memoizedState.element;if(d===e)Ie(),b=sa(a,b,c);else{e=b.stateNode;if(f=e.hydrate)Na=tb(b.stateNode.containerInfo.firstChild),ra=b,f=la=!0;if(f){a=e.mutableSourceEagerHydrationData;if(null!= a)for(e=0;e<a.length;e+=2)f=a[e],f._workInProgressVersionPrimary=a[e+1],Bb.push(f);c=xh(b,null,d,c);for(b.child=c;c;)c.flags=c.flags&-3|1024,c=c.sibling}else U(a,b,d,c),Ie();b=b.child}return b;case 5:return jh(b),null===a&&He(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,se(d,e)?g=null:null!==f&&se(d,f)&&(b.flags|=16),Bh(a,b),U(a,b,g,c),b.child;case 6:return null===a&&He(b),null;case 13:return Eh(a,b,c);case 4:return Fe(b,b.stateNode.containerInfo),d=b.pendingProps,null=== a?b.child=od(b,null,d,c):U(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ea(d,e),yh(a,b,d,e,c);case 7:return U(a,b,b.pendingProps,c),b.child;case 8:return U(a,b,b.pendingProps.children,c),b.child;case 12:return U(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;var h=b.type._context;A(bd,h._currentValue);h._currentValue=f;if(null!==g)if(h=g.value,f=X(h,f)?0:("function"===typeof d._calculateChangedBits? d._calculateChangedBits(h,f):1073741823)|0,0===f){if(g.children===e.children&&!J.current){b=sa(a,b,c);break a}}else for(h=b.child,null!==h&&(h.return=b);null!==h;){var k=h.dependencies;if(null!==k){g=h.child;for(var l=k.firstContext;null!==l;){if(l.context===d&&0!==(l.observedBits&f)){1===h.tag&&(l=Ia(-1,c&-c),l.tag=2,Ja(h,l));h.lanes|=c;l=h.alternate;null!==l&&(l.lanes|=c);ah(h.return,c);k.lanes|=c;break}l=l.next}}else g=10===h.tag?h.type===b.type?null:h.child:h.child;if(null!==g)g.return=h;else for(g= h;null!==g;){if(g===b){g=null;break}h=g.sibling;if(null!==h){h.return=g.return;g=h;break}g=g.return}h=g}U(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,f=b.pendingProps,d=f.children,yb(b,c),e=Y(e,f.unstable_observedBits),d=d(e),b.flags|=1,U(a,b,d,c),b.child;case 14:return e=b.type,f=ea(e,b.pendingProps),f=ea(e.type,f),zh(a,b,e,f,d,c);case 15:return Ah(a,b,b.type,b.pendingProps,d,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ea(d,e),null!==a&&(a.alternate=null,b.alternate= null,b.flags|=2),b.tag=1,S(d)?(a=!0,Xc(b)):a=!1,yb(b,c),fh(b,d,e),Ce(b,d,e,c),Te(null,b,d,!0,a,c);case 19:return Jh(a,b,c);case 23:return Se(a,b,c);case 24:return Se(a,b,c)}throw Error(m(156,b.tag));};var Z=function(a,b,c,d){return new Uj(a,b,c,d)};tf.prototype.render=function(a){yd(a,this._internalRoot,null,null)};tf.prototype.unmount=function(){var a=this._internalRoot,b=a.containerInfo;yd(null,a,null,function(){b[rb]=null})};var Ei=function(a){if(13===a.tag){var b=W();Pa(a,4,b);sf(a,4)}};var Yf= function(a){if(13===a.tag){var b=W();Pa(a,67108864,b);sf(a,67108864)}};var Ci=function(a){if(13===a.tag){var b=W(),c=Oa(a);Pa(a,c,b);sf(a,c)}};var Bi=function(a,b){return b()};Vd=function(a,b,c){switch(b){case "input":Nd(a,c);b=c.name;if("radio"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode;c=c.querySelectorAll("input[name="+JSON.stringify(""+b)+'][type="radio"]');for(b=0;b<c.length;b++){var d=c[b];if(d!==a&&d.form===a.form){var e=Hc(d);if(!e)throw Error(m(90));Ff(d);Nd(d,e)}}}break;case "textarea":Kf(a, c);break;case "select":b=c.value,null!=b&&ib(a,!!c.multiple,b,!1)}};(function(a,b,c,d){me=a;fg=b;Xd=c;Sf=d})(ai,function(a,b,c,d,e){var f=n;n|=4;try{return Za(98,a.bind(null,b,c,d,e))}finally{n=f,0===n&&(Eb(),ja())}},function(){0===(n&49)&&(Jj(),Ra())},function(a,b){var c=n;n|=2;try{return a(b)}finally{n=c,0===n&&(Eb(),ja())}});var vk={Events:[Ob,pb,Hc,Qf,Rf,Ra,{current:!1}]};(function(a){a={bundleType:a.bundleType,version:a.version,rendererPackageName:a.rendererPackageName,rendererConfig:a.rendererConfig, overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:fb.ReactCurrentDispatcher,findHostInstanceByFiber:Yj,findFiberByHostInstance:a.findFiberByHostInstance||Zj,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)a= !1;else{var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!b.isDisabled&&b.supportsFiber)try{$e=b.inject(a),db=b}catch(c){}a=!0}return a})({findFiberByHostInstance:Wa,bundleType:0,version:"17.0.1",rendererPackageName:"react-dom"});M.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vk;M.createPortal=hi;M.findDOMNode=function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternals;if(void 0===b){if("function"===typeof a.render)throw Error(m(188));throw Error(m(268,Object.keys(a))); }a=Vf(b);a=null===a?null:a.stateNode;return a};M.flushSync=function(a,b){var c=n;if(0!==(c&48))return a(b);n|=1;try{if(a)return Za(99,a.bind(null,b))}finally{n=c,ja()}};M.hydrate=function(a,b,c){if(!wc(b))throw Error(m(200));return zd(null,a,b,!0,c)};M.render=function(a,b,c){if(!wc(b))throw Error(m(200));return zd(null,a,b,!1,c)};M.unmountComponentAtNode=function(a){if(!wc(a))throw Error(m(40));return a._reactRootContainer?(bi(function(){zd(null,null,a,!1,function(){a._reactRootContainer=null;a[rb]= null})}),!0):!1};M.unstable_batchedUpdates=ai;M.unstable_createPortal=function(a,b){return hi(a,b,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)};M.unstable_renderSubtreeIntoContainer=function(a,b,c,d){if(!wc(c))throw Error(m(200));if(null==a||void 0===a._reactInternals)throw Error(m(38));return zd(a,b,c,!1,d)};M.version="17.0.1"}); })(); assets/js/component.cdn.js 0000777 00000014530 15251157102 0011576 0 ustar 00 /** * CDN module * @author Hai Zheng */ class CDNMapping extends React.Component { constructor(props) { super(props); this.state = { list: props.list, }; this.onChange = this.onChange.bind(this); this.delRow = this.delRow.bind(this); this.addNew = this.addNew.bind(this); } onChange(e, index) { const target = e.currentTarget; const value = target.dataset.hasOwnProperty('value') ? Boolean(target.dataset.value * 1) : target.value; const list = this.state.list; list[index][target.dataset.type] = value; this.setState({ list: list, }); } delRow(index) { const data = this.state.list; data.splice(index, 1); this.setState({ list: data }); } addNew() { const list = this.state.list; list.push({ url: '' }); this.setState({ list: list }); } render() { return ( <React.Fragment> {this.state.list.map((item, i) => ( <CDNMappingBlock item={item} key={i} index={i} onChange={this.onChange} delRow={this.delRow} /> ))} <p> <button type="button" className="button button-link litespeed-form-action litespeed-link-with-icon" onClick={this.addNew}> <span className="dashicons dashicons-plus-alt"></span> {litespeed_data['lang']['add_cdn_mapping_row']} </button> </p> </React.Fragment> ); } } // { url: '', inc_img: true, inc_css: false, inc_js: false, filetype: [ '.aac', '.eot', ... ] } class CDNMappingBlock extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.delRow = this.delRow.bind(this); } onChange(e) { this.props.onChange(e, this.props.index); } delRow() { this.props.delRow(this.props.index); } render() { const name_prefix = litespeed_data['ids']['cdn_mapping']; const item = this.props.item; const filetype = item.filetype ? (Array.isArray(item.filetype) ? item.filetype.join('\n') : item.filetype) : ''; return ( <div className="litespeed-block"> <div className="litespeed-cdn-mapping-col1"> <label className="litespeed-form-label">{litespeed_data['lang']['cdn_mapping_url']}</label> <input type="text" name={name_prefix + '[url][]'} className="regular-text litespeed-input-long" value={item.url ? item.url : ''} data-type="url" onChange={this.onChange} /> <div className="litespeed-desc"> <span dangerouslySetInnerHTML={{ __html: litespeed_data['lang']['cdn_mapping_url_desc'] }} /> </div> </div> <div className="litespeed-col-auto litespeed-cdn-mapping-col2"> <div className="litespeed-row litespeed-toggle-wrapper"> <div className="litespeed-cdn-mapping-inc litespeed-form-label litespeed-form-label--toggle">{litespeed_data['lang']['cdn_mapping_inc_img']}</div> <div className={`litespeed-toggle litespeed-toggle-btn litespeed-toggle-btn-${item.inc_img ? 'primary' : 'default litespeed-toggleoff'}`} data-type="inc_img" data-value={item.inc_img ? 0 : 1} onClick={this.onChange} > <input name={name_prefix + '[inc_img][]'} type="hidden" value={item.inc_img ? 1 : 0} /> <div className="litespeed-toggle-group"> <label className="litespeed-toggle-btn litespeed-toggle-btn-primary litespeed-toggle-on">{litespeed_data['lang']['on']}</label> <label className="litespeed-toggle-btn litespeed-toggle-btn-default litespeed-toggle-active litespeed-toggle-off"> {litespeed_data['lang']['off']} </label> <span className="litespeed-toggle-handle litespeed-toggle-btn litespeed-toggle-btn-default"></span> </div> </div> </div> <div className="litespeed-row litespeed-toggle-wrapper"> <div className="litespeed-cdn-mapping-inc litespeed-form-label litespeed-form-label--toggle">{litespeed_data['lang']['cdn_mapping_inc_css']}</div> <div className={`litespeed-toggle litespeed-toggle-btn litespeed-toggle-btn-${item.inc_css ? 'primary' : 'default litespeed-toggleoff'}`} data-type="inc_css" data-value={item.inc_css ? 0 : 1} onClick={this.onChange} > <input name={name_prefix + '[inc_css][]'} type="hidden" value={item.inc_css ? 1 : 0} /> <div className="litespeed-toggle-group"> <label className="litespeed-toggle-btn litespeed-toggle-btn-primary litespeed-toggle-on">{litespeed_data['lang']['on']}</label> <label className="litespeed-toggle-btn litespeed-toggle-btn-default litespeed-toggle-active litespeed-toggle-off"> {litespeed_data['lang']['off']} </label> <span className="litespeed-toggle-handle litespeed-toggle-btn litespeed-toggle-btn-default"></span> </div> </div> </div> <div className="litespeed-row litespeed-toggle-wrapper"> <div className="litespeed-cdn-mapping-inc litespeed-form-label litespeed-form-label--toggle">{litespeed_data['lang']['cdn_mapping_inc_js']}</div> <div className={`litespeed-toggle litespeed-toggle-btn litespeed-toggle-btn-${item.inc_js ? 'primary' : 'default litespeed-toggleoff'}`} data-type="inc_js" data-value={item.inc_js ? 0 : 1} onClick={this.onChange} > <input name={name_prefix + '[inc_js][]'} type="hidden" value={item.inc_js ? 1 : 0} /> <div className="litespeed-toggle-group"> <label className="litespeed-toggle-btn litespeed-toggle-btn-primary litespeed-toggle-on">{litespeed_data['lang']['on']}</label> <label className="litespeed-toggle-btn litespeed-toggle-btn-default litespeed-toggle-active litespeed-toggle-off"> {litespeed_data['lang']['off']} </label> <span className="litespeed-toggle-handle litespeed-toggle-btn litespeed-toggle-btn-default"></span> </div> </div> </div> </div> <div className="litespeed-col-auto"> <label className="litespeed-form-label">{litespeed_data['lang']['cdn_mapping_filetype']}</label> <textarea name={name_prefix + '[filetype][]'} rows={filetype.split('\n').length + 2} cols="18" value={filetype} data-type="filetype" onChange={this.onChange} /> </div> <div className="litespeed-col-auto"> <button type="button" className="button button-link litespeed-collection-button litespeed-danger" onClick={this.delRow}> <span className="dashicons dashicons-dismiss"></span> <span className="screen-reader-text">{litespeed_data['lang']['cdn_mapping_remove']}</span> </button> </div> </div> ); } } assets/js/css_async.js 0000777 00000002721 15251157102 0011015 0 ustar 00 /*! loadCSS. [c]2017 Filament Group, Inc. MIT License */ !function(a){"use strict";var b=function(b,c,d){function e(a){return h.body?a():void setTimeout(function(){e(a)})}function f(){i.addEventListener&&i.removeEventListener("load",f),i.media=d||"all"}var g,h=a.document,i=h.createElement("link");if(c)g=c;else{var j=(h.body||h.getElementsByTagName("head")[0]).childNodes;g=j[j.length-1]}var k=h.styleSheets;i.rel="stylesheet",i.href=b,i.media="only x",e(function(){g.parentNode.insertBefore(i,c?g:g.nextSibling)});var l=function(a){for(var b=i.href,c=k.length;c--;)if(k[c].href===b)return a();setTimeout(function(){l(a)})};return i.addEventListener&&i.addEventListener("load",f),i.onloadcssdefined=l,l(f),i};"undefined"!=typeof exports?exports.loadCSS=b:a.loadCSS=b}("undefined"!=typeof global?global:this); /*! loadCSS rel=preload polyfill. [c]2017 Filament Group, Inc. MIT License */ !function(a){if(a.loadCSS){var b=loadCSS.relpreload={};if(b.support=function(){try{return a.document.createElement("link").relList.supports("preload")}catch(b){return!1}},b.poly=function(){for(var b=a.document.getElementsByTagName("link"),c=0;c<b.length;c++){var d=b[c];"preload"===d.rel&&"style"===d.getAttribute("as")&&(a.loadCSS(d.href,d,d.getAttribute("media")),d.rel=null)}},!b.support()){b.poly();var c=a.setInterval(b.poly,300);a.addEventListener&&a.addEventListener("load",function(){b.poly(),a.clearInterval(c)}),a.attachEvent&&a.attachEvent("onload",function(){a.clearInterval(c)})}}}(this); assets/js/guest.min.js 0000777 00000000565 15251157102 0010745 0 ustar 00 var litespeed_vary=document.cookie.replace(/(?:(?:^|.*;\s*)_lscache_vary\s*\=\s*([^;]*).*$)|^.*$/,"$1");litespeed_vary||fetch("litespeed_url",{method:"POST",cache:"no-cache",redirect:"follow"}).then(e=>e.json()).then(e=>{console.log(e),e.hasOwnProperty("reload")&&"yes"==e.reload&&(sessionStorage.setItem("litespeed_docref",document.referrer),window.location.reload(!0))}); assets/js/babel.min.js 0000777 00003011302 15251157102 0010655 0 ustar 00 !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Babel=t():e.Babel=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))switch(typeof e[t]){case"function":break;case"object":e[t]=function(t){var r=t.slice(1),n=e[t[0]];return function(e,t,i){n.apply(this,[e,t,i].concat(r))}}(e[t]);break;default:e[t]=e[e[t]]}return e}([function(e,t,r){"use strict";function n(e,t){return g(t)&&"string"==typeof t[0]?e.hasOwnProperty(t[0])?[e[t[0]]].concat(t.slice(1)):void 0:"string"==typeof t?e[t]:t}function i(e){var t=(e.presets||[]).map(function(e){var t=n(E,e);if(!t)throw new Error('Invalid preset specified in Babel options: "'+e+'"');return g(t)&&"object"===h(t[0])&&t[0].hasOwnProperty("buildPreset")&&(t[0]=d({},t[0],{buildPreset:t[0].buildPreset})),t}),r=(e.plugins||[]).map(function(e){var t=n(b,e);if(!t)throw new Error('Invalid plugin specified in Babel options: "'+e+'"');return t});return d({babelrc:!1},e,{presets:t,plugins:r})}function s(e,t){return y.transform(e,i(t))}function a(e,t,r){return y.transformFromAst(e,t,i(r))}function o(e,t){b.hasOwnProperty(e)&&console.warn('A plugin named "'+e+'" is already registered, it will be overridden'),b[e]=t}function u(e){Object.keys(e).forEach(function(t){return o(t,e[t])})}function l(e,t){E.hasOwnProperty(e)&&console.warn('A preset named "'+e+'" is already registered, it will be overridden'),E[e]=t}function c(e){Object.keys(e).forEach(function(t){return l(t,e[t])})}function f(e){(0,v.runScripts)(s,e)}function p(){window.removeEventListener("DOMContentLoaded",f)}Object.defineProperty(t,"__esModule",{value:!0}),t.version=t.buildExternalHelpers=t.availablePresets=t.availablePlugins=void 0;var d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.transform=s,t.transformFromAst=a,t.registerPlugin=o,t.registerPlugins=u,t.registerPreset=l,t.registerPresets=c,t.transformScriptTags=f,t.disableScriptTags=p;var m=r(290),y=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(m),v=r(629),g=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},b=t.availablePlugins={},E=t.availablePresets={};t.buildExternalHelpers=y.buildExternalHelpers;u({"check-es2015-constants":r(66),"external-helpers":r(322),"inline-replace-variables":r(323),"syntax-async-functions":r(67),"syntax-async-generators":r(195),"syntax-class-constructor-call":r(196),"syntax-class-properties":r(197),"syntax-decorators":r(125),"syntax-do-expressions":r(198),"syntax-exponentiation-operator":r(199),"syntax-export-extensions":r(200),"syntax-flow":r(126),"syntax-function-bind":r(201),"syntax-function-sent":r(325),"syntax-jsx":r(127),"syntax-object-rest-spread":r(202),"syntax-trailing-function-commas":r(128),"transform-async-functions":r(326),"transform-async-to-generator":r(129),"transform-async-to-module-method":r(328),"transform-class-constructor-call":r(203),"transform-class-properties":r(204),"transform-decorators":r(205),"transform-decorators-legacy":r(329).default,"transform-do-expressions":r(206),"transform-es2015-arrow-functions":r(68),"transform-es2015-block-scoped-functions":r(69),"transform-es2015-block-scoping":r(70),"transform-es2015-classes":r(71),"transform-es2015-computed-properties":r(72),"transform-es2015-destructuring":r(73),"transform-es2015-duplicate-keys":r(130),"transform-es2015-for-of":r(74),"transform-es2015-function-name":r(75),"transform-es2015-instanceof":r(332),"transform-es2015-literals":r(76),"transform-es2015-modules-amd":r(131),"transform-es2015-modules-commonjs":r(77),"transform-es2015-modules-systemjs":r(208),"transform-es2015-modules-umd":r(209),"transform-es2015-object-super":r(78),"transform-es2015-parameters":r(79),"transform-es2015-shorthand-properties":r(80),"transform-es2015-spread":r(81),"transform-es2015-sticky-regex":r(82),"transform-es2015-template-literals":r(83),"transform-es2015-typeof-symbol":r(84),"transform-es2015-unicode-regex":r(85),"transform-es3-member-expression-literals":r(336),"transform-es3-property-literals":r(337),"transform-es5-property-mutators":r(338),"transform-eval":r(339),"transform-exponentiation-operator":r(132),"transform-export-extensions":r(210),"transform-flow-comments":r(340),"transform-flow-strip-types":r(211),"transform-function-bind":r(212),"transform-jscript":r(341),"transform-object-assign":r(342),"transform-object-rest-spread":r(213),"transform-object-set-prototype-of-to-assign":r(343),"transform-proto-to-assign":r(344),"transform-react-constant-elements":r(345),"transform-react-display-name":r(214),"transform-react-inline-elements":r(346),"transform-react-jsx":r(215),"transform-react-jsx-compat":r(347),"transform-react-jsx-self":r(349),"transform-react-jsx-source":r(350),"transform-regenerator":r(86),"transform-runtime":r(353),"transform-strict-mode":r(216),"undeclared-variables-check":r(354)}),c({es2015:r(217),es2016:r(218),es2017:r(219),latest:r(356),react:r(357),"stage-0":r(358),"stage-1":r(220),"stage-2":r(221),"stage-3":r(222),"es2015-no-commonjs":{plugins:[r(83),r(76),r(75),r(68),r(69),r(71),r(78),r(80),r(72),r(74),r(82),r(85),r(66),r(81),r(79),r(73),r(70),r(84),[r(86),{async:!1,asyncGenerators:!1}]]},"es2015-loose":{plugins:[[r(83),{loose:!0}],r(76),r(75),r(68),r(69),[r(71),{loose:!0}],r(78),r(80),r(130),[r(72),{loose:!0}],[r(74),{loose:!0}],r(82),r(85),r(66),[r(81),{loose:!0}],r(79),[r(73),{loose:!0}],r(70),r(84),[r(77),{loose:!0}],[r(86),{async:!1,asyncGenerators:!1}]]}});t.version="6.26.0";"undefined"!=typeof window&&window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",function(){return f()},!1)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=z["is"+e];t||(t=z["is"+e]=function(t,r){return z.is(e,t,r)}),z["assert"+e]=function(r,n){if(n=n||{},!t(r,n))throw new Error("Expected type "+(0,I.default)(e)+" with option "+(0,I.default)(n))}}function s(e,t,r){return!!t&&(!!a(t.type,e)&&(void 0===r||z.shallowEqual(t,r)))}function a(e,t){if(e===t)return!0;if(z.ALIAS_KEYS[t])return!1;var r=z.FLIPPED_ALIAS_KEYS[t];if(r){if(r[0]===e)return!0;for(var n=r,i=Array.isArray(n),s=0,n=i?n:(0,T.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}if(e===a)return!0}}return!1}function o(e,t,r){if(e){var n=z.NODE_FIELDS[e.type];if(n){var i=n[t];i&&i.validate&&(i.optional&&null==r||i.validate(e,t,r))}}}function u(e,t){for(var r=(0,B.default)(t),n=r,i=Array.isArray(n),s=0,n=i?n:(0,T.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a;if(e[o]!==t[o])return!1}return!0}function l(e,t,r){return e.object=z.memberExpression(e.object,e.property,e.computed),e.property=t,e.computed=!!r,e}function c(e,t){return e.object=z.memberExpression(t,e.object),e}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body";return e[t]=z.toBlock(e[t],e)}function p(e){if(!e)return e;var t={};for(var r in e)"_"!==r[0]&&(t[r]=e[r]);return t}function d(e){var t=p(e);return delete t.loc,t}function h(e){if(!e)return e;var t={};for(var r in e)if("_"!==r[0]){var n=e[r];n&&(n.type?n=z.cloneDeep(n):Array.isArray(n)&&(n=n.map(z.cloneDeep))),t[r]=n}return t}function m(e,t){var r=e.split(".");return function(e){if(!z.isMemberExpression(e))return!1;for(var n=[e],i=0;n.length;){var s=n.shift();if(t&&i===r.length)return!0;if(z.isIdentifier(s)){if(r[i]!==s.name)return!1}else{if(!z.isStringLiteral(s)){if(z.isMemberExpression(s)){if(s.computed&&!z.isStringLiteral(s.property))return!1;n.push(s.object),n.push(s.property);continue}return!1}if(r[i]!==s.value)return!1}if(++i>r.length)return!1}return!0}}function y(e){for(var t=z.COMMENT_KEYS,r=Array.isArray(t),n=0,t=r?t:(0,T.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}delete e[i]}return e}function v(e,t){return g(e,t),b(e,t),E(e,t),e}function g(e,t){x("trailingComments",e,t)}function b(e,t){x("leadingComments",e,t)}function E(e,t){x("innerComments",e,t)}function x(e,t,r){t&&r&&(t[e]=(0,K.default)([].concat(t[e],r[e]).filter(Boolean)))}function A(e,t){if(!e||!t)return e;for(var r=z.INHERIT_KEYS.optional,n=Array.isArray(r),i=0,r=n?r:(0,T.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var a=s;null==e[a]&&(e[a]=t[a])}for(var o in t)"_"===o[0]&&(e[o]=t[o]);for(var u=z.INHERIT_KEYS.force,l=Array.isArray(u),c=0,u=l?u:(0,T.default)(u);;){var f;if(l){if(c>=u.length)break;f=u[c++]}else{if(c=u.next(),c.done)break;f=c.value}var p=f;e[p]=t[p]}return z.inheritsComments(e,t),e}function S(e){if(!_(e))throw new TypeError("Not a valid node "+(e&&e.type))}function _(e){return!(!e||!H.VISITOR_KEYS[e.type])}function D(e,t,r){if(e){var n=z.VISITOR_KEYS[e.type];if(n){r=r||{},t(e,r);for(var i=n,s=Array.isArray(i),a=0,i=s?i:(0,T.default)(i);;){var o;if(s){if(a>=i.length)break;o=i[a++]}else{if(a=i.next(),a.done)break;o=a.value}var u=o,l=e[u];if(Array.isArray(l))for(var c=l,f=Array.isArray(c),p=0,c=f?c:(0,T.default)(c);;){var d;if(f){if(p>=c.length)break;d=c[p++]}else{if(p=c.next(),p.done)break;d=p.value}var h=d;D(h,t,r)}else D(l,t,r)}}}}function C(e,t){t=t||{};for(var r=t.preserveComments?Z:ee,n=r,i=Array.isArray(n),s=0,n=i?n:(0,T.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a;null!=e[o]&&(e[o]=void 0)}for(var u in e)"_"===u[0]&&null!=e[u]&&(e[u]=void 0);for(var l=(0,k.default)(e),c=l,f=Array.isArray(c),p=0,c=f?c:(0,T.default)(c);;){var d;if(f){if(p>=c.length)break;d=c[p++]}else{if(p=c.next(),p.done)break;d=p.value}e[d]=null}}function w(e,t){return D(e,C,t),e}t.__esModule=!0,t.createTypeAnnotationBasedOnTypeof=t.removeTypeDuplicates=t.createUnionTypeAnnotation=t.valueToNode=t.toBlock=t.toExpression=t.toStatement=t.toBindingIdentifierName=t.toIdentifier=t.toKeyAlias=t.toSequenceExpression=t.toComputedKey=t.isNodesEquivalent=t.isImmutable=t.isScope=t.isSpecifierDefault=t.isVar=t.isBlockScoped=t.isLet=t.isValidIdentifier=t.isReferenced=t.isBinding=t.getOuterBindingIdentifiers=t.getBindingIdentifiers=t.TYPES=t.react=t.DEPRECATED_KEYS=t.BUILDER_KEYS=t.NODE_FIELDS=t.ALIAS_KEYS=t.VISITOR_KEYS=t.NOT_LOCAL_BINDING=t.BLOCK_SCOPED_SYMBOL=t.INHERIT_KEYS=t.UNARY_OPERATORS=t.STRING_UNARY_OPERATORS=t.NUMBER_UNARY_OPERATORS=t.BOOLEAN_UNARY_OPERATORS=t.BINARY_OPERATORS=t.NUMBER_BINARY_OPERATORS=t.BOOLEAN_BINARY_OPERATORS=t.COMPARISON_BINARY_OPERATORS=t.EQUALITY_BINARY_OPERATORS=t.BOOLEAN_NUMBER_BINARY_OPERATORS=t.UPDATE_OPERATORS=t.LOGICAL_OPERATORS=t.COMMENT_KEYS=t.FOR_INIT_KEYS=t.FLATTENABLE_KEYS=t.STATEMENT_OR_BLOCK_KEYS=void 0;var P=r(360),k=n(P),F=r(2),T=n(F),O=r(14),B=n(O),R=r(35),I=n(R),M=r(135);Object.defineProperty(t,"STATEMENT_OR_BLOCK_KEYS",{enumerable:!0,get:function(){return M.STATEMENT_OR_BLOCK_KEYS}}),Object.defineProperty(t,"FLATTENABLE_KEYS",{enumerable:!0,get:function(){return M.FLATTENABLE_KEYS}}),Object.defineProperty(t,"FOR_INIT_KEYS",{enumerable:!0,get:function(){return M.FOR_INIT_KEYS}}),Object.defineProperty(t,"COMMENT_KEYS",{enumerable:!0,get:function(){return M.COMMENT_KEYS}}),Object.defineProperty(t,"LOGICAL_OPERATORS",{enumerable:!0,get:function(){return M.LOGICAL_OPERATORS}}),Object.defineProperty(t,"UPDATE_OPERATORS",{enumerable:!0,get:function(){return M.UPDATE_OPERATORS}}),Object.defineProperty(t,"BOOLEAN_NUMBER_BINARY_OPERATORS",{enumerable:!0,get:function(){return M.BOOLEAN_NUMBER_BINARY_OPERATORS}}),Object.defineProperty(t,"EQUALITY_BINARY_OPERATORS",{enumerable:!0,get:function(){return M.EQUALITY_BINARY_OPERATORS}}),Object.defineProperty(t,"COMPARISON_BINARY_OPERATORS",{enumerable:!0,get:function(){return M.COMPARISON_BINARY_OPERATORS}}),Object.defineProperty(t,"BOOLEAN_BINARY_OPERATORS",{enumerable:!0,get:function(){return M.BOOLEAN_BINARY_OPERATORS}}),Object.defineProperty(t,"NUMBER_BINARY_OPERATORS",{enumerable:!0,get:function(){return M.NUMBER_BINARY_OPERATORS}}),Object.defineProperty(t,"BINARY_OPERATORS",{enumerable:!0,get:function(){return M.BINARY_OPERATORS}}),Object.defineProperty(t,"BOOLEAN_UNARY_OPERATORS",{enumerable:!0,get:function(){return M.BOOLEAN_UNARY_OPERATORS}}),Object.defineProperty(t,"NUMBER_UNARY_OPERATORS",{enumerable:!0,get:function(){return M.NUMBER_UNARY_OPERATORS}}),Object.defineProperty(t,"STRING_UNARY_OPERATORS",{enumerable:!0,get:function(){return M.STRING_UNARY_OPERATORS}}),Object.defineProperty(t,"UNARY_OPERATORS",{enumerable:!0,get:function(){return M.UNARY_OPERATORS}}),Object.defineProperty(t,"INHERIT_KEYS",{enumerable:!0,get:function(){return M.INHERIT_KEYS}}),Object.defineProperty(t,"BLOCK_SCOPED_SYMBOL",{enumerable:!0,get:function(){return M.BLOCK_SCOPED_SYMBOL}}),Object.defineProperty(t,"NOT_LOCAL_BINDING",{enumerable:!0,get:function(){return M.NOT_LOCAL_BINDING}}),t.is=s,t.isType=a,t.validate=o,t.shallowEqual=u,t.appendToMemberExpression=l,t.prependToMemberExpression=c,t.ensureBlock=f,t.clone=p,t.cloneWithoutLoc=d,t.cloneDeep=h,t.buildMatchMemberExpression=m,t.removeComments=y,t.inheritsComments=v,t.inheritTrailingComments=g,t.inheritLeadingComments=b,t.inheritInnerComments=E,t.inherits=A,t.assertNode=S,t.isNode=_,t.traverseFast=D,t.removeProperties=C,t.removePropertiesDeep=w;var N=r(226);Object.defineProperty(t,"getBindingIdentifiers",{enumerable:!0,get:function(){return N.getBindingIdentifiers}}),Object.defineProperty(t,"getOuterBindingIdentifiers",{enumerable:!0,get:function(){return N.getOuterBindingIdentifiers}});var L=r(395);Object.defineProperty(t,"isBinding",{enumerable:!0,get:function(){return L.isBinding}}),Object.defineProperty(t,"isReferenced",{enumerable:!0,get:function(){return L.isReferenced}}),Object.defineProperty(t,"isValidIdentifier",{enumerable:!0,get:function(){return L.isValidIdentifier}}),Object.defineProperty(t,"isLet",{enumerable:!0,get:function(){return L.isLet}}),Object.defineProperty(t,"isBlockScoped",{enumerable:!0,get:function(){return L.isBlockScoped}}),Object.defineProperty(t,"isVar",{enumerable:!0,get:function(){return L.isVar}}),Object.defineProperty(t,"isSpecifierDefault",{enumerable:!0,get:function(){return L.isSpecifierDefault}}),Object.defineProperty(t,"isScope",{enumerable:!0,get:function(){return L.isScope}}),Object.defineProperty(t,"isImmutable",{enumerable:!0,get:function(){return L.isImmutable}}),Object.defineProperty(t,"isNodesEquivalent",{enumerable:!0,get:function(){return L.isNodesEquivalent}});var j=r(385);Object.defineProperty(t,"toComputedKey",{enumerable:!0,get:function(){return j.toComputedKey}}),Object.defineProperty(t,"toSequenceExpression",{enumerable:!0,get:function(){return j.toSequenceExpression}}),Object.defineProperty(t,"toKeyAlias",{enumerable:!0,get:function(){return j.toKeyAlias}}),Object.defineProperty(t,"toIdentifier",{enumerable:!0,get:function(){return j.toIdentifier}}),Object.defineProperty(t,"toBindingIdentifierName",{enumerable:!0,get:function(){return j.toBindingIdentifierName}}),Object.defineProperty(t,"toStatement",{enumerable:!0,get:function(){return j.toStatement}}),Object.defineProperty(t,"toExpression",{enumerable:!0,get:function(){return j.toExpression}}),Object.defineProperty(t,"toBlock",{enumerable:!0,get:function(){return j.toBlock}}),Object.defineProperty(t,"valueToNode",{enumerable:!0,get:function(){return j.valueToNode}});var U=r(393);Object.defineProperty(t,"createUnionTypeAnnotation",{enumerable:!0,get:function(){return U.createUnionTypeAnnotation}}),Object.defineProperty(t,"removeTypeDuplicates",{enumerable:!0,get:function(){return U.removeTypeDuplicates}}),Object.defineProperty(t,"createTypeAnnotationBasedOnTypeof",{enumerable:!0,get:function(){return U.createTypeAnnotationBasedOnTypeof}});var V=r(624),G=n(V),W=r(109),Y=n(W),q=r(600),K=n(q);r(390);var H=r(26),J=r(394),X=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(J),z=t;t.VISITOR_KEYS=H.VISITOR_KEYS,t.ALIAS_KEYS=H.ALIAS_KEYS,t.NODE_FIELDS=H.NODE_FIELDS,t.BUILDER_KEYS=H.BUILDER_KEYS,t.DEPRECATED_KEYS=H.DEPRECATED_KEYS,t.react=X;for(var $ in z.VISITOR_KEYS)i($);z.FLIPPED_ALIAS_KEYS={},(0,B.default)(z.ALIAS_KEYS).forEach(function(e){z.ALIAS_KEYS[e].forEach(function(t){(z.FLIPPED_ALIAS_KEYS[t]=z.FLIPPED_ALIAS_KEYS[t]||[]).push(e)})}),(0,B.default)(z.FLIPPED_ALIAS_KEYS).forEach(function(e){z[e.toUpperCase()+"_TYPES"]=z.FLIPPED_ALIAS_KEYS[e],i(e)});t.TYPES=(0,B.default)(z.VISITOR_KEYS).concat((0,B.default)(z.FLIPPED_ALIAS_KEYS)).concat((0,B.default)(z.DEPRECATED_KEYS));(0,B.default)(z.BUILDER_KEYS).forEach(function(e){function t(){if(arguments.length>r.length)throw new Error("t."+e+": Too many arguments passed. Received "+arguments.length+" but can receive no more than "+r.length);var t={};t.type=e;for(var n=0,i=r,s=Array.isArray(i),a=0,i=s?i:(0,T.default)(i);;){var u;if(s){if(a>=i.length)break;u=i[a++]}else{if(a=i.next(),a.done)break;u=a.value}var l=u,c=z.NODE_FIELDS[e][l],f=arguments[n++];void 0===f&&(f=(0,Y.default)(c.default)),t[l]=f}for(var p in t)o(t,p,t[p]);return t}var r=z.BUILDER_KEYS[e];z[e]=t,z[e[0].toLowerCase()+e.slice(1)]=t});for(var Q in z.DEPRECATED_KEYS)!function(e){function t(t){return function(){return console.trace("The node type "+e+" has been renamed to "+r),t.apply(this,arguments)}}var r=z.DEPRECATED_KEYS[e];z[e]=z[e[0].toLowerCase()+e.slice(1)]=t(z[r]),z["is"+e]=t(z["is"+r]),z["assert"+e]=t(z["assert"+r])}(Q);(0,G.default)(z),(0,G.default)(z.VISITOR_KEYS);var Z=["tokens","start","end","loc","raw","rawValue"],ee=z.COMMENT_KEYS.concat(["comments"]).concat(Z)},function(e,t,r){"use strict";e.exports={default:r(404),__esModule:!0}},function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e,t){e=(0,l.default)(e);var r=e,n=r.program;return t.length&&(0,m.default)(e,A,null,t),n.body.length>1?n.body:n.body[0]}t.__esModule=!0;var a=r(10),o=i(a);t.default=function(e,t){var r=void 0;try{throw new Error}catch(e){e.stack&&(r=e.stack.split("\n").slice(1).join("\n"))}t=(0,f.default)({allowReturnOutsideFunction:!0,allowSuperOutsideMethod:!0,preserveComments:!1},t);var n=function(){var i=void 0;try{i=v.parse(e,t),i=m.default.removeProperties(i,{preserveComments:t.preserveComments}),m.default.cheap(i,function(e){e[E]=!0})}catch(e){throw e.stack=e.stack+"from\n"+r,e}return n=function(){return i},i};return function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return s(n(),t)}};var u=r(574),l=i(u),c=r(174),f=i(c),p=r(274),d=i(p),h=r(7),m=i(h),y=r(89),v=n(y),g=r(1),b=n(g),E="_fromTemplate",x=(0,o.default)(),A={noScope:!0,enter:function(e,t){var r=e.node;if(r[x])return e.skip();b.isExpressionStatement(r)&&(r=r.expression);var n=void 0;if(b.isIdentifier(r)&&r[E])if((0,d.default)(t[0],r.name))n=t[0][r.name];else if("$"===r.name[0]){var i=+r.name.slice(1);t[i]&&(n=t[i])}null===n&&e.remove(),n&&(n[x]=!0,e.replaceInline(n))},exit:function(e){var t=e.node;t.loc||m.default.clearNode(t)}};e.exports=t.default},function(e,t){"use strict";var r=e.exports={version:"2.5.0"};"number"==typeof __e&&(__e=r)},function(e,t){"use strict";var r=Array.isArray;e.exports=r},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e,t,r,n,i){if(e){if(t||(t={}),!t.noScope&&!r&&"Program"!==e.type&&"File"!==e.type)throw new Error(v.get("traverseNeedsParent",e.type));m.explode(t),s.node(e,t,r,n,i)}}function a(e,t){e.node.type===t.type&&(t.has=!0,e.stop())}t.__esModule=!0,t.visitors=t.Hub=t.Scope=t.NodePath=void 0;var o=r(2),u=i(o),l=r(36);Object.defineProperty(t,"NodePath",{enumerable:!0,get:function(){return i(l).default}});var c=r(134);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return i(c).default}});var f=r(223);Object.defineProperty(t,"Hub",{enumerable:!0,get:function(){return i(f).default}}),t.default=s;var p=r(367),d=i(p),h=r(384),m=n(h),y=r(20),v=n(y),g=r(111),b=i(g),E=r(1),x=n(E),A=r(88),S=n(A);t.visitors=m,s.visitors=m,s.verify=m.verify,s.explode=m.explode,s.NodePath=r(36),s.Scope=r(134),s.Hub=r(223),s.cheap=function(e,t){return x.traverseFast(e,t)},s.node=function(e,t,r,n,i,s){var a=x.VISITOR_KEYS[e.type];if(a)for(var o=new d.default(r,t,n,i),l=a,c=Array.isArray(l),f=0,l=c?l:(0,u.default)(l);;){var p;if(c){if(f>=l.length)break;p=l[f++]}else{if(f=l.next(),f.done)break;p=f.value}var h=p;if((!s||!s[h])&&o.visit(e,h))return}},s.clearNode=function(e,t){x.removeProperties(e,t),S.path.delete(e)},s.removeProperties=function(e,t){return x.traverseFast(e,s.clearNode,t),e},s.hasType=function(e,t,r,n){if((0,b.default)(n,e.type))return!1;if(e.type===r)return!0;var i={has:!1,type:r};return s(e,{blacklist:n,enter:a},t,i),i.has},s.clearCache=function(){S.clear()},s.clearCache.clearPath=S.clearPath,s.clearCache.clearScope=S.clearScope,s.copyCache=function(e,t){S.path.has(e)&&S.path.set(t,S.path.get(e))}},function(e,t){"use strict";function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function i(e){if(c===setTimeout)return setTimeout(e,0);if((c===r||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function s(e){if(f===clearTimeout)return clearTimeout(e);if((f===n||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function a(){m&&d&&(m=!1,d.length?h=d.concat(h):y=-1,h.length&&o())}function o(){if(!m){var e=i(a);m=!0;for(var t=h.length;t;){for(d=h,h=[];++y<t;)d&&d[y].run();y=-1,t=h.length}d=null,m=!1,s(e)}}function u(e,t){this.fun=e,this.array=t}function l(){}var c,f,p=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:r}catch(e){c=r}try{f="function"==typeof clearTimeout?clearTimeout:n}catch(e){f=n}}();var d,h=[],m=!1,y=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];h.push(new u(e,t)),1!==h.length||m||i(o)},u.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=l,p.addListener=l,p.once=l,p.off=l,p.removeListener=l,p.removeAllListeners=l,p.emit=l,p.prependListener=l,p.prependOnceListener=l,p.listeners=function(e){return[]},p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t,r){"use strict";e.exports={default:r(409),__esModule:!0}},function(e,t,r){"use strict";e.exports={default:r(414),__esModule:!0}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.__esModule=!0;var s=r(363),a=n(s),o=r(10),u=n(o),l="function"==typeof u.default&&"symbol"===i(a.default)?function(e){return void 0===e?"undefined":i(e)}:function(e){return e&&"function"==typeof u.default&&e.constructor===u.default&&e!==u.default.prototype?"symbol":void 0===e?"undefined":i(e)};t.default="function"==typeof u.default&&"symbol"===l(a.default)?function(e){return void 0===e?"undefined":l(e)}:function(e){return e&&"function"==typeof u.default&&e.constructor===u.default&&e!==u.default.prototype?"symbol":void 0===e?"undefined":l(e)}},function(e,t,r){"use strict";var n=r(15),i=r(5),s=r(43),a=r(29),o=function e(t,r,o){var u,l,c,f=t&e.F,p=t&e.G,d=t&e.S,h=t&e.P,m=t&e.B,y=t&e.W,v=p?i:i[r]||(i[r]={}),g=v.prototype,b=p?n:d?n[r]:(n[r]||{}).prototype;p&&(o=r);for(u in o)(l=!f&&b&&void 0!==b[u])&&u in v||(c=l?b[u]:o[u],v[u]=p&&"function"!=typeof b[u]?o[u]:m&&l?s(c,n):y&&b[u]==c?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(c):h&&"function"==typeof c?s(Function.call,c):c,h&&((v.virtual||(v.virtual={}))[u]=c,t&e.R&&g&&!g[u]&&a(g,u,c)))};o.F=1,o.G=2,o.S=4,o.P=8,o.B=16,o.W=32,o.U=64,o.R=128,e.exports=o},function(e,t,r){"use strict";var n=r(151)("wks"),i=r(95),s=r(15).Symbol,a="function"==typeof s;(e.exports=function(e){return n[e]||(n[e]=a&&s[e]||(a?s:i)("Symbol."+e))}).store=n},function(e,t,r){"use strict";e.exports={default:r(411),__esModule:!0}},function(e,t){"use strict";var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e){return"object"===(void 0===e?"undefined":r(e))?null!==e:"function"==typeof e}},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(261),s="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,a=i||s||Function("return this")();e.exports=a},function(e,t){"use strict";function r(e){var t=void 0===e?"undefined":n(e);return null!=e&&("object"==t||"function"==t)}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=r},function(e,t,r){(function(e){"use strict";function r(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,s=function(e){return i.exec(e).slice(1)};t.resolve=function(){for(var t="",i=!1,s=arguments.length-1;s>=-1&&!i;s--){var a=s>=0?arguments[s]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,i="/"===a.charAt(0))}return t=r(n(t.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),s="/"===a(e,-1);return e=r(n(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&s&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,r){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var i=n(e.split("/")),s=n(r.split("/")),a=Math.min(i.length,s.length),o=a,u=0;u<a;u++)if(i[u]!==s[u]){o=u;break}for(var l=[],u=o;u<i.length;u++)l.push("..");return l=l.concat(s.slice(o)),l.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=s(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},t.basename=function(e,t){var r=s(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},t.extname=function(e){return s(e)[3]};var a="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}).call(t,r(8))},function(e,t,r){"use strict";function n(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var s=l[e];if(!s)throw new ReferenceError("Unknown message "+(0,a.default)(e));return r=i(r),s.replace(/\$(\d+)/g,function(e,t){return r[t-1]})}function i(e){return e.map(function(e){if(null!=e&&e.inspect)return e.inspect();try{return(0,a.default)(e)||e+""}catch(t){return u.inspect(e)}})}t.__esModule=!0,t.MESSAGES=void 0;var s=r(35),a=function(e){return e&&e.__esModule?e:{default:e}}(s);t.get=n,t.parseArgs=i;var o=r(117),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(o),l=t.MESSAGES={tailCallReassignmentDeopt:"Function reference has been reassigned, so it will probably be dereferenced, therefore we can't optimise this with confidence",classesIllegalBareSuper:"Illegal use of bare super",classesIllegalSuperCall:"Direct super call is illegal in non-constructor, use super.$1() instead",scopeDuplicateDeclaration:"Duplicate declaration $1",settersNoRest:"Setters aren't allowed to have a rest",noAssignmentsInForHead:"No assignments allowed in for-in/of head",expectedMemberExpressionOrIdentifier:"Expected type MemberExpression or Identifier",invalidParentForThisNode:"We don't know how to handle this node within the current parent - please open an issue",readOnly:"$1 is read-only",unknownForHead:"Unknown node type $1 in ForStatement",didYouMean:"Did you mean $1?",codeGeneratorDeopt:"Note: The code generator has deoptimised the styling of $1 as it exceeds the max of $2.",missingTemplatesDirectory:"no templates directory - this is most likely the result of a broken `npm publish`. Please report to https://github.com/babel/babel/issues",unsupportedOutputType:"Unsupported output type $1",illegalMethodName:"Illegal method name $1",lostTrackNodePath:"We lost track of this node's position, likely because the AST was directly manipulated",modulesIllegalExportName:"Illegal export $1",modulesDuplicateDeclarations:"Duplicate module declarations with the same source but in different scopes",undeclaredVariable:"Reference to undeclared variable $1",undeclaredVariableType:"Referencing a type alias outside of a type annotation",undeclaredVariableSuggestion:"Reference to undeclared variable $1 - did you mean $2?",traverseNeedsParent:"You must pass a scope and parentPath unless traversing a Program/File. Instead of that you tried to traverse a $1 node without passing scope and parentPath.",traverseVerifyRootFunction:"You passed `traverse()` a function when it expected a visitor object, are you sure you didn't mean `{ enter: Function }`?",traverseVerifyVisitorProperty:"You passed `traverse()` a visitor object with the property $1 that has the invalid property $2",traverseVerifyNodeType:"You gave us a visitor for the node type $1 but it's not a valid type",pluginNotObject:"Plugin $2 specified in $1 was expected to return an object when invoked but returned $3",pluginNotFunction:"Plugin $2 specified in $1 was expected to return a function but returned $3", pluginUnknown:"Unknown plugin $1 specified in $2 at $3, attempted to resolve relative to $4",pluginInvalidProperty:"Plugin $2 specified in $1 provided an invalid property of $3"}},function(e,t,r){"use strict";var n=r(16);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t,r){"use strict";e.exports=!r(27)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,r){"use strict";var n=r(21),i=r(231),s=r(154),a=Object.defineProperty;t.f=r(22)?Object.defineProperty:function(e,t,r){if(n(e),t=s(t,!0),n(r),i)try{return a(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){"use strict";function n(e){return null!=e&&s(e.length)&&!i(e)}var i=r(175),s=r(176);e.exports=n},function(e,t){"use strict";function r(e){return null!=e&&"object"==(void 0===e?"undefined":n(e))}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){return Array.isArray(e)?"array":null===e?"null":void 0===e?"undefined":void 0===e?"undefined":(0,v.default)(e)}function s(e){function t(t,r,n){if(Array.isArray(n))for(var i=0;i<n.length;i++)e(t,r+"["+i+"]",n[i])}return t.each=e,t}function a(){function e(e,t,n){if(r.indexOf(n)<0)throw new TypeError("Property "+t+" expected value to be one of "+(0,m.default)(r)+" but got "+(0,m.default)(n))}for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.oneOf=r,e}function o(){function e(e,t,n){for(var i=!1,s=r,a=Array.isArray(s),o=0,s=a?s:(0,d.default)(s);;){var u;if(a){if(o>=s.length)break;u=s[o++]}else{if(o=s.next(),o.done)break;u=o.value}var l=u;if(b.is(l,n)){i=!0;break}}if(!i)throw new TypeError("Property "+t+" of "+e.type+" expected node to be of a type "+(0,m.default)(r)+" but instead got "+(0,m.default)(n&&n.type))}for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.oneOfNodeTypes=r,e}function u(){function e(e,t,n){for(var s=!1,a=r,o=Array.isArray(a),u=0,a=o?a:(0,d.default)(a);;){var l;if(o){if(u>=a.length)break;l=a[u++]}else{if(u=a.next(),u.done)break;l=u.value}var c=l;if(i(n)===c||b.is(c,n)){s=!0;break}}if(!s)throw new TypeError("Property "+t+" of "+e.type+" expected node to be of a type "+(0,m.default)(r)+" but instead got "+(0,m.default)(n&&n.type))}for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.oneOfNodeOrValueTypes=r,e}function l(e){function t(t,r,n){if(i(n)!==e)throw new TypeError("Property "+r+" expected type of "+e+" but got "+i(n))}return t.type=e,t}function c(){function e(){for(var e=r,t=Array.isArray(e),n=0,e=t?e:(0,d.default)(e);;){var i;if(t){if(n>=e.length)break;i=e[n++]}else{if(n=e.next(),n.done)break;i=n.value}i.apply(void 0,arguments)}}for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.chainOf=r,e}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.inherits&&D[t.inherits]||{};t.fields=t.fields||r.fields||{},t.visitor=t.visitor||r.visitor||[],t.aliases=t.aliases||r.aliases||[],t.builder=t.builder||r.builder||t.visitor||[],t.deprecatedAlias&&(_[t.deprecatedAlias]=e);for(var n=t.visitor.concat(t.builder),s=Array.isArray(n),a=0,n=s?n:(0,d.default)(n);;){var o;if(s){if(a>=n.length)break;o=n[a++]}else{if(a=n.next(),a.done)break;o=a.value}var u=o;t.fields[u]=t.fields[u]||{}}for(var c in t.fields){var f=t.fields[c];-1===t.builder.indexOf(c)&&(f.optional=!0),void 0===f.default?f.default=null:f.validate||(f.validate=l(i(f.default)))}E[e]=t.visitor,S[e]=t.builder,A[e]=t.fields,x[e]=t.aliases,D[e]=t}t.__esModule=!0,t.DEPRECATED_KEYS=t.BUILDER_KEYS=t.NODE_FIELDS=t.ALIAS_KEYS=t.VISITOR_KEYS=void 0;var p=r(2),d=n(p),h=r(35),m=n(h),y=r(11),v=n(y);t.assertEach=s,t.assertOneOf=a,t.assertNodeType=o,t.assertNodeOrValueType=u,t.assertValueType=l,t.chain=c,t.default=f;var g=r(1),b=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(g),E=t.VISITOR_KEYS={},x=t.ALIAS_KEYS={},A=t.NODE_FIELDS={},S=t.BUILDER_KEYS={},_=t.DEPRECATED_KEYS={},D={}},function(e,t){"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){"use strict";var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){"use strict";var n=r(23),i=r(92);e.exports=r(22)?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){"use strict";function n(e){return null==e?void 0===e?u:o:l&&l in Object(e)?s(e):a(e)}var i=r(45),s=r(534),a=r(559),o="[object Null]",u="[object Undefined]",l=i?i.toStringTag:void 0;e.exports=n},function(e,t,r){"use strict";function n(e,t,r,n){var a=!r;r||(r={});for(var o=-1,u=t.length;++o<u;){var l=t[o],c=n?n(r[l],e[l],l,r,e):void 0;void 0===c&&(c=e[l]),a?s(r,l,c):i(r,l,c)}return r}var i=r(162),s=r(163);e.exports=n},function(e,t,r){"use strict";function n(e){return a(e)?i(e):s(e)}var i=r(245),s=r(500),a=r(24);e.exports=n},function(e,t){"use strict";e.exports={filename:{type:"filename",description:"filename to use when reading from stdin - this will be used in source-maps, errors etc",default:"unknown",shorthand:"f"},filenameRelative:{hidden:!0,type:"string"},inputSourceMap:{hidden:!0},env:{hidden:!0,default:{}},mode:{description:"",hidden:!0},retainLines:{type:"boolean",default:!1,description:"retain line numbers - will result in really ugly code"},highlightCode:{description:"enable/disable ANSI syntax highlighting of code frames (on by default)",type:"boolean",default:!0},suppressDeprecationMessages:{type:"boolean",default:!1,hidden:!0},presets:{type:"list",description:"",default:[]},plugins:{type:"list",default:[],description:""},ignore:{type:"list",description:"list of glob paths to **not** compile",default:[]},only:{type:"list",description:"list of glob paths to **only** compile"},code:{hidden:!0,default:!0,type:"boolean"},metadata:{hidden:!0,default:!0,type:"boolean"},ast:{hidden:!0,default:!0,type:"boolean"},extends:{type:"string",hidden:!0},comments:{type:"boolean",default:!0,description:"write comments to generated output (true by default)"},shouldPrintComment:{hidden:!0,description:"optional callback to control whether a comment should be inserted, when this is used the comments option is ignored"},wrapPluginVisitorMethod:{hidden:!0,description:"optional callback to wrap all visitor methods"},compact:{type:"booleanString",default:"auto",description:"do not include superfluous whitespace characters and line terminators [true|false|auto]"},minified:{type:"boolean",default:!1,description:"save as much bytes when printing [true|false]"},sourceMap:{alias:"sourceMaps",hidden:!0},sourceMaps:{type:"booleanString",description:"[true|false|inline]",default:!1,shorthand:"s"},sourceMapTarget:{type:"string",description:"set `file` on returned source map"},sourceFileName:{type:"string",description:"set `sources[0]` on returned source map"},sourceRoot:{type:"filename",description:"the root from which all sources are relative"},babelrc:{description:"Whether or not to look up .babelrc and .babelignore files",type:"boolean",default:!0},sourceType:{description:"",default:"module"},auxiliaryCommentBefore:{type:"string",description:"print a comment before any injected non-user code"},auxiliaryCommentAfter:{type:"string",description:"print a comment after any injected non-user code"},resolveModuleSource:{hidden:!0},getModuleId:{hidden:!0},moduleRoot:{type:"filename",description:"optional prefix for the AMD module formatter that will be prepend to the filename on module definitions"},moduleIds:{type:"boolean",default:!1,shorthand:"M",description:"insert an explicit id for modules"},moduleId:{description:"specify a custom name for module ids",type:"string"},passPerPreset:{description:"Whether to spawn a traversal pass per a preset. By default all presets are merged.",type:"boolean",default:!1,hidden:!0},parserOpts:{description:"Options to pass into the parser, or to change parsers (parserOpts.parser)",default:!1},generatorOpts:{description:"Options to pass into the generator, or to change generators (generatorOpts.generator)",default:!1}}},function(e,t,r){(function(n){"use strict";function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function s(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=r(366),o=s(a),u=r(35),l=s(u),c=r(87),f=s(c),p=r(2),d=s(p),h=r(11),m=s(h),y=r(3),v=s(y),g=r(182),b=i(g),E=r(65),x=s(E),A=r(20),S=i(A),_=r(52),D=r(184),C=s(D),w=r(185),P=s(w),k=r(575),F=s(k),T=r(109),O=s(T),B=r(293),R=s(B),I=r(33),M=s(I),N=r(54),L=s(N),j=r(51),U=s(j),V=r(19),G=s(V),W=function(){function e(t){(0,v.default)(this,e),this.resolvedConfigs=[],this.options=e.createBareOptions(),this.log=t}return e.memoisePluginContainer=function(t,r,n,i){for(var s=e.memoisedPlugins,a=Array.isArray(s),o=0,s=a?s:(0,d.default)(s);;){var u;if(a){if(o>=s.length)break;u=s[o++]}else{if(o=s.next(),o.done)break;u=o.value}var l=u;if(l.container===t)return l.plugin}var c=void 0;if(c="function"==typeof t?t(b):t,"object"===(void 0===c?"undefined":(0,m.default)(c))){var f=new x.default(c,i);return e.memoisedPlugins.push({container:t,plugin:f}),f}throw new TypeError(S.get("pluginNotObject",r,n,void 0===c?"undefined":(0,m.default)(c))+r+n)},e.createBareOptions=function(){var e={};for(var t in M.default){var r=M.default[t];e[t]=(0,O.default)(r.default)}return e},e.normalisePlugin=function(t,r,n,i){if(!((t=t.__esModule?t.default:t)instanceof x.default)){if("function"!=typeof t&&"object"!==(void 0===t?"undefined":(0,m.default)(t)))throw new TypeError(S.get("pluginNotFunction",r,n,void 0===t?"undefined":(0,m.default)(t)));t=e.memoisePluginContainer(t,r,n,i)}return t.init(r,n),t},e.normalisePlugins=function(t,n,i){return i.map(function(i,s){var a=void 0,o=void 0;if(!i)throw new TypeError("Falsy value found in plugins");Array.isArray(i)?(a=i[0],o=i[1]):a=i;var u="string"==typeof a?a:t+"$"+s;if("string"==typeof a){var l=(0,C.default)(a,n);if(!l)throw new ReferenceError(S.get("pluginUnknown",a,t,s,n));a=r(179)(l)}return a=e.normalisePlugin(a,t,s,u),[a,o]})},e.prototype.mergeOptions=function(t){var r=this,i=t.options,s=t.extending,a=t.alias,o=t.loc,u=t.dirname;if(a=a||"foreign",i){("object"!==(void 0===i?"undefined":(0,m.default)(i))||Array.isArray(i))&&this.log.error("Invalid options type for "+a,TypeError);var l=(0,F.default)(i,function(e){if(e instanceof x.default)return e});u=u||n.cwd(),o=o||a;for(var c in l){if(!M.default[c]&&this.log)if(L.default[c])this.log.error("Using removed Babel 5 option: "+a+"."+c+" - "+L.default[c].message,ReferenceError);else{var p="Unknown option: "+a+"."+c+". Check out http://babeljs.io/docs/usage/options/ for more information about options.";this.log.error(p+"\n\nA common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:\n\nInvalid:\n `{ presets: [{option: value}] }`\nValid:\n `{ presets: [['presetName', {option: value}]] }`\n\nFor more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options.",ReferenceError)}}(0,_.normaliseOptions)(l),l.plugins&&(l.plugins=e.normalisePlugins(o,u,l.plugins)),l.presets&&(l.passPerPreset?l.presets=this.resolvePresets(l.presets,u,function(e,t){r.mergeOptions({options:e,extending:e,alias:t,loc:t,dirname:u})}):(this.mergePresets(l.presets,u),delete l.presets)),i===s?(0,f.default)(s,l):(0,R.default)(s||this.options,l)}},e.prototype.mergePresets=function(e,t){var r=this;this.resolvePresets(e,t,function(e,t){r.mergeOptions({options:e,alias:t,loc:t,dirname:G.default.dirname(t||"")})})},e.prototype.resolvePresets=function(e,t,n){return e.map(function(e){var i=void 0;if(Array.isArray(e)){if(e.length>2)throw new Error("Unexpected extra options "+(0,l.default)(e.slice(2))+" passed to preset.");var s=e;e=s[0],i=s[1]}var a=void 0;try{if("string"==typeof e){if(!(a=(0,P.default)(e,t)))throw new Error("Couldn't find preset "+(0,l.default)(e)+" relative to directory "+(0,l.default)(t));e=r(179)(a)}if("object"===(void 0===e?"undefined":(0,m.default)(e))&&e.__esModule)if(e.default)e=e.default;else{var u=e,c=(u.__esModule,(0,o.default)(u,["__esModule"]));e=c}if("object"===(void 0===e?"undefined":(0,m.default)(e))&&e.buildPreset&&(e=e.buildPreset),"function"!=typeof e&&void 0!==i)throw new Error("Options "+(0,l.default)(i)+" passed to "+(a||"a preset")+" which does not accept options.");if("function"==typeof e&&(e=e(b,i,{dirname:t})),"object"!==(void 0===e?"undefined":(0,m.default)(e)))throw new Error("Unsupported preset format: "+e+".");n&&n(e,a)}catch(e){throw a&&(e.message+=" (While processing preset: "+(0,l.default)(a)+")"),e}return e})},e.prototype.normaliseOptions=function(){var e=this.options;for(var t in M.default){var r=M.default[t],n=e[t];!n&&r.optional||(r.alias?e[r.alias]=e[r.alias]||n:e[t]=n)}},e.prototype.init=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,U.default)(e,this.log),r=Array.isArray(t),n=0,t=r?t:(0,d.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i;this.mergeOptions(s)}return this.normaliseOptions(e),this.options},e}();t.default=W,W.memoisedPlugins=[],e.exports=t.default}).call(t,r(8))},function(e,t,r){"use strict";e.exports={default:r(405),__esModule:!0}},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var s=r(2),a=i(s),o=r(3),u=i(o),l=r(224),c=n(l),f=r(239),p=i(f),d=r(466),h=i(d),m=r(7),y=i(m),v=r(174),g=i(v),b=r(134),E=i(b),x=r(1),A=n(x),S=r(88),_=(0,p.default)("babel"),D=function(){function e(t,r){(0,u.default)(this,e),this.parent=r,this.hub=t,this.contexts=[],this.data={},this.shouldSkip=!1,this.shouldStop=!1,this.removed=!1,this.state=null,this.opts=null,this.skipKeys=null,this.parentPath=null,this.context=null,this.container=null,this.listKey=null,this.inList=!1,this.parentKey=null,this.key=null,this.node=null,this.scope=null,this.type=null,this.typeAnnotation=null}return e.get=function(t){var r=t.hub,n=t.parentPath,i=t.parent,s=t.container,a=t.listKey,o=t.key;!r&&n&&(r=n.hub),(0,h.default)(i,"To get a node path the parent needs to exist");var u=s[o],l=S.path.get(i)||[];S.path.has(i)||S.path.set(i,l);for(var c=void 0,f=0;f<l.length;f++){var p=l[f];if(p.node===u){c=p;break}}return c||(c=new e(r,i),l.push(c)),c.setup(n,s,a,o),c},e.prototype.getScope=function(e){var t=e;return this.isScope()&&(t=new E.default(this,e)),t},e.prototype.setData=function(e,t){return this.data[e]=t},e.prototype.getData=function(e,t){var r=this.data[e];return!r&&t&&(r=this.data[e]=t),r},e.prototype.buildCodeFrameError=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:SyntaxError;return this.hub.file.buildCodeFrameError(this.node,e,t)},e.prototype.traverse=function(e,t){(0,y.default)(this.node,e,this.scope,t,this)},e.prototype.mark=function(e,t){this.hub.file.metadata.marked.push({type:e,message:t,loc:this.node.loc})},e.prototype.set=function(e,t){A.validate(this.node,e,t),this.node[e]=t},e.prototype.getPathLocation=function(){var e=[],t=this;do{var r=t.key;t.inList&&(r=t.listKey+"["+r+"]"),e.unshift(r)}while(t=t.parentPath);return e.join(".")},e.prototype.debug=function(e){_.enabled&&_(this.getPathLocation()+" "+this.type+": "+e())},e}();t.default=D,(0,g.default)(D.prototype,r(368)),(0,g.default)(D.prototype,r(374)),(0,g.default)(D.prototype,r(382)),(0,g.default)(D.prototype,r(372)),(0,g.default)(D.prototype,r(371)),(0,g.default)(D.prototype,r(377)),(0,g.default)(D.prototype,r(370)),(0,g.default)(D.prototype,r(381)),(0,g.default)(D.prototype,r(380)),(0,g.default)(D.prototype,r(373)),(0,g.default)(D.prototype,r(369));for(var C=A.TYPES,w=Array.isArray(C),P=0,C=w?C:(0,a.default)(C);;){var k;if("break"===function(){if(w){if(P>=C.length)return"break";k=C[P++]}else{if(P=C.next(),P.done)return"break";k=P.value}var e=k,t="is"+e;D.prototype[t]=function(e){return A[t](this.node,e)},D.prototype["assert"+e]=function(r){if(!this[t](r))throw new TypeError("Expected node path of type "+e)}}())break}for(var F in c){(function(e){if("_"===e[0])return"continue";A.TYPES.indexOf(e)<0&&A.TYPES.push(e);var t=c[e];D.prototype["is"+e]=function(e){return t.checkPath(this,e)}})(F)}e.exports=t.default},function(e,t,r){"use strict";var n=r(142),i=r(140);e.exports=function(e){return n(i(e))}},function(e,t,r){"use strict";function n(e,t){var r=s(e,t);return i(r)?r:void 0}var i=r(497),s=r(535);e.exports=n},function(e,t){"use strict";e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r,n){if(e.selfReference){if(!n.hasBinding(r.name)||n.hasGlobal(r.name)){if(!f.isFunction(t))return;var i=p;t.generator&&(i=d);var s=i({FUNCTION:t,FUNCTION_ID:r,FUNCTION_KEY:n.generateUidIdentifier(r.name)}).expression;s.callee._skipModulesRemap=!0;for(var a=s.callee.body.body[0].params,u=0,l=(0,o.default)(t);u<l;u++)a.push(n.generateUidIdentifier("x"));return s}n.rename(r.name)}t.id=r,n.getProgramParent().references[r.name]=!0}function s(e,t,r){var n={selfAssignment:!1,selfReference:!1,outerDeclar:r.getBindingIdentifier(t),references:[],name:t},i=r.getOwnBinding(t);return i?"param"===i.kind&&(n.selfReference=!0):(n.outerDeclar||r.hasGlobal(t))&&r.traverse(e,h,n),n}t.__esModule=!0,t.default=function(e){var t=e.node,r=e.parent,n=e.scope,a=e.id;if(!t.id){if(!f.isObjectProperty(r)&&!f.isObjectMethod(r,{kind:"method"})||r.computed&&!f.isLiteral(r.key)){if(f.isVariableDeclarator(r)){if(a=r.id,f.isIdentifier(a)){var o=n.parent.getBinding(a.name);if(o&&o.constant&&n.getBinding(a.name)===o)return t.id=a,void(t.id[f.NOT_LOCAL_BINDING]=!0)}}else if(f.isAssignmentExpression(r))a=r.left;else if(!a)return}else a=r.key;var u=void 0;if(a&&f.isLiteral(a))u=a.value;else{if(!a||!f.isIdentifier(a))return;u=a.name}u=f.toBindingIdentifierName(u),a=f.identifier(u),a[f.NOT_LOCAL_BINDING]=!0;return i(s(t,u,n),t,a,n)||t}};var a=r(189),o=n(a),u=r(4),l=n(u),c=r(1),f=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(c),p=(0,l.default)("\n (function (FUNCTION_KEY) {\n function FUNCTION_ID() {\n return FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n }\n\n return FUNCTION_ID;\n })(FUNCTION)\n"),d=(0,l.default)("\n (function (FUNCTION_KEY) {\n function* FUNCTION_ID() {\n return yield* FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n };\n\n return FUNCTION_ID;\n })(FUNCTION)\n"),h={"ReferencedIdentifier|BindingIdentifier":function(e,t){if(e.node.name===t.name){e.scope.getBindingIdentifier(t.name)===t.outerDeclar&&(t.selfReference=!0,e.stop())}}};e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(361),s=n(i),a=r(9),o=n(a),u=r(11),l=n(u);t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,l.default)(t)));e.prototype=(0,o.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(s.default?(0,s.default)(e,t):e.__proto__=t)}},function(e,t,r){"use strict";t.__esModule=!0;var n=r(11),i=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,i.default)(t))&&"function"!=typeof t?e:t}},function(e,t,r){"use strict";var n=r(227);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,r){"use strict";var n=r(237),i=r(141);e.exports=Object.keys||function(e){return n(e,i)}},function(e,t,r){"use strict";var n=r(17),i=n.Symbol;e.exports=i},function(e,t){"use strict";function r(e,t){return e===t||e!==e&&t!==t}e.exports=r},function(e,t,r){"use strict";function n(e){return a(e)?i(e,!0):s(e)}var i=r(245),s=r(501),a=r(24);e.exports=n},function(e,t,r){"use strict";function n(e){var t=i(e),r=t%1;return t===t?r?t-r:t:0}var i=r(597);e.exports=n},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,r){(function(e){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.File=void 0;var s=r(2),a=i(s),o=r(9),u=i(o),l=r(87),c=i(l),f=r(3),p=i(f),d=r(42),h=i(d),m=r(41),y=i(m),v=r(194),g=i(v),b=r(121),E=n(b),x=r(403),A=i(x),S=r(34),_=i(S),D=r(299),C=i(D),w=r(7),P=i(w),k=r(288),F=i(k),T=r(186),O=i(T),B=r(181),R=i(B),I=r(273),M=i(I),N=r(120),L=i(N),j=r(119),U=i(j),V=r(89),G=r(122),W=n(G),Y=r(19),q=i(Y),K=r(1),H=n(K),J=r(118),X=i(J),z=r(296),$=i(z),Q=r(297),Z=i(Q),ee=/^#!.*/,te=[[$.default],[Z.default]],re={enter:function(e,t){var r=e.node.loc;r&&(t.loc=r,e.stop())}},ne=function(t){function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments[1];(0,p.default)(this,n);var i=(0,h.default)(this,t.call(this));return i.pipeline=r,i.log=new L.default(i,e.filename||"unknown"),i.opts=i.initOptions(e),i.parserOpts={sourceType:i.opts.sourceType,sourceFileName:i.opts.filename,plugins:[]},i.pluginVisitors=[],i.pluginPasses=[],i.buildPluginsForOptions(i.opts),i.opts.passPerPreset&&(i.perPresetOpts=[],i.opts.presets.forEach(function(e){var t=(0,c.default)((0,u.default)(i.opts),e);i.perPresetOpts.push(t),i.buildPluginsForOptions(t)})),i.metadata={usedHelpers:[],marked:[],modules:{imports:[],exports:{exported:[],specifiers:[]}}},i.dynamicImportTypes={},i.dynamicImportIds={},i.dynamicImports=[],i.declarations={},i.usedHelpers={},i.path=null,i.ast={},i.code="",i.shebang="",i.hub=new w.Hub(i),i}return(0,y.default)(n,t),n.prototype.getMetadata=function(){for(var e=!1,t=this.ast.program.body,r=Array.isArray(t),n=0,t=r?t:(0,a.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i;if(H.isModuleDeclaration(s)){e=!0;break}}e&&this.path.traverse(E,this)},n.prototype.initOptions=function(e){e=new _.default(this.log,this.pipeline).init(e),e.inputSourceMap&&(e.sourceMaps=!0),e.moduleId&&(e.moduleIds=!0),e.basename=q.default.basename(e.filename,q.default.extname(e.filename)),e.ignore=W.arrayify(e.ignore,W.regexify),e.only&&(e.only=W.arrayify(e.only,W.regexify)),(0,M.default)(e,{moduleRoot:e.sourceRoot}),(0,M.default)(e,{sourceRoot:e.moduleRoot}),(0,M.default)(e,{filenameRelative:e.filename});var t=q.default.basename(e.filenameRelative);return(0,M.default)(e,{sourceFileName:t,sourceMapTarget:t}),e},n.prototype.buildPluginsForOptions=function(e){if(Array.isArray(e.plugins)){for(var t=e.plugins.concat(te),r=[],n=[],i=t,s=Array.isArray(i),o=0,i=s?i:(0,a.default)(i);;){var u;if(s){if(o>=i.length)break;u=i[o++]}else{if(o=i.next(),o.done)break;u=o.value}var l=u,c=l[0],f=l[1];r.push(c.visitor),n.push(new C.default(this,c,f)),c.manipulateOptions&&c.manipulateOptions(e,this.parserOpts,this)}this.pluginVisitors.push(r),this.pluginPasses.push(n)}},n.prototype.getModuleName=function(){var e=this.opts;if(!e.moduleIds)return null;if(null!=e.moduleId&&!e.getModuleId)return e.moduleId;var t=e.filenameRelative,r="";if(null!=e.moduleRoot&&(r=e.moduleRoot+"/"),!e.filenameRelative)return r+e.filename.replace(/^\//,"");if(null!=e.sourceRoot){var n=new RegExp("^"+e.sourceRoot+"/?");t=t.replace(n,"")}return t=t.replace(/\.(\w*?)$/,""),r+=t,r=r.replace(/\\/g,"/"),e.getModuleId?e.getModuleId(r)||r:r},n.prototype.resolveModuleSource=function(e){var t=this.opts.resolveModuleSource;return t&&(e=t(e,this.opts.filename)),e},n.prototype.addImport=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,n=e+":"+t,i=this.dynamicImportIds[n];if(!i){e=this.resolveModuleSource(e),i=this.dynamicImportIds[n]=this.scope.generateUidIdentifier(r);var s=[];"*"===t?s.push(H.importNamespaceSpecifier(i)):"default"===t?s.push(H.importDefaultSpecifier(i)):s.push(H.importSpecifier(i,H.identifier(t)));var a=H.importDeclaration(s,H.stringLiteral(e));a._blockHoist=3,this.path.unshiftContainer("body",a)}return i},n.prototype.addHelper=function(e){var t=this.declarations[e];if(t)return t;this.usedHelpers[e]||(this.metadata.usedHelpers.push(e),this.usedHelpers[e]=!0);var r=this.get("helperGenerator"),n=this.get("helpersNamespace");if(r){var i=r(e);if(i)return i}else if(n)return H.memberExpression(n,H.identifier(e));var s=(0,g.default)(e),a=this.declarations[e]=this.scope.generateUidIdentifier(e);return H.isFunctionExpression(s)&&!s.id?(s.body._compact=!0,s._generated=!0,s.id=a,s.type="FunctionDeclaration",this.path.unshiftContainer("body",s)):(s._compact=!0,this.scope.push({id:a,init:s,unique:!0})),a},n.prototype.addTemplateObject=function(e,t,r){var n=r.elements.map(function(e){return e.value}),i=e+"_"+r.elements.length+"_"+n.join(","),s=this.declarations[i];if(s)return s;var a=this.declarations[i]=this.scope.generateUidIdentifier("templateObject"),o=this.addHelper(e),u=H.callExpression(o,[t,r]);return u._compact=!0,this.scope.push({id:a,init:u,_blockHoist:1.9}),a},n.prototype.buildCodeFrameError=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:SyntaxError,n=e&&(e.loc||e._loc),i=new r(t);return n?i.loc=n.start:((0,P.default)(e,re,this.scope,i),i.message+=" (This is an error on an internal node. Probably an internal error",i.loc&&(i.message+=". Location has been estimated."),i.message+=")"),i},n.prototype.mergeSourceMap=function(e){var t=this.opts.inputSourceMap;if(t){var r=new F.default.SourceMapConsumer(t),n=new F.default.SourceMapConsumer(e),i=new F.default.SourceMapGenerator({file:r.file,sourceRoot:r.sourceRoot}),s=n.sources[0];r.eachMapping(function(e){var t=n.generatedPositionFor({line:e.generatedLine,column:e.generatedColumn,source:s});null!=t.column&&i.addMapping({source:e.source,original:null==e.source?null:{line:e.originalLine,column:e.originalColumn},generated:t})});var a=i.toJSON();return t.mappings=a.mappings,t}return e},n.prototype.parse=function(t){var n=V.parse,i=this.opts.parserOpts;if(i&&(i=(0,c.default)({},this.parserOpts,i),i.parser)){if("string"==typeof i.parser){var s=q.default.dirname(this.opts.filename)||e.cwd(),a=(0,X.default)(i.parser,s);if(!a)throw new Error("Couldn't find parser "+i.parser+' with "parse" method relative to directory '+s);n=r(178)(a).parse}else n=i.parser;i.parser={parse:function(e){return(0,V.parse)(e,i)}}}this.log.debug("Parse start");var o=n(t,i||this.parserOpts);return this.log.debug("Parse stop"),o},n.prototype._addAst=function(e){this.path=w.NodePath.get({hub:this.hub,parentPath:null,parent:e,container:e,key:"program"}).setContext(),this.scope=this.path.scope,this.ast=e,this.getMetadata()},n.prototype.addAst=function(e){this.log.debug("Start set AST"),this._addAst(e),this.log.debug("End set AST")},n.prototype.transform=function(){for(var e=0;e<this.pluginPasses.length;e++){var t=this.pluginPasses[e];this.call("pre",t),this.log.debug("Start transform traverse");var r=P.default.visitors.merge(this.pluginVisitors[e],t,this.opts.wrapPluginVisitorMethod);(0,P.default)(this.ast,r,this.scope),this.log.debug("End transform traverse"),this.call("post",t)}return this.generate()},n.prototype.wrap=function(t,r){t+="";try{return this.shouldIgnore()?this.makeResult({code:t,ignored:!0}):r()}catch(r){if(r._babel)throw r;r._babel=!0;var n=r.message=this.opts.filename+": "+r.message,i=r.loc;if(i&&(r.codeFrame=(0,R.default)(t,i.line,i.column+1,this.opts),n+="\n"+r.codeFrame),e.browser&&(r.message=n),r.stack){var s=r.stack.replace(r.message,n);r.stack=s}throw r}},n.prototype.addCode=function(e){e=(e||"")+"",e=this.parseInputSourceMap(e),this.code=e},n.prototype.parseCode=function(){this.parseShebang();var e=this.parse(this.code);this.addAst(e)},n.prototype.shouldIgnore=function(){var e=this.opts;return W.shouldIgnore(e.filename,e.ignore,e.only)},n.prototype.call=function(e,t){for(var r=t,n=Array.isArray(r),i=0,r=n?r:(0,a.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var o=s,u=o.plugin,l=u[e];l&&l.call(o,this)}},n.prototype.parseInputSourceMap=function(e){var t=this.opts;if(!1!==t.inputSourceMap){var r=A.default.fromSource(e);r&&(t.inputSourceMap=r.toObject(),e=A.default.removeComments(e))}return e},n.prototype.parseShebang=function(){var e=ee.exec(this.code);e&&(this.shebang=e[0],this.code=this.code.replace(ee,""))},n.prototype.makeResult=function(e){var t=e.code,r=e.map,n=e.ast,i=e.ignored,s={metadata:null,options:this.opts,ignored:!!i,code:null,ast:null,map:r||null};return this.opts.code&&(s.code=t),this.opts.ast&&(s.ast=n),this.opts.metadata&&(s.metadata=this.metadata),s},n.prototype.generate=function(){var t=this.opts,n=this.ast,i={ast:n};if(!t.code)return this.makeResult(i);var s=O.default;if(t.generatorOpts.generator&&"string"==typeof(s=t.generatorOpts.generator)){var a=q.default.dirname(this.opts.filename)||e.cwd(),o=(0,X.default)(s,a);if(!o)throw new Error("Couldn't find generator "+s+' with "print" method relative to directory '+a);s=r(178)(o).print}this.log.debug("Generation start");var u=s(n,t.generatorOpts?(0,c.default)(t,t.generatorOpts):t,this.code);return i.code=u.code,i.map=u.map,this.log.debug("Generation end"),this.shebang&&(i.code=this.shebang+"\n"+i.code),i.map&&(i.map=this.mergeSourceMap(i.map)),"inline"!==t.sourceMaps&&"both"!==t.sourceMaps||(i.code+="\n"+A.default.fromObject(i.map).toComment()),"inline"===t.sourceMaps&&(i.map=null),this.makeResult(i)},n}(U.default);t.default=ne,t.File=ne}).call(t,r(8))},function(e,t,r){(function(n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=x[e];return null==t?x[e]=E.default.existsSync(e):t}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1],r=e.filename,n=new S(t);return!1!==e.babelrc&&n.findConfigs(r),n.mergeConfig({options:e,alias:"base",dirname:r&&g.default.dirname(r)}),n.configs}t.__esModule=!0;var o=r(87),u=i(o),l=r(3),c=i(l);t.default=a;var f=r(118),p=i(f),d=r(470),h=i(d),m=r(604),y=i(m),v=r(19),g=i(v),b=r(115),E=i(b),x={},A={},S=function(){function e(t){(0,c.default)(this,e),this.resolvedConfigs=[],this.configs=[],this.log=t}return e.prototype.findConfigs=function(e){if(e){(0,y.default)(e)||(e=g.default.join(n.cwd(),e));for(var t=!1,r=!1;e!==(e=g.default.dirname(e));){if(!t){var i=g.default.join(e,".babelrc");s(i)&&(this.addConfig(i),t=!0);var a=g.default.join(e,"package.json");!t&&s(a)&&(t=this.addConfig(a,"babel",JSON))}if(!r){var o=g.default.join(e,".babelignore");s(o)&&(this.addIgnoreConfig(o),r=!0)}if(r&&t)return}}},e.prototype.addIgnoreConfig=function(e){var t=E.default.readFileSync(e,"utf8"),r=t.split("\n");r=r.map(function(e){return e.replace(/#(.*?)$/,"").trim()}).filter(function(e){return!!e}),r.length&&this.mergeConfig({options:{ignore:r},alias:e,dirname:g.default.dirname(e)})},e.prototype.addConfig=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h.default;if(this.resolvedConfigs.indexOf(e)>=0)return!1 ;this.resolvedConfigs.push(e);var n=E.default.readFileSync(e,"utf8"),i=void 0;try{i=A[n]=A[n]||r.parse(n),t&&(i=i[t])}catch(t){throw t.message=e+": Error while parsing JSON - "+t.message,t}return this.mergeConfig({options:i,alias:e,dirname:g.default.dirname(e)}),!!i},e.prototype.mergeConfig=function(e){var t=e.options,r=e.alias,i=e.loc,s=e.dirname;if(!t)return!1;if(t=(0,u.default)({},t),s=s||n.cwd(),i=i||r,t.extends){var a=(0,p.default)(t.extends,s);a?this.addConfig(a):this.log&&this.log.error("Couldn't resolve extends clause of "+t.extends+" in "+r),delete t.extends}this.configs.push({options:t,alias:r,loc:i,dirname:s});var o=void 0,l=n.env.BABEL_ENV||"production"||"development";t.env&&(o=t.env[l],delete t.env),this.mergeConfig({options:o,alias:r+".env."+l,dirname:s})},e}();e.exports=t.default}).call(t,r(8))},function(e,t,r){"use strict";function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var t in e){var r=e[t];if(null!=r){var n=o.default[t];if(n&&n.alias&&(n=o.default[n.alias]),n){var i=s[n.type];i&&(r=i(r)),e[t]=r}}}return e}t.__esModule=!0,t.config=void 0,t.normaliseOptions=n;var i=r(53),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i),a=r(33),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.config=o.default},function(e,t,r){"use strict";function n(e){return!!e}function i(e){return l.booleanify(e)}function s(e){return l.list(e)}t.__esModule=!0,t.filename=void 0,t.boolean=n,t.booleanString=i,t.list=s;var a=r(284),o=function(e){return e&&e.__esModule?e:{default:e}}(a),u=r(122),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(u);t.filename=o.default},function(e,t){"use strict";e.exports={auxiliaryComment:{message:"Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`"},blacklist:{message:"Put the specific transforms you want in the `plugins` option"},breakConfig:{message:"This is not a necessary option in Babel 6"},experimental:{message:"Put the specific transforms you want in the `plugins` option"},externalHelpers:{message:"Use the `external-helpers` plugin instead. Check out http://babeljs.io/docs/plugins/external-helpers/"},extra:{message:""},jsxPragma:{message:"use the `pragma` option in the `react-jsx` plugin . Check out http://babeljs.io/docs/plugins/transform-react-jsx/"},loose:{message:"Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option."},metadataUsedHelpers:{message:"Not required anymore as this is enabled by default"},modules:{message:"Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules"},nonStandard:{message:"Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. Also check out the react preset http://babeljs.io/docs/plugins/preset-react/"},optional:{message:"Put the specific transforms you want in the `plugins` option"},sourceMapName:{message:"Use the `sourceMapTarget` option"},stage:{message:"Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets"},whitelist:{message:"Put the specific transforms you want in the `plugins` option"}}},function(e,t,r){"use strict";var n=r(43),i=r(428),s=r(427),a=r(21),o=r(153),u=r(238),l={},c={},f=e.exports=function(e,t,r,f,p){var d,h,m,y,v=p?function(){return e}:u(e),g=n(r,f,t?2:1),b=0;if("function"!=typeof v)throw TypeError(e+" is not iterable!");if(s(v)){for(d=o(e.length);d>b;b++)if((y=t?g(a(h=e[b])[0],h[1]):g(e[b]))===l||y===c)return y}else for(m=v.call(e);!(h=m.next()).done;)if((y=i(m,g,h.value,t))===l||y===c)return y};f.BREAK=l,f.RETURN=c},function(e,t){"use strict";e.exports={}},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(95)("meta"),s=r(16),a=r(28),o=r(23).f,u=0,l=Object.isExtensible||function(){return!0},c=!r(27)(function(){return l(Object.preventExtensions({}))}),f=function(e){o(e,i,{value:{i:"O"+ ++u,w:{}}})},p=function(e,t){if(!s(e))return"symbol"==(void 0===e?"undefined":n(e))?e:("string"==typeof e?"S":"P")+e;if(!a(e,i)){if(!l(e))return"F";if(!t)return"E";f(e)}return e[i].i},d=function(e,t){if(!a(e,i)){if(!l(e))return!0;if(!t)return!1;f(e)}return e[i].w},h=function(e){return c&&m.NEED&&l(e)&&!a(e,i)&&f(e),e},m=e.exports={KEY:i,NEED:!1,fastKey:p,getWeak:d,onFreeze:h}},function(e,t,r){"use strict";var n=r(16);e.exports=function(e,t){if(!n(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,r){"use strict";r(440);for(var n=r(15),i=r(29),s=r(56),a=r(13)("toStringTag"),o="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u<o.length;u++){var l=o[u],c=n[l],f=c&&c.prototype;f&&!f[a]&&i(f,a,l),s[l]=s.Array}},function(e,t){"use strict";function r(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}e.exports=r},function(e,t,r){"use strict";function n(e){return"function"==typeof e?e:null==e?o:"object"==(void 0===e?"undefined":i(e))?u(e)?a(e[0],e[1]):s(e):l(e)}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=r(502),a=r(503),o=r(110),u=r(6),l=r(592);e.exports=n},function(e,t,r){"use strict";function n(e){return"symbol"==(void 0===e?"undefined":i(e))||a(e)&&s(e)==o}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=r(30),a=r(25),o="[object Symbol]";e.exports=n},function(e,t){"use strict";function r(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')}function n(e){var t=e.match(y);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function s(e){var r=e,s=n(e);if(s){if(!s.path)return e;r=s.path}for(var a,o=t.isAbsolute(r),u=r.split(/\/+/),l=0,c=u.length-1;c>=0;c--)a=u[c],"."===a?u.splice(c,1):".."===a?l++:l>0&&(""===a?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return r=u.join("/"),""===r&&(r=o?"/":"."),s?(s.path=r,i(s)):r}function a(e,t){""===e&&(e="."),""===t&&(t=".");var r=n(t),a=n(e);if(a&&(e=a.path||"/"),r&&!r.scheme)return a&&(r.scheme=a.scheme),i(r);if(r||t.match(v))return t;if(a&&!a.host&&!a.path)return a.host=t,i(a);var o="/"===t.charAt(0)?t:s(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=o,i(a)):o}function o(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==t.indexOf(e+"/");){var n=e.lastIndexOf("/");if(n<0)return t;if(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}function u(e){return e}function l(e){return f(e)?"$"+e:e}function c(e){return f(e)?e.slice(1):e}function f(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var r=t-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function p(e,t,r){var n=e.source-t.source;return 0!==n?n:0!==(n=e.originalLine-t.originalLine)?n:0!==(n=e.originalColumn-t.originalColumn)||r?n:0!==(n=e.generatedColumn-t.generatedColumn)?n:(n=e.generatedLine-t.generatedLine,0!==n?n:e.name-t.name)}function d(e,t,r){var n=e.generatedLine-t.generatedLine;return 0!==n?n:0!==(n=e.generatedColumn-t.generatedColumn)||r?n:0!==(n=e.source-t.source)?n:0!==(n=e.originalLine-t.originalLine)?n:(n=e.originalColumn-t.originalColumn,0!==n?n:e.name-t.name)}function h(e,t){return e===t?0:e>t?1:-1}function m(e,t){var r=e.generatedLine-t.generatedLine;return 0!==r?r:0!==(r=e.generatedColumn-t.generatedColumn)?r:0!==(r=h(e.source,t.source))?r:0!==(r=e.originalLine-t.originalLine)?r:(r=e.originalColumn-t.originalColumn,0!==r?r:h(e.name,t.name))}t.getArg=r;var y=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,v=/^data:.+\,.+$/;t.urlParse=n,t.urlGenerate=i,t.normalize=s,t.join=a,t.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(y)},t.relative=o;var g=function(){return!("__proto__"in Object.create(null))}();t.toSetString=g?u:l,t.fromSetString=g?u:c,t.compareByOriginalPositions=p,t.compareByGeneratedPositionsDeflated=d,t.compareByGeneratedPositionsInflated=m},function(e,t,r){(function(t){"use strict";function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function i(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}function s(e){return Object.prototype.toString.call(e)}function a(e){return!i(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}function o(e){if(x.isFunction(e)){if(_)return e.name;var t=e.toString(),r=t.match(C);return r&&r[1]}}function u(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function l(e){if(_||!x.isFunction(e))return x.inspect(e);var t=o(e);return"[Function"+(t?": "+t:"")+"]"}function c(e){return u(l(e.actual),128)+" "+e.operator+" "+u(l(e.expected),128)}function f(e,t,r,n,i){throw new D.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function p(e,t){e||f(e,!0,t,"==",D.ok)}function d(e,t,r,o){if(e===t)return!0;if(i(e)&&i(t))return 0===n(e,t);if(x.isDate(e)&&x.isDate(t))return e.getTime()===t.getTime();if(x.isRegExp(e)&&x.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"===(void 0===e?"undefined":E(e))||null!==t&&"object"===(void 0===t?"undefined":E(t))){if(a(e)&&a(t)&&s(e)===s(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===n(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(i(e)!==i(t))return!1;o=o||{actual:[],expected:[]};var u=o.actual.indexOf(e);return-1!==u&&u===o.expected.indexOf(t)||(o.actual.push(e),o.expected.push(t),m(e,t,r,o))}return r?e===t:e==t}function h(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function m(e,t,r,n){if(null===e||void 0===e||null===t||void 0===t)return!1;if(x.isPrimitive(e)||x.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=h(e),s=h(t);if(i&&!s||!i&&s)return!1;if(i)return e=S.call(e),t=S.call(t),d(e,t,r);var a,o,u=w(e),l=w(t);if(u.length!==l.length)return!1;for(u.sort(),l.sort(),o=u.length-1;o>=0;o--)if(u[o]!==l[o])return!1;for(o=u.length-1;o>=0;o--)if(a=u[o],!d(e[a],t[a],r,n))return!1;return!0}function y(e,t,r){d(e,t,!0)&&f(e,t,r,"notDeepStrictEqual",y)}function v(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function g(e){var t;try{e()}catch(e){t=e}return t}function b(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=g(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&f(i,r,"Missing expected exception"+n);var s="string"==typeof n,a=!e&&x.isError(i),o=!e&&i&&!r;if((a&&s&&v(i,r)||o)&&f(i,r,"Got unwanted exception"+n),e&&i&&r&&!v(i,r)||!e&&i)throw i}var E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x=r(117),A=Object.prototype.hasOwnProperty,S=Array.prototype.slice,_=function(){return"foo"===function(){}.name}(),D=e.exports=p,C=/\s*function\s+([^\(\s]*)\s*/;D.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=c(this),this.generatedMessage=!0);var t=e.stackStartFunction||f;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=o(t),s=n.indexOf("\n"+i);if(s>=0){var a=n.indexOf("\n",s+1);n=n.substring(a+1)}this.stack=n}}},x.inherits(D.AssertionError,Error),D.fail=f,D.ok=p,D.equal=function(e,t,r){e!=t&&f(e,t,r,"==",D.equal)},D.notEqual=function(e,t,r){e==t&&f(e,t,r,"!=",D.notEqual)},D.deepEqual=function(e,t,r){d(e,t,!1)||f(e,t,r,"deepEqual",D.deepEqual)},D.deepStrictEqual=function(e,t,r){d(e,t,!0)||f(e,t,r,"deepStrictEqual",D.deepStrictEqual)},D.notDeepEqual=function(e,t,r){d(e,t,!1)&&f(e,t,r,"notDeepEqual",D.notDeepEqual)},D.notDeepStrictEqual=y,D.strictEqual=function(e,t,r){e!==t&&f(e,t,r,"===",D.strictEqual)},D.notStrictEqual=function(e,t,r){e===t&&f(e,t,r,"!==",D.notStrictEqual)},D.throws=function(e,t,r){b(!0,e,t,r)},D.doesNotThrow=function(e,t,r){b(!1,e,t,r)},D.ifError=function(e){if(e)throw e};var w=Object.keys||function(e){var t=[];for(var r in e)A.call(e,r)&&t.push(r);return t}}).call(t,function(){return this}())},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),s=n(i),a=r(3),o=n(a),u=r(42),l=n(u),c=r(41),f=n(c),p=r(34),d=n(p),h=r(20),m=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(h),y=r(119),v=n(y),g=r(7),b=n(g),E=r(174),x=n(E),A=r(109),S=n(A),_=["enter","exit"],D=function(e){function t(r,n){(0,o.default)(this,t);var i=(0,l.default)(this,e.call(this));return i.initialized=!1,i.raw=(0,x.default)({},r),i.key=i.take("name")||n,i.manipulateOptions=i.take("manipulateOptions"),i.post=i.take("post"),i.pre=i.take("pre"),i.visitor=i.normaliseVisitor((0,S.default)(i.take("visitor"))||{}),i}return(0,f.default)(t,e),t.prototype.take=function(e){var t=this.raw[e];return delete this.raw[e],t},t.prototype.chain=function(e,t){if(!e[t])return this[t];if(!this[t])return e[t];var r=[e[t],this[t]];return function(){for(var e=void 0,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];for(var a=r,o=Array.isArray(a),u=0,a=o?a:(0,s.default)(a);;){var l;if(o){if(u>=a.length)break;l=a[u++]}else{if(u=a.next(),u.done)break;l=u.value}var c=l;if(c){var f=c.apply(this,n);null!=f&&(e=f)}}return e}},t.prototype.maybeInherit=function(e){var t=this.take("inherits");t&&(t=d.default.normalisePlugin(t,e,"inherits"),this.manipulateOptions=this.chain(t,"manipulateOptions"),this.post=this.chain(t,"post"),this.pre=this.chain(t,"pre"),this.visitor=b.default.visitors.merge([t.visitor,this.visitor]))},t.prototype.init=function(e,t){if(!this.initialized){this.initialized=!0,this.maybeInherit(e);for(var r in this.raw)throw new Error(m.get("pluginInvalidProperty",e,t,r))}},t.prototype.normaliseVisitor=function(e){for(var t=_,r=Array.isArray(t),n=0,t=r?t:(0,s.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}if(e[i])throw new Error("Plugins aren't allowed to specify catch-all enter/exit handlers. Please target individual nodes.")}return b.default.explode(e),e},t}(v.default);t.default=D,e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(2),i=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=function(e){var t=e.messages;return{visitor:{Scope:function(e){var r=e.scope;for(var n in r.bindings){var s=r.bindings[n];if("const"===s.kind||"module"===s.kind)for(var a=s.constantViolations,o=Array.isArray(a),u=0,a=o?a:(0,i.default)(a);;){var l;if(o){if(u>=a.length)break;l=a[u++]}else{if(u=a.next(),u.done)break;l=u.value}var c=l;throw c.buildCodeFrameError(t.get("readOnly",n))}}}}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("asyncFunctions")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){var t=e.types;return{visitor:{ArrowFunctionExpression:function(e,r){if(r.opts.spec){var n=e.node;if(n.shadow)return;n.shadow={this:!1},n.type="FunctionExpression";var i=t.thisExpression();i._forceShadow=e,e.ensureBlock(),e.get("body").unshiftContainer("body",t.expressionStatement(t.callExpression(r.addHelper("newArrowCheck"),[t.thisExpression(),i]))),e.replaceWith(t.callExpression(t.memberExpression(n,t.identifier("bind")),[t.thisExpression()]))}else e.arrowFunctionToShadowed()}}}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(2),i=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=function(e){function t(e,t){for(var n=t.get(e),s=n,a=Array.isArray(s),o=0,s=a?s:(0,i.default)(s);;){var u;if(a){if(o>=s.length)break;u=s[o++]}else{if(o=s.next(),o.done)break;u=o.value}var l=u,c=l.node;if(l.isFunctionDeclaration()){var f=r.variableDeclaration("let",[r.variableDeclarator(c.id,r.toExpression(c))]);f._blockHoist=2,c.id=null,l.replaceWith(f)}}}var r=e.types;return{visitor:{BlockStatement:function(e){var n=e.node,i=e.parent;r.isFunction(i,{body:n})||r.isExportDeclaration(i)||t("body",e)},SwitchCase:function(e){t("consequent",e)}}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){return b.isLoop(e.parent)||b.isCatchClause(e.parent)}function s(e){return!!b.isVariableDeclaration(e)&&(!!e[b.BLOCK_SCOPED_SYMBOL]||("let"===e.kind||"const"===e.kind))}function a(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(t||(t=e.node),!b.isFor(r))for(var s=0;s<t.declarations.length;s++){var a=t.declarations[s];a.init=a.init||n.buildUndefinedNode()}if(t[b.BLOCK_SCOPED_SYMBOL]=!0,t.kind="var",i){var o=n.getFunctionParent(),u=e.getBindingIdentifiers();for(var l in u){var c=n.getOwnBinding(l);c&&(c.kind="var"),n.moveBindingTo(l,o)}}}function o(e){return b.isVariableDeclaration(e,{kind:"var"})&&!s(e)}function u(e){return b.isBreakStatement(e)?"break":b.isContinueStatement(e)?"continue":void 0}t.__esModule=!0;var l=r(10),c=n(l),f=r(9),p=n(f),d=r(3),h=n(d);t.default=function(){return{visitor:{VariableDeclaration:function(e,t){var r=e.node,n=e.parent,i=e.scope;if(s(r)&&(a(e,null,n,i,!0),r._tdzThis)){for(var o=[r],u=0;u<r.declarations.length;u++){var l=r.declarations[u];if(l.init){var c=b.assignmentExpression("=",l.id,l.init);c._ignoreBlockScopingTDZ=!0,o.push(b.expressionStatement(c))}l.init=t.addHelper("temporalUndefined")}r._blockHoist=2,e.isCompletionRecord()&&o.push(b.expressionStatement(i.buildUndefinedNode())),e.replaceWithMultiple(o)}},Loop:function(e,t){var r=e.node,n=e.parent,i=e.scope;b.ensureBlock(r);var s=new B(e,e.get("body"),n,i,t),a=s.run();a&&e.replaceWith(a)},CatchClause:function(e,t){var r=e.parent,n=e.scope;new B(null,e.get("body"),r,n,t).run()},"BlockStatement|SwitchStatement|Program":function(e,t){if(!i(e)){new B(null,e,e.parent,e.scope,t).run()}}}}};var m=r(7),y=n(m),v=r(330),g=r(1),b=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(g),E=r(280),x=n(E),A=r(578),S=n(A),_=r(4),D=n(_),C=(0,D.default)('\n if (typeof RETURN === "object") return RETURN.v;\n'),w=y.default.visitors.merge([{Loop:{enter:function(e,t){t.loopDepth++},exit:function(e,t){t.loopDepth--}},Function:function(e,t){return t.loopDepth>0&&e.traverse(P,t),e.skip()}},v.visitor]),P=y.default.visitors.merge([{ReferencedIdentifier:function(e,t){var r=t.letReferences[e.node.name];if(r){var n=e.scope.getBindingIdentifier(e.node.name);n&&n!==r||(t.closurify=!0)}}},v.visitor]),k={enter:function(e,t){var r=e.node;e.parent;if(e.isForStatement()){if(o(r.init)){var n=t.pushDeclar(r.init);1===n.length?r.init=n[0]:r.init=b.sequenceExpression(n)}}else if(e.isFor())o(r.left)&&(t.pushDeclar(r.left),r.left=r.left.declarations[0].id);else if(o(r))e.replaceWithMultiple(t.pushDeclar(r).map(function(e){return b.expressionStatement(e)}));else if(e.isFunction())return e.skip()}},F={LabeledStatement:function(e,t){var r=e.node;t.innerLabels.push(r.label.name)}},T={enter:function(e,t){if(e.isAssignmentExpression()||e.isUpdateExpression()){var r=e.getBindingIdentifiers();for(var n in r)t.outsideReferences[n]===e.scope.getBindingIdentifier(n)&&(t.reassignments[n]=!0)}}},O={Loop:function(e,t){var r=t.ignoreLabeless;t.ignoreLabeless=!0,e.traverse(O,t),t.ignoreLabeless=r,e.skip()},Function:function(e){e.skip()},SwitchCase:function(e,t){var r=t.inSwitchCase;t.inSwitchCase=!0,e.traverse(O,t),t.inSwitchCase=r,e.skip()},"BreakStatement|ContinueStatement|ReturnStatement":function(e,t){var r=e.node,n=e.parent,i=e.scope;if(!r[this.LOOP_IGNORE]){var s=void 0,a=u(r);if(a){if(r.label){if(t.innerLabels.indexOf(r.label.name)>=0)return;a=a+"|"+r.label.name}else{if(t.ignoreLabeless)return;if(t.inSwitchCase)return;if(b.isBreakStatement(r)&&b.isSwitchCase(n))return}t.hasBreakContinue=!0,t.map[a]=r,s=b.stringLiteral(a)}e.isReturnStatement()&&(t.hasReturn=!0,s=b.objectExpression([b.objectProperty(b.identifier("v"),r.argument||i.buildUndefinedNode())])),s&&(s=b.returnStatement(s),s[this.LOOP_IGNORE]=!0,e.skip(),e.replaceWith(b.inherits(s,r)))}}},B=function(){function e(t,r,n,i,s){(0,h.default)(this,e),this.parent=n,this.scope=i,this.file=s,this.blockPath=r,this.block=r.node,this.outsideLetReferences=(0,p.default)(null),this.hasLetReferences=!1,this.letReferences=(0,p.default)(null),this.body=[],t&&(this.loopParent=t.parent,this.loopLabel=b.isLabeledStatement(this.loopParent)&&this.loopParent.label,this.loopPath=t,this.loop=t.node)}return e.prototype.run=function(){var e=this.block;if(!e._letDone){e._letDone=!0;var t=this.getLetReferences();if(b.isFunction(this.parent)||b.isProgram(this.block))return void this.updateScopeInfo();if(this.hasLetReferences)return t?this.wrapClosure():this.remap(),this.updateScopeInfo(t),this.loopLabel&&!b.isLabeledStatement(this.loopParent)?b.labeledStatement(this.loopLabel,this.loop):void 0}},e.prototype.updateScopeInfo=function(e){var t=this.scope,r=t.getFunctionParent(),n=this.letReferences;for(var i in n){var s=n[i],a=t.getBinding(s.name);a&&("let"!==a.kind&&"const"!==a.kind||(a.kind="var",e?t.removeBinding(s.name):t.moveBindingTo(s.name,r)))}},e.prototype.remap=function(){var e=this.letReferences,t=this.scope;for(var r in e){var n=e[r];(t.parentHasBinding(r)||t.hasGlobal(r))&&(t.hasOwnBinding(r)&&t.rename(n.name),this.blockPath.scope.hasOwnBinding(r)&&this.blockPath.scope.rename(n.name))}},e.prototype.wrapClosure=function(){if(this.file.opts.throwIfClosureRequired)throw this.blockPath.buildCodeFrameError("Compiling let/const in this block would add a closure (throwIfClosureRequired).");var e=this.block,t=this.outsideLetReferences;if(this.loop)for(var r in t){var n=t[r];(this.scope.hasGlobal(n.name)||this.scope.parentHasBinding(n.name))&&(delete t[n.name],delete this.letReferences[n.name],this.scope.rename(n.name),this.letReferences[n.name]=n,t[n.name]=n)}this.has=this.checkLoop(),this.hoistVarDeclarations();var i=(0,x.default)(t),s=(0,x.default)(t),a=this.blockPath.isSwitchStatement(),o=b.functionExpression(null,i,b.blockStatement(a?[e]:e.body));o.shadow=!0,this.addContinuations(o);var u=o;this.loop&&(u=this.scope.generateUidIdentifier("loop"),this.loopPath.insertBefore(b.variableDeclaration("var",[b.variableDeclarator(u,o)])));var l=b.callExpression(u,s),c=this.scope.generateUidIdentifier("ret");y.default.hasType(o.body,this.scope,"YieldExpression",b.FUNCTION_TYPES)&&(o.generator=!0,l=b.yieldExpression(l,!0)),y.default.hasType(o.body,this.scope,"AwaitExpression",b.FUNCTION_TYPES)&&(o.async=!0,l=b.awaitExpression(l)),this.buildClosure(c,l),a?this.blockPath.replaceWithMultiple(this.body):e.body=this.body},e.prototype.buildClosure=function(e,t){var r=this.has;r.hasReturn||r.hasBreakContinue?this.buildHas(e,t):this.body.push(b.expressionStatement(t))},e.prototype.addContinuations=function(e){var t={reassignments:{},outsideReferences:this.outsideLetReferences};this.scope.traverse(e,T,t);for(var r=0;r<e.params.length;r++){var n=e.params[r];if(t.reassignments[n.name]){var i=this.scope.generateUidIdentifier(n.name);e.params[r]=i,this.scope.rename(n.name,i.name,e),e.body.body.push(b.expressionStatement(b.assignmentExpression("=",n,i)))}}},e.prototype.getLetReferences=function(){var e=this,t=this.block,r=[];if(this.loop){var n=this.loop.left||this.loop.init;s(n)&&(r.push(n),(0,S.default)(this.outsideLetReferences,b.getBindingIdentifiers(n)))}var i=function n(i,o){o=o||i.node,(b.isClassDeclaration(o)||b.isFunctionDeclaration(o)||s(o))&&(s(o)&&a(i,o,t,e.scope),r=r.concat(o.declarations||o)),b.isLabeledStatement(o)&&n(i.get("body"),o.body)};if(t.body)for(var o=0;o<t.body.length;o++){var u=this.blockPath.get("body")[o];i(u)}if(t.cases)for(var l=0;l<t.cases.length;l++)for(var c=t.cases[l].consequent,f=0;f<c.length;f++){var p=this.blockPath.get("cases")[l],d=c[f];i(p,d)}for(var h=0;h<r.length;h++){var m=r[h],y=b.getBindingIdentifiers(m,!1,!0);(0,S.default)(this.letReferences,y),this.hasLetReferences=!0}if(this.hasLetReferences){var v={letReferences:this.letReferences,closurify:!1,file:this.file,loopDepth:0},g=this.blockPath.find(function(e){return e.isLoop()||e.isFunction()});return g&&g.isLoop()&&v.loopDepth++,this.blockPath.traverse(w,v),v.closurify}},e.prototype.checkLoop=function(){var e={hasBreakContinue:!1,ignoreLabeless:!1,inSwitchCase:!1,innerLabels:[],hasReturn:!1,isLoop:!!this.loop,map:{},LOOP_IGNORE:(0,c.default)()};return this.blockPath.traverse(F,e),this.blockPath.traverse(O,e),e},e.prototype.hoistVarDeclarations=function(){this.blockPath.traverse(k,this)},e.prototype.pushDeclar=function(e){var t=[],r=b.getBindingIdentifiers(e);for(var n in r)t.push(b.variableDeclarator(r[n]));this.body.push(b.variableDeclaration(e.kind,t));for(var i=[],s=0;s<e.declarations.length;s++){var a=e.declarations[s];if(a.init){var o=b.assignmentExpression("=",a.id,a.init);i.push(b.inherits(o,a))}}return i},e.prototype.buildHas=function(e,t){var r=this.body;r.push(b.variableDeclaration("var",[b.variableDeclarator(e,t)]));var n=void 0,i=this.has,s=[];if(i.hasReturn&&(n=C({RETURN:e})),i.hasBreakContinue){for(var a in i.map)s.push(b.switchCase(b.stringLiteral(a),[i.map[a]]));if(i.hasReturn&&s.push(b.switchCase(null,[n])),1===s.length){var o=s[0];r.push(b.ifStatement(b.binaryExpression("===",e,o.test),o.consequent[0]))}else{if(this.loop)for(var u=0;u<s.length;u++){var l=s[u].consequent[0];b.isBreakStatement(l)&&!l.label&&(l.label=this.loopLabel=this.loopLabel||this.scope.generateUidIdentifier("loop"))}r.push(b.switchStatement(e,s))}}else i.hasReturn&&r.push(n)},e}();e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(10),s=n(i);t.default=function(e){var t=e.types,r=(0,s.default)();return{visitor:{ExportDefaultDeclaration:function(e){if(e.get("declaration").isClassDeclaration()){var r=e.node,n=r.declaration.id||e.scope.generateUidIdentifier("class");r.declaration.id=n,e.replaceWith(r.declaration),e.insertAfter(t.exportDefaultDeclaration(n))}},ClassDeclaration:function(e){var r=e.node,n=r.id||e.scope.generateUidIdentifier("class");e.replaceWith(t.variableDeclaration("let",[t.variableDeclarator(n,t.toExpression(r))]))},ClassExpression:function(e,t){var n=e.node;if(!n[r]){var i=(0,f.default)(e);if(i&&i!==n)return e.replaceWith(i);n[r]=!0;var s=l.default;t.opts.loose&&(s=o.default),e.replaceWith(new s(e,t.file).run())}}}}};var a=r(331),o=n(a),u=r(207),l=n(u),c=r(40),f=n(c);e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(2),i=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=function(e){function t(e){return o.isObjectProperty(e)?e.value:o.isObjectMethod(e)?o.functionExpression(null,e.params,e.body,e.generator,e.async):void 0}function r(e,r,i){"get"===r.kind&&"set"===r.kind?n(e,r,i):i.push(o.expressionStatement(o.assignmentExpression("=",o.memberExpression(e,r.key,r.computed||o.isLiteral(r.key)),t(r))))}function n(e,r){var n=(e.objId,e.body),i=e.getMutatorId,s=e.scope,a=!r.computed&&o.isIdentifier(r.key)?o.stringLiteral(r.key.name):r.key,u=s.maybeGenerateMemoised(a);u&&(n.push(o.expressionStatement(o.assignmentExpression("=",u,a))),a=u),n.push.apply(n,l({MUTATOR_MAP_REF:i(),KEY:a,VALUE:t(r),KIND:o.identifier(r.kind)}))}function s(e){for(var t=e.computedProps,s=Array.isArray(t),a=0,t=s?t:(0,i.default)(t);;){var o;if(s){if(a>=t.length)break;o=t[a++]}else{if(a=t.next(),a.done)break;o=a.value}var u=o;"get"===u.kind||"set"===u.kind?n(e,u):r(e.objId,u,e.body)}}function a(e){for(var s=e.objId,a=e.body,u=e.computedProps,l=e.state,c=u,f=Array.isArray(c),p=0,c=f?c:(0,i.default)(c);;){var d;if(f){if(p>=c.length)break;d=c[p++]}else{if(p=c.next(),p.done)break;d=p.value}var h=d,m=o.toComputedKey(h);if("get"===h.kind||"set"===h.kind)n(e,h);else if(o.isStringLiteral(m,{value:"__proto__"}))r(s,h,a);else{if(1===u.length)return o.callExpression(l.addHelper("defineProperty"),[e.initPropExpression,m,t(h)]);a.push(o.expressionStatement(o.callExpression(l.addHelper("defineProperty"),[s,m,t(h)])))}}}var o=e.types,u=e.template,l=u("\n MUTATOR_MAP_REF[KEY] = MUTATOR_MAP_REF[KEY] || {};\n MUTATOR_MAP_REF[KEY].KIND = VALUE;\n ");return{visitor:{ObjectExpression:{exit:function(e,t){for(var r=e.node,n=e.parent,u=e.scope,l=!1,c=r.properties,f=Array.isArray(c),p=0,c=f?c:(0,i.default)(c);;){var d;if(f){if(p>=c.length)break;d=c[p++]}else{if(p=c.next(),p.done)break;d=p.value}if(l=!0===d.computed)break}if(l){for(var h=[],m=[],y=!1,v=r.properties,g=Array.isArray(v),b=0,v=g?v:(0,i.default)(v);;){var E;if(g){if(b>=v.length)break;E=v[b++]}else{if(b=v.next(),b.done)break;E=b.value}var x=E;x.computed&&(y=!0),y?m.push(x):h.push(x)}var A=u.generateUidIdentifierBasedOnNode(n),S=o.objectExpression(h),_=[];_.push(o.variableDeclaration("var",[o.variableDeclarator(A,S)]));var D=a;t.opts.loose&&(D=s);var C=void 0,w=function(){return C||(C=u.generateUidIdentifier("mutatorMap"),_.push(o.variableDeclaration("var",[o.variableDeclarator(C,o.objectExpression([]))]))),C},P=D({scope:u,objId:A,body:_,computedProps:m,initPropExpression:S,getMutatorId:w,state:t});C&&_.push(o.expressionStatement(o.callExpression(t.addHelper("defineEnumerableProperties"),[A,C]))),P?e.replaceWith(P):(_.push(o.expressionStatement(A)),e.replaceWithMultiple(_))}}}}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(3),s=n(i),a=r(2),o=n(a);t.default=function(e){function t(e){for(var t=e.declarations,r=Array.isArray(t),i=0,t=r?t:(0,o.default)(t);;){var s;if(r){if(i>=t.length)break;s=t[i++]}else{if(i=t.next(),i.done)break;s=i.value}var a=s;if(n.isPattern(a.id))return!0}return!1}function r(e){for(var t=e.elements,r=Array.isArray(t),i=0,t=r?t:(0,o.default)(t);;){var s;if(r){if(i>=t.length)break;s=t[i++]}else{if(i=t.next(),i.done)break;s=i.value}var a=s;if(n.isRestElement(a))return!0}return!1}var n=e.types,i={ReferencedIdentifier:function(e,t){t.bindings[e.node.name]&&(t.deopt=!0,e.stop())}},a=function(){function e(t){(0,s.default)(this,e),this.blockHoist=t.blockHoist,this.operator=t.operator,this.arrays={},this.nodes=t.nodes||[],this.scope=t.scope,this.file=t.file,this.kind=t.kind} return e.prototype.buildVariableAssignment=function(e,t){var r=this.operator;n.isMemberExpression(e)&&(r="=");var i=void 0;return i=r?n.expressionStatement(n.assignmentExpression(r,e,t)):n.variableDeclaration(this.kind,[n.variableDeclarator(e,t)]),i._blockHoist=this.blockHoist,i},e.prototype.buildVariableDeclaration=function(e,t){var r=n.variableDeclaration("var",[n.variableDeclarator(e,t)]);return r._blockHoist=this.blockHoist,r},e.prototype.push=function(e,t){n.isObjectPattern(e)?this.pushObjectPattern(e,t):n.isArrayPattern(e)?this.pushArrayPattern(e,t):n.isAssignmentPattern(e)?this.pushAssignmentPattern(e,t):this.nodes.push(this.buildVariableAssignment(e,t))},e.prototype.toArray=function(e,t){return this.file.opts.loose||n.isIdentifier(e)&&this.arrays[e.name]?e:this.scope.toArray(e,t)},e.prototype.pushAssignmentPattern=function(e,t){var r=this.scope.generateUidIdentifierBasedOnNode(t),i=n.variableDeclaration("var",[n.variableDeclarator(r,t)]);i._blockHoist=this.blockHoist,this.nodes.push(i);var s=n.conditionalExpression(n.binaryExpression("===",r,n.identifier("undefined")),e.right,r),a=e.left;if(n.isPattern(a)){var o=n.expressionStatement(n.assignmentExpression("=",r,s));o._blockHoist=this.blockHoist,this.nodes.push(o),this.push(a,r)}else this.nodes.push(this.buildVariableAssignment(a,s))},e.prototype.pushObjectRest=function(e,t,r,i){for(var s=[],a=0;a<e.properties.length;a++){var o=e.properties[a];if(a>=i)break;if(!n.isRestProperty(o)){var u=o.key;n.isIdentifier(u)&&!o.computed&&(u=n.stringLiteral(o.key.name)),s.push(u)}}s=n.arrayExpression(s);var l=n.callExpression(this.file.addHelper("objectWithoutProperties"),[t,s]);this.nodes.push(this.buildVariableAssignment(r.argument,l))},e.prototype.pushObjectProperty=function(e,t){n.isLiteral(e.key)&&(e.computed=!0);var r=e.value,i=n.memberExpression(t,e.key,e.computed);n.isPattern(r)?this.push(r,i):this.nodes.push(this.buildVariableAssignment(r,i))},e.prototype.pushObjectPattern=function(e,t){if(e.properties.length||this.nodes.push(n.expressionStatement(n.callExpression(this.file.addHelper("objectDestructuringEmpty"),[t]))),e.properties.length>1&&!this.scope.isStatic(t)){var r=this.scope.generateUidIdentifierBasedOnNode(t);this.nodes.push(this.buildVariableDeclaration(r,t)),t=r}for(var i=0;i<e.properties.length;i++){var s=e.properties[i];n.isRestProperty(s)?this.pushObjectRest(e,t,s,i):this.pushObjectProperty(s,t)}},e.prototype.canUnpackArrayPattern=function(e,t){if(!n.isArrayExpression(t))return!1;if(!(e.elements.length>t.elements.length)){if(e.elements.length<t.elements.length&&!r(e))return!1;for(var s=e.elements,a=Array.isArray(s),u=0,s=a?s:(0,o.default)(s);;){var l;if(a){if(u>=s.length)break;l=s[u++]}else{if(u=s.next(),u.done)break;l=u.value}var c=l;if(!c)return!1;if(n.isMemberExpression(c))return!1}for(var f=t.elements,p=Array.isArray(f),d=0,f=p?f:(0,o.default)(f);;){var h;if(p){if(d>=f.length)break;h=f[d++]}else{if(d=f.next(),d.done)break;h=d.value}var m=h;if(n.isSpreadElement(m))return!1;if(n.isCallExpression(m))return!1;if(n.isMemberExpression(m))return!1}var y=n.getBindingIdentifiers(e),v={deopt:!1,bindings:y};return this.scope.traverse(t,i,v),!v.deopt}},e.prototype.pushUnpackedArrayPattern=function(e,t){for(var r=0;r<e.elements.length;r++){var i=e.elements[r];n.isRestElement(i)?this.push(i.argument,n.arrayExpression(t.elements.slice(r))):this.push(i,t.elements[r])}},e.prototype.pushArrayPattern=function(e,t){if(e.elements){if(this.canUnpackArrayPattern(e,t))return this.pushUnpackedArrayPattern(e,t);var i=!r(e)&&e.elements.length,s=this.toArray(t,i);n.isIdentifier(s)?t=s:(t=this.scope.generateUidIdentifierBasedOnNode(t),this.arrays[t.name]=!0,this.nodes.push(this.buildVariableDeclaration(t,s)));for(var a=0;a<e.elements.length;a++){var o=e.elements[a];if(o){var u=void 0;n.isRestElement(o)?(u=this.toArray(t),u=n.callExpression(n.memberExpression(u,n.identifier("slice")),[n.numericLiteral(a)]),o=o.argument):u=n.memberExpression(t,n.numericLiteral(a),!0),this.push(o,u)}}}},e.prototype.init=function(e,t){if(!n.isArrayExpression(t)&&!n.isMemberExpression(t)){var r=this.scope.maybeGenerateMemoised(t,!0);r&&(this.nodes.push(this.buildVariableDeclaration(r,t)),t=r)}return this.push(e,t),this.nodes},e}();return{visitor:{ExportNamedDeclaration:function(e){var r=e.get("declaration");if(r.isVariableDeclaration()&&t(r.node)){var i=[];for(var s in e.getOuterBindingIdentifiers(e)){var a=n.identifier(s);i.push(n.exportSpecifier(a,a))}e.replaceWith(r.node),e.insertAfter(n.exportNamedDeclaration(null,i))}},ForXStatement:function(e,t){var r=e.node,i=e.scope,s=r.left;if(n.isPattern(s)){var o=i.generateUidIdentifier("ref");return r.left=n.variableDeclaration("var",[n.variableDeclarator(o)]),e.ensureBlock(),void r.body.body.unshift(n.variableDeclaration("var",[n.variableDeclarator(s,o)]))}if(n.isVariableDeclaration(s)){var u=s.declarations[0].id;if(n.isPattern(u)){var l=i.generateUidIdentifier("ref");r.left=n.variableDeclaration(s.kind,[n.variableDeclarator(l,null)]);var c=[];new a({kind:s.kind,file:t,scope:i,nodes:c}).init(u,l),e.ensureBlock();var f=r.body;f.body=c.concat(f.body)}}},CatchClause:function(e,t){var r=e.node,i=e.scope,s=r.param;if(n.isPattern(s)){var o=i.generateUidIdentifier("ref");r.param=o;var u=[];new a({kind:"let",file:t,scope:i,nodes:u}).init(s,o),r.body.body=u.concat(r.body.body)}},AssignmentExpression:function(e,t){var r=e.node,i=e.scope;if(n.isPattern(r.left)){var s=[],o=new a({operator:r.operator,file:t,scope:i,nodes:s}),u=void 0;!e.isCompletionRecord()&&e.parentPath.isExpressionStatement()||(u=i.generateUidIdentifierBasedOnNode(r.right,"ref"),s.push(n.variableDeclaration("var",[n.variableDeclarator(u,r.right)])),n.isArrayExpression(r.right)&&(o.arrays[u.name]=!0)),o.init(r.left,u||r.right),u&&s.push(n.expressionStatement(u)),e.replaceWithMultiple(s)}},VariableDeclaration:function(e,r){var i=e.node,s=e.scope,u=e.parent;if(!n.isForXStatement(u)&&u&&e.container&&t(i)){for(var l=[],c=void 0,f=0;f<i.declarations.length;f++){c=i.declarations[f];var p=c.init,d=c.id,h=new a({blockHoist:i._blockHoist,nodes:l,scope:s,kind:i.kind,file:r});n.isPattern(d)?(h.init(d,p),+f!=i.declarations.length-1&&n.inherits(l[l.length-1],c)):l.push(n.inherits(h.buildVariableAssignment(c.id,c.init),c))}for(var m=[],y=l,v=Array.isArray(y),g=0,y=v?y:(0,o.default)(y);;){var b;if(v){if(g>=y.length)break;b=y[g++]}else{if(g=y.next(),g.done)break;b=g.value}var E=b,x=m[m.length-1];if(x&&n.isVariableDeclaration(x)&&n.isVariableDeclaration(E)&&x.kind===E.kind){var A;(A=x.declarations).push.apply(A,E.declarations)}else m.push(E)}for(var S=m,_=Array.isArray(S),D=0,S=_?S:(0,o.default)(S);;){var C;if(_){if(D>=S.length)break;C=S[D++]}else{if(D=S.next(),D.done)break;C=D.value}var w=C;if(w.declarations)for(var P=w.declarations,k=Array.isArray(P),F=0,P=k?P:(0,o.default)(P);;){var T;if(k){if(F>=P.length)break;T=P[F++]}else{if(F=P.next(),F.done)break;T=F.value}var O=T,B=O.id.name;s.bindings[B]&&(s.bindings[B].kind=w.kind)}}1===m.length?e.replaceWith(m[0]):e.replaceWithMultiple(m)}}}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){function t(e){var t=e.node,r=e.scope,n=[],i=t.right;if(!a.isIdentifier(i)||!r.hasBinding(i.name)){var s=r.generateUidIdentifier("arr");n.push(a.variableDeclaration("var",[a.variableDeclarator(s,i)])),i=s}var u=r.generateUidIdentifier("i"),l=o({BODY:t.body,KEY:u,ARR:i});a.inherits(l,t),a.ensureBlock(l);var c=a.memberExpression(i,u,!0),f=t.left;return a.isVariableDeclaration(f)?(f.declarations[0].init=c,l.body.body.unshift(f)):l.body.body.unshift(a.expressionStatement(a.assignmentExpression("=",f,c))),e.parentPath.isLabeledStatement()&&(l=a.labeledStatement(e.parentPath.node.label,l)),n.push(l),n}function r(e,t){var r=e.node,n=e.scope,s=e.parent,o=r.left,l=void 0,c=void 0;if(a.isIdentifier(o)||a.isPattern(o)||a.isMemberExpression(o))c=o;else{if(!a.isVariableDeclaration(o))throw t.buildCodeFrameError(o,i.get("unknownForHead",o.type));c=n.generateUidIdentifier("ref"),l=a.variableDeclaration(o.kind,[a.variableDeclarator(o.declarations[0].id,c)])}var f=n.generateUidIdentifier("iterator"),p=n.generateUidIdentifier("isArray"),d=u({LOOP_OBJECT:f,IS_ARRAY:p,OBJECT:r.right,INDEX:n.generateUidIdentifier("i"),ID:c});l||d.body.body.shift();var h=a.isLabeledStatement(s),m=void 0;return h&&(m=a.labeledStatement(s.label,d)),{replaceParent:h,declar:l,node:m||d,loop:d}}function n(e,t){var r=e.node,n=e.scope,s=e.parent,o=r.left,u=void 0,c=n.generateUidIdentifier("step"),f=a.memberExpression(c,a.identifier("value"));if(a.isIdentifier(o)||a.isPattern(o)||a.isMemberExpression(o))u=a.expressionStatement(a.assignmentExpression("=",o,f));else{if(!a.isVariableDeclaration(o))throw t.buildCodeFrameError(o,i.get("unknownForHead",o.type));u=a.variableDeclaration(o.kind,[a.variableDeclarator(o.declarations[0].id,f)])}var p=n.generateUidIdentifier("iterator"),d=l({ITERATOR_HAD_ERROR_KEY:n.generateUidIdentifier("didIteratorError"),ITERATOR_COMPLETION:n.generateUidIdentifier("iteratorNormalCompletion"),ITERATOR_ERROR_KEY:n.generateUidIdentifier("iteratorError"),ITERATOR_KEY:p,STEP_KEY:c,OBJECT:r.right,BODY:null}),h=a.isLabeledStatement(s),m=d[3].block.body,y=m[0];return h&&(m[0]=a.labeledStatement(s.label,y)),{replaceParent:h,declar:u,loop:y,node:d}}var i=e.messages,s=e.template,a=e.types,o=s("\n for (var KEY = 0; KEY < ARR.length; KEY++) BODY;\n "),u=s("\n for (var LOOP_OBJECT = OBJECT,\n IS_ARRAY = Array.isArray(LOOP_OBJECT),\n INDEX = 0,\n LOOP_OBJECT = IS_ARRAY ? LOOP_OBJECT : LOOP_OBJECT[Symbol.iterator]();;) {\n var ID;\n if (IS_ARRAY) {\n if (INDEX >= LOOP_OBJECT.length) break;\n ID = LOOP_OBJECT[INDEX++];\n } else {\n INDEX = LOOP_OBJECT.next();\n if (INDEX.done) break;\n ID = INDEX.value;\n }\n }\n "),l=s("\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY = undefined;\n try {\n for (var ITERATOR_KEY = OBJECT[Symbol.iterator](), STEP_KEY; !(ITERATOR_COMPLETION = (STEP_KEY = ITERATOR_KEY.next()).done); ITERATOR_COMPLETION = true) {\n }\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return) {\n ITERATOR_KEY.return();\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n ");return{visitor:{ForOfStatement:function(e,i){if(e.get("right").isArrayExpression())return e.parentPath.isLabeledStatement()?e.parentPath.replaceWithMultiple(t(e)):e.replaceWithMultiple(t(e));var s=n;i.opts.loose&&(s=r);var o=e.node,u=s(e,i),l=u.declar,c=u.loop,f=c.body;e.ensureBlock(),l&&f.body.push(l),f.body=f.body.concat(o.body.body),a.inherits(c,o),a.inherits(c.body,o.body),u.replaceParent?(e.parentPath.replaceWithMultiple(u.node),e.remove()):e.replaceWithMultiple(u.node)}}}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(){return{visitor:{FunctionExpression:{exit:function(e){if("value"!==e.key&&!e.parentPath.isObjectProperty()){var t=(0,i.default)(e);t&&e.replaceWith(t)}}},ObjectProperty:function(e){var t=e.get("value");if(t.isFunction()){var r=(0,i.default)(t);r&&t.replaceWith(r)}}}}};var n=r(40),i=function(e){return e&&e.__esModule?e:{default:e}}(n);e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{visitor:{NumericLiteral:function(e){var t=e.node;t.extra&&/^0[ob]/i.test(t.extra.raw)&&(t.extra=void 0)},StringLiteral:function(e){var t=e.node;t.extra&&/\\[u]/gi.test(t.extra.raw)&&(t.extra=void 0)}}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(14),s=n(i),a=r(9),o=n(a),u=r(2),l=n(u),c=r(10),f=n(c);t.default=function(){var e=(0,f.default)(),t={ReferencedIdentifier:function(e){var t=e.node.name,r=this.remaps[t];if(r&&this.scope.getBinding(t)===e.scope.getBinding(t)){if(e.parentPath.isCallExpression({callee:e.node}))e.replaceWith(g.sequenceExpression([g.numericLiteral(0),r]));else if(e.isJSXIdentifier()&&g.isMemberExpression(r)){var n=r.object,i=r.property;e.replaceWith(g.JSXMemberExpression(g.JSXIdentifier(n.name),g.JSXIdentifier(i.name)))}else e.replaceWith(r);this.requeueInParent(e)}},AssignmentExpression:function(t){var r=t.node;if(!r[e]){var n=t.get("left");if(n.isIdentifier()){var i=n.node.name,s=this.exports[i];if(!s)return;if(this.scope.getBinding(i)!==t.scope.getBinding(i))return;r[e]=!0;for(var a=s,o=Array.isArray(a),u=0,a=o?a:(0,l.default)(a);;){var c;if(o){if(u>=a.length)break;c=a[u++]}else{if(u=a.next(),u.done)break;c=u.value}r=S(c,r).expression}t.replaceWith(r),this.requeueInParent(t)}else if(n.isObjectPattern())for(var f=n.node.properties,p=Array.isArray(f),d=0,f=p?f:(0,l.default)(f);;){var h;if(p){if(d>=f.length)break;h=f[d++]}else{if(d=f.next(),d.done)break;h=d.value}var m=h,y=m.value.name,v=this.exports[y];if(v){if(this.scope.getBinding(y)!==t.scope.getBinding(y))return;r[e]=!0,t.insertAfter(S(g.identifier(y),g.identifier(y)))}}else if(n.isArrayPattern())for(var b=n.node.elements,E=Array.isArray(b),x=0,b=E?b:(0,l.default)(b);;){var A;if(E){if(x>=b.length)break;A=b[x++]}else{if(x=b.next(),x.done)break;A=x.value}var _=A;if(_){var D=_.name,C=this.exports[D];if(C){if(this.scope.getBinding(D)!==t.scope.getBinding(D))return;r[e]=!0,t.insertAfter(S(g.identifier(D),g.identifier(D)))}}}}},UpdateExpression:function(e){var t=e.get("argument");if(t.isIdentifier()){var r=t.node.name;if(this.exports[r]&&this.scope.getBinding(r)===e.scope.getBinding(r)){var n=g.assignmentExpression(e.node.operator[0]+"=",t.node,g.numericLiteral(1));if(e.parentPath.isExpressionStatement()&&!e.isCompletionRecord()||e.node.prefix)return e.replaceWith(n),void this.requeueInParent(e);var i=[];i.push(n);var s=void 0;s="--"===e.node.operator?"+":"-",i.push(g.binaryExpression(s,t.node,g.numericLiteral(1))),e.replaceWithMultiple(g.sequenceExpression(i))}}}};return{inherits:y.default,visitor:{ThisExpression:function(e,t){this.ranCommonJS||!0===t.opts.allowTopLevelThis||e.findParent(function(e){return!e.is("shadow")&&D.indexOf(e.type)>=0})||e.replaceWith(g.identifier("undefined"))},Program:{exit:function(e){function r(t,r){var n=C[t];if(n)return n;var i=e.scope.generateUidIdentifier((0,p.basename)(t,(0,p.extname)(t))),s=g.variableDeclaration("var",[g.variableDeclarator(i,b(g.stringLiteral(t)).expression)]);return h[t]&&(s.loc=h[t].loc),"number"==typeof r&&r>0&&(s._blockHoist=r),v.push(s),C[t]=i}function n(e,t,r){var n=e[t]||[];e[t]=n.concat(r)}this.ranCommonJS=!0;var i=!!this.opts.strict,a=!!this.opts.noInterop,u=e.scope;u.rename("module"),u.rename("exports"),u.rename("require");for(var c=!1,f=!1,d=e.get("body"),h=(0,o.default)(null),m=(0,o.default)(null),y=(0,o.default)(null),v=[],D=(0,o.default)(null),C=(0,o.default)(null),w=d,P=Array.isArray(w),k=0,w=P?w:(0,l.default)(w);;){var F;if(P){if(k>=w.length)break;F=w[k++]}else{if(k=w.next(),k.done)break;F=k.value}var T=F;if(T.isExportDeclaration()){c=!0;for(var O=[].concat(T.get("declaration"),T.get("specifiers")),B=O,R=Array.isArray(B),I=0,B=R?B:(0,l.default)(B);;){var M;if(R){if(I>=B.length)break;M=B[I++]}else{if(I=B.next(),I.done)break;M=I.value}var N=M;if(N.getBindingIdentifiers().__esModule)throw N.buildCodeFrameError('Illegal export "__esModule"')}}if(T.isImportDeclaration()){var L;f=!0;var j=T.node.source.value,U=h[j]||{specifiers:[],maxBlockHoist:0,loc:T.node.loc};(L=U.specifiers).push.apply(L,T.node.specifiers),"number"==typeof T.node._blockHoist&&(U.maxBlockHoist=Math.max(T.node._blockHoist,U.maxBlockHoist)),h[j]=U,T.remove()}else if(T.isExportDefaultDeclaration()){var V=T.get("declaration");if(V.isFunctionDeclaration()){var G=V.node.id,W=g.identifier("default");G?(n(m,G.name,W),v.push(S(W,G)),T.replaceWith(V.node)):(v.push(S(W,g.toExpression(V.node))),T.remove())}else if(V.isClassDeclaration()){var Y=V.node.id,q=g.identifier("default");Y?(n(m,Y.name,q),T.replaceWithMultiple([V.node,S(q,Y)])):(T.replaceWith(S(q,g.toExpression(V.node))),T.parentPath.requeue(T.get("expression.left")))}else T.replaceWith(S(g.identifier("default"),V.node)),T.parentPath.requeue(T.get("expression.left"))}else if(T.isExportNamedDeclaration()){var K=T.get("declaration");if(K.node){if(K.isFunctionDeclaration()){var H=K.node.id;n(m,H.name,H),v.push(S(H,H)),T.replaceWith(K.node)}else if(K.isClassDeclaration()){var J=K.node.id;n(m,J.name,J),T.replaceWithMultiple([K.node,S(J,J)]),y[J.name]=!0}else if(K.isVariableDeclaration()){for(var X=K.get("declarations"),z=X,$=Array.isArray(z),Q=0,z=$?z:(0,l.default)(z);;){var Z;if($){if(Q>=z.length)break;Z=z[Q++]}else{if(Q=z.next(),Q.done)break;Z=Q.value}var ee=Z,te=ee.get("id"),re=ee.get("init"),ne=[];if(re.node||re.replaceWith(g.identifier("undefined")),te.isIdentifier())n(m,te.node.name,te.node),re.replaceWith(S(te.node,re.node).expression),y[te.node.name]=!0;else if(te.isObjectPattern())for(var ie=0;ie<te.node.properties.length;ie++){var se=te.node.properties[ie],ae=se.value;g.isAssignmentPattern(ae)?ae=ae.left:g.isRestProperty(se)&&(ae=se.argument),n(m,ae.name,ae),ne.push(S(ae,ae)),y[ae.name]=!0}else if(te.isArrayPattern()&&te.node.elements)for(var oe=0;oe<te.node.elements.length;oe++){var ue=te.node.elements[oe];if(ue){g.isAssignmentPattern(ue)?ue=ue.left:g.isRestElement(ue)&&(ue=ue.argument);var le=ue.name;n(m,le,ue),ne.push(S(ue,ue)),y[le]=!0}}T.insertAfter(ne)}T.replaceWith(K.node)}continue}var ce=T.get("specifiers"),fe=[],pe=T.node.source;if(pe)for(var de=r(pe.value,T.node._blockHoist),he=ce,me=Array.isArray(he),ye=0,he=me?he:(0,l.default)(he);;){var ve;if(me){if(ye>=he.length)break;ve=he[ye++]}else{if(ye=he.next(),ye.done)break;ve=ye.value}var ge=ve;ge.isExportNamespaceSpecifier()||ge.isExportDefaultSpecifier()||ge.isExportSpecifier()&&(a||"default"!==ge.node.local.name?v.push(x(g.stringLiteral(ge.node.exported.name),g.memberExpression(de,ge.node.local))):v.push(x(g.stringLiteral(ge.node.exported.name),g.memberExpression(g.callExpression(this.addHelper("interopRequireDefault"),[de]),ge.node.local))),y[ge.node.exported.name]=!0)}else for(var be=ce,Ee=Array.isArray(be),xe=0,be=Ee?be:(0,l.default)(be);;){var Ae;if(Ee){if(xe>=be.length)break;Ae=be[xe++]}else{if(xe=be.next(),xe.done)break;Ae=xe.value}var Se=Ae;Se.isExportSpecifier()&&(n(m,Se.node.local.name,Se.node.exported),y[Se.node.exported.name]=!0,fe.push(S(Se.node.exported,Se.node.local)))}T.replaceWithMultiple(fe)}else if(T.isExportAllDeclaration()){var _e=_({OBJECT:r(T.node.source.value,T.node._blockHoist)});_e.loc=T.node.loc,v.push(_e),T.remove()}}for(var De in h){var Ce=h[De],O=Ce.specifiers,we=Ce.maxBlockHoist;if(O.length){for(var Pe=r(De,we),ke=void 0,Fe=0;Fe<O.length;Fe++){var Te=O[Fe];if(g.isImportNamespaceSpecifier(Te)){if(i||a)D[Te.local.name]=Pe;else{var Oe=g.variableDeclaration("var",[g.variableDeclarator(Te.local,g.callExpression(this.addHelper("interopRequireWildcard"),[Pe]))]);we>0&&(Oe._blockHoist=we),v.push(Oe)}ke=Te.local}else g.isImportDefaultSpecifier(Te)&&(O[Fe]=g.importSpecifier(Te.local,g.identifier("default")))}for(var Be=O,Re=Array.isArray(Be),Ie=0,Be=Re?Be:(0,l.default)(Be);;){var Me;if(Re){if(Ie>=Be.length)break;Me=Be[Ie++]}else{if(Ie=Be.next(),Ie.done)break;Me=Ie.value}var Ne=Me;if(g.isImportSpecifier(Ne)){var Le=Pe;if("default"===Ne.imported.name)if(ke)Le=ke;else if(!a){Le=ke=e.scope.generateUidIdentifier(Pe.name);var je=g.variableDeclaration("var",[g.variableDeclarator(Le,g.callExpression(this.addHelper("interopRequireDefault"),[Pe]))]);we>0&&(je._blockHoist=we),v.push(je)}D[Ne.local.name]=g.memberExpression(Le,g.cloneWithoutLoc(Ne.imported))}}}else{var Ue=b(g.stringLiteral(De));Ue.loc=h[De].loc,v.push(Ue)}}if(f&&(0,s.default)(y).length)for(var Ve=(0,s.default)(y),Ge=0;Ge<Ve.length;Ge+=100)!function(e){var t=Ve.slice(e,e+100),r=g.identifier("undefined");t.forEach(function(e){r=S(g.identifier(e),r).expression});var n=g.expressionStatement(r);n._blockHoist=3,v.unshift(n)}(Ge);if(c&&!i){var We=E;this.opts.loose&&(We=A);var Ye=We();Ye._blockHoist=3,v.unshift(Ye)}e.unshiftContainer("body",v),e.traverse(t,{remaps:D,scope:u,exports:m,requeueInParent:function(t){return e.requeue(t)}})}}}}};var p=r(19),d=r(4),h=n(d),m=r(216),y=n(m),v=r(1),g=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(v),b=(0,h.default)("\n require($0);\n"),E=(0,h.default)('\n Object.defineProperty(exports, "__esModule", {\n value: true\n });\n'),x=(0,h.default)("\n Object.defineProperty(exports, $0, {\n enumerable: true,\n get: function () {\n return $1;\n }\n });\n"),A=(0,h.default)("\n exports.__esModule = true;\n"),S=(0,h.default)("\n exports.$0 = $1;\n"),_=(0,h.default)('\n Object.keys(OBJECT).forEach(function (key) {\n if (key === "default" || key === "__esModule") return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return OBJECT[key];\n }\n });\n });\n'),D=["FunctionExpression","FunctionDeclaration","ClassProperty","ClassMethod","ObjectMethod"];e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),s=n(i),a=r(10),o=n(a);t.default=function(e){function t(e,t,r,n,i){new l.default({getObjectRef:n,methodNode:t,methodPath:e,isStatic:!0,scope:r,file:i}).replace()}var r=e.types,n=(0,o.default)();return{visitor:{Super:function(e){var t=e.findParent(function(e){return e.isObjectExpression()});t&&(t.node[n]=!0)},ObjectExpression:{exit:function(e,i){if(e.node[n]){for(var a=void 0,o=function(){return a=a||e.scope.generateUidIdentifier("obj")},u=e.get("properties"),l=u,c=Array.isArray(l),f=0,l=c?l:(0,s.default)(l);;){var p;if(c){if(f>=l.length)break;p=l[f++]}else{if(f=l.next(),f.done)break;p=f.value}var d=p;d.isObjectProperty()&&(d=d.get("value")),t(d,d.node,e.scope,o,i)}a&&(e.scope.push({id:a}),e.replaceWith(r.assignmentExpression("=",a,e.node)))}}}}}};var u=r(193),l=n(u);e.exports=t.default},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.__esModule=!0;var i=r(2),s=function(e){return e&&e.__esModule?e:{default:e}}(i);t.default=function(){return{visitor:a.visitors.merge([{ArrowFunctionExpression:function(e){for(var t=e.get("params"),r=t,n=Array.isArray(r),i=0,r=n?r:(0,s.default)(r);;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if(i=r.next(),i.done)break;a=i.value}var o=a;if(o.isRestElement()||o.isAssignmentPattern()){e.arrowFunctionToShadowed();break}}}},u.visitor,p.visitor,c.visitor])}};var a=r(7),o=r(334),u=n(o),l=r(333),c=n(l),f=r(335),p=n(f);e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(){return{visitor:{ObjectMethod:function(e){var t=e.node;if("method"===t.kind){var r=i.functionExpression(null,t.params,t.body,t.generator,t.async);r.returnType=t.returnType,e.replaceWith(i.objectProperty(t.key,r,t.computed))}},ObjectProperty:function(e){var t=e.node;t.shorthand&&(t.shorthand=!1)}}}};var n=r(1),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(n);e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(2),i=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=function(e){function t(e,t,r){return r.opts.loose&&!s.isIdentifier(e.argument,{name:"arguments"})?e.argument:t.toArray(e.argument,!0)}function r(e){for(var t=0;t<e.length;t++)if(s.isSpreadElement(e[t]))return!0;return!1}function n(e,r,n){function a(){u.length&&(o.push(s.arrayExpression(u)),u=[])}for(var o=[],u=[],l=e,c=Array.isArray(l),f=0,l=c?l:(0,i.default)(l);;){var p;if(c){if(f>=l.length)break;p=l[f++]}else{if(f=l.next(),f.done)break;p=f.value}var d=p;s.isSpreadElement(d)?(a(),o.push(t(d,r,n))):u.push(d)}return a(),o}var s=e.types;return{visitor:{ArrayExpression:function(e,t){var i=e.node,a=e.scope,o=i.elements;if(r(o)){var u=n(o,a,t),l=u.shift();s.isArrayExpression(l)||(u.unshift(l),l=s.arrayExpression([])),e.replaceWith(s.callExpression(s.memberExpression(l,s.identifier("concat")),u))}},CallExpression:function(e,t){var i=e.node,a=e.scope,o=i.arguments;if(r(o)){var u=e.get("callee");if(!u.isSuper()){var l=s.identifier("undefined");i.arguments=[];var c=void 0;c=1===o.length&&"arguments"===o[0].argument.name?[o[0].argument]:n(o,a,t);var f=c.shift();c.length?i.arguments.push(s.callExpression(s.memberExpression(f,s.identifier("concat")),c)):i.arguments.push(f);var p=i.callee;if(u.isMemberExpression()){var d=a.maybeGenerateMemoised(p.object);d?(p.object=s.assignmentExpression("=",d,p.object),l=d):l=p.object,s.appendToMemberExpression(p,s.identifier("apply"))}else i.callee=s.memberExpression(i.callee,s.identifier("apply"));s.isSuper(l)&&(l=s.thisExpression()),i.arguments.unshift(l)}}},NewExpression:function(e,t){var i=e.node,a=e.scope,o=i.arguments;if(r(o)){var u=n(o,a,t),l=s.arrayExpression([s.nullLiteral()]);o=s.callExpression(s.memberExpression(l,s.identifier("concat")),u),e.replaceWith(s.newExpression(s.callExpression(s.memberExpression(s.memberExpression(s.memberExpression(s.identifier("Function"),s.identifier("prototype")),s.identifier("bind")),s.identifier("apply")),[i.callee,o]),[]))}}}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.__esModule=!0,t.default=function(){return{visitor:{RegExpLiteral:function(e){var t=e.node;s.is(t,"y")&&e.replaceWith(o.newExpression(o.identifier("RegExp"),[o.stringLiteral(t.pattern),o.stringLiteral(t.flags)]))}}}};var i=r(192),s=n(i),a=r(1),o=n(a);e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(2),i=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=function(e){function t(e){return n.isLiteral(e)&&"string"==typeof e.value}function r(e,t){return n.binaryExpression("+",e,t)}var n=e.types;return{visitor:{TaggedTemplateExpression:function(e,t){for(var r=e.node,s=r.quasi,a=[],o=[],u=[],l=s.quasis,c=Array.isArray(l),f=0,l=c?l:(0,i.default)(l);;){var p;if(c){if(f>=l.length)break;p=l[f++]}else{if(f=l.next(),f.done)break;p=f.value}var d=p;o.push(n.stringLiteral(d.value.cooked)),u.push(n.stringLiteral(d.value.raw))}o=n.arrayExpression(o),u=n.arrayExpression(u);var h="taggedTemplateLiteral";t.opts.loose&&(h+="Loose");var m=t.file.addTemplateObject(h,o,u);a.push(m),a=a.concat(s.expressions),e.replaceWith(n.callExpression(r.tag,a))},TemplateLiteral:function(e,s){for(var a=[],o=e.get("expressions"),u=e.node.quasis,l=Array.isArray(u),c=0,u=l?u:(0,i.default)(u);;){var f;if(l){if(c>=u.length)break;f=u[c++]}else{if(c=u.next(),c.done)break;f=c.value}var p=f;a.push(n.stringLiteral(p.value.cooked));var d=o.shift();d&&(!s.opts.spec||d.isBaseType("string")||d.isBaseType("number")?a.push(d.node):a.push(n.callExpression(n.identifier("String"),[d.node])))}if(a=a.filter(function(e){return!n.isLiteral(e,{value:""})}),t(a[0])||t(a[1])||a.unshift(n.stringLiteral("")),a.length>1){for(var h=r(a.shift(),a.shift()),m=a,y=Array.isArray(m),v=0,m=y?m:(0,i.default)(m);;){var g;if(y){if(v>=m.length)break;g=m[v++]}else{if(v=m.next(),v.done)break;g=v.value}h=r(h,g)}e.replaceWith(h)}else e.replaceWith(a[0])}}}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(10),i=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=function(e){var t=e.types,r=(0,i.default)();return{visitor:{Scope:function(e){var t=e.scope;t.getBinding("Symbol")&&t.rename("Symbol")},UnaryExpression:function(e){var n=e.node,i=e.parent;if(!n[r]&&!e.find(function(e){return e.node&&!!e.node._generated})){if(e.parentPath.isBinaryExpression()&&t.EQUALITY_BINARY_OPERATORS.indexOf(i.operator)>=0){var s=e.getOpposite();if(s.isLiteral()&&"symbol"!==s.node.value&&"object"!==s.node.value)return}if("typeof"===n.operator){var a=t.callExpression(this.addHelper("typeof"),[n.argument]);if(e.get("argument").isIdentifier()){var o=t.stringLiteral("undefined"),u=t.unaryExpression("typeof",n.argument);u[r]=!0,e.replaceWith(t.conditionalExpression(t.binaryExpression("===",u,o),o,a))}else e.replaceWith(a)}}}}}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(){return{visitor:{RegExpLiteral:function(e){var t=e.node;a.is(t,"u")&&(t.pattern=(0,i.default)(t.pattern,t.flags),a.pullFlag(t,"u"))}}}};var n=r(612),i=function(e){return e&&e.__esModule?e:{default:e}}(n),s=r(192),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s);e.exports=t.default},function(e,t,r){"use strict";e.exports=r(606)},function(e,t,r){"use strict";e.exports={default:r(408),__esModule:!0}},function(e,t,r){"use strict";function n(){i(),s()}function i(){t.path=u=new o.default}function s(){t.scope=l=new o.default}t.__esModule=!0,t.scope=t.path=void 0;var a=r(364),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.clear=n,t.clearPath=i,t.clearScope=s;var u=t.path=new o.default,l=t.scope=new o.default},function(e,t){"use strict";function r(e){return e=e.split(" "),function(t){return e.indexOf(t)>=0}}function n(e,t){for(var r=65536,n=0;n<t.length;n+=2){if((r+=t[n])>e)return!1;if((r+=t[n+1])>=e)return!0}}function i(e){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&x.test(String.fromCharCode(e)):n(e,S)))}function s(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&A.test(String.fromCharCode(e)):n(e,S)||n(e,_))))}function a(e){var t={};for(var r in D)t[r]=e&&r in e?e[r]:D[r];return t}function o(e){return 10===e||13===e||8232===e||8233===e}function u(e,t){for(var r=1,n=0;;){N.lastIndex=n;var i=N.exec(e);if(!(i&&i.index<t))return new V(r,t-n);++r,n=i.index+i[0].length}}function l(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}function c(e,t,r,n){return e.type=t,e.end=r,e.loc.end=n,this.processComment(e),e}function f(e){return e[e.length-1]}function p(e){return e&&"Property"===e.type&&"init"===e.kind&&!1===e.method}function d(e){return"JSXIdentifier"===e.type?e.name:"JSXNamespacedName"===e.type?e.namespace.name+":"+e.name.name:"JSXMemberExpression"===e.type?d(e.object)+"."+d(e.property):void 0}function h(e,t){return new J(t,e).parse()}function m(e,t){var r=new J(t,e);return r.options.strictMode&&(r.state.strict=!0),r.getExpression()}var y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var v={6:r("enum await"),strict:r("implements interface let package private protected public static yield"),strictBind:r("eval arguments") },g=r("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this let const class extends export import yield super"),b="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿕ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞮꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",E="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣔ-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",x=new RegExp("["+b+"]"),A=new RegExp("["+b+E+"]");b=E=null;var S=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,264,8,2,36,18,0,50,29,881,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,65,0,32,6124,20,754,9486,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,10591,541],_=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,7,0,161,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,87,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,838,7,2,7,17,9,57,21,2,13,19882,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239],D={sourceType:"script",sourceFilename:void 0,startLine:1,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,plugins:[],strictMode:null},C="function"==typeof Symbol&&"symbol"===y(Symbol.iterator)?function(e){return void 0===e?"undefined":y(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":y(e)},w=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},P=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":y(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},k=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":y(t))&&"function"!=typeof t?e:t},F=!0,T=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};w(this,e),this.label=t,this.keyword=r.keyword,this.beforeExpr=!!r.beforeExpr,this.startsExpr=!!r.startsExpr,this.rightAssociative=!!r.rightAssociative,this.isLoop=!!r.isLoop,this.isAssign=!!r.isAssign,this.prefix=!!r.prefix,this.postfix=!!r.postfix,this.binop=r.binop||null,this.updateContext=null},O=function(e){function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return w(this,t),n.keyword=r,k(this,e.call(this,r,n))}return P(t,e),t}(T),B=function(e){function t(r,n){return w(this,t),k(this,e.call(this,r,{beforeExpr:F,binop:n}))}return P(t,e),t}(T),R={num:new T("num",{startsExpr:!0}),regexp:new T("regexp",{startsExpr:!0}),string:new T("string",{startsExpr:!0}),name:new T("name",{startsExpr:!0}),eof:new T("eof"),bracketL:new T("[",{beforeExpr:F,startsExpr:!0}),bracketR:new T("]"),braceL:new T("{",{beforeExpr:F,startsExpr:!0}),braceBarL:new T("{|",{beforeExpr:F,startsExpr:!0}),braceR:new T("}"),braceBarR:new T("|}"),parenL:new T("(",{beforeExpr:F,startsExpr:!0}),parenR:new T(")"),comma:new T(",",{beforeExpr:F}),semi:new T(";",{beforeExpr:F}),colon:new T(":",{beforeExpr:F}),doubleColon:new T("::",{beforeExpr:F}),dot:new T("."),question:new T("?",{beforeExpr:F}),arrow:new T("=>",{beforeExpr:F}),template:new T("template"),ellipsis:new T("...",{beforeExpr:F}),backQuote:new T("`",{startsExpr:!0}),dollarBraceL:new T("${",{beforeExpr:F,startsExpr:!0}),at:new T("@"),eq:new T("=",{beforeExpr:F,isAssign:!0}),assign:new T("_=",{beforeExpr:F,isAssign:!0}),incDec:new T("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new T("prefix",{beforeExpr:F,prefix:!0,startsExpr:!0}),logicalOR:new B("||",1),logicalAND:new B("&&",2),bitwiseOR:new B("|",3),bitwiseXOR:new B("^",4),bitwiseAND:new B("&",5),equality:new B("==/!=",6),relational:new B("</>",7),bitShift:new B("<</>>",8),plusMin:new T("+/-",{beforeExpr:F,binop:9,prefix:!0,startsExpr:!0}),modulo:new B("%",10),star:new B("*",10),slash:new B("/",10),exponent:new T("**",{beforeExpr:F,binop:11,rightAssociative:!0})},I={break:new O("break"),case:new O("case",{beforeExpr:F}),catch:new O("catch"),continue:new O("continue"),debugger:new O("debugger"),default:new O("default",{beforeExpr:F}),do:new O("do",{isLoop:!0,beforeExpr:F}),else:new O("else",{beforeExpr:F}),finally:new O("finally"),for:new O("for",{isLoop:!0}),function:new O("function",{startsExpr:!0}),if:new O("if"),return:new O("return",{beforeExpr:F}),switch:new O("switch"),throw:new O("throw",{beforeExpr:F}),try:new O("try"),var:new O("var"),let:new O("let"),const:new O("const"),while:new O("while",{isLoop:!0}),with:new O("with"),new:new O("new",{beforeExpr:F,startsExpr:!0}),this:new O("this",{startsExpr:!0}),super:new O("super",{startsExpr:!0}),class:new O("class"),extends:new O("extends",{beforeExpr:F}),export:new O("export"),import:new O("import",{startsExpr:!0}),yield:new O("yield",{beforeExpr:F,startsExpr:!0}),null:new O("null",{startsExpr:!0}),true:new O("true",{startsExpr:!0}),false:new O("false",{startsExpr:!0}),in:new O("in",{beforeExpr:F,binop:7}),instanceof:new O("instanceof",{beforeExpr:F,binop:7}),typeof:new O("typeof",{beforeExpr:F,prefix:!0,startsExpr:!0}),void:new O("void",{beforeExpr:F,prefix:!0,startsExpr:!0}),delete:new O("delete",{beforeExpr:F,prefix:!0,startsExpr:!0})};Object.keys(I).forEach(function(e){R["_"+e]=I[e]});var M=/\r\n?|\n|\u2028|\u2029/,N=new RegExp(M.source,"g"),L=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,j=function e(t,r,n,i){w(this,e),this.token=t,this.isExpr=!!r,this.preserveSpace=!!n,this.override=i},U={braceStatement:new j("{",!1),braceExpression:new j("{",!0),templateQuasi:new j("${",!0),parenStatement:new j("(",!1),parenExpression:new j("(",!0),template:new j("`",!0,!0,function(e){return e.readTmplToken()}),functionExpression:new j("function",!0)};R.parenR.updateContext=R.braceR.updateContext=function(){if(1===this.state.context.length)return void(this.state.exprAllowed=!0);var e=this.state.context.pop();e===U.braceStatement&&this.curContext()===U.functionExpression?(this.state.context.pop(),this.state.exprAllowed=!1):e===U.templateQuasi?this.state.exprAllowed=!0:this.state.exprAllowed=!e.isExpr},R.name.updateContext=function(e){this.state.exprAllowed=!1,e!==R._let&&e!==R._const&&e!==R._var||M.test(this.input.slice(this.state.end))&&(this.state.exprAllowed=!0)},R.braceL.updateContext=function(e){this.state.context.push(this.braceIsBlock(e)?U.braceStatement:U.braceExpression),this.state.exprAllowed=!0},R.dollarBraceL.updateContext=function(){this.state.context.push(U.templateQuasi),this.state.exprAllowed=!0},R.parenL.updateContext=function(e){var t=e===R._if||e===R._for||e===R._with||e===R._while;this.state.context.push(t?U.parenStatement:U.parenExpression),this.state.exprAllowed=!0},R.incDec.updateContext=function(){},R._function.updateContext=function(){this.curContext()!==U.braceStatement&&this.state.context.push(U.functionExpression),this.state.exprAllowed=!1},R.backQuote.updateContext=function(){this.curContext()===U.template?this.state.context.pop():this.state.context.push(U.template),this.state.exprAllowed=!1};var V=function e(t,r){w(this,e),this.line=t,this.column=r},G=function e(t,r){w(this,e),this.start=t,this.end=r},W=function(){function e(){w(this,e)}return e.prototype.init=function(e,t){return this.strict=!1!==e.strictMode&&"module"===e.sourceType,this.input=t,this.potentialArrowAt=-1,this.inMethod=this.inFunction=this.inGenerator=this.inAsync=this.inPropertyName=this.inType=this.inClassProperty=this.noAnonFunctionType=!1,this.labels=[],this.decorators=[],this.tokens=[],this.comments=[],this.trailingComments=[],this.leadingComments=[],this.commentStack=[],this.pos=this.lineStart=0,this.curLine=e.startLine,this.type=R.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=[U.braceStatement],this.exprAllowed=!0,this.containsEsc=this.containsOctal=!1,this.octalPosition=null,this.invalidTemplateEscapePosition=null,this.exportedIdentifiers=[],this},e.prototype.curPosition=function(){return new V(this.curLine,this.pos-this.lineStart)},e.prototype.clone=function(t){var r=new e;for(var n in this){var i=this[n];t&&"context"!==n||!Array.isArray(i)||(i=i.slice()),r[n]=i}return r},e}(),Y=function e(t){w(this,e),this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,this.loc=new G(t.startLoc,t.endLoc)},q=function(){function e(t,r){w(this,e),this.state=new W,this.state.init(t,r)}return e.prototype.next=function(){this.isLookahead||this.state.tokens.push(new Y(this.state)),this.state.lastTokEnd=this.state.end,this.state.lastTokStart=this.state.start,this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()},e.prototype.eat=function(e){return!!this.match(e)&&(this.next(),!0)},e.prototype.match=function(e){return this.state.type===e},e.prototype.isKeyword=function(e){return g(e)},e.prototype.lookahead=function(){var e=this.state;this.state=e.clone(!0),this.isLookahead=!0,this.next(),this.isLookahead=!1;var t=this.state.clone(!0);return this.state=e,t},e.prototype.setStrict=function(e){if(this.state.strict=e,this.match(R.num)||this.match(R.string)){for(this.state.pos=this.state.start;this.state.pos<this.state.lineStart;)this.state.lineStart=this.input.lastIndexOf("\n",this.state.lineStart-2)+1,--this.state.curLine;this.nextToken()}},e.prototype.curContext=function(){return this.state.context[this.state.context.length-1]},e.prototype.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.state.containsOctal=!1,this.state.octalPosition=null,this.state.start=this.state.pos,this.state.startLoc=this.state.curPosition(),this.state.pos>=this.input.length?this.finishToken(R.eof):e.override?e.override(this):this.readToken(this.fullCharCodeAtPos())},e.prototype.readToken=function(e){return i(e)||92===e?this.readWord():this.getTokenFromCode(e)},e.prototype.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.state.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.state.pos+1)-56613888},e.prototype.pushComment=function(e,t,r,n,i,s){var a={type:e?"CommentBlock":"CommentLine",value:t,start:r,end:n,loc:new G(i,s)};this.isLookahead||(this.state.tokens.push(a),this.state.comments.push(a),this.addComment(a))},e.prototype.skipBlockComment=function(){var e=this.state.curPosition(),t=this.state.pos,r=this.input.indexOf("*/",this.state.pos+=2);-1===r&&this.raise(this.state.pos-2,"Unterminated comment"),this.state.pos=r+2,N.lastIndex=t;for(var n=void 0;(n=N.exec(this.input))&&n.index<this.state.pos;)++this.state.curLine,this.state.lineStart=n.index+n[0].length;this.pushComment(!0,this.input.slice(t+2,r),t,this.state.pos,e,this.state.curPosition())},e.prototype.skipLineComment=function(e){for(var t=this.state.pos,r=this.state.curPosition(),n=this.input.charCodeAt(this.state.pos+=e);this.state.pos<this.input.length&&10!==n&&13!==n&&8232!==n&&8233!==n;)++this.state.pos,n=this.input.charCodeAt(this.state.pos);this.pushComment(!1,this.input.slice(t+e,this.state.pos),t,this.state.pos,r,this.state.curPosition())},e.prototype.skipSpace=function(){e:for(;this.state.pos<this.input.length;){var e=this.input.charCodeAt(this.state.pos);switch(e){case 32:case 160:++this.state.pos;break;case 13:10===this.input.charCodeAt(this.state.pos+1)&&++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&L.test(String.fromCharCode(e))))break e;++this.state.pos}}},e.prototype.finishToken=function(e,t){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();var r=this.state.type;this.state.type=e,this.state.value=t,this.updateContext(r)},e.prototype.readToken_dot=function(){var e=this.input.charCodeAt(this.state.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.state.pos+2);return 46===e&&46===t?(this.state.pos+=3,this.finishToken(R.ellipsis)):(++this.state.pos,this.finishToken(R.dot))},e.prototype.readToken_slash=function(){return this.state.exprAllowed?(++this.state.pos,this.readRegexp()):61===this.input.charCodeAt(this.state.pos+1)?this.finishOp(R.assign,2):this.finishOp(R.slash,1)},e.prototype.readToken_mult_modulo=function(e){var t=42===e?R.star:R.modulo,r=1,n=this.input.charCodeAt(this.state.pos+1);return 42===n&&(r++,n=this.input.charCodeAt(this.state.pos+2),t=R.exponent),61===n&&(r++,t=R.assign),this.finishOp(t,r)},e.prototype.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.state.pos+1);return t===e?this.finishOp(124===e?R.logicalOR:R.logicalAND,2):61===t?this.finishOp(R.assign,2):124===e&&125===t&&this.hasPlugin("flow")?this.finishOp(R.braceBarR,2):this.finishOp(124===e?R.bitwiseOR:R.bitwiseAND,1)},e.prototype.readToken_caret=function(){return 61===this.input.charCodeAt(this.state.pos+1)?this.finishOp(R.assign,2):this.finishOp(R.bitwiseXOR,1)},e.prototype.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.state.pos+1);return t===e?45===t&&62===this.input.charCodeAt(this.state.pos+2)&&M.test(this.input.slice(this.state.lastTokEnd,this.state.pos))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(R.incDec,2):61===t?this.finishOp(R.assign,2):this.finishOp(R.plusMin,1)},e.prototype.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.state.pos+1),r=1;return t===e?(r=62===e&&62===this.input.charCodeAt(this.state.pos+2)?3:2,61===this.input.charCodeAt(this.state.pos+r)?this.finishOp(R.assign,r+1):this.finishOp(R.bitShift,r)):33===t&&60===e&&45===this.input.charCodeAt(this.state.pos+2)&&45===this.input.charCodeAt(this.state.pos+3)?(this.inModule&&this.unexpected(),this.skipLineComment(4),this.skipSpace(),this.nextToken()):(61===t&&(r=2),this.finishOp(R.relational,r))},e.prototype.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.state.pos+1);return 61===t?this.finishOp(R.equality,61===this.input.charCodeAt(this.state.pos+2)?3:2):61===e&&62===t?(this.state.pos+=2,this.finishToken(R.arrow)):this.finishOp(61===e?R.eq:R.prefix,1)},e.prototype.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.state.pos,this.finishToken(R.parenL);case 41:return++this.state.pos,this.finishToken(R.parenR);case 59:return++this.state.pos,this.finishToken(R.semi);case 44:return++this.state.pos,this.finishToken(R.comma);case 91:return++this.state.pos,this.finishToken(R.bracketL);case 93:return++this.state.pos,this.finishToken(R.bracketR);case 123:return this.hasPlugin("flow")&&124===this.input.charCodeAt(this.state.pos+1)?this.finishOp(R.braceBarL,2):(++this.state.pos,this.finishToken(R.braceL));case 125:return++this.state.pos,this.finishToken(R.braceR);case 58:return this.hasPlugin("functionBind")&&58===this.input.charCodeAt(this.state.pos+1)?this.finishOp(R.doubleColon,2):(++this.state.pos,this.finishToken(R.colon));case 63:return++this.state.pos,this.finishToken(R.question);case 64:return++this.state.pos,this.finishToken(R.at);case 96:return++this.state.pos,this.finishToken(R.backQuote);case 48:var t=this.input.charCodeAt(this.state.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2);case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 126:return this.finishOp(R.prefix,1)}this.raise(this.state.pos,"Unexpected character '"+l(e)+"'")},e.prototype.finishOp=function(e,t){var r=this.input.slice(this.state.pos,this.state.pos+t);return this.state.pos+=t,this.finishToken(e,r)},e.prototype.readRegexp=function(){for(var e=this.state.pos,t=void 0,r=void 0;;){this.state.pos>=this.input.length&&this.raise(e,"Unterminated regular expression");var n=this.input.charAt(this.state.pos);if(M.test(n)&&this.raise(e,"Unterminated regular expression"),t)t=!1;else{if("["===n)r=!0;else if("]"===n&&r)r=!1;else if("/"===n&&!r)break;t="\\"===n}++this.state.pos}var i=this.input.slice(e,this.state.pos);++this.state.pos;var s=this.readWord1();if(s){/^[gmsiyu]*$/.test(s)||this.raise(e,"Invalid regular expression flag")}return this.finishToken(R.regexp,{pattern:i,flags:s})},e.prototype.readInt=function(e,t){for(var r=this.state.pos,n=0,i=0,s=null==t?1/0:t;i<s;++i){var a=this.input.charCodeAt(this.state.pos),o=void 0;if((o=a>=97?a-97+10:a>=65?a-65+10:a>=48&&a<=57?a-48:1/0)>=e)break;++this.state.pos,n=n*e+o}return this.state.pos===r||null!=t&&this.state.pos-r!==t?null:n},e.prototype.readRadixNumber=function(e){this.state.pos+=2;var t=this.readInt(e);return null==t&&this.raise(this.state.start+2,"Expected number in radix "+e),i(this.fullCharCodeAtPos())&&this.raise(this.state.pos,"Identifier directly after number"),this.finishToken(R.num,t)},e.prototype.readNumber=function(e){var t=this.state.pos,r=48===this.input.charCodeAt(t),n=!1;e||null!==this.readInt(10)||this.raise(t,"Invalid number"),r&&this.state.pos==t+1&&(r=!1);var s=this.input.charCodeAt(this.state.pos);46!==s||r||(++this.state.pos,this.readInt(10),n=!0,s=this.input.charCodeAt(this.state.pos)),69!==s&&101!==s||r||(s=this.input.charCodeAt(++this.state.pos),43!==s&&45!==s||++this.state.pos,null===this.readInt(10)&&this.raise(t,"Invalid number"),n=!0),i(this.fullCharCodeAtPos())&&this.raise(this.state.pos,"Identifier directly after number");var a=this.input.slice(t,this.state.pos),o=void 0;return n?o=parseFloat(a):r&&1!==a.length?this.state.strict?this.raise(t,"Invalid number"):o=/[89]/.test(a)?parseInt(a,10):parseInt(a,8):o=parseInt(a,10),this.finishToken(R.num,o)},e.prototype.readCodePoint=function(e){var t=this.input.charCodeAt(this.state.pos),r=void 0;if(123===t){var n=++this.state.pos;if(r=this.readHexChar(this.input.indexOf("}",this.state.pos)-this.state.pos,e),++this.state.pos,null===r)--this.state.invalidTemplateEscapePosition;else if(r>1114111){if(!e)return this.state.invalidTemplateEscapePosition=n-2,null;this.raise(n,"Code point out of bounds")}}else r=this.readHexChar(4,e);return r},e.prototype.readString=function(e){for(var t="",r=++this.state.pos;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated string constant");var n=this.input.charCodeAt(this.state.pos);if(n===e)break;92===n?(t+=this.input.slice(r,this.state.pos),t+=this.readEscapedChar(!1),r=this.state.pos):(o(n)&&this.raise(this.state.start,"Unterminated string constant"),++this.state.pos)}return t+=this.input.slice(r,this.state.pos++),this.finishToken(R.string,t)},e.prototype.readTmplToken=function(){for(var e="",t=this.state.pos,r=!1;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated template");var n=this.input.charCodeAt(this.state.pos);if(96===n||36===n&&123===this.input.charCodeAt(this.state.pos+1))return this.state.pos===this.state.start&&this.match(R.template)?36===n?(this.state.pos+=2,this.finishToken(R.dollarBraceL)):(++this.state.pos,this.finishToken(R.backQuote)):(e+=this.input.slice(t,this.state.pos),this.finishToken(R.template,r?null:e));if(92===n){e+=this.input.slice(t,this.state.pos);var i=this.readEscapedChar(!0);null===i?r=!0:e+=i,t=this.state.pos}else if(o(n)){switch(e+=this.input.slice(t,this.state.pos),++this.state.pos,n){case 13:10===this.input.charCodeAt(this.state.pos)&&++this.state.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(n)}++this.state.curLine,this.state.lineStart=this.state.pos,t=this.state.pos}else++this.state.pos}},e.prototype.readEscapedChar=function(e){var t=!e,r=this.input.charCodeAt(++this.state.pos);switch(++this.state.pos,r){case 110:return"\n";case 114:return"\r";case 120:var n=this.readHexChar(2,t);return null===n?null:String.fromCharCode(n);case 117:var i=this.readCodePoint(t);return null===i?null:l(i);case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.state.pos)&&++this.state.pos;case 10:return this.state.lineStart=this.state.pos,++this.state.curLine,"";default:if(r>=48&&r<=55){var s=this.state.pos-1,a=this.input.substr(this.state.pos-1,3).match(/^[0-7]+/)[0],o=parseInt(a,8);if(o>255&&(a=a.slice(0,-1),o=parseInt(a,8)),o>0){if(e)return this.state.invalidTemplateEscapePosition=s,null;this.state.strict?this.raise(s,"Octal literal in strict mode"):this.state.containsOctal||(this.state.containsOctal=!0,this.state.octalPosition=s)}return this.state.pos+=a.length-1,String.fromCharCode(o)}return String.fromCharCode(r)}},e.prototype.readHexChar=function(e,t){var r=this.state.pos,n=this.readInt(16,e);return null===n&&(t?this.raise(r,"Bad character escape sequence"):(this.state.pos=r-1,this.state.invalidTemplateEscapePosition=r-1)),n},e.prototype.readWord1=function(){this.state.containsEsc=!1;for(var e="",t=!0,r=this.state.pos;this.state.pos<this.input.length;){var n=this.fullCharCodeAtPos();if(s(n))this.state.pos+=n<=65535?1:2;else{if(92!==n)break;this.state.containsEsc=!0,e+=this.input.slice(r,this.state.pos);var a=this.state.pos;117!==this.input.charCodeAt(++this.state.pos)&&this.raise(this.state.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.state.pos;var o=this.readCodePoint(!0);(t?i:s)(o,!0)||this.raise(a,"Invalid Unicode escape"),e+=l(o),r=this.state.pos}t=!1}return e+this.input.slice(r,this.state.pos)},e.prototype.readWord=function(){var e=this.readWord1(),t=R.name;return!this.state.containsEsc&&this.isKeyword(e)&&(t=I[e]),this.finishToken(t,e)},e.prototype.braceIsBlock=function(e){if(e===R.colon){var t=this.curContext();if(t===U.braceStatement||t===U.braceExpression)return!t.isExpr}return e===R._return?M.test(this.input.slice(this.state.lastTokEnd,this.state.start)):e===R._else||e===R.semi||e===R.eof||e===R.parenR||(e===R.braceL?this.curContext()===U.braceStatement:!this.state.exprAllowed)},e.prototype.updateContext=function(e){var t=this.state.type,r=void 0;t.keyword&&e===R.dot?this.state.exprAllowed=!1:(r=t.updateContext)?r.call(this,e):this.state.exprAllowed=t.beforeExpr},e}(),K={},H=["jsx","doExpressions","objectRestSpread","decorators","classProperties","exportExtensions","asyncGenerators","functionBind","functionSent","dynamicImport","flow"],J=function(e){function t(r,n){w(this,t),r=a(r);var i=k(this,e.call(this,r,n));return i.options=r,i.inModule="module"===i.options.sourceType,i.input=n,i.plugins=i.loadPlugins(i.options.plugins),i.filename=r.sourceFilename,0===i.state.pos&&"#"===i.input[0]&&"!"===i.input[1]&&i.skipLineComment(2),i}return P(t,e),t.prototype.isReservedWord=function(e){return"await"===e?this.inModule:v[6](e)},t.prototype.hasPlugin=function(e){return!!(this.plugins["*"]&&H.indexOf(e)>-1)||!!this.plugins[e]},t.prototype.extend=function(e,t){this[e]=t(this[e])},t.prototype.loadAllPlugins=function(){var e=this,t=Object.keys(K).filter(function(e){return"flow"!==e&&"estree"!==e});t.push("flow"),t.forEach(function(t){var r=K[t];r&&r(e)})},t.prototype.loadPlugins=function(e){if(e.indexOf("*")>=0)return this.loadAllPlugins(),{"*":!0};var t={};e.indexOf("flow")>=0&&(e=e.filter(function(e){return"flow"!==e}),e.push("flow")),e.indexOf("estree")>=0&&(e=e.filter(function(e){return"estree"!==e}),e.unshift("estree"));for(var r=e,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var a=s;if(!t[a]){t[a]=!0;var o=K[a];o&&o(this)}}return t},t.prototype.parse=function(){var e=this.startNode(),t=this.startNode();return this.nextToken(),this.parseTopLevel(e,t)},t}(q),X=J.prototype;X.addExtra=function(e,t,r){if(e){(e.extra=e.extra||{})[t]=r}},X.isRelational=function(e){return this.match(R.relational)&&this.state.value===e},X.expectRelational=function(e){this.isRelational(e)?this.next():this.unexpected(null,R.relational)},X.isContextual=function(e){return this.match(R.name)&&this.state.value===e},X.eatContextual=function(e){return this.state.value===e&&this.eat(R.name)},X.expectContextual=function(e,t){this.eatContextual(e)||this.unexpected(null,t)},X.canInsertSemicolon=function(){return this.match(R.eof)||this.match(R.braceR)||M.test(this.input.slice(this.state.lastTokEnd,this.state.start))},X.isLineTerminator=function(){return this.eat(R.semi)||this.canInsertSemicolon()},X.semicolon=function(){this.isLineTerminator()||this.unexpected(null,R.semi)},X.expect=function(e,t){return this.eat(e)||this.unexpected(t,e)},X.unexpected=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Unexpected token";t&&"object"===(void 0===t?"undefined":C(t))&&t.label&&(t="Unexpected token, expected "+t.label),this.raise(null!=e?e:this.state.start,t)};var z=J.prototype;z.parseTopLevel=function(e,t){return t.sourceType=this.options.sourceType,this.parseBlockBody(t,!0,!0,R.eof),e.program=this.finishNode(t,"Program"),e.comments=this.state.comments,e.tokens=this.state.tokens,this.finishNode(e,"File")};var $={kind:"loop"},Q={kind:"switch"};z.stmtToDirective=function(e){var t=e.expression,r=this.startNodeAt(t.start,t.loc.start),n=this.startNodeAt(e.start,e.loc.start),i=this.input.slice(t.start,t.end),s=r.value=i.slice(1,-1);return this.addExtra(r,"raw",i),this.addExtra(r,"rawValue",s),n.value=this.finishNodeAt(r,"DirectiveLiteral",t.end,t.loc.end),this.finishNodeAt(n,"Directive",e.end,e.loc.end)},z.parseStatement=function(e,t){this.match(R.at)&&this.parseDecorators(!0);var r=this.state.type,n=this.startNode();switch(r){case R._break:case R._continue:return this.parseBreakContinueStatement(n,r.keyword);case R._debugger:return this.parseDebuggerStatement(n);case R._do:return this.parseDoStatement(n);case R._for:return this.parseForStatement(n);case R._function:return e||this.unexpected(),this.parseFunctionStatement(n);case R._class:return e||this.unexpected(),this.parseClass(n,!0);case R._if:return this.parseIfStatement(n);case R._return:return this.parseReturnStatement(n);case R._switch:return this.parseSwitchStatement(n);case R._throw:return this.parseThrowStatement(n);case R._try:return this.parseTryStatement(n);case R._let:case R._const:e||this.unexpected();case R._var:return this.parseVarStatement(n,r);case R._while:return this.parseWhileStatement(n);case R._with:return this.parseWithStatement(n);case R.braceL:return this.parseBlock();case R.semi:return this.parseEmptyStatement(n);case R._export:case R._import:if(this.hasPlugin("dynamicImport")&&this.lookahead().type===R.parenL)break;return this.options.allowImportExportEverywhere||(t||this.raise(this.state.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.state.start,"'import' and 'export' may appear only with 'sourceType: \"module\"'")),r===R._import?this.parseImport(n):this.parseExport(n);case R.name:if("async"===this.state.value){var i=this.state.clone();if(this.next(),this.match(R._function)&&!this.canInsertSemicolon())return this.expect(R._function),this.parseFunction(n,!0,!1,!0);this.state=i}}var s=this.state.value,a=this.parseExpression();return r===R.name&&"Identifier"===a.type&&this.eat(R.colon)?this.parseLabeledStatement(n,s,a):this.parseExpressionStatement(n,a)},z.takeDecorators=function(e){this.state.decorators.length&&(e.decorators=this.state.decorators,this.state.decorators=[])},z.parseDecorators=function(e){for(;this.match(R.at);){var t=this.parseDecorator();this.state.decorators.push(t)}e&&this.match(R._export)||this.match(R._class)||this.raise(this.state.start,"Leading decorators must be attached to a class declaration")},z.parseDecorator=function(){this.hasPlugin("decorators")||this.unexpected();var e=this.startNode();return this.next(),e.expression=this.parseMaybeAssign(),this.finishNode(e,"Decorator")},z.parseBreakContinueStatement=function(e,t){var r="break"===t;this.next(),this.isLineTerminator()?e.label=null:this.match(R.name)?(e.label=this.parseIdentifier(),this.semicolon()):this.unexpected();var n=void 0;for(n=0;n<this.state.labels.length;++n){var i=this.state.labels[n];if(null==e.label||i.name===e.label.name){if(null!=i.kind&&(r||"loop"===i.kind))break;if(e.label&&r)break}}return n===this.state.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,r?"BreakStatement":"ContinueStatement")},z.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},z.parseDoStatement=function(e){return this.next(),this.state.labels.push($),e.body=this.parseStatement(!1),this.state.labels.pop(),this.expect(R._while),e.test=this.parseParenExpression(),this.eat(R.semi),this.finishNode(e,"DoWhileStatement")},z.parseForStatement=function(e){this.next(),this.state.labels.push($);var t=!1;if(this.hasPlugin("asyncGenerators")&&this.state.inAsync&&this.isContextual("await")&&(t=!0,this.next()),this.expect(R.parenL),this.match(R.semi))return t&&this.unexpected(),this.parseFor(e,null);if(this.match(R._var)||this.match(R._let)||this.match(R._const)){var r=this.startNode(),n=this.state.type;return this.next(),(this.parseVar(r,!0,n),this.finishNode(r,"VariableDeclaration"),!this.match(R._in)&&!this.isContextual("of")||1!==r.declarations.length||r.declarations[0].init)?(t&&this.unexpected(), this.parseFor(e,r)):this.parseForIn(e,r,t)}var i={start:0},s=this.parseExpression(!0,i);if(this.match(R._in)||this.isContextual("of")){var a=this.isContextual("of")?"for-of statement":"for-in statement";return this.toAssignable(s,void 0,a),this.checkLVal(s,void 0,void 0,a),this.parseForIn(e,s,t)}return i.start&&this.unexpected(i.start),t&&this.unexpected(),this.parseFor(e,s)},z.parseFunctionStatement=function(e){return this.next(),this.parseFunction(e,!0)},z.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(!1),e.alternate=this.eat(R._else)?this.parseStatement(!1):null,this.finishNode(e,"IfStatement")},z.parseReturnStatement=function(e){return this.state.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.state.start,"'return' outside of function"),this.next(),this.isLineTerminator()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},z.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(R.braceL),this.state.labels.push(Q);for(var t,r=void 0;!this.match(R.braceR);)if(this.match(R._case)||this.match(R._default)){var n=this.match(R._case);r&&this.finishNode(r,"SwitchCase"),e.cases.push(r=this.startNode()),r.consequent=[],this.next(),n?r.test=this.parseExpression():(t&&this.raise(this.state.lastTokStart,"Multiple default clauses"),t=!0,r.test=null),this.expect(R.colon)}else r?r.consequent.push(this.parseStatement(!0)):this.unexpected();return r&&this.finishNode(r,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(e,"SwitchStatement")},z.parseThrowStatement=function(e){return this.next(),M.test(this.input.slice(this.state.lastTokEnd,this.state.start))&&this.raise(this.state.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Z=[];z.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.match(R._catch)){var t=this.startNode();this.next(),this.expect(R.parenL),t.param=this.parseBindingAtom(),this.checkLVal(t.param,!0,Object.create(null),"catch clause"),this.expect(R.parenR),t.body=this.parseBlock(),e.handler=this.finishNode(t,"CatchClause")}return e.guardedHandlers=Z,e.finalizer=this.eat(R._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},z.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},z.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.state.labels.push($),e.body=this.parseStatement(!1),this.state.labels.pop(),this.finishNode(e,"WhileStatement")},z.parseWithStatement=function(e){return this.state.strict&&this.raise(this.state.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(!1),this.finishNode(e,"WithStatement")},z.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},z.parseLabeledStatement=function(e,t,r){for(var n=this.state.labels,i=Array.isArray(n),s=0,n=i?n:n[Symbol.iterator]();;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}a.name===t&&this.raise(r.start,"Label '"+t+"' is already declared")}for(var o=this.state.type.isLoop?"loop":this.match(R._switch)?"switch":null,u=this.state.labels.length-1;u>=0;u--){var l=this.state.labels[u];if(l.statementStart!==e.start)break;l.statementStart=this.state.start,l.kind=o}return this.state.labels.push({name:t,kind:o,statementStart:this.state.start}),e.body=this.parseStatement(!0),this.state.labels.pop(),e.label=r,this.finishNode(e,"LabeledStatement")},z.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},z.parseBlock=function(e){var t=this.startNode();return this.expect(R.braceL),this.parseBlockBody(t,e,!1,R.braceR),this.finishNode(t,"BlockStatement")},z.isValidDirective=function(e){return"ExpressionStatement"===e.type&&"StringLiteral"===e.expression.type&&!e.expression.extra.parenthesized},z.parseBlockBody=function(e,t,r,n){e.body=[],e.directives=[];for(var i=!1,s=void 0,a=void 0;!this.eat(n);){i||!this.state.containsOctal||a||(a=this.state.octalPosition);var o=this.parseStatement(!0,r);if(t&&!i&&this.isValidDirective(o)){var u=this.stmtToDirective(o);e.directives.push(u),void 0===s&&"use strict"===u.value.value&&(s=this.state.strict,this.setStrict(!0),a&&this.raise(a,"Octal literal in strict mode"))}else i=!0,e.body.push(o)}!1===s&&this.setStrict(!1)},z.parseFor=function(e,t){return e.init=t,this.expect(R.semi),e.test=this.match(R.semi)?null:this.parseExpression(),this.expect(R.semi),e.update=this.match(R.parenR)?null:this.parseExpression(),this.expect(R.parenR),e.body=this.parseStatement(!1),this.state.labels.pop(),this.finishNode(e,"ForStatement")},z.parseForIn=function(e,t,r){var n=void 0;return r?(this.eatContextual("of"),n="ForAwaitStatement"):(n=this.match(R._in)?"ForInStatement":"ForOfStatement",this.next()),e.left=t,e.right=this.parseExpression(),this.expect(R.parenR),e.body=this.parseStatement(!1),this.state.labels.pop(),this.finishNode(e,n)},z.parseVar=function(e,t,r){for(e.declarations=[],e.kind=r.keyword;;){var n=this.startNode();if(this.parseVarHead(n),this.eat(R.eq)?n.init=this.parseMaybeAssign(t):r!==R._const||this.match(R._in)||this.isContextual("of")?"Identifier"===n.id.type||t&&(this.match(R._in)||this.isContextual("of"))?n.init=null:this.raise(this.state.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(R.comma))break}return e},z.parseVarHead=function(e){e.id=this.parseBindingAtom(),this.checkLVal(e.id,!0,void 0,"variable declaration")},z.parseFunction=function(e,t,r,n,i){var s=this.state.inMethod;return this.state.inMethod=!1,this.initFunction(e,n),this.match(R.star)&&(e.async&&!this.hasPlugin("asyncGenerators")?this.unexpected():(e.generator=!0,this.next())),!t||i||this.match(R.name)||this.match(R._yield)||this.unexpected(),(this.match(R.name)||this.match(R._yield))&&(e.id=this.parseBindingIdentifier()),this.parseFunctionParams(e),this.parseFunctionBody(e,r),this.state.inMethod=s,this.finishNode(e,t?"FunctionDeclaration":"FunctionExpression")},z.parseFunctionParams=function(e){this.expect(R.parenL),e.params=this.parseBindingList(R.parenR)},z.parseClass=function(e,t,r){return this.next(),this.takeDecorators(e),this.parseClassId(e,t,r),this.parseClassSuper(e),this.parseClassBody(e),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},z.isClassProperty=function(){return this.match(R.eq)||this.match(R.semi)||this.match(R.braceR)},z.isClassMethod=function(){return this.match(R.parenL)},z.isNonstaticConstructor=function(e){return!(e.computed||e.static||"constructor"!==e.key.name&&"constructor"!==e.key.value)},z.parseClassBody=function(e){var t=this.state.strict;this.state.strict=!0;var r=!1,n=!1,i=[],s=this.startNode();for(s.body=[],this.expect(R.braceL);!this.eat(R.braceR);)if(this.eat(R.semi))i.length>0&&this.raise(this.state.lastTokEnd,"Decorators must not be followed by a semicolon");else if(this.match(R.at))i.push(this.parseDecorator());else{var a=this.startNode();if(i.length&&(a.decorators=i,i=[]),a.static=!1,this.match(R.name)&&"static"===this.state.value){var o=this.parseIdentifier(!0);if(this.isClassMethod()){a.kind="method",a.computed=!1,a.key=o,this.parseClassMethod(s,a,!1,!1);continue}if(this.isClassProperty()){a.computed=!1,a.key=o,s.body.push(this.parseClassProperty(a));continue}a.static=!0}if(this.eat(R.star))a.kind="method",this.parsePropertyName(a),this.isNonstaticConstructor(a)&&this.raise(a.key.start,"Constructor can't be a generator"),a.computed||!a.static||"prototype"!==a.key.name&&"prototype"!==a.key.value||this.raise(a.key.start,"Classes may not have static property named prototype"),this.parseClassMethod(s,a,!0,!1);else{var u=this.match(R.name),l=this.parsePropertyName(a);if(a.computed||!a.static||"prototype"!==a.key.name&&"prototype"!==a.key.value||this.raise(a.key.start,"Classes may not have static property named prototype"),this.isClassMethod())this.isNonstaticConstructor(a)?(n?this.raise(l.start,"Duplicate constructor in the same class"):a.decorators&&this.raise(a.start,"You can't attach decorators to a class constructor"),n=!0,a.kind="constructor"):a.kind="method",this.parseClassMethod(s,a,!1,!1);else if(this.isClassProperty())this.isNonstaticConstructor(a)&&this.raise(a.key.start,"Classes may not have a non-static field named 'constructor'"),s.body.push(this.parseClassProperty(a));else if(u&&"async"===l.name&&!this.isLineTerminator()){var c=this.hasPlugin("asyncGenerators")&&this.eat(R.star);a.kind="method",this.parsePropertyName(a),this.isNonstaticConstructor(a)&&this.raise(a.key.start,"Constructor can't be an async function"),this.parseClassMethod(s,a,c,!0)}else!u||"get"!==l.name&&"set"!==l.name||this.isLineTerminator()&&this.match(R.star)?this.hasPlugin("classConstructorCall")&&u&&"call"===l.name&&this.match(R.name)&&"constructor"===this.state.value?(r?this.raise(a.start,"Duplicate constructor call in the same class"):a.decorators&&this.raise(a.start,"You can't attach decorators to a class constructor"),r=!0,a.kind="constructorCall",this.parsePropertyName(a),this.parseClassMethod(s,a,!1,!1)):this.isLineTerminator()?(this.isNonstaticConstructor(a)&&this.raise(a.key.start,"Classes may not have a non-static field named 'constructor'"),s.body.push(this.parseClassProperty(a))):this.unexpected():(a.kind=l.name,this.parsePropertyName(a),this.isNonstaticConstructor(a)&&this.raise(a.key.start,"Constructor can't have get/set modifier"),this.parseClassMethod(s,a,!1,!1),this.checkGetterSetterParamCount(a))}}i.length&&this.raise(this.state.start,"You have trailing decorators with no method"),e.body=this.finishNode(s,"ClassBody"),this.state.strict=t},z.parseClassProperty=function(e){return this.state.inClassProperty=!0,this.match(R.eq)?(this.hasPlugin("classProperties")||this.unexpected(),this.next(),e.value=this.parseMaybeAssign()):e.value=null,this.semicolon(),this.state.inClassProperty=!1,this.finishNode(e,"ClassProperty")},z.parseClassMethod=function(e,t,r,n){this.parseMethod(t,r,n),e.body.push(this.finishNode(t,"ClassMethod"))},z.parseClassId=function(e,t,r){this.match(R.name)?e.id=this.parseIdentifier():r||!t?e.id=null:this.unexpected()},z.parseClassSuper=function(e){e.superClass=this.eat(R._extends)?this.parseExprSubscripts():null},z.parseExport=function(e){if(this.next(),this.match(R.star)){var t=this.startNode();if(this.next(),!this.hasPlugin("exportExtensions")||!this.eatContextual("as"))return this.parseExportFrom(e,!0),this.finishNode(e,"ExportAllDeclaration");t.exported=this.parseIdentifier(),e.specifiers=[this.finishNode(t,"ExportNamespaceSpecifier")],this.parseExportSpecifiersMaybe(e),this.parseExportFrom(e,!0)}else if(this.hasPlugin("exportExtensions")&&this.isExportDefaultSpecifier()){var r=this.startNode();if(r.exported=this.parseIdentifier(!0),e.specifiers=[this.finishNode(r,"ExportDefaultSpecifier")],this.match(R.comma)&&this.lookahead().type===R.star){this.expect(R.comma);var n=this.startNode();this.expect(R.star),this.expectContextual("as"),n.exported=this.parseIdentifier(),e.specifiers.push(this.finishNode(n,"ExportNamespaceSpecifier"))}else this.parseExportSpecifiersMaybe(e);this.parseExportFrom(e,!0)}else{if(this.eat(R._default)){var i=this.startNode(),s=!1;return this.eat(R._function)?i=this.parseFunction(i,!0,!1,!1,!0):this.match(R._class)?i=this.parseClass(i,!0,!0):(s=!0,i=this.parseMaybeAssign()),e.declaration=i,s&&this.semicolon(),this.checkExport(e,!0,!0),this.finishNode(e,"ExportDefaultDeclaration")}this.shouldParseExportDeclaration()?(e.specifiers=[],e.source=null,e.declaration=this.parseExportDeclaration(e)):(e.declaration=null,e.specifiers=this.parseExportSpecifiers(),this.parseExportFrom(e))}return this.checkExport(e,!0),this.finishNode(e,"ExportNamedDeclaration")},z.parseExportDeclaration=function(){return this.parseStatement(!0)},z.isExportDefaultSpecifier=function(){if(this.match(R.name))return"async"!==this.state.value;if(!this.match(R._default))return!1;var e=this.lookahead();return e.type===R.comma||e.type===R.name&&"from"===e.value},z.parseExportSpecifiersMaybe=function(e){this.eat(R.comma)&&(e.specifiers=e.specifiers.concat(this.parseExportSpecifiers()))},z.parseExportFrom=function(e,t){this.eatContextual("from")?(e.source=this.match(R.string)?this.parseExprAtom():this.unexpected(),this.checkExport(e)):t?this.unexpected():e.source=null,this.semicolon()},z.shouldParseExportDeclaration=function(){return"var"===this.state.type.keyword||"const"===this.state.type.keyword||"let"===this.state.type.keyword||"function"===this.state.type.keyword||"class"===this.state.type.keyword||this.isContextual("async")},z.checkExport=function(e,t,r){if(t)if(r)this.checkDuplicateExports(e,"default");else if(e.specifiers&&e.specifiers.length)for(var n=e.specifiers,i=Array.isArray(n),s=0,n=i?n:n[Symbol.iterator]();;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a;this.checkDuplicateExports(o,o.exported.name)}else if(e.declaration)if("FunctionDeclaration"===e.declaration.type||"ClassDeclaration"===e.declaration.type)this.checkDuplicateExports(e,e.declaration.id.name);else if("VariableDeclaration"===e.declaration.type)for(var u=e.declaration.declarations,l=Array.isArray(u),c=0,u=l?u:u[Symbol.iterator]();;){var f;if(l){if(c>=u.length)break;f=u[c++]}else{if(c=u.next(),c.done)break;f=c.value}var p=f;this.checkDeclaration(p.id)}if(this.state.decorators.length){var d=e.declaration&&("ClassDeclaration"===e.declaration.type||"ClassExpression"===e.declaration.type);e.declaration&&d||this.raise(e.start,"You can only use decorators on an export when exporting a class"),this.takeDecorators(e.declaration)}},z.checkDeclaration=function(e){if("ObjectPattern"===e.type)for(var t=e.properties,r=Array.isArray(t),n=0,t=r?t:t[Symbol.iterator]();;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i;this.checkDeclaration(s)}else if("ArrayPattern"===e.type)for(var a=e.elements,o=Array.isArray(a),u=0,a=o?a:a[Symbol.iterator]();;){var l;if(o){if(u>=a.length)break;l=a[u++]}else{if(u=a.next(),u.done)break;l=u.value}var c=l;c&&this.checkDeclaration(c)}else"ObjectProperty"===e.type?this.checkDeclaration(e.value):"RestElement"===e.type||"RestProperty"===e.type?this.checkDeclaration(e.argument):"Identifier"===e.type&&this.checkDuplicateExports(e,e.name)},z.checkDuplicateExports=function(e,t){this.state.exportedIdentifiers.indexOf(t)>-1&&this.raiseDuplicateExportError(e,t),this.state.exportedIdentifiers.push(t)},z.raiseDuplicateExportError=function(e,t){this.raise(e.start,"default"===t?"Only one default export allowed per module.":"`"+t+"` has already been exported. Exported identifiers must be unique.")},z.parseExportSpecifiers=function(){var e=[],t=!0,r=void 0;for(this.expect(R.braceL);!this.eat(R.braceR);){if(t)t=!1;else if(this.expect(R.comma),this.eat(R.braceR))break;var n=this.match(R._default);n&&!r&&(r=!0);var i=this.startNode();i.local=this.parseIdentifier(n),i.exported=this.eatContextual("as")?this.parseIdentifier(!0):i.local.__clone(),e.push(this.finishNode(i,"ExportSpecifier"))}return r&&!this.isContextual("from")&&this.unexpected(),e},z.parseImport=function(e){return this.eat(R._import),this.match(R.string)?(e.specifiers=[],e.source=this.parseExprAtom()):(e.specifiers=[],this.parseImportSpecifiers(e),this.expectContextual("from"),e.source=this.match(R.string)?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},z.parseImportSpecifiers=function(e){var t=!0;if(this.match(R.name)){var r=this.state.start,n=this.state.startLoc;if(e.specifiers.push(this.parseImportSpecifierDefault(this.parseIdentifier(),r,n)),!this.eat(R.comma))return}if(this.match(R.star)){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdentifier(),this.checkLVal(i.local,!0,void 0,"import namespace specifier"),void e.specifiers.push(this.finishNode(i,"ImportNamespaceSpecifier"))}for(this.expect(R.braceL);!this.eat(R.braceR);){if(t)t=!1;else if(this.eat(R.colon)&&this.unexpected(null,"ES2015 named imports do not destructure. Use another statement for destructuring after the import."),this.expect(R.comma),this.eat(R.braceR))break;this.parseImportSpecifier(e)}},z.parseImportSpecifier=function(e){var t=this.startNode();t.imported=this.parseIdentifier(!0),this.eatContextual("as")?t.local=this.parseIdentifier():(this.checkReservedWord(t.imported.name,t.start,!0,!0),t.local=t.imported.__clone()),this.checkLVal(t.local,!0,void 0,"import specifier"),e.specifiers.push(this.finishNode(t,"ImportSpecifier"))},z.parseImportSpecifierDefault=function(e,t,r){var n=this.startNodeAt(t,r);return n.local=e,this.checkLVal(n.local,!0,void 0,"default import specifier"),this.finishNode(n,"ImportDefaultSpecifier")};var ee=J.prototype;ee.toAssignable=function(e,t,r){if(e)switch(e.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":break;case"ObjectExpression":e.type="ObjectPattern";for(var n=e.properties,i=Array.isArray(n),s=0,n=i?n:n[Symbol.iterator]();;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a;"ObjectMethod"===o.type?"get"===o.kind||"set"===o.kind?this.raise(o.key.start,"Object pattern can't contain getter or setter"):this.raise(o.key.start,"Object pattern can't contain methods"):this.toAssignable(o,t,"object destructuring pattern")}break;case"ObjectProperty":this.toAssignable(e.value,t,r);break;case"SpreadProperty":e.type="RestProperty";var u=e.argument;this.toAssignable(u,t,r);break;case"ArrayExpression":e.type="ArrayPattern",this.toAssignableList(e.elements,t,r);break;case"AssignmentExpression":"="===e.operator?(e.type="AssignmentPattern",delete e.operator):this.raise(e.left.end,"Only '=' operator can be used for specifying default value.");break;case"MemberExpression":if(!t)break;default:var l="Invalid left-hand side"+(r?" in "+r:"expression");this.raise(e.start,l)}return e},ee.toAssignableList=function(e,t,r){var n=e.length;if(n){var i=e[n-1];if(i&&"RestElement"===i.type)--n;else if(i&&"SpreadElement"===i.type){i.type="RestElement";var s=i.argument;this.toAssignable(s,t,r),"Identifier"!==s.type&&"MemberExpression"!==s.type&&"ArrayPattern"!==s.type&&this.unexpected(s.start),--n}}for(var a=0;a<n;a++){var o=e[a];o&&this.toAssignable(o,t,r)}return e},ee.toReferencedList=function(e){return e},ee.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},ee.parseRest=function(){var e=this.startNode();return this.next(),e.argument=this.parseBindingIdentifier(),this.finishNode(e,"RestElement")},ee.shouldAllowYieldIdentifier=function(){return this.match(R._yield)&&!this.state.strict&&!this.state.inGenerator},ee.parseBindingIdentifier=function(){return this.parseIdentifier(this.shouldAllowYieldIdentifier())},ee.parseBindingAtom=function(){switch(this.state.type){case R._yield:(this.state.strict||this.state.inGenerator)&&this.unexpected();case R.name:return this.parseIdentifier(!0);case R.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(R.bracketR,!0),this.finishNode(e,"ArrayPattern");case R.braceL:return this.parseObj(!0);default:this.unexpected()}},ee.parseBindingList=function(e,t){for(var r=[],n=!0;!this.eat(e);)if(n?n=!1:this.expect(R.comma),t&&this.match(R.comma))r.push(null);else{if(this.eat(e))break;if(this.match(R.ellipsis)){r.push(this.parseAssignableListItemTypes(this.parseRest())),this.expect(e);break}for(var i=[];this.match(R.at);)i.push(this.parseDecorator());var s=this.parseMaybeDefault();i.length&&(s.decorators=i),this.parseAssignableListItemTypes(s),r.push(this.parseMaybeDefault(s.start,s.loc.start,s))}return r},ee.parseAssignableListItemTypes=function(e){return e},ee.parseMaybeDefault=function(e,t,r){if(t=t||this.state.startLoc,e=e||this.state.start,r=r||this.parseBindingAtom(),!this.eat(R.eq))return r;var n=this.startNodeAt(e,t);return n.left=r,n.right=this.parseMaybeAssign(),this.finishNode(n,"AssignmentPattern")},ee.checkLVal=function(e,t,r,n){switch(e.type){case"Identifier":if(this.checkReservedWord(e.name,e.start,!1,!0),r){var i="_"+e.name;r[i]?this.raise(e.start,"Argument name clash in strict mode"):r[i]=!0}break;case"MemberExpression":t&&this.raise(e.start,(t?"Binding":"Assigning to")+" member expression");break;case"ObjectPattern":for(var s=e.properties,a=Array.isArray(s),o=0,s=a?s:s[Symbol.iterator]();;){var u;if(a){if(o>=s.length)break;u=s[o++]}else{if(o=s.next(),o.done)break;u=o.value}var l=u;"ObjectProperty"===l.type&&(l=l.value),this.checkLVal(l,t,r,"object destructuring pattern")}break;case"ArrayPattern":for(var c=e.elements,f=Array.isArray(c),p=0,c=f?c:c[Symbol.iterator]();;){var d;if(f){if(p>=c.length)break;d=c[p++]}else{if(p=c.next(),p.done)break;d=p.value}var h=d;h&&this.checkLVal(h,t,r,"array destructuring pattern")}break;case"AssignmentPattern":this.checkLVal(e.left,t,r,"assignment pattern");break;case"RestProperty":this.checkLVal(e.argument,t,r,"rest property");break;case"RestElement":this.checkLVal(e.argument,t,r,"rest element");break;default:var m=(t?"Binding invalid":"Invalid")+" left-hand side"+(n?" in "+n:"expression");this.raise(e.start,m)}};var te=J.prototype;te.checkPropClash=function(e,t){if(!e.computed&&!e.kind){var r=e.key;"__proto__"===("Identifier"===r.type?r.name:String(r.value))&&(t.proto&&this.raise(r.start,"Redefinition of __proto__ property"),t.proto=!0)}},te.getExpression=function(){this.nextToken();var e=this.parseExpression();return this.match(R.eof)||this.unexpected(),e},te.parseExpression=function(e,t){var r=this.state.start,n=this.state.startLoc,i=this.parseMaybeAssign(e,t);if(this.match(R.comma)){var s=this.startNodeAt(r,n);for(s.expressions=[i];this.eat(R.comma);)s.expressions.push(this.parseMaybeAssign(e,t));return this.toReferencedList(s.expressions),this.finishNode(s,"SequenceExpression")}return i},te.parseMaybeAssign=function(e,t,r,n){var i=this.state.start,s=this.state.startLoc;if(this.match(R._yield)&&this.state.inGenerator){var a=this.parseYield();return r&&(a=r.call(this,a,i,s)),a}var o=void 0;t?o=!1:(t={start:0},o=!0),(this.match(R.parenL)||this.match(R.name))&&(this.state.potentialArrowAt=this.state.start);var u=this.parseMaybeConditional(e,t,n);if(r&&(u=r.call(this,u,i,s)),this.state.type.isAssign){var l=this.startNodeAt(i,s);if(l.operator=this.state.value,l.left=this.match(R.eq)?this.toAssignable(u,void 0,"assignment expression"):u,t.start=0,this.checkLVal(u,void 0,void 0,"assignment expression"),u.extra&&u.extra.parenthesized){var c=void 0;"ObjectPattern"===u.type?c="`({a}) = 0` use `({a} = 0)`":"ArrayPattern"===u.type&&(c="`([a]) = 0` use `([a] = 0)`"),c&&this.raise(u.start,"You're trying to assign to a parenthesized expression, eg. instead of "+c)}return this.next(),l.right=this.parseMaybeAssign(e),this.finishNode(l,"AssignmentExpression")}return o&&t.start&&this.unexpected(t.start),u},te.parseMaybeConditional=function(e,t,r){var n=this.state.start,i=this.state.startLoc,s=this.parseExprOps(e,t);return t&&t.start?s:this.parseConditional(s,e,n,i,r)},te.parseConditional=function(e,t,r,n){if(this.eat(R.question)){var i=this.startNodeAt(r,n);return i.test=e,i.consequent=this.parseMaybeAssign(),this.expect(R.colon),i.alternate=this.parseMaybeAssign(t),this.finishNode(i,"ConditionalExpression")}return e},te.parseExprOps=function(e,t){var r=this.state.start,n=this.state.startLoc,i=this.parseMaybeUnary(t);return t&&t.start?i:this.parseExprOp(i,r,n,-1,e)},te.parseExprOp=function(e,t,r,n,i){var s=this.state.type.binop;if(!(null==s||i&&this.match(R._in))&&s>n){var a=this.startNodeAt(t,r);a.left=e,a.operator=this.state.value,"**"!==a.operator||"UnaryExpression"!==e.type||!e.extra||e.extra.parenthesizedArgument||e.extra.parenthesized||this.raise(e.argument.start,"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.");var o=this.state.type;this.next();var u=this.state.start,l=this.state.startLoc;return a.right=this.parseExprOp(this.parseMaybeUnary(),u,l,o.rightAssociative?s-1:s,i),this.finishNode(a,o===R.logicalOR||o===R.logicalAND?"LogicalExpression":"BinaryExpression"),this.parseExprOp(a,t,r,n,i)}return e},te.parseMaybeUnary=function(e){if(this.state.type.prefix){var t=this.startNode(),r=this.match(R.incDec);t.operator=this.state.value,t.prefix=!0,this.next();var n=this.state.type;return t.argument=this.parseMaybeUnary(),this.addExtra(t,"parenthesizedArgument",!(n!==R.parenL||t.argument.extra&&t.argument.extra.parenthesized)),e&&e.start&&this.unexpected(e.start),r?this.checkLVal(t.argument,void 0,void 0,"prefix operation"):this.state.strict&&"delete"===t.operator&&"Identifier"===t.argument.type&&this.raise(t.start,"Deleting local variable in strict mode"),this.finishNode(t,r?"UpdateExpression":"UnaryExpression")}var i=this.state.start,s=this.state.startLoc,a=this.parseExprSubscripts(e);if(e&&e.start)return a;for(;this.state.type.postfix&&!this.canInsertSemicolon();){var o=this.startNodeAt(i,s);o.operator=this.state.value,o.prefix=!1,o.argument=a,this.checkLVal(a,void 0,void 0,"postfix operation"),this.next(),a=this.finishNode(o,"UpdateExpression")}return a},te.parseExprSubscripts=function(e){var t=this.state.start,r=this.state.startLoc,n=this.state.potentialArrowAt,i=this.parseExprAtom(e);return"ArrowFunctionExpression"===i.type&&i.start===n?i:e&&e.start?i:this.parseSubscripts(i,t,r)},te.parseSubscripts=function(e,t,r,n){for(;;){if(!n&&this.eat(R.doubleColon)){var i=this.startNodeAt(t,r);return i.object=e,i.callee=this.parseNoCallExpr(),this.parseSubscripts(this.finishNode(i,"BindExpression"),t,r,n)}if(this.eat(R.dot)){var s=this.startNodeAt(t,r);s.object=e,s.property=this.parseIdentifier(!0),s.computed=!1,e=this.finishNode(s,"MemberExpression")}else if(this.eat(R.bracketL)){var a=this.startNodeAt(t,r);a.object=e,a.property=this.parseExpression(),a.computed=!0,this.expect(R.bracketR),e=this.finishNode(a,"MemberExpression")}else if(!n&&this.match(R.parenL)){var o=this.state.potentialArrowAt===e.start&&"Identifier"===e.type&&"async"===e.name&&!this.canInsertSemicolon();this.next();var u=this.startNodeAt(t,r);if(u.callee=e,u.arguments=this.parseCallExpressionArguments(R.parenR,o),"Import"===u.callee.type&&1!==u.arguments.length&&this.raise(u.start,"import() requires exactly one argument"),e=this.finishNode(u,"CallExpression"),o&&this.shouldParseAsyncArrow())return this.parseAsyncArrowFromCallExpression(this.startNodeAt(t,r),u);this.toReferencedList(u.arguments)}else{if(!this.match(R.backQuote))return e;var l=this.startNodeAt(t,r);l.tag=e,l.quasi=this.parseTemplate(!0),e=this.finishNode(l,"TaggedTemplateExpression")}}},te.parseCallExpressionArguments=function(e,t){for(var r=[],n=void 0,i=!0;!this.eat(e);){if(i)i=!1;else if(this.expect(R.comma),this.eat(e))break;this.match(R.parenL)&&!n&&(n=this.state.start),r.push(this.parseExprListItem(!1,t?{start:0}:void 0,t?{start:0}:void 0))}return t&&n&&this.shouldParseAsyncArrow()&&this.unexpected(),r},te.shouldParseAsyncArrow=function(){return this.match(R.arrow)},te.parseAsyncArrowFromCallExpression=function(e,t){return this.expect(R.arrow),this.parseArrowExpression(e,t.arguments,!0)},te.parseNoCallExpr=function(){var e=this.state.start,t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),e,t,!0)},te.parseExprAtom=function(e){var t=this.state.potentialArrowAt===this.state.start,r=void 0;switch(this.state.type){case R._super:return this.state.inMethod||this.state.inClassProperty||this.options.allowSuperOutsideMethod||this.raise(this.state.start,"'super' outside of function or class"),r=this.startNode(),this.next(),this.match(R.parenL)||this.match(R.bracketL)||this.match(R.dot)||this.unexpected(),this.match(R.parenL)&&"constructor"!==this.state.inMethod&&!this.options.allowSuperOutsideMethod&&this.raise(r.start,"super() outside of class constructor"),this.finishNode(r,"Super");case R._import:return this.hasPlugin("dynamicImport")||this.unexpected(),r=this.startNode(),this.next(),this.match(R.parenL)||this.unexpected(null,R.parenL),this.finishNode(r,"Import");case R._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case R._yield:this.state.inGenerator&&this.unexpected();case R.name:r=this.startNode();var n="await"===this.state.value&&this.state.inAsync,i=this.shouldAllowYieldIdentifier(),s=this.parseIdentifier(n||i);if("await"===s.name){if(this.state.inAsync||this.inModule)return this.parseAwait(r)}else{if("async"===s.name&&this.match(R._function)&&!this.canInsertSemicolon())return this.next(),this.parseFunction(r,!1,!1,!0);if(t&&"async"===s.name&&this.match(R.name)){var a=[this.parseIdentifier()];return this.expect(R.arrow),this.parseArrowExpression(r,a,!0)}}return t&&!this.canInsertSemicolon()&&this.eat(R.arrow)?this.parseArrowExpression(r,[s]):s;case R._do:if(this.hasPlugin("doExpressions")){var o=this.startNode();this.next();var u=this.state.inFunction,l=this.state.labels;return this.state.labels=[],this.state.inFunction=!1,o.body=this.parseBlock(!1,!0),this.state.inFunction=u,this.state.labels=l,this.finishNode(o,"DoExpression")}case R.regexp:var c=this.state.value;return r=this.parseLiteral(c.value,"RegExpLiteral"),r.pattern=c.pattern,r.flags=c.flags,r;case R.num:return this.parseLiteral(this.state.value,"NumericLiteral");case R.string:return this.parseLiteral(this.state.value,"StringLiteral");case R._null:return r=this.startNode(),this.next(),this.finishNode(r,"NullLiteral");case R._true:case R._false:return r=this.startNode(),r.value=this.match(R._true),this.next(),this.finishNode(r,"BooleanLiteral");case R.parenL:return this.parseParenAndDistinguishExpression(null,null,t);case R.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(R.bracketR,!0,e),this.toReferencedList(r.elements),this.finishNode(r,"ArrayExpression");case R.braceL:return this.parseObj(!1,e);case R._function:return this.parseFunctionExpression();case R.at:this.parseDecorators();case R._class:return r=this.startNode(),this.takeDecorators(r),this.parseClass(r,!1);case R._new:return this.parseNew();case R.backQuote:return this.parseTemplate(!1);case R.doubleColon:r=this.startNode(),this.next(),r.object=null;var f=r.callee=this.parseNoCallExpr();if("MemberExpression"===f.type)return this.finishNode(r,"BindExpression");this.raise(f.start,"Binding should be performed on object property.");default:this.unexpected()}},te.parseFunctionExpression=function(){var e=this.startNode(),t=this.parseIdentifier(!0);return this.state.inGenerator&&this.eat(R.dot)&&this.hasPlugin("functionSent")?this.parseMetaProperty(e,t,"sent"):this.parseFunction(e,!1)},te.parseMetaProperty=function(e,t,r){return e.meta=t,e.property=this.parseIdentifier(!0),e.property.name!==r&&this.raise(e.property.start,"The only valid meta property for new is "+t.name+"."+r),this.finishNode(e,"MetaProperty")},te.parseLiteral=function(e,t,r,n){r=r||this.state.start,n=n||this.state.startLoc;var i=this.startNodeAt(r,n);return this.addExtra(i,"rawValue",e),this.addExtra(i,"raw",this.input.slice(r,this.state.end)),i.value=e,this.next(),this.finishNode(i,t)},te.parseParenExpression=function(){this.expect(R.parenL);var e=this.parseExpression();return this.expect(R.parenR),e},te.parseParenAndDistinguishExpression=function(e,t,r){e=e||this.state.start,t=t||this.state.startLoc;var n=void 0;this.expect(R.parenL);for(var i=this.state.start,s=this.state.startLoc,a=[],o={start:0},u={start:0},l=!0,c=void 0,f=void 0;!this.match(R.parenR);){if(l)l=!1;else if(this.expect(R.comma,u.start||null),this.match(R.parenR)){f=this.state.start;break} if(this.match(R.ellipsis)){var p=this.state.start,d=this.state.startLoc;c=this.state.start,a.push(this.parseParenItem(this.parseRest(),p,d));break}a.push(this.parseMaybeAssign(!1,o,this.parseParenItem,u))}var h=this.state.start,m=this.state.startLoc;this.expect(R.parenR);var y=this.startNodeAt(e,t);if(r&&this.shouldParseArrow()&&(y=this.parseArrow(y))){for(var v=a,g=Array.isArray(v),b=0,v=g?v:v[Symbol.iterator]();;){var E;if(g){if(b>=v.length)break;E=v[b++]}else{if(b=v.next(),b.done)break;E=b.value}var x=E;x.extra&&x.extra.parenthesized&&this.unexpected(x.extra.parenStart)}return this.parseArrowExpression(y,a)}return a.length||this.unexpected(this.state.lastTokStart),f&&this.unexpected(f),c&&this.unexpected(c),o.start&&this.unexpected(o.start),u.start&&this.unexpected(u.start),a.length>1?(n=this.startNodeAt(i,s),n.expressions=a,this.toReferencedList(n.expressions),this.finishNodeAt(n,"SequenceExpression",h,m)):n=a[0],this.addExtra(n,"parenthesized",!0),this.addExtra(n,"parenStart",e),n},te.shouldParseArrow=function(){return!this.canInsertSemicolon()},te.parseArrow=function(e){if(this.eat(R.arrow))return e},te.parseParenItem=function(e){return e},te.parseNew=function(){var e=this.startNode(),t=this.parseIdentifier(!0);if(this.eat(R.dot)){var r=this.parseMetaProperty(e,t,"target");return this.state.inFunction||this.raise(r.property.start,"new.target can only be used in functions"),r}return e.callee=this.parseNoCallExpr(),this.eat(R.parenL)?(e.arguments=this.parseExprList(R.parenR),this.toReferencedList(e.arguments)):e.arguments=[],this.finishNode(e,"NewExpression")},te.parseTemplateElement=function(e){var t=this.startNode();return null===this.state.value&&(e&&this.hasPlugin("templateInvalidEscapes")?this.state.invalidTemplateEscapePosition=null:this.raise(this.state.invalidTemplateEscapePosition,"Invalid escape sequence in template")),t.value={raw:this.input.slice(this.state.start,this.state.end).replace(/\r\n?/g,"\n"),cooked:this.state.value},this.next(),t.tail=this.match(R.backQuote),this.finishNode(t,"TemplateElement")},te.parseTemplate=function(e){var t=this.startNode();this.next(),t.expressions=[];var r=this.parseTemplateElement(e);for(t.quasis=[r];!r.tail;)this.expect(R.dollarBraceL),t.expressions.push(this.parseExpression()),this.expect(R.braceR),t.quasis.push(r=this.parseTemplateElement(e));return this.next(),this.finishNode(t,"TemplateLiteral")},te.parseObj=function(e,t){var r=[],n=Object.create(null),i=!0,s=this.startNode();s.properties=[],this.next();for(var a=null;!this.eat(R.braceR);){if(i)i=!1;else if(this.expect(R.comma),this.eat(R.braceR))break;for(;this.match(R.at);)r.push(this.parseDecorator());var o=this.startNode(),u=!1,l=!1,c=void 0,f=void 0;if(r.length&&(o.decorators=r,r=[]),this.hasPlugin("objectRestSpread")&&this.match(R.ellipsis)){if(o=this.parseSpread(e?{start:0}:void 0),o.type=e?"RestProperty":"SpreadProperty",e&&this.toAssignable(o.argument,!0,"object pattern"),s.properties.push(o),!e)continue;var p=this.state.start;if(null===a){if(this.eat(R.braceR))break;if(this.match(R.comma)&&this.lookahead().type===R.braceR)continue;a=p;continue}this.unexpected(a,"Cannot have multiple rest elements when destructuring")}if(o.method=!1,o.shorthand=!1,(e||t)&&(c=this.state.start,f=this.state.startLoc),e||(u=this.eat(R.star)),!e&&this.isContextual("async")){u&&this.unexpected();var d=this.parseIdentifier();this.match(R.colon)||this.match(R.parenL)||this.match(R.braceR)||this.match(R.eq)||this.match(R.comma)?(o.key=d,o.computed=!1):(l=!0,this.hasPlugin("asyncGenerators")&&(u=this.eat(R.star)),this.parsePropertyName(o))}else this.parsePropertyName(o);this.parseObjPropValue(o,c,f,u,l,e,t),this.checkPropClash(o,n),o.shorthand&&this.addExtra(o,"shorthand",!0),s.properties.push(o)}return null!==a&&this.unexpected(a,"The rest element has to be the last element when destructuring"),r.length&&this.raise(this.state.start,"You have trailing decorators with no property"),this.finishNode(s,e?"ObjectPattern":"ObjectExpression")},te.isGetterOrSetterMethod=function(e,t){return!t&&!e.computed&&"Identifier"===e.key.type&&("get"===e.key.name||"set"===e.key.name)&&(this.match(R.string)||this.match(R.num)||this.match(R.bracketL)||this.match(R.name)||this.state.type.keyword)},te.checkGetterSetterParamCount=function(e){var t="get"===e.kind?0:1;if(e.params.length!==t){var r=e.start;"get"===e.kind?this.raise(r,"getter should have no params"):this.raise(r,"setter should have exactly one param")}},te.parseObjectMethod=function(e,t,r,n){return r||t||this.match(R.parenL)?(n&&this.unexpected(),e.kind="method",e.method=!0,this.parseMethod(e,t,r),this.finishNode(e,"ObjectMethod")):this.isGetterOrSetterMethod(e,n)?((t||r)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),this.parseMethod(e),this.checkGetterSetterParamCount(e),this.finishNode(e,"ObjectMethod")):void 0},te.parseObjectProperty=function(e,t,r,n,i){return this.eat(R.colon)?(e.value=n?this.parseMaybeDefault(this.state.start,this.state.startLoc):this.parseMaybeAssign(!1,i),this.finishNode(e,"ObjectProperty")):e.computed||"Identifier"!==e.key.type?void 0:(this.checkReservedWord(e.key.name,e.key.start,!0,!0),n?e.value=this.parseMaybeDefault(t,r,e.key.__clone()):this.match(R.eq)&&i?(i.start||(i.start=this.state.start),e.value=this.parseMaybeDefault(t,r,e.key.__clone())):e.value=e.key.__clone(),e.shorthand=!0,this.finishNode(e,"ObjectProperty"))},te.parseObjPropValue=function(e,t,r,n,i,s,a){var o=this.parseObjectMethod(e,n,i,s)||this.parseObjectProperty(e,t,r,s,a);return o||this.unexpected(),o},te.parsePropertyName=function(e){if(this.eat(R.bracketL))e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(R.bracketR);else{e.computed=!1;var t=this.state.inPropertyName;this.state.inPropertyName=!0,e.key=this.match(R.num)||this.match(R.string)?this.parseExprAtom():this.parseIdentifier(!0),this.state.inPropertyName=t}return e.key},te.initFunction=function(e,t){e.id=null,e.generator=!1,e.expression=!1,e.async=!!t},te.parseMethod=function(e,t,r){var n=this.state.inMethod;return this.state.inMethod=e.kind||!0,this.initFunction(e,r),this.expect(R.parenL),e.params=this.parseBindingList(R.parenR),e.generator=!!t,this.parseFunctionBody(e),this.state.inMethod=n,e},te.parseArrowExpression=function(e,t,r){return this.initFunction(e,r),e.params=this.toAssignableList(t,!0,"arrow function parameters"),this.parseFunctionBody(e,!0),this.finishNode(e,"ArrowFunctionExpression")},te.isStrictBody=function(e,t){if(!t&&e.body.directives.length)for(var r=e.body.directives,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var a=s;if("use strict"===a.value.value)return!0}return!1},te.parseFunctionBody=function(e,t){var r=t&&!this.match(R.braceL),n=this.state.inAsync;if(this.state.inAsync=e.async,r)e.body=this.parseMaybeAssign(),e.expression=!0;else{var i=this.state.inFunction,s=this.state.inGenerator,a=this.state.labels;this.state.inFunction=!0,this.state.inGenerator=e.generator,this.state.labels=[],e.body=this.parseBlock(!0),e.expression=!1,this.state.inFunction=i,this.state.inGenerator=s,this.state.labels=a}this.state.inAsync=n;var o=this.isStrictBody(e,r),u=this.state.strict||t||o;if(o&&e.id&&"Identifier"===e.id.type&&"yield"===e.id.name&&this.raise(e.id.start,"Binding yield in strict mode"),u){var l=Object.create(null),c=this.state.strict;o&&(this.state.strict=!0),e.id&&this.checkLVal(e.id,!0,void 0,"function name");for(var f=e.params,p=Array.isArray(f),d=0,f=p?f:f[Symbol.iterator]();;){var h;if(p){if(d>=f.length)break;h=f[d++]}else{if(d=f.next(),d.done)break;h=d.value}var m=h;o&&"Identifier"!==m.type&&this.raise(m.start,"Non-simple parameter in strict mode"),this.checkLVal(m,!0,l,"function parameter list")}this.state.strict=c}},te.parseExprList=function(e,t,r){for(var n=[],i=!0;!this.eat(e);){if(i)i=!1;else if(this.expect(R.comma),this.eat(e))break;n.push(this.parseExprListItem(t,r))}return n},te.parseExprListItem=function(e,t,r){return e&&this.match(R.comma)?null:this.match(R.ellipsis)?this.parseSpread(t):this.parseMaybeAssign(!1,t,this.parseParenItem,r)},te.parseIdentifier=function(e){var t=this.startNode();return e||this.checkReservedWord(this.state.value,this.state.start,!!this.state.type.keyword,!1),this.match(R.name)?t.name=this.state.value:this.state.type.keyword?t.name=this.state.type.keyword:this.unexpected(),!e&&"await"===t.name&&this.state.inAsync&&this.raise(t.start,"invalid use of await inside of an async function"),t.loc.identifierName=t.name,this.next(),this.finishNode(t,"Identifier")},te.checkReservedWord=function(e,t,r,n){(this.isReservedWord(e)||r&&this.isKeyword(e))&&this.raise(t,e+" is a reserved word"),this.state.strict&&(v.strict(e)||n&&v.strictBind(e))&&this.raise(t,e+" is a reserved word in strict mode")},te.parseAwait=function(e){return this.state.inAsync||this.unexpected(),this.match(R.star)&&this.raise(e.start,"await* has been removed from the async functions proposal. Use Promise.all() instead."),e.argument=this.parseMaybeUnary(),this.finishNode(e,"AwaitExpression")},te.parseYield=function(){var e=this.startNode();return this.next(),this.match(R.semi)||this.canInsertSemicolon()||!this.match(R.star)&&!this.state.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(R.star),e.argument=this.parseMaybeAssign()),this.finishNode(e,"YieldExpression")};var re=J.prototype,ne=["leadingComments","trailingComments","innerComments"],ie=function(){function e(t,r,n){w(this,e),this.type="",this.start=t,this.end=0,this.loc=new G(r),n&&(this.loc.filename=n)}return e.prototype.__clone=function(){var t=new e;for(var r in this)ne.indexOf(r)<0&&(t[r]=this[r]);return t},e}();re.startNode=function(){return new ie(this.state.start,this.state.startLoc,this.filename)},re.startNodeAt=function(e,t){return new ie(e,t,this.filename)},re.finishNode=function(e,t){return c.call(this,e,t,this.state.lastTokEnd,this.state.lastTokEndLoc)},re.finishNodeAt=function(e,t,r,n){return c.call(this,e,t,r,n)},J.prototype.raise=function(e,t){var r=u(this.input,e);t+=" ("+r.line+":"+r.column+")";var n=new SyntaxError(t);throw n.pos=e,n.loc=r,n};var se=J.prototype;se.addComment=function(e){this.filename&&(e.loc.filename=this.filename),this.state.trailingComments.push(e),this.state.leadingComments.push(e)},se.processComment=function(e){if(!("Program"===e.type&&e.body.length>0)){var t=this.state.commentStack,r=void 0,n=void 0,i=void 0,s=void 0,a=void 0;if(this.state.trailingComments.length>0)this.state.trailingComments[0].start>=e.end?(i=this.state.trailingComments,this.state.trailingComments=[]):this.state.trailingComments.length=0;else{var o=f(t);t.length>0&&o.trailingComments&&o.trailingComments[0].start>=e.end&&(i=o.trailingComments,o.trailingComments=null)}for(t.length>0&&f(t).start>=e.start&&(r=t.pop());t.length>0&&f(t).start>=e.start;)n=t.pop();if(!n&&r&&(n=r),r&&this.state.leadingComments.length>0){var u=f(this.state.leadingComments);if("ObjectProperty"===r.type){if(u.start>=e.start&&this.state.commentPreviousNode){for(a=0;a<this.state.leadingComments.length;a++)this.state.leadingComments[a].end<this.state.commentPreviousNode.end&&(this.state.leadingComments.splice(a,1),a--);this.state.leadingComments.length>0&&(r.trailingComments=this.state.leadingComments,this.state.leadingComments=[])}}else if("CallExpression"===e.type&&e.arguments&&e.arguments.length){var l=f(e.arguments);l&&u.start>=l.start&&u.end<=e.end&&this.state.commentPreviousNode&&this.state.leadingComments.length>0&&(l.trailingComments=this.state.leadingComments,this.state.leadingComments=[])}}if(n){if(n.leadingComments)if(n!==e&&f(n.leadingComments).end<=e.start)e.leadingComments=n.leadingComments,n.leadingComments=null;else for(s=n.leadingComments.length-2;s>=0;--s)if(n.leadingComments[s].end<=e.start){e.leadingComments=n.leadingComments.splice(0,s+1);break}}else if(this.state.leadingComments.length>0)if(f(this.state.leadingComments).end<=e.start){if(this.state.commentPreviousNode)for(a=0;a<this.state.leadingComments.length;a++)this.state.leadingComments[a].end<this.state.commentPreviousNode.end&&(this.state.leadingComments.splice(a,1),a--);this.state.leadingComments.length>0&&(e.leadingComments=this.state.leadingComments,this.state.leadingComments=[])}else{for(s=0;s<this.state.leadingComments.length&&!(this.state.leadingComments[s].end>e.start);s++);e.leadingComments=this.state.leadingComments.slice(0,s),0===e.leadingComments.length&&(e.leadingComments=null),i=this.state.leadingComments.slice(s),0===i.length&&(i=null)}this.state.commentPreviousNode=e,i&&(i.length&&i[0].start>=e.start&&f(i).end<=e.end?e.innerComments=i:e.trailingComments=i),t.push(e)}};var ae=J.prototype;ae.estreeParseRegExpLiteral=function(e){var t=e.pattern,r=e.flags,n=null;try{n=new RegExp(t,r)}catch(e){}var i=this.estreeParseLiteral(n);return i.regex={pattern:t,flags:r},i},ae.estreeParseLiteral=function(e){return this.parseLiteral(e,"Literal")},ae.directiveToStmt=function(e){var t=e.value,r=this.startNodeAt(e.start,e.loc.start),n=this.startNodeAt(t.start,t.loc.start);return n.value=t.value,n.raw=t.extra.raw,r.expression=this.finishNodeAt(n,"Literal",t.end,t.loc.end),r.directive=t.extra.raw.slice(1,-1),this.finishNodeAt(r,"ExpressionStatement",e.end,e.loc.end)};var oe=function(e){e.extend("checkDeclaration",function(e){return function(t){p(t)?this.checkDeclaration(t.value):e.call(this,t)}}),e.extend("checkGetterSetterParamCount",function(){return function(e){var t="get"===e.kind?0:1;if(e.value.params.length!==t){var r=e.start;"get"===e.kind?this.raise(r,"getter should have no params"):this.raise(r,"setter should have exactly one param")}}}),e.extend("checkLVal",function(e){return function(t,r,n){var i=this;switch(t.type){case"ObjectPattern":t.properties.forEach(function(e){i.checkLVal("Property"===e.type?e.value:e,r,n,"object destructuring pattern")});break;default:for(var s=arguments.length,a=Array(s>3?s-3:0),o=3;o<s;o++)a[o-3]=arguments[o];e.call.apply(e,[this,t,r,n].concat(a))}}}),e.extend("checkPropClash",function(){return function(e,t){if(!e.computed&&p(e)){var r=e.key;"__proto__"===("Identifier"===r.type?r.name:String(r.value))&&(t.proto&&this.raise(r.start,"Redefinition of __proto__ property"),t.proto=!0)}}}),e.extend("isStrictBody",function(){return function(e,t){if(!t&&e.body.body.length>0)for(var r=e.body.body,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var a=s;if("ExpressionStatement"!==a.type||"Literal"!==a.expression.type)break;if("use strict"===a.expression.value)return!0}return!1}}),e.extend("isValidDirective",function(){return function(e){return!("ExpressionStatement"!==e.type||"Literal"!==e.expression.type||"string"!=typeof e.expression.value||e.expression.extra&&e.expression.extra.parenthesized)}}),e.extend("stmtToDirective",function(e){return function(t){var r=e.call(this,t),n=t.expression.value;return r.value.value=n,r}}),e.extend("parseBlockBody",function(e){return function(t){for(var r=this,n=arguments.length,i=Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];e.call.apply(e,[this,t].concat(i)),t.directives.reverse().forEach(function(e){t.body.unshift(r.directiveToStmt(e))}),delete t.directives}}),e.extend("parseClassMethod",function(){return function(e,t,r,n){this.parseMethod(t,r,n),t.typeParameters&&(t.value.typeParameters=t.typeParameters,delete t.typeParameters),e.body.push(this.finishNode(t,"MethodDefinition"))}}),e.extend("parseExprAtom",function(e){return function(){switch(this.state.type){case R.regexp:return this.estreeParseRegExpLiteral(this.state.value);case R.num:case R.string:return this.estreeParseLiteral(this.state.value);case R._null:return this.estreeParseLiteral(null);case R._true:return this.estreeParseLiteral(!0);case R._false:return this.estreeParseLiteral(!1);default:for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.call.apply(e,[this].concat(r))}}}),e.extend("parseLiteral",function(e){return function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=e.call.apply(e,[this].concat(r));return i.raw=i.extra.raw,delete i.extra,i}}),e.extend("parseMethod",function(e){return function(t){var r=this.startNode();r.kind=t.kind;for(var n=arguments.length,i=Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return r=e.call.apply(e,[this,r].concat(i)),delete r.kind,t.value=this.finishNode(r,"FunctionExpression"),t}}),e.extend("parseObjectMethod",function(e){return function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=e.call.apply(e,[this].concat(r));return i&&("method"===i.kind&&(i.kind="init"),i.type="Property"),i}}),e.extend("parseObjectProperty",function(e){return function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=e.call.apply(e,[this].concat(r));return i&&(i.kind="init",i.type="Property"),i}}),e.extend("toAssignable",function(e){return function(t,r){for(var n=arguments.length,i=Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];if(p(t))return this.toAssignable.apply(this,[t.value,r].concat(i)),t;if("ObjectExpression"===t.type){t.type="ObjectPattern";for(var a=t.properties,o=Array.isArray(a),u=0,a=o?a:a[Symbol.iterator]();;){var l;if(o){if(u>=a.length)break;l=a[u++]}else{if(u=a.next(),u.done)break;l=u.value}var c=l;"get"===c.kind||"set"===c.kind?this.raise(c.key.start,"Object pattern can't contain getter or setter"):c.method?this.raise(c.key.start,"Object pattern can't contain methods"):this.toAssignable(c,r,"object destructuring pattern")}return t}return e.call.apply(e,[this,t,r].concat(i))}})},ue=["any","mixed","empty","bool","boolean","number","string","void","null"],le=J.prototype;le.flowParseTypeInitialiser=function(e){var t=this.state.inType;this.state.inType=!0,this.expect(e||R.colon);var r=this.flowParseType();return this.state.inType=t,r},le.flowParsePredicate=function(){var e=this.startNode(),t=this.state.startLoc,r=this.state.start;this.expect(R.modulo);var n=this.state.startLoc;return this.expectContextual("checks"),t.line===n.line&&t.column===n.column-1||this.raise(r,"Spaces between ´%´ and ´checks´ are not allowed here."),this.eat(R.parenL)?(e.expression=this.parseExpression(),this.expect(R.parenR),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")},le.flowParseTypeAndPredicateInitialiser=function(){var e=this.state.inType;this.state.inType=!0,this.expect(R.colon);var t=null,r=null;return this.match(R.modulo)?(this.state.inType=e,r=this.flowParsePredicate()):(t=this.flowParseType(),this.state.inType=e,this.match(R.modulo)&&(r=this.flowParsePredicate())),[t,r]},le.flowParseDeclareClass=function(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")},le.flowParseDeclareFunction=function(e){this.next();var t=e.id=this.parseIdentifier(),r=this.startNode(),n=this.startNode();this.isRelational("<")?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,this.expect(R.parenL);var i=this.flowParseFunctionTypeParams();r.params=i.params,r.rest=i.rest,this.expect(R.parenR);var s=null,a=this.flowParseTypeAndPredicateInitialiser();return r.returnType=a[0],s=a[1],n.typeAnnotation=this.finishNode(r,"FunctionTypeAnnotation"),n.predicate=s,t.typeAnnotation=this.finishNode(n,"TypeAnnotation"),this.finishNode(t,t.type),this.semicolon(),this.finishNode(e,"DeclareFunction")},le.flowParseDeclare=function(e){return this.match(R._class)?this.flowParseDeclareClass(e):this.match(R._function)?this.flowParseDeclareFunction(e):this.match(R._var)?this.flowParseDeclareVariable(e):this.isContextual("module")?this.lookahead().type===R.dot?this.flowParseDeclareModuleExports(e):this.flowParseDeclareModule(e):this.isContextual("type")?this.flowParseDeclareTypeAlias(e):this.isContextual("opaque")?this.flowParseDeclareOpaqueType(e):this.isContextual("interface")?this.flowParseDeclareInterface(e):this.match(R._export)?this.flowParseDeclareExportDeclaration(e):void this.unexpected()},le.flowParseDeclareExportDeclaration=function(e){if(this.expect(R._export),this.isContextual("opaque"))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");throw this.unexpected()},le.flowParseDeclareVariable=function(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(),this.semicolon(),this.finishNode(e,"DeclareVariable")},le.flowParseDeclareModule=function(e){this.next(),this.match(R.string)?e.id=this.parseExprAtom():e.id=this.parseIdentifier();var t=e.body=this.startNode(),r=t.body=[];for(this.expect(R.braceL);!this.match(R.braceR);){var n=this.startNode();if(this.match(R._import)){var i=this.lookahead();"type"!==i.value&&"typeof"!==i.value&&this.unexpected(null,"Imports within a `declare module` body must always be `import type` or `import typeof`"),this.parseImport(n)}else this.expectContextual("declare","Only declares and type imports are allowed inside declare module"),n=this.flowParseDeclare(n,!0);r.push(n)}return this.expect(R.braceR),this.finishNode(t,"BlockStatement"),this.finishNode(e,"DeclareModule")},le.flowParseDeclareModuleExports=function(e){return this.expectContextual("module"),this.expect(R.dot),this.expectContextual("exports"),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")},le.flowParseDeclareTypeAlias=function(e){return this.next(),this.flowParseTypeAlias(e),this.finishNode(e,"DeclareTypeAlias")},le.flowParseDeclareOpaqueType=function(e){return this.next(),this.flowParseOpaqueType(e,!0),this.finishNode(e,"DeclareOpaqueType")},le.flowParseDeclareInterface=function(e){return this.next(),this.flowParseInterfaceish(e),this.finishNode(e,"DeclareInterface")},le.flowParseInterfaceish=function(e){if(e.id=this.parseIdentifier(),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],e.mixins=[],this.eat(R._extends))do{e.extends.push(this.flowParseInterfaceExtends())}while(this.eat(R.comma));if(this.isContextual("mixins")){this.next();do{e.mixins.push(this.flowParseInterfaceExtends())}while(this.eat(R.comma))}e.body=this.flowParseObjectType(!0,!1,!1)},le.flowParseInterfaceExtends=function(){var e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")},le.flowParseInterface=function(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")},le.flowParseRestrictedIdentifier=function(e){return ue.indexOf(this.state.value)>-1&&this.raise(this.state.start,"Cannot overwrite primitive type "+this.state.value),this.parseIdentifier(e)},le.flowParseTypeAlias=function(e){return e.id=this.flowParseRestrictedIdentifier(),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(R.eq),this.semicolon(),this.finishNode(e,"TypeAlias")},le.flowParseOpaqueType=function(e,t){return this.expectContextual("type"),e.id=this.flowParseRestrictedIdentifier(),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(R.colon)&&(e.supertype=this.flowParseTypeInitialiser(R.colon)),e.impltype=null,t||(e.impltype=this.flowParseTypeInitialiser(R.eq)),this.semicolon(),this.finishNode(e,"OpaqueType")},le.flowParseTypeParameter=function(){var e=this.startNode(),t=this.flowParseVariance(),r=this.flowParseTypeAnnotatableIdentifier();return e.name=r.name,e.variance=t,e.bound=r.typeAnnotation,this.match(R.eq)&&(this.eat(R.eq),e.default=this.flowParseType()),this.finishNode(e,"TypeParameter")},le.flowParseTypeParameterDeclaration=function(){var e=this.state.inType,t=this.startNode();t.params=[],this.state.inType=!0,this.isRelational("<")||this.match(R.jsxTagStart)?this.next():this.unexpected();do{t.params.push(this.flowParseTypeParameter()),this.isRelational(">")||this.expect(R.comma)}while(!this.isRelational(">"));return this.expectRelational(">"),this.state.inType=e,this.finishNode(t,"TypeParameterDeclaration")},le.flowParseTypeParameterInstantiation=function(){var e=this.startNode(),t=this.state.inType;for(e.params=[],this.state.inType=!0,this.expectRelational("<");!this.isRelational(">");)e.params.push(this.flowParseType()),this.isRelational(">")||this.expect(R.comma);return this.expectRelational(">"),this.state.inType=t,this.finishNode(e,"TypeParameterInstantiation")},le.flowParseObjectPropertyKey=function(){return this.match(R.num)||this.match(R.string)?this.parseExprAtom():this.parseIdentifier(!0)},le.flowParseObjectTypeIndexer=function(e,t,r){return e.static=t,this.expect(R.bracketL),this.lookahead().type===R.colon?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(R.bracketR),e.value=this.flowParseTypeInitialiser(),e.variance=r,this.flowObjectTypeSemicolon(),this.finishNode(e,"ObjectTypeIndexer")},le.flowParseObjectTypeMethodish=function(e){for(e.params=[],e.rest=null,e.typeParameters=null,this.isRelational("<")&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(R.parenL);!this.match(R.parenR)&&!this.match(R.ellipsis);)e.params.push(this.flowParseFunctionTypeParam()),this.match(R.parenR)||this.expect(R.comma);return this.eat(R.ellipsis)&&(e.rest=this.flowParseFunctionTypeParam()),this.expect(R.parenR),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")},le.flowParseObjectTypeMethod=function(e,t,r,n){var i=this.startNodeAt(e,t);return i.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e,t)),i.static=r,i.key=n,i.optional=!1,this.flowObjectTypeSemicolon(),this.finishNode(i,"ObjectTypeProperty")},le.flowParseObjectTypeCallProperty=function(e,t){var r=this.startNode();return e.static=t,e.value=this.flowParseObjectTypeMethodish(r),this.flowObjectTypeSemicolon(),this.finishNode(e,"ObjectTypeCallProperty")},le.flowParseObjectType=function(e,t,r){var n=this.state.inType;this.state.inType=!0;var i=this.startNode(),s=void 0,a=void 0,o=!1;i.callProperties=[],i.properties=[],i.indexers=[];var u=void 0,l=void 0;for(t&&this.match(R.braceBarL)?(this.expect(R.braceBarL),u=R.braceBarR,l=!0):(this.expect(R.braceL),u=R.braceR,l=!1),i.exact=l;!this.match(u);){var c=!1,f=this.state.start,p=this.state.startLoc;s=this.startNode(),e&&this.isContextual("static")&&this.lookahead().type!==R.colon&&(this.next(),o=!0);var d=this.state.start,h=this.flowParseVariance();this.match(R.bracketL)?i.indexers.push(this.flowParseObjectTypeIndexer(s,o,h)):this.match(R.parenL)||this.isRelational("<")?(h&&this.unexpected(d),i.callProperties.push(this.flowParseObjectTypeCallProperty(s,o))):this.match(R.ellipsis)?(r||this.unexpected(null,"Spread operator cannot appear in class or interface definitions"),h&&this.unexpected(h.start,"Spread properties cannot have variance"),this.expect(R.ellipsis),s.argument=this.flowParseType(),this.flowObjectTypeSemicolon(),i.properties.push(this.finishNode(s,"ObjectTypeSpreadProperty"))):(a=this.flowParseObjectPropertyKey(),this.isRelational("<")||this.match(R.parenL)?(h&&this.unexpected(h.start),i.properties.push(this.flowParseObjectTypeMethod(f,p,o,a))):(this.eat(R.question)&&(c=!0),s.key=a,s.value=this.flowParseTypeInitialiser(),s.optional=c,s.static=o,s.variance=h,this.flowObjectTypeSemicolon(),i.properties.push(this.finishNode(s,"ObjectTypeProperty")))),o=!1}this.expect(u);var m=this.finishNode(i,"ObjectTypeAnnotation");return this.state.inType=n,m},le.flowObjectTypeSemicolon=function(){this.eat(R.semi)||this.eat(R.comma)||this.match(R.braceR)||this.match(R.braceBarR)||this.unexpected()},le.flowParseQualifiedTypeIdentifier=function(e,t,r){e=e||this.state.start,t=t||this.state.startLoc;for(var n=r||this.parseIdentifier();this.eat(R.dot);){var i=this.startNodeAt(e,t);i.qualification=n,i.id=this.parseIdentifier(),n=this.finishNode(i,"QualifiedTypeIdentifier")}return n},le.flowParseGenericType=function(e,t,r){var n=this.startNodeAt(e,t);return n.typeParameters=null,n.id=this.flowParseQualifiedTypeIdentifier(e,t,r),this.isRelational("<")&&(n.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(n,"GenericTypeAnnotation")},le.flowParseTypeofType=function(){var e=this.startNode();return this.expect(R._typeof),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")},le.flowParseTupleType=function(){var e=this.startNode();for(e.types=[],this.expect(R.bracketL);this.state.pos<this.input.length&&!this.match(R.bracketR)&&(e.types.push(this.flowParseType()),!this.match(R.bracketR));)this.expect(R.comma);return this.expect(R.bracketR),this.finishNode(e,"TupleTypeAnnotation")},le.flowParseFunctionTypeParam=function(){var e=null,t=!1,r=null,n=this.startNode(),i=this.lookahead();return i.type===R.colon||i.type===R.question?(e=this.parseIdentifier(),this.eat(R.question)&&(t=!0),r=this.flowParseTypeInitialiser()):r=this.flowParseType(),n.name=e,n.optional=t,n.typeAnnotation=r,this.finishNode(n,"FunctionTypeParam")},le.reinterpretTypeAsFunctionTypeParam=function(e){var t=this.startNodeAt(e.start,e.loc.start);return t.name=null,t.optional=!1,t.typeAnnotation=e,this.finishNode(t,"FunctionTypeParam")},le.flowParseFunctionTypeParams=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={params:e,rest:null};!this.match(R.parenR)&&!this.match(R.ellipsis);)t.params.push(this.flowParseFunctionTypeParam()),this.match(R.parenR)||this.expect(R.comma);return this.eat(R.ellipsis)&&(t.rest=this.flowParseFunctionTypeParam()),t},le.flowIdentToTypeAnnotation=function(e,t,r,n){switch(n.name){case"any":return this.finishNode(r,"AnyTypeAnnotation");case"void":return this.finishNode(r,"VoidTypeAnnotation");case"bool":case"boolean":return this.finishNode(r,"BooleanTypeAnnotation");case"mixed":return this.finishNode(r,"MixedTypeAnnotation");case"empty":return this.finishNode(r,"EmptyTypeAnnotation");case"number":return this.finishNode(r,"NumberTypeAnnotation");case"string":return this.finishNode(r,"StringTypeAnnotation");default:return this.flowParseGenericType(e,t,n)}},le.flowParsePrimaryType=function(){var e=this.state.start,t=this.state.startLoc,r=this.startNode(),n=void 0,i=void 0,s=!1,a=this.state.noAnonFunctionType;switch(this.state.type){case R.name:return this.flowIdentToTypeAnnotation(e,t,r,this.parseIdentifier());case R.braceL:return this.flowParseObjectType(!1,!1,!0);case R.braceBarL:return this.flowParseObjectType(!1,!0,!0);case R.bracketL:return this.flowParseTupleType();case R.relational:if("<"===this.state.value)return r.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(R.parenL),n=this.flowParseFunctionTypeParams(),r.params=n.params,r.rest=n.rest,this.expect(R.parenR),this.expect(R.arrow),r.returnType=this.flowParseType(),this.finishNode(r,"FunctionTypeAnnotation");break;case R.parenL:if(this.next(),!this.match(R.parenR)&&!this.match(R.ellipsis))if(this.match(R.name)){var o=this.lookahead().type;s=o!==R.question&&o!==R.colon}else s=!0;if(s){if(this.state.noAnonFunctionType=!1,i=this.flowParseType(),this.state.noAnonFunctionType=a,this.state.noAnonFunctionType||!(this.match(R.comma)||this.match(R.parenR)&&this.lookahead().type===R.arrow))return this.expect(R.parenR),i;this.eat(R.comma)}return n=i?this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(i)]):this.flowParseFunctionTypeParams(),r.params=n.params,r.rest=n.rest,this.expect(R.parenR),this.expect(R.arrow),r.returnType=this.flowParseType(),r.typeParameters=null,this.finishNode(r,"FunctionTypeAnnotation");case R.string:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case R._true:case R._false:return r.value=this.match(R._true),this.next(),this.finishNode(r,"BooleanLiteralTypeAnnotation");case R.plusMin:if("-"===this.state.value)return this.next(), this.match(R.num)||this.unexpected(null,"Unexpected token, expected number"),this.parseLiteral(-this.state.value,"NumericLiteralTypeAnnotation",r.start,r.loc.start);this.unexpected();case R.num:return this.parseLiteral(this.state.value,"NumericLiteralTypeAnnotation");case R._null:return r.value=this.match(R._null),this.next(),this.finishNode(r,"NullLiteralTypeAnnotation");case R._this:return r.value=this.match(R._this),this.next(),this.finishNode(r,"ThisTypeAnnotation");case R.star:return this.next(),this.finishNode(r,"ExistentialTypeParam");default:if("typeof"===this.state.type.keyword)return this.flowParseTypeofType()}this.unexpected()},le.flowParsePostfixType=function(){for(var e=this.state.start,t=this.state.startLoc,r=this.flowParsePrimaryType();!this.canInsertSemicolon()&&this.match(R.bracketL);){var n=this.startNodeAt(e,t);n.elementType=r,this.expect(R.bracketL),this.expect(R.bracketR),r=this.finishNode(n,"ArrayTypeAnnotation")}return r},le.flowParsePrefixType=function(){var e=this.startNode();return this.eat(R.question)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()},le.flowParseAnonFunctionWithoutParens=function(){var e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(R.arrow)){var t=this.startNodeAt(e.start,e.loc.start);return t.params=[this.reinterpretTypeAsFunctionTypeParam(e)],t.rest=null,t.returnType=this.flowParseType(),t.typeParameters=null,this.finishNode(t,"FunctionTypeAnnotation")}return e},le.flowParseIntersectionType=function(){var e=this.startNode();this.eat(R.bitwiseAND);var t=this.flowParseAnonFunctionWithoutParens();for(e.types=[t];this.eat(R.bitwiseAND);)e.types.push(this.flowParseAnonFunctionWithoutParens());return 1===e.types.length?t:this.finishNode(e,"IntersectionTypeAnnotation")},le.flowParseUnionType=function(){var e=this.startNode();this.eat(R.bitwiseOR);var t=this.flowParseIntersectionType();for(e.types=[t];this.eat(R.bitwiseOR);)e.types.push(this.flowParseIntersectionType());return 1===e.types.length?t:this.finishNode(e,"UnionTypeAnnotation")},le.flowParseType=function(){var e=this.state.inType;this.state.inType=!0;var t=this.flowParseUnionType();return this.state.inType=e,t},le.flowParseTypeAnnotation=function(){var e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")},le.flowParseTypeAndPredicateAnnotation=function(){var e=this.startNode(),t=this.flowParseTypeAndPredicateInitialiser();return e.typeAnnotation=t[0],e.predicate=t[1],this.finishNode(e,"TypeAnnotation")},le.flowParseTypeAnnotatableIdentifier=function(){var e=this.flowParseRestrictedIdentifier();return this.match(R.colon)&&(e.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(e,e.type)),e},le.typeCastToParameter=function(e){return e.expression.typeAnnotation=e.typeAnnotation,this.finishNodeAt(e.expression,e.expression.type,e.typeAnnotation.end,e.typeAnnotation.loc.end)},le.flowParseVariance=function(){var e=null;return this.match(R.plusMin)&&("+"===this.state.value?e="plus":"-"===this.state.value&&(e="minus"),this.next()),e};var ce=function(e){e.extend("parseFunctionBody",function(e){return function(t,r){return this.match(R.colon)&&!r&&(t.returnType=this.flowParseTypeAndPredicateAnnotation()),e.call(this,t,r)}}),e.extend("parseStatement",function(e){return function(t,r){if(this.state.strict&&this.match(R.name)&&"interface"===this.state.value){var n=this.startNode();return this.next(),this.flowParseInterface(n)}return e.call(this,t,r)}}),e.extend("parseExpressionStatement",function(e){return function(t,r){if("Identifier"===r.type)if("declare"===r.name){if(this.match(R._class)||this.match(R.name)||this.match(R._function)||this.match(R._var)||this.match(R._export))return this.flowParseDeclare(t)}else if(this.match(R.name)){if("interface"===r.name)return this.flowParseInterface(t);if("type"===r.name)return this.flowParseTypeAlias(t);if("opaque"===r.name)return this.flowParseOpaqueType(t,!1)}return e.call(this,t,r)}}),e.extend("shouldParseExportDeclaration",function(e){return function(){return this.isContextual("type")||this.isContextual("interface")||this.isContextual("opaque")||e.call(this)}}),e.extend("isExportDefaultSpecifier",function(e){return function(){return(!this.match(R.name)||"type"!==this.state.value&&"interface"!==this.state.value&&"opaque"!==this.state.value)&&e.call(this)}}),e.extend("parseConditional",function(e){return function(t,r,n,i,s){if(s&&this.match(R.question)){var a=this.state.clone();try{return e.call(this,t,r,n,i)}catch(e){if(e instanceof SyntaxError)return this.state=a,s.start=e.pos||this.state.start,t;throw e}}return e.call(this,t,r,n,i)}}),e.extend("parseParenItem",function(e){return function(t,r,n){if(t=e.call(this,t,r,n),this.eat(R.question)&&(t.optional=!0),this.match(R.colon)){var i=this.startNodeAt(r,n);return i.expression=t,i.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(i,"TypeCastExpression")}return t}}),e.extend("parseExport",function(e){return function(t){return t=e.call(this,t),"ExportNamedDeclaration"===t.type&&(t.exportKind=t.exportKind||"value"),t}}),e.extend("parseExportDeclaration",function(e){return function(t){if(this.isContextual("type")){t.exportKind="type";var r=this.startNode();return this.next(),this.match(R.braceL)?(t.specifiers=this.parseExportSpecifiers(),this.parseExportFrom(t),null):this.flowParseTypeAlias(r)}if(this.isContextual("opaque")){t.exportKind="type";var n=this.startNode();return this.next(),this.flowParseOpaqueType(n,!1)}if(this.isContextual("interface")){t.exportKind="type";var i=this.startNode();return this.next(),this.flowParseInterface(i)}return e.call(this,t)}}),e.extend("parseClassId",function(e){return function(t){e.apply(this,arguments),this.isRelational("<")&&(t.typeParameters=this.flowParseTypeParameterDeclaration())}}),e.extend("isKeyword",function(e){return function(t){return(!this.state.inType||"void"!==t)&&e.call(this,t)}}),e.extend("readToken",function(e){return function(t){return!this.state.inType||62!==t&&60!==t?e.call(this,t):this.finishOp(R.relational,1)}}),e.extend("jsx_readToken",function(e){return function(){if(!this.state.inType)return e.call(this)}}),e.extend("toAssignable",function(e){return function(t,r,n){return"TypeCastExpression"===t.type?e.call(this,this.typeCastToParameter(t),r,n):e.call(this,t,r,n)}}),e.extend("toAssignableList",function(e){return function(t,r,n){for(var i=0;i<t.length;i++){var s=t[i];s&&"TypeCastExpression"===s.type&&(t[i]=this.typeCastToParameter(s))}return e.call(this,t,r,n)}}),e.extend("toReferencedList",function(){return function(e){for(var t=0;t<e.length;t++){var r=e[t];r&&r._exprListItem&&"TypeCastExpression"===r.type&&this.raise(r.start,"Unexpected type cast")}return e}}),e.extend("parseExprListItem",function(e){return function(){for(var t=this.startNode(),r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=e.call.apply(e,[this].concat(n));return this.match(R.colon)?(t._exprListItem=!0,t.expression=s,t.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(t,"TypeCastExpression")):s}}),e.extend("checkLVal",function(e){return function(t){if("TypeCastExpression"!==t.type)return e.apply(this,arguments)}}),e.extend("parseClassProperty",function(e){return function(t){return delete t.variancePos,this.match(R.colon)&&(t.typeAnnotation=this.flowParseTypeAnnotation()),e.call(this,t)}}),e.extend("isClassMethod",function(e){return function(){return this.isRelational("<")||e.call(this)}}),e.extend("isClassProperty",function(e){return function(){return this.match(R.colon)||e.call(this)}}),e.extend("isNonstaticConstructor",function(e){return function(t){return!this.match(R.colon)&&e.call(this,t)}}),e.extend("parseClassMethod",function(e){return function(t,r){r.variance&&this.unexpected(r.variancePos),delete r.variance,delete r.variancePos,this.isRelational("<")&&(r.typeParameters=this.flowParseTypeParameterDeclaration());for(var n=arguments.length,i=Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];e.call.apply(e,[this,t,r].concat(i))}}),e.extend("parseClassSuper",function(e){return function(t,r){if(e.call(this,t,r),t.superClass&&this.isRelational("<")&&(t.superTypeParameters=this.flowParseTypeParameterInstantiation()),this.isContextual("implements")){this.next();var n=t.implements=[];do{var i=this.startNode();i.id=this.parseIdentifier(),this.isRelational("<")?i.typeParameters=this.flowParseTypeParameterInstantiation():i.typeParameters=null,n.push(this.finishNode(i,"ClassImplements"))}while(this.eat(R.comma))}}}),e.extend("parsePropertyName",function(e){return function(t){var r=this.state.start,n=this.flowParseVariance(),i=e.call(this,t);return t.variance=n,t.variancePos=r,i}}),e.extend("parseObjPropValue",function(e){return function(t){t.variance&&this.unexpected(t.variancePos),delete t.variance,delete t.variancePos;var r=void 0;this.isRelational("<")&&(r=this.flowParseTypeParameterDeclaration(),this.match(R.parenL)||this.unexpected()),e.apply(this,arguments),r&&((t.value||t).typeParameters=r)}}),e.extend("parseAssignableListItemTypes",function(){return function(e){return this.eat(R.question)&&(e.optional=!0),this.match(R.colon)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),this.finishNode(e,e.type),e}}),e.extend("parseMaybeDefault",function(e){return function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=e.apply(this,r);return"AssignmentPattern"===i.type&&i.typeAnnotation&&i.right.start<i.typeAnnotation.start&&this.raise(i.typeAnnotation.start,"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`"),i}}),e.extend("parseImportSpecifiers",function(e){return function(t){t.importKind="value";var r=null;if(this.match(R._typeof)?r="typeof":this.isContextual("type")&&(r="type"),r){var n=this.lookahead();(n.type===R.name&&"from"!==n.value||n.type===R.braceL||n.type===R.star)&&(this.next(),t.importKind=r)}e.call(this,t)}}),e.extend("parseImportSpecifier",function(){return function(e){var t=this.startNode(),r=this.state.start,n=this.parseIdentifier(!0),i=null;"type"===n.name?i="type":"typeof"===n.name&&(i="typeof");var s=!1;if(this.isContextual("as")){var a=this.parseIdentifier(!0);null===i||this.match(R.name)||this.state.type.keyword?(t.imported=n,t.importKind=null,t.local=this.parseIdentifier()):(t.imported=a,t.importKind=i,t.local=a.__clone())}else null!==i&&(this.match(R.name)||this.state.type.keyword)?(t.imported=this.parseIdentifier(!0),t.importKind=i,this.eatContextual("as")?t.local=this.parseIdentifier():(s=!0,t.local=t.imported.__clone())):(s=!0,t.imported=n,t.importKind=null,t.local=t.imported.__clone());"type"!==e.importKind&&"typeof"!==e.importKind||"type"!==t.importKind&&"typeof"!==t.importKind||this.raise(r,"`The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements`"),s&&this.checkReservedWord(t.local.name,t.start,!0,!0),this.checkLVal(t.local,!0,void 0,"import specifier"),e.specifiers.push(this.finishNode(t,"ImportSpecifier"))}}),e.extend("parseFunctionParams",function(e){return function(t){this.isRelational("<")&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),e.call(this,t)}}),e.extend("parseVarHead",function(e){return function(t){e.call(this,t),this.match(R.colon)&&(t.id.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(t.id,t.id.type))}}),e.extend("parseAsyncArrowFromCallExpression",function(e){return function(t,r){if(this.match(R.colon)){var n=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,t.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=n}return e.call(this,t,r)}}),e.extend("shouldParseAsyncArrow",function(e){return function(){return this.match(R.colon)||e.call(this)}}),e.extend("parseMaybeAssign",function(e){return function(){for(var t=null,r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];if(R.jsxTagStart&&this.match(R.jsxTagStart)){var s=this.state.clone();try{return e.apply(this,n)}catch(e){if(!(e instanceof SyntaxError))throw e;this.state=s,this.state.context.length-=2,t=e}}if(null!=t||this.isRelational("<")){var a=void 0,o=void 0;try{o=this.flowParseTypeParameterDeclaration(),a=e.apply(this,n),a.typeParameters=o,a.start=o.start,a.loc.start=o.loc.start}catch(e){throw t||e}if("ArrowFunctionExpression"===a.type)return a;if(null!=t)throw t;this.raise(o.start,"Expected an arrow function after this type parameter declaration")}return e.apply(this,n)}}),e.extend("parseArrow",function(e){return function(t){if(this.match(R.colon)){var r=this.state.clone();try{var n=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;var i=this.flowParseTypeAndPredicateAnnotation();this.state.noAnonFunctionType=n,this.canInsertSemicolon()&&this.unexpected(),this.match(R.arrow)||this.unexpected(),t.returnType=i}catch(e){if(!(e instanceof SyntaxError))throw e;this.state=r}}return e.call(this,t)}}),e.extend("shouldParseArrow",function(e){return function(){return this.match(R.colon)||e.call(this)}})},fe=String.fromCodePoint;if(!fe){var pe=String.fromCharCode,de=Math.floor;fe=function(){var e=[],t=void 0,r=void 0,n=-1,i=arguments.length;if(!i)return"";for(var s="";++n<i;){var a=Number(arguments[n]);if(!isFinite(a)||a<0||a>1114111||de(a)!=a)throw RangeError("Invalid code point: "+a);a<=65535?e.push(a):(a-=65536,t=55296+(a>>10),r=a%1024+56320,e.push(t,r)),(n+1==i||e.length>16384)&&(s+=pe.apply(null,e),e.length=0)}return s}}var he=fe,me={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},ye=/^[\da-fA-F]+$/,ve=/^\d+$/;U.j_oTag=new j("<tag",!1),U.j_cTag=new j("</tag",!1),U.j_expr=new j("<tag>...</tag>",!0,!0),R.jsxName=new T("jsxName"),R.jsxText=new T("jsxText",{beforeExpr:!0}),R.jsxTagStart=new T("jsxTagStart",{startsExpr:!0}),R.jsxTagEnd=new T("jsxTagEnd"),R.jsxTagStart.updateContext=function(){this.state.context.push(U.j_expr),this.state.context.push(U.j_oTag),this.state.exprAllowed=!1},R.jsxTagEnd.updateContext=function(e){var t=this.state.context.pop();t===U.j_oTag&&e===R.slash||t===U.j_cTag?(this.state.context.pop(),this.state.exprAllowed=this.curContext()===U.j_expr):this.state.exprAllowed=!0};var ge=J.prototype;ge.jsxReadToken=function(){for(var e="",t=this.state.pos;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated JSX contents");var r=this.input.charCodeAt(this.state.pos);switch(r){case 60:case 123:return this.state.pos===this.state.start?60===r&&this.state.exprAllowed?(++this.state.pos,this.finishToken(R.jsxTagStart)):this.getTokenFromCode(r):(e+=this.input.slice(t,this.state.pos),this.finishToken(R.jsxText,e));case 38:e+=this.input.slice(t,this.state.pos),e+=this.jsxReadEntity(),t=this.state.pos;break;default:o(r)?(e+=this.input.slice(t,this.state.pos),e+=this.jsxReadNewLine(!0),t=this.state.pos):++this.state.pos}}},ge.jsxReadNewLine=function(e){var t=this.input.charCodeAt(this.state.pos),r=void 0;return++this.state.pos,13===t&&10===this.input.charCodeAt(this.state.pos)?(++this.state.pos,r=e?"\n":"\r\n"):r=String.fromCharCode(t),++this.state.curLine,this.state.lineStart=this.state.pos,r},ge.jsxReadString=function(e){for(var t="",r=++this.state.pos;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated string constant");var n=this.input.charCodeAt(this.state.pos);if(n===e)break;38===n?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadEntity(),r=this.state.pos):o(n)?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadNewLine(!1),r=this.state.pos):++this.state.pos}return t+=this.input.slice(r,this.state.pos++),this.finishToken(R.string,t)},ge.jsxReadEntity=function(){for(var e="",t=0,r=void 0,n=this.input[this.state.pos],i=++this.state.pos;this.state.pos<this.input.length&&t++<10;){if(";"===(n=this.input[this.state.pos++])){"#"===e[0]?"x"===e[1]?(e=e.substr(2),ye.test(e)&&(r=he(parseInt(e,16)))):(e=e.substr(1),ve.test(e)&&(r=he(parseInt(e,10)))):r=me[e];break}e+=n}return r||(this.state.pos=i,"&")},ge.jsxReadWord=function(){var e=void 0,t=this.state.pos;do{e=this.input.charCodeAt(++this.state.pos)}while(s(e)||45===e);return this.finishToken(R.jsxName,this.input.slice(t,this.state.pos))},ge.jsxParseIdentifier=function(){var e=this.startNode();return this.match(R.jsxName)?e.name=this.state.value:this.state.type.keyword?e.name=this.state.type.keyword:this.unexpected(),this.next(),this.finishNode(e,"JSXIdentifier")},ge.jsxParseNamespacedName=function(){var e=this.state.start,t=this.state.startLoc,r=this.jsxParseIdentifier();if(!this.eat(R.colon))return r;var n=this.startNodeAt(e,t);return n.namespace=r,n.name=this.jsxParseIdentifier(),this.finishNode(n,"JSXNamespacedName")},ge.jsxParseElementName=function(){for(var e=this.state.start,t=this.state.startLoc,r=this.jsxParseNamespacedName();this.eat(R.dot);){var n=this.startNodeAt(e,t);n.object=r,n.property=this.jsxParseIdentifier(),r=this.finishNode(n,"JSXMemberExpression")}return r},ge.jsxParseAttributeValue=function(){var e=void 0;switch(this.state.type){case R.braceL:if(e=this.jsxParseExpressionContainer(),"JSXEmptyExpression"!==e.expression.type)return e;this.raise(e.start,"JSX attributes must only be assigned a non-empty expression");case R.jsxTagStart:case R.string:return e=this.parseExprAtom(),e.extra=null,e;default:this.raise(this.state.start,"JSX value should be either an expression or a quoted JSX text")}},ge.jsxParseEmptyExpression=function(){var e=this.startNodeAt(this.state.lastTokEnd,this.state.lastTokEndLoc);return this.finishNodeAt(e,"JSXEmptyExpression",this.state.start,this.state.startLoc)},ge.jsxParseSpreadChild=function(){var e=this.startNode();return this.expect(R.braceL),this.expect(R.ellipsis),e.expression=this.parseExpression(),this.expect(R.braceR),this.finishNode(e,"JSXSpreadChild")},ge.jsxParseExpressionContainer=function(){var e=this.startNode();return this.next(),this.match(R.braceR)?e.expression=this.jsxParseEmptyExpression():e.expression=this.parseExpression(),this.expect(R.braceR),this.finishNode(e,"JSXExpressionContainer")},ge.jsxParseAttribute=function(){var e=this.startNode();return this.eat(R.braceL)?(this.expect(R.ellipsis),e.argument=this.parseMaybeAssign(),this.expect(R.braceR),this.finishNode(e,"JSXSpreadAttribute")):(e.name=this.jsxParseNamespacedName(),e.value=this.eat(R.eq)?this.jsxParseAttributeValue():null,this.finishNode(e,"JSXAttribute"))},ge.jsxParseOpeningElementAt=function(e,t){var r=this.startNodeAt(e,t);for(r.attributes=[],r.name=this.jsxParseElementName();!this.match(R.slash)&&!this.match(R.jsxTagEnd);)r.attributes.push(this.jsxParseAttribute());return r.selfClosing=this.eat(R.slash),this.expect(R.jsxTagEnd),this.finishNode(r,"JSXOpeningElement")},ge.jsxParseClosingElementAt=function(e,t){var r=this.startNodeAt(e,t);return r.name=this.jsxParseElementName(),this.expect(R.jsxTagEnd),this.finishNode(r,"JSXClosingElement")},ge.jsxParseElementAt=function(e,t){var r=this.startNodeAt(e,t),n=[],i=this.jsxParseOpeningElementAt(e,t),s=null;if(!i.selfClosing){e:for(;;)switch(this.state.type){case R.jsxTagStart:if(e=this.state.start,t=this.state.startLoc,this.next(),this.eat(R.slash)){s=this.jsxParseClosingElementAt(e,t);break e}n.push(this.jsxParseElementAt(e,t));break;case R.jsxText:n.push(this.parseExprAtom());break;case R.braceL:this.lookahead().type===R.ellipsis?n.push(this.jsxParseSpreadChild()):n.push(this.jsxParseExpressionContainer());break;default:this.unexpected()}d(s.name)!==d(i.name)&&this.raise(s.start,"Expected corresponding JSX closing tag for <"+d(i.name)+">")}return r.openingElement=i,r.closingElement=s,r.children=n,this.match(R.relational)&&"<"===this.state.value&&this.raise(this.state.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(r,"JSXElement")},ge.jsxParseElement=function(){var e=this.state.start,t=this.state.startLoc;return this.next(),this.jsxParseElementAt(e,t)};var be=function(e){e.extend("parseExprAtom",function(e){return function(t){if(this.match(R.jsxText)){var r=this.parseLiteral(this.state.value,"JSXText");return r.extra=null,r}return this.match(R.jsxTagStart)?this.jsxParseElement():e.call(this,t)}}),e.extend("readToken",function(e){return function(t){if(this.state.inPropertyName)return e.call(this,t);var r=this.curContext();if(r===U.j_expr)return this.jsxReadToken();if(r===U.j_oTag||r===U.j_cTag){if(i(t))return this.jsxReadWord();if(62===t)return++this.state.pos,this.finishToken(R.jsxTagEnd);if((34===t||39===t)&&r===U.j_oTag)return this.jsxReadString(t)}return 60===t&&this.state.exprAllowed?(++this.state.pos,this.finishToken(R.jsxTagStart)):e.call(this,t)}}),e.extend("updateContext",function(e){return function(t){if(this.match(R.braceL)){var r=this.curContext();r===U.j_oTag?this.state.context.push(U.braceExpression):r===U.j_expr?this.state.context.push(U.templateQuasi):e.call(this,t),this.state.exprAllowed=!0}else{if(!this.match(R.slash)||t!==R.jsxTagStart)return e.call(this,t);this.state.context.length-=2,this.state.context.push(U.j_cTag),this.state.exprAllowed=!1}}})};K.estree=oe,K.flow=ce,K.jsx=be,t.parse=h,t.parseExpression=m,t.tokTypes=R},function(e,t,r){"use strict";var n=r(21),i=r(431),s=r(141),a=r(150)("IE_PROTO"),o=function(){},u=function(){var e,t=r(230)("iframe"),n=s.length;for(t.style.display="none",r(426).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;n--;)delete u.prototype[s[n]];return u()};e.exports=Object.create||function(e,t){var r;return null!==e?(o.prototype=n(e),r=new o,o.prototype=null,r[a]=e):r=u(),void 0===t?r:i(r,t)}},function(e,t){"use strict";t.f={}.propertyIsEnumerable},function(e,t){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){"use strict";var n=r(23).f,i=r(28),s=r(13)("toStringTag");e.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,s)&&n(e,s,{configurable:!0,value:t})}},function(e,t,r){"use strict";var n=r(140);e.exports=function(e){return Object(n(e))}},function(e,t){"use strict";var r=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+n).toString(36))}},function(e,t){"use strict"},function(e,t,r){"use strict";!function(){t.ast=r(461),t.code=r(240),t.keyword=r(462)}()},function(e,t,r){"use strict";function n(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var i=r(546),s=r(547),a=r(548),o=r(549),u=r(550);n.prototype.clear=i,n.prototype.delete=s,n.prototype.get=a,n.prototype.has=o,n.prototype.set=u,e.exports=n},function(e,t,r){"use strict";function n(e){var t=this.__data__=new i(e);this.size=t.size}var i=r(98),s=r(565),a=r(566),o=r(567),u=r(568),l=r(569);n.prototype.clear=s,n.prototype.delete=a,n.prototype.get=o,n.prototype.has=u,n.prototype.set=l,e.exports=n},function(e,t,r){"use strict";function n(e,t){for(var r=e.length;r--;)if(i(e[r][0],t))return r;return-1}var i=r(46);e.exports=n},function(e,t,r){"use strict";function n(e,t){return a(s(e,t,i),e+"")}var i=r(110),s=r(560),a=r(563);e.exports=n},function(e,t){"use strict";function r(e){return function(t){return e(t)}}e.exports=r},function(e,t,r){"use strict";function n(e){return i(function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,o&&s(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var u=r[n];u&&e(t,u,n,a)}return t})}var i=r(101),s=r(172);e.exports=n},function(e,t,r){"use strict";function n(e,t){var r=e.__data__;return i(t)?r["string"==typeof t?"string":"hash"]:r.map}var i=r(544);e.exports=n},function(e,t){"use strict";function r(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}var n=Object.prototype;e.exports=r},function(e,t,r){"use strict";var n=r(38),i=n(Object,"create");e.exports=i},function(e,t){"use strict";function r(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}e.exports=r},function(e,t,r){"use strict";function n(e){if("string"==typeof e||i(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}var i=r(62),s=1/0;e.exports=n},function(e,t,r){"use strict";function n(e){return i(e,s)}var i=r(164),s=4;e.exports=n},function(e,t){"use strict";function r(e){return e}e.exports=r},function(e,t,r){"use strict";function n(e,t,r,n){e=s(e)?e:u(e),r=r&&!n?o(r):0;var c=e.length;return r<0&&(r=l(c+r,0)),a(e)?r<=c&&e.indexOf(t,r)>-1:!!c&&i(e,t,r)>-1}var i=r(166),s=r(24),a=r(587),o=r(48),u=r(280),l=Math.max;e.exports=n},function(e,t,r){"use strict";var n=r(493),i=r(25),s=Object.prototype,a=s.hasOwnProperty,o=s.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return i(e)&&a.call(e,"callee")&&!o.call(e,"callee")};e.exports=u},function(e,t,r){(function(e){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(17),s=r(596),a="object"==n(t)&&t&&!t.nodeType&&t,o=a&&"object"==n(e)&&e&&!e.nodeType&&e,u=o&&o.exports===a,l=u?i.Buffer:void 0,c=l?l.isBuffer:void 0,f=c||s;e.exports=f}).call(t,r(39)(e))},function(e,t,r){"use strict";function n(e){return null==e?"":i(e)}var i=r(253);e.exports=n},96,function(e,t,r){"use strict";function n(e){return o.memberExpression(o.identifier("regeneratorRuntime"),o.identifier(e),!1)}function i(e){return e.isReferenced()||e.parentPath.isAssignmentExpression({left:e.node})}function s(e,t){t?e.replaceWith(t):e.remove()}t.__esModule=!0,t.runtimeProperty=n,t.isReference=i,t.replaceWithOrRemove=s;var a=r(1),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(a)},function(e,t,r){(function(e,n){"use strict";function i(e,r){var n={seen:[],stylize:a};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&t._extend(n,r),x(n.showHidden)&&(n.showHidden=!1),x(n.depth)&&(n.depth=2),x(n.colors)&&(n.colors=!1),x(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),u(n,e,n.depth)}function s(e,t){var r=i.styles[t];return r?"["+i.colors[r][0]+"m"+e+"["+i.colors[r][1]+"m":e}function a(e,t){return e}function o(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function u(e,r,n){if(e.customInspect&&r&&C(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return b(i)||(i=u(e,i,n)),i}var s=l(e,r);if(s)return s;var a=Object.keys(r),m=o(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),D(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(r);if(0===a.length){if(C(r)){var y=r.name?": "+r.name:"";return e.stylize("[Function"+y+"]","special")}if(A(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(D(r))return c(r)}var v="",g=!1,E=["{","}"];if(h(r)&&(g=!0,E=["[","]"]),C(r)){v=" [Function"+(r.name?": "+r.name:"")+"]"}if(A(r)&&(v=" "+RegExp.prototype.toString.call(r)),_(r)&&(v=" "+Date.prototype.toUTCString.call(r)),D(r)&&(v=" "+c(r)),0===a.length&&(!g||0==r.length))return E[0]+v+E[1];if(n<0)return A(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var x;return x=g?f(e,r,n,m,a):a.map(function(t){return p(e,r,n,m,t,g)}),e.seen.pop(),d(x,v,E)}function l(e,t){if(x(t))return e.stylize("undefined","undefined");if(b(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,r,n,i){for(var s=[],a=0,o=t.length;a<o;++a)T(t,String(a))?s.push(p(e,t,r,n,String(a),!0)):s.push("");return i.forEach(function(i){i.match(/^\d+$/)||s.push(p(e,t,r,n,i,!0))}),s}function p(e,t,r,n,i,s){var a,o,l;if(l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},l.get?o=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(o=e.stylize("[Setter]","special")),T(n,i)||(a="["+i+"]"),o||(e.seen.indexOf(l.value)<0?(o=y(r)?u(e,l.value,null):u(e,l.value,r-1),o.indexOf("\n")>-1&&(o=s?o.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+o.split("\n").map(function(e){return" "+e}).join("\n"))):o=e.stylize("[Circular]","special")),x(a)){if(s&&i.match(/^\d+$/))return o;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+o}function d(e,t,r){var n=0;return e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function h(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function y(e){return null===e}function v(e){return null==e}function g(e){return"number"==typeof e}function b(e){return"string"==typeof e}function E(e){return"symbol"===(void 0===e?"undefined":O(e))}function x(e){return void 0===e}function A(e){return S(e)&&"[object RegExp]"===P(e)}function S(e){return"object"===(void 0===e?"undefined":O(e))&&null!==e}function _(e){return S(e)&&"[object Date]"===P(e)}function D(e){return S(e)&&("[object Error]"===P(e)||e instanceof Error)}function C(e){return"function"==typeof e}function w(e){ return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===(void 0===e?"undefined":O(e))||void 0===e}function P(e){return Object.prototype.toString.call(e)}function k(e){return e<10?"0"+e.toString(10):e.toString(10)}function F(){var e=new Date,t=[k(e.getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B=/%[sdj%]/g;t.format=function(e){if(!b(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(i(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,s=n.length,a=String(e).replace(B,function(e){if("%%"===e)return"%";if(r>=s)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),o=n[r];r<s;o=n[++r])y(o)||!S(o)?a+=" "+o:a+=" "+i(o);return a},t.deprecate=function(r,i){function s(){if(!a){if(n.throwDeprecation)throw new Error(i);n.traceDeprecation?console.trace(i):console.error(i),a=!0}return r.apply(this,arguments)}if(x(e.process))return function(){return t.deprecate(r,i).apply(this,arguments)};if(!0===n.noDeprecation)return r;var a=!1;return s};var R,I={};t.debuglog=function(e){if(x(R)&&(R=n.env.NODE_DEBUG||""),e=e.toUpperCase(),!I[e])if(new RegExp("\\b"+e+"\\b","i").test(R)){var r=n.pid;I[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else I[e]=function(){};return I[e]},t.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=m,t.isNull=y,t.isNullOrUndefined=v,t.isNumber=g,t.isString=b,t.isSymbol=E,t.isUndefined=x,t.isRegExp=A,t.isObject=S,t.isDate=_,t.isError=D,t.isFunction=C,t.isPrimitive=w,t.isBuffer=r(627);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t.log=function(){console.log("%s - %s",F(),t.format.apply(t,arguments))},t.inherits=r(626),t._extend=function(e,t){if(!t||!S(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(t,function(){return this}(),r(8))},function(e,t,r){(function(n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var s=r(11),a=i(s);t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.cwd();if("object"===(void 0===u.default?"undefined":(0,a.default)(u.default)))return null;var r=f[t];if(!r){r=new u.default;var i=c.default.join(t,".babelrc");r.id=i,r.filename=i,r.paths=u.default._nodeModulePaths(t),f[t]=r}try{return u.default._resolveFilename(e,r)}catch(e){return null}};var o=r(115),u=i(o),l=r(19),c=i(l),f={};e.exports=t.default}).call(t,r(8))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(133),s=n(i),a=r(3),o=n(a),u=r(42),l=n(u),c=r(41),f=n(c),p=function(e){function t(){(0,o.default)(this,t);var r=(0,l.default)(this,e.call(this));return r.dynamicData={},r}return(0,f.default)(t,e),t.prototype.setDynamic=function(e,t){this.dynamicData[e]=t},t.prototype.get=function(t){if(this.has(t))return e.prototype.get.call(this,t);if(Object.prototype.hasOwnProperty.call(this.dynamicData,t)){var r=this.dynamicData[t]();return this.set(t,r),r}},t}(s.default);t.default=p,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(3),s=n(i),a=r(239),o=n(a),u=(0,o.default)("babel:verbose"),l=(0,o.default)("babel"),c=[],f=function(){function e(t,r){(0,s.default)(this,e),this.filename=r,this.file=t}return e.prototype._buildMessage=function(e){var t="[BABEL] "+this.filename;return e&&(t+=": "+e),t},e.prototype.warn=function(e){console.warn(this._buildMessage(e))},e.prototype.error=function(e){throw new(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Error)(this._buildMessage(e))},e.prototype.deprecate=function(e){this.file.opts&&this.file.opts.suppressDeprecationMessages||(e=this._buildMessage(e),c.indexOf(e)>=0||(c.push(e),console.error(e)))},e.prototype.verbose=function(e){u.enabled&&u(this._buildMessage(e))},e.prototype.debug=function(e){l.enabled&&l(this._buildMessage(e))},e.prototype.deopt=function(e,t){this.debug(t)},e}();t.default=f,e.exports=t.default},function(e,t,r){"use strict";function n(e,t){var r=e.node,n=r.source?r.source.value:null,i=t.metadata.modules.exports,s=e.get("declaration");if(s.isStatement()){var o=s.getBindingIdentifiers();for(var l in o)i.exported.push(l),i.specifiers.push({kind:"local",local:l,exported:e.isExportDefaultDeclaration()?"default":l})}if(e.isExportNamedDeclaration()&&r.specifiers)for(var c=r.specifiers,f=Array.isArray(c),p=0,c=f?c:(0,a.default)(c);;){var d;if(f){if(p>=c.length)break;d=c[p++]}else{if(p=c.next(),p.done)break;d=p.value}var h=d,m=h.exported.name;i.exported.push(m),u.isExportDefaultSpecifier(h)&&i.specifiers.push({kind:"external",local:m,exported:m,source:n}),u.isExportNamespaceSpecifier(h)&&i.specifiers.push({kind:"external-namespace",exported:m,source:n});var y=h.local;y&&(n&&i.specifiers.push({kind:"external",local:y.name,exported:m,source:n}),n||i.specifiers.push({kind:"local",local:y.name,exported:m}))}e.isExportAllDeclaration()&&i.specifiers.push({kind:"external-all",source:n})}function i(e){e.skip()}t.__esModule=!0,t.ImportDeclaration=t.ModuleDeclaration=void 0;var s=r(2),a=function(e){return e&&e.__esModule?e:{default:e}}(s);t.ExportDeclaration=n,t.Scope=i;var o=r(1),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(o);t.ModuleDeclaration={enter:function(e,t){var r=e.node;r.source&&(r.source.value=t.resolveModuleSource(r.source.value))}},t.ImportDeclaration={exit:function(e,t){var r=e.node,n=[],i=[];t.metadata.modules.imports.push({source:r.source.value,imported:i,specifiers:n});for(var s=e.get("specifiers"),o=Array.isArray(s),u=0,s=o?s:(0,a.default)(s);;){var l;if(o){if(u>=s.length)break;l=s[u++]}else{if(u=s.next(),u.done)break;l=u.value}var c=l,f=c.node.local.name;if(c.isImportDefaultSpecifier()&&(i.push("default"),n.push({kind:"named",imported:"default",local:f})),c.isImportSpecifier()){var p=c.node.imported.name;i.push(p),n.push({kind:"named",imported:p,local:f})}c.isImportNamespaceSpecifier()&&(i.push("*"),n.push({kind:"namespace",local:f}))}}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r=t||i.EXTENSIONS,n=D.default.extname(e);return(0,x.default)(r,n)}function s(e){return e?Array.isArray(e)?e:"string"==typeof e?e.split(","):[e]:[]}function a(e){if(!e)return new RegExp(/.^/);if(Array.isArray(e)&&(e=new RegExp(e.map(m.default).join("|"),"i")),"string"==typeof e){e=(0,w.default)(e),((0,v.default)(e,"./")||(0,v.default)(e,"*/"))&&(e=e.slice(2)),(0,v.default)(e,"**/")&&(e=e.slice(3));var t=b.default.makeRe(e,{nocase:!0});return new RegExp(t.source.slice(1,-1),"i")}if((0,S.default)(e))return e;throw new TypeError("illegal type for regexify")}function o(e,t){return e?"boolean"==typeof e?o([e],t):"string"==typeof e?o(s(e),t):Array.isArray(e)?(t&&(e=e.map(t)),e):[e]:[]}function u(e){return"true"===e||1==e||!("false"===e||0==e||!e)&&e}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments[2];if(e=e.replace(/\\/g,"/"),r){for(var n=r,i=Array.isArray(n),s=0,n=i?n:(0,p.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}if(c(a,e))return!1}return!0}if(t.length)for(var o=t,u=Array.isArray(o),l=0,o=u?o:(0,p.default)(o);;){var f;if(u){if(l>=o.length)break;f=o[l++]}else{if(l=o.next(),l.done)break;f=l.value}var d=f;if(c(d,e))return!0}return!1}function c(e,t){return"function"==typeof e?e(t):e.test(t)}t.__esModule=!0,t.inspect=t.inherits=void 0;var f=r(2),p=n(f),d=r(117);Object.defineProperty(t,"inherits",{enumerable:!0,get:function(){return d.inherits}}),Object.defineProperty(t,"inspect",{enumerable:!0,get:function(){return d.inspect}}),t.canCompile=i,t.list=s,t.regexify=a,t.arrayify=o,t.booleanify=u,t.shouldIgnore=l;var h=r(577),m=n(h),y=r(595),v=n(y),g=r(601),b=n(g),E=r(111),x=n(E),A=r(276),S=n(A),_=r(19),D=n(_),C=r(284),w=n(C);i.EXTENSIONS=[".js",".jsx",".es6",".es"]},function(e,t,r){"use strict";function n(e){e.variance&&("plus"===e.variance?this.token("+"):"minus"===e.variance&&this.token("-")),this.word(e.name)}function i(e){this.token("..."),this.print(e.argument,e)}function s(e){var t=e.properties;this.token("{"),this.printInnerComments(e),t.length&&(this.space(),this.printList(t,e,{indent:!0,statement:!0}),this.space()),this.token("}")}function a(e){this.printJoin(e.decorators,e),this._method(e)}function o(e){if(this.printJoin(e.decorators,e),e.computed)this.token("["),this.print(e.key,e),this.token("]");else{if(m.isAssignmentPattern(e.value)&&m.isIdentifier(e.key)&&e.key.name===e.value.left.name)return void this.print(e.value,e);if(this.print(e.key,e),e.shorthand&&m.isIdentifier(e.key)&&m.isIdentifier(e.value)&&e.key.name===e.value.name)return}this.token(":"),this.space(),this.print(e.value,e)}function u(e){var t=e.elements,r=t.length;this.token("["),this.printInnerComments(e);for(var n=0;n<t.length;n++){var i=t[n];i?(n>0&&this.space(),this.print(i,e),n<r-1&&this.token(",")):this.token(",")}this.token("]")}function l(e){this.word("/"+e.pattern+"/"+e.flags)}function c(e){this.word(e.value?"true":"false")}function f(){this.word("null")}function p(e){var t=this.getPossibleRaw(e),r=e.value+"";null==t?this.number(r):this.format.minified?this.number(t.length<r.length?t:r):this.number(t)}function d(e,t){var r=this.getPossibleRaw(e);if(!this.format.minified&&null!=r)return void this.token(r);var n={quotes:m.isJSX(t)?"double":this.format.quotes,wrap:!0};this.format.jsonCompatibleStrings&&(n.json=!0);var i=(0,v.default)(e.value,n);return this.token(i)}t.__esModule=!0,t.ArrayPattern=t.ObjectPattern=t.RestProperty=t.SpreadProperty=t.SpreadElement=void 0,t.Identifier=n,t.RestElement=i,t.ObjectExpression=s,t.ObjectMethod=a,t.ObjectProperty=o,t.ArrayExpression=u,t.RegExpLiteral=l,t.BooleanLiteral=c,t.NullLiteral=f,t.NumericLiteral=p,t.StringLiteral=d;var h=r(1),m=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(h),y=r(469),v=function(e){return e&&e.__esModule?e:{default:e}}(y);t.SpreadElement=i,t.SpreadProperty=i,t.RestProperty=i,t.ObjectPattern=s,t.ArrayPattern=u},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r=e.node,n=r.body;r.async=!1;var i=f.functionExpression(null,[],f.blockStatement(n.body),!0);i.shadow=!0,n.body=[f.returnStatement(f.callExpression(f.callExpression(t,[i]),[]))],r.generator=!1}function s(e,t){var r=e.node,n=e.isFunctionDeclaration(),i=r.id,s=h;e.isArrowFunctionExpression()?e.arrowFunctionToShadowed():!n&&i&&(s=m),r.async=!1,r.generator=!0,r.id=null,n&&(r.type="FunctionExpression");var a=f.callExpression(t,[r]),u=s({NAME:i,REF:e.scope.generateUidIdentifier("ref"),FUNCTION:a,PARAMS:r.params.reduce(function(t,r){return t.done=t.done||f.isAssignmentPattern(r)||f.isRestElement(r),t.done||t.params.push(e.scope.generateUidIdentifier("x")),t},{params:[],done:!1}).params}).expression;if(n){var l=f.variableDeclaration("let",[f.variableDeclarator(f.identifier(i.name),f.callExpression(u,[]))]);l._blockHoist=!0,e.replaceWith(l)}else{var c=u.body.body[1].argument;i||(0,o.default)({node:c,parent:e.parent,scope:e.scope}),!c||c.id||r.params.length?e.replaceWith(f.callExpression(u,[])):e.replaceWith(a)}}t.__esModule=!0,t.default=function(e,t,r){r||(r={wrapAsync:t},t=null),e.traverse(y,{file:t,wrapAwait:r.wrapAwait}),e.isClassMethod()||e.isObjectMethod()?i(e,r.wrapAsync):s(e,r.wrapAsync)};var a=r(40),o=n(a),u=r(4),l=n(u),c=r(1),f=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(c),p=r(320),d=n(p),h=(0,l.default)("\n (() => {\n var REF = FUNCTION;\n return function NAME(PARAMS) {\n return REF.apply(this, arguments);\n };\n })\n"),m=(0,l.default)("\n (() => {\n var REF = FUNCTION;\n function NAME(PARAMS) {\n return REF.apply(this, arguments);\n }\n return NAME;\n })\n"),y={Function:function(e){if(e.isArrowFunctionExpression()&&!e.node.async)return void e.arrowFunctionToShadowed();e.skip()},AwaitExpression:function(e,t){var r=e.node,n=t.wrapAwait;r.type="YieldExpression",n&&(r.argument=f.callExpression(n,[r.argument]))},ForAwaitStatement:function(e,t){var r=t.file,n=t.wrapAwait,i=e.node,s=(0,d.default)(e,{getAsyncIterator:r.addHelper("asyncIterator"),wrapAwait:n}),a=s.declar,o=s.loop,u=o.body;e.ensureBlock(),a&&u.body.push(a),u.body=u.body.concat(i.body.body),f.inherits(o,i),f.inherits(o.body,i.body),s.replaceParent?(e.parentPath.replaceWithMultiple(s.node),e.remove()):e.replaceWithMultiple(s.node)}};e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("decorators")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("flow")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("jsx")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("trailingFunctionCommas")}}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(){return{inherits:r(67),visitor:{Function:function(e,t){e.node.async&&!e.node.generator&&(0,i.default)(e,t.file,{wrapAsync:t.addHelper("asyncToGenerator")})}}}};var n=r(124),i=function(e){return e&&e.__esModule?e:{default:e}}(n);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){return c.isIdentifier(e)?e.name:e.value.toString()}t.__esModule=!0;var s=r(2),a=n(s),o=r(9),u=n(o);t.default=function(){return{visitor:{ObjectExpression:function(e){for(var t=e.node,r=t.properties.filter(function(e){return!c.isSpreadProperty(e)&&!e.computed}),n=(0,u.default)(null),s=(0,u.default)(null),o=(0,u.default)(null),l=r,f=Array.isArray(l),p=0,l=f?l:(0,a.default)(l);;){var d;if(f){if(p>=l.length)break;d=l[p++]}else{if(p=l.next(),p.done)break;d=p.value}var h=d,m=i(h.key),y=!1;switch(h.kind){case"get":(n[m]||s[m])&&(y=!0),s[m]=!0;break;case"set":(n[m]||o[m])&&(y=!0),o[m]=!0;break;default:(n[m]||s[m]||o[m])&&(y=!0),n[m]=!0}y&&(h.computed=!0,h.key=c.stringLiteral(m))}}}}};var l=r(1),c=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(l);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(9),s=n(i);t.default=function(e){function t(e){if(!e.isCallExpression())return!1;if(!e.get("callee").isIdentifier({name:"require"}))return!1;if(e.scope.getBinding("require"))return!1;var t=e.get("arguments");return 1===t.length&&!!t[0].isStringLiteral()}var n=e.types,i={ReferencedIdentifier:function(e){var t=e.node,r=e.scope;"exports"!==t.name||r.getBinding("exports")||(this.hasExports=!0),"module"!==t.name||r.getBinding("module")||(this.hasModule=!0)},CallExpression:function(e){t(e)&&(this.bareSources.push(e.node.arguments[0]),e.remove())},VariableDeclarator:function(e){var r=e.get("id");if(r.isIdentifier()){var n=e.get("init");if(t(n)){var i=n.node.arguments[0];this.sourceNames[i.value]=!0,this.sources.push([r.node,i]),e.remove()}}}};return{inherits:r(77),pre:function(){this.sources=[],this.sourceNames=(0,s.default)(null),this.bareSources=[],this.hasExports=!1,this.hasModule=!1},visitor:{Program:{exit:function(e){var t=this;if(!this.ran){this.ran=!0,e.traverse(i,this);var r=this.sources.map(function(e){return e[0]}),s=this.sources.map(function(e){return e[1]});s=s.concat(this.bareSources.filter(function(e){return!t.sourceNames[e.value]}));var a=this.getModuleName();a&&(a=n.stringLiteral(a)),this.hasExports&&(s.unshift(n.stringLiteral("exports")),r.unshift(n.identifier("exports"))),this.hasModule&&(s.unshift(n.stringLiteral("module")),r.unshift(n.identifier("module")));var o=e.node,c=l({PARAMS:r,BODY:o.body});c.expression.body.directives=o.directives,o.directives=[],o.body=[u({MODULE_NAME:a,SOURCES:s,FACTORY:c})]}}}}}};var a=r(4),o=n(a),u=(0,o.default)("\n define(MODULE_NAME, [SOURCES], FACTORY);\n"),l=(0,o.default)("\n (function (PARAMS) {\n BODY;\n })\n");e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){var t=e.types;return{inherits:r(199),visitor:(0,i.default)({operator:"**",build:function(e,r){return t.callExpression(t.memberExpression(t.identifier("Math"),t.identifier("pow")),[e,r])}})}};var n=r(316),i=function(e){return e&&e.__esModule?e:{default:e}}(n);e.exports=t.default},function(e,t,r){"use strict";e.exports={default:r(406),__esModule:!0}},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e,t,r){for(var n=I.scope.get(e.node)||[],i=n,s=Array.isArray(i),a=0,i=s?i:(0,y.default)(i);;){var o;if(s){if(a>=i.length)break;o=i[a++]}else{if(a=i.next(),a.done)break;o=a.value}var u=o;if(u.parent===t&&u.path===e)return u}n.push(r),I.scope.has(e.node)||I.scope.set(e.node,n)}function a(e,t){if(R.isModuleDeclaration(e))if(e.source)a(e.source,t);else if(e.specifiers&&e.specifiers.length)for(var r=e.specifiers,n=Array.isArray(r),i=0,r=n?r:(0,y.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var o=s;a(o,t)}else e.declaration&&a(e.declaration,t);else if(R.isModuleSpecifier(e))a(e.local,t);else if(R.isMemberExpression(e))a(e.object,t),a(e.property,t);else if(R.isIdentifier(e))t.push(e.name);else if(R.isLiteral(e))t.push(e.value);else if(R.isCallExpression(e))a(e.callee,t);else if(R.isObjectExpression(e)||R.isObjectPattern(e))for(var u=e.properties,l=Array.isArray(u),c=0,u=l?u:(0,y.default)(u);;){var f;if(l){if(c>=u.length)break;f=u[c++]}else{if(c=u.next(),c.done)break;f=c.value}var p=f;a(p.key||p.argument,t)}}t.__esModule=!0;var o=r(14),u=i(o),l=r(9),c=i(l),f=r(133),p=i(f),d=r(3),h=i(d),m=r(2),y=i(m),v=r(111),g=i(v),b=r(278),E=i(b),x=r(383),A=i(x),S=r(7),_=i(S),D=r(273),C=i(D),w=r(20),P=n(w),k=r(225),F=i(k),T=r(463),O=i(T),B=r(1),R=n(B),I=r(88),M=0,N={For:function(e){for(var t=R.FOR_INIT_KEYS,r=Array.isArray(t),n=0,t=r?t:(0,y.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i,a=e.get(s);a.isVar()&&e.scope.getFunctionParent().registerBinding("var",a)}},Declaration:function(e){e.isBlockScoped()||e.isExportDeclaration()&&e.get("declaration").isDeclaration()||e.scope.getFunctionParent().registerDeclaration(e)},ReferencedIdentifier:function(e,t){t.references.push(e)},ForXStatement:function(e,t){var r=e.get("left");(r.isPattern()||r.isIdentifier())&&t.constantViolations.push(r)},ExportDeclaration:{exit:function(e){var t=e.node,r=e.scope,n=t.declaration;if(R.isClassDeclaration(n)||R.isFunctionDeclaration(n)){var i=n.id;if(!i)return;var s=r.getBinding(i.name);s&&s.reference(e)}else if(R.isVariableDeclaration(n))for(var a=n.declarations,o=Array.isArray(a),u=0,a=o?a:(0,y.default)(a);;){var l;if(o){if(u>=a.length)break;l=a[u++]}else{if(u=a.next(),u.done)break;l=u.value}var c=l,f=R.getBindingIdentifiers(c);for(var p in f){var d=r.getBinding(p);d&&d.reference(e)}}}},LabeledStatement:function(e){e.scope.getProgramParent().addGlobal(e.node),e.scope.getBlockParent().registerDeclaration(e)},AssignmentExpression:function(e,t){t.assignments.push(e)},UpdateExpression:function(e,t){t.constantViolations.push(e.get("argument"))},UnaryExpression:function(e,t){"delete"===e.node.operator&&t.constantViolations.push(e.get("argument"))},BlockScoped:function(e){var t=e.scope;t.path===e&&(t=t.parent),t.getBlockParent().registerDeclaration(e)},ClassDeclaration:function(e){var t=e.node.id;if(t){var r=t.name;e.scope.bindings[r]=e.scope.getBinding(r)}},Block:function(e){for(var t=e.get("body"),r=t,n=Array.isArray(r),i=0,r=n?r:(0,y.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var a=s;a.isFunctionDeclaration()&&e.scope.getBlockParent().registerDeclaration(a)}}},L=0,j=function(){function e(t,r){if((0,h.default)(this,e),r&&r.block===t.node)return r;var n=s(t,r,this);if(n)return n;this.uid=L++,this.parent=r,this.hub=t.hub,this.parentBlock=t.parent,this.block=t.node,this.path=t,this.labels=new p.default}return e.prototype.traverse=function(e,t,r){(0,_.default)(e,t,this,r,this.path)},e.prototype.generateDeclaredUidIdentifier=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"temp",t=this.generateUidIdentifier(e);return this.push({id:t}),t},e.prototype.generateUidIdentifier=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"temp";return R.identifier(this.generateUid(e))},e.prototype.generateUid=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"temp";e=R.toIdentifier(e).replace(/^_+/,"").replace(/[0-9]+$/g,"");var t=void 0,r=0;do{t=this._generateUid(e,r),r++}while(this.hasLabel(t)||this.hasBinding(t)||this.hasGlobal(t)||this.hasReference(t));var n=this.getProgramParent();return n.references[t]=!0,n.uids[t]=!0,t},e.prototype._generateUid=function(e,t){var r=e;return t>1&&(r+=t),"_"+r},e.prototype.generateUidIdentifierBasedOnNode=function(e,t){var r=e;R.isAssignmentExpression(e)?r=e.left:R.isVariableDeclarator(e)?r=e.id:(R.isObjectProperty(r)||R.isObjectMethod(r))&&(r=r.key);var n=[];a(r,n);var i=n.join("$");return i=i.replace(/^_/,"")||t||"ref",this.generateUidIdentifier(i.slice(0,20))},e.prototype.isStatic=function(e){if(R.isThisExpression(e)||R.isSuper(e))return!0;if(R.isIdentifier(e)){var t=this.getBinding(e.name);return t?t.constant:this.hasBinding(e.name)}return!1},e.prototype.maybeGenerateMemoised=function(e,t){if(this.isStatic(e))return null;var r=this.generateUidIdentifierBasedOnNode(e);return t||this.push({id:r}),r},e.prototype.checkBlockScopedCollisions=function(e,t,r,n){if("param"!==t&&("hoisted"!==t||"let"!==e.kind)){if("let"===t||"let"===e.kind||"const"===e.kind||"module"===e.kind||"param"===e.kind&&("let"===t||"const"===t))throw this.hub.file.buildCodeFrameError(n,P.get("scopeDuplicateDeclaration",r),TypeError)}},e.prototype.rename=function(e,t,r){var n=this.getBinding(e);if(n)return t=t||this.generateUidIdentifier(e).name,new A.default(n,e,t).rename(r)},e.prototype._renameFromMap=function(e,t,r,n){e[t]&&(e[r]=n,e[t]=null)},e.prototype.dump=function(){var e=(0,E.default)("-",60);console.log(e);var t=this;do{console.log("#",t.block.type);for(var r in t.bindings){var n=t.bindings[r];console.log(" -",r,{constant:n.constant,references:n.references,violations:n.constantViolations.length,kind:n.kind})}}while(t=t.parent);console.log(e)},e.prototype.toArray=function(e,t){var r=this.hub.file;if(R.isIdentifier(e)){var n=this.getBinding(e.name);if(n&&n.constant&&n.path.isGenericType("Array"))return e}if(R.isArrayExpression(e))return e;if(R.isIdentifier(e,{name:"arguments"}))return R.callExpression(R.memberExpression(R.memberExpression(R.memberExpression(R.identifier("Array"),R.identifier("prototype")),R.identifier("slice")),R.identifier("call")),[e]);var i="toArray",s=[e];return!0===t?i="toConsumableArray":t&&(s.push(R.numericLiteral(t)),i="slicedToArray"),R.callExpression(r.addHelper(i),s)},e.prototype.hasLabel=function(e){return!!this.getLabel(e)},e.prototype.getLabel=function(e){return this.labels.get(e)},e.prototype.registerLabel=function(e){this.labels.set(e.node.label.name,e)},e.prototype.registerDeclaration=function(e){if(e.isLabeledStatement())this.registerLabel(e);else if(e.isFunctionDeclaration())this.registerBinding("hoisted",e.get("id"),e);else if(e.isVariableDeclaration())for(var t=e.get("declarations"),r=t,n=Array.isArray(r),i=0,r=n?r:(0,y.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var a=s;this.registerBinding(e.node.kind,a)}else if(e.isClassDeclaration())this.registerBinding("let",e);else if(e.isImportDeclaration())for(var o=e.get("specifiers"),u=o,l=Array.isArray(u),c=0,u=l?u:(0,y.default)(u);;){var f;if(l){if(c>=u.length)break;f=u[c++]}else{if(c=u.next(),c.done)break;f=c.value}var p=f;this.registerBinding("module",p)}else if(e.isExportDeclaration()){var d=e.get("declaration");(d.isClassDeclaration()||d.isFunctionDeclaration()||d.isVariableDeclaration())&&this.registerDeclaration(d)}else this.registerBinding("unknown",e)},e.prototype.buildUndefinedNode=function(){return this.hasBinding("undefined")?R.unaryExpression("void",R.numericLiteral(0),!0):R.identifier("undefined")},e.prototype.registerConstantViolation=function(e){var t=e.getBindingIdentifiers();for(var r in t){var n=this.getBinding(r);n&&n.reassign(e)}},e.prototype.registerBinding=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;if(!e)throw new ReferenceError("no `kind`");if(t.isVariableDeclaration())for(var n=t.get("declarations"),i=n,s=Array.isArray(i),a=0,i=s?i:(0,y.default)(i);;){var o;if(s){if(a>=i.length)break;o=i[a++]}else{if(a=i.next(),a.done)break;o=a.value}var u=o;this.registerBinding(e,u)}else{var l=this.getProgramParent(),c=t.getBindingIdentifiers(!0);for(var f in c)for(var p=c[f],d=Array.isArray(p),h=0,p=d?p:(0,y.default)(p);;){var m;if(d){if(h>=p.length)break;m=p[h++]}else{if(h=p.next(),h.done)break;m=h.value}var v=m,g=this.getOwnBinding(f);if(g){if(g.identifier===v)continue;this.checkBlockScopedCollisions(g,e,f,v)}g&&g.path.isFlow()&&(g=null),l.references[f]=!0,this.bindings[f]=new F.default({identifier:v,existing:g,scope:this,path:r,kind:e})}}},e.prototype.addGlobal=function(e){this.globals[e.name]=e},e.prototype.hasUid=function(e){var t=this;do{if(t.uids[e])return!0}while(t=t.parent);return!1},e.prototype.hasGlobal=function(e){var t=this;do{if(t.globals[e])return!0}while(t=t.parent);return!1},e.prototype.hasReference=function(e){var t=this;do{if(t.references[e])return!0}while(t=t.parent);return!1},e.prototype.isPure=function(e,t){if(R.isIdentifier(e)){var r=this.getBinding(e.name);return!!r&&(!t||r.constant)}if(R.isClass(e))return!(e.superClass&&!this.isPure(e.superClass,t))&&this.isPure(e.body,t);if(R.isClassBody(e)){for(var n=e.body,i=Array.isArray(n),s=0,n=i?n:(0,y.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a;if(!this.isPure(o,t))return!1}return!0}if(R.isBinary(e))return this.isPure(e.left,t)&&this.isPure(e.right,t);if(R.isArrayExpression(e)){for(var u=e.elements,l=Array.isArray(u),c=0,u=l?u:(0,y.default)(u);;){var f;if(l){if(c>=u.length)break;f=u[c++]}else{if(c=u.next(),c.done)break;f=c.value}var p=f;if(!this.isPure(p,t))return!1}return!0}if(R.isObjectExpression(e)){for(var d=e.properties,h=Array.isArray(d),m=0,d=h?d:(0,y.default)(d);;){var v;if(h){if(m>=d.length)break;v=d[m++]}else{if(m=d.next(),m.done)break;v=m.value}var g=v;if(!this.isPure(g,t))return!1}return!0}return R.isClassMethod(e)?!(e.computed&&!this.isPure(e.key,t))&&("get"!==e.kind&&"set"!==e.kind):R.isClassProperty(e)||R.isObjectProperty(e)?!(e.computed&&!this.isPure(e.key,t))&&this.isPure(e.value,t):R.isUnaryExpression(e)?this.isPure(e.argument,t):R.isPureish(e)},e.prototype.setData=function(e,t){return this.data[e]=t},e.prototype.getData=function(e){var t=this;do{var r=t.data[e];if(null!=r)return r}while(t=t.parent)},e.prototype.removeData=function(e){var t=this;do{null!=t.data[e]&&(t.data[e]=null)}while(t=t.parent)},e.prototype.init=function(){this.references||this.crawl()},e.prototype.crawl=function(){M++,this._crawl(),M--},e.prototype._crawl=function(){var e=this.path;if(this.references=(0,c.default)(null),this.bindings=(0,c.default)(null),this.globals=(0,c.default)(null),this.uids=(0,c.default)(null),this.data=(0,c.default)(null),e.isLoop())for(var t=R.FOR_INIT_KEYS,r=Array.isArray(t),n=0,t=r?t:(0,y.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i,a=e.get(s);a.isBlockScoped()&&this.registerBinding(a.node.kind,a)}if(e.isFunctionExpression()&&e.has("id")&&(e.get("id").node[R.NOT_LOCAL_BINDING]||this.registerBinding("local",e.get("id"),e)),e.isClassExpression()&&e.has("id")&&(e.get("id").node[R.NOT_LOCAL_BINDING]||this.registerBinding("local",e)),e.isFunction())for(var o=e.get("params"),u=o,l=Array.isArray(u),f=0,u=l?u:(0,y.default)(u);;){var p;if(l){if(f>=u.length)break;p=u[f++]}else{if(f=u.next(),f.done)break;p=f.value}var d=p;this.registerBinding("param",d)}if(e.isCatchClause()&&this.registerBinding("let",e),!this.getProgramParent().crawling){var h={references:[],constantViolations:[],assignments:[]};this.crawling=!0,e.traverse(N,h),this.crawling=!1;for(var m=h.assignments,v=Array.isArray(m),g=0,m=v?m:(0,y.default)(m);;){var b;if(v){if(g>=m.length)break;b=m[g++]}else{if(g=m.next(),g.done)break;b=g.value}var E=b,x=E.getBindingIdentifiers(),A=void 0;for(var S in x)E.scope.getBinding(S)||(A=A||E.scope.getProgramParent(),A.addGlobal(x[S]));E.scope.registerConstantViolation(E)}for(var _=h.references,D=Array.isArray(_),C=0,_=D?_:(0,y.default)(_);;){var w;if(D){if(C>=_.length)break;w=_[C++]}else{if(C=_.next(),C.done)break;w=C.value}var P=w,k=P.scope.getBinding(P.node.name);k?k.reference(P):P.scope.getProgramParent().addGlobal(P.node)}for(var F=h.constantViolations,T=Array.isArray(F),O=0,F=T?F:(0,y.default)(F);;){var B;if(T){if(O>=F.length)break;B=F[O++]}else{if(O=F.next(),O.done)break;B=O.value}var I=B;I.scope.registerConstantViolation(I)}}},e.prototype.push=function(e){var t=this.path;t.isBlockStatement()||t.isProgram()||(t=this.getBlockParent().path),t.isSwitchStatement()&&(t=this.getFunctionParent().path),(t.isLoop()||t.isCatchClause()||t.isFunction())&&(R.ensureBlock(t.node),t=t.get("body"));var r=e.unique,n=e.kind||"var",i=null==e._blockHoist?2:e._blockHoist,s="declaration:"+n+":"+i,a=!r&&t.getData(s);if(!a){var o=R.variableDeclaration(n,[]);o._generated=!0,o._blockHoist=i;a=t.unshiftContainer("body",[o])[0],r||t.setData(s,a)}var u=R.variableDeclarator(e.id,e.init);a.node.declarations.push(u),this.registerBinding(n,a.get("declarations").pop())},e.prototype.getProgramParent=function(){var e=this;do{if(e.path.isProgram())return e}while(e=e.parent);throw new Error("We couldn't find a Function or Program...")},e.prototype.getFunctionParent=function(){var e=this;do{if(e.path.isFunctionParent())return e}while(e=e.parent);throw new Error("We couldn't find a Function or Program...")},e.prototype.getBlockParent=function(){var e=this;do{if(e.path.isBlockParent())return e}while(e=e.parent);throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...")},e.prototype.getAllBindings=function(){var e=(0,c.default)(null),t=this;do{(0,C.default)(e,t.bindings),t=t.parent}while(t);return e},e.prototype.getAllBindingsOfKind=function(){for(var e=(0,c.default)(null),t=arguments,r=Array.isArray(t),n=0,t=r?t:(0,y.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i,a=this;do{for(var o in a.bindings){var u=a.bindings[o];u.kind===s&&(e[o]=u)}a=a.parent}while(a)}return e},e.prototype.bindingIdentifierEquals=function(e,t){ return this.getBindingIdentifier(e)===t},e.prototype.warnOnFlowBinding=function(e){return 0===M&&e&&e.path.isFlow()&&console.warn("\n You or one of the Babel plugins you are using are using Flow declarations as bindings.\n Support for this will be removed in version 7. To find out the caller, grep for this\n message and change it to a `console.trace()`.\n "),e},e.prototype.getBinding=function(e){var t=this;do{var r=t.getOwnBinding(e);if(r)return this.warnOnFlowBinding(r)}while(t=t.parent)},e.prototype.getOwnBinding=function(e){return this.warnOnFlowBinding(this.bindings[e])},e.prototype.getBindingIdentifier=function(e){var t=this.getBinding(e);return t&&t.identifier},e.prototype.getOwnBindingIdentifier=function(e){var t=this.bindings[e];return t&&t.identifier},e.prototype.hasOwnBinding=function(e){return!!this.getOwnBinding(e)},e.prototype.hasBinding=function(t,r){return!!t&&(!!this.hasOwnBinding(t)||(!!this.parentHasBinding(t,r)||(!!this.hasUid(t)||(!(r||!(0,g.default)(e.globals,t))||!(r||!(0,g.default)(e.contextVariables,t))))))},e.prototype.parentHasBinding=function(e,t){return this.parent&&this.parent.hasBinding(e,t)},e.prototype.moveBindingTo=function(e,t){var r=this.getBinding(e);r&&(r.scope.removeOwnBinding(e),r.scope=t,t.bindings[e]=r)},e.prototype.removeOwnBinding=function(e){delete this.bindings[e]},e.prototype.removeBinding=function(e){var t=this.getBinding(e);t&&t.scope.removeOwnBinding(e);var r=this;do{r.uids[e]&&(r.uids[e]=!1)}while(r=r.parent)},e}();j.globals=(0,u.default)(O.default.builtin),j.contextVariables=["arguments","undefined","Infinity","NaN"],t.default=j,e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.NOT_LOCAL_BINDING=t.BLOCK_SCOPED_SYMBOL=t.INHERIT_KEYS=t.UNARY_OPERATORS=t.STRING_UNARY_OPERATORS=t.NUMBER_UNARY_OPERATORS=t.BOOLEAN_UNARY_OPERATORS=t.BINARY_OPERATORS=t.NUMBER_BINARY_OPERATORS=t.BOOLEAN_BINARY_OPERATORS=t.COMPARISON_BINARY_OPERATORS=t.EQUALITY_BINARY_OPERATORS=t.BOOLEAN_NUMBER_BINARY_OPERATORS=t.UPDATE_OPERATORS=t.LOGICAL_OPERATORS=t.COMMENT_KEYS=t.FOR_INIT_KEYS=t.FLATTENABLE_KEYS=t.STATEMENT_OR_BLOCK_KEYS=void 0;var n=r(362),i=function(e){return e&&e.__esModule?e:{default:e}}(n),s=(t.STATEMENT_OR_BLOCK_KEYS=["consequent","body","alternate"],t.FLATTENABLE_KEYS=["body","expressions"],t.FOR_INIT_KEYS=["left","init"],t.COMMENT_KEYS=["leadingComments","trailingComments","innerComments"],t.LOGICAL_OPERATORS=["||","&&"],t.UPDATE_OPERATORS=["++","--"],t.BOOLEAN_NUMBER_BINARY_OPERATORS=[">","<",">=","<="]),a=t.EQUALITY_BINARY_OPERATORS=["==","===","!=","!=="],o=t.COMPARISON_BINARY_OPERATORS=[].concat(a,["in","instanceof"]),u=t.BOOLEAN_BINARY_OPERATORS=[].concat(o,s),l=t.NUMBER_BINARY_OPERATORS=["-","/","%","*","**","&","|",">>",">>>","<<","^"],c=(t.BINARY_OPERATORS=["+"].concat(l,u),t.BOOLEAN_UNARY_OPERATORS=["delete","!"]),f=t.NUMBER_UNARY_OPERATORS=["+","-","++","--","~"],p=t.STRING_UNARY_OPERATORS=["typeof"];t.UNARY_OPERATORS=["void"].concat(c,f,p),t.INHERIT_KEYS={optional:["typeAnnotation","typeParameters","returnType"],force:["start","loc","end"]},t.BLOCK_SCOPED_SYMBOL=(0,i.default)("var used to be block scoped"),t.NOT_LOCAL_BINDING=(0,i.default)("should not be considered a local binding")},function(e,t){"use strict";e.exports=function(e,t,r,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(r+": incorrect invocation!");return e}},function(e,t,r){"use strict";var n=r(43),i=r(142),s=r(94),a=r(153),o=r(422);e.exports=function(e,t){var r=1==e,u=2==e,l=3==e,c=4==e,f=6==e,p=5==e||f,d=t||o;return function(t,o,h){for(var m,y,v=s(t),g=i(v),b=n(o,h,3),E=a(g.length),x=0,A=r?d(t,E):u?d(t,0):void 0;E>x;x++)if((p||x in g)&&(m=g[x],y=b(m,x,v),e))if(r)A[x]=y;else if(y)switch(e){case 3:return!0;case 5:return m;case 6:return x;case 2:A.push(m)}else if(c)return!1;return f?-1:l||c?c:A}}},function(e,t){"use strict";var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){"use strict";var n=r(15),i=r(12),s=r(57),a=r(27),o=r(29),u=r(146),l=r(55),c=r(136),f=r(16),p=r(93),d=r(23).f,h=r(137)(0),m=r(22);e.exports=function(e,t,r,y,v,g){var b=n[e],E=b,x=v?"set":"add",A=E&&E.prototype,S={};return m&&"function"==typeof E&&(g||A.forEach&&!a(function(){(new E).entries().next()}))?(E=t(function(t,r){c(t,E,e,"_c"),t._c=new b,void 0!=r&&l(r,v,t[x],t)}),h("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(e){var t="add"==e||"set"==e;e in A&&(!g||"clear"!=e)&&o(E.prototype,e,function(r,n){if(c(this,E,e),!t&&g&&!f(r))return"get"==e&&void 0;var i=this._c[e](0===r?0:r,n);return t?this:i})}),g||d(E.prototype,"size",{get:function(){return this._c.size}})):(E=y.getConstructor(t,e,v,x),u(E.prototype,r),s.NEED=!0),p(E,e),S[e]=E,i(i.G+i.W+i.F,S),g||y.setStrong(E,e,v),E}},function(e,t){"use strict";e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){"use strict";e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,r){"use strict";var n=r(138);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},function(e,t,r){"use strict";var n=r(144),i=r(12),s=r(147),a=r(29),o=r(28),u=r(56),l=r(429),c=r(93),f=r(433),p=r(13)("iterator"),d=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,r,m,y,v,g){l(r,t,m);var b,E,x,A=function(e){if(!d&&e in C)return C[e];switch(e){case"keys":case"values":return function(){return new r(this,e)}}return function(){return new r(this,e)}},S=t+" Iterator",_="values"==y,D=!1,C=e.prototype,w=C[p]||C["@@iterator"]||y&&C[y],P=w||A(y),k=y?_?A("entries"):P:void 0,F="Array"==t?C.entries||w:w;if(F&&(x=f(F.call(new e)))!==Object.prototype&&x.next&&(c(x,S,!0),n||o(x,p)||a(x,p,h)),_&&w&&"values"!==w.name&&(D=!0,P=function(){return w.call(this)}),n&&!g||!d&&!D&&C[p]||a(C,p,P),u[t]=P,u[S]=h,y)if(b={values:_?P:A("values"),keys:v?P:A("keys"),entries:k},g)for(E in b)E in C||s(C,E,b[E]);else i(i.P+i.F*(d||D),t,b);return b}},function(e,t){"use strict";e.exports=!0},function(e,t){"use strict";t.f=Object.getOwnPropertySymbols},function(e,t,r){"use strict";var n=r(29);e.exports=function(e,t,r){for(var i in t)r&&e[i]?e[i]=t[i]:n(e,i,t[i]);return e}},function(e,t,r){"use strict";e.exports=r(29)},function(e,t,r){"use strict";var n=r(12),i=r(227),s=r(43),a=r(55);e.exports=function(e){n(n.S,e,{from:function(e){var t,r,n,o,u=arguments[1];return i(this),t=void 0!==u,t&&i(u),void 0==e?new this:(r=[],t?(n=0,o=s(u,arguments[2],2),a(e,!1,function(e){r.push(o(e,n++))})):a(e,!1,r.push,r),new this(r))}})}},function(e,t,r){"use strict";var n=r(12);e.exports=function(e){n(n.S,e,{of:function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},function(e,t,r){"use strict";var n=r(151)("keys"),i=r(95);e.exports=function(e){return n[e]||(n[e]=i(e))}},function(e,t,r){"use strict";var n=r(15),i=n["__core-js_shared__"]||(n["__core-js_shared__"]={});e.exports=function(e){return i[e]||(i[e]={})}},function(e,t){"use strict";var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,r){"use strict";var n=r(152),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},function(e,t,r){"use strict";var n=r(16);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){"use strict";var n=r(15),i=r(5),s=r(144),a=r(156),o=r(23).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=s?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||o(t,e,{value:a.f(e)})}},function(e,t,r){"use strict";t.f=r(13)},function(e,t,r){"use strict";var n=r(437)(!0);r(143)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=n(t,r),this._i+=e.length,{value:e,done:!1})})},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(15),s=r(28),a=r(22),o=r(12),u=r(147),l=r(57).KEY,c=r(27),f=r(151),p=r(93),d=r(95),h=r(13),m=r(156),y=r(155),v=r(430),g=r(425),b=r(232),E=r(21),x=r(37),A=r(154),S=r(92),_=r(90),D=r(432),C=r(235),w=r(23),P=r(44),k=C.f,F=w.f,T=D.f,O=i.Symbol,B=i.JSON,R=B&&B.stringify,I=h("_hidden"),M=h("toPrimitive"),N={}.propertyIsEnumerable,L=f("symbol-registry"),j=f("symbols"),U=f("op-symbols"),V=Object.prototype,G="function"==typeof O,W=i.QObject,Y=!W||!W.prototype||!W.prototype.findChild,q=a&&c(function(){return 7!=_(F({},"a",{get:function(){return F(this,"a",{value:7}).a}})).a})?function(e,t,r){var n=k(V,t);n&&delete V[t],F(e,t,r),n&&e!==V&&F(V,t,n)}:F,K=function(e){var t=j[e]=_(O.prototype);return t._k=e,t},H=G&&"symbol"==n(O.iterator)?function(e){return"symbol"==(void 0===e?"undefined":n(e))}:function(e){return e instanceof O},J=function(e,t,r){return e===V&&J(U,t,r),E(e),t=A(t,!0),E(r),s(j,t)?(r.enumerable?(s(e,I)&&e[I][t]&&(e[I][t]=!1),r=_(r,{enumerable:S(0,!1)})):(s(e,I)||F(e,I,S(1,{})),e[I][t]=!0),q(e,t,r)):F(e,t,r)},X=function(e,t){E(e);for(var r,n=g(t=x(t)),i=0,s=n.length;s>i;)J(e,r=n[i++],t[r]);return e},z=function(e,t){return void 0===t?_(e):X(_(e),t)},$=function(e){var t=N.call(this,e=A(e,!0));return!(this===V&&s(j,e)&&!s(U,e))&&(!(t||!s(this,e)||!s(j,e)||s(this,I)&&this[I][e])||t)},Q=function(e,t){if(e=x(e),t=A(t,!0),e!==V||!s(j,t)||s(U,t)){var r=k(e,t);return!r||!s(j,t)||s(e,I)&&e[I][t]||(r.enumerable=!0),r}},Z=function(e){for(var t,r=T(x(e)),n=[],i=0;r.length>i;)s(j,t=r[i++])||t==I||t==l||n.push(t);return n},ee=function(e){for(var t,r=e===V,n=T(r?U:x(e)),i=[],a=0;n.length>a;)!s(j,t=n[a++])||r&&!s(V,t)||i.push(j[t]);return i};G||(O=function(){if(this instanceof O)throw TypeError("Symbol is not a constructor!");var e=d(arguments.length>0?arguments[0]:void 0),t=function t(r){this===V&&t.call(U,r),s(this,I)&&s(this[I],e)&&(this[I][e]=!1),q(this,e,S(1,r))};return a&&Y&&q(V,e,{configurable:!0,set:t}),K(e)},u(O.prototype,"toString",function(){return this._k}),C.f=Q,w.f=J,r(236).f=D.f=Z,r(91).f=$,r(145).f=ee,a&&!r(144)&&u(V,"propertyIsEnumerable",$,!0),m.f=function(e){return K(h(e))}),o(o.G+o.W+o.F*!G,{Symbol:O});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;te.length>re;)h(te[re++]);for(var ne=P(h.store),ie=0;ne.length>ie;)y(ne[ie++]);o(o.S+o.F*!G,"Symbol",{for:function(e){return s(L,e+="")?L[e]:L[e]=O(e)},keyFor:function(e){if(H(e))return v(L,e);throw TypeError(e+" is not a symbol!")},useSetter:function(){Y=!0},useSimple:function(){Y=!1}}),o(o.S+o.F*!G,"Object",{create:z,defineProperty:J,defineProperties:X,getOwnPropertyDescriptor:Q,getOwnPropertyNames:Z,getOwnPropertySymbols:ee}),B&&o(o.S+o.F*(!G||c(function(){var e=O();return"[null]"!=R([e])||"{}"!=R({a:e})||"{}"!=R(Object(e))})),"JSON",{stringify:function(e){if(void 0!==e&&!H(e)){for(var t,r,n=[e],i=1;arguments.length>i;)n.push(arguments[i++]);return t=n[1],"function"==typeof t&&(r=t),!r&&b(t)||(t=function(e,t){if(r&&(t=r.call(this,e,t)),!H(t))return t}),n[1]=t,R.apply(B,n)}}}),O.prototype[M]||r(29)(O.prototype,M,O.prototype.valueOf),p(O,"Symbol"),p(Math,"Math",!0),p(i.JSON,"JSON",!0)},function(e,t,r){"use strict";var n=r(38),i=r(17),s=n(i,"Map");e.exports=s},function(e,t,r){"use strict";function n(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var i=r(551),s=r(552),a=r(553),o=r(554),u=r(555);n.prototype.clear=i,n.prototype.delete=s,n.prototype.get=a,n.prototype.has=o,n.prototype.set=u,e.exports=n},function(e,t){"use strict";function r(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}e.exports=r},function(e,t,r){"use strict";function n(e,t,r){var n=e[t];o.call(e,t)&&s(n,r)&&(void 0!==r||t in e)||i(e,t,r)}var i=r(163),s=r(46),a=Object.prototype,o=a.hasOwnProperty;e.exports=n},function(e,t,r){"use strict";function n(e,t,r){"__proto__"==t&&i?i(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var i=r(259);e.exports=n},function(e,t,r){"use strict";function n(e,t,r,T,O,B){var R,I=t&S,M=t&_,N=t&D;if(r&&(R=O?r(e,T,O,B):r(e)),void 0!==R)return R;if(!x(e))return e;var L=b(e);if(L){if(R=y(e),!I)return c(e,R)}else{var j=m(e),U=j==w||j==P;if(E(e))return l(e,I);if(j==k||j==C||U&&!O){if(R=M||U?{}:g(e),!I)return M?p(e,u(R,e)):f(e,o(R,e))}else{if(!F[j])return O?e:{};R=v(e,j,n,I)}}B||(B=new i);var V=B.get(e);if(V)return V;B.set(e,R);var G=N?M?h:d:M?keysIn:A,W=L?void 0:G(e);return s(W||e,function(i,s){W&&(s=i,i=e[s]),a(R,s,n(i,t,r,s,e,B))}),R}var i=r(99),s=r(478),a=r(162),o=r(483),u=r(484),l=r(256),c=r(168),f=r(523),p=r(524),d=r(262),h=r(532),m=r(264),y=r(541),v=r(542),g=r(266),b=r(6),E=r(113),x=r(18),A=r(32),S=1,_=2,D=4,C="[object Arguments]",w="[object Function]",P="[object GeneratorFunction]",k="[object Object]",F={};F[C]=F["[object Array]"]=F["[object ArrayBuffer]"]=F["[object DataView]"]=F["[object Boolean]"]=F["[object Date]"]=F["[object Float32Array]"]=F["[object Float64Array]"]=F["[object Int8Array]"]=F["[object Int16Array]"]=F["[object Int32Array]"]=F["[object Map]"]=F["[object Number]"]=F[k]=F["[object RegExp]"]=F["[object Set]"]=F["[object String]"]=F["[object Symbol]"]=F["[object Uint8Array]"]=F["[object Uint8ClampedArray]"]=F["[object Uint16Array]"]=F["[object Uint32Array]"]=!0,F["[object Error]"]=F[w]=F["[object WeakMap]"]=!1,e.exports=n},function(e,t){"use strict";function r(e,t,r,n){for(var i=e.length,s=r+(n?1:-1);n?s--:++s<i;)if(t(e[s],s,e))return s;return-1}e.exports=r},function(e,t,r){"use strict";function n(e,t,r){return t===t?a(e,t,r):i(e,s,r)}var i=r(165),s=r(496),a=r(570);e.exports=n},function(e,t,r){"use strict";function n(e){var t=new e.constructor(e.byteLength);return new i(t).set(new i(e)),t}var i=r(243);e.exports=n},function(e,t){"use strict";function r(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}e.exports=r},function(e,t,r){"use strict";var n=r(271),i=n(Object.getPrototypeOf,Object);e.exports=i},function(e,t,r){"use strict";var n=r(479),i=r(279),s=Object.prototype,a=s.propertyIsEnumerable,o=Object.getOwnPropertySymbols,u=o?function(e){return null==e?[]:(e=Object(e),n(o(e),function(t){return a.call(e,t)}))}:i;e.exports=u},function(e,t){"use strict";function r(e,t){return!!(t=null==t?n:t)&&("number"==typeof e||i.test(e))&&e>-1&&e%1==0&&e<t}var n=9007199254740991,i=/^(?:0|[1-9]\d*)$/;e.exports=r},function(e,t,r){"use strict";function n(e,t,r){if(!u(r))return!1;var n=void 0===t?"undefined":i(t);return!!("number"==n?a(r)&&o(t,r.length):"string"==n&&t in r)&&s(r[t],e)}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=r(46),a=r(24),o=r(171),u=r(18);e.exports=n},function(e,t,r){"use strict";function n(e,t){if(s(e))return!1;var r=void 0===e?"undefined":i(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!a(e))||(u.test(e)||!o.test(e)||null!=t&&e in Object(t))}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=r(6),a=r(62),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/;e.exports=n},function(e,t,r){"use strict";var n=r(162),i=r(31),s=r(103),a=r(24),o=r(105),u=r(32),l=Object.prototype,c=l.hasOwnProperty,f=s(function(e,t){if(o(t)||a(t))return void i(t,u(t),e);for(var r in t)c.call(t,r)&&n(e,r,t[r])});e.exports=f},function(e,t,r){"use strict";function n(e){if(!s(e))return!1;var t=i(e);return t==o||t==u||t==a||t==l}var i=r(30),s=r(18),a="[object AsyncFunction]",o="[object Function]",u="[object GeneratorFunction]",l="[object Proxy]";e.exports=n},function(e,t){"use strict";function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}var n=9007199254740991;e.exports=r},function(e,t,r){"use strict";var n=r(499),i=r(102),s=r(270),a=s&&s.isTypedArray,o=a?i(a):n;e.exports=o},function(e,t,r){function n(e){return r(i(e))}function i(e){return s[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var s={"./index":50,"./index.js":50,"./logger":120,"./logger.js":120,"./metadata":121,"./metadata.js":121,"./options/build-config-chain":51,"./options/build-config-chain.js":51,"./options/config":33,"./options/config.js":33,"./options/index":52,"./options/index.js":52,"./options/option-manager":34,"./options/option-manager.js":34,"./options/parsers":53,"./options/parsers.js":53,"./options/removed":54,"./options/removed.js":54};n.keys=function(){return Object.keys(s)},n.resolve=i,e.exports=n,n.id=178},function(e,t,r){function n(e){return r(i(e))}function i(e){return s[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var s={"./build-config-chain":51,"./build-config-chain.js":51,"./config":33,"./config.js":33,"./index":52,"./index.js":52,"./option-manager":34,"./option-manager.js":34,"./parsers":53,"./parsers.js":53,"./removed":54,"./removed.js":54};n.keys=function(){return Object.keys(s)},n.resolve=i,e.exports=n,n.id=179},function(e,t){"use strict";e.exports=function(){return/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){return{keyword:e.cyan,capitalized:e.yellow,jsx_tag:e.yellow,punctuator:e.yellow,number:e.magenta,string:e.green,regex:e.magenta,comment:e.grey,invalid:e.white.bgRed.bold,gutter:e.grey,marker:e.red.bold}}function s(e){var t=e.slice(-2),r=t[0],n=t[1],i=(0,o.matchToToken)(e);if("name"===i.type){if(c.default.keyword.isReservedWordES6(i.value))return"keyword";if(h.test(i.value)&&("<"===n[r-1]||"</"==n.substr(r-2,2)))return"jsx_tag";if(i.value[0]!==i.value[0].toLowerCase())return"capitalized"}return"punctuator"===i.type&&m.test(i.value)?"bracket":i.type}function a(e,t){return t.replace(u.default,function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=s(r),a=e[i];return a?r[0].split(d).map(function(e){return a(e)}).join("\n"):r[0]})}t.__esModule=!0,t.default=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};r=Math.max(r,0);var s=n.highlightCode&&p.default.supportsColor||n.forceColor,o=p.default;n.forceColor&&(o=new p.default.constructor({enabled:!0}));var u=function(e,t){return s?e(t):t},l=i(o);s&&(e=a(l,e));var c=n.linesAbove||2,f=n.linesBelow||3,h=e.split(d),m=Math.max(t-(c+1),0),y=Math.min(h.length,t+f);t||r||(m=0,y=h.length);var v=String(y).length,g=h.slice(m,y).map(function(e,n){var i=m+1+n,s=(" "+i).slice(-v),a=" "+s+" | ";if(i===t){var o="";if(r){var c=e.slice(0,r-1).replace(/[^\t]/g," ");o=["\n ",u(l.gutter,a.replace(/\d/g," ")),c,u(l.marker,"^")].join("")}return[u(l.marker,">"),u(l.gutter,a),e,o].join("")}return" "+u(l.gutter,a)+e}).join("\n");return s?o.reset(g):g};var o=r(468),u=n(o),l=r(97),c=n(l),f=r(401),p=n(f),d=/\r\n|[\n\r\u2028\u2029]/,h=/^[a-z][\w-]*$/i,m=/^[()\[\]{}]$/;e.exports=t.default},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e){throw new Error("The ("+e+") Babel 5 plugin is being run with Babel 6.")}function a(e,t,r){"function"==typeof t&&(r=t,t={}),t.filename=e,y.default.readFile(e,function(e,n){var i=void 0;if(!e)try{i=F(n,t)}catch(t){e=t}e?r(e):r(null,i)})}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.filename=e,F(y.default.readFileSync(e,"utf8"),t)}t.__esModule=!0,t.transformFromAst=t.transform=t.analyse=t.Pipeline=t.OptionManager=t.traverse=t.types=t.messages=t.util=t.version=t.resolvePreset=t.resolvePlugin=t.template=t.buildExternalHelpers=t.options=t.File=void 0;var u=r(50);Object.defineProperty(t,"File",{enumerable:!0,get:function(){return i(u).default}});var l=r(33);Object.defineProperty(t,"options",{enumerable:!0,get:function(){return i(l).default}});var c=r(295);Object.defineProperty(t,"buildExternalHelpers",{enumerable:!0,get:function(){return i(c).default}});var f=r(4);Object.defineProperty(t,"template",{enumerable:!0,get:function(){return i(f).default}});var p=r(184);Object.defineProperty(t,"resolvePlugin",{enumerable:!0,get:function(){return i(p).default}});var d=r(185);Object.defineProperty(t,"resolvePreset",{enumerable:!0,get:function(){return i(d).default}});var h=r(628);Object.defineProperty(t,"version",{enumerable:!0,get:function(){return h.version}}),t.Plugin=s,t.transformFile=a,t.transformFileSync=o;var m=r(115),y=i(m),v=r(122),g=n(v),b=r(20),E=n(b),x=r(1),A=n(x),S=r(7),_=i(S),D=r(34),C=i(D),w=r(298),P=i(w);t.util=g,t.messages=E,t.types=A,t.traverse=_.default,t.OptionManager=C.default,t.Pipeline=P.default;var k=new P.default,F=(t.analyse=k.analyse.bind(k),t.transform=k.transform.bind(k));t.transformFromAst=k.transformFromAst.bind(k)},function(e,t,r){"use strict";function n(e,t){return e.reduce(function(e,r){return e||(0,s.default)(r,t)},null)}t.__esModule=!0,t.default=n;var i=r(118),s=function(e){return e&&e.__esModule?e:{default:e}}(i);e.exports=t.default},function(e,t,r){(function(n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.cwd();return(0,o.default)((0,l.default)(e),t)}t.__esModule=!0,t.default=s;var a=r(183),o=i(a),u=r(291),l=i(u);e.exports=t.default}).call(t,r(8))},function(e,t,r){(function(n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.cwd();return(0,o.default)((0,l.default)(e),t)}t.__esModule=!0,t.default=s;var a=r(183),o=i(a),u=r(292),l=i(u);e.exports=t.default}).call(t,r(8))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){var n=" ";if(e&&"string"==typeof e){var i=(0,d.default)(e).indent;i&&" "!==i&&(n=i)}var a={auxiliaryCommentBefore:t.auxiliaryCommentBefore,auxiliaryCommentAfter:t.auxiliaryCommentAfter,shouldPrintComment:t.shouldPrintComment,retainLines:t.retainLines,retainFunctionParens:t.retainFunctionParens,comments:null==t.comments||t.comments,compact:t.compact,minified:t.minified,concise:t.concise,quotes:t.quotes||s(e,r),jsonCompatibleStrings:t.jsonCompatibleStrings,indent:{adjustMultilineComment:!0,style:n,base:0},flowCommaSeparator:t.flowCommaSeparator};return a.minified?(a.compact=!0,a.shouldPrintComment=a.shouldPrintComment||function(){return a.comments}):a.shouldPrintComment=a.shouldPrintComment||function(e){return a.comments||e.indexOf("@license")>=0||e.indexOf("@preserve")>=0},"auto"===a.compact&&(a.compact=e.length>5e5,a.compact&&console.error("[BABEL] "+v.get("codeGeneratorDeopt",t.filename,"500KB"))),a.compact&&(a.indent.adjustMultilineComment=!1),a}function s(e,t){if(!e)return"double";for(var r={single:0,double:0},n=0,i=0;i<t.length;i++){var s=t[i];if("string"===s.type.label){if("'"===e.slice(s.start,s.end)[0]?r.single++:r.double++,++n>=3)break}}return r.single>r.double?"single":"double"}t.__esModule=!0,t.CodeGenerator=void 0;var a=r(3),o=n(a),u=r(42),l=n(u),c=r(41),f=n(c);t.default=function(e,t,r){return new E(e,t,r).generate()};var p=r(459),d=n(p),h=r(313),m=n(h),y=r(20),v=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(y),g=r(312),b=n(g),E=function(e){function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments[2];(0,o.default)(this,t);var a=r.tokens||[],u=i(s,n,a),c=n.sourceMaps?new m.default(n,s):null,f=(0,l.default)(this,e.call(this,u,c,a));return f.ast=r,f}return(0,f.default)(t,e),t.prototype.generate=function(){return e.prototype.generate.call(this,this.ast)},t}(b.default);t.CodeGenerator=function(){function e(t,r,n){(0,o.default)(this,e),this._generator=new E(t,r,n)}return e.prototype.generate=function(){return this._generator.generate()},e}()},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e){function t(e,t){var n=r[e];r[e]=n?function(e,r,i){var s=n(e,r,i);return null==s?t(e,r,i):s}:t}for(var r={},n=(0,m.default)(e),i=Array.isArray(n),s=0,n=i?n:(0,d.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a,u=x.FLIPPED_ALIAS_KEYS[o];if(u)for(var l=u,c=Array.isArray(l),f=0,l=c?l:(0,d.default)(l);;){var p;if(c){if(f>=l.length)break;p=l[f++]}else{if(f=l.next(),f.done)break;p=f.value}var h=p;t(h,e[o])}else t(o,e[o])}return r}function a(e,t,r,n){var i=e[t.type];return i?i(t,r,n):null}function o(e){return!!x.isCallExpression(e)||!!x.isMemberExpression(e)&&(o(e.object)||!e.computed&&o(e.property))}function u(e,t,r){if(!e)return 0;x.isExpressionStatement(e)&&(e=e.expression);var n=a(S,e,t);if(!n){var i=a(_,e,t);if(i)for(var s=0;s<i.length&&!(n=u(i[s],e,r));s++);}return n&&n[r]||0}function l(e,t){return u(e,t,"before")}function c(e,t){return u(e,t,"after")}function f(e,t,r){return!!t&&(!(!x.isNewExpression(t)||t.callee!==e||!o(e))||a(A,e,t,r))}t.__esModule=!0;var p=r(2),d=i(p),h=r(14),m=i(h);t.needsWhitespace=u,t.needsWhitespaceBefore=l,t.needsWhitespaceAfter=c,t.needsParens=f;var y=r(311),v=i(y),g=r(310),b=n(g),E=r(1),x=n(E),A=s(b),S=s(v.default.nodes),_=s(v.default.list)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){return!v.isClassMethod(e)&&!v.isObjectMethod(e)||"get"!==e.kind&&"set"!==e.kind?"value":e.kind}function s(e,t,r,n,s){var a=v.toKeyAlias(t),o={};if((0,m.default)(e,a)&&(o=e[a]),e[a]=o,o._inherits=o._inherits||[],o._inherits.push(t),o._key=t.key,t.computed&&(o._computed=!0),t.decorators){var u=o.decorators=o.decorators||v.arrayExpression([]);u.elements=u.elements.concat(t.decorators.map(function(e){return e.expression}).reverse())}if(o.value||o.initializer)throw n.buildCodeFrameError(t,"Key conflict with sibling node");var l=void 0,c=void 0;(v.isObjectProperty(t)||v.isObjectMethod(t)||v.isClassMethod(t))&&(l=v.toComputedKey(t,t.key)),v.isObjectProperty(t)||v.isClassProperty(t)?c=t.value:(v.isObjectMethod(t)||v.isClassMethod(t))&&(c=v.functionExpression(null,t.params,t.body,t.generator,t.async),c.returnType=t.returnType);var f=i(t);return r&&"value"===f||(r=f),s&&v.isStringLiteral(l)&&("value"===r||"initializer"===r)&&v.isFunctionExpression(c)&&(c=(0,d.default)({id:l,node:c,scope:s})),c&&(v.inheritsComments(c,t),o[r]=c),o}function a(e){for(var t in e)if(e[t]._computed)return!0;return!1}function o(e){for(var t=v.arrayExpression([]),r=0;r<e.properties.length;r++){var n=e.properties[r],i=n.value;i.properties.unshift(v.objectProperty(v.identifier("key"),v.toComputedKey(n))),t.elements.push(i)}return t}function u(e){var t=v.objectExpression([]);return(0,f.default)(e).forEach(function(r){var n=e[r],i=v.objectExpression([]),s=v.objectProperty(n._key,i,n._computed);(0,f.default)(n).forEach(function(e){var t=n[e];if("_"!==e[0]){var r=t;(v.isClassMethod(t)||v.isClassProperty(t))&&(t=t.value);var s=v.objectProperty(v.identifier(e),t);v.inheritsComments(s,r),v.removeComments(r),i.properties.push(s)}}),t.properties.push(s)}),t}function l(e){return(0,f.default)(e).forEach(function(t){var r=e[t];r.value&&(r.writable=v.booleanLiteral(!0)),r.configurable=v.booleanLiteral(!0),r.enumerable=v.booleanLiteral(!0)}),u(e)}t.__esModule=!0;var c=r(14),f=n(c);t.push=s,t.hasComputed=a,t.toComputedObjectFromClass=o,t.toClassObject=u,t.toDefineObject=l;var p=r(40),d=n(p),h=r(274),m=n(h),y=r(1),v=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(y)},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){for(var t=e.params,r=0;r<t.length;r++){var n=t[r];if(i.isAssignmentPattern(n)||i.isRestElement(n))return r}return t.length};var n=r(1),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(n);e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(2),i=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"var";e.traverse(o,{kind:r,emit:t})};var s=r(1),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),o={Scope:function(e,t){"let"===t.kind&&e.skip()},Function:function(e){e.skip()},VariableDeclaration:function(e,t){if(!t.kind||e.node.kind===t.kind){for(var r=[],n=e.get("declarations"),s=void 0,o=n,u=Array.isArray(o),l=0,o=u?o:(0,i.default)(o);;){var c;if(u){if(l>=o.length)break;c=o[l++]}else{if(l=o.next(),l.done)break;c=l.value}var f=c;s=f.node.id,f.node.init&&r.push(a.expressionStatement(a.assignmentExpression("=",f.node.id,f.node.init)));for(var p in f.getBindingIdentifiers())t.emit(a.identifier(p),p)}e.parentPath.isFor({left:e.node})?e.replaceWith(s):e.replaceWithMultiple(r)}}};e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e,t,r){return 1===r.length&&i.isSpreadElement(r[0])&&i.isIdentifier(r[0].argument,{name:"arguments"})?i.callExpression(i.memberExpression(e,i.identifier("apply")),[t,r[0].argument]):i.callExpression(i.memberExpression(e,i.identifier("call")),[t].concat(r))};var n=r(1),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(n);e.exports=t.default},function(e,t,r){"use strict";function n(e,t){return u.isRegExpLiteral(e)&&e.flags.indexOf(t)>=0}function i(e,t){var r=e.flags.split("");e.flags.indexOf(t)<0||((0,a.default)(r,t),e.flags=r.join(""))}t.__esModule=!0,t.is=n,t.pullFlag=i;var s=r(277),a=function(e){return e&&e.__esModule?e:{default:e}}(s),o=r(1),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(o)},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e,t){return!!v.isSuper(e)&&(!v.isMemberExpression(t,{computed:!1})&&!v.isCallExpression(t,{callee:e}))}function a(e){return v.isMemberExpression(e)&&v.isSuper(e.object)}function o(e,t){var r=t?e:v.memberExpression(e,v.identifier("prototype"));return v.logicalExpression("||",v.memberExpression(r,v.identifier("__proto__")),v.callExpression(v.memberExpression(v.identifier("Object"),v.identifier("getPrototypeOf")),[r]))}t.__esModule=!0;var u=r(3),l=i(u),c=r(10),f=i(c),p=r(191),d=i(p),h=r(20),m=n(h),y=r(1),v=n(y),g=(0,f.default)(),b={Function:function(e){e.inShadow("this")||e.skip()},ReturnStatement:function(e,t){e.inShadow("this")||t.returns.push(e)},ThisExpression:function(e,t){e.node[g]||t.thises.push(e)},enter:function(e,t){var r=t.specHandle;t.isLoose&&(r=t.looseHandle);var n=e.isCallExpression()&&e.get("callee").isSuper(),i=r.call(t,e);i&&(t.hasSuper=!0),n&&t.bareSupers.push(e),!0===i&&e.requeue(),!0!==i&&i&&(Array.isArray(i)?e.replaceWithMultiple(i):e.replaceWith(i))}},E=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,l.default)(this,e),this.forceSuperMemoisation=t.forceSuperMemoisation,this.methodPath=t.methodPath, this.methodNode=t.methodNode,this.superRef=t.superRef,this.isStatic=t.isStatic,this.hasSuper=!1,this.inClass=r,this.isLoose=t.isLoose,this.scope=this.methodPath.scope,this.file=t.file,this.opts=t,this.bareSupers=[],this.returns=[],this.thises=[]}return e.prototype.getObjectRef=function(){return this.opts.objectRef||this.opts.getObjectRef()},e.prototype.setSuperProperty=function(e,t,r){return v.callExpression(this.file.addHelper("set"),[o(this.getObjectRef(),this.isStatic),r?e:v.stringLiteral(e.name),t,v.thisExpression()])},e.prototype.getSuperProperty=function(e,t){return v.callExpression(this.file.addHelper("get"),[o(this.getObjectRef(),this.isStatic),t?e:v.stringLiteral(e.name),v.thisExpression()])},e.prototype.replace=function(){this.methodPath.traverse(b,this)},e.prototype.getLooseSuperProperty=function(e,t){var r=this.methodNode,n=this.superRef||v.identifier("Function");return t.property===e?void 0:v.isCallExpression(t,{callee:e})?void 0:v.isMemberExpression(t)&&!r.static?v.memberExpression(n,v.identifier("prototype")):n},e.prototype.looseHandle=function(e){var t=e.node;if(e.isSuper())return this.getLooseSuperProperty(t,e.parent);if(e.isCallExpression()){var r=t.callee;if(!v.isMemberExpression(r))return;if(!v.isSuper(r.object))return;return v.appendToMemberExpression(r,v.identifier("call")),t.arguments.unshift(v.thisExpression()),!0}},e.prototype.specHandleAssignmentExpression=function(e,t,r){return"="===r.operator?this.setSuperProperty(r.left.property,r.right,r.left.computed):(e=e||t.scope.generateUidIdentifier("ref"),[v.variableDeclaration("var",[v.variableDeclarator(e,r.left)]),v.expressionStatement(v.assignmentExpression("=",r.left,v.binaryExpression(r.operator[0],e,r.right)))])},e.prototype.specHandle=function(e){var t=void 0,r=void 0,n=void 0,i=e.parent,o=e.node;if(s(o,i))throw e.buildCodeFrameError(m.get("classesIllegalBareSuper"));if(v.isCallExpression(o)){var u=o.callee;if(v.isSuper(u))return;a(u)&&(t=u.property,r=u.computed,n=o.arguments)}else if(v.isMemberExpression(o)&&v.isSuper(o.object))t=o.property,r=o.computed;else{if(v.isUpdateExpression(o)&&a(o.argument)){var l=v.binaryExpression(o.operator[0],o.argument,v.numericLiteral(1));if(o.prefix)return this.specHandleAssignmentExpression(null,e,l);var c=e.scope.generateUidIdentifier("ref");return this.specHandleAssignmentExpression(c,e,l).concat(v.expressionStatement(c))}if(v.isAssignmentExpression(o)&&a(o.left))return this.specHandleAssignmentExpression(null,e,o)}if(t){var f=this.getSuperProperty(t,r);return n?this.optimiseCall(f,n):f}},e.prototype.optimiseCall=function(e,t){var r=v.thisExpression();return r[g]=!0,(0,d.default)(e,r,t)},e}();t.default=E,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=u.default[e];if(!t)throw new ReferenceError("Unknown helper "+e);return t().expression}t.__esModule=!0,t.list=void 0;var s=r(14),a=n(s);t.get=i;var o=r(321),u=n(o);t.list=(0,a.default)(u.default).map(function(e){return e.replace(/^_/,"")}).filter(function(e){return"__esModule"!==e});t.default=i},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("asyncGenerators")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("classConstructorCall")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("classProperties")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("doExpressions")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("exponentiationOperator")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("exportExtensions")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("functionBind")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("objectRestSpread")}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),s=n(i),a=r(10),o=n(a);t.default=function(e){function t(e){for(var t=e.get("body.body"),r=t,n=Array.isArray(r),i=0,r=n?r:(0,s.default)(r);;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if(i=r.next(),i.done)break;a=i.value}var o=a;if("constructorCall"===o.node.kind)return o}return null}function n(e,t){var r=t,n=r.node,s=n.id||t.scope.generateUidIdentifier("class");t.parentPath.isExportDefaultDeclaration()&&(t=t.parentPath,t.insertAfter(i.exportDefaultDeclaration(s))),t.replaceWithMultiple(c({CLASS_REF:t.scope.generateUidIdentifier(s.name),CALL_REF:t.scope.generateUidIdentifier(s.name+"Call"),CALL:i.functionExpression(null,e.node.params,e.node.body),CLASS:i.toExpression(n),WRAPPER_REF:s})),e.remove()}var i=e.types,a=(0,o.default)();return{inherits:r(196),visitor:{Class:function(e){if(!e.node[a]){e.node[a]=!0;var r=t(e);r&&n(r,e)}}}}};var u=r(4),l=n(u),c=(0,l.default)("\n let CLASS_REF = CLASS;\n var CALL_REF = CALL;\n var WRAPPER_REF = function (...args) {\n if (this instanceof WRAPPER_REF) {\n return Reflect.construct(CLASS_REF, args);\n } else {\n return CALL_REF.apply(this, args);\n }\n };\n WRAPPER_REF.__proto__ = CLASS_REF;\n WRAPPER_REF;\n");e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),s=n(i);t.default=function(e){var t=e.types,n={Super:function(e){e.parentPath.isCallExpression({callee:e.node})&&this.push(e.parentPath)}},i={ReferencedIdentifier:function(e){this.scope.hasOwnBinding(e.node.name)&&(this.collision=!0,e.skip())}},a=(0,l.default)("\n Object.defineProperty(REF, KEY, {\n // configurable is false by default\n enumerable: true,\n writable: true,\n value: VALUE\n });\n "),u=function(e,r){var n=r.key,i=r.value,s=r.computed;return a({REF:e,KEY:t.isIdentifier(n)&&!s?t.stringLiteral(n.name):n,VALUE:i||t.identifier("undefined")})},c=function(e,r){var n=r.key,i=r.value,s=r.computed;return t.expressionStatement(t.assignmentExpression("=",t.memberExpression(e,n,s||t.isLiteral(n)),i))};return{inherits:r(197),visitor:{Class:function(e,r){for(var a=r.opts.spec?u:c,l=!!e.node.superClass,f=void 0,p=[],d=e.get("body"),h=d.get("body"),m=Array.isArray(h),y=0,h=m?h:(0,s.default)(h);;){var v;if(m){if(y>=h.length)break;v=h[y++]}else{if(y=h.next(),y.done)break;v=y.value}var g=v;g.isClassProperty()?p.push(g):g.isClassMethod({kind:"constructor"})&&(f=g)}if(p.length){var b=[],E=void 0;e.isClassExpression()||!e.node.id?((0,o.default)(e),E=e.scope.generateUidIdentifier("class")):E=e.node.id;for(var x=[],A=p,S=Array.isArray(A),_=0,A=S?A:(0,s.default)(A);;){var D;if(S){if(_>=A.length)break;D=A[_++]}else{if(_=A.next(),_.done)break;D=_.value}var C=D,w=C.node;if(!(w.decorators&&w.decorators.length>0)&&(r.opts.spec||w.value)){if(w.static)b.push(a(E,w));else{if(!w.value)continue;x.push(a(t.thisExpression(),w))}}}if(x.length){if(!f){var P=t.classMethod("constructor",t.identifier("constructor"),[],t.blockStatement([]));l&&(P.params=[t.restElement(t.identifier("args"))],P.body.body.push(t.returnStatement(t.callExpression(t.super(),[t.spreadElement(t.identifier("args"))]))));f=d.unshiftContainer("body",P)[0]}for(var k={collision:!1,scope:f.scope},F=p,T=Array.isArray(F),O=0,F=T?F:(0,s.default)(F);;){var B;if(T){if(O>=F.length)break;B=F[O++]}else{if(O=F.next(),O.done)break;B=O.value}if(B.traverse(i,k),k.collision)break}if(k.collision){var R=e.scope.generateUidIdentifier("initialiseProps");b.push(t.variableDeclaration("var",[t.variableDeclarator(R,t.functionExpression(null,[],t.blockStatement(x)))])),x=[t.expressionStatement(t.callExpression(t.memberExpression(R,t.identifier("call")),[t.thisExpression()]))]}if(l){var I=[];f.traverse(n,I);for(var M=I,N=Array.isArray(M),L=0,M=N?M:(0,s.default)(M);;){var j;if(N){if(L>=M.length)break;j=M[L++]}else{if(L=M.next(),L.done)break;j=L.value}j.insertAfter(x)}}else f.get("body").unshiftContainer("body",x)}for(var U=p,V=Array.isArray(U),G=0,U=V?U:(0,s.default)(U);;){var W;if(V){if(G>=U.length)break;W=U[G++]}else{if(G=U.next(),G.done)break;W=G.value}W.remove()}b.length&&(e.isClassExpression()?(e.scope.push({id:E}),e.replaceWith(t.assignmentExpression("=",E,e.node))):(e.node.id||(e.node.id=E),e.parentPath.isExportDeclaration()&&(e=e.parentPath)),e.insertAfter(b))}},ArrowFunctionExpression:function(e){var t=e.get("body");if(t.isClassExpression()){t.get("body").get("body").some(function(e){return e.isClassProperty()})&&e.ensureBlock()}}}}};var a=r(40),o=n(a),u=r(4),l=n(u);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(9),s=n(i),a=r(2),o=n(a);t.default=function(e){function t(e){return e.reverse().map(function(e){return e.expression})}function n(e,r,n){var i=[],a=e.node.decorators;if(a){e.node.decorators=null,a=t(a);for(var l=a,c=Array.isArray(l),f=0,l=c?l:(0,o.default)(l);;){var d;if(c){if(f>=l.length)break;d=l[f++]}else{if(f=l.next(),f.done)break;d=f.value}var h=d;i.push(p({CLASS_REF:r,DECORATOR:h}))}}for(var m=(0,s.default)(null),y=e.get("body.body"),v=Array.isArray(y),g=0,y=v?y:(0,o.default)(y);;){var b;if(v){if(g>=y.length)break;b=y[g++]}else{if(g=y.next(),g.done)break;b=g.value}var E=b;if(E.node.decorators){var x=u.toKeyAlias(E.node);m[x]=m[x]||[],m[x].push(E.node),E.remove()}}for(var A in m){m[A]}return i}function i(e){if(e.isClass()){if(e.node.decorators)return!0;for(var t=e.node.body.body,r=Array.isArray(t),n=0,t=r?t:(0,o.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}if(i.decorators)return!0}}else if(e.isObjectExpression())for(var s=e.node.properties,a=Array.isArray(s),u=0,s=a?s:(0,o.default)(s);;){var l;if(a){if(u>=s.length)break;l=s[u++]}else{if(u=s.next(),u.done)break;l=u.value}var c=l;if(c.decorators)return!0}return!1}function a(e){throw e.buildCodeFrameError('Decorators are not officially supported yet in 6.x pending a proposal update.\nHowever, if you need to use them you can install the legacy decorators transform with:\n\nnpm install babel-plugin-transform-decorators-legacy --save-dev\n\nand add the following line to your .babelrc file:\n\n{\n "plugins": ["transform-decorators-legacy"]\n}\n\nThe repo url is: https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy.\n ')}var u=e.types;return{inherits:r(125),visitor:{ClassExpression:function(e){if(i(e)){a(e),(0,f.default)(e);var t=e.scope.generateDeclaredUidIdentifier("ref"),r=[];r.push(u.assignmentExpression("=",t,e.node)),r=r.concat(n(e,t,this)),r.push(t),e.replaceWith(u.sequenceExpression(r))}},ClassDeclaration:function(e){if(i(e)){a(e),(0,f.default)(e);var t=e.node.id,r=[];r=r.concat(n(e,t,this).map(function(e){return u.expressionStatement(e)})),r.push(u.expressionStatement(t)),e.insertAfter(r)}},ObjectExpression:function(e){i(e)&&a(e)}}}};var u=r(4),l=n(u),c=r(319),f=n(c),p=(0,l.default)("\n CLASS_REF = DECORATOR(CLASS_REF) || CLASS_REF;\n");e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(){return{inherits:r(198),visitor:{DoExpression:function(e){var t=e.node.body.body;t.length?e.replaceWithMultiple(t):e.replaceWith(e.scope.buildUndefinedNode())}}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var s=r(2),a=i(s),o=r(3),u=i(o),l=r(7),c=r(193),f=i(c),p=r(191),d=i(p),h=r(188),m=n(h),y=r(4),v=i(y),g=r(1),b=n(g),E=(0,v.default)("\n (function () {\n super(...arguments);\n })\n"),x={"FunctionExpression|FunctionDeclaration":function(e){e.is("shadow")||e.skip()},Method:function(e){e.skip()}},A=l.visitors.merge([x,{Super:function(e){if(this.isDerived&&!this.hasBareSuper&&!e.parentPath.isCallExpression({callee:e.node}))throw e.buildCodeFrameError("'super.*' is not allowed before super()")},CallExpression:{exit:function(e){if(e.get("callee").isSuper()&&(this.hasBareSuper=!0,!this.isDerived))throw e.buildCodeFrameError("super() is only allowed in a derived constructor")}},ThisExpression:function(e){if(this.isDerived&&!this.hasBareSuper&&!e.inShadow("this"))throw e.buildCodeFrameError("'this' is not allowed before super()")}}]),S=l.visitors.merge([x,{ThisExpression:function(e){this.superThises.push(e)}}]),_=function(){function e(t,r){(0,u.default)(this,e),this.parent=t.parent,this.scope=t.scope,this.node=t.node,this.path=t,this.file=r,this.clearDescriptors(),this.instancePropBody=[],this.instancePropRefs={},this.staticPropBody=[],this.body=[],this.bareSuperAfter=[],this.bareSupers=[],this.pushedConstructor=!1,this.pushedInherits=!1,this.isLoose=!1,this.superThises=[],this.classId=this.node.id,this.classRef=this.node.id?b.identifier(this.node.id.name):this.scope.generateUidIdentifier("class"),this.superName=this.node.superClass||b.identifier("Function"),this.isDerived=!!this.node.superClass}return e.prototype.run=function(){var e=this,t=this.superName,r=this.file,n=this.body,i=this.constructorBody=b.blockStatement([]);this.constructor=this.buildConstructor();var s=[],a=[];if(this.isDerived&&(a.push(t),t=this.scope.generateUidIdentifierBasedOnNode(t),s.push(t),this.superName=t),this.buildBody(),i.body.unshift(b.expressionStatement(b.callExpression(r.addHelper("classCallCheck"),[b.thisExpression(),this.classRef]))),n=n.concat(this.staticPropBody.map(function(t){return t(e.classRef)})),this.classId&&1===n.length)return b.toExpression(n[0]);n.push(b.returnStatement(this.classRef));var o=b.functionExpression(null,s,b.blockStatement(n));return o.shadow=!0,b.callExpression(o,a)},e.prototype.buildConstructor=function(){var e=b.functionDeclaration(this.classRef,[],this.constructorBody);return b.inherits(e,this.node),e},e.prototype.pushToMap=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"value",n=arguments[3],i=void 0;e.static?(this.hasStaticDescriptors=!0,i=this.staticMutatorMap):(this.hasInstanceDescriptors=!0,i=this.instanceMutatorMap);var s=m.push(i,e,r,this.file,n);return t&&(s.enumerable=b.booleanLiteral(!0)),s},e.prototype.constructorMeMaybe=function(){for(var e=!1,t=this.path.get("body.body"),r=t,n=Array.isArray(r),i=0,r=n?r:(0,a.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}if(e=s.equals("kind","constructor"))break}if(!e){var o=void 0,u=void 0;if(this.isDerived){var l=E().expression;o=l.params,u=l.body}else o=[],u=b.blockStatement([]);this.path.get("body").unshiftContainer("body",b.classMethod("constructor",b.identifier("constructor"),o,u))}},e.prototype.buildBody=function(){if(this.constructorMeMaybe(),this.pushBody(),this.verifyConstructor(),this.userConstructor){var e=this.constructorBody;e.body=e.body.concat(this.userConstructor.body.body),b.inherits(this.constructor,this.userConstructor),b.inherits(e,this.userConstructor.body)}this.pushDescriptors()},e.prototype.pushBody=function(){for(var e=this.path.get("body.body"),t=e,r=Array.isArray(t),n=0,t=r?t:(0,a.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i,o=s.node;if(s.isClassProperty())throw s.buildCodeFrameError("Missing class properties transform.");if(o.decorators)throw s.buildCodeFrameError("Method has decorators, put the decorator plugin before the classes one.");if(b.isClassMethod(o)){var u="constructor"===o.kind;if(u&&(s.traverse(A,this),!this.hasBareSuper&&this.isDerived))throw s.buildCodeFrameError("missing super() call in constructor");var l=new f.default({forceSuperMemoisation:u,methodPath:s,methodNode:o,objectRef:this.classRef,superRef:this.superName,isStatic:o.static,isLoose:this.isLoose,scope:this.scope,file:this.file},!0);l.replace(),u?this.pushConstructor(l,o,s):this.pushMethod(o,s)}}},e.prototype.clearDescriptors=function(){this.hasInstanceDescriptors=!1,this.hasStaticDescriptors=!1,this.instanceMutatorMap={},this.staticMutatorMap={}},e.prototype.pushDescriptors=function(){this.pushInherits();var e=this.body,t=void 0,r=void 0;if(this.hasInstanceDescriptors&&(t=m.toClassObject(this.instanceMutatorMap)),this.hasStaticDescriptors&&(r=m.toClassObject(this.staticMutatorMap)),t||r){t&&(t=m.toComputedObjectFromClass(t)),r&&(r=m.toComputedObjectFromClass(r));var n=b.nullLiteral(),i=[this.classRef,n,n,n,n];t&&(i[1]=t),r&&(i[2]=r),this.instanceInitializersId&&(i[3]=this.instanceInitializersId,e.unshift(this.buildObjectAssignment(this.instanceInitializersId))),this.staticInitializersId&&(i[4]=this.staticInitializersId,e.unshift(this.buildObjectAssignment(this.staticInitializersId)));for(var s=0,a=0;a<i.length;a++)i[a]!==n&&(s=a);i=i.slice(0,s+1),e.push(b.expressionStatement(b.callExpression(this.file.addHelper("createClass"),i)))}this.clearDescriptors()},e.prototype.buildObjectAssignment=function(e){return b.variableDeclaration("var",[b.variableDeclarator(e,b.objectExpression([]))])},e.prototype.wrapSuperCall=function(e,t,r,n){var i=e.node;this.isLoose?(i.arguments.unshift(b.thisExpression()),2===i.arguments.length&&b.isSpreadElement(i.arguments[1])&&b.isIdentifier(i.arguments[1].argument,{name:"arguments"})?(i.arguments[1]=i.arguments[1].argument,i.callee=b.memberExpression(t,b.identifier("apply"))):i.callee=b.memberExpression(t,b.identifier("call"))):i=(0,d.default)(b.logicalExpression("||",b.memberExpression(this.classRef,b.identifier("__proto__")),b.callExpression(b.memberExpression(b.identifier("Object"),b.identifier("getPrototypeOf")),[this.classRef])),b.thisExpression(),i.arguments);var s=b.callExpression(this.file.addHelper("possibleConstructorReturn"),[b.thisExpression(),i]),a=this.bareSuperAfter.map(function(e){return e(r)});e.parentPath.isExpressionStatement()&&e.parentPath.container===n.node.body&&n.node.body.length-1===e.parentPath.key?((this.superThises.length||a.length)&&(e.scope.push({id:r}),s=b.assignmentExpression("=",r,s)),a.length&&(s=b.toSequenceExpression([s].concat(a,[r]))),e.parentPath.replaceWith(b.returnStatement(s))):e.replaceWithMultiple([b.variableDeclaration("var",[b.variableDeclarator(r,s)])].concat(a,[b.expressionStatement(r)]))},e.prototype.verifyConstructor=function(){var e=this;if(this.isDerived){var t=this.userConstructorPath,r=t.get("body");t.traverse(S,this);for(var n=!!this.bareSupers.length,i=this.superName||b.identifier("Function"),s=t.scope.generateUidIdentifier("this"),o=this.bareSupers,u=Array.isArray(o),l=0,o=u?o:(0,a.default)(o);;){var c;if(u){if(l>=o.length)break;c=o[l++]}else{if(l=o.next(),l.done)break;c=l.value}var f=c;this.wrapSuperCall(f,i,s,r),n&&f.find(function(e){return e===t||(e.isLoop()||e.isConditional()?(n=!1,!0):void 0)})}for(var p=this.superThises,d=Array.isArray(p),h=0,p=d?p:(0,a.default)(p);;){var m;if(d){if(h>=p.length)break;m=p[h++]}else{if(h=p.next(),h.done)break;m=h.value}m.replaceWith(s)}var y=function(t){return b.callExpression(e.file.addHelper("possibleConstructorReturn"),[s].concat(t||[]))},v=r.get("body");v.length&&!v.pop().isReturnStatement()&&r.pushContainer("body",b.returnStatement(n?s:y()));for(var g=this.superReturns,E=Array.isArray(g),x=0,g=E?g:(0,a.default)(g);;){var A;if(E){if(x>=g.length)break;A=g[x++]}else{if(x=g.next(),x.done)break;A=x.value}var _=A;if(_.node.argument){var D=_.scope.generateDeclaredUidIdentifier("ret");_.get("argument").replaceWithMultiple([b.assignmentExpression("=",D,_.node.argument),y(D)])}else _.get("argument").replaceWith(y())}}},e.prototype.pushMethod=function(e,t){var r=t?t.scope:this.scope;"method"===e.kind&&this._processMethod(e,r)||this.pushToMap(e,!1,null,r)},e.prototype._processMethod=function(){return!1},e.prototype.pushConstructor=function(e,t,r){this.bareSupers=e.bareSupers,this.superReturns=e.returns,r.scope.hasOwnBinding(this.classRef.name)&&r.scope.rename(this.classRef.name);var n=this.constructor;this.userConstructorPath=r,this.userConstructor=t,this.hasConstructor=!0,b.inheritsComments(n,t),n._ignoreUserWhitespace=!0,n.params=t.params,b.inherits(n.body,t.body),n.body.directives=t.body.directives,this._pushConstructor()},e.prototype._pushConstructor=function(){this.pushedConstructor||(this.pushedConstructor=!0,(this.hasInstanceDescriptors||this.hasStaticDescriptors)&&this.pushDescriptors(),this.body.push(this.constructor),this.pushInherits())},e.prototype.pushInherits=function(){this.isDerived&&!this.pushedInherits&&(this.pushedInherits=!0,this.body.unshift(b.expressionStatement(b.callExpression(this.file.addHelper("inherits"),[this.classRef,this.superName]))))},e}();t.default=_,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(9),s=n(i),a=r(2),o=n(a),u=r(10),l=n(u);t.default=function(e){var t=e.types,r=(0,l.default)(),n={"AssignmentExpression|UpdateExpression":function(e){if(!e.node[r]){e.node[r]=!0;var n=e.get(e.isAssignmentExpression()?"left":"argument");if(n.isIdentifier()){var i=n.node.name;if(this.scope.getBinding(i)===e.scope.getBinding(i)){var s=this.exports[i];if(s){var a=e.node,u=e.isUpdateExpression()&&!a.prefix;u&&("++"===a.operator?a=t.binaryExpression("+",a.argument,t.numericLiteral(1)):"--"===a.operator?a=t.binaryExpression("-",a.argument,t.numericLiteral(1)):u=!1);for(var l=s,c=Array.isArray(l),f=0,l=c?l:(0,o.default)(l);;){var p;if(c){if(f>=l.length)break;p=l[f++]}else{if(f=l.next(),f.done)break;p=f.value}var d=p;a=this.buildCall(d,a).expression}u&&(a=t.sequenceExpression([a,e.node])),e.replaceWith(a)}}}}}};return{visitor:{CallExpression:function(e,r){if(e.node.callee.type===y){var n=r.contextIdent;e.replaceWith(t.callExpression(t.memberExpression(n,t.identifier("import")),e.node.arguments))}},ReferencedIdentifier:function(e,r){"__moduleName"!=e.node.name||e.scope.hasBinding("__moduleName")||e.replaceWith(t.memberExpression(r.contextIdent,t.identifier("id")))},Program:{enter:function(e,t){t.contextIdent=e.scope.generateUidIdentifier("context")},exit:function(e,r){function i(e,t){p[e]=p[e]||[],p[e].push(t)}function a(e,t,r){var n=void 0;d.forEach(function(t){t.key===e&&(n=t)}),n||d.push(n={key:e,imports:[],exports:[]}),n[t]=n[t].concat(r)}function u(e,r){return t.expressionStatement(t.callExpression(l,[t.stringLiteral(e),r]))}for(var l=e.scope.generateUidIdentifier("export"),c=r.contextIdent,p=(0,s.default)(null),d=[],y=[],v=[],g=[],b=[],E=[],x=e.get("body"),A=!0,S=x,_=Array.isArray(S),D=0,S=_?S:(0,o.default)(S);;){var C;if(_){if(D>=S.length)break;C=S[D++]}else{if(D=S.next(),D.done)break;C=D.value}var w=C;if(w.isExportDeclaration()&&(w=w.get("declaration")),w.isVariableDeclaration()&&"var"!==w.node.kind){A=!1;break}}for(var P=x,k=Array.isArray(P),F=0,P=k?P:(0,o.default)(P);;){var T;if(k){if(F>=P.length)break;T=P[F++]}else{if(F=P.next(),F.done)break;T=F.value}var O=T;if(A&&O.isFunctionDeclaration())y.push(O.node),E.push(O);else if(O.isImportDeclaration()){var B=O.node.source.value;a(B,"imports",O.node.specifiers);for(var R in O.getBindingIdentifiers())O.scope.removeBinding(R),b.push(t.identifier(R));O.remove()}else if(O.isExportAllDeclaration())a(O.node.source.value,"exports",O.node),O.remove();else if(O.isExportDefaultDeclaration()){var I=O.get("declaration");if(I.isClassDeclaration()||I.isFunctionDeclaration()){var M=I.node.id,N=[];M?(N.push(I.node),N.push(u("default",M)),i(M.name,"default")):N.push(u("default",t.toExpression(I.node))),!A||I.isClassDeclaration()?O.replaceWithMultiple(N):(y=y.concat(N),E.push(O))}else O.replaceWith(u("default",I.node))}else if(O.isExportNamedDeclaration()){var L=O.get("declaration");if(L.node){O.replaceWith(L);var j=[],U=void 0;if(O.isFunction()){var V=L.node,G=V.id.name;if(A)i(G,G),y.push(V),y.push(u(G,V.id)),E.push(O);else{var W;W={},W[G]=V.id,U=W}}else U=L.getBindingIdentifiers();for(var Y in U)i(Y,Y),j.push(u(Y,t.identifier(Y)));O.insertAfter(j)}else{var q=O.node.specifiers;if(q&&q.length)if(O.node.source)a(O.node.source.value,"exports",q),O.remove();else{for(var K=[],H=q,J=Array.isArray(H),X=0,H=J?H:(0,o.default)(H);;){var z;if(J){if(X>=H.length)break;z=H[X++]}else{if(X=H.next(),X.done)break;z=X.value}var $=z;K.push(u($.exported.name,$.local)),i($.local.name,$.exported.name)}O.replaceWithMultiple(K)}}}}d.forEach(function(r){for(var n=[],i=e.scope.generateUidIdentifier(r.key),s=r.imports,a=Array.isArray(s),u=0,s=a?s:(0,o.default)(s);;){var c;if(a){if(u>=s.length)break;c=s[u++]}else{if(u=s.next(),u.done)break;c=u.value}var f=c;t.isImportNamespaceSpecifier(f)?n.push(t.expressionStatement(t.assignmentExpression("=",f.local,i))):t.isImportDefaultSpecifier(f)&&(f=t.importSpecifier(f.local,t.identifier("default"))),t.isImportSpecifier(f)&&n.push(t.expressionStatement(t.assignmentExpression("=",f.local,t.memberExpression(i,f.imported))))}if(r.exports.length){var p=e.scope.generateUidIdentifier("exportObj");n.push(t.variableDeclaration("var",[t.variableDeclarator(p,t.objectExpression([]))]));for(var d=r.exports,h=Array.isArray(d),y=0,d=h?d:(0,o.default)(d);;){var b;if(h){if(y>=d.length)break;b=d[y++]}else{if(y=d.next(),y.done)break;b=y.value}var E=b;t.isExportAllDeclaration(E)?n.push(m({KEY:e.scope.generateUidIdentifier("key"),EXPORT_OBJ:p,TARGET:i})):t.isExportSpecifier(E)&&n.push(t.expressionStatement(t.assignmentExpression("=",t.memberExpression(p,E.exported),t.memberExpression(i,E.local))))}n.push(t.expressionStatement(t.callExpression(l,[p])))}g.push(t.stringLiteral(r.key)),v.push(t.functionExpression(null,[i],t.blockStatement(n)))});var Q=this.getModuleName();Q&&(Q=t.stringLiteral(Q)),A&&(0,f.default)(e,function(e){return b.push(e)}),b.length&&y.unshift(t.variableDeclaration("var",b.map(function(e){return t.variableDeclarator(e)}))),e.traverse(n,{exports:p,buildCall:u,scope:e.scope});for(var Z=E,ee=Array.isArray(Z),te=0,Z=ee?Z:(0,o.default)(Z);;){var re;if(ee){if(te>=Z.length)break;re=Z[te++]}else{if(te=Z.next(),te.done)break;re=te.value}re.remove()}e.node.body=[h({SYSTEM_REGISTER:t.memberExpression(t.identifier(r.opts.systemGlobal||"System"),t.identifier("register")),BEFORE_BODY:y,MODULE_NAME:Q,SETTERS:v,SOURCES:g,BODY:e.node.body,EXPORT_IDENTIFIER:l,CONTEXT_IDENTIFIER:c})]}}}}};var c=r(190),f=n(c),p=r(4),d=n(p),h=(0,d.default)('\n SYSTEM_REGISTER(MODULE_NAME, [SOURCES], function (EXPORT_IDENTIFIER, CONTEXT_IDENTIFIER) {\n "use strict";\n BEFORE_BODY;\n return {\n setters: [SETTERS],\n execute: function () {\n BODY;\n }\n };\n });\n'),m=(0,d.default)('\n for (var KEY in TARGET) {\n if (KEY !== "default" && KEY !== "__esModule") EXPORT_OBJ[KEY] = TARGET[KEY];\n }\n'),y="Import";e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){function t(e){if(e.isExpressionStatement()){var t=e.get("expression");if(!t.isCallExpression())return!1;if(!t.get("callee").isIdentifier({name:"define"}))return!1;var r=t.get("arguments");return!(3===r.length&&!r.shift().isStringLiteral())&&(2===r.length&&(!!r.shift().isArrayExpression()&&!!r.shift().isFunctionExpression()))}}var i=e.types;return{inherits:r(131),visitor:{Program:{exit:function(e,r){var s=e.get("body").pop();if(t(s)){var l=s.node.expression,c=l.arguments,f=3===c.length?c.shift():null,p=l.arguments[0],d=l.arguments[1],h=r.opts.globals||{},m=p.elements.map(function(e){return"module"===e.value||"exports"===e.value?i.identifier(e.value):i.callExpression(i.identifier("require"),[e])}),y=p.elements.map(function(e){if("module"===e.value)return i.identifier("mod");if("exports"===e.value)return i.memberExpression(i.identifier("mod"),i.identifier("exports"));var t=void 0;if(r.opts.exactGlobals){var s=h[e.value];t=s?s.split(".").reduce(function(e,t){return i.memberExpression(e,i.identifier(t))},i.identifier("global")):i.memberExpression(i.identifier("global"),i.identifier(i.toIdentifier(e.value)))}else{var a=(0,n.basename)(e.value,(0,n.extname)(e.value)),o=h[a]||a;t=i.memberExpression(i.identifier("global"),i.identifier(i.toIdentifier(o)))}return t}),v=f?f.value:this.file.opts.basename,g=i.memberExpression(i.identifier("global"),i.identifier(i.toIdentifier(v))),b=null;if(r.opts.exactGlobals){var E=h[v];if(E){b=[];var x=E.split(".");g=x.slice(1).reduce(function(e,t){return b.push(a({GLOBAL_REFERENCE:e})),i.memberExpression(e,i.identifier(t))},i.memberExpression(i.identifier("global"),i.identifier(x[0])))}}var A=o({BROWSER_ARGUMENTS:y,PREREQUISITE_ASSIGNMENTS:b,GLOBAL_TO_ASSIGN:g});s.replaceWith(u({MODULE_NAME:f,AMD_ARGUMENTS:p,COMMON_ARGUMENTS:m,GLOBAL_EXPORT:A,FUNC:d}))}}}}}};var n=r(19),i=r(4),s=function(e){return e&&e.__esModule?e:{default:e}}(i),a=(0,s.default)("\n GLOBAL_REFERENCE = GLOBAL_REFERENCE || {}\n"),o=(0,s.default)("\n var mod = { exports: {} };\n factory(BROWSER_ARGUMENTS);\n PREREQUISITE_ASSIGNMENTS\n GLOBAL_TO_ASSIGN = mod.exports;\n"),u=(0,s.default)('\n (function (global, factory) {\n if (typeof define === "function" && define.amd) {\n define(MODULE_NAME, AMD_ARGUMENTS, factory);\n } else if (typeof exports !== "undefined") {\n factory(COMMON_ARGUMENTS);\n } else {\n GLOBAL_EXPORT\n }\n })(this, FUNC);\n');e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){function t(e,r,i){var s=e.specifiers[0];if(n.isExportNamespaceSpecifier(s)||n.isExportDefaultSpecifier(s)){var a=e.specifiers.shift(),o=i.generateUidIdentifier(a.exported.name),u=void 0;u=n.isExportNamespaceSpecifier(a)?n.importNamespaceSpecifier(o):n.importDefaultSpecifier(o),r.push(n.importDeclaration([u],e.source)),r.push(n.exportNamedDeclaration(null,[n.exportSpecifier(o,a.exported)])),t(e,r,i)}}var n=e.types;return{inherits:r(200),visitor:{ExportNamedDeclaration:function(e){var r=e.node,n=e.scope,i=[];t(r,i,n),i.length&&(r.specifiers.length>=1&&i.push(r),e.replaceWithMultiple(i))}}}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(2),i=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=function(e){var t=e.types;return{inherits:r(126),visitor:{Program:function(e,t){for(var r=t.file.ast.comments,n=r,s=Array.isArray(n),a=0,n=s?n:(0,i.default)(n);;){var o;if(s){if(a>=n.length)break;o=n[a++]}else{if(a=n.next(),a.done)break;o=a.value}var u=o;u.value.indexOf("@flow")>=0&&(u.value=u.value.replace("@flow",""),u.value.replace(/\*/g,"").trim()||(u.ignore=!0))}},Flow:function(e){e.remove()},ClassProperty:function(e){e.node.variance=null,e.node.typeAnnotation=null,e.node.value||e.remove()},Class:function(e){e.node.implements=null,e.get("body.body").forEach(function(e){e.isClassProperty()&&(e.node.typeAnnotation=null,e.node.value||e.remove())})},AssignmentPattern:function(e){e.node.left.optional=!1},Function:function(e){for(var t=e.node,r=0;r<t.params.length;r++){t.params[r].optional=!1}},TypeCastExpression:function(e){var r=e.node;do{r=r.expression}while(t.isTypeCastExpression(r));e.replaceWith(r)}}}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){function t(e){var t=e.path.getData("functionBind");return t||(t=e.generateDeclaredUidIdentifier("context"),e.path.setData("functionBind",t))}function n(e,t){var r=e.object||e.callee.object;return t.isStatic(r)&&r}function i(e,r){var i=n(e,r);if(i)return i;var a=t(r);return e.object?e.callee=s.sequenceExpression([s.assignmentExpression("=",a,e.object),e.callee]):e.callee.object=s.assignmentExpression("=",a,e.callee.object),a}var s=e.types;return{inherits:r(201),visitor:{CallExpression:function(e){var t=e.node,r=e.scope,n=t.callee;if(s.isBindExpression(n)){var a=i(n,r);t.callee=s.memberExpression(n.callee,s.identifier("call")),t.arguments.unshift(a)}},BindExpression:function(e){ var t=e.node,r=e.scope,n=i(t,r);e.replaceWith(s.callExpression(s.memberExpression(t.callee,s.identifier("bind")),[n]))}}}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(2),i=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=function(e){function t(e){var t=!1;return e.traverse({RestProperty:function(){t=!0,e.stop()}}),t}function n(e){for(var t=e.properties,r=Array.isArray(t),n=0,t=r?t:(0,i.default)(t);;){var s;if(r){if(n>=t.length)break;s=t[n++]}else{if(n=t.next(),n.done)break;s=n.value}var a=s;if(o.isSpreadProperty(a))return!0}return!1}function s(e,t,r){for(var n=t.pop(),s=[],a=t,u=Array.isArray(a),l=0,a=u?a:(0,i.default)(a);;){var c;if(u){if(l>=a.length)break;c=a[l++]}else{if(l=a.next(),l.done)break;c=l.value}var f=c,p=f.key;o.isIdentifier(p)&&!f.computed&&(p=o.stringLiteral(f.key.name)),s.push(p)}return[n.argument,o.callExpression(e.addHelper("objectWithoutProperties"),[r,o.arrayExpression(s)])]}function a(e,r,n,i){if(r.isAssignmentPattern())return void a(e,r.get("left"),n,i);if(r.isObjectPattern()&&t(r)){var s=e.scope.generateUidIdentifier("ref"),u=o.variableDeclaration("let",[o.variableDeclarator(r.node,s)]);u._blockHoist=n?i-n:1,e.ensureBlock(),e.get("body").unshiftContainer("body",u),r.replaceWith(s)}}var o=e.types;return{inherits:r(202),visitor:{Function:function(e){for(var t=e.get("params"),r=0;r<t.length;r++)a(t[r].parentPath,t[r],r,t.length)},VariableDeclarator:function(e,t){if(e.get("id").isObjectPattern()){var r=e;e.get("id").traverse({RestProperty:function(e){if(this.originalPath.node.id.properties.length>1&&!o.isIdentifier(this.originalPath.node.init)){var n=e.scope.generateUidIdentifierBasedOnNode(this.originalPath.node.init,"ref");return this.originalPath.insertBefore(o.variableDeclarator(n,this.originalPath.node.init)),void this.originalPath.replaceWith(o.variableDeclarator(this.originalPath.node.id,n))}var i=this.originalPath.node.init,a=[];e.findParent(function(e){if(e.isObjectProperty())a.unshift(e.node.key.name);else if(e.isVariableDeclarator())return!0}),a.length&&a.forEach(function(e){i=o.memberExpression(i,o.identifier(e))});var u=s(t,e.parentPath.node.properties,i),l=u[0],c=u[1];r.insertAfter(o.variableDeclarator(l,c)),r=r.getSibling(r.key+1),0===e.parentPath.node.properties.length&&e.findParent(function(e){return e.isObjectProperty()||e.isVariableDeclarator()}).remove()}},{originalPath:e})}},ExportNamedDeclaration:function(e){var r=e.get("declaration");if(r.isVariableDeclaration()&&t(r)){var n=[];for(var i in e.getOuterBindingIdentifiers(e)){var s=o.identifier(i);n.push(o.exportSpecifier(s,s))}e.replaceWith(r.node),e.insertAfter(o.exportNamedDeclaration(null,n))}},CatchClause:function(e){var t=e.get("param");a(t.parentPath,t)},AssignmentExpression:function(e,r){var n=e.get("left");if(n.isObjectPattern()&&t(n)){var i=[],a=void 0;(e.isCompletionRecord()||e.parentPath.isExpressionStatement())&&(a=e.scope.generateUidIdentifierBasedOnNode(e.node.right,"ref"),i.push(o.variableDeclaration("var",[o.variableDeclarator(a,e.node.right)])));var u=s(r,e.node.left.properties,a),l=u[0],c=u[1],f=o.clone(e.node);f.right=a,i.push(o.expressionStatement(f)),i.push(o.toStatement(o.assignmentExpression("=",l,c))),a&&i.push(o.expressionStatement(a)),e.replaceWithMultiple(i)}},ForXStatement:function(e){var r=e.node,n=e.scope,i=e.get("left"),s=r.left;if(o.isObjectPattern(s)&&t(i)){var a=n.generateUidIdentifier("ref");return r.left=o.variableDeclaration("var",[o.variableDeclarator(a)]),e.ensureBlock(),void r.body.body.unshift(o.variableDeclaration("var",[o.variableDeclarator(s,a)]))}if(o.isVariableDeclaration(s)){var u=s.declarations[0].id;if(o.isObjectPattern(u)){var l=n.generateUidIdentifier("ref");r.left=o.variableDeclaration(s.kind,[o.variableDeclarator(l,null)]),e.ensureBlock(),r.body.body.unshift(o.variableDeclaration(r.left.kind,[o.variableDeclarator(u,l)]))}}},ObjectExpression:function(e,t){function r(){u.length&&(a.push(o.objectExpression(u)),u=[])}if(n(e.node)){var s=t.opts.useBuiltIns||!1;if("boolean"!=typeof s)throw new Error("transform-object-rest-spread currently only accepts a boolean option for useBuiltIns (defaults to false)");for(var a=[],u=[],l=e.node.properties,c=Array.isArray(l),f=0,l=c?l:(0,i.default)(l);;){var p;if(c){if(f>=l.length)break;p=l[f++]}else{if(f=l.next(),f.done)break;p=f.value}var d=p;o.isSpreadProperty(d)?(r(),a.push(d.argument)):u.push(d)}r(),o.isObjectExpression(a[0])||a.unshift(o.objectExpression([]));var h=s?o.memberExpression(o.identifier("Object"),o.identifier("assign")):t.addHelper("extends");e.replaceWith(o.callExpression(h,a))}}}}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){function t(e,t){for(var r=t.arguments[0].properties,i=!0,s=0;s<r.length;s++){var a=r[s],o=n.toComputedKey(a);if(n.isLiteral(o,{value:"displayName"})){i=!1;break}}i&&r.unshift(n.objectProperty(n.identifier("displayName"),n.stringLiteral(e)))}function r(e){if(!e||!n.isCallExpression(e))return!1;if(!s(e.callee)&&!a(e.callee))return!1;var t=e.arguments;if(1!==t.length)return!1;var r=t[0];return!!n.isObjectExpression(r)}var n=e.types,s=n.buildMatchMemberExpression("React.createClass"),a=function(e){return"createReactClass"===e.name};return{visitor:{ExportDefaultDeclaration:function(e,n){var s=e.node;if(r(s.declaration)){var a=n.file.opts.basename;"index"===a&&(a=i.default.basename(i.default.dirname(n.file.opts.filename))),t(a,s.declaration)}},CallExpression:function(e){var i=e.node;if(r(i)){var s=void 0;e.find(function(e){if(e.isAssignmentExpression())s=e.node.left;else if(e.isObjectProperty())s=e.node.key;else if(e.isVariableDeclarator())s=e.node.id;else if(e.isStatement())return!0;if(s)return!0}),s&&(n.isMemberExpression(s)&&(s=s.property),n.isIdentifier(s)&&t(s.name,i))}}}}};var n=r(19),i=function(e){return e&&e.__esModule?e:{default:e}}(n);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),s=n(i);t.default=function(e){var t=e.types,r=/\*?\s*@jsx\s+([^\s]+)/,n=(0,l.default)({pre:function(e){var r=e.tagName,n=e.args;t.react.isCompatTag(r)?n.push(t.stringLiteral(r)):n.push(e.tagExpr)},post:function(e,t){e.callee=t.get("jsxIdentifier")()}});return n.Program=function(e,n){for(var i=n.file,a=n.opts.pragma||"React.createElement",o=i.ast.comments,u=Array.isArray(o),l=0,o=u?o:(0,s.default)(o);;){var c;if(u){if(l>=o.length)break;c=o[l++]}else{if(l=o.next(),l.done)break;c=l.value}var f=c,p=r.exec(f.value);if(p){if("React.DOM"===(a=p[1]))throw i.buildCodeFrameError(f,"The @jsx React.DOM pragma has been deprecated as of React 0.12");break}}n.set("jsxIdentifier",function(){return a.split(".").map(function(e){return t.identifier(e)}).reduce(function(e,r){return t.memberExpression(e,r)})})},{inherits:o.default,visitor:n}};var a=r(127),o=n(a),u=r(351),l=n(u);e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(2),i=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=function(){return{visitor:{Program:function(e,t){if(!1!==t.opts.strict&&!1!==t.opts.strictMode){for(var r=e.node,n=r.directives,s=Array.isArray(n),o=0,n=s?n:(0,i.default)(n);;){var u;if(s){if(o>=n.length)break;u=n[o++]}else{if(o=n.next(),o.done)break;u=o.value}if("use strict"===u.value.value)return}e.unshiftContainer("directives",a.directive(a.directiveLiteral("use strict")))}}}}};var s=r(1),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=["commonjs","amd","umd","systemjs"],n=!1,i="commonjs",s=!1;if(void 0!==t&&(void 0!==t.loose&&(n=t.loose),void 0!==t.modules&&(i=t.modules),void 0!==t.spec&&(s=t.spec)),"boolean"!=typeof n)throw new Error("Preset es2015 'loose' option must be a boolean.");if("boolean"!=typeof s)throw new Error("Preset es2015 'spec' option must be a boolean.");if(!1!==i&&-1===r.indexOf(i))throw new Error("Preset es2015 'modules' option must be 'false' to indicate no modules\nor a module type which be be one of: 'commonjs' (default), 'amd', 'umd', 'systemjs'");var o={loose:n};return{plugins:[[a.default,{loose:n,spec:s}],u.default,c.default,[p.default,{spec:s}],h.default,[y.default,o],g.default,E.default,A.default,[_.default,o],[C.default,o],P.default,F.default,O.default,[R.default,o],M.default,[L.default,o],U.default,G.default,"commonjs"===i&&[Y.default,o],"systemjs"===i&&[K.default,o],"amd"===i&&[J.default,o],"umd"===i&&[z.default,o],[Q.default,{async:!1,asyncGenerators:!1}]].filter(Boolean)}}t.__esModule=!0;var s=r(83),a=n(s),o=r(76),u=n(o),l=r(75),c=n(l),f=r(68),p=n(f),d=r(69),h=n(d),m=r(71),y=n(m),v=r(78),g=n(v),b=r(80),E=n(b),x=r(130),A=n(x),S=r(72),_=n(S),D=r(74),C=n(D),w=r(82),P=n(w),k=r(85),F=n(k),T=r(66),O=n(T),B=r(81),R=n(B),I=r(79),M=n(I),N=r(73),L=n(N),j=r(70),U=n(j),V=r(84),G=n(V),W=r(77),Y=n(W),q=r(208),K=n(q),H=r(131),J=n(H),X=r(209),z=n(X),$=r(86),Q=n($),Z=i({});t.default=Z,Object.defineProperty(Z,"buildPreset",{configurable:!0,writable:!0,enumerable:!1,value:i}),e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(132),i=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default={plugins:[i.default]},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(128),s=n(i),a=r(129),o=n(a);t.default={plugins:[s.default,o.default]},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(221),s=n(i),a=r(203),o=n(a),u=r(210),l=n(u);t.default={presets:[s.default],plugins:[o.default,l.default]},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(222),s=n(i),a=r(204),o=n(a),u=r(205),l=n(u),c=r(324),f=n(c);t.default={presets:[s.default],plugins:[f.default,o.default,l.default]},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(128),s=n(i),a=r(129),o=n(a),u=r(132),l=n(u),c=r(213),f=n(c),p=r(327),d=n(p);t.default={plugins:[s.default,o.default,l.default,d.default,f.default]},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(3),i=function(e){return e&&e.__esModule?e:{default:e}}(n),s=function e(t,r){(0,i.default)(this,e),this.file=t,this.options=r};t.default=s,e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.Flow=t.Pure=t.Generated=t.User=t.Var=t.BlockScoped=t.Referenced=t.Scope=t.Expression=t.Statement=t.BindingIdentifier=t.ReferencedMemberExpression=t.ReferencedIdentifier=void 0;var n=r(1),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(n);t.ReferencedIdentifier={types:["Identifier","JSXIdentifier"],checkPath:function(e,t){var r=e.node,s=e.parent;if(!i.isIdentifier(r,t)&&!i.isJSXMemberExpression(s,t)){if(!i.isJSXIdentifier(r,t))return!1;if(n.react.isCompatTag(r.name))return!1}return i.isReferenced(r,s)}},t.ReferencedMemberExpression={types:["MemberExpression"],checkPath:function(e){var t=e.node,r=e.parent;return i.isMemberExpression(t)&&i.isReferenced(t,r)}},t.BindingIdentifier={types:["Identifier"],checkPath:function(e){var t=e.node,r=e.parent;return i.isIdentifier(t)&&i.isBinding(t,r)}},t.Statement={types:["Statement"],checkPath:function(e){var t=e.node,r=e.parent;if(i.isStatement(t)){if(i.isVariableDeclaration(t)){if(i.isForXStatement(r,{left:t}))return!1;if(i.isForStatement(r,{init:t}))return!1}return!0}return!1}},t.Expression={types:["Expression"],checkPath:function(e){return e.isIdentifier()?e.isReferencedIdentifier():i.isExpression(e.node)}},t.Scope={types:["Scopable"],checkPath:function(e){return i.isScope(e.node,e.parent)}},t.Referenced={checkPath:function(e){return i.isReferenced(e.node,e.parent)}},t.BlockScoped={checkPath:function(e){return i.isBlockScoped(e.node)}},t.Var={types:["VariableDeclaration"],checkPath:function(e){return i.isVar(e.node)}},t.User={checkPath:function(e){return e.node&&!!e.node.loc}},t.Generated={checkPath:function(e){return!e.isUser()}},t.Pure={checkPath:function(e,t){return e.scope.isPure(e.node,t)}},t.Flow={types:["Flow","ImportDeclaration","ExportDeclaration","ImportSpecifier"],checkPath:function(e){var t=e.node;return!!i.isFlow(t)||(i.isImportDeclaration(t)?"type"===t.importKind||"typeof"===t.importKind:i.isExportDeclaration(t)?"type"===t.exportKind:!!i.isImportSpecifier(t)&&("type"===t.importKind||"typeof"===t.importKind))}}},function(e,t,r){"use strict";t.__esModule=!0;var n=r(3),i=function(e){return e&&e.__esModule?e:{default:e}}(n),s=function(){function e(t){var r=t.existing,n=t.identifier,s=t.scope,a=t.path,o=t.kind;(0,i.default)(this,e),this.identifier=n,this.scope=s,this.path=a,this.kind=o,this.constantViolations=[],this.constant=!0,this.referencePaths=[],this.referenced=!1,this.references=0,this.clearValue(),r&&(this.constantViolations=[].concat(r.path,r.constantViolations,this.constantViolations))}return e.prototype.deoptValue=function(){this.clearValue(),this.hasDeoptedValue=!0},e.prototype.setValue=function(e){this.hasDeoptedValue||(this.hasValue=!0,this.value=e)},e.prototype.clearValue=function(){this.hasDeoptedValue=!1,this.hasValue=!1,this.value=null},e.prototype.reassign=function(e){this.constant=!1,-1===this.constantViolations.indexOf(e)&&this.constantViolations.push(e)},e.prototype.reference=function(e){-1===this.referencePaths.indexOf(e)&&(this.referenced=!0,this.references++,this.referencePaths.push(e))},e.prototype.dereference=function(){this.references--,this.referenced=!!this.references},e}();t.default=s,e.exports=t.default},function(e,t,r){"use strict";function n(e,t,r){for(var n=[].concat(e),i=(0,a.default)(null);n.length;){var s=n.shift();if(s){var o=u.getBindingIdentifiers.keys[s.type];if(u.isIdentifier(s))if(t){var l=i[s.name]=i[s.name]||[];l.push(s)}else i[s.name]=s;else if(u.isExportDeclaration(s))u.isDeclaration(s.declaration)&&n.push(s.declaration);else{if(r){if(u.isFunctionDeclaration(s)){n.push(s.id);continue}if(u.isFunctionExpression(s))continue}if(o)for(var c=0;c<o.length;c++){var f=o[c];s[f]&&(n=n.concat(s[f]))}}}}return i}function i(e,t){return n(e,t,!0)}t.__esModule=!0;var s=r(9),a=function(e){return e&&e.__esModule?e:{default:e}}(s);t.getBindingIdentifiers=n,t.getOuterBindingIdentifiers=i;var o=r(1),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(o);n.keys={DeclareClass:["id"],DeclareFunction:["id"],DeclareModule:["id"],DeclareVariable:["id"],InterfaceDeclaration:["id"],TypeAlias:["id"],OpaqueType:["id"],CatchClause:["param"],LabeledStatement:["label"],UnaryExpression:["argument"],AssignmentExpression:["left"],ImportSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportDefaultSpecifier:["local"],ImportDeclaration:["specifiers"],ExportSpecifier:["exported"],ExportNamespaceSpecifier:["exported"],ExportDefaultSpecifier:["exported"],FunctionDeclaration:["id","params"],FunctionExpression:["id","params"],ClassDeclaration:["id"],ClassExpression:["id"],RestElement:["argument"],UpdateExpression:["argument"],RestProperty:["argument"],ObjectProperty:["value"],AssignmentPattern:["left"],ArrayPattern:["elements"],ObjectPattern:["properties"],VariableDeclaration:["declarations"],VariableDeclarator:["id"]}},function(e,t){"use strict";e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,r){"use strict";var n=r(138),i=r(13)("toStringTag"),s="Arguments"==n(function(){return arguments}()),a=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,r,o;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=a(t=Object(e),i))?r:s?n(t):"Object"==(o=n(t))&&"function"==typeof t.callee?"Arguments":o}},function(e,t,r){"use strict";var n=r(146),i=r(57).getWeak,s=r(21),a=r(16),o=r(136),u=r(55),l=r(137),c=r(28),f=r(58),p=l(5),d=l(6),h=0,m=function(e){return e._l||(e._l=new y)},y=function(){this.a=[]},v=function(e,t){return p(e.a,function(e){return e[0]===t})};y.prototype={get:function(e){var t=v(this,e);if(t)return t[1]},has:function(e){return!!v(this,e)},set:function(e,t){var r=v(this,e);r?r[1]=t:this.a.push([e,t])},delete:function(e){var t=d(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,r,s){var l=e(function(e,n){o(e,l,t,"_i"),e._t=t,e._i=h++,e._l=void 0,void 0!=n&&u(n,r,e[s],e)});return n(l.prototype,{delete:function(e){if(!a(e))return!1;var r=i(e);return!0===r?m(f(this,t)).delete(e):r&&c(r,this._i)&&delete r[this._i]},has:function(e){if(!a(e))return!1;var r=i(e);return!0===r?m(f(this,t)).has(e):r&&c(r,this._i)}}),l},def:function(e,t,r){var n=i(s(t),!0);return!0===n?m(e).set(t,r):n[e._i]=r,e},ufstore:m}},function(e,t,r){"use strict";var n=r(16),i=r(15).document,s=n(i)&&n(i.createElement);e.exports=function(e){return s?i.createElement(e):{}}},function(e,t,r){"use strict";e.exports=!r(22)&&!r(27)(function(){return 7!=Object.defineProperty(r(230)("div"),"a",{get:function(){return 7}}).a})},function(e,t,r){"use strict";var n=r(138);e.exports=Array.isArray||function(e){return"Array"==n(e)}},function(e,t){"use strict";e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,r){"use strict";var n=r(44),i=r(145),s=r(91),a=r(94),o=r(142),u=Object.assign;e.exports=!u||r(27)(function(){var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!=u({},e)[r]||Object.keys(u({},t)).join("")!=n})?function(e,t){for(var r=a(e),u=arguments.length,l=1,c=i.f,f=s.f;u>l;)for(var p,d=o(arguments[l++]),h=c?n(d).concat(c(d)):n(d),m=h.length,y=0;m>y;)f.call(d,p=h[y++])&&(r[p]=d[p]);return r}:u},function(e,t,r){"use strict";var n=r(91),i=r(92),s=r(37),a=r(154),o=r(28),u=r(231),l=Object.getOwnPropertyDescriptor;t.f=r(22)?l:function(e,t){if(e=s(e),t=a(t,!0),u)try{return l(e,t)}catch(e){}if(o(e,t))return i(!n.f.call(e,t),e[t])}},function(e,t,r){"use strict";var n=r(237),i=r(141).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},function(e,t,r){"use strict";var n=r(28),i=r(37),s=r(420)(!1),a=r(150)("IE_PROTO");e.exports=function(e,t){var r,o=i(e),u=0,l=[];for(r in o)r!=a&&n(o,r)&&l.push(r);for(;t.length>u;)n(o,r=t[u++])&&(~s(l,r)||l.push(r));return l}},function(e,t,r){"use strict";var n=r(228),i=r(13)("iterator"),s=r(56);e.exports=r(5).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||s[n(e)]}},function(e,t,r){(function(n){"use strict";function i(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function s(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),r){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var i=0,s=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(i++,"%c"===e&&(s=i))}),e.splice(s,0,n)}}function a(){return"object"===("undefined"==typeof console?"undefined":l(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function o(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}}function u(){var e;try{e=t.storage.debug}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t=e.exports=r(458),t.log=a,t.formatArgs=s,t.save=o,t.load=u,t.useColors=i,t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(u())}).call(t,r(8))},function(e,t){"use strict";!function(){function t(e){return 48<=e&&e<=57}function r(e){return 48<=e&&e<=57||97<=e&&e<=102||65<=e&&e<=70}function n(e){return e>=48&&e<=55}function i(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&d.indexOf(e)>=0}function s(e){return 10===e||13===e||8232===e||8233===e}function a(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(Math.floor((e-65536)/1024)+55296)+String.fromCharCode((e-65536)%1024+56320)}function o(e){return e<128?h[e]:p.NonAsciiIdentifierStart.test(a(e))}function u(e){return e<128?m[e]:p.NonAsciiIdentifierPart.test(a(e))}function l(e){return e<128?h[e]:f.NonAsciiIdentifierStart.test(a(e))}function c(e){return e<128?m[e]:f.NonAsciiIdentifierPart.test(a(e))}var f,p,d,h,m,y;for(p={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,NonAsciiIdentifierPart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/},f={ NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},d=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],h=new Array(128),y=0;y<128;++y)h[y]=y>=97&&y<=122||y>=65&&y<=90||36===y||95===y;for(m=new Array(128),y=0;y<128;++y)m[y]=y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||36===y||95===y;e.exports={isDecimalDigit:t,isHexDigit:r,isOctalDigit:n,isWhiteSpace:i,isLineTerminator:s,isIdentifierStartES5:o,isIdentifierPartES5:u,isIdentifierStartES6:l,isIdentifierPartES6:c}}()},function(e,t,r){"use strict";var n=r(38),i=r(17),s=n(i,"Set");e.exports=s},function(e,t,r){"use strict";function n(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new i;++t<r;)this.add(e[t])}var i=r(160),s=r(561),a=r(562);n.prototype.add=n.prototype.push=s,n.prototype.has=a,e.exports=n},function(e,t,r){"use strict";var n=r(17),i=n.Uint8Array;e.exports=i},function(e,t){"use strict";function r(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}e.exports=r},function(e,t,r){"use strict";function n(e,t){var r=a(e),n=!r&&s(e),c=!r&&!n&&o(e),p=!r&&!n&&!c&&l(e),d=r||n||c||p,h=d?i(e.length,String):[],m=h.length;for(var y in e)!t&&!f.call(e,y)||d&&("length"==y||c&&("offset"==y||"parent"==y)||p&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||u(y,m))||h.push(y);return h}var i=r(513),s=r(112),a=r(6),o=r(113),u=r(171),l=r(177),c=Object.prototype,f=c.hasOwnProperty;e.exports=n},function(e,t){"use strict";function r(e,t,r,n){var i=-1,s=null==e?0:e.length;for(n&&s&&(r=e[++i]);++i<s;)r=t(r,e[i],i,e);return r}e.exports=r},function(e,t,r){"use strict";function n(e,t,r){(void 0===r||s(e[t],r))&&(void 0!==r||t in e)||i(e,t,r)}var i=r(163),s=r(46);e.exports=n},function(e,t,r){"use strict";var n=r(527),i=n();e.exports=i},function(e,t,r){"use strict";function n(e,t){t=i(t,e);for(var r=0,n=t.length;null!=e&&r<n;)e=e[s(t[r++])];return r&&r==n?e:void 0}var i=r(255),s=r(108);e.exports=n},function(e,t,r){"use strict";function n(e,t,r){var n=t(e);return s(e)?n:i(n,r(e))}var i=r(161),s=r(6);e.exports=n},function(e,t,r){"use strict";function n(e,t,r,a,o){return e===t||(null==e||null==t||!s(e)&&!s(t)?e!==e&&t!==t:i(e,t,r,a,n,o))}var i=r(494),s=r(25);e.exports=n},function(e,t,r){"use strict";function n(e,t){var r=-1,n=s(e)?Array(e.length):[];return i(e,function(e,i,s){n[++r]=t(e,i,s)}),n}var i=r(487),s=r(24);e.exports=n},function(e,t,r){"use strict";function n(e){if("string"==typeof e)return e;if(a(e))return s(e,n)+"";if(o(e))return c?c.call(e):"";var t=e+"";return"0"==t&&1/e==-u?"-0":t}var i=r(45),s=r(60),a=r(6),o=r(62),u=1/0,l=i?i.prototype:void 0,c=l?l.toString:void 0;e.exports=n},function(e,t){"use strict";function r(e,t){return e.has(t)}e.exports=r},function(e,t,r){"use strict";function n(e,t){return i(e)?e:s(e,t)?[e]:a(o(e))}var i=r(6),s=r(173),a=r(571),o=r(114);e.exports=n},function(e,t,r){(function(e){"use strict";function n(e,t){if(t)return e.slice();var r=e.length,n=c?c(r):new e.constructor(r);return e.copy(n),n}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=r(17),a="object"==i(t)&&t&&!t.nodeType&&t,o=a&&"object"==i(e)&&e&&!e.nodeType&&e,u=o&&o.exports===a,l=u?s.Buffer:void 0,c=l?l.allocUnsafe:void 0;e.exports=n}).call(t,r(39)(e))},function(e,t,r){"use strict";function n(e,t){var r=t?i(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var i=r(167);e.exports=n},function(e,t,r){"use strict";function n(e){return function(t,r,n){var o=Object(t);if(!s(t)){var u=i(r,3);t=a(t),r=function(e){return u(o[e],e,o)}}var l=e(t,r,n);return l>-1?o[u?t[l]:l]:void 0}}var i=r(61),s=r(24),a=r(32);e.exports=n},function(e,t,r){"use strict";var n=r(38),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},function(e,t,r){"use strict";function n(e,t,r,n,l,c){var f=r&o,p=e.length,d=t.length;if(p!=d&&!(f&&d>p))return!1;var h=c.get(e);if(h&&c.get(t))return h==t;var m=-1,y=!0,v=r&u?new i:void 0;for(c.set(e,t),c.set(t,e);++m<p;){var g=e[m],b=t[m];if(n)var E=f?n(b,g,m,t,e,c):n(g,b,m,e,t,c);if(void 0!==E){if(E)continue;y=!1;break}if(v){if(!s(t,function(e,t){if(!a(v,t)&&(g===e||l(g,e,r,n,c)))return v.push(t)})){y=!1;break}}else if(g!==b&&!l(g,b,r,n,c)){y=!1;break}}return c.delete(e),c.delete(t),y}var i=r(242),s=r(482),a=r(254),o=1,u=2;e.exports=n},function(e,t){(function(t){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n="object"==(void 0===t?"undefined":r(t))&&t&&t.Object===Object&&t;e.exports=n}).call(t,function(){return this}())},function(e,t,r){"use strict";function n(e){return i(e,a,s)}var i=r(250),s=r(170),a=r(32);e.exports=n},function(e,t,r){"use strict";var n=r(161),i=r(169),s=r(170),a=r(279),o=Object.getOwnPropertySymbols,u=o?function(e){for(var t=[];e;)n(t,s(e)),e=i(e);return t}:a;e.exports=u},function(e,t,r){"use strict";var n=r(472),i=r(159),s=r(474),a=r(241),o=r(475),u=r(30),l=r(272),c=l(n),f=l(i),p=l(s),d=l(a),h=l(o),m=u;(n&&"[object DataView]"!=m(new n(new ArrayBuffer(1)))||i&&"[object Map]"!=m(new i)||s&&"[object Promise]"!=m(s.resolve())||a&&"[object Set]"!=m(new a)||o&&"[object WeakMap]"!=m(new o))&&(m=function(e){var t=u(e),r="[object Object]"==t?e.constructor:void 0,n=r?l(r):"";if(n)switch(n){case c:return"[object DataView]";case f:return"[object Map]";case p:return"[object Promise]";case d:return"[object Set]";case h:return"[object WeakMap]"}return t}),e.exports=m},function(e,t,r){"use strict";function n(e,t,r){t=i(t,e);for(var n=-1,c=t.length,f=!1;++n<c;){var p=l(t[n]);if(!(f=null!=e&&r(e,p)))break;e=e[p]}return f||++n!=c?f:!!(c=null==e?0:e.length)&&u(c)&&o(p,c)&&(a(e)||s(e))}var i=r(255),s=r(112),a=r(6),o=r(171),u=r(176),l=r(108);e.exports=n},function(e,t,r){"use strict";function n(e){return"function"!=typeof e.constructor||a(e)?{}:i(s(e))}var i=r(486),s=r(169),a=r(105);e.exports=n},function(e,t,r){"use strict";function n(e){return e===e&&!i(e)}var i=r(18);e.exports=n},function(e,t){"use strict";function r(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}e.exports=r},function(e,t){"use strict";function r(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}e.exports=r},function(e,t,r){(function(e){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(261),s="object"==n(t)&&t&&!t.nodeType&&t,a=s&&"object"==n(e)&&e&&!e.nodeType&&e,o=a&&a.exports===s,u=o&&i.process,l=function(){try{return u&&u.binding&&u.binding("util")}catch(e){}}();e.exports=l}).call(t,r(39)(e))},function(e,t){"use strict";function r(e,t){return function(r){return e(t(r))}}e.exports=r},function(e,t){"use strict";function r(e){if(null!=e){try{return i.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var n=Function.prototype,i=n.toString;e.exports=r},function(e,t,r){"use strict";var n=r(244),i=r(573),s=r(101),a=r(529),o=s(function(e){return e.push(void 0,a),n(i,void 0,e)});e.exports=o},function(e,t,r){"use strict";function n(e,t){return null!=e&&s(e,t,i)}var i=r(490),s=r(265);e.exports=n},function(e,t,r){"use strict";function n(e){if(!a(e)||i(e)!=o)return!1;var t=s(e);if(null===t)return!0;var r=f.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==p}var i=r(30),s=r(169),a=r(25),o="[object Object]",u=Function.prototype,l=Object.prototype,c=u.toString,f=l.hasOwnProperty,p=c.call(Object);e.exports=n},function(e,t,r){"use strict";var n=r(498),i=r(102),s=r(270),a=s&&s.isRegExp,o=a?i(a):n;e.exports=o},function(e,t,r){"use strict";var n=r(101),i=r(593),s=n(i);e.exports=s},function(e,t,r){"use strict";function n(e,t,r){return t=(r?s(e,t,r):void 0===t)?1:a(t),i(o(e),t)}var i=r(510),s=r(172),a=r(48),o=r(114);e.exports=n},function(e,t){"use strict";function r(){return[]}e.exports=r},function(e,t,r){"use strict";function n(e){return null==e?[]:i(e,s(e))}var i=r(515),s=r(32);e.exports=n},function(e,t){"use strict";function r(e,t,r){if(c)try{c.call(l,e,t,{value:r})}catch(n){e[t]=r}else e[t]=r}function n(e){return e&&(r(e,"call",e.call),r(e,"apply",e.apply)),e}function i(e){return f?f.call(l,e):(m.prototype=e||null,new m)}function s(){do{var e=a(h.call(d.call(y(),36),2))}while(p.call(v,e));return v[e]=e}function a(e){var t={};return t[e]=!0,Object.keys(t)[0]}function o(e){return i(null)}function u(e){function t(t){function n(r,n){if(r===u)return n?i=null:i||(i=e(t))}var i;r(t,a,n)}function n(e){return p.call(e,a)||t(e),e[a](u)}var a=s(),u=i(null);return e=e||o,n.forget=function(e){p.call(e,a)&&e[a](u,!0)},n}var l=Object,c=Object.defineProperty,f=Object.create;n(c),n(f);var p=n(Object.prototype.hasOwnProperty),d=n(Number.prototype.toString),h=n(String.prototype.slice),m=function(){},y=Math.random,v=i(null);t.makeUniqueKey=s;var g=Object.getOwnPropertyNames;Object.getOwnPropertyNames=function(e){for(var t=g(e),r=0,n=0,i=t.length;r<i;++r)p.call(v,t[r])||(r>n&&(t[n]=t[r]),++n);return t.length=n,t},t.makeAccessor=u},function(e,t,r){var n;(function(e,i){"use strict";var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(a){var o="object"==s(t)&&t,u="object"==s(e)&&e&&e.exports==o&&e,l="object"==(void 0===i?"undefined":s(i))&&i;l.global!==l&&l.window!==l||(a=l);var c={rangeOrder:"A range’s `stop` value must be greater than or equal to the `start` value.",codePointRange:"Invalid code point value. Code points range from U+000000 to U+10FFFF."},f=/\\x00([^0123456789]|$)/g,p={},d=p.hasOwnProperty,h=function(e,t){for(var r=-1,n=e.length;++r<n;)t(e[r],r)},m=p.toString,y=function(e){return"[object Array]"==m.call(e)},v=function(e){return"number"==typeof e||"[object Number]"==m.call(e)},g=function(e,t){var r=String(e);return r.length<t?("0000"+r).slice(-t):r},b=function(e){return Number(e).toString(16).toUpperCase()},E=[].slice,x=function(e){for(var t,r=-1,n=e.length,i=n-1,s=[],a=!0,o=0;++r<n;)if(t=e[r],a)s.push(t),o=t,a=!1;else if(t==o+1){if(r!=i){o=t;continue}a=!0,s.push(t+1)}else s.push(o+1,t),o=t;return a||s.push(t+1),s},A=function(e,t){for(var r,n,i=0,s=e.length;i<s;){if(r=e[i],n=e[i+1],t>=r&&t<n)return t==r?n==r+1?(e.splice(i,2),e):(e[i]=t+1,e):t==n-1?(e[i+1]=t,e):(e.splice(i,2,r,t,t+1,n),e);i+=2}return e},S=function(e,t,r){if(r<t)throw Error(c.rangeOrder);for(var n,i,s=0;s<e.length;){if(n=e[s],i=e[s+1]-1,n>r)return e;if(t<=n&&r>=i)e.splice(s,2);else{if(t>=n&&r<i)return t==n?(e[s]=r+1,e[s+1]=i+1,e):(e.splice(s,2,n,t,r+1,i+1),e);if(t>=n&&t<=i)e[s+1]=t;else if(r>=n&&r<=i)return e[s]=r+1,e;s+=2}}return e},_=function(e,t){var r,n,i=0,s=null,a=e.length;if(t<0||t>1114111)throw RangeError(c.codePointRange);for(;i<a;){if(r=e[i],n=e[i+1],t>=r&&t<n)return e;if(t==r-1)return e[i]=t,e;if(r>t)return e.splice(null!=s?s+2:0,0,t,t+1),e;if(t==n)return t+1==e[i+2]?(e.splice(i,4,r,e[i+3]),e):(e[i+1]=t+1,e);s=i,i+=2}return e.push(t,t+1),e},D=function(e,t){for(var r,n,i=0,s=e.slice(),a=t.length;i<a;)r=t[i],n=t[i+1]-1,s=r==n?_(s,r):w(s,r,n),i+=2;return s},C=function(e,t){for(var r,n,i=0,s=e.slice(),a=t.length;i<a;)r=t[i],n=t[i+1]-1,s=r==n?A(s,r):S(s,r,n),i+=2;return s},w=function(e,t,r){if(r<t)throw Error(c.rangeOrder);if(t<0||t>1114111||r<0||r>1114111)throw RangeError(c.codePointRange);for(var n,i,s=0,a=!1,o=e.length;s<o;){if(n=e[s],i=e[s+1],a){if(n==r+1)return e.splice(s-1,2),e;if(n>r)return e;n>=t&&n<=r&&(i>t&&i-1<=r?(e.splice(s,2),s-=2):(e.splice(s-1,2),s-=2))}else{if(n==r+1)return e[s]=t,e;if(n>r)return e.splice(s,0,t,r+1),e;if(t>=n&&t<i&&r+1<=i)return e;t>=n&&t<i||i==t?(e[s+1]=r+1,a=!0):t<=n&&r+1>=i&&(e[s]=t,e[s+1]=r+1,a=!0)}s+=2}return a||e.push(t,r+1),e},P=function(e,t){var r=0,n=e.length,i=e[r],s=e[n-1];if(n>=2&&(t<i||t>s))return!1;for(;r<n;){if(i=e[r],s=e[r+1],t>=i&&t<s)return!0;r+=2}return!1},k=function(e,t){for(var r,n=0,i=t.length,s=[];n<i;)r=t[n],P(e,r)&&s.push(r),++n;return x(s)},F=function(e){return!e.length},T=function(e){return 2==e.length&&e[0]+1==e[1]},O=function(e){for(var t,r,n=0,i=[],s=e.length;n<s;){for(t=e[n],r=e[n+1];t<r;)i.push(t),++t;n+=2}return i},B=Math.floor,R=function(e){return parseInt(B((e-65536)/1024)+55296,10)},I=function(e){return parseInt((e-65536)%1024+56320,10)},M=String.fromCharCode,N=function(e){return 9==e?"\\t":10==e?"\\n":12==e?"\\f":13==e?"\\r":92==e?"\\\\":36==e||e>=40&&e<=43||45==e||46==e||63==e||e>=91&&e<=94||e>=123&&e<=125?"\\"+M(e):e>=32&&e<=126?M(e):e<=255?"\\x"+g(b(e),2):"\\u"+g(b(e),4)},L=function(e){return e<=65535?N(e):"\\u{"+e.toString(16).toUpperCase()+"}"},j=function(e){var t,r=e.length,n=e.charCodeAt(0);return n>=55296&&n<=56319&&r>1?(t=e.charCodeAt(1),1024*(n-55296)+t-56320+65536):n},U=function(e){var t,r,n="",i=0,s=e.length;if(T(e))return N(e[0]);for(;i<s;)t=e[i],r=e[i+1]-1,n+=t==r?N(t):t+1==r?N(t)+N(r):N(t)+"-"+N(r),i+=2;return"["+n+"]"},V=function(e){var t,r,n="",i=0,s=e.length;if(T(e))return L(e[0]);for(;i<s;)t=e[i],r=e[i+1]-1,n+=t==r?L(t):t+1==r?L(t)+L(r):L(t)+"-"+L(r),i+=2;return"["+n+"]"},G=function(e){for(var t,r,n=[],i=[],s=[],a=[],o=0,u=e.length;o<u;)t=e[o],r=e[o+1]-1,t<55296?(r<55296&&s.push(t,r+1),r>=55296&&r<=56319&&(s.push(t,55296),n.push(55296,r+1)),r>=56320&&r<=57343&&(s.push(t,55296),n.push(55296,56320),i.push(56320,r+1)),r>57343&&(s.push(t,55296),n.push(55296,56320),i.push(56320,57344),r<=65535?s.push(57344,r+1):(s.push(57344,65536),a.push(65536,r+1)))):t>=55296&&t<=56319?(r>=55296&&r<=56319&&n.push(t,r+1),r>=56320&&r<=57343&&(n.push(t,56320),i.push(56320,r+1)),r>57343&&(n.push(t,56320),i.push(56320,57344),r<=65535?s.push(57344,r+1):(s.push(57344,65536),a.push(65536,r+1)))):t>=56320&&t<=57343?(r>=56320&&r<=57343&&i.push(t,r+1),r>57343&&(i.push(t,57344),r<=65535?s.push(57344,r+1):(s.push(57344,65536),a.push(65536,r+1)))):t>57343&&t<=65535?r<=65535?s.push(t,r+1):(s.push(t,65536),a.push(65536,r+1)):a.push(t,r+1),o+=2;return{loneHighSurrogates:n,loneLowSurrogates:i,bmp:s,astral:a}},W=function(e){for(var t,r,n,i,s,a,o=[],u=[],l=!1,c=-1,f=e.length;++c<f;)if(t=e[c],r=e[c+1]){for(n=t[0],i=t[1],s=r[0],a=r[1],u=i;s&&n[0]==s[0]&&n[1]==s[1];)u=T(a)?_(u,a[0]):w(u,a[0],a[1]-1),++c,t=e[c],n=t[0],i=t[1],r=e[c+1],s=r&&r[0],a=r&&r[1],l=!0;o.push([n,l?u:i]),l=!1}else o.push(t);return Y(o)},Y=function(e){if(1==e.length)return e;for(var t=-1,r=-1;++t<e.length;){var n=e[t],i=n[1],s=i[0],a=i[1];for(r=t;++r<e.length;){var o=e[r],u=o[1],l=u[0],c=u[1];s==l&&a==c&&(T(o[0])?n[0]=_(n[0],o[0][0]):n[0]=w(n[0],o[0][0],o[0][1]-1),e.splice(r,1),--r)}}return e},q=function(e){if(!e.length)return[];for(var t,r,n,i,s,a,o=0,u=[],l=e.length;o<l;){t=e[o],r=e[o+1]-1,n=R(t),i=I(t),s=R(r),a=I(r);var c=56320==i,f=57343==a,p=!1;n==s||c&&f?(u.push([[n,s+1],[i,a+1]]),p=!0):u.push([[n,n+1],[i,57344]]),!p&&n+1<s&&(f?(u.push([[n+1,s+1],[56320,a+1]]),p=!0):u.push([[n+1,s],[56320,57344]])),p||u.push([[s,s+1],[56320,a+1]]),o+=2}return W(u)},K=function(e){var t=[];return h(e,function(e){var r=e[0],n=e[1];t.push(U(r)+U(n))}),t.join("|")},H=function(e,t,r){if(r)return V(e);var n=[],i=G(e),s=i.loneHighSurrogates,a=i.loneLowSurrogates,o=i.bmp,u=i.astral,l=!F(s),c=!F(a),f=q(u);return t&&(o=D(o,s),l=!1,o=D(o,a),c=!1),F(o)||n.push(U(o)),f.length&&n.push(K(f)),l&&n.push(U(s)+"(?![\\uDC00-\\uDFFF])"),c&&n.push("(?:[^\\uD800-\\uDBFF]|^)"+U(a)),n.join("|")},J=function e(t){return arguments.length>1&&(t=E.call(arguments)),this instanceof e?(this.data=[],t?this.add(t):this):(new e).add(t)};J.version="1.3.2";var X=J.prototype;!function(e,t){var r;for(r in t)d.call(t,r)&&(e[r]=t[r])}(X,{add:function(e){var t=this;return null==e?t:e instanceof J?(t.data=D(t.data,e.data),t):(arguments.length>1&&(e=E.call(arguments)),y(e)?(h(e,function(e){t.add(e)}),t):(t.data=_(t.data,v(e)?e:j(e)),t))},remove:function(e){var t=this;return null==e?t:e instanceof J?(t.data=C(t.data,e.data),t):(arguments.length>1&&(e=E.call(arguments)),y(e)?(h(e,function(e){t.remove(e)}),t):(t.data=A(t.data,v(e)?e:j(e)),t))},addRange:function(e,t){var r=this;return r.data=w(r.data,v(e)?e:j(e),v(t)?t:j(t)),r},removeRange:function(e,t){var r=this,n=v(e)?e:j(e),i=v(t)?t:j(t);return r.data=S(r.data,n,i),r},intersection:function(e){var t=this,r=e instanceof J?O(e.data):e;return t.data=k(t.data,r),t},contains:function(e){return P(this.data,v(e)?e:j(e))},clone:function(){var e=new J;return e.data=this.data.slice(0),e},toString:function(e){var t=H(this.data,!!e&&e.bmpOnly,!!e&&e.hasUnicodeFlag);return t?t.replace(f,"\\0$1"):"[]"},toRegExp:function(e){var t=this.toString(e&&-1!=e.indexOf("u")?{hasUnicodeFlag:!0}:null);return RegExp(t,e||"")},valueOf:function(){return O(this.data)}}),X.toArray=X.valueOf,"object"==s(r(49))&&r(49)?void 0!==(n=function(){return J}.call(t,r,t,e))&&(e.exports=n):o&&!o.nodeType?u?u.exports=J:o.regenerate=J:a.regenerate=J}(void 0)}).call(t,r(39)(e),function(){return this}())},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e){p.default.ok(this instanceof s),h.assertIdentifier(e),this.nextTempId=0,this.contextId=e,this.listing=[],this.marked=[!0],this.finalLoc=a(),this.tryEntries=[],this.leapManager=new y.LeapManager(this)}function a(){return h.numericLiteral(-1)}function o(e){return new Error("all declarations should have been transformed into assignments before the Exploder began its work: "+(0,c.default)(e))}function u(e){var t=e.type ;return"normal"===t?!x.call(e,"target"):"break"===t||"continue"===t?!x.call(e,"value")&&h.isLiteral(e.target):("return"===t||"throw"===t)&&(x.call(e,"value")&&!x.call(e,"target"))}var l=r(35),c=i(l),f=r(64),p=i(f),d=r(1),h=n(d),m=r(607),y=n(m),v=r(608),g=n(v),b=r(116),E=n(b),x=Object.prototype.hasOwnProperty,A=s.prototype;t.Emitter=s,A.mark=function(e){h.assertLiteral(e);var t=this.listing.length;return-1===e.value?e.value=t:p.default.strictEqual(e.value,t),this.marked[t]=!0,e},A.emit=function(e){h.isExpression(e)&&(e=h.expressionStatement(e)),h.assertStatement(e),this.listing.push(e)},A.emitAssign=function(e,t){return this.emit(this.assign(e,t)),e},A.assign=function(e,t){return h.expressionStatement(h.assignmentExpression("=",e,t))},A.contextProperty=function(e,t){return h.memberExpression(this.contextId,t?h.stringLiteral(e):h.identifier(e),!!t)},A.stop=function(e){e&&this.setReturnValue(e),this.jump(this.finalLoc)},A.setReturnValue=function(e){h.assertExpression(e.value),this.emitAssign(this.contextProperty("rval"),this.explodeExpression(e))},A.clearPendingException=function(e,t){h.assertLiteral(e);var r=h.callExpression(this.contextProperty("catch",!0),[e]);t?this.emitAssign(t,r):this.emit(r)},A.jump=function(e){this.emitAssign(this.contextProperty("next"),e),this.emit(h.breakStatement())},A.jumpIf=function(e,t){h.assertExpression(e),h.assertLiteral(t),this.emit(h.ifStatement(e,h.blockStatement([this.assign(this.contextProperty("next"),t),h.breakStatement()])))},A.jumpIfNot=function(e,t){h.assertExpression(e),h.assertLiteral(t);var r=void 0;r=h.isUnaryExpression(e)&&"!"===e.operator?e.argument:h.unaryExpression("!",e),this.emit(h.ifStatement(r,h.blockStatement([this.assign(this.contextProperty("next"),t),h.breakStatement()])))},A.makeTempVar=function(){return this.contextProperty("t"+this.nextTempId++)},A.getContextFunction=function(e){return h.functionExpression(e||null,[this.contextId],h.blockStatement([this.getDispatchLoop()]),!1,!1)},A.getDispatchLoop=function(){var e=this,t=[],r=void 0,n=!1;return e.listing.forEach(function(i,s){e.marked.hasOwnProperty(s)&&(t.push(h.switchCase(h.numericLiteral(s),r=[])),n=!1),n||(r.push(i),h.isCompletionStatement(i)&&(n=!0))}),this.finalLoc.value=this.listing.length,t.push(h.switchCase(this.finalLoc,[]),h.switchCase(h.stringLiteral("end"),[h.returnStatement(h.callExpression(this.contextProperty("stop"),[]))])),h.whileStatement(h.numericLiteral(1),h.switchStatement(h.assignmentExpression("=",this.contextProperty("prev"),this.contextProperty("next")),t))},A.getTryLocsList=function(){if(0===this.tryEntries.length)return null;var e=0;return h.arrayExpression(this.tryEntries.map(function(t){var r=t.firstLoc.value;p.default.ok(r>=e,"try entries out of order"),e=r;var n=t.catchEntry,i=t.finallyEntry,s=[t.firstLoc,n?n.firstLoc:null];return i&&(s[2]=i.firstLoc,s[3]=i.afterLoc),h.arrayExpression(s)}))},A.explode=function(e,t){var r=e.node,n=this;if(h.assertNode(r),h.isDeclaration(r))throw o(r);if(h.isStatement(r))return n.explodeStatement(e);if(h.isExpression(r))return n.explodeExpression(e,t);switch(r.type){case"Program":return e.get("body").map(n.explodeStatement,n);case"VariableDeclarator":throw o(r);case"Property":case"SwitchCase":case"CatchClause":throw new Error(r.type+" nodes should be handled by their parents");default:throw new Error("unknown Node of type "+(0,c.default)(r.type))}},A.explodeStatement=function(e,t){var r=e.node,n=this,i=void 0,s=void 0,o=void 0;if(h.assertStatement(r),t?h.assertIdentifier(t):t=null,h.isBlockStatement(r))return void e.get("body").forEach(function(e){n.explodeStatement(e)});if(!g.containsLeap(r))return void n.emit(r);switch(r.type){case"ExpressionStatement":n.explodeExpression(e.get("expression"),!0);break;case"LabeledStatement":s=a(),n.leapManager.withEntry(new y.LabeledEntry(s,r.label),function(){n.explodeStatement(e.get("body"),r.label)}),n.mark(s);break;case"WhileStatement":i=a(),s=a(),n.mark(i),n.jumpIfNot(n.explodeExpression(e.get("test")),s),n.leapManager.withEntry(new y.LoopEntry(s,i,t),function(){n.explodeStatement(e.get("body"))}),n.jump(i),n.mark(s);break;case"DoWhileStatement":var u=a(),l=a();s=a(),n.mark(u),n.leapManager.withEntry(new y.LoopEntry(s,l,t),function(){n.explode(e.get("body"))}),n.mark(l),n.jumpIf(n.explodeExpression(e.get("test")),u),n.mark(s);break;case"ForStatement":o=a();var f=a();s=a(),r.init&&n.explode(e.get("init"),!0),n.mark(o),r.test&&n.jumpIfNot(n.explodeExpression(e.get("test")),s),n.leapManager.withEntry(new y.LoopEntry(s,f,t),function(){n.explodeStatement(e.get("body"))}),n.mark(f),r.update&&n.explode(e.get("update"),!0),n.jump(o),n.mark(s);break;case"TypeCastExpression":return n.explodeExpression(e.get("expression"));case"ForInStatement":o=a(),s=a();var d=n.makeTempVar();n.emitAssign(d,h.callExpression(E.runtimeProperty("keys"),[n.explodeExpression(e.get("right"))])),n.mark(o);var m=n.makeTempVar();n.jumpIf(h.memberExpression(h.assignmentExpression("=",m,h.callExpression(d,[])),h.identifier("done"),!1),s),n.emitAssign(r.left,h.memberExpression(m,h.identifier("value"),!1)),n.leapManager.withEntry(new y.LoopEntry(s,o,t),function(){n.explodeStatement(e.get("body"))}),n.jump(o),n.mark(s);break;case"BreakStatement":n.emitAbruptCompletion({type:"break",target:n.leapManager.getBreakLoc(r.label)});break;case"ContinueStatement":n.emitAbruptCompletion({type:"continue",target:n.leapManager.getContinueLoc(r.label)});break;case"SwitchStatement":var v=n.emitAssign(n.makeTempVar(),n.explodeExpression(e.get("discriminant")));s=a();for(var b=a(),x=b,A=[],_=r.cases||[],D=_.length-1;D>=0;--D){var C=_[D];h.assertSwitchCase(C),C.test?x=h.conditionalExpression(h.binaryExpression("===",v,C.test),A[D]=a(),x):A[D]=b}var w=e.get("discriminant");E.replaceWithOrRemove(w,x),n.jump(n.explodeExpression(w)),n.leapManager.withEntry(new y.SwitchEntry(s),function(){e.get("cases").forEach(function(e){var t=e.key;n.mark(A[t]),e.get("consequent").forEach(function(e){n.explodeStatement(e)})})}),n.mark(s),-1===b.value&&(n.mark(b),p.default.strictEqual(s.value,b.value));break;case"IfStatement":var P=r.alternate&&a();s=a(),n.jumpIfNot(n.explodeExpression(e.get("test")),P||s),n.explodeStatement(e.get("consequent")),P&&(n.jump(s),n.mark(P),n.explodeStatement(e.get("alternate"))),n.mark(s);break;case"ReturnStatement":n.emitAbruptCompletion({type:"return",value:n.explodeExpression(e.get("argument"))});break;case"WithStatement":throw new Error("WithStatement not supported in generator functions.");case"TryStatement":s=a();var k=r.handler,F=k&&a(),T=F&&new y.CatchEntry(F,k.param),O=r.finalizer&&a(),B=O&&new y.FinallyEntry(O,s),R=new y.TryEntry(n.getUnmarkedCurrentLoc(),T,B);n.tryEntries.push(R),n.updateContextPrevLoc(R.firstLoc),n.leapManager.withEntry(R,function(){if(n.explodeStatement(e.get("block")),F){O?n.jump(O):n.jump(s),n.updateContextPrevLoc(n.mark(F));var t=e.get("handler.body"),r=n.makeTempVar();n.clearPendingException(R.firstLoc,r),t.traverse(S,{safeParam:r,catchParamName:k.param.name}),n.leapManager.withEntry(T,function(){n.explodeStatement(t)})}O&&(n.updateContextPrevLoc(n.mark(O)),n.leapManager.withEntry(B,function(){n.explodeStatement(e.get("finalizer"))}),n.emit(h.returnStatement(h.callExpression(n.contextProperty("finish"),[B.firstLoc]))))}),n.mark(s);break;case"ThrowStatement":n.emit(h.throwStatement(n.explodeExpression(e.get("argument"))));break;default:throw new Error("unknown Statement of type "+(0,c.default)(r.type))}};var S={Identifier:function(e,t){e.node.name===t.catchParamName&&E.isReference(e)&&E.replaceWithOrRemove(e,t.safeParam)},Scope:function(e,t){e.scope.hasOwnBinding(t.catchParamName)&&e.skip()}};A.emitAbruptCompletion=function(e){u(e)||p.default.ok(!1,"invalid completion record: "+(0,c.default)(e)),p.default.notStrictEqual(e.type,"normal","normal completions are not abrupt");var t=[h.stringLiteral(e.type)];"break"===e.type||"continue"===e.type?(h.assertLiteral(e.target),t[1]=e.target):"return"!==e.type&&"throw"!==e.type||e.value&&(h.assertExpression(e.value),t[1]=e.value),this.emit(h.returnStatement(h.callExpression(this.contextProperty("abrupt"),t)))},A.getUnmarkedCurrentLoc=function(){return h.numericLiteral(this.listing.length)},A.updateContextPrevLoc=function(e){e?(h.assertLiteral(e),-1===e.value?e.value=this.listing.length:p.default.strictEqual(e.value,this.listing.length)):e=this.getUnmarkedCurrentLoc(),this.emitAssign(this.contextProperty("prev"),e)},A.explodeExpression=function(e,t){function r(e){if(h.assertExpression(e),!t)return e;s.emit(e)}function n(e,t,r){p.default.ok(!r||!e,"Ignoring the result of a child expression but forcing it to be assigned to a temporary variable?");var n=s.explodeExpression(t,r);return r||(e||l&&!h.isLiteral(n))&&(n=s.emitAssign(e||s.makeTempVar(),n)),n}var i=e.node;if(!i)return i;h.assertExpression(i);var s=this,o=void 0,u=void 0;if(!g.containsLeap(i))return r(i);var l=g.containsLeap.onlyChildren(i);switch(i.type){case"MemberExpression":return r(h.memberExpression(s.explodeExpression(e.get("object")),i.computed?n(null,e.get("property")):i.property,i.computed));case"CallExpression":var f=e.get("callee"),d=e.get("arguments"),m=void 0,y=[],v=!1;if(d.forEach(function(e){v=v||g.containsLeap(e.node)}),h.isMemberExpression(f.node))if(v){var b=n(s.makeTempVar(),f.get("object")),E=f.node.computed?n(null,f.get("property")):f.node.property;y.unshift(b),m=h.memberExpression(h.memberExpression(b,E,f.node.computed),h.identifier("call"),!1)}else m=s.explodeExpression(f);else m=n(null,f),h.isMemberExpression(m)&&(m=h.sequenceExpression([h.numericLiteral(0),m]));return d.forEach(function(e){y.push(n(null,e))}),r(h.callExpression(m,y));case"NewExpression":return r(h.newExpression(n(null,e.get("callee")),e.get("arguments").map(function(e){return n(null,e)})));case"ObjectExpression":return r(h.objectExpression(e.get("properties").map(function(e){return e.isObjectProperty()?h.objectProperty(e.node.key,n(null,e.get("value")),e.node.computed):e.node})));case"ArrayExpression":return r(h.arrayExpression(e.get("elements").map(function(e){return n(null,e)})));case"SequenceExpression":var x=i.expressions.length-1;return e.get("expressions").forEach(function(e){e.key===x?o=s.explodeExpression(e,t):s.explodeExpression(e,!0)}),o;case"LogicalExpression":u=a(),t||(o=s.makeTempVar());var A=n(o,e.get("left"));return"&&"===i.operator?s.jumpIfNot(A,u):(p.default.strictEqual(i.operator,"||"),s.jumpIf(A,u)),n(o,e.get("right"),t),s.mark(u),o;case"ConditionalExpression":var S=a();u=a();var _=s.explodeExpression(e.get("test"));return s.jumpIfNot(_,S),t||(o=s.makeTempVar()),n(o,e.get("consequent"),t),s.jump(u),s.mark(S),n(o,e.get("alternate"),t),s.mark(u),o;case"UnaryExpression":return r(h.unaryExpression(i.operator,s.explodeExpression(e.get("argument")),!!i.prefix));case"BinaryExpression":return r(h.binaryExpression(i.operator,n(null,e.get("left")),n(null,e.get("right"))));case"AssignmentExpression":return r(h.assignmentExpression(i.operator,s.explodeExpression(e.get("left")),s.explodeExpression(e.get("right"))));case"UpdateExpression":return r(h.updateExpression(i.operator,s.explodeExpression(e.get("argument")),i.prefix));case"YieldExpression":u=a();var D=i.argument&&s.explodeExpression(e.get("argument"));if(D&&i.delegate){var C=s.makeTempVar();return s.emit(h.returnStatement(h.callExpression(s.contextProperty("delegateYield"),[D,h.stringLiteral(C.property.name),u]))),s.mark(u),C}return s.emitAssign(s.contextProperty("next"),u),s.emit(h.returnStatement(D||null)),s.mark(u),s.contextProperty("sent");default:throw new Error("unknown Expression of type "+(0,c.default)(i.type))}}},function(e,t){"use strict";e.exports=function(e){var t=/^\\\\\?\\/.test(e),r=/[^\x00-\x80]+/.test(e);return t||r?e:e.replace(/\\/g,"/")}},function(e,t,r){"use strict";function n(){this._array=[],this._set=Object.create(null)}var i=r(63),s=Object.prototype.hasOwnProperty;n.fromArray=function(e,t){for(var r=new n,i=0,s=e.length;i<s;i++)r.add(e[i],t);return r},n.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length},n.prototype.add=function(e,t){var r=i.toSetString(e),n=s.call(this._set,r),a=this._array.length;n&&!t||this._array.push(e),n||(this._set[r]=a)},n.prototype.has=function(e){var t=i.toSetString(e);return s.call(this._set,t)},n.prototype.indexOf=function(e){var t=i.toSetString(e);if(s.call(this._set,t))return this._set[t];throw new Error('"'+e+'" is not in the set.')},n.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},n.prototype.toArray=function(){return this._array.slice()},t.ArraySet=n},function(e,t,r){"use strict";function n(e){return e<0?1+(-e<<1):0+(e<<1)}function i(e){var t=1==(1&e),r=e>>1;return t?-r:r}var s=r(616);t.encode=function(e){var t,r="",i=n(e);do{t=31&i,i>>>=5,i>0&&(t|=32),r+=s.encode(t)}while(i>0);return r},t.decode=function(e,t,r){var n,a,o=e.length,u=0,l=0;do{if(t>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(a=s.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));n=!!(32&a),a&=31,u+=a<<l,l+=5}while(n);r.value=i(u),r.rest=t}},function(e,t,r){"use strict";function n(e){e||(e={}),this._file=s.getArg(e,"file",null),this._sourceRoot=s.getArg(e,"sourceRoot",null),this._skipValidation=s.getArg(e,"skipValidation",!1),this._sources=new a,this._names=new a,this._mappings=new o,this._sourcesContents=null}var i=r(286),s=r(63),a=r(285).ArraySet,o=r(618).MappingList;n.prototype._version=3,n.fromSourceMap=function(e){var t=e.sourceRoot,r=new n({file:e.file,sourceRoot:t});return e.eachMapping(function(e){var n={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(n.source=e.source,null!=t&&(n.source=s.relative(t,n.source)),n.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(n.name=e.name)),r.addMapping(n)}),e.sources.forEach(function(t){var n=e.sourceContentFor(t);null!=n&&r.setSourceContent(t,n)}),r},n.prototype.addMapping=function(e){var t=s.getArg(e,"generated"),r=s.getArg(e,"original",null),n=s.getArg(e,"source",null),i=s.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,r,n,i),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=i&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:n,name:i})},n.prototype.setSourceContent=function(e,t){var r=e;null!=this._sourceRoot&&(r=s.relative(this._sourceRoot,r)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[s.toSetString(r)]=t):this._sourcesContents&&(delete this._sourcesContents[s.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},n.prototype.applySourceMap=function(e,t,r){var n=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=e.file}var i=this._sourceRoot;null!=i&&(n=s.relative(i,n));var o=new a,u=new a;this._mappings.unsortedForEach(function(t){if(t.source===n&&null!=t.originalLine){var a=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=a.source&&(t.source=a.source,null!=r&&(t.source=s.join(r,t.source)),null!=i&&(t.source=s.relative(i,t.source)),t.originalLine=a.line,t.originalColumn=a.column,null!=a.name&&(t.name=a.name))}var l=t.source;null==l||o.has(l)||o.add(l);var c=t.name;null==c||u.has(c)||u.add(c)},this),this._sources=o,this._names=u,e.sources.forEach(function(t){var n=e.sourceContentFor(t);null!=n&&(null!=r&&(t=s.join(r,t)),null!=i&&(t=s.relative(i,t)),this.setSourceContent(t,n))},this)},n.prototype._validateMapping=function(e,t,r,n){if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||r||n)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:t,name:n}))},n.prototype._serializeMappings=function(){for(var e,t,r,n,a=0,o=1,u=0,l=0,c=0,f=0,p="",d=this._mappings.toArray(),h=0,m=d.length;h<m;h++){if(t=d[h],e="",t.generatedLine!==o)for(a=0;t.generatedLine!==o;)e+=";",o++;else if(h>0){if(!s.compareByGeneratedPositionsInflated(t,d[h-1]))continue;e+=","}e+=i.encode(t.generatedColumn-a),a=t.generatedColumn,null!=t.source&&(n=this._sources.indexOf(t.source),e+=i.encode(n-f),f=n,e+=i.encode(t.originalLine-1-l),l=t.originalLine-1,e+=i.encode(t.originalColumn-u),u=t.originalColumn,null!=t.name&&(r=this._names.indexOf(t.name),e+=i.encode(r-c),c=r)),p+=e}return p},n.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=s.relative(t,e));var r=s.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)},n.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},n.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=n},function(e,t,r){"use strict";t.SourceMapGenerator=r(287).SourceMapGenerator,t.SourceMapConsumer=r(620).SourceMapConsumer,t.SourceNode=r(621).SourceNode},function(e,t,r){(function(e){"use strict";function t(){var e={modifiers:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},colors:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39]},bgColors:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49]}};return e.colors.grey=e.colors.gray,Object.keys(e).forEach(function(t){var r=e[t];Object.keys(r).forEach(function(t){var n=r[t];e[t]=r[t]={open:"["+n[0]+"m",close:"["+n[1]+"m"}}),Object.defineProperty(e,t,{value:r,enumerable:!1})}),e}Object.defineProperty(e,"exports",{enumerable:!0,get:t})}).call(t,r(39)(e))},function(e,t,r){"use strict";e.exports=r(182)},function(e,t){"use strict";function r(e){return["babel-plugin-"+e,e]}t.__esModule=!0,t.default=r,e.exports=t.default},function(e,t){"use strict";function r(e){var t=["babel-preset-"+e,e],r=e.match(/^(@[^\/]+)\/(.+)$/);if(r){var n=r[1],i=r[2];t.push(n+"/babel-preset-"+i)}return t}t.__esModule=!0,t.default=r,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),s=n(i);t.default=function(e,t){if(e&&t)return(0,o.default)(e,t,function(e,t){if(t&&Array.isArray(e)){for(var r=t.slice(0),n=e,i=Array.isArray(n),a=0,n=i?n:(0,s.default)(n);;){var o;if(i){if(a>=n.length)break;o=n[a++]}else{if(a=n.next(),a.done)break;o=a.value}var u=o;r.indexOf(u)<0&&r.push(u)}return r}})};var a=r(590),o=n(a);e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e,t,r){if(e){if("Program"===e.type)return i.file(e,t||[],r||[]);if("File"===e.type)return e}throw new Error("Not a valid ast?")};var n=r(1),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(n);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function s(e,t){var r=[],n=g.functionExpression(null,[g.identifier("global")],g.blockStatement(r)),i=g.program([g.expressionStatement(g.callExpression(n,[c.get("selfGlobal")]))]);return r.push(g.variableDeclaration("var",[g.variableDeclarator(e,g.assignmentExpression("=",g.memberExpression(g.identifier("global"),e),g.objectExpression([])))])),t(r),i}function a(e,t){var r=[];return r.push(g.variableDeclaration("var",[g.variableDeclarator(e,g.identifier("global"))])),t(r),g.program([b({FACTORY_PARAMETERS:g.identifier("global"),BROWSER_ARGUMENTS:g.assignmentExpression("=",g.memberExpression(g.identifier("root"),e),g.objectExpression([])),COMMON_ARGUMENTS:g.identifier("exports"),AMD_ARGUMENTS:g.arrayExpression([g.stringLiteral("exports")]),FACTORY_BODY:r,UMD_ROOT:g.identifier("this")})])}function o(e,t){var r=[];return r.push(g.variableDeclaration("var",[g.variableDeclarator(e,g.objectExpression([]))])),t(r),r.push(g.expressionStatement(e)),g.program(r)}function u(e,t,r){c.list.forEach(function(n){if(!(r&&r.indexOf(n)<0)){var i=g.identifier(n);e.push(g.expressionStatement(g.assignmentExpression("=",g.memberExpression(t,i),c.get(n))))}})}t.__esModule=!0,t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"global",r=g.identifier("babelHelpers"),n=function(t){return u(t,r,e)},i=void 0,l={global:s,umd:a,var:o}[t];if(!l)throw new Error(h.get("unsupportedOutputType",t));return i=l(r,n),(0,p.default)(i).code};var l=r(194),c=i(l),f=r(186),p=n(f),d=r(20),h=i(d),m=r(4),y=n(m),v=r(1),g=i(v),b=(0,y.default)('\n (function (root, factory) {\n if (typeof define === "function" && define.amd) {\n define(AMD_ARGUMENTS, factory);\n } else if (typeof exports === "object") {\n factory(COMMON_ARGUMENTS);\n } else {\n factory(BROWSER_ARGUMENTS);\n }\n })(UMD_ROOT, function (FACTORY_PARAMETERS) {\n FACTORY_BODY\n });\n');e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(65),s=n(i),a=r(594),o=n(a);t.default=new s.default({name:"internal.blockHoist",visitor:{Block:{exit:function(e){for(var t=e.node,r=!1,n=0;n<t.body.length;n++){var i=t.body[n];if(i&&null!=i._blockHoist){r=!0;break}}r&&(t.body=(0,o.default)(t.body,function(e){var t=e&&e._blockHoist;return null==t&&(t=1),!0===t&&(t=2),-1*t}))}}}}),e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return!!e.is("_forceShadow")||t}function s(e,t){var r=e.inShadow(t);if(i(e,r)){var n=e.node._shadowedFunctionLiteral,s=void 0,a=!1,o=e.find(function(t){if(t.parentPath&&t.parentPath.isClassProperty()&&"value"===t.key)return!0;if(e===t)return!1;if((t.isProgram()||t.isFunction())&&(s=s||t),t.isProgram())return a=!0,!0;if(t.isFunction()&&!t.isArrowFunctionExpression()){if(n){if(t===n||t.node===n.node)return!0}else if(!t.is("shadow"))return!0;return a=!0,!1}return!1});if(n&&o.isProgram()&&!n.isProgram()&&(o=e.findParent(function(e){return e.isProgram()||e.isFunction()})),o!==s&&a){var u=o.getData(t);if(u)return e.replaceWith(u);var l=e.scope.generateUidIdentifier(t);o.setData(t,l);var c=o.findParent(function(e){return e.isClass()}),p=!!(c&&c.node&&c.node.superClass);if("this"===t&&o.isMethod({kind:"constructor"})&&p)o.scope.push({id:l}),o.traverse(d,{id:l});else{var h="this"===t?f.thisExpression():f.identifier(t);n&&(h._shadowedFunctionLiteral=n),o.scope.push({id:l,init:h})}return e.replaceWith(l)}}}t.__esModule=!0;var a=r(10),o=n(a),u=r(65),l=n(u),c=r(1),f=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(c),p=(0,o.default)("super this bound"),d={CallExpression:function(e){if(e.get("callee").isSuper()){var t=e.node;t[p]||(t[p]=!0,e.replaceWith(f.assignmentExpression("=",this.id,t)))}}};t.default=new l.default({name:"internal.shadowFunctions",visitor:{ThisExpression:function(e){s(e,"this")},ReferencedIdentifier:function(e){"arguments"===e.node.name&&s(e,"arguments")}}}),e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(3),s=n(i),a=r(294),o=n(a),u=r(65),l=n(u),c=r(50),f=n(c),p=function(){function e(){(0,s.default)(this,e)}return e.prototype.lint=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.code=!1,t.mode="lint",this.transform(e,t)},e.prototype.pretransform=function(e,t){var r=new f.default(t,this);return r.wrap(e,function(){return r.addCode(e),r.parseCode(e),r})},e.prototype.transform=function(e,t){var r=new f.default(t,this);return r.wrap(e,function(){return r.addCode(e),r.parseCode(e),r.transform()})},e.prototype.analyse=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2];return t.code=!1,r&&(t.plugins=t.plugins||[],t.plugins.push(new l.default({visitor:r}))),this.transform(e,t).metadata},e.prototype.transformFromAst=function(e,t,r){e=(0,o.default)(e);var n=new f.default(r,this);return n.wrap(t,function(){return n.addCode(t),n.addAst(e),n.transform()})},e}();t.default=p,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(3),s=n(i),a=r(42),o=n(a),u=r(41),l=n(u),c=r(119),f=n(c),p=r(50),d=(n(p),function(e){function t(r,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,s.default)(this,t);var a=(0,o.default)(this,e.call(this));return a.plugin=n,a.key=n.key,a.file=r,a.opts=i,a}return(0,l.default)(t,e),t.prototype.addHelper=function(){var e;return(e=this.file).addHelper.apply(e,arguments)},t.prototype.addImport=function(){var e;return(e=this.file).addImport.apply(e,arguments)},t.prototype.getModuleName=function(){var e;return(e=this.file).getModuleName.apply(e,arguments)},t.prototype.buildCodeFrameError=function(){var e;return(e=this.file).buildCodeFrameError.apply(e,arguments)},t}(f.default));t.default=d,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(3),s=n(i),a=r(625),o=n(a),u=/^[ \t]+$/,l=function(){function e(t){(0,s.default)(this,e),this._map=null,this._buf=[],this._last="",this._queue=[],this._position={line:1,column:0},this._sourcePosition={identifierName:null,line:null,column:null,filename:null},this._map=t}return e.prototype.get=function(){this._flush();var e=this._map,t={code:(0,o.default)(this._buf.join("")),map:null,rawMappings:e&&e.getRawMappings()};return e&&Object.defineProperty(t,"map",{configurable:!0,enumerable:!0,get:function(){return this.map=e.get()},set:function(e){Object.defineProperty(this,"map",{value:e,writable:!0})}}),t},e.prototype.append=function(e){this._flush();var t=this._sourcePosition,r=t.line,n=t.column,i=t.filename,s=t.identifierName;this._append(e,r,n,s,i)},e.prototype.queue=function(e){if("\n"===e)for(;this._queue.length>0&&u.test(this._queue[0][0]);)this._queue.shift();var t=this._sourcePosition,r=t.line,n=t.column,i=t.filename,s=t.identifierName;this._queue.unshift([e,r,n,s,i])},e.prototype._flush=function(){for(var e=void 0;e=this._queue.pop();)this._append.apply(this,e)},e.prototype._append=function(e,t,r,n,i){this._map&&"\n"!==e[0]&&this._map.mark(this._position.line,this._position.column,t,r,n,i),this._buf.push(e),this._last=e[e.length-1];for(var s=0;s<e.length;s++)"\n"===e[s]?(this._position.line++,this._position.column=0):this._position.column++},e.prototype.removeTrailingNewline=function(){this._queue.length>0&&"\n"===this._queue[0][0]&&this._queue.shift()},e.prototype.removeLastSemicolon=function(){this._queue.length>0&&";"===this._queue[0][0]&&this._queue.shift()},e.prototype.endsWith=function(e){if(1===e.length){var t=void 0;if(this._queue.length>0){var r=this._queue[0][0];t=r[r.length-1]}else t=this._last;return t===e}var n=this._last+this._queue.reduce(function(e,t){return t[0]+e},"");return e.length<=n.length&&n.slice(-e.length)===e},e.prototype.hasContent=function(){return this._queue.length>0||!!this._last},e.prototype.source=function(e,t){if(!e||t){var r=t?t[e]:null;this._sourcePosition.identifierName=t&&t.identifierName||null,this._sourcePosition.line=r?r.line:null,this._sourcePosition.column=r?r.column:null,this._sourcePosition.filename=t&&t.filename||null}},e.prototype.withSource=function(e,t,r){if(!this._map)return r();var n=this._sourcePosition.line,i=this._sourcePosition.column,s=this._sourcePosition.filename,a=this._sourcePosition.identifierName;this.source(e,t),r(),this._sourcePosition.line=n,this._sourcePosition.column=i,this._sourcePosition.filename=s,this._sourcePosition.identifierName=a},e.prototype.getCurrentColumn=function(){var e=this._queue.reduce(function(e,t){return t[0]+e},""),t=e.lastIndexOf("\n");return-1===t?this._position.column+e.length:e.length-1-t},e.prototype.getCurrentLine=function(){for(var e=this._queue.reduce(function(e,t){return t[0]+e},""),t=0,r=0;r<e.length;r++)"\n"===e[r]&&t++;return this._position.line+t},e}();t.default=l,e.exports=t.default},function(e,t,r){"use strict";function n(e){this.print(e.program,e)}function i(e){this.printInnerComments(e,!1),this.printSequence(e.directives,e),e.directives&&e.directives.length&&this.newline(),this.printSequence(e.body,e)}function s(e){this.token("{"),this.printInnerComments(e);var t=e.directives&&e.directives.length;e.body.length||t?(this.newline(),this.printSequence(e.directives,e,{indent:!0}),t&&this.newline(),this.printSequence(e.body,e,{indent:!0}),this.removeTrailingNewline(),this.source("end",e.loc),this.endsWith("\n")||this.newline(),this.rightBrace()):(this.source("end",e.loc),this.token("}"))}function a(){}function o(e){this.print(e.value,e),this.semicolon()}t.__esModule=!0,t.File=n,t.Program=i,t.BlockStatement=s,t.Noop=a,t.Directive=o;var u=r(123);Object.defineProperty(t,"DirectiveLiteral",{enumerable:!0,get:function(){return u.StringLiteral}})},function(e,t){"use strict";function r(e){this.printJoin(e.decorators,e),this.word("class"),e.id&&(this.space(),this.print(e.id,e)),this.print(e.typeParameters,e),e.superClass&&(this.space(),this.word("extends"),this.space(),this.print(e.superClass,e),this.print(e.superTypeParameters,e)),e.implements&&(this.space(),this.word("implements"),this.space(),this.printList(e.implements,e)),this.space(),this.print(e.body,e)}function n(e){this.token("{"),this.printInnerComments(e),0===e.body.length?this.token("}"):(this.newline(),this.indent(),this.printSequence(e.body,e),this.dedent(),this.endsWith("\n")||this.newline(),this.rightBrace())}function i(e){this.printJoin(e.decorators,e),e.static&&(this.word("static"),this.space()),e.computed?(this.token("["),this.print(e.key,e),this.token("]")):(this._variance(e),this.print(e.key,e)),this.print(e.typeAnnotation,e),e.value&&(this.space(),this.token("="),this.space(),this.print(e.value,e)),this.semicolon()}function s(e){this.printJoin(e.decorators,e),e.static&&(this.word("static"),this.space()),"constructorCall"===e.kind&&(this.word("call"),this.space()),this._method(e)}t.__esModule=!0,t.ClassDeclaration=r,t.ClassBody=n,t.ClassProperty=i,t.ClassMethod=s,t.ClassExpression=r},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){"void"===e.operator||"delete"===e.operator||"typeof"===e.operator?(this.word(e.operator),this.space()):this.token(e.operator),this.print(e.argument,e)}function s(e){this.word("do"),this.space(),this.print(e.body,e)}function a(e){this.token("("),this.print(e.expression,e),this.token(")")}function o(e){e.prefix?(this.token(e.operator),this.print(e.argument,e)):(this.print(e.argument,e),this.token(e.operator))}function u(e){this.print(e.test,e),this.space(),this.token("?"),this.space(),this.print(e.consequent,e),this.space(),this.token(":"),this.space(),this.print(e.alternate,e)}function l(e,t){this.word("new"),this.space(),this.print(e.callee,e),(0!==e.arguments.length||!this.format.minified||C.isCallExpression(t,{callee:e})||C.isMemberExpression(t)||C.isNewExpression(t))&&(this.token("("),this.printList(e.arguments,e),this.token(")"))}function c(e){this.printList(e.expressions,e)}function f(){ this.word("this")}function p(){this.word("super")}function d(e){this.token("@"),this.print(e.expression,e),this.newline()}function h(){this.token(","),this.newline(),this.endsWith("\n")||this.space()}function m(e){this.print(e.callee,e),this.token("(");var t=e._prettyCall,r=void 0;t&&(r=h,this.newline(),this.indent()),this.printList(e.arguments,e,{separator:r}),t&&(this.newline(),this.dedent()),this.token(")")}function y(){this.word("import")}function v(e){return function(t){if(this.word(e),t.delegate&&this.token("*"),t.argument){this.space();var r=this.startTerminatorless();this.print(t.argument,t),this.endTerminatorless(r)}}}function g(){this.semicolon(!0)}function b(e){this.print(e.expression,e),this.semicolon()}function E(e){this.print(e.left,e),e.left.optional&&this.token("?"),this.print(e.left.typeAnnotation,e),this.space(),this.token("="),this.space(),this.print(e.right,e)}function x(e,t){var r=this.inForStatementInitCounter&&"in"===e.operator&&!P.needsParens(e,t);r&&this.token("("),this.print(e.left,e),this.space(),"in"===e.operator||"instanceof"===e.operator?this.word(e.operator):this.token(e.operator),this.space(),this.print(e.right,e),r&&this.token(")")}function A(e){this.print(e.object,e),this.token("::"),this.print(e.callee,e)}function S(e){if(this.print(e.object,e),!e.computed&&C.isMemberExpression(e.property))throw new TypeError("Got a MemberExpression for MemberExpression property");var t=e.computed;C.isLiteral(e.property)&&"number"==typeof e.property.value&&(t=!0),t?(this.token("["),this.print(e.property,e),this.token("]")):(this.token("."),this.print(e.property,e))}function _(e){this.print(e.meta,e),this.token("."),this.print(e.property,e)}t.__esModule=!0,t.LogicalExpression=t.BinaryExpression=t.AwaitExpression=t.YieldExpression=void 0,t.UnaryExpression=i,t.DoExpression=s,t.ParenthesizedExpression=a,t.UpdateExpression=o,t.ConditionalExpression=u,t.NewExpression=l,t.SequenceExpression=c,t.ThisExpression=f,t.Super=p,t.Decorator=d,t.CallExpression=m,t.Import=y,t.EmptyStatement=g,t.ExpressionStatement=b,t.AssignmentPattern=E,t.AssignmentExpression=x,t.BindExpression=A,t.MemberExpression=S,t.MetaProperty=_;var D=r(1),C=n(D),w=r(187),P=n(w);t.YieldExpression=v("yield"),t.AwaitExpression=v("await");t.BinaryExpression=x,t.LogicalExpression=x},function(e,t,r){"use strict";function n(){this.word("any")}function i(e){this.print(e.elementType,e),this.token("["),this.token("]")}function s(){this.word("boolean")}function a(e){this.word(e.value?"true":"false")}function o(){this.word("null")}function u(e,t){Q.isDeclareExportDeclaration(t)||(this.word("declare"),this.space()),this.word("class"),this.space(),this._interfaceish(e)}function l(e,t){Q.isDeclareExportDeclaration(t)||(this.word("declare"),this.space()),this.word("function"),this.space(),this.print(e.id,e),this.print(e.id.typeAnnotation.typeAnnotation,e),this.semicolon()}function c(e){this.word("declare"),this.space(),this.InterfaceDeclaration(e)}function f(e){this.word("declare"),this.space(),this.word("module"),this.space(),this.print(e.id,e),this.space(),this.print(e.body,e)}function p(e){this.word("declare"),this.space(),this.word("module"),this.token("."),this.word("exports"),this.print(e.typeAnnotation,e)}function d(e){this.word("declare"),this.space(),this.TypeAlias(e)}function h(e,t){Q.isDeclareExportDeclaration(t)||(this.word("declare"),this.space()),this.OpaqueType(e)}function m(e,t){Q.isDeclareExportDeclaration(t)||(this.word("declare"),this.space()),this.word("var"),this.space(),this.print(e.id,e),this.print(e.id.typeAnnotation,e),this.semicolon()}function y(e){this.word("declare"),this.space(),this.word("export"),this.space(),e.default&&(this.word("default"),this.space()),v.apply(this,arguments)}function v(e){if(e.declaration){var t=e.declaration;this.print(t,e),Q.isStatement(t)||this.semicolon()}else this.token("{"),e.specifiers.length&&(this.space(),this.printList(e.specifiers,e),this.space()),this.token("}"),e.source&&(this.space(),this.word("from"),this.space(),this.print(e.source,e)),this.semicolon()}function g(){this.token("*")}function b(e,t){this.print(e.typeParameters,e),this.token("("),this.printList(e.params,e),e.rest&&(e.params.length&&(this.token(","),this.space()),this.token("..."),this.print(e.rest,e)),this.token(")"),"ObjectTypeCallProperty"===t.type||"DeclareFunction"===t.type?this.token(":"):(this.space(),this.token("=>")),this.space(),this.print(e.returnType,e)}function E(e){this.print(e.name,e),e.optional&&this.token("?"),this.token(":"),this.space(),this.print(e.typeAnnotation,e)}function x(e){this.print(e.id,e),this.print(e.typeParameters,e)}function A(e){this.print(e.id,e),this.print(e.typeParameters,e),e.extends.length&&(this.space(),this.word("extends"),this.space(),this.printList(e.extends,e)),e.mixins&&e.mixins.length&&(this.space(),this.word("mixins"),this.space(),this.printList(e.mixins,e)),this.space(),this.print(e.body,e)}function S(e){"plus"===e.variance?this.token("+"):"minus"===e.variance&&this.token("-")}function _(e){this.word("interface"),this.space(),this._interfaceish(e)}function D(){this.space(),this.token("&"),this.space()}function C(e){this.printJoin(e.types,e,{separator:D})}function w(){this.word("mixed")}function P(){this.word("empty")}function k(e){this.token("?"),this.print(e.typeAnnotation,e)}function F(){this.word("number")}function T(){this.word("string")}function O(){this.word("this")}function B(e){this.token("["),this.printList(e.types,e),this.token("]")}function R(e){this.word("typeof"),this.space(),this.print(e.argument,e)}function I(e){this.word("type"),this.space(),this.print(e.id,e),this.print(e.typeParameters,e),this.space(),this.token("="),this.space(),this.print(e.right,e),this.semicolon()}function M(e){this.word("opaque"),this.space(),this.word("type"),this.space(),this.print(e.id,e),this.print(e.typeParameters,e),e.supertype&&(this.token(":"),this.space(),this.print(e.supertype,e)),e.impltype&&(this.space(),this.token("="),this.space(),this.print(e.impltype,e)),this.semicolon()}function N(e){this.token(":"),this.space(),e.optional&&this.token("?"),this.print(e.typeAnnotation,e)}function L(e){this._variance(e),this.word(e.name),e.bound&&this.print(e.bound,e),e.default&&(this.space(),this.token("="),this.space(),this.print(e.default,e))}function j(e){this.token("<"),this.printList(e.params,e,{}),this.token(">")}function U(e){var t=this;e.exact?this.token("{|"):this.token("{");var r=e.properties.concat(e.callProperties,e.indexers);r.length&&(this.space(),this.printJoin(r,e,{addNewlines:function(e){if(e&&!r[0])return 1},indent:!0,statement:!0,iterator:function(){1!==r.length&&(t.format.flowCommaSeparator?t.token(","):t.semicolon(),t.space())}}),this.space()),e.exact?this.token("|}"):this.token("}")}function V(e){e.static&&(this.word("static"),this.space()),this.print(e.value,e)}function G(e){e.static&&(this.word("static"),this.space()),this._variance(e),this.token("["),this.print(e.id,e),this.token(":"),this.space(),this.print(e.key,e),this.token("]"),this.token(":"),this.space(),this.print(e.value,e)}function W(e){e.static&&(this.word("static"),this.space()),this._variance(e),this.print(e.key,e),e.optional&&this.token("?"),this.token(":"),this.space(),this.print(e.value,e)}function Y(e){this.token("..."),this.print(e.argument,e)}function q(e){this.print(e.qualification,e),this.token("."),this.print(e.id,e)}function K(){this.space(),this.token("|"),this.space()}function H(e){this.printJoin(e.types,e,{separator:K})}function J(e){this.token("("),this.print(e.expression,e),this.print(e.typeAnnotation,e),this.token(")")}function X(){this.word("void")}t.__esModule=!0,t.TypeParameterDeclaration=t.StringLiteralTypeAnnotation=t.NumericLiteralTypeAnnotation=t.GenericTypeAnnotation=t.ClassImplements=void 0,t.AnyTypeAnnotation=n,t.ArrayTypeAnnotation=i,t.BooleanTypeAnnotation=s,t.BooleanLiteralTypeAnnotation=a,t.NullLiteralTypeAnnotation=o,t.DeclareClass=u,t.DeclareFunction=l,t.DeclareInterface=c,t.DeclareModule=f,t.DeclareModuleExports=p,t.DeclareTypeAlias=d,t.DeclareOpaqueType=h,t.DeclareVariable=m,t.DeclareExportDeclaration=y,t.ExistentialTypeParam=g,t.FunctionTypeAnnotation=b,t.FunctionTypeParam=E,t.InterfaceExtends=x,t._interfaceish=A,t._variance=S,t.InterfaceDeclaration=_,t.IntersectionTypeAnnotation=C,t.MixedTypeAnnotation=w,t.EmptyTypeAnnotation=P,t.NullableTypeAnnotation=k;var z=r(123);Object.defineProperty(t,"NumericLiteralTypeAnnotation",{enumerable:!0,get:function(){return z.NumericLiteral}}),Object.defineProperty(t,"StringLiteralTypeAnnotation",{enumerable:!0,get:function(){return z.StringLiteral}}),t.NumberTypeAnnotation=F,t.StringTypeAnnotation=T,t.ThisTypeAnnotation=O,t.TupleTypeAnnotation=B,t.TypeofTypeAnnotation=R,t.TypeAlias=I,t.OpaqueType=M,t.TypeAnnotation=N,t.TypeParameter=L,t.TypeParameterInstantiation=j,t.ObjectTypeAnnotation=U,t.ObjectTypeCallProperty=V,t.ObjectTypeIndexer=G,t.ObjectTypeProperty=W,t.ObjectTypeSpreadProperty=Y,t.QualifiedTypeIdentifier=q,t.UnionTypeAnnotation=H,t.TypeCastExpression=J,t.VoidTypeAnnotation=X;var $=r(1),Q=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}($);t.ClassImplements=x,t.GenericTypeAnnotation=x,t.TypeParameterDeclaration=j},function(e,t,r){"use strict";function n(e){this.print(e.name,e),e.value&&(this.token("="),this.print(e.value,e))}function i(e){this.word(e.name)}function s(e){this.print(e.namespace,e),this.token(":"),this.print(e.name,e)}function a(e){this.print(e.object,e),this.token("."),this.print(e.property,e)}function o(e){this.token("{"),this.token("..."),this.print(e.argument,e),this.token("}")}function u(e){this.token("{"),this.print(e.expression,e),this.token("}")}function l(e){this.token("{"),this.token("..."),this.print(e.expression,e),this.token("}")}function c(e){this.token(e.value)}function f(e){var t=e.openingElement;if(this.print(t,e),!t.selfClosing){this.indent();for(var r=e.children,n=Array.isArray(r),i=0,r=n?r:(0,v.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var a=s;this.print(a,e)}this.dedent(),this.print(e.closingElement,e)}}function p(){this.space()}function d(e){this.token("<"),this.print(e.name,e),e.attributes.length>0&&(this.space(),this.printJoin(e.attributes,e,{separator:p})),e.selfClosing?(this.space(),this.token("/>")):this.token(">")}function h(e){this.token("</"),this.print(e.name,e),this.token(">")}function m(){}t.__esModule=!0;var y=r(2),v=function(e){return e&&e.__esModule?e:{default:e}}(y);t.JSXAttribute=n,t.JSXIdentifier=i,t.JSXNamespacedName=s,t.JSXMemberExpression=a,t.JSXSpreadAttribute=o,t.JSXExpressionContainer=u,t.JSXSpreadChild=l,t.JSXText=c,t.JSXElement=f,t.JSXOpeningElement=d,t.JSXClosingElement=h,t.JSXEmptyExpression=m},function(e,t,r){"use strict";function n(e){var t=this;this.print(e.typeParameters,e),this.token("("),this.printList(e.params,e,{iterator:function(e){e.optional&&t.token("?"),t.print(e.typeAnnotation,e)}}),this.token(")"),e.returnType&&this.print(e.returnType,e)}function i(e){var t=e.kind,r=e.key;"method"!==t&&"init"!==t||e.generator&&this.token("*"),"get"!==t&&"set"!==t||(this.word(t),this.space()),e.async&&(this.word("async"),this.space()),e.computed?(this.token("["),this.print(r,e),this.token("]")):this.print(r,e),this._params(e),this.space(),this.print(e.body,e)}function s(e){e.async&&(this.word("async"),this.space()),this.word("function"),e.generator&&this.token("*"),e.id?(this.space(),this.print(e.id,e)):this.space(),this._params(e),this.space(),this.print(e.body,e)}function a(e){e.async&&(this.word("async"),this.space());var t=e.params[0];1===e.params.length&&l.isIdentifier(t)&&!o(e,t)?this.print(t,e):this._params(e),this.space(),this.token("=>"),this.space(),this.print(e.body,e)}function o(e,t){return e.typeParameters||e.returnType||t.typeAnnotation||t.optional||t.trailingComments}t.__esModule=!0,t.FunctionDeclaration=void 0,t._params=n,t._method=i,t.FunctionExpression=s,t.ArrowFunctionExpression=a;var u=r(1),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(u);t.FunctionDeclaration=s},function(e,t,r){"use strict";function n(e){"type"!==e.importKind&&"typeof"!==e.importKind||(this.word(e.importKind),this.space()),this.print(e.imported,e),e.local&&e.local.name!==e.imported.name&&(this.space(),this.word("as"),this.space(),this.print(e.local,e))}function i(e){this.print(e.local,e)}function s(e){this.print(e.exported,e)}function a(e){this.print(e.local,e),e.exported&&e.local.name!==e.exported.name&&(this.space(),this.word("as"),this.space(),this.print(e.exported,e))}function o(e){this.token("*"),this.space(),this.word("as"),this.space(),this.print(e.exported,e)}function u(e){this.word("export"),this.space(),this.token("*"),this.space(),this.word("from"),this.space(),this.print(e.source,e),this.semicolon()}function l(){this.word("export"),this.space(),f.apply(this,arguments)}function c(){this.word("export"),this.space(),this.word("default"),this.space(),f.apply(this,arguments)}function f(e){if(e.declaration){var t=e.declaration;this.print(t,e),m.isStatement(t)||this.semicolon()}else{"type"===e.exportKind&&(this.word("type"),this.space());for(var r=e.specifiers.slice(0),n=!1;;){var i=r[0];if(!m.isExportDefaultSpecifier(i)&&!m.isExportNamespaceSpecifier(i))break;n=!0,this.print(r.shift(),e),r.length&&(this.token(","),this.space())}(r.length||!r.length&&!n)&&(this.token("{"),r.length&&(this.space(),this.printList(r,e),this.space()),this.token("}")),e.source&&(this.space(),this.word("from"),this.space(),this.print(e.source,e)),this.semicolon()}}function p(e){this.word("import"),this.space(),"type"!==e.importKind&&"typeof"!==e.importKind||(this.word(e.importKind),this.space());var t=e.specifiers.slice(0);if(t&&t.length){for(;;){var r=t[0];if(!m.isImportDefaultSpecifier(r)&&!m.isImportNamespaceSpecifier(r))break;this.print(t.shift(),e),t.length&&(this.token(","),this.space())}t.length&&(this.token("{"),this.space(),this.printList(t,e),this.space(),this.token("}")),this.space(),this.word("from"),this.space()}this.print(e.source,e),this.semicolon()}function d(e){this.token("*"),this.space(),this.word("as"),this.space(),this.print(e.local,e)}t.__esModule=!0,t.ImportSpecifier=n,t.ImportDefaultSpecifier=i,t.ExportDefaultSpecifier=s,t.ExportSpecifier=a,t.ExportNamespaceSpecifier=o,t.ExportAllDeclaration=u,t.ExportNamedDeclaration=l,t.ExportDefaultDeclaration=c,t.ImportDeclaration=p,t.ImportNamespaceSpecifier=d;var h=r(1),m=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(h)},function(e,t,r){"use strict";function n(e){this.word("with"),this.space(),this.token("("),this.print(e.object,e),this.token(")"),this.printBlock(e)}function i(e){this.word("if"),this.space(),this.token("("),this.print(e.test,e),this.token(")"),this.space();var t=e.alternate&&S.isIfStatement(s(e.consequent));t&&(this.token("{"),this.newline(),this.indent()),this.printAndIndentOnComments(e.consequent,e),t&&(this.dedent(),this.newline(),this.token("}")),e.alternate&&(this.endsWith("}")&&this.space(),this.word("else"),this.space(),this.printAndIndentOnComments(e.alternate,e))}function s(e){return S.isStatement(e.body)?s(e.body):e}function a(e){this.word("for"),this.space(),this.token("("),this.inForStatementInitCounter++,this.print(e.init,e),this.inForStatementInitCounter--,this.token(";"),e.test&&(this.space(),this.print(e.test,e)),this.token(";"),e.update&&(this.space(),this.print(e.update,e)),this.token(")"),this.printBlock(e)}function o(e){this.word("while"),this.space(),this.token("("),this.print(e.test,e),this.token(")"),this.printBlock(e)}function u(e){this.word("do"),this.space(),this.print(e.body,e),this.space(),this.word("while"),this.space(),this.token("("),this.print(e.test,e),this.token(")"),this.semicolon()}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"label";return function(r){this.word(e);var n=r[t];if(n){this.space();var i=this.startTerminatorless();this.print(n,r),this.endTerminatorless(i)}this.semicolon()}}function c(e){this.print(e.label,e),this.token(":"),this.space(),this.print(e.body,e)}function f(e){this.word("try"),this.space(),this.print(e.block,e),this.space(),e.handlers?this.print(e.handlers[0],e):this.print(e.handler,e),e.finalizer&&(this.space(),this.word("finally"),this.space(),this.print(e.finalizer,e))}function p(e){this.word("catch"),this.space(),this.token("("),this.print(e.param,e),this.token(")"),this.space(),this.print(e.body,e)}function d(e){this.word("switch"),this.space(),this.token("("),this.print(e.discriminant,e),this.token(")"),this.space(),this.token("{"),this.printSequence(e.cases,e,{indent:!0,addNewlines:function(t,r){if(!t&&e.cases[e.cases.length-1]===r)return-1}}),this.token("}")}function h(e){e.test?(this.word("case"),this.space(),this.print(e.test,e),this.token(":")):(this.word("default"),this.token(":")),e.consequent.length&&(this.newline(),this.printSequence(e.consequent,e,{indent:!0}))}function m(){this.word("debugger"),this.semicolon()}function y(){if(this.token(","),this.newline(),this.endsWith("\n"))for(var e=0;e<4;e++)this.space(!0)}function v(){if(this.token(","),this.newline(),this.endsWith("\n"))for(var e=0;e<6;e++)this.space(!0)}function g(e,t){this.word(e.kind),this.space();var r=!1;if(!S.isFor(t))for(var n=e.declarations,i=Array.isArray(n),s=0,n=i?n:(0,x.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a;o.init&&(r=!0)}var u=void 0;r&&(u="const"===e.kind?v:y),this.printList(e.declarations,e,{separator:u}),(!S.isFor(t)||t.left!==e&&t.init!==e)&&this.semicolon()}function b(e){this.print(e.id,e),this.print(e.id.typeAnnotation,e),e.init&&(this.space(),this.token("="),this.space(),this.print(e.init,e))}t.__esModule=!0,t.ThrowStatement=t.BreakStatement=t.ReturnStatement=t.ContinueStatement=t.ForAwaitStatement=t.ForOfStatement=t.ForInStatement=void 0;var E=r(2),x=function(e){return e&&e.__esModule?e:{default:e}}(E);t.WithStatement=n,t.IfStatement=i,t.ForStatement=a,t.WhileStatement=o,t.DoWhileStatement=u,t.LabeledStatement=c,t.TryStatement=f,t.CatchClause=p,t.SwitchStatement=d,t.SwitchCase=h,t.DebuggerStatement=m,t.VariableDeclaration=g,t.VariableDeclarator=b;var A=r(1),S=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(A),_=function(e){return function(t){this.word("for"),this.space(),"await"===e&&(this.word("await"),this.space()),this.token("("),this.print(t.left,t),this.space(),this.word("await"===e?"of":e),this.space(),this.print(t.right,t),this.token(")"),this.printBlock(t)}};t.ForInStatement=_("in"),t.ForOfStatement=_("of"),t.ForAwaitStatement=_("await"),t.ContinueStatement=l("continue"),t.ReturnStatement=l("return","argument"),t.BreakStatement=l("break"),t.ThrowStatement=l("throw","argument")},function(e,t){"use strict";function r(e){this.print(e.tag,e),this.print(e.quasi,e)}function n(e,t){var r=t.quasis[0]===e,n=t.quasis[t.quasis.length-1]===e,i=(r?"`":"}")+e.value.raw+(n?"`":"${");this.token(i)}function i(e){for(var t=e.quasis,r=0;r<t.length;r++)this.print(t[r],e),r+1<t.length&&this.print(e.expressions[r],e)}t.__esModule=!0,t.TaggedTemplateExpression=r,t.TemplateElement=n,t.TemplateLiteral=i},function(e,t,r){"use strict";function n(e,t){return b.isArrayTypeAnnotation(t)}function i(e,t){return b.isMemberExpression(t)&&t.object===e}function s(e,t,r){return v(r,{considerArrow:!0})}function a(e,t,r){return v(r)}function o(e,t){if((b.isCallExpression(t)||b.isNewExpression(t))&&t.callee===e||b.isUnaryLike(t)||b.isMemberExpression(t)&&t.object===e||b.isAwaitExpression(t))return!0;if(b.isBinary(t)){var r=t.operator,n=E[r],i=e.operator,s=E[i];if(n===s&&t.right===e&&!b.isLogicalExpression(t)||n>s)return!0}return!1}function u(e,t){return"in"===e.operator&&(b.isVariableDeclarator(t)||b.isFor(t))}function l(e,t){return!(b.isForStatement(t)||b.isThrowStatement(t)||b.isReturnStatement(t)||b.isIfStatement(t)&&t.test===e||b.isWhileStatement(t)&&t.test===e||b.isForInStatement(t)&&t.right===e||b.isSwitchStatement(t)&&t.discriminant===e||b.isExpressionStatement(t)&&t.expression===e)}function c(e,t){return b.isBinary(t)||b.isUnaryLike(t)||b.isCallExpression(t)||b.isMemberExpression(t)||b.isNewExpression(t)||b.isConditionalExpression(t)&&e===t.test}function f(e,t,r){return v(r,{considerDefaultExports:!0})}function p(e,t){return b.isMemberExpression(t,{object:e})||b.isCallExpression(t,{callee:e})||b.isNewExpression(t,{callee:e})}function d(e,t,r){return v(r,{considerDefaultExports:!0})}function h(e,t){return!!(b.isExportDeclaration(t)||b.isBinaryExpression(t)||b.isLogicalExpression(t)||b.isUnaryExpression(t)||b.isTaggedTemplateExpression(t))||p(e,t)}function m(e,t){return!!(b.isUnaryLike(t)||b.isBinary(t)||b.isConditionalExpression(t,{test:e})||b.isAwaitExpression(t))||p(e,t)}function y(e){return!!b.isObjectPattern(e.left)||m.apply(void 0,arguments)}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.considerArrow,n=void 0!==r&&r,i=t.considerDefaultExports,s=void 0!==i&&i,a=e.length-1,o=e[a];a--;for(var u=e[a];a>0;){if(b.isExpressionStatement(u,{expression:o})||b.isTaggedTemplateExpression(u)||s&&b.isExportDefaultDeclaration(u,{declaration:o})||n&&b.isArrowFunctionExpression(u,{body:o}))return!0;if(!(b.isCallExpression(u,{callee:o})||b.isSequenceExpression(u)&&u.expressions[0]===o||b.isMemberExpression(u,{object:o})||b.isConditional(u,{test:o})||b.isBinary(u,{left:o})||b.isAssignmentExpression(u,{left:o})))return!1;o=u,a--,u=e[a]}return!1}t.__esModule=!0,t.AwaitExpression=t.FunctionTypeAnnotation=void 0,t.NullableTypeAnnotation=n,t.UpdateExpression=i,t.ObjectExpression=s,t.DoExpression=a,t.Binary=o,t.BinaryExpression=u,t.SequenceExpression=l,t.YieldExpression=c,t.ClassExpression=f,t.UnaryLike=p,t.FunctionExpression=d,t.ArrowFunctionExpression=h,t.ConditionalExpression=m,t.AssignmentExpression=y;var g=r(1),b=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(g),E={"||":0,"&&":1,"|":2,"^":3,"&":4,"==":5,"===":5,"!=":5,"!==":5,"<":6,">":6,"<=":6,">=":6,in:6,instanceof:6,">>":7,"<<":7,">>>":7,"+":8,"-":8,"*":9,"/":9,"%":9,"**":10};t.FunctionTypeAnnotation=n,t.AwaitExpression=c},function(e,t,r){"use strict";function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l.isMemberExpression(e)?(n(e.object,t),e.computed&&n(e.property,t)):l.isBinary(e)||l.isAssignmentExpression(e)?(n(e.left,t),n(e.right,t)):l.isCallExpression(e)?(t.hasCall=!0,n(e.callee,t)):l.isFunction(e)?t.hasFunction=!0:l.isIdentifier(e)&&(t.hasHelper=t.hasHelper||i(e.callee)),t}function i(e){return l.isMemberExpression(e)?i(e.object)||i(e.property):l.isIdentifier(e)?"require"===e.name||"_"===e.name[0]:l.isCallExpression(e)?i(e.callee):!(!l.isBinary(e)&&!l.isAssignmentExpression(e))&&(l.isIdentifier(e.left)&&i(e.left)||i(e.right))}function s(e){return l.isLiteral(e)||l.isObjectExpression(e)||l.isArrayExpression(e)||l.isIdentifier(e)||l.isMemberExpression(e)}var a=r(588),o=function(e){return e&&e.__esModule?e:{default:e}}(a),u=r(1),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(u);t.nodes={AssignmentExpression:function(e){var t=n(e.right);if(t.hasCall&&t.hasHelper||t.hasFunction)return{before:t.hasFunction,after:!0}},SwitchCase:function(e,t){return{before:e.consequent.length||t.cases[0]===e}},LogicalExpression:function(e){if(l.isFunction(e.left)||l.isFunction(e.right))return{after:!0}},Literal:function(e){if("use strict"===e.value)return{after:!0}},CallExpression:function(e){if(l.isFunction(e.callee)||i(e))return{before:!0,after:!0}},VariableDeclaration:function(e){for(var t=0;t<e.declarations.length;t++){var r=e.declarations[t],a=i(r.id)&&!s(r.init);if(!a){var o=n(r.init);a=i(r.init)&&o.hasCall||o.hasFunction}if(a)return{before:!0,after:!0}}},IfStatement:function(e){if(l.isBlockStatement(e.consequent))return{before:!0,after:!0}}},t.nodes.ObjectProperty=t.nodes.ObjectTypeProperty=t.nodes.ObjectMethod=t.nodes.SpreadProperty=function(e,t){if(t.properties[0]===e)return{before:!0}},t.list={VariableDeclaration:function(e){return(0,o.default)(e.declarations,"init")},ArrayExpression:function(e){return e.elements},ObjectExpression:function(e){return e.properties}},[["Function",!0],["Class",!0],["Loop",!0],["LabeledStatement",!0],["SwitchStatement",!0],["TryStatement",!0]].forEach(function(e){var r=e[0],n=e[1];"boolean"==typeof n&&(n={after:n,before:n}),[r].concat(l.FLIPPED_ALIAS_KEYS[r]||[]).forEach(function(e){t.nodes[e]=function(){return n}})})},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(){this.token(","),this.space()}t.__esModule=!0;var a=r(87),o=i(a),u=r(2),l=i(u),c=r(35),f=i(c),p=r(365),d=i(p),h=r(3),m=i(h),y=r(579),v=i(y),g=r(581),b=i(g),E=r(586),x=i(E),A=r(278),S=i(A),_=r(300),D=i(_),C=r(187),w=n(C),P=r(314),k=i(P),F=r(1),T=n(F),O=/e/i,B=/\.0+$/,R=/^0[box]/,I=function(){function e(t,r,n){(0,m.default)(this,e),this.inForStatementInitCounter=0,this._printStack=[],this._indent=0,this._insideAux=!1,this._printedCommentStarts={},this._parenPushNewlineState=null,this._printAuxAfterOnNextUserNode=!1,this._printedComments=new d.default,this._endsWithInteger=!1,this._endsWithWord=!1,this.format=t||{},this._buf=new D.default(r),this._whitespace=n.length>0?new k.default(n):null}return e.prototype.generate=function(e){return this.print(e),this._maybeAddAuxComment(),this._buf.get()},e.prototype.indent=function(){this.format.compact||this.format.concise||this._indent++},e.prototype.dedent=function(){this.format.compact||this.format.concise||this._indent--},e.prototype.semicolon=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._maybeAddAuxComment(),this._append(";",!e)},e.prototype.rightBrace=function(){this.format.minified&&this._buf.removeLastSemicolon(),this.token("}")},e.prototype.space=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.format.compact||(this._buf.hasContent()&&!this.endsWith(" ")&&!this.endsWith("\n")||e)&&this._space()},e.prototype.word=function(e){this._endsWithWord&&this._space(),this._maybeAddAuxComment(),this._append(e),this._endsWithWord=!0},e.prototype.number=function(e){this.word(e),this._endsWithInteger=(0,x.default)(+e)&&!R.test(e)&&!O.test(e)&&!B.test(e)&&"."!==e[e.length-1]},e.prototype.token=function(e){("--"===e&&this.endsWith("!")||"+"===e[0]&&this.endsWith("+")||"-"===e[0]&&this.endsWith("-")||"."===e[0]&&this._endsWithInteger)&&this._space(),this._maybeAddAuxComment(),this._append(e)},e.prototype.newline=function(e){if(!this.format.retainLines&&!this.format.compact){if(this.format.concise)return void this.space();if(!(this.endsWith("\n\n")||("number"!=typeof e&&(e=1),e=Math.min(2,e),(this.endsWith("{\n")||this.endsWith(":\n"))&&e--,e<=0)))for(var t=0;t<e;t++)this._newline()}},e.prototype.endsWith=function(e){return this._buf.endsWith(e)},e.prototype.removeTrailingNewline=function(){this._buf.removeTrailingNewline()},e.prototype.source=function(e,t){this._catchUp(e,t),this._buf.source(e,t)},e.prototype.withSource=function(e,t,r){this._catchUp(e,t),this._buf.withSource(e,t,r)},e.prototype._space=function(){this._append(" ",!0)},e.prototype._newline=function(){this._append("\n",!0)},e.prototype._append=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._maybeAddParen(e),this._maybeIndent(e),t?this._buf.queue(e):this._buf.append(e),this._endsWithWord=!1,this._endsWithInteger=!1},e.prototype._maybeIndent=function(e){this._indent&&this.endsWith("\n")&&"\n"!==e[0]&&this._buf.queue(this._getIndent())},e.prototype._maybeAddParen=function(e){var t=this._parenPushNewlineState;if(t){this._parenPushNewlineState=null;var r=void 0;for(r=0;r<e.length&&" "===e[r];r++);if(r!==e.length){var n=e[r];"\n"!==n&&"/"!==n||(this.token("("),this.indent(),t.printed=!0)}}},e.prototype._catchUp=function(e,t){if(this.format.retainLines){var r=t?t[e]:null;if(r&&null!==r.line)for(var n=r.line-this._buf.getCurrentLine(),i=0;i<n;i++)this._newline()}},e.prototype._getIndent=function(){return(0,S.default)(this.format.indent.style,this._indent)},e.prototype.startTerminatorless=function(){return this._parenPushNewlineState={printed:!1}},e.prototype.endTerminatorless=function(e){e.printed&&(this.dedent(),this.newline(),this.token(")"))},e.prototype.print=function(e,t){var r=this;if(e){var n=this.format.concise;e._compact&&(this.format.concise=!0);if(!this[e.type])throw new ReferenceError("unknown node of type "+(0,f.default)(e.type)+" with constructor "+(0,f.default)(e&&e.constructor.name));this._printStack.push(e);var i=this._insideAux;this._insideAux=!e.loc,this._maybeAddAuxComment(this._insideAux&&!i);var s=w.needsParens(e,t,this._printStack);this.format.retainFunctionParens&&"FunctionExpression"===e.type&&e.extra&&e.extra.parenthesized&&(s=!0),s&&this.token("("),this._printLeadingComments(e,t);var a=T.isProgram(e)||T.isFile(e)?null:e.loc;this.withSource("start",a,function(){r[e.type](e,t)}),this._printTrailingComments(e,t),s&&this.token(")"),this._printStack.pop(),this.format.concise=n,this._insideAux=i}},e.prototype._maybeAddAuxComment=function(e){e&&this._printAuxBeforeComment(),this._insideAux||this._printAuxAfterComment()},e.prototype._printAuxBeforeComment=function(){if(!this._printAuxAfterOnNextUserNode){this._printAuxAfterOnNextUserNode=!0;var e=this.format.auxiliaryCommentBefore;e&&this._printComment({type:"CommentBlock",value:e})}},e.prototype._printAuxAfterComment=function(){if(this._printAuxAfterOnNextUserNode){this._printAuxAfterOnNextUserNode=!1;var e=this.format.auxiliaryCommentAfter;e&&this._printComment({type:"CommentBlock",value:e})}},e.prototype.getPossibleRaw=function(e){var t=e.extra;if(t&&null!=t.raw&&null!=t.rawValue&&e.value===t.rawValue)return t.raw},e.prototype.printJoin=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&e.length){r.indent&&this.indent();for(var n={addNewlines:r.addNewlines},i=0;i<e.length;i++){var s=e[i];s&&(r.statement&&this._printNewline(!0,s,t,n),this.print(s,t),r.iterator&&r.iterator(s,i),r.separator&&i<e.length-1&&r.separator.call(this),r.statement&&this._printNewline(!1,s,t,n))}r.indent&&this.dedent()}},e.prototype.printAndIndentOnComments=function(e,t){var r=!!e.leadingComments;r&&this.indent(),this.print(e,t),r&&this.dedent()},e.prototype.printBlock=function(e){var t=e.body;T.isEmptyStatement(t)||this.space(),this.print(t,e)},e.prototype._printTrailingComments=function(e,t){this._printComments(this._getComments(!1,e,t))},e.prototype._printLeadingComments=function(e,t){this._printComments(this._getComments(!0,e,t))},e.prototype.printInnerComments=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.innerComments&&(t&&this.indent(),this._printComments(e.innerComments),t&&this.dedent())},e.prototype.printSequence=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.statement=!0,this.printJoin(e,t,r)},e.prototype.printList=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return null==r.separator&&(r.separator=s),this.printJoin(e,t,r)},e.prototype._printNewline=function(e,t,r,n){var i=this;if(!this.format.retainLines&&!this.format.compact){if(this.format.concise)return void this.space();var s=0;if(null!=t.start&&!t._ignoreUserWhitespace&&this._whitespace)if(e){var a=t.leadingComments,o=a&&(0,v.default)(a,function(e){ return!!e.loc&&i.format.shouldPrintComment(e.value)});s=this._whitespace.getNewlinesBefore(o||t)}else{var u=t.trailingComments,l=u&&(0,b.default)(u,function(e){return!!e.loc&&i.format.shouldPrintComment(e.value)});s=this._whitespace.getNewlinesAfter(l||t)}else{e||s++,n.addNewlines&&(s+=n.addNewlines(e,t)||0);var c=w.needsWhitespaceAfter;e&&(c=w.needsWhitespaceBefore),c(t,r)&&s++,this._buf.hasContent()||(s=0)}this.newline(s)}},e.prototype._getComments=function(e,t){return t&&(e?t.leadingComments:t.trailingComments)||[]},e.prototype._printComment=function(e){var t=this;if(this.format.shouldPrintComment(e.value)&&!e.ignore&&!this._printedComments.has(e)){if(this._printedComments.add(e),null!=e.start){if(this._printedCommentStarts[e.start])return;this._printedCommentStarts[e.start]=!0}this.newline(this._whitespace?this._whitespace.getNewlinesBefore(e):0),this.endsWith("[")||this.endsWith("{")||this.space();var r="CommentLine"===e.type?"//"+e.value+"\n":"/*"+e.value+"*/";if("CommentBlock"===e.type&&this.format.indent.adjustMultilineComment){var n=e.loc&&e.loc.start.column;if(n){var i=new RegExp("\\n\\s{1,"+n+"}","g");r=r.replace(i,"\n")}var s=Math.max(this._getIndent().length,this._buf.getCurrentColumn());r=r.replace(/\n(?!$)/g,"\n"+(0,S.default)(" ",s))}this.withSource("start",e.loc,function(){t._append(r)}),this.newline((this._whitespace?this._whitespace.getNewlinesAfter(e):0)+("CommentLine"===e.type?-1:0))}},e.prototype._printComments=function(e){if(e&&e.length)for(var t=e,r=Array.isArray(t),n=0,t=r?t:(0,l.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i;this._printComment(s)}},e}();t.default=I;for(var M=[r(309),r(303),r(308),r(302),r(306),r(307),r(123),r(304),r(301),r(305)],N=0;N<M.length;N++){var L=M[N];(0,o.default)(I.prototype,L)}e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(14),s=n(i),a=r(11),o=n(a),u=r(3),l=n(u),c=r(288),f=n(c),p=function(){function e(t,r){(0,l.default)(this,e),this._cachedMap=null,this._code=r,this._opts=t,this._rawMappings=[]}return e.prototype.get=function(){if(!this._cachedMap){var e=this._cachedMap=new f.default.SourceMapGenerator({file:this._opts.sourceMapTarget,sourceRoot:this._opts.sourceRoot}),t=this._code;"string"==typeof t?e.setSourceContent(this._opts.sourceFileName,t):"object"===(void 0===t?"undefined":(0,o.default)(t))&&(0,s.default)(t).forEach(function(r){e.setSourceContent(r,t[r])}),this._rawMappings.forEach(e.addMapping,e)}return this._cachedMap.toJSON()},e.prototype.getRawMappings=function(){return this._rawMappings.slice()},e.prototype.mark=function(e,t,r,n,i,s){this._lastGenLine!==e&&null===r||this._lastGenLine===e&&this._lastSourceLine===r&&this._lastSourceColumn===n||(this._cachedMap=null,this._lastGenLine=e,this._lastSourceLine=r,this._lastSourceColumn=n,this._rawMappings.push({name:i||void 0,generated:{line:e,column:t},source:null==r?void 0:s||this._opts.sourceFileName,original:null==r?void 0:{line:r,column:n}}))},e}();t.default=p,e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(3),i=function(e){return e&&e.__esModule?e:{default:e}}(n),s=function(){function e(t){(0,i.default)(this,e),this.tokens=t,this.used={}}return e.prototype.getNewlinesBefore=function(e){var t=void 0,r=void 0,n=this.tokens,i=this._findToken(function(t){return t.start-e.start},0,n.length);if(i>=0){for(;i&&e.start===n[i-1].start;)--i;t=n[i-1],r=n[i]}return this._getNewlinesBetween(t,r)},e.prototype.getNewlinesAfter=function(e){var t=void 0,r=void 0,n=this.tokens,i=this._findToken(function(t){return t.end-e.end},0,n.length);if(i>=0){for(;i&&e.end===n[i-1].end;)--i;t=n[i],r=n[i+1],","===r.type.label&&(r=n[i+2])}return r&&"eof"===r.type.label?1:this._getNewlinesBetween(t,r)},e.prototype._getNewlinesBetween=function(e,t){if(!t||!t.loc)return 0;for(var r=e?e.loc.end.line:1,n=t.loc.start.line,i=0,s=r;s<n;s++)void 0===this.used[s]&&(this.used[s]=!0,i++);return i},e.prototype._findToken=function(e,t,r){if(t>=r)return-1;var n=t+r>>>1,i=e(this.tokens[n]);return i<0?this._findToken(e,n+1,r):i>0?this._findToken(e,t,n):0===i?n:-1},e}();t.default=s,e.exports=t.default},function(e,t,r){"use strict";function n(e){for(var t=e,r=Array.isArray(t),n=0,t=r?t:(0,s.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var a=i,u=a.node,l=u.expression;if(o.isMemberExpression(l)){var c=a.scope.maybeGenerateMemoised(l.object),f=void 0,p=[];c?(f=c,p.push(o.assignmentExpression("=",c,l.object))):f=l.object,p.push(o.callExpression(o.memberExpression(o.memberExpression(f,l.property,l.computed),o.identifier("bind")),[f])),1===p.length?u.expression=p[0]:u.expression=o.sequenceExpression(p)}}}t.__esModule=!0;var i=r(2),s=function(e){return e&&e.__esModule?e:{default:e}}(i);t.default=n;var a=r(1),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(a);e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){function t(t){return t&&t.operator===e.operator+"="}function r(e,t){return a.assignmentExpression("=",e,t)}var n={};return n.ExpressionStatement=function(n,s){if(!n.isCompletionRecord()){var o=n.node.expression;if(t(o)){var u=[],l=(0,i.default)(o.left,u,s,n.scope,!0);u.push(a.expressionStatement(r(l.ref,e.build(l.uid,o.right)))),n.replaceWithMultiple(u)}}},n.AssignmentExpression=function(n,s){var a=n.node,o=n.scope;if(t(a)){var u=[],l=(0,i.default)(a.left,u,s,o);u.push(r(l.ref,e.build(l.uid,a.right))),n.replaceWithMultiple(u)}},n.BinaryExpression=function(t){var r=t.node;r.operator===e.operator&&t.replaceWith(e.build(r.left,r.right))},n};var n=r(318),i=function(e){return e&&e.__esModule?e:{default:e}}(n),s=r(1),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s);e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.scope,r=e.node,n=a.functionExpression(null,[],r.body,r.generator,r.async),s=n,u=[];(0,i.default)(e,function(e){return t.push({id:e})});var l={foundThis:!1,foundArguments:!1};e.traverse(o,l),l.foundArguments&&(s=a.memberExpression(n,a.identifier("apply")),u=[],l.foundThis&&u.push(a.thisExpression()),l.foundArguments&&(l.foundThis||u.push(a.nullLiteral()),u.push(a.identifier("arguments"))));var c=a.callExpression(s,u);return r.generator&&(c=a.yieldExpression(c,!0)),a.returnStatement(c)};var n=r(190),i=function(e){return e&&e.__esModule?e:{default:e}}(n),s=r(1),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),o={enter:function(e,t){e.isThisExpression()&&(t.foundThis=!0),e.isReferencedIdentifier({name:"arguments"})&&(t.foundArguments=!0)},Function:function(e){e.skip()}};e.exports=t.default},function(e,t,r){"use strict";function n(e,t,r,n){var i=void 0;if(a.isSuper(e))return e;if(a.isIdentifier(e)){if(n.hasBinding(e.name))return e;i=e}else{if(!a.isMemberExpression(e))throw new Error("We can't explode this node type "+e.type);if(i=e.object,a.isSuper(i)||a.isIdentifier(i)&&n.hasBinding(i.name))return i}var s=n.generateUidIdentifierBasedOnNode(i);return t.push(a.variableDeclaration("var",[a.variableDeclarator(s,i)])),s}function i(e,t,r,n){var i=e.property,s=a.toComputedKey(e,i);if(a.isLiteral(s)&&a.isPureish(s))return s;var o=n.generateUidIdentifierBasedOnNode(i);return t.push(a.variableDeclaration("var",[a.variableDeclarator(o,i)])),o}t.__esModule=!0,t.default=function(e,t,r,s,o){var u=void 0;u=a.isIdentifier(e)&&o?e:n(e,t,r,s);var l=void 0,c=void 0;if(a.isIdentifier(e))l=e,c=u;else{var f=i(e,t,r,s),p=e.computed||a.isLiteral(f);c=l=a.memberExpression(u,f,p)}return{uid:c,ref:l}};var s=r(1),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),s=n(i);t.default=function(e){function t(t){if(t.node&&!t.isPure()){var r=e.scope.generateDeclaredUidIdentifier();n.push(l.assignmentExpression("=",r,t.node)),t.replaceWith(r)}}function r(e){if(Array.isArray(e)&&e.length){e=e.reverse(),(0,o.default)(e);for(var r=e,n=Array.isArray(r),i=0,r=n?r:(0,s.default)(r);;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if(i=r.next(),i.done)break;a=i.value}t(a)}}}e.assertClass();var n=[];t(e.get("superClass")),r(e.get("decorators"));for(var i=e.get("body.body"),a=i,u=Array.isArray(a),c=0,a=u?a:(0,s.default)(a);;){var f;if(u){if(c>=a.length)break;f=a[c++]}else{if(c=a.next(),c.done)break;f=c.value}var p=f;p.is("computed")&&t(p.get("key")),p.has("decorators")&&r(e.get("decorators"))}n&&e.insertBefore(n.map(function(e){return l.expressionStatement(e)}))};var a=r(315),o=n(a),u=r(1),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(u);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.default=function(e,t){var r=e.node,n=e.scope,i=e.parent,a=n.generateUidIdentifier("step"),o=n.generateUidIdentifier("value"),u=r.left,p=void 0;s.isIdentifier(u)||s.isPattern(u)||s.isMemberExpression(u)?p=s.expressionStatement(s.assignmentExpression("=",u,o)):s.isVariableDeclaration(u)&&(p=s.variableDeclaration(u.kind,[s.variableDeclarator(u.declarations[0].id,o)]));var d=c();(0,l.default)(d,f,null,{ITERATOR_HAD_ERROR_KEY:n.generateUidIdentifier("didIteratorError"),ITERATOR_COMPLETION:n.generateUidIdentifier("iteratorNormalCompletion"),ITERATOR_ERROR_KEY:n.generateUidIdentifier("iteratorError"),ITERATOR_KEY:n.generateUidIdentifier("iterator"),GET_ITERATOR:t.getAsyncIterator,OBJECT:r.right,STEP_VALUE:o,STEP_KEY:a,AWAIT:t.wrapAwait}),d=d.body.body;var h=s.isLabeledStatement(i),m=d[3].block.body,y=m[0];return h&&(m[0]=s.labeledStatement(i.label,y)),{replaceParent:h,node:d,declar:p,loop:y}};var i=r(1),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i),a=r(4),o=n(a),u=r(7),l=n(u),c=(0,o.default)("\n function* wrapper() {\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY = undefined;\n try {\n for (\n var ITERATOR_KEY = GET_ITERATOR(OBJECT), STEP_KEY, STEP_VALUE;\n (\n STEP_KEY = yield AWAIT(ITERATOR_KEY.next()),\n ITERATOR_COMPLETION = STEP_KEY.done,\n STEP_VALUE = yield AWAIT(STEP_KEY.value),\n !ITERATOR_COMPLETION\n );\n ITERATOR_COMPLETION = true) {\n }\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return) {\n yield AWAIT(ITERATOR_KEY.return());\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n }\n"),f={noScope:!0,Identifier:function(e,t){e.node.name in t&&e.replaceInline(t[e.node.name])},CallExpression:function(e,t){var r=e.node.callee;s.isIdentifier(r)&&"AWAIT"===r.name&&!t.AWAIT&&e.replaceWith(e.node.arguments[0])}};e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(4),i=function(e){return e&&e.__esModule?e:{default:e}}(n),s={};t.default=s,s.typeof=(0,i.default)('\n (typeof Symbol === "function" && typeof Symbol.iterator === "symbol")\n ? function (obj) { return typeof obj; }\n : function (obj) {\n return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype\n ? "symbol"\n : typeof obj;\n };\n'),s.jsx=(0,i.default)('\n (function () {\n var REACT_ELEMENT_TYPE = (typeof Symbol === "function" && Symbol.for && Symbol.for("react.element")) || 0xeac7;\n\n return function createRawReactElement (type, props, key, children) {\n var defaultProps = type && type.defaultProps;\n var childrenLength = arguments.length - 3;\n\n if (!props && childrenLength !== 0) {\n // If we\'re going to assign props.children, we create a new object now\n // to avoid mutating defaultProps.\n props = {};\n }\n if (props && defaultProps) {\n for (var propName in defaultProps) {\n if (props[propName] === void 0) {\n props[propName] = defaultProps[propName];\n }\n }\n } else if (!props) {\n props = defaultProps || {};\n }\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 3];\n }\n props.children = childArray;\n }\n\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key === undefined ? null : \'\' + key,\n ref: null,\n props: props,\n _owner: null,\n };\n };\n\n })()\n'),s.asyncIterator=(0,i.default)('\n (function (iterable) {\n if (typeof Symbol === "function") {\n if (Symbol.asyncIterator) {\n var method = iterable[Symbol.asyncIterator];\n if (method != null) return method.call(iterable);\n }\n if (Symbol.iterator) {\n return iterable[Symbol.iterator]();\n }\n }\n throw new TypeError("Object is not async iterable");\n })\n'),s.asyncGenerator=(0,i.default)('\n (function () {\n function AwaitValue(value) {\n this.value = value;\n }\n\n function AsyncGenerator(gen) {\n var front, back;\n\n function send(key, arg) {\n return new Promise(function (resolve, reject) {\n var request = {\n key: key,\n arg: arg,\n resolve: resolve,\n reject: reject,\n next: null\n };\n\n if (back) {\n back = back.next = request;\n } else {\n front = back = request;\n resume(key, arg);\n }\n });\n }\n\n function resume(key, arg) {\n try {\n var result = gen[key](arg)\n var value = result.value;\n if (value instanceof AwaitValue) {\n Promise.resolve(value.value).then(\n function (arg) { resume("next", arg); },\n function (arg) { resume("throw", arg); });\n } else {\n settle(result.done ? "return" : "normal", result.value);\n }\n } catch (err) {\n settle("throw", err);\n }\n }\n\n function settle(type, value) {\n switch (type) {\n case "return":\n front.resolve({ value: value, done: true });\n break;\n case "throw":\n front.reject(value);\n break;\n default:\n front.resolve({ value: value, done: false });\n break;\n }\n\n front = front.next;\n if (front) {\n resume(front.key, front.arg);\n } else {\n back = null;\n }\n }\n\n this._invoke = send;\n\n // Hide "return" method if generator return is not supported\n if (typeof gen.return !== "function") {\n this.return = undefined;\n }\n }\n\n if (typeof Symbol === "function" && Symbol.asyncIterator) {\n AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; };\n }\n\n AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); };\n AsyncGenerator.prototype.throw = function (arg) { return this._invoke("throw", arg); };\n AsyncGenerator.prototype.return = function (arg) { return this._invoke("return", arg); };\n\n return {\n wrap: function (fn) {\n return function () {\n return new AsyncGenerator(fn.apply(this, arguments));\n };\n },\n await: function (value) {\n return new AwaitValue(value);\n }\n };\n\n })()\n'),s.asyncGeneratorDelegate=(0,i.default)('\n (function (inner, awaitWrap) {\n var iter = {}, waiting = false;\n\n function pump(key, value) {\n waiting = true;\n value = new Promise(function (resolve) { resolve(inner[key](value)); });\n return { done: false, value: awaitWrap(value) };\n };\n\n if (typeof Symbol === "function" && Symbol.iterator) {\n iter[Symbol.iterator] = function () { return this; };\n }\n\n iter.next = function (value) {\n if (waiting) {\n waiting = false;\n return value;\n }\n return pump("next", value);\n };\n\n if (typeof inner.throw === "function") {\n iter.throw = function (value) {\n if (waiting) {\n waiting = false;\n throw value;\n }\n return pump("throw", value);\n };\n }\n\n if (typeof inner.return === "function") {\n iter.return = function (value) {\n return pump("return", value);\n };\n }\n\n return iter;\n })\n'),s.asyncToGenerator=(0,i.default)('\n (function (fn) {\n return function () {\n var gen = fn.apply(this, arguments);\n return new Promise(function (resolve, reject) {\n function step(key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n return Promise.resolve(value).then(function (value) {\n step("next", value);\n }, function (err) {\n step("throw", err);\n });\n }\n }\n\n return step("next");\n });\n };\n })\n'),s.classCallCheck=(0,i.default)('\n (function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError("Cannot call a class as a function");\n }\n });\n'),s.createClass=(0,i.default)('\n (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i ++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ("value" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n })()\n'),s.defineEnumerableProperties=(0,i.default)('\n (function (obj, descs) {\n for (var key in descs) {\n var desc = descs[key];\n desc.configurable = desc.enumerable = true;\n if ("value" in desc) desc.writable = true;\n Object.defineProperty(obj, key, desc);\n }\n return obj;\n })\n'),s.defaults=(0,i.default)("\n (function (obj, defaults) {\n var keys = Object.getOwnPropertyNames(defaults);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = Object.getOwnPropertyDescriptor(defaults, key);\n if (value && value.configurable && obj[key] === undefined) {\n Object.defineProperty(obj, key, value);\n }\n }\n return obj;\n })\n"),s.defineProperty=(0,i.default)("\n (function (obj, key, value) {\n // Shortcircuit the slow defineProperty path when possible.\n // We are trying to avoid issues where setters defined on the\n // prototype cause side effects under the fast path of simple\n // assignment. By checking for existence of the property with\n // the in operator, we can optimize most of this overhead away.\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n });\n"),s.extends=(0,i.default)("\n Object.assign || (function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n })\n"),s.get=(0,i.default)('\n (function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if ("value" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n });\n'),s.inherits=(0,i.default)('\n (function (subClass, superClass) {\n if (typeof superClass !== "function" && superClass !== null) {\n throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n })\n'),s.instanceof=(0,i.default)('\n (function (left, right) {\n if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {\n return right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n });\n'),s.interopRequireDefault=(0,i.default)("\n (function (obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n })\n"),s.interopRequireWildcard=(0,i.default)("\n (function (obj) {\n if (obj && obj.__esModule) {\n return obj;\n } else {\n var newObj = {};\n if (obj != null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];\n }\n }\n newObj.default = obj;\n return newObj;\n }\n })\n"),s.newArrowCheck=(0,i.default)('\n (function (innerThis, boundThis) {\n if (innerThis !== boundThis) {\n throw new TypeError("Cannot instantiate an arrow function");\n }\n });\n'),s.objectDestructuringEmpty=(0,i.default)('\n (function (obj) {\n if (obj == null) throw new TypeError("Cannot destructure undefined");\n });\n'),s.objectWithoutProperties=(0,i.default)("\n (function (obj, keys) {\n var target = {};\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n return target;\n })\n"),s.possibleConstructorReturn=(0,i.default)('\n (function (self, call) {\n if (!self) {\n throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");\n }\n return call && (typeof call === "object" || typeof call === "function") ? call : self;\n });\n'),s.selfGlobal=(0,i.default)('\n typeof global === "undefined" ? self : global\n'),s.set=(0,i.default)('\n (function set(object, property, value, receiver) {\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent !== null) {\n set(parent, property, value, receiver);\n }\n } else if ("value" in desc && desc.writable) {\n desc.value = value;\n } else {\n var setter = desc.set;\n\n if (setter !== undefined) {\n setter.call(receiver, value);\n }\n }\n\n return value;\n });\n'),s.slicedToArray=(0,i.default)('\n (function () {\n // Broken out into a separate function to avoid deoptimizations due to the try/catch for the\n // array iterator case.\n function sliceIterator(arr, i) {\n // this is an expanded form of `for...of` that properly supports abrupt completions of\n // iterators etc. variable names have been minimised to reduce the size of this massive\n // helper. sometimes spec compliancy is annoying :(\n //\n // _n = _iteratorNormalCompletion\n // _d = _didIteratorError\n // _e = _iteratorError\n // _i = _iterator\n // _s = _step\n\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i["return"]) _i["return"]();\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError("Invalid attempt to destructure non-iterable instance");\n }\n };\n })();\n'),s.slicedToArrayLoose=(0,i.default)('\n (function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n var _arr = [];\n for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {\n _arr.push(_step.value);\n if (i && _arr.length === i) break;\n }\n return _arr;\n } else {\n throw new TypeError("Invalid attempt to destructure non-iterable instance");\n }\n });\n'),s.taggedTemplateLiteral=(0,i.default)("\n (function (strings, raw) {\n return Object.freeze(Object.defineProperties(strings, {\n raw: { value: Object.freeze(raw) }\n }));\n });\n"),s.taggedTemplateLiteralLoose=(0,i.default)("\n (function (strings, raw) {\n strings.raw = raw;\n return strings;\n });\n"),s.temporalRef=(0,i.default)('\n (function (val, name, undef) {\n if (val === undef) {\n throw new ReferenceError(name + " is not defined - temporal dead zone");\n } else {\n return val;\n }\n })\n'),s.temporalUndefined=(0,i.default)("\n ({})\n"),s.toArray=(0,i.default)("\n (function (arr) {\n return Array.isArray(arr) ? arr : Array.from(arr);\n });\n"),s.toConsumableArray=(0,i.default)("\n (function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n return arr2;\n } else {\n return Array.from(arr);\n }\n });\n"),e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){var t=e.types;return{pre:function(e){e.set("helpersNamespace",t.identifier("babelHelpers"))}}},e.exports=t.default},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(89);e.exports=function(e){var t=e.types,r={};return{visitor:{Identifier:function(e,s){if("MemberExpression"!==e.parent.type&&"ClassMethod"!==e.parent.type&&!e.isPure()&&s.opts.hasOwnProperty(e.node.name)){var a=s.opts[e.node.name];void 0!==a&&null!==a||(a=t.identifier(String(a)));var o=void 0===a?"undefined":n(a);"string"===o||"boolean"===o?a={type:o,replacement:a}:t.isNode(a)?a={type:"node",replacement:a}:"object"===o&&"node"===a.type&&"string"==typeof a.replacement&&(a.replacement=r[a.replacement]?r[a.replacement]:i.parseExpression(a.replacement));var u=a.replacement;switch(a.type){case"boolean":e.replaceWith(t.booleanLiteral(u));break;case"node":t.isNode(u)&&e.replaceWith(u);break;default:var l=String(u);e.replaceWith(t.stringLiteral(l))}}}}}}},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("dynamicImport")}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("functionSent")}}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(){return{inherits:r(67)}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){var t=e.types,n={Function:function(e){e.skip()},YieldExpression:function(e,r){var n=e.node;if(n.delegate){var i=r.addHelper("asyncGeneratorDelegate");n.argument=t.callExpression(i,[t.callExpression(r.addHelper("asyncIterator"),[n.argument]),t.memberExpression(r.addHelper("asyncGenerator"),t.identifier("await"))])}}};return{inherits:r(195),visitor:{Function:function(e,r){e.node.async&&e.node.generator&&(e.traverse(n,r),(0,i.default)(e,r.file,{wrapAsync:t.memberExpression(r.addHelper("asyncGenerator"),t.identifier("wrap")),wrapAwait:t.memberExpression(r.addHelper("asyncGenerator"),t.identifier("await"))}))}}}};var n=r(124),i=function(e){return e&&e.__esModule?e:{default:e}}(n);e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(){return{inherits:r(67),visitor:{Function:function(e,t){e.node.async&&!e.node.generator&&(0,i.default)(e,t.file,{wrapAsync:t.addImport(t.opts.module,t.opts.method)})}}}};var n=r(124),i=function(e){return e&&e.__esModule?e:{default:e}}(n);e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(e,t){if(!t.applyDecoratedDescriptor){t.applyDecoratedDescriptor=e.scope.generateUidIdentifier("applyDecoratedDescriptor");var r=f({NAME:t.applyDecoratedDescriptor});e.scope.getProgramParent().path.unshiftContainer("body",r)}return t.applyDecoratedDescriptor}function n(e,t){if(!t.initializerDefineProp){t.initializerDefineProp=e.scope.generateUidIdentifier("initDefineProp");var r=c({NAME:t.initializerDefineProp});e.scope.getProgramParent().path.unshiftContainer("body",r)}return t.initializerDefineProp}function i(e,t){if(!t.initializerWarningHelper){t.initializerWarningHelper=e.scope.generateUidIdentifier("initializerWarningHelper");var r=l({NAME:t.initializerWarningHelper});e.scope.getProgramParent().path.unshiftContainer("body",r)}return t.initializerWarningHelper}function p(e){var t=(e.isClass()?[e].concat(e.get("body.body")):e.get("properties")).reduce(function(e,t){return e.concat(t.node.decorators||[])},[]),r=t.filter(function(e){return!v.isIdentifier(e.expression)});if(0!==r.length)return v.sequenceExpression(r.map(function(t){var r=t.expression,n=t.expression=e.scope.generateDeclaredUidIdentifier("dec");return v.assignmentExpression("=",n,r)}).concat([e.node]))}function d(e,t){var r=e.node.decorators||[];if(e.node.decorators=null,0!==r.length){var n=e.scope.generateDeclaredUidIdentifier("class");return r.map(function(e){return e.expression}).reverse().reduce(function(e,t){return s({CLASS_REF:n,DECORATOR:t,INNER:e}).expression},e.node)}}function h(e,t){if(e.node.body.body.some(function(e){return(e.decorators||[]).length>0}))return y(e,t,e.node.body.body)}function m(e,t){if(e.node.properties.some(function(e){return(e.decorators||[]).length>0}))return y(e,t,e.node.properties)}function y(e,r,n){var s=(e.scope.generateDeclaredUidIdentifier("desc"),e.scope.generateDeclaredUidIdentifier("value"), e.scope.generateDeclaredUidIdentifier(e.isClass()?"class":"obj")),l=n.reduce(function(n,l){var c=l.decorators||[];if(l.decorators=null,0===c.length)return n;if(l.computed)throw e.buildCodeFrameError("Computed method/property decorators are not yet supported.");var f=v.isLiteral(l.key)?l.key:v.stringLiteral(l.key.name),p=e.isClass()&&!l.static?a({CLASS_REF:s}).expression:s;if(v.isClassProperty(l,{static:!1})){var d=e.scope.generateDeclaredUidIdentifier("descriptor"),h=l.value?v.functionExpression(null,[],v.blockStatement([v.returnStatement(l.value)])):v.nullLiteral();l.value=v.callExpression(i(e,r),[d,v.thisExpression()]),n=n.concat([v.assignmentExpression("=",d,v.callExpression(t(e,r),[p,f,v.arrayExpression(c.map(function(e){return e.expression})),v.objectExpression([v.objectProperty(v.identifier("enumerable"),v.booleanLiteral(!0)),v.objectProperty(v.identifier("initializer"),h)])]))])}else n=n.concat(v.callExpression(t(e,r),[p,f,v.arrayExpression(c.map(function(e){return e.expression})),v.isObjectProperty(l)||v.isClassProperty(l,{static:!0})?u({TEMP:e.scope.generateDeclaredUidIdentifier("init"),TARGET:p,PROPERTY:f}).expression:o({TARGET:p,PROPERTY:f}).expression,p]));return n},[]);return v.sequenceExpression([v.assignmentExpression("=",s,e.node),v.sequenceExpression(l),s])}var v=e.types;return{inherits:r(125),visitor:{ExportDefaultDeclaration:function(e){if(e.get("declaration").isClassDeclaration()){var t=e.node,r=t.declaration.id||e.scope.generateUidIdentifier("default");t.declaration.id=r,e.replaceWith(t.declaration),e.insertAfter(v.exportNamedDeclaration(null,[v.exportSpecifier(r,v.identifier("default"))]))}},ClassDeclaration:function(e){var t=e.node,r=t.id||e.scope.generateUidIdentifier("class");e.replaceWith(v.variableDeclaration("let",[v.variableDeclarator(r,v.toExpression(t))]))},ClassExpression:function(e,t){var r=p(e)||d(e,t)||h(e,t);r&&e.replaceWith(r)},ObjectExpression:function(e,t){var r=p(e)||m(e,t);r&&e.replaceWith(r)},AssignmentExpression:function(e,t){t.initializerWarningHelper&&e.get("left").isMemberExpression()&&e.get("left.property").isIdentifier()&&e.get("right").isCallExpression()&&e.get("right.callee").isIdentifier({name:t.initializerWarningHelper.name})&&e.replaceWith(v.callExpression(n(e,t),[e.get("left.object").node,v.stringLiteral(e.get("left.property").node.name),e.get("right.arguments")[0].node,e.get("right.arguments")[1].node]))}}}};var n=r(4),i=function(e){return e&&e.__esModule?e:{default:e}}(n),s=(0,i.default)("\n DECORATOR(CLASS_REF = INNER) || CLASS_REF;\n"),a=(0,i.default)("\n CLASS_REF.prototype;\n"),o=(0,i.default)("\n Object.getOwnPropertyDescriptor(TARGET, PROPERTY);\n"),u=(0,i.default)("\n (TEMP = Object.getOwnPropertyDescriptor(TARGET, PROPERTY), (TEMP = TEMP ? TEMP.value : undefined), {\n enumerable: true,\n configurable: true,\n writable: true,\n initializer: function(){\n return TEMP;\n }\n })\n"),l=(0,i.default)("\n function NAME(descriptor, context){\n throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');\n }\n"),c=(0,i.default)("\n function NAME(target, property, descriptor, context){\n if (!descriptor) return;\n\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer ? descriptor.initializer.call(context) : void 0,\n });\n }\n"),f=(0,i.default)("\n function NAME(target, property, decorators, descriptor, context){\n var desc = {};\n Object['ke' + 'ys'](descriptor).forEach(function(key){\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n if ('value' in desc || desc.initializer){\n desc.writable = true;\n }\n\n desc = decorators.slice().reverse().reduce(function(desc, decorator){\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0){\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n\n if (desc.initializer === void 0){\n // This is a hack to avoid this being processed by 'transform-runtime'.\n // See issue #9.\n Object['define' + 'Property'](target, property, desc);\n desc = null;\n }\n\n return desc;\n }\n")},function(e,t,r){"use strict";function n(e,t){var r=t._guessExecutionStatusRelativeTo(e);return"before"===r?"inside":"after"===r?"outside":"maybe"}function i(e,t){return o.callExpression(t.addHelper("temporalRef"),[e,o.stringLiteral(e.name),t.addHelper("temporalUndefined")])}function s(e,t,r){var n=r.letReferences[e.name];return!!n&&t.getBindingIdentifier(e.name)===n}t.__esModule=!0,t.visitor=void 0;var a=r(1),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(a);t.visitor={ReferencedIdentifier:function(e,t){if(this.file.opts.tdz){var r=e.node,a=e.parent,u=e.scope;if(!e.parentPath.isFor({left:r})&&s(r,u,t)){var l=u.getBinding(r.name).path,c=n(e,l);if("inside"!==c)if("maybe"===c){var f=i(r,t.file);if(l.parent._tdzThis=!0,e.skip(),e.parentPath.isUpdateExpression()){if(a._ignoreBlockScopingTDZ)return;e.parentPath.replaceWith(o.sequenceExpression([f,a]))}else e.replaceWith(f)}else"outside"===c&&e.replaceWith(o.throwStatement(o.inherits(o.newExpression(o.identifier("ReferenceError"),[o.stringLiteral(r.name+" is not defined - temporal dead zone")]),r)))}}},AssignmentExpression:{exit:function(e,t){if(this.file.opts.tdz){var r=e.node;if(!r._ignoreBlockScopingTDZ){var n=[],a=e.getBindingIdentifiers();for(var u in a){var l=a[u];s(l,e.scope,t)&&n.push(i(l,t.file))}n.length&&(r._ignoreBlockScopingTDZ=!0,n.push(r),e.replaceWithMultiple(n.map(o.expressionStatement)))}}}}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(3),s=n(i),a=r(42),o=n(a),u=r(41),l=n(u),c=r(40),f=n(c),p=r(207),d=n(p),h=r(1),m=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(h),y=function(e){function t(){(0,s.default)(this,t);var r=(0,o.default)(this,e.apply(this,arguments));return r.isLoose=!0,r}return(0,l.default)(t,e),t.prototype._processMethod=function(e,t){if(!e.decorators){var r=this.classRef;e.static||(r=m.memberExpression(r,m.identifier("prototype")));var n=m.memberExpression(r,e.key,e.computed||m.isLiteral(e.key)),i=m.functionExpression(null,e.params,e.body,e.generator,e.async);i.returnType=e.returnType;var s=m.toComputedKey(e,e.key);m.isStringLiteral(s)&&(i=(0,f.default)({node:i,id:s,scope:t}));var a=m.expressionStatement(m.assignmentExpression("=",n,i));return m.inheritsComments(a,e),this.body.push(a),!0}},t}(d.default);t.default=y,e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){var t=e.types;return{visitor:{BinaryExpression:function(e){var r=e.node;"instanceof"===r.operator&&e.replaceWith(t.callExpression(this.addHelper("instanceof"),[r.left,r.right]))}}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){for(var t=e.params,r=Array.isArray(t),n=0,t=r?t:(0,o.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i;if(!m.isIdentifier(s))return!0}return!1}function s(e,t){if(!e.hasOwnBinding(t.name))return!0;var r=e.getOwnBinding(t.name),n=r.kind;return"param"===n||"local"===n}t.__esModule=!0,t.visitor=void 0;var a=r(2),o=n(a),u=r(189),l=n(u),c=r(317),f=n(c),p=r(4),d=n(p),h=r(1),m=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(h),y=(0,d.default)("\n let VARIABLE_NAME =\n ARGUMENTS.length > ARGUMENT_KEY && ARGUMENTS[ARGUMENT_KEY] !== undefined ?\n ARGUMENTS[ARGUMENT_KEY]\n :\n DEFAULT_VALUE;\n"),v=(0,d.default)("\n let $0 = $1[$2];\n"),g={ReferencedIdentifier:function(e,t){var r=e.scope,n=e.node;"eval"!==n.name&&s(r,n)||(t.iife=!0,e.stop())},Scope:function(e){e.skip()}};t.visitor={Function:function(e){var t=e.node,r=e.scope;if(i(t)){e.ensureBlock();var n={iife:!1,scope:r},a=[],o=m.identifier("arguments");o._shadowedFunctionLiteral=e;for(var u=(0,l.default)(t),c=e.get("params"),p=0;p<c.length;p++){var d=c[p];if(d.isAssignmentPattern()){var h=d.get("left"),b=d.get("right");if(p>=u||h.isPattern()){var E=r.generateUidIdentifier("x");E._isDefaultPlaceholder=!0,t.params[p]=E}else t.params[p]=h.node;n.iife||(b.isIdentifier()&&!s(r,b.node)?n.iife=!0:b.traverse(g,n)),function(e,r,n){var i=y({VARIABLE_NAME:e,DEFAULT_VALUE:r,ARGUMENT_KEY:m.numericLiteral(n),ARGUMENTS:o});i._blockHoist=t.params.length-n,a.push(i)}(h.node,b.node,p)}else n.iife||d.isIdentifier()||d.traverse(g,n)}for(var x=u+1;x<t.params.length;x++){var A=t.params[x];if(!A._isDefaultPlaceholder){var S=v(A,o,m.numericLiteral(x));S._blockHoist=t.params.length-x,a.push(S)}}t.params=t.params.slice(0,u),n.iife?(a.push((0,f.default)(e,r)),e.set("body",m.blockStatement(a))):e.get("body").unshiftContainer("body",a)}}}},function(e,t,r){"use strict";t.__esModule=!0,t.visitor=void 0;var n=r(1),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(n);t.visitor={Function:function(e){for(var t=e.get("params"),r=i.isRestElement(t[t.length-1])?1:0,n=t.length-r,s=0;s<n;s++){var a=t[s];if(a.isArrayPattern()||a.isObjectPattern()){var o=e.scope.generateUidIdentifier("ref"),u=i.variableDeclaration("let",[i.variableDeclarator(a.node,o)]);u._blockHoist=n-s,e.ensureBlock(),e.get("body").unshiftContainer("body",u),a.replaceWith(o)}}}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){return p.isRestElement(e.params[e.params.length-1])}function s(e,t,r){var n=void 0;n=p.isNumericLiteral(e.parent.property)?p.numericLiteral(e.parent.property.value+r):0===r?e.parent.property:p.binaryExpression("+",e.parent.property,p.numericLiteral(r));var i=e.scope;if(i.isPure(n))e.parentPath.replaceWith(h({ARGUMENTS:t,INDEX:n}));else{var s=i.generateUidIdentifierBasedOnNode(n);i.push({id:s,kind:"var"}),e.parentPath.replaceWith(m({ARGUMENTS:t,INDEX:n,REF:s}))}}function a(e,t,r){r?e.parentPath.replaceWith(y({ARGUMENTS:t,OFFSET:p.numericLiteral(r)})):e.replaceWith(t)}t.__esModule=!0,t.visitor=void 0;var o=r(2),u=n(o),l=r(4),c=n(l),f=r(1),p=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(f),d=(0,c.default)("\n for (var LEN = ARGUMENTS.length,\n ARRAY = Array(ARRAY_LEN),\n KEY = START;\n KEY < LEN;\n KEY++) {\n ARRAY[ARRAY_KEY] = ARGUMENTS[KEY];\n }\n"),h=(0,c.default)("\n ARGUMENTS.length <= INDEX ? undefined : ARGUMENTS[INDEX]\n"),m=(0,c.default)("\n REF = INDEX, ARGUMENTS.length <= REF ? undefined : ARGUMENTS[REF]\n"),y=(0,c.default)("\n ARGUMENTS.length <= OFFSET ? 0 : ARGUMENTS.length - OFFSET\n"),v={Scope:function(e,t){e.scope.bindingIdentifierEquals(t.name,t.outerBinding)||e.skip()},Flow:function(e){e.isTypeCastExpression()||e.skip()},"Function|ClassProperty":function(e,t){var r=t.noOptimise;t.noOptimise=!0,e.traverse(v,t),t.noOptimise=r,e.skip()},ReferencedIdentifier:function(e,t){var r=e.node;if("arguments"===r.name&&(t.deopted=!0),r.name===t.name)if(t.noOptimise)t.deopted=!0;else{var n=e.parentPath;if("params"===n.listKey&&n.key<t.offset)return;if(n.isMemberExpression({object:r})){var i=n.parentPath,s=!t.deopted&&!(i.isAssignmentExpression()&&n.node===i.node.left||i.isLVal()||i.isForXStatement()||i.isUpdateExpression()||i.isUnaryExpression({operator:"delete"})||(i.isCallExpression()||i.isNewExpression())&&n.node===i.node.callee);if(s)if(n.node.computed){if(n.get("property").isBaseType("number"))return void t.candidates.push({cause:"indexGetter",path:e})}else if("length"===n.node.property.name)return void t.candidates.push({cause:"lengthGetter",path:e})}if(0===t.offset&&n.isSpreadElement()){var a=n.parentPath;if(a.isCallExpression()&&1===a.node.arguments.length)return void t.candidates.push({cause:"argSpread",path:e})}t.references.push(e)}},BindingIdentifier:function(e,t){e.node.name===t.name&&(t.deopted=!0)}};t.visitor={Function:function(e){var t=e.node,r=e.scope;if(i(t)){var n=t.params.pop().argument,o=p.identifier("arguments");o._shadowedFunctionLiteral=e;var l={references:[],offset:t.params.length,argumentsNode:o,outerBinding:r.getBindingIdentifier(n.name),candidates:[],name:n.name,deopted:!1};if(e.traverse(v,l),l.deopted||l.references.length){l.references=l.references.concat(l.candidates.map(function(e){return e.path})),l.deopted=l.deopted||!!t.shadow;var c=p.numericLiteral(t.params.length),f=r.generateUidIdentifier("key"),h=r.generateUidIdentifier("len"),m=f,y=h;t.params.length&&(m=p.binaryExpression("-",f,c),y=p.conditionalExpression(p.binaryExpression(">",h,c),p.binaryExpression("-",h,c),p.numericLiteral(0)));var g=d({ARGUMENTS:o,ARRAY_KEY:m,ARRAY_LEN:y,START:c,ARRAY:n,KEY:f,LEN:h});if(l.deopted)g._blockHoist=t.params.length+1,t.body.body.unshift(g);else{g._blockHoist=1;var b=e.getEarliestCommonAncestorFrom(l.references).getStatementParent();b.findParent(function(e){if(!e.isLoop())return e.isFunction();b=e}),b.insertBefore(g)}}else for(var E=l.candidates,x=Array.isArray(E),A=0,E=x?E:(0,u.default)(E);;){var S;if(x){if(A>=E.length)break;S=E[A++]}else{if(A=E.next(),A.done)break;S=A.value}var _=S,D=_.path,C=_.cause;switch(C){case"indexGetter":s(D,o,l.offset);break;case"lengthGetter":a(D,o,l.offset);break;default:D.replaceWith(o)}}}}}},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){var t=e.types;return{visitor:{MemberExpression:{exit:function(e){var r=e.node,n=r.property;r.computed||!t.isIdentifier(n)||t.isValidIdentifier(n.name)||(r.property=t.stringLiteral(n.name),r.computed=!0)}}}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){var t=e.types;return{visitor:{ObjectProperty:{exit:function(e){var r=e.node,n=r.key;r.computed||!t.isIdentifier(n)||t.isValidIdentifier(n.name)||(r.key=t.stringLiteral(n.name))}}}}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(2),i=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=function(e){var t=e.types;return{visitor:{ObjectExpression:function(e,r){for(var n=e.node,s=!1,o=n.properties,u=Array.isArray(o),l=0,o=u?o:(0,i.default)(o);;){var c;if(u){if(l>=o.length)break;c=o[l++]}else{if(l=o.next(),l.done)break;c=l.value}var f=c;if("get"===f.kind||"set"===f.kind){s=!0;break}}if(s){var p={};n.properties=n.properties.filter(function(e){return!!(e.computed||"get"!==e.kind&&"set"!==e.kind)||(a.push(p,e,null,r),!1)}),e.replaceWith(t.callExpression(t.memberExpression(t.identifier("Object"),t.identifier("defineProperties")),[n,a.toDefineObject(p)]))}}}}};var s=r(188),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s);e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){var t=e.parse,r=e.traverse;return{visitor:{CallExpression:function(e){if(e.get("callee").isIdentifier({name:"eval"})&&1===e.node.arguments.length){var n=e.get("arguments")[0].evaluate();if(!n.confident)return;var i=n.value;if("string"!=typeof i)return;var s=t(i);return r.removeProperties(s),s.program}}}}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){function t(e,t){e.addComment("trailing",n(e,t)),e.replaceWith(i.noop())}function n(e,t){var r=e.getSource().replace(/\*-\//g,"*-ESCAPED/").replace(/\*\//g,"*-/");return t&&t.optional&&(r="?"+r),":"!==r[0]&&(r=":: "+r),r}var i=e.types;return{inherits:r(126),visitor:{TypeCastExpression:function(e){var t=e.node;e.get("expression").addComment("trailing",n(e.get("typeAnnotation"))),e.replaceWith(i.parenthesizedExpression(t.expression))},Identifier:function(e){var t=e.node;t.optional&&!t.typeAnnotation&&e.addComment("trailing",":: ?")},AssignmentPattern:{exit:function(e){e.node.left.optional=!1}},Function:{exit:function(e){e.node.params.forEach(function(e){return e.optional=!1})}},ClassProperty:function(e){var r=e.node,n=e.parent;r.value||t(e,n)},"ExportNamedDeclaration|Flow":function(e){var r=e.node,n=e.parent;i.isExportNamedDeclaration(r)&&!i.isFlow(r.declaration)||t(e,n)},ImportDeclaration:function(e){var r=e.node,n=e.parent;i.isImportDeclaration(r)&&"type"!==r.importKind&&"typeof"!==r.importKind||t(e,n)}}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){var t=e.types;return{visitor:{FunctionExpression:{exit:function(e){var r=e.node;r.id&&(r._ignoreUserWhitespace=!0,e.replaceWith(t.callExpression(t.functionExpression(null,[],t.blockStatement([t.toStatement(r),t.returnStatement(r.id)])),[])))}}}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{visitor:{CallExpression:function(e,t){e.get("callee").matchesPattern("Object.assign")&&(e.node.callee=t.addHelper("extends"))}}}},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(){return{visitor:{CallExpression:function(e,t){e.get("callee").matchesPattern("Object.setPrototypeOf")&&(e.node.callee=t.addHelper("defaults"))}}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),s=n(i);t.default=function(e){function t(e){return i.isLiteral(i.toComputedKey(e,e.key),{value:"__proto__"})}function r(e){var t=e.left;return i.isMemberExpression(t)&&i.isLiteral(i.toComputedKey(t,t.property),{value:"__proto__"})}function n(e,t,r){return i.expressionStatement(i.callExpression(r.addHelper("defaults"),[t,e.right]))}var i=e.types;return{visitor:{AssignmentExpression:function(e,t){if(r(e.node)){var s=[],a=e.node.left.object,o=e.scope.maybeGenerateMemoised(a);o&&s.push(i.expressionStatement(i.assignmentExpression("=",o,a))),s.push(n(e.node,o||a,t)),o&&s.push(o),e.replaceWithMultiple(s)}},ExpressionStatement:function(e,t){var s=e.node.expression;i.isAssignmentExpression(s,{operator:"="})&&r(s)&&e.replaceWith(n(s,s.left.object,t))},ObjectExpression:function(e,r){for(var n=void 0,a=e.node,u=a.properties,l=Array.isArray(u),c=0,u=l?u:(0,s.default)(u);;){var f;if(l){if(c>=u.length)break;f=u[c++]}else{if(c=u.next(),c.done)break;f=c.value}var p=f;t(p)&&(n=p.value,(0,o.default)(a.properties,p))}if(n){var d=[i.objectExpression([]),n];a.properties.length&&d.push(a),e.replaceWith(i.callExpression(r.addHelper("extends"),d))}}}}};var a=r(277),o=n(a);e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(11),i=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=function(e){var t=e.types,r={enter:function(e,r){var n=function(){r.isImmutable=!1,e.stop()};if(e.isJSXClosingElement())return void e.skip();if(e.isJSXIdentifier({name:"ref"})&&e.parentPath.isJSXAttribute({name:e.node}))return n();if(!(e.isJSXIdentifier()||e.isIdentifier()||e.isJSXMemberExpression()||e.isImmutable())){if(e.isPure()){var s=e.evaluate();if(s.confident){var a=s.value;if(!(a&&"object"===(void 0===a?"undefined":(0,i.default)(a))||"function"==typeof a))return}else if(t.isIdentifier(s.deopt))return}n()}}};return{visitor:{JSXElement:function(e){if(!e.node._hoisted){var t={isImmutable:!0};e.traverse(r,t),t.isImmutable?e.hoist():e.node._hoisted=!0}}}}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(2),i=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=function(e){function t(e){for(var t=0;t<e.length;t++){var n=e[t];if(s.isJSXSpreadAttribute(n))return!0;if(r(n,"ref"))return!0}return!1}function r(e,t){return s.isJSXAttribute(e)&&s.isJSXIdentifier(e.name,{name:t})}function n(e){var t=e.value;return t?(s.isJSXExpressionContainer(t)&&(t=t.expression),t):s.identifier("true")}var s=e.types;return{visitor:{JSXElement:function(e,a){var o=e.node,u=o.openingElement;if(!t(u.attributes)){var l=s.objectExpression([]),c=null,f=u.name;s.isJSXIdentifier(f)&&s.react.isCompatTag(f.name)&&(f=s.stringLiteral(f.name));for(var p=u.attributes,d=Array.isArray(p),h=0,p=d?p:(0,i.default)(p);;){var m;if(d){if(h>=p.length)break;m=p[h++]}else{if(h=p.next(),h.done)break;m=h.value}var y=m;if(r(y,"key"))c=n(y);else{var v=y.name.name,g=s.isValidIdentifier(v)?s.identifier(v):s.stringLiteral(v);!function(e,t,r){e.push(s.objectProperty(t,r))}(l.properties,g,n(y))}}var b=[f,l];if(c||o.children.length){var E=s.react.buildChildren(o);b.push.apply(b,[c||s.unaryExpression("void",s.numericLiteral(0),!0)].concat(E))}var x=s.callExpression(a.addHelper("jsx"),b);e.replaceWith(x)}}}}},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){var t=e.types;return{manipulateOptions:function(e,t){t.plugins.push("jsx")},visitor:(0,i.default)({pre:function(e){e.callee=e.tagExpr},post:function(e){t.react.isCompatTag(e.tagName)&&(e.call=t.callExpression(t.memberExpression(t.memberExpression(t.identifier("React"),t.identifier("DOM")),e.tagExpr,t.isLiteral(e.tagExpr)),e.args))}})}};var n=r(348),i=function(e){return e&&e.__esModule?e:{default:e}}(n);e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){function t(e,r){if(a.isJSXIdentifier(e)){if("this"===e.name&&a.isReferenced(e,r))return a.thisExpression();if(!i.default.keyword.isIdentifierNameES6(e.name))return a.stringLiteral(e.name);e.type="Identifier"}else if(a.isJSXMemberExpression(e))return a.memberExpression(t(e.object,e),t(e.property,e));return e}function r(e){return a.isJSXExpressionContainer(e)?e.expression:e}function n(e){var t=r(e.value||a.booleanLiteral(!0));return a.isStringLiteral(t)&&!a.isJSXExpressionContainer(e.value)&&(t.value=t.value.replace(/\n\s+/g," ")),a.isValidIdentifier(e.name.name)?e.name.type="Identifier":e.name=a.stringLiteral(e.name.name),a.inherits(a.objectProperty(e.name,t),e)}function s(r,n){r.parent.children=a.react.buildChildren(r.parent);var i=t(r.node.name,r.node),s=[],u=void 0;a.isIdentifier(i)?u=i.name:a.isLiteral(i)&&(u=i.value);var l={tagExpr:i,tagName:u,args:s};e.pre&&e.pre(l,n);var c=r.node.attributes;return c=c.length?o(c,n):a.nullLiteral(),s.push(c),e.post&&e.post(l,n),l.call||a.callExpression(l.callee,s)}function o(e,t){function r(){i.length&&(s.push(a.objectExpression(i)),i=[])}var i=[],s=[],o=t.opts.useBuiltIns||!1;if("boolean"!=typeof o)throw new Error("transform-react-jsx currently only accepts a boolean option for useBuiltIns (defaults to false)");for(;e.length;){var u=e.shift();a.isJSXSpreadAttribute(u)?(r(),s.push(u.argument)):i.push(n(u))}if(r(),1===s.length)e=s[0];else{a.isObjectExpression(s[0])||s.unshift(a.objectExpression([]));var l=o?a.memberExpression(a.identifier("Object"),a.identifier("assign")):t.addHelper("extends");e=a.callExpression(l,s)}return e}var u={};return u.JSXNamespacedName=function(e){throw e.buildCodeFrameError("Namespace tags are not supported. ReactJSX is not XML.")},u.JSXElement={exit:function(e,t){var r=s(e.get("openingElement"),t);r.arguments=r.arguments.concat(e.node.children),r.arguments.length>=3&&(r._prettyCall=!0),e.replaceWith(a.inherits(r,e.node))}},u};var n=r(97),i=function(e){return e&&e.__esModule?e:{default:e}}(n),s=r(1),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s);e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){var t=e.types;return{visitor:{JSXOpeningElement:function(e){var n=e.node,i=t.jSXIdentifier(r),s=t.thisExpression();n.attributes.push(t.jSXAttribute(i,t.jSXExpressionContainer(s)))}}}};var r="__self";e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){function t(e,t){var r=null!=t?i.numericLiteral(t):i.nullLiteral(),n=i.objectProperty(i.identifier("fileName"),e),s=i.objectProperty(i.identifier("lineNumber"),r);return i.objectExpression([n,s])}var i=e.types;return{visitor:{JSXOpeningElement:function(e,s){var a=i.jSXIdentifier(r),o=e.container.openingElement.loc;if(o){for(var u=e.container.openingElement.attributes,l=0;l<u.length;l++){var c=u[l].name;if(c&&c.name===r)return}if(!s.fileNameIdentifier){var f="unknown"!==s.file.log.filename?s.file.log.filename:null,p=e.scope.generateUidIdentifier(n);e.hub.file.scope.push({id:p,init:i.stringLiteral(f)}),s.fileNameIdentifier=p}var d=t(s.fileNameIdentifier,o.start.line);u.push(i.jSXAttribute(a,i.jSXExpressionContainer(d)))}}}}};var r="__source",n="_jsxFileName";e.exports=t.default},348,function(e,t){"use strict";e.exports={builtins:{Symbol:"symbol",Promise:"promise",Map:"map",WeakMap:"weak-map",Set:"set",WeakSet:"weak-set",Observable:"observable",setImmediate:"set-immediate",clearImmediate:"clear-immediate",asap:"asap"},methods:{Array:{concat:"array/concat",copyWithin:"array/copy-within",entries:"array/entries",every:"array/every",fill:"array/fill",filter:"array/filter",findIndex:"array/find-index",find:"array/find",forEach:"array/for-each",from:"array/from",includes:"array/includes",indexOf:"array/index-of",join:"array/join",keys:"array/keys",lastIndexOf:"array/last-index-of",map:"array/map",of:"array/of",pop:"array/pop",push:"array/push",reduceRight:"array/reduce-right",reduce:"array/reduce",reverse:"array/reverse",shift:"array/shift",slice:"array/slice",some:"array/some",sort:"array/sort",splice:"array/splice",unshift:"array/unshift",values:"array/values"},JSON:{stringify:"json/stringify"},Object:{assign:"object/assign",create:"object/create",defineProperties:"object/define-properties",defineProperty:"object/define-property",entries:"object/entries",freeze:"object/freeze",getOwnPropertyDescriptor:"object/get-own-property-descriptor",getOwnPropertyDescriptors:"object/get-own-property-descriptors",getOwnPropertyNames:"object/get-own-property-names",getOwnPropertySymbols:"object/get-own-property-symbols",getPrototypeOf:"object/get-prototype-of",isExtensible:"object/is-extensible",isFrozen:"object/is-frozen",isSealed:"object/is-sealed",is:"object/is",keys:"object/keys",preventExtensions:"object/prevent-extensions",seal:"object/seal",setPrototypeOf:"object/set-prototype-of",values:"object/values"},RegExp:{escape:"regexp/escape"},Math:{acosh:"math/acosh",asinh:"math/asinh",atanh:"math/atanh",cbrt:"math/cbrt",clz32:"math/clz32",cosh:"math/cosh",expm1:"math/expm1",fround:"math/fround",hypot:"math/hypot",imul:"math/imul",log10:"math/log10",log1p:"math/log1p",log2:"math/log2",sign:"math/sign",sinh:"math/sinh",tanh:"math/tanh",trunc:"math/trunc",iaddh:"math/iaddh",isubh:"math/isubh",imulh:"math/imulh",umulh:"math/umulh"},Symbol:{for:"symbol/for",hasInstance:"symbol/has-instance",isConcatSpreadable:"symbol/is-concat-spreadable",iterator:"symbol/iterator",keyFor:"symbol/key-for",match:"symbol/match",replace:"symbol/replace",search:"symbol/search",species:"symbol/species",split:"symbol/split",toPrimitive:"symbol/to-primitive",toStringTag:"symbol/to-string-tag",unscopables:"symbol/unscopables"},String:{at:"string/at",codePointAt:"string/code-point-at",endsWith:"string/ends-with",fromCodePoint:"string/from-code-point",includes:"string/includes",matchAll:"string/match-all",padLeft:"string/pad-left",padRight:"string/pad-right",padStart:"string/pad-start",padEnd:"string/pad-end",raw:"string/raw",repeat:"string/repeat",startsWith:"string/starts-with",trim:"string/trim",trimLeft:"string/trim-left",trimRight:"string/trim-right",trimStart:"string/trim-start",trimEnd:"string/trim-end"},Number:{EPSILON:"number/epsilon",isFinite:"number/is-finite",isInteger:"number/is-integer",isNaN:"number/is-nan",isSafeInteger:"number/is-safe-integer",MAX_SAFE_INTEGER:"number/max-safe-integer",MIN_SAFE_INTEGER:"number/min-safe-integer",parseFloat:"number/parse-float",parseInt:"number/parse-int"},Reflect:{apply:"reflect/apply",construct:"reflect/construct",defineProperty:"reflect/define-property",deleteProperty:"reflect/delete-property",enumerate:"reflect/enumerate",getOwnPropertyDescriptor:"reflect/get-own-property-descriptor",getPrototypeOf:"reflect/get-prototype-of",get:"reflect/get",has:"reflect/has",isExtensible:"reflect/is-extensible",ownKeys:"reflect/own-keys",preventExtensions:"reflect/prevent-extensions",setPrototypeOf:"reflect/set-prototype-of",set:"reflect/set",defineMetadata:"reflect/define-metadata",deleteMetadata:"reflect/delete-metadata",getMetadata:"reflect/get-metadata",getMetadataKeys:"reflect/get-metadata-keys",getOwnMetadata:"reflect/get-own-metadata",getOwnMetadataKeys:"reflect/get-own-metadata-keys",hasMetadata:"reflect/has-metadata",hasOwnMetadata:"reflect/has-own-metadata",metadata:"reflect/metadata"},System:{global:"system/global"},Error:{isError:"error/is-error"},Date:{},Function:{}}}},function(e,t,r){"use strict";t.__esModule=!0,t.definitions=void 0,t.default=function(e){function t(e){return e.moduleName||"babel-runtime"}function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var n=e.types,s=["interopRequireWildcard","interopRequireDefault"];return{pre:function(e){var r=t(this.opts);!1!==this.opts.helpers&&e.set("helperGenerator",function(t){if(s.indexOf(t)<0)return e.addImport(r+"/helpers/"+t,"default",t)}),this.setDynamic("regeneratorIdentifier",function(){return e.addImport(r+"/regenerator","default","regeneratorRuntime")})},visitor:{ReferencedIdentifier:function(e,s){var a=e.node,o=e.parent,u=e.scope;if("regeneratorRuntime"===a.name&&!1!==s.opts.regenerator)return void e.replaceWith(s.get("regeneratorIdentifier"));if(!1!==s.opts.polyfill&&!n.isMemberExpression(o)&&r(i.default.builtins,a.name)&&!u.getBindingIdentifier(a.name)){var l=t(s.opts);e.replaceWith(s.addImport(l+"/core-js/"+i.default.builtins[a.name],"default",a.name))}},CallExpression:function(e,r){if(!1!==r.opts.polyfill&&!e.node.arguments.length){var i=e.node.callee;if(n.isMemberExpression(i)&&i.computed&&e.get("callee.property").matchesPattern("Symbol.iterator")){var s=t(r.opts);e.replaceWith(n.callExpression(r.addImport(s+"/core-js/get-iterator","default","getIterator"),[i.object]))}}},BinaryExpression:function(e,r){if(!1!==r.opts.polyfill&&"in"===e.node.operator&&e.get("left").matchesPattern("Symbol.iterator")){var i=t(r.opts);e.replaceWith(n.callExpression(r.addImport(i+"/core-js/is-iterable","default","isIterable"),[e.node.right]))}},MemberExpression:{enter:function(e,s){if(!1!==s.opts.polyfill&&e.isReferenced()){var a=e.node,o=a.object,u=a.property;if(n.isReferenced(o,a)&&!a.computed&&r(i.default.methods,o.name)){var l=i.default.methods[o.name];if(r(l,u.name)&&!e.scope.getBindingIdentifier(o.name)){if("Object"===o.name&&"defineProperty"===u.name&&e.parentPath.isCallExpression()){var c=e.parentPath.node;if(3===c.arguments.length&&n.isLiteral(c.arguments[1]))return}var f=t(s.opts);e.replaceWith(s.addImport(f+"/core-js/"+l[u.name],"default",o.name+"$"+u.name))}}}},exit:function(e,s){if(!1!==s.opts.polyfill&&e.isReferenced()){var a=e.node,o=a.object;if(r(i.default.builtins,o.name)&&!e.scope.getBindingIdentifier(o.name)){var u=t(s.opts);e.replaceWith(n.memberExpression(s.addImport(u+"/core-js/"+i.default.builtins[o.name],"default",o.name),a.property,a.computed))}}}}}}};var n=r(352),i=function(e){return e&&e.__esModule?e:{default:e}}(n);t.definitions=i.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e){var t=e.messages;return{visitor:{ReferencedIdentifier:function(e){var r=e.node,n=e.scope,s=n.getBinding(r.name) ;if(s&&"type"===s.kind&&!e.parentPath.isFlow())throw e.buildCodeFrameError(t.get("undeclaredVariableType",r.name),ReferenceError);if(!n.hasBinding(r.name)){var a=n.getAllBindings(),o=void 0,u=-1;for(var l in a){var c=(0,i.default)(r.name,l);c<=0||c>3||(c<=u||(o=l,u=c))}var f=void 0;throw f=o?t.get("undeclaredVariableSuggestion",r.name,o):t.get("undeclaredVariable",r.name),e.buildCodeFrameError(f,ReferenceError)}}}}};var n=r(471),i=function(e){return e&&e.__esModule?e:{default:e}}(n);e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(211),i=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default={plugins:[i.default]},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{presets:[!1!==t.es2015&&[s.default.buildPreset,t.es2015],!1!==t.es2016&&o.default,!1!==t.es2017&&l.default].filter(Boolean)}};var i=r(217),s=n(i),a=r(218),o=n(a),u=r(219),l=n(u);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(355),s=n(i),a=r(215),o=n(a),u=r(127),l=n(u),c=r(214),f=n(c);t.default={presets:[s.default],plugins:[o.default,l.default,f.default],env:{development:{plugins:[]}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(220),s=n(i),a=r(206),o=n(a),u=r(212),l=n(u);t.default={presets:[s.default],plugins:[o.default,l.default]},e.exports=t.default},function(e,t,r){"use strict";e.exports={default:r(407),__esModule:!0}},function(e,t,r){"use strict";e.exports={default:r(410),__esModule:!0}},function(e,t,r){"use strict";e.exports={default:r(412),__esModule:!0}},function(e,t,r){"use strict";e.exports={default:r(413),__esModule:!0}},function(e,t,r){"use strict";e.exports={default:r(415),__esModule:!0}},function(e,t,r){"use strict";e.exports={default:r(416),__esModule:!0}},function(e,t,r){"use strict";e.exports={default:r(417),__esModule:!0}},function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),s=n(i),a=r(3),o=n(a),u=r(36),l=n(u),c=r(1),f=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(c),p=function(){function e(t,r,n,i){(0,o.default)(this,e),this.queue=null,this.parentPath=i,this.scope=t,this.state=n,this.opts=r}return e.prototype.shouldVisit=function(e){var t=this.opts;if(t.enter||t.exit)return!0;if(t[e.type])return!0;var r=f.VISITOR_KEYS[e.type];if(!r||!r.length)return!1;for(var n=r,i=Array.isArray(n),a=0,n=i?n:(0,s.default)(n);;){var o;if(i){if(a>=n.length)break;o=n[a++]}else{if(a=n.next(),a.done)break;o=a.value}if(e[o])return!0}return!1},e.prototype.create=function(e,t,r,n){return l.default.get({parentPath:this.parentPath,parent:e,container:t,key:r,listKey:n})},e.prototype.maybeQueue=function(e,t){if(this.trap)throw new Error("Infinite cycle detected");this.queue&&(t?this.queue.push(e):this.priorityQueue.push(e))},e.prototype.visitMultiple=function(e,t,r){if(0===e.length)return!1;for(var n=[],i=0;i<e.length;i++){var s=e[i];s&&this.shouldVisit(s)&&n.push(this.create(t,e,i,r))}return this.visitQueue(n)},e.prototype.visitSingle=function(e,t){return!!this.shouldVisit(e[t])&&this.visitQueue([this.create(e,e,t)])},e.prototype.visitQueue=function(e){this.queue=e,this.priorityQueue=[];for(var t=[],r=!1,n=e,i=Array.isArray(n),a=0,n=i?n:(0,s.default)(n);;){var o;if(i){if(a>=n.length)break;o=n[a++]}else{if(a=n.next(),a.done)break;o=a.value}var u=o;if(u.resync(),0!==u.contexts.length&&u.contexts[u.contexts.length-1]===this||u.pushContext(this),null!==u.key&&!(t.indexOf(u.node)>=0)){if(t.push(u.node),u.visit()){r=!0;break}if(this.priorityQueue.length&&(r=this.visitQueue(this.priorityQueue),this.priorityQueue=[],this.queue=e,r))break}}for(var l=e,c=Array.isArray(l),f=0,l=c?l:(0,s.default)(l);;){var p;if(c){if(f>=l.length)break;p=l[f++]}else{if(f=l.next(),f.done)break;p=f.value}p.popContext()}return this.queue=null,r},e.prototype.visit=function(e,t){var r=e[t];return!!r&&(Array.isArray(r)?this.visitMultiple(r,e,t):this.visitSingle(e,t))},e}();t.default=p,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){for(var t=this;t=t.parentPath;)if(e(t))return t;return null}function s(e){var t=this;do{if(e(t))return t}while(t=t.parentPath);return null}function a(){return this.findParent(function(e){return e.isFunction()||e.isProgram()})}function o(){var e=this;do{if(Array.isArray(e.container))return e}while(e=e.parentPath)}function u(e){return this.getDeepestCommonAncestorFrom(e,function(e,t,r){for(var n=void 0,i=g.VISITOR_KEYS[e.type],s=r,a=Array.isArray(s),o=0,s=a?s:(0,y.default)(s);;){var u;if(a){if(o>=s.length)break;u=s[o++]}else{if(o=s.next(),o.done)break;u=o.value}var l=u,c=l[t+1];if(n)if(c.listKey&&n.listKey===c.listKey&&c.key<n.key)n=c;else{var f=i.indexOf(n.parentKey),p=i.indexOf(c.parentKey);f>p&&(n=c)}else n=c}return n})}function l(e,t){var r=this;if(!e.length)return this;if(1===e.length)return e[0];var n=1/0,i=void 0,s=void 0,a=e.map(function(e){var t=[];do{t.unshift(e)}while((e=e.parentPath)&&e!==r);return t.length<n&&(n=t.length),t}),o=a[0];e:for(var u=0;u<n;u++){for(var l=o[u],c=a,f=Array.isArray(c),p=0,c=f?c:(0,y.default)(c);;){var d;if(f){if(p>=c.length)break;d=c[p++]}else{if(p=c.next(),p.done)break;d=p.value}var h=d;if(h[u]!==l)break e}i=u,s=l}if(s)return t?t(s,i,a):s;throw new Error("Couldn't find intersection")}function c(){var e=this,t=[];do{t.push(e)}while(e=e.parentPath);return t}function f(e){return e.isDescendant(this)}function p(e){return!!this.findParent(function(t){return t===e})}function d(){for(var e=this;e;){for(var t=arguments,r=Array.isArray(t),n=0,t=r?t:(0,y.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i;if(e.node.type===s)return!0}e=e.parentPath}return!1}function h(e){var t=this.isFunction()?this:this.findParent(function(e){return e.isFunction()});if(t){if(t.isFunctionExpression()||t.isFunctionDeclaration()){var r=t.node.shadow;if(r&&(!e||!1!==r[e]))return t}else if(t.isArrowFunctionExpression())return t;return null}}t.__esModule=!0;var m=r(2),y=n(m);t.findParent=i,t.find=s,t.getFunctionParent=a,t.getStatementParent=o,t.getEarliestCommonAncestorFrom=u,t.getDeepestCommonAncestorFrom=l,t.getAncestry=c,t.isAncestor=f,t.isDescendant=p,t.inType=d,t.inShadow=h;var v=r(1),g=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(v),b=r(36);n(b)},function(e,t){"use strict";function r(){if("string"!=typeof this.key){var e=this.node;if(e){var t=e.trailingComments,r=e.leadingComments;if(t||r){var n=this.getSibling(this.key-1),i=this.getSibling(this.key+1);n.node||(n=i),i.node||(i=n),n.addComments("trailing",r),i.addComments("leading",t)}}}}function n(e,t,r){this.addComments(e,[{type:r?"CommentLine":"CommentBlock",value:t}])}function i(e,t){if(t){var r=this.node;if(r){var n=e+"Comments";r[n]?r[n]=r[n].concat(t):r[n]=t}}}t.__esModule=!0,t.shareCommentsWithSiblings=r,t.addComment=n,t.addComments=i},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=this.opts;return this.debug(function(){return e}),!(!this.node||!this._call(t[e]))||!!this.node&&this._call(t[this.node.type]&&t[this.node.type][e])}function s(e){if(!e)return!1;for(var t=e,r=Array.isArray(t),n=0,t=r?t:(0,D.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i;if(s){var a=this.node;if(!a)return!0;if(s.call(this.state,this,this.state))throw new Error("Unexpected return value from visitor method "+s);if(this.node!==a)return!0;if(this.shouldStop||this.shouldSkip||this.removed)return!0}}return!1}function a(){var e=this.opts.blacklist;return e&&e.indexOf(this.node.type)>-1}function o(){return!!this.node&&(!this.isBlacklisted()&&((!this.opts.shouldSkip||!this.opts.shouldSkip(this))&&(this.call("enter")||this.shouldSkip?(this.debug(function(){return"Skip..."}),this.shouldStop):(this.debug(function(){return"Recursing into..."}),w.default.node(this.node,this.opts,this.scope,this.state,this,this.skipKeys),this.call("exit"),this.shouldStop))))}function u(){this.shouldSkip=!0}function l(e){this.skipKeys[e]=!0}function c(){this.shouldStop=!0,this.shouldSkip=!0}function f(){if(!this.opts||!this.opts.noScope){var e=this.context&&this.context.scope;if(!e)for(var t=this.parentPath;t&&!e;){if(t.opts&&t.opts.noScope)return;e=t.scope,t=t.parentPath}this.scope=this.getScope(e),this.scope&&this.scope.init()}}function p(e){return this.shouldSkip=!1,this.shouldStop=!1,this.removed=!1,this.skipKeys={},e&&(this.context=e,this.state=e.state,this.opts=e.opts),this.setScope(),this}function d(){this.removed||(this._resyncParent(),this._resyncList(),this._resyncKey())}function h(){this.parentPath&&(this.parent=this.parentPath.node)}function m(){if(this.container&&this.node!==this.container[this.key]){if(Array.isArray(this.container)){for(var e=0;e<this.container.length;e++)if(this.container[e]===this.node)return this.setKey(e)}else for(var t in this.container)if(this.container[t]===this.node)return this.setKey(t);this.key=null}}function y(){if(this.parent&&this.inList){var e=this.parent[this.listKey];this.container!==e&&(this.container=e||null)}}function v(){null!=this.key&&this.container&&this.container[this.key]===this.node||this._markRemoved()}function g(){this.contexts.pop(),this.setContext(this.contexts[this.contexts.length-1])}function b(e){this.contexts.push(e),this.setContext(e)}function E(e,t,r,n){this.inList=!!r,this.listKey=r,this.parentKey=r||n,this.container=t,this.parentPath=e||this.parentPath,this.setKey(n)}function x(e){this.key=e,this.node=this.container[this.key],this.type=this.node&&this.node.type}function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;if(!e.removed)for(var t=this.contexts,r=t,n=Array.isArray(r),i=0,r=n?r:(0,D.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var a=s;a.maybeQueue(e)}}function S(){for(var e=this,t=this.contexts;!t.length;)e=e.parentPath,t=e.contexts;return t}t.__esModule=!0;var _=r(2),D=n(_);t.call=i,t._call=s,t.isBlacklisted=a,t.visit=o,t.skip=u,t.skipKey=l,t.stop=c,t.setScope=f,t.setContext=p,t.resync=d,t._resyncParent=h,t._resyncKey=m,t._resyncList=y,t._resyncRemoved=v,t.popContext=g,t.pushContext=b,t.setup=E,t.setKey=x,t.requeue=A,t._getQueueContexts=S;var C=r(7),w=n(C)},function(e,t,r){"use strict";function n(){var e=this.node,t=void 0;if(this.isMemberExpression())t=e.property;else{if(!this.isProperty()&&!this.isMethod())throw new ReferenceError("todo");t=e.key}return e.computed||o.isIdentifier(t)&&(t=o.stringLiteral(t.name)),t}function i(){return o.ensureBlock(this.node)}function s(){if(this.isArrowFunctionExpression()){this.ensureBlock();var e=this.node;e.expression=!1,e.type="FunctionExpression",e.shadow=e.shadow||!0}}t.__esModule=!0,t.toComputedKey=n,t.ensureBlock=i,t.arrowFunctionToShadowed=s;var a=r(1),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(a)},function(e,t,r){(function(e){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(){var e=this.evaluate();if(e.confident)return!!e.value}function s(){function t(e){i&&(s=e,i=!1)}function r(e){var r=e.node;if(a.has(r)){var s=a.get(r);return s.resolved?s.value:void t(e)}var o={resolved:!1};a.set(r,o);var u=n(e);return i&&(o.resolved=!0,o.value=u),u}function n(n){if(i){var s=n.node;if(n.isSequenceExpression()){var a=n.get("expressions");return r(a[a.length-1])}if(n.isStringLiteral()||n.isNumericLiteral()||n.isBooleanLiteral())return s.value;if(n.isNullLiteral())return null;if(n.isTemplateLiteral()){for(var u="",c=0,f=n.get("expressions"),h=s.quasis,m=Array.isArray(h),y=0,h=m?h:(0,l.default)(h);;){var v;if(m){if(y>=h.length)break;v=h[y++]}else{if(y=h.next(),y.done)break;v=y.value}var g=v;if(!i)break;u+=g.value.cooked;var b=f[c++];b&&(u+=String(r(b)))}if(!i)return;return u}if(n.isConditionalExpression()){var E=r(n.get("test"));if(!i)return;return r(E?n.get("consequent"):n.get("alternate"))}if(n.isExpressionWrapper())return r(n.get("expression"));if(n.isMemberExpression()&&!n.parentPath.isCallExpression({callee:s})){var x=n.get("property"),A=n.get("object");if(A.isLiteral()&&x.isIdentifier()){var S=A.node.value,_=void 0===S?"undefined":(0,o.default)(S);if("number"===_||"string"===_)return S[x.node.name]}}if(n.isReferencedIdentifier()){var D=n.scope.getBinding(s.name);if(D&&D.constantViolations.length>0)return t(D.path);if(D&&n.node.start<D.path.node.end)return t(D.path);if(D&&D.hasValue)return D.value;if("undefined"===s.name)return D?t(D.path):void 0;if("Infinity"===s.name)return D?t(D.path):1/0;if("NaN"===s.name)return D?t(D.path):NaN;var C=n.resolve();return C===n?t(n):r(C)}if(n.isUnaryExpression({prefix:!0})){if("void"===s.operator)return;var w=n.get("argument");if("typeof"===s.operator&&(w.isFunction()||w.isClass()))return"function";var P=r(w);if(!i)return;switch(s.operator){case"!":return!P;case"+":return+P;case"-":return-P;case"~":return~P;case"typeof":return void 0===P?"undefined":(0,o.default)(P)}}if(n.isArrayExpression()){for(var k=[],F=n.get("elements"),T=F,O=Array.isArray(T),B=0,T=O?T:(0,l.default)(T);;){var R;if(O){if(B>=T.length)break;R=T[B++]}else{if(B=T.next(),B.done)break;R=B.value}var I=R;if(I=I.evaluate(),!I.confident)return t(I);k.push(I.value)}return k}if(n.isObjectExpression()){for(var M={},N=n.get("properties"),L=N,j=Array.isArray(L),U=0,L=j?L:(0,l.default)(L);;){var V;if(j){if(U>=L.length)break;V=L[U++]}else{if(U=L.next(),U.done)break;V=U.value}var G=V;if(G.isObjectMethod()||G.isSpreadProperty())return t(G);var W=G.get("key"),Y=W;if(G.node.computed){if(Y=Y.evaluate(),!Y.confident)return t(W);Y=Y.value}else Y=Y.isIdentifier()?Y.node.name:Y.node.value;var q=G.get("value"),K=q.evaluate();if(!K.confident)return t(q);K=K.value,M[Y]=K}return M}if(n.isLogicalExpression()){var H=i,J=r(n.get("left")),X=i;i=H;var z=r(n.get("right")),$=i;switch(i=X&&$,s.operator){case"||":if(J&&X)return i=!0,J;if(!i)return;return J||z;case"&&":if((!J&&X||!z&&$)&&(i=!0),!i)return;return J&&z}}if(n.isBinaryExpression()){var Q=r(n.get("left"));if(!i)return;var Z=r(n.get("right"));if(!i)return;switch(s.operator){case"-":return Q-Z;case"+":return Q+Z;case"/":return Q/Z;case"*":return Q*Z;case"%":return Q%Z;case"**":return Math.pow(Q,Z);case"<":return Q<Z;case">":return Q>Z;case"<=":return Q<=Z;case">=":return Q>=Z;case"==":return Q==Z;case"!=":return Q!=Z;case"===":return Q===Z;case"!==":return Q!==Z;case"|":return Q|Z;case"&":return Q&Z;case"^":return Q^Z;case"<<":return Q<<Z;case">>":return Q>>Z;case">>>":return Q>>>Z}}if(n.isCallExpression()){var ee=n.get("callee"),te=void 0,re=void 0;if(ee.isIdentifier()&&!n.scope.getBinding(ee.node.name,!0)&&p.indexOf(ee.node.name)>=0&&(re=e[s.callee.name]),ee.isMemberExpression()){var ne=ee.get("object"),ie=ee.get("property");if(ne.isIdentifier()&&ie.isIdentifier()&&p.indexOf(ne.node.name)>=0&&d.indexOf(ie.node.name)<0&&(te=e[ne.node.name],re=te[ie.node.name]),ne.isLiteral()&&ie.isIdentifier()){var se=(0,o.default)(ne.node.value);"string"!==se&&"number"!==se||(te=ne.node.value,re=te[ie.node.name])}}if(re){var ae=n.get("arguments").map(r);if(!i)return;return re.apply(te,ae)}}t(n)}}var i=!0,s=void 0,a=new f.default,u=r(this);return i||(u=void 0),{confident:i,deopt:s,value:u}}t.__esModule=!0;var a=r(11),o=n(a),u=r(2),l=n(u),c=r(133),f=n(c);t.evaluateTruthy=i,t.evaluate=s;var p=["String","Number","Math"],d=["random"]}).call(t,function(){return this}())},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(){var e=this;do{if(!e.parentPath||Array.isArray(e.container)&&e.isStatement())break;e=e.parentPath}while(e);if(e&&(e.isProgram()||e.isFile()))throw new Error("File/Program node, we can't possibly find a statement parent to this");return e}function s(){return"left"===this.key?this.getSibling("right"):"right"===this.key?this.getSibling("left"):void 0}function a(){var e=[],t=function(t){t&&(e=e.concat(t.getCompletionRecords()))};if(this.isIfStatement())t(this.get("consequent")),t(this.get("alternate"));else if(this.isDoExpression()||this.isFor()||this.isWhile())t(this.get("body"));else if(this.isProgram()||this.isBlockStatement())t(this.get("body").pop());else{if(this.isFunction())return this.get("body").getCompletionRecords();this.isTryStatement()?(t(this.get("block")),t(this.get("handler")),t(this.get("finalizer"))):e.push(this)}return e}function o(e){return _.default.get({parentPath:this.parentPath,parent:this.parent,container:this.container,listKey:this.listKey,key:e})}function u(){return this.getSibling(this.key-1)}function l(){return this.getSibling(this.key+1)}function c(){for(var e=this.key,t=this.getSibling(++e),r=[];t.node;)r.push(t),t=this.getSibling(++e);return r}function f(){for(var e=this.key,t=this.getSibling(--e),r=[];t.node;)r.push(t),t=this.getSibling(--e);return r}function p(e,t){!0===t&&(t=this.context);var r=e.split(".");return 1===r.length?this._getKey(e,t):this._getPattern(r,t)}function d(e,t){var r=this,n=this.node,i=n[e];return Array.isArray(i)?i.map(function(s,a){return _.default.get({listKey:e,parentPath:r,parent:n,container:i,key:a}).setContext(t)}):_.default.get({parentPath:this,parent:n,container:n,key:e}).setContext(t)}function h(e,t){for(var r=this,n=e,i=Array.isArray(n),s=0,n=i?n:(0,A.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a;r="."===o?r.parentPath:Array.isArray(r)?r[o]:r.get(o,t)}return r}function m(e){return C.getBindingIdentifiers(this.node,e)}function y(e){return C.getOuterBindingIdentifiers(this.node,e)}function v(){for(var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this,n=[].concat(r),i=(0,E.default)(null);n.length;){var s=n.shift();if(s&&s.node){var a=C.getBindingIdentifiers.keys[s.node.type];if(s.isIdentifier())if(e){var o=i[s.node.name]=i[s.node.name]||[];o.push(s)}else i[s.node.name]=s;else if(s.isExportDeclaration()){var u=s.get("declaration");u.isDeclaration()&&n.push(u)}else{if(t){if(s.isFunctionDeclaration()){n.push(s.get("id"));continue}if(s.isFunctionExpression())continue}if(a)for(var l=0;l<a.length;l++){var c=a[l],f=s.get(c);(Array.isArray(f)||f.node)&&(n=n.concat(f))}}}}return i}function g(e){return this.getBindingIdentifierPaths(e,!0)}t.__esModule=!0;var b=r(9),E=n(b),x=r(2),A=n(x);t.getStatementParent=i,t.getOpposite=s,t.getCompletionRecords=a,t.getSibling=o,t.getPrevSibling=u,t.getNextSibling=l,t.getAllNextSiblings=c,t.getAllPrevSiblings=f,t.get=p,t._getKey=d,t._getPattern=h,t.getBindingIdentifiers=m,t.getOuterBindingIdentifiers=y,t.getBindingIdentifierPaths=v,t.getOuterBindingIdentifierPaths=g;var S=r(36),_=n(S),D=r(1),C=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(D)},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(){if(this.typeAnnotation)return this.typeAnnotation;var e=this._getTypeAnnotation()||y.anyTypeAnnotation();return y.isTypeAnnotation(e)&&(e=e.typeAnnotation),this.typeAnnotation=e}function s(){var e=this.node;{if(e){if(e.typeAnnotation)return e.typeAnnotation;var t=h[e.type];return t?t.call(this,e):(t=h[this.parentPath.type],t&&t.validParent?this.parentPath.getTypeAnnotation():void 0)}if("init"===this.key&&this.parentPath.isVariableDeclarator()){var r=this.parentPath.parentPath,n=r.parentPath;return"left"===r.key&&n.isForInStatement()?y.stringTypeAnnotation():"left"===r.key&&n.isForOfStatement()?y.anyTypeAnnotation():y.voidTypeAnnotation()}}}function a(e,t){return o(e,this.getTypeAnnotation(),t)}function o(e,t,r){if("string"===e)return y.isStringTypeAnnotation(t);if("number"===e)return y.isNumberTypeAnnotation(t);if("boolean"===e)return y.isBooleanTypeAnnotation(t);if("any"===e)return y.isAnyTypeAnnotation(t);if("mixed"===e)return y.isMixedTypeAnnotation(t);if("empty"===e)return y.isEmptyTypeAnnotation(t);if("void"===e)return y.isVoidTypeAnnotation(t);if(r)return!1;throw new Error("Unknown base type "+e)}function u(e){var t=this.getTypeAnnotation();if(y.isAnyTypeAnnotation(t))return!0;if(y.isUnionTypeAnnotation(t)){for(var r=t.types,n=Array.isArray(r),i=0,r=n?r:(0,p.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var a=s;if(y.isAnyTypeAnnotation(a)||o(e,a,!0))return!0}return!1}return o(e,t,!0)}function l(e){var t=this.getTypeAnnotation();if(e=e.getTypeAnnotation(),!y.isAnyTypeAnnotation(t)&&y.isFlowBaseAnnotation(t))return e.type===t.type}function c(e){var t=this.getTypeAnnotation();return y.isGenericTypeAnnotation(t)&&y.isIdentifier(t.id,{name:e})}t.__esModule=!0;var f=r(2),p=function(e){return e&&e.__esModule?e:{default:e}}(f);t.getTypeAnnotation=i,t._getTypeAnnotation=s,t.isBaseType=a,t.couldBeBaseType=u,t.baseTypeStrictlyMatches=l,t.isGenericType=c;var d=r(376),h=n(d),m=r(1),y=n(m)},function(e,t,r){"use strict";function n(e,t){var r=e.scope.getBinding(t),n=[];e.typeAnnotation=f.unionTypeAnnotation(n);var s=[],a=i(r,e,s),u=o(e,t);if(u){var c=i(r,u.ifStatement);a=a.filter(function(e){return c.indexOf(e)<0}),n.push(u.typeAnnotation)}if(a.length){a=a.concat(s);for(var p=a,d=Array.isArray(p),h=0,p=d?p:(0,l.default)(p);;){var m;if(d){if(h>=p.length)break;m=p[h++]}else{if(h=p.next(),h.done)break;m=h.value}var y=m;n.push(y.getTypeAnnotation())}}if(n.length)return f.createUnionTypeAnnotation(n)}function i(e,t,r){var n=e.constantViolations.slice();return n.unshift(e.path),n.filter(function(e){e=e.resolve();var n=e._guessExecutionStatusRelativeTo(t);return r&&"function"===n&&r.push(e),"before"===n})}function s(e,t){var r=t.node.operator,n=t.get("right").resolve(),i=t.get("left").resolve(),s=void 0;if(i.isIdentifier({name:e})?s=n:n.isIdentifier({name:e})&&(s=i),s)return"==="===r?s.getTypeAnnotation():f.BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(r)>=0?f.numberTypeAnnotation():void 0;if("==="===r){var a=void 0,o=void 0;if(i.isUnaryExpression({operator:"typeof"})?(a=i,o=n):n.isUnaryExpression({operator:"typeof"})&&(a=n,o=i),(o||a)&&(o=o.resolve(),o.isLiteral())){if("string"==typeof o.node.value&&a.get("argument").isIdentifier({name:e}))return f.createTypeAnnotationBasedOnTypeof(o.node.value)}}}function a(e){for(var t=void 0;t=e.parentPath;){if(t.isIfStatement()||t.isConditionalExpression())return"test"===e.key?void 0:t;e=t}}function o(e,t){var r=a(e);if(r){var n=r.get("test"),i=[n],u=[];do{var l=i.shift().resolve();if(l.isLogicalExpression()&&(i.push(l.get("left")),i.push(l.get("right"))),l.isBinaryExpression()){var c=s(t,l);c&&u.push(c)}}while(i.length);return u.length?{typeAnnotation:f.createUnionTypeAnnotation(u),ifStatement:r}:o(r,t)}}t.__esModule=!0;var u=r(2),l=function(e){return e&&e.__esModule?e:{default:e}}(u);t.default=function(e){if(this.isReferenced()){var t=this.scope.getBinding(e.name);return t?t.identifier.typeAnnotation?t.identifier.typeAnnotation:n(this,e.name):"undefined"===e.name?f.voidTypeAnnotation():"NaN"===e.name||"Infinity"===e.name?f.numberTypeAnnotation():void e.name}};var c=r(1),f=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(c);e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(){return this.get("id").isIdentifier()?this.get("init").getTypeAnnotation():void 0}function s(e){return e.typeAnnotation}function a(e){if(this.get("callee").isIdentifier())return k.genericTypeAnnotation(e.callee)}function o(){return k.stringTypeAnnotation()}function u(e){var t=e.operator;return"void"===t?k.voidTypeAnnotation():k.NUMBER_UNARY_OPERATORS.indexOf(t)>=0?k.numberTypeAnnotation():k.STRING_UNARY_OPERATORS.indexOf(t)>=0?k.stringTypeAnnotation():k.BOOLEAN_UNARY_OPERATORS.indexOf(t)>=0?k.booleanTypeAnnotation():void 0}function l(e){var t=e.operator;if(k.NUMBER_BINARY_OPERATORS.indexOf(t)>=0)return k.numberTypeAnnotation();if(k.BOOLEAN_BINARY_OPERATORS.indexOf(t)>=0)return k.booleanTypeAnnotation();if("+"===t){var r=this.get("right"),n=this.get("left");return n.isBaseType("number")&&r.isBaseType("number")?k.numberTypeAnnotation():n.isBaseType("string")||r.isBaseType("string")?k.stringTypeAnnotation():k.unionTypeAnnotation([k.stringTypeAnnotation(),k.numberTypeAnnotation()])}}function c(){return k.createUnionTypeAnnotation([this.get("left").getTypeAnnotation(),this.get("right").getTypeAnnotation()])}function f(){return k.createUnionTypeAnnotation([this.get("consequent").getTypeAnnotation(),this.get("alternate").getTypeAnnotation()])}function p(){return this.get("expressions").pop().getTypeAnnotation()}function d(){return this.get("right").getTypeAnnotation()}function h(e){var t=e.operator;if("++"===t||"--"===t)return k.numberTypeAnnotation()}function m(){return k.stringTypeAnnotation()}function y(){return k.numberTypeAnnotation()}function v(){return k.booleanTypeAnnotation()}function g(){return k.nullLiteralTypeAnnotation()}function b(){return k.genericTypeAnnotation(k.identifier("RegExp"))}function E(){return k.genericTypeAnnotation(k.identifier("Object"))}function x(){return k.genericTypeAnnotation(k.identifier("Array"))}function A(){return x()}function S(){return k.genericTypeAnnotation(k.identifier("Function"))}function _(){return C(this.get("callee"))}function D(){return C(this.get("tag"))}function C(e){if(e=e.resolve(),e.isFunction()){if(e.is("async"))return e.is("generator")?k.genericTypeAnnotation(k.identifier("AsyncIterator")):k.genericTypeAnnotation(k.identifier("Promise"));if(e.node.returnType)return e.node.returnType}}t.__esModule=!0,t.ClassDeclaration=t.ClassExpression=t.FunctionDeclaration=t.ArrowFunctionExpression=t.FunctionExpression=t.Identifier=void 0;var w=r(375);Object.defineProperty(t,"Identifier",{enumerable:!0,get:function(){return n(w).default}}),t.VariableDeclarator=i,t.TypeCastExpression=s,t.NewExpression=a,t.TemplateLiteral=o,t.UnaryExpression=u,t.BinaryExpression=l,t.LogicalExpression=c,t.ConditionalExpression=f,t.SequenceExpression=p,t.AssignmentExpression=d,t.UpdateExpression=h,t.StringLiteral=m,t.NumericLiteral=y,t.BooleanLiteral=v,t.NullLiteral=g,t.RegExpLiteral=b,t.ObjectExpression=E,t.ArrayExpression=x,t.RestElement=A,t.CallExpression=_,t.TaggedTemplateExpression=D;var P=r(1),k=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(P);s.validParent=!0,A.validParent=!0,t.FunctionExpression=S,t.ArrowFunctionExpression=S,t.FunctionDeclaration=S,t.ClassExpression=S,t.ClassDeclaration=S},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){function r(e){var t=n[s];return"*"===t||e===t}if(!this.isMemberExpression())return!1;for(var n=e.split("."),i=[this.node],s=0;i.length;){var a=i.shift();if(t&&s===n.length)return!0;if(C.isIdentifier(a)){if(!r(a.name))return!1}else if(C.isLiteral(a)){if(!r(a.value))return!1}else{if(C.isMemberExpression(a)){if(a.computed&&!C.isLiteral(a.property))return!1;i.unshift(a.property),i.unshift(a.object);continue}if(!C.isThisExpression(a))return!1;if(!r("this"))return!1}if(++s>n.length)return!1}return s===n.length}function s(e){var t=this.node&&this.node[e];return t&&Array.isArray(t)?!!t.length:!!t}function a(){return this.scope.isStatic(this.node)}function o(e){return!this.has(e)}function u(e,t){return this.node[e]===t}function l(e){return C.isType(this.type,e)}function c(){return("init"===this.key||"left"===this.key)&&this.parentPath.isFor()}function f(e){return!("body"!==this.key||!this.parentPath.isArrowFunctionExpression())&&(this.isExpression()?C.isBlockStatement(e):!!this.isBlockStatement()&&C.isExpression(e))}function p(e){var t=this,r=!0;do{var n=t.container;if(t.isFunction()&&!r)return!!e;if(r=!1,Array.isArray(n)&&t.key!==n.length-1)return!1}while((t=t.parentPath)&&!t.isProgram());return!0}function d(){return!this.parentPath.isLabeledStatement()&&!C.isBlockStatement(this.container)&&(0,_.default)(C.STATEMENT_OR_BLOCK_KEYS,this.key)}function h(e,t){if(!this.isReferencedIdentifier())return!1;var r=this.scope.getBinding(this.node.name);if(!r||"module"!==r.kind)return!1;var n=r.path,i=n.parentPath;return!!i.isImportDeclaration()&&(i.node.source.value===e&&(!t||(!(!n.isImportDefaultSpecifier()||"default"!==t)||(!(!n.isImportNamespaceSpecifier()||"*"!==t)||!(!n.isImportSpecifier()||n.node.imported.name!==t)))))}function m(){var e=this.node;return e.end?this.hub.file.code.slice(e.start,e.end):""}function y(e){return"after"!==this._guessExecutionStatusRelativeTo(e)}function v(e){var t=e.scope.getFunctionParent(),r=this.scope.getFunctionParent();if(t.node!==r.node){var n=this._guessExecutionStatusRelativeToDifferentFunctions(t);if(n)return n;e=t.path}var i=e.getAncestry();if(i.indexOf(this)>=0)return"after";var s=this.getAncestry(),a=void 0,o=void 0,u=void 0;for(u=0;u<s.length;u++){var l=s[u];if((o=i.indexOf(l))>=0){a=l;break}}if(!a)return"before";var c=i[o-1],f=s[u-1];return c&&f?c.listKey&&c.container===f.container?c.key>f.key?"before":"after":C.VISITOR_KEYS[c.type].indexOf(c.key)>C.VISITOR_KEYS[f.type].indexOf(f.key)?"before":"after":"before"}function g(e){var t=e.path;if(t.isFunctionDeclaration()){var r=t.scope.getBinding(t.node.id.name);if(!r.references)return"before";for(var n=r.referencePaths,i=n,s=Array.isArray(i),a=0,i=s?i:(0,A.default)(i);;){var o;if(s){if(a>=i.length)break;o=i[a++]}else{if(a=i.next(),a.done)break;o=a.value}var u=o;if("callee"!==u.key||!u.parentPath.isCallExpression())return}for(var l=void 0,c=n,f=Array.isArray(c),p=0,c=f?c:(0,A.default)(c);;){var d;if(f){if(p>=c.length)break;d=c[p++]}else{if(p=c.next(),p.done)break;d=p.value}var h=d;if(!!!h.find(function(e){return e.node===t.node})){var m=this._guessExecutionStatusRelativeTo(h);if(l){if(l!==m)return}else l=m}}return l}}function b(e,t){return this._resolve(e,t)||this}function E(e,t){if(!(t&&t.indexOf(this)>=0))if(t=t||[],t.push(this),this.isVariableDeclarator()){if(this.get("id").isIdentifier())return this.get("init").resolve(e,t)}else if(this.isReferencedIdentifier()){var r=this.scope.getBinding(this.node.name);if(!r)return;if(!r.constant)return;if("module"===r.kind)return;if(r.path!==this){var n=r.path.resolve(e,t);if(this.find(function(e){return e.node===n.node}))return;return n}}else{if(this.isTypeCastExpression())return this.get("expression").resolve(e,t);if(e&&this.isMemberExpression()){var i=this.toComputedKey();if(!C.isLiteral(i))return;var s=i.value,a=this.get("object").resolve(e,t);if(a.isObjectExpression())for(var o=a.get("properties"),u=o,l=Array.isArray(u),c=0,u=l?u:(0,A.default)(u);;){var f;if(l){if(c>=u.length)break;f=u[c++]}else{if(c=u.next(),c.done)break;f=c.value}var p=f;if(p.isProperty()){var d=p.get("key"),h=p.isnt("computed")&&d.isIdentifier({name:s});if(h=h||d.isLiteral({value:s}))return p.get("value").resolve(e,t)}}else if(a.isArrayExpression()&&!isNaN(+s)){var m=a.get("elements"),y=m[s];if(y)return y.resolve(e,t)}}}}t.__esModule=!0,t.is=void 0;var x=r(2),A=n(x);t.matchesPattern=i,t.has=s,t.isStatic=a,t.isnt=o,t.equals=u,t.isNodeType=l,t.canHaveVariableDeclarationOrExpression=c,t.canSwapBetweenExpressionAndStatement=f,t.isCompletionRecord=p,t.isStatementOrBlock=d,t.referencesImport=h,t.getSource=m, t.willIMaybeExecuteBefore=y,t._guessExecutionStatusRelativeTo=v,t._guessExecutionStatusRelativeToDifferentFunctions=g,t.resolve=b,t._resolve=E;var S=r(111),_=n(S),D=r(1),C=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(D);t.is=s},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(2),s=n(i),a=r(3),o=n(a),u=r(1),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(u),c={ReferencedIdentifier:function(e,t){if(!e.isJSXIdentifier()||!u.react.isCompatTag(e.node.name)||e.parentPath.isJSXMemberExpression()){if("this"===e.node.name){var r=e.scope;do{if(r.path.isFunction()&&!r.path.isArrowFunctionExpression())break}while(r=r.parent);r&&t.breakOnScopePaths.push(r.path)}var n=e.scope.getBinding(e.node.name);n&&n===t.scope.getBinding(e.node.name)&&(t.bindings[e.node.name]=n)}}},f=function(){function e(t,r){(0,o.default)(this,e),this.breakOnScopePaths=[],this.bindings={},this.scopes=[],this.scope=r,this.path=t,this.attachAfter=!1}return e.prototype.isCompatibleScope=function(e){for(var t in this.bindings){var r=this.bindings[t];if(!e.bindingIdentifierEquals(t,r.identifier))return!1}return!0},e.prototype.getCompatibleScopes=function(){var e=this.path.scope;do{if(!this.isCompatibleScope(e))break;if(this.scopes.push(e),this.breakOnScopePaths.indexOf(e.path)>=0)break}while(e=e.parent)},e.prototype.getAttachmentPath=function(){var e=this._getAttachmentPath();if(e){var t=e.scope;if(t.path===e&&(t=e.scope.parent),t.path.isProgram()||t.path.isFunction())for(var r in this.bindings)if(t.hasOwnBinding(r)){var n=this.bindings[r];if("param"!==n.kind&&this.getAttachmentParentForPath(n.path).key>e.key){this.attachAfter=!0,e=n.path;for(var i=n.constantViolations,a=Array.isArray(i),o=0,i=a?i:(0,s.default)(i);;){var u;if(a){if(o>=i.length)break;u=i[o++]}else{if(o=i.next(),o.done)break;u=o.value}var l=u;this.getAttachmentParentForPath(l).key>e.key&&(e=l)}}}return e.parentPath.isExportDeclaration()&&(e=e.parentPath),e}},e.prototype._getAttachmentPath=function(){var e=this.scopes,t=e.pop();if(t){if(t.path.isFunction()){if(this.hasOwnParamBindings(t)){if(this.scope===t)return;return t.path.get("body").get("body")[0]}return this.getNextScopeAttachmentParent()}return t.path.isProgram()?this.getNextScopeAttachmentParent():void 0}},e.prototype.getNextScopeAttachmentParent=function(){var e=this.scopes.pop();if(e)return this.getAttachmentParentForPath(e.path)},e.prototype.getAttachmentParentForPath=function(e){do{if(!e.parentPath||Array.isArray(e.container)&&e.isStatement()||e.isVariableDeclarator()&&null!==e.parentPath.node&&e.parentPath.node.declarations.length>1)return e}while(e=e.parentPath)},e.prototype.hasOwnParamBindings=function(e){for(var t in this.bindings)if(e.hasOwnBinding(t)){var r=this.bindings[t];if("param"===r.kind&&r.constant)return!0}return!1},e.prototype.run=function(){var e=this.path.node;if(!e._hoisted){e._hoisted=!0,this.path.traverse(c,this),this.getCompatibleScopes();var t=this.getAttachmentPath();if(t&&t.getFunctionParent()!==this.path.getFunctionParent()){var r=t.scope.generateUidIdentifier("ref"),n=l.variableDeclarator(r,this.path.node);t[this.attachAfter?"insertAfter":"insertBefore"]([t.isVariableDeclarator()?n:l.variableDeclaration("var",[n])]);var i=this.path.parentPath;i.isJSXElement()&&this.path.container===i.node.children&&(r=l.JSXExpressionContainer(r)),this.path.replaceWith(r)}}},e}();t.default=f,e.exports=t.default},function(e,t){"use strict";t.__esModule=!0;t.hooks=[function(e,t){if("test"===e.key&&(t.isWhile()||t.isSwitchCase())||"declaration"===e.key&&t.isExportDeclaration()||"body"===e.key&&t.isLabeledStatement()||"declarations"===e.listKey&&t.isVariableDeclaration()&&1===t.node.declarations.length||"expression"===e.key&&t.isExpressionStatement())return t.remove(),!0},function(e,t){if(t.isSequenceExpression()&&1===t.node.expressions.length)return t.replaceWith(t.node.expressions[0]),!0},function(e,t){if(t.isBinary())return"left"===e.key?t.replaceWith(t.node.right):t.replaceWith(t.node.left),!0},function(e,t){if(t.isIfStatement()&&("consequent"===e.key||"alternate"===e.key)||"body"===e.key&&(t.isLoop()||t.isArrowFunctionExpression()))return e.replaceWith({type:"BlockStatement",body:[]}),!0}]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){if(this._assertUnremoved(),e=this._verifyNodeList(e),this.parentPath.isExpressionStatement()||this.parentPath.isLabeledStatement())return this.parentPath.insertBefore(e);if(this.isNodeType("Expression")||this.parentPath.isForStatement()&&"init"===this.key)this.node&&e.push(this.node),this.replaceExpressionWithStatements(e);else{if(this._maybePopFromStatements(e),Array.isArray(this.container))return this._containerInsertBefore(e);if(!this.isStatementOrBlock())throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?");this.node&&e.push(this.node),this._replaceWith(D.blockStatement(e))}return[this]}function s(e,t){this.updateSiblingKeys(e,t.length);for(var r=[],n=0;n<t.length;n++){var i=e+n,s=t[n];if(this.container.splice(i,0,s),this.context){var a=this.context.create(this.parent,this.container,i,this.listKey);this.context.queue&&a.pushContext(this.context),r.push(a)}else r.push(S.default.get({parentPath:this.parentPath,parent:this.parent,container:this.container,listKey:this.listKey,key:i}))}for(var o=this._getQueueContexts(),u=r,l=Array.isArray(u),c=0,u=l?u:(0,g.default)(u);;){var f;if(l){if(c>=u.length)break;f=u[c++]}else{if(c=u.next(),c.done)break;f=c.value}var p=f;p.setScope(),p.debug(function(){return"Inserted."});for(var d=o,h=Array.isArray(d),m=0,d=h?d:(0,g.default)(d);;){var y;if(h){if(m>=d.length)break;y=d[m++]}else{if(m=d.next(),m.done)break;y=m.value}y.maybeQueue(p,!0)}}return r}function a(e){return this._containerInsert(this.key,e)}function o(e){return this._containerInsert(this.key+1,e)}function u(e){var t=e[e.length-1];(D.isIdentifier(t)||D.isExpressionStatement(t)&&D.isIdentifier(t.expression))&&!this.isCompletionRecord()&&e.pop()}function l(e){if(this._assertUnremoved(),e=this._verifyNodeList(e),this.parentPath.isExpressionStatement()||this.parentPath.isLabeledStatement())return this.parentPath.insertAfter(e);if(this.isNodeType("Expression")||this.parentPath.isForStatement()&&"init"===this.key){if(this.node){var t=this.scope.generateDeclaredUidIdentifier();e.unshift(D.expressionStatement(D.assignmentExpression("=",t,this.node))),e.push(D.expressionStatement(t))}this.replaceExpressionWithStatements(e)}else{if(this._maybePopFromStatements(e),Array.isArray(this.container))return this._containerInsertAfter(e);if(!this.isStatementOrBlock())throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?");this.node&&e.unshift(this.node),this._replaceWith(D.blockStatement(e))}return[this]}function c(e,t){if(this.parent)for(var r=b.path.get(this.parent),n=0;n<r.length;n++){var i=r[n];i.key>=e&&(i.key+=t)}}function f(e){if(!e)return[];e.constructor!==Array&&(e=[e]);for(var t=0;t<e.length;t++){var r=e[t],n=void 0;if(r?"object"!==(void 0===r?"undefined":(0,y.default)(r))?n="contains a non-object node":r.type?r instanceof S.default&&(n="has a NodePath when it expected a raw object"):n="without a type":n="has falsy node",n){var i=Array.isArray(r)?"array":void 0===r?"undefined":(0,y.default)(r);throw new Error("Node list "+n+" with the index of "+t+" and type of "+i)}}return e}function p(e,t){return this._assertUnremoved(),t=this._verifyNodeList(t),S.default.get({parentPath:this,parent:this.node,container:this.node[e],listKey:e,key:0}).insertBefore(t)}function d(e,t){this._assertUnremoved(),t=this._verifyNodeList(t);var r=this.node[e];return S.default.get({parentPath:this,parent:this.node,container:r,listKey:e,key:r.length}).replaceWithMultiple(t)}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.scope;return new x.default(this,e).run()}t.__esModule=!0;var m=r(11),y=n(m),v=r(2),g=n(v);t.insertBefore=i,t._containerInsert=s,t._containerInsertBefore=a,t._containerInsertAfter=o,t._maybePopFromStatements=u,t.insertAfter=l,t.updateSiblingKeys=c,t._verifyNodeList=f,t.unshiftContainer=p,t.pushContainer=d,t.hoist=h;var b=r(88),E=r(378),x=n(E),A=r(36),S=n(A),_=r(1),D=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(_)},function(e,t,r){"use strict";function n(){if(this._assertUnremoved(),this.resync(),this._callRemovalHooks())return void this._markRemoved();this.shareCommentsWithSiblings(),this._remove(),this._markRemoved()}function i(){for(var e=c.hooks,t=Array.isArray(e),r=0,e=t?e:(0,l.default)(e);;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{if(r=e.next(),r.done)break;n=r.value}if(n(this,this.parentPath))return!0}}function s(){Array.isArray(this.container)?(this.container.splice(this.key,1),this.updateSiblingKeys(this.key,-1)):this._replaceWith(null)}function a(){this.shouldSkip=!0,this.removed=!0,this.node=null}function o(){if(this.removed)throw this.buildCodeFrameError("NodePath has been removed so is read-only.")}t.__esModule=!0;var u=r(2),l=function(e){return e&&e.__esModule?e:{default:e}}(u);t.remove=n,t._callRemovalHooks=i,t._remove=s,t._markRemoved=a,t._assertUnremoved=o;var c=r(379)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){this.resync(),e=this._verifyNodeList(e),E.inheritLeadingComments(e[0],this.node),E.inheritTrailingComments(e[e.length-1],this.node),this.node=this.container[this.key]=null,this.insertAfter(e),this.node?this.requeue():this.remove()}function s(e){this.resync();try{e="("+e+")",e=(0,g.parse)(e)}catch(r){var t=r.loc;throw t&&(r.message+=" - make sure this is an expression.",r.message+="\n"+(0,d.default)(e,t.line,t.column+1)),r}return e=e.program.body[0].expression,m.default.removeProperties(e),this.replaceWith(e)}function a(e){if(this.resync(),this.removed)throw new Error("You can't replace this node, we've already removed it");if(e instanceof v.default&&(e=e.node),!e)throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead");if(this.node!==e){if(this.isProgram()&&!E.isProgram(e))throw new Error("You can only replace a Program root node with another Program node");if(Array.isArray(e))throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`");if("string"==typeof e)throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`");if(this.isNodeType("Statement")&&E.isExpression(e)&&(this.canHaveVariableDeclarationOrExpression()||this.canSwapBetweenExpressionAndStatement(e)||this.parentPath.isExportDefaultDeclaration()||(e=E.expressionStatement(e))),this.isNodeType("Expression")&&E.isStatement(e)&&!this.canHaveVariableDeclarationOrExpression()&&!this.canSwapBetweenExpressionAndStatement(e))return this.replaceExpressionWithStatements([e]);var t=this.node;t&&(E.inheritsComments(e,t),E.removeComments(t)),this._replaceWith(e),this.type=e.type,this.setScope(),this.requeue()}}function o(e){if(!this.container)throw new ReferenceError("Container is falsy");this.inList?E.validate(this.parent,this.key,[e]):E.validate(this.parent,this.key,e),this.debug(function(){return"Replace with "+(e&&e.type)}),this.node=this.container[this.key]=e}function u(e){this.resync();var t=E.toSequenceExpression(e,this.scope);if(E.isSequenceExpression(t)){var r=t.expressions;r.length>=2&&this.parentPath.isExpressionStatement()&&this._maybePopFromStatements(r),1===r.length?this.replaceWith(r[0]):this.replaceWith(t)}else{if(!t){var n=E.functionExpression(null,[],E.blockStatement(e));n.shadow=!0,this.replaceWith(E.callExpression(n,[])),this.traverse(x);for(var i=this.get("callee").getCompletionRecords(),s=i,a=Array.isArray(s),o=0,s=a?s:(0,f.default)(s);;){var u;if(a){if(o>=s.length)break;u=s[o++]}else{if(o=s.next(),o.done)break;u=o.value}var l=u;if(l.isExpressionStatement()){var c=l.findParent(function(e){return e.isLoop()});if(c){var p=c.getData("expressionReplacementReturnUid");if(p)p=E.identifier(p.name);else{var d=this.get("callee");p=d.scope.generateDeclaredUidIdentifier("ret"),d.get("body").pushContainer("body",E.returnStatement(p)),c.setData("expressionReplacementReturnUid",p)}l.get("expression").replaceWith(E.assignmentExpression("=",p,l.node.expression))}else l.replaceWith(E.returnStatement(l.node.expression))}}return this.node}this.replaceWith(t)}}function l(e){return this.resync(),Array.isArray(e)?Array.isArray(this.container)?(e=this._verifyNodeList(e),this._containerInsertAfter(e),this.remove()):this.replaceWithMultiple(e):this.replaceWith(e)}t.__esModule=!0;var c=r(2),f=n(c);t.replaceWithMultiple=i,t.replaceWithSourceString=s,t.replaceWith=a,t._replaceWith=o,t.replaceExpressionWithStatements=u,t.replaceInline=l;var p=r(181),d=n(p),h=r(7),m=n(h),y=r(36),v=n(y),g=r(89),b=r(1),E=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(b),x={Function:function(e){e.skip()},VariableDeclaration:function(e){if("var"===e.node.kind){var t=e.getBindingIdentifiers();for(var r in t)e.scope.push({id:t[r]});for(var n=[],i=e.node.declarations,s=Array.isArray(i),a=0,i=s?i:(0,f.default)(i);;){var o;if(s){if(a>=i.length)break;o=i[a++]}else{if(a=i.next(),a.done)break;o=a.value}var u=o;u.init&&n.push(E.expressionStatement(E.assignmentExpression("=",u.id,u.init)))}e.replaceWithMultiple(n)}}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=r(3),s=n(i),a=r(225),o=(n(a),r(1)),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(o),l={ReferencedIdentifier:function(e,t){var r=e.node;r.name===t.oldName&&(r.name=t.newName)},Scope:function(e,t){e.scope.bindingIdentifierEquals(t.oldName,t.binding.identifier)||e.skip()},"AssignmentExpression|Declaration":function(e,t){var r=e.getOuterBindingIdentifiers();for(var n in r)n===t.oldName&&(r[n].name=t.newName)}},c=function(){function e(t,r,n){(0,s.default)(this,e),this.newName=n,this.oldName=r,this.binding=t}return e.prototype.maybeConvertFromExportDeclaration=function(e){var t=e.parentPath.isExportDeclaration()&&e.parentPath;if(t){var r=t.isExportDefaultDeclaration();r&&(e.isFunctionDeclaration()||e.isClassDeclaration())&&!e.node.id&&(e.node.id=e.scope.generateUidIdentifier("default"));var n=e.getOuterBindingIdentifiers(),i=[];for(var s in n){var a=s===this.oldName?this.newName:s,o=r?"default":s;i.push(u.exportSpecifier(u.identifier(a),u.identifier(o)))}if(i.length){var l=u.exportNamedDeclaration(null,i);e.isFunctionDeclaration()&&(l._blockHoist=3),t.insertAfter(l),t.replaceWith(e.node)}}},e.prototype.rename=function(e){var t=this.binding,r=this.oldName,n=this.newName,i=t.scope,s=t.path,a=s.find(function(e){return e.isDeclaration()||e.isFunctionExpression()});a&&this.maybeConvertFromExportDeclaration(a),i.traverse(e||i.block,l,this),e||(i.removeOwnBinding(r),i.bindings[n]=t,this.binding.identifier.name=n),t.type},e}();t.default=c,e.exports=t.default},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e){if(e._exploded)return e;e._exploded=!0;for(var t in e)if(!d(t)){var r=t.split("|");if(1!==r.length){var n=e[t];delete e[t];for(var i=r,s=Array.isArray(i),o=0,i=s?i:(0,E.default)(i);;){var u;if(s){if(o>=i.length)break;u=i[o++]}else{if(o=i.next(),o.done)break;u=o.value}var l=u;e[l]=n}}}a(e),delete e.__esModule,c(e),f(e);for(var m=(0,g.default)(e),y=Array.isArray(m),v=0,m=y?m:(0,E.default)(m);;){var b;if(y){if(v>=m.length)break;b=m[v++]}else{if(v=m.next(),v.done)break;b=v.value}var x=b;if(!d(x)){var S=A[x];if(S){var _=e[x];for(var D in _)_[D]=p(S,_[D]);if(delete e[x],S.types)for(var w=S.types,k=Array.isArray(w),F=0,w=k?w:(0,E.default)(w);;){var T;if(k){if(F>=w.length)break;T=w[F++]}else{if(F=w.next(),F.done)break;T=F.value}var O=T;e[O]?h(e[O],_):e[O]=_}else h(e,_)}}}for(var B in e)if(!d(B)){var R=e[B],I=C.FLIPPED_ALIAS_KEYS[B],M=C.DEPRECATED_KEYS[B];if(M&&(console.trace("Visitor defined for "+B+" but it has been renamed to "+M),I=[M]),I){delete e[B];for(var N=I,L=Array.isArray(N),j=0,N=L?N:(0,E.default)(N);;){var U;if(L){if(j>=N.length)break;U=N[j++]}else{if(j=N.next(),j.done)break;U=j.value}var V=U,G=e[V];G?h(G,R):e[V]=(0,P.default)(R)}}}for(var W in e)d(W)||f(e[W]);return e}function a(e){if(!e._verified){if("function"==typeof e)throw new Error(_.get("traverseVerifyRootFunction"));for(var t in e)if("enter"!==t&&"exit"!==t||o(t,e[t]),!d(t)){if(C.TYPES.indexOf(t)<0)throw new Error(_.get("traverseVerifyNodeType",t));var r=e[t];if("object"===(void 0===r?"undefined":(0,y.default)(r)))for(var n in r){if("enter"!==n&&"exit"!==n)throw new Error(_.get("traverseVerifyVisitorProperty",t,n));o(t+"."+n,r[n])}}e._verified=!0}}function o(e,t){for(var r=[].concat(t),n=r,i=Array.isArray(n),s=0,n=i?n:(0,E.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a;if("function"!=typeof o)throw new TypeError("Non-function found defined in "+e+" with type "+(void 0===o?"undefined":(0,y.default)(o)))}}function u(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments[2],n={},i=0;i<e.length;i++){var a=e[i],o=t[i];s(a);for(var u in a){var c=a[u];(o||r)&&(c=l(c,o,r));h(n[u]=n[u]||{},c)}}return n}function l(e,t,r){var n={};for(var i in e){(function(i){var s=e[i];if(!Array.isArray(s))return"continue";s=s.map(function(e){var n=e;return t&&(n=function(r){return e.call(t,r,t)}),r&&(n=r(t.key,i,n)),n}),n[i]=s})(i)}return n}function c(e){for(var t in e)if(!d(t)){var r=e[t];"function"==typeof r&&(e[t]={enter:r})}}function f(e){e.enter&&!Array.isArray(e.enter)&&(e.enter=[e.enter]),e.exit&&!Array.isArray(e.exit)&&(e.exit=[e.exit])}function p(e,t){var r=function(r){if(e.checkPath(r))return t.apply(this,arguments)};return r.toString=function(){return t.toString()},r}function d(e){return"_"===e[0]||("enter"===e||"exit"===e||"shouldSkip"===e||("blacklist"===e||"noScope"===e||"skipKeys"===e))}function h(e,t){for(var r in t)e[r]=[].concat(e[r]||[],t[r])}t.__esModule=!0;var m=r(11),y=i(m),v=r(14),g=i(v),b=r(2),E=i(b);t.explode=s,t.verify=a,t.merge=u;var x=r(224),A=n(x),S=r(20),_=n(S),D=r(1),C=n(D),w=r(109),P=i(w)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.key||e.property;return e.computed||D.isIdentifier(t)&&(t=D.stringLiteral(t.name)),t}function s(e,t,r){for(var n=[],i=!0,a=e,o=Array.isArray(a),u=0,a=o?a:(0,b.default)(a);;){var l;if(o){if(u>=a.length)break;l=a[u++]}else{if(u=a.next(),u.done)break;l=u.value}var c=l;if(i=!1,D.isExpression(c))n.push(c);else if(D.isExpressionStatement(c))n.push(c.expression);else if(D.isVariableDeclaration(c)){if("var"!==c.kind)return;for(var f=c.declarations,p=Array.isArray(f),d=0,f=p?f:(0,b.default)(f);;){var h;if(p){if(d>=f.length)break;h=f[d++]}else{if(d=f.next(),d.done)break;h=d.value}var m=h,y=D.getBindingIdentifiers(m);for(var v in y)r.push({kind:c.kind,id:y[v]});m.init&&n.push(D.assignmentExpression("=",m.id,m.init))}i=!0}else if(D.isIfStatement(c)){var g=c.consequent?s([c.consequent],t,r):t.buildUndefinedNode(),E=c.alternate?s([c.alternate],t,r):t.buildUndefinedNode();if(!g||!E)return;n.push(D.conditionalExpression(c.test,g,E))}else if(D.isBlockStatement(c)){var x=s(c.body,t,r);if(!x)return;n.push(x)}else{if(!D.isEmptyStatement(c))return;i=!0}}return i&&n.push(t.buildUndefinedNode()),1===n.length?n[0]:D.sequenceExpression(n)}function a(e,t){if(e&&e.length){var r=[],n=s(e,t,r);if(n){for(var i=r,a=Array.isArray(i),o=0,i=a?i:(0,b.default)(i);;){var u;if(a){if(o>=i.length)break;u=i[o++]}else{if(o=i.next(),o.done)break;u=o.value}var l=u;t.push(l)}return n}}}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.key,r=void 0;return"method"===e.kind?o.increment()+"":(r=D.isIdentifier(t)?t.name:D.isStringLiteral(t)?(0,v.default)(t.value):(0,v.default)(D.removePropertiesDeep(D.cloneDeep(t))),e.computed&&(r="["+r+"]"),e.static&&(r="static:"+r),r)}function u(e){return e+="",e=e.replace(/[^a-zA-Z0-9$_]/g,"-"),e=e.replace(/^[-0-9]+/,""),e=e.replace(/[-\s]+(.)?/g,function(e,t){return t?t.toUpperCase():""}),D.isValidIdentifier(e)||(e="_"+e),e||"_"}function l(e){return e=u(e),"eval"!==e&&"arguments"!==e||(e="_"+e),e}function c(e,t){if(D.isStatement(e))return e;var r=!1,n=void 0;if(D.isClass(e))r=!0,n="ClassDeclaration";else if(D.isFunction(e))r=!0,n="FunctionDeclaration";else if(D.isAssignmentExpression(e))return D.expressionStatement(e);if(r&&!e.id&&(n=!1),!n){if(t)return!1;throw new Error("cannot turn "+e.type+" to a statement")}return e.type=n,e}function f(e){if(D.isExpressionStatement(e)&&(e=e.expression),D.isExpression(e))return e;if(D.isClass(e)?e.type="ClassExpression":D.isFunction(e)&&(e.type="FunctionExpression"),!D.isExpression(e))throw new Error("cannot turn "+e.type+" to an expression");return e}function p(e,t){return D.isBlockStatement(e)?e:(D.isEmptyStatement(e)&&(e=[]),Array.isArray(e)||(D.isStatement(e)||(e=D.isFunction(t)?D.returnStatement(e):D.expressionStatement(e)),e=[e]),D.blockStatement(e))}function d(e){if(void 0===e)return D.identifier("undefined");if(!0===e||!1===e)return D.booleanLiteral(e);if(null===e)return D.nullLiteral();if("string"==typeof e)return D.stringLiteral(e);if("number"==typeof e)return D.numericLiteral(e);if((0,S.default)(e)){var t=e.source,r=e.toString().match(/\/([a-z]+|)$/)[1];return D.regExpLiteral(t,r)}if(Array.isArray(e))return D.arrayExpression(e.map(D.valueToNode));if((0,x.default)(e)){var n=[];for(var i in e){var s=void 0;s=D.isValidIdentifier(i)?D.identifier(i):D.stringLiteral(i),n.push(D.objectProperty(s,D.valueToNode(e[i])))}return D.objectExpression(n)}throw new Error("don't know how to turn this value into a node")}t.__esModule=!0;var h=r(359),m=n(h),y=r(35),v=n(y),g=r(2),b=n(g);t.toComputedKey=i,t.toSequenceExpression=a,t.toKeyAlias=o,t.toIdentifier=u,t.toBindingIdentifierName=l,t.toStatement=c,t.toExpression=f,t.toBlock=p,t.valueToNode=d;var E=r(275),x=n(E),A=r(276),S=n(A),_=r(1),D=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(_);o.uid=0,o.increment=function(){return o.uid>=m.default?o.uid=0:o.uid++}},function(e,t,r){"use strict";var n=r(1),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(n),s=r(135),a=r(26),o=function(e){return e&&e.__esModule?e:{default:e}}(a);(0,o.default)("ArrayExpression",{fields:{elements:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeOrValueType)("null","Expression","SpreadElement"))),default:[]}},visitor:["elements"],aliases:["Expression"]}),(0,o.default)("AssignmentExpression",{fields:{operator:{validate:(0,a.assertValueType)("string")},left:{validate:(0,a.assertNodeType)("LVal")},right:{validate:(0,a.assertNodeType)("Expression")}},builder:["operator","left","right"],visitor:["left","right"],aliases:["Expression"]}),(0,o.default)("BinaryExpression",{builder:["operator","left","right"],fields:{operator:{validate:a.assertOneOf.apply(void 0,s.BINARY_OPERATORS)},left:{validate:(0,a.assertNodeType)("Expression")},right:{validate:(0,a.assertNodeType)("Expression")}},visitor:["left","right"],aliases:["Binary","Expression"]}),(0,o.default)("Directive",{visitor:["value"],fields:{value:{validate:(0,a.assertNodeType)("DirectiveLiteral")}}}),(0,o.default)("DirectiveLiteral",{builder:["value"],fields:{value:{validate:(0,a.assertValueType)("string")}}}),(0,o.default)("BlockStatement",{builder:["body","directives"],visitor:["directives","body"],fields:{directives:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Directive"))),default:[]},body:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Statement")))}},aliases:["Scopable","BlockParent","Block","Statement"]}),(0,o.default)("BreakStatement",{visitor:["label"],fields:{label:{validate:(0,a.assertNodeType)("Identifier"),optional:!0}},aliases:["Statement","Terminatorless","CompletionStatement"]}),(0,o.default)("CallExpression",{visitor:["callee","arguments"],fields:{callee:{validate:(0,a.assertNodeType)("Expression")},arguments:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Expression","SpreadElement")))}},aliases:["Expression"]}),(0,o.default)("CatchClause",{visitor:["param","body"],fields:{param:{validate:(0,a.assertNodeType)("Identifier")},body:{validate:(0,a.assertNodeType)("BlockStatement")}},aliases:["Scopable"]}),(0,o.default)("ConditionalExpression",{visitor:["test","consequent","alternate"],fields:{test:{validate:(0,a.assertNodeType)("Expression")},consequent:{validate:(0,a.assertNodeType)("Expression")},alternate:{validate:(0,a.assertNodeType)("Expression")}},aliases:["Expression","Conditional"]}),(0,o.default)("ContinueStatement",{visitor:["label"],fields:{label:{validate:(0,a.assertNodeType)("Identifier"),optional:!0}},aliases:["Statement","Terminatorless","CompletionStatement"]}),(0,o.default)("DebuggerStatement",{aliases:["Statement"]}),(0,o.default)("DoWhileStatement",{visitor:["test","body"],fields:{test:{validate:(0,a.assertNodeType)("Expression")},body:{validate:(0,a.assertNodeType)("Statement")}},aliases:["Statement","BlockParent","Loop","While","Scopable"]}),(0,o.default)("EmptyStatement",{aliases:["Statement"]}),(0,o.default)("ExpressionStatement",{visitor:["expression"],fields:{expression:{validate:(0,a.assertNodeType)("Expression")}},aliases:["Statement","ExpressionWrapper"]}),(0,o.default)("File",{builder:["program","comments","tokens"],visitor:["program"],fields:{program:{validate:(0,a.assertNodeType)("Program")}}}),(0,o.default)("ForInStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:(0,a.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0,a.assertNodeType)("Expression")},body:{validate:(0,a.assertNodeType)("Statement")}}}),(0,o.default)("ForStatement",{visitor:["init","test","update","body"],aliases:["Scopable","Statement","For","BlockParent","Loop"],fields:{init:{validate:(0,a.assertNodeType)("VariableDeclaration","Expression"),optional:!0},test:{validate:(0,a.assertNodeType)("Expression"),optional:!0},update:{validate:(0,a.assertNodeType)("Expression"),optional:!0},body:{validate:(0,a.assertNodeType)("Statement")}}}),(0,o.default)("FunctionDeclaration",{builder:["id","params","body","generator","async"],visitor:["id","params","body","returnType","typeParameters"],fields:{id:{validate:(0,a.assertNodeType)("Identifier")},params:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("LVal")))},body:{validate:(0,a.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,a.assertValueType)("boolean")},async:{default:!1,validate:(0,a.assertValueType)("boolean")}},aliases:["Scopable","Function","BlockParent","FunctionParent","Statement","Pureish","Declaration"]}),(0,o.default)("FunctionExpression",{inherits:"FunctionDeclaration",aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:{id:{validate:(0,a.assertNodeType)("Identifier"),optional:!0},params:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("LVal")))},body:{validate:(0,a.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,a.assertValueType)("boolean")},async:{default:!1,validate:(0,a.assertValueType)("boolean")}}}),(0,o.default)("Identifier",{builder:["name"],visitor:["typeAnnotation"],aliases:["Expression","LVal"],fields:{name:{validate:function(e,t,r){i.isValidIdentifier(r)}},decorators:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Decorator")))}}}),(0,o.default)("IfStatement",{visitor:["test","consequent","alternate"],aliases:["Statement","Conditional"],fields:{test:{validate:(0,a.assertNodeType)("Expression")},consequent:{validate:(0,a.assertNodeType)("Statement")},alternate:{optional:!0,validate:(0,a.assertNodeType)("Statement")}}}),(0,o.default)("LabeledStatement",{visitor:["label","body"],aliases:["Statement"],fields:{label:{validate:(0,a.assertNodeType)("Identifier")},body:{validate:(0,a.assertNodeType)("Statement")}}}),(0,o.default)("StringLiteral",{builder:["value"],fields:{value:{validate:(0,a.assertValueType)("string")}},aliases:["Expression","Pureish","Literal","Immutable"]}),(0,o.default)("NumericLiteral",{builder:["value"],deprecatedAlias:"NumberLiteral",fields:{value:{validate:(0,a.assertValueType)("number")}},aliases:["Expression","Pureish","Literal","Immutable"]}),(0,o.default)("NullLiteral",{aliases:["Expression","Pureish","Literal","Immutable"]}),(0,o.default)("BooleanLiteral",{builder:["value"],fields:{value:{validate:(0,a.assertValueType)("boolean")}},aliases:["Expression","Pureish","Literal","Immutable"]}),(0,o.default)("RegExpLiteral",{builder:["pattern","flags"],deprecatedAlias:"RegexLiteral",aliases:["Expression","Literal"],fields:{pattern:{validate:(0,a.assertValueType)("string")},flags:{validate:(0,a.assertValueType)("string"),default:""}}}),(0,o.default)("LogicalExpression",{builder:["operator","left","right"],visitor:["left","right"],aliases:["Binary","Expression"],fields:{operator:{validate:a.assertOneOf.apply(void 0,s.LOGICAL_OPERATORS)},left:{validate:(0,a.assertNodeType)("Expression")},right:{validate:(0,a.assertNodeType)("Expression")}}}),(0,o.default)("MemberExpression",{builder:["object","property","computed"],visitor:["object","property"],aliases:["Expression","LVal"],fields:{object:{validate:(0,a.assertNodeType)("Expression")},property:{validate:function(e,t,r){var n=e.computed?"Expression":"Identifier";(0,a.assertNodeType)(n)(e,t,r)}},computed:{default:!1}}}),(0,o.default)("NewExpression",{visitor:["callee","arguments"],aliases:["Expression"],fields:{callee:{validate:(0,a.assertNodeType)("Expression")},arguments:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Expression","SpreadElement")))}}}),(0,o.default)("Program",{visitor:["directives","body"],builder:["body","directives"],fields:{directives:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Directive"))),default:[]},body:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Statement")))}},aliases:["Scopable","BlockParent","Block","FunctionParent"]}),(0,o.default)("ObjectExpression",{visitor:["properties"],aliases:["Expression"],fields:{properties:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("ObjectMethod","ObjectProperty","SpreadProperty")))}}}),(0,o.default)("ObjectMethod",{builder:["kind","key","params","body","computed"],fields:{kind:{validate:(0,a.chain)((0,a.assertValueType)("string"),(0,a.assertOneOf)("method","get","set")),default:"method"},computed:{validate:(0,a.assertValueType)("boolean"),default:!1},key:{validate:function(e,t,r){var n=e.computed?["Expression"]:["Identifier","StringLiteral","NumericLiteral"];a.assertNodeType.apply(void 0,n)(e,t,r)}},decorators:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Decorator")))}, body:{validate:(0,a.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,a.assertValueType)("boolean")},async:{default:!1,validate:(0,a.assertValueType)("boolean")}},visitor:["key","params","body","decorators","returnType","typeParameters"],aliases:["UserWhitespacable","Function","Scopable","BlockParent","FunctionParent","Method","ObjectMember"]}),(0,o.default)("ObjectProperty",{builder:["key","value","computed","shorthand","decorators"],fields:{computed:{validate:(0,a.assertValueType)("boolean"),default:!1},key:{validate:function(e,t,r){var n=e.computed?["Expression"]:["Identifier","StringLiteral","NumericLiteral"];a.assertNodeType.apply(void 0,n)(e,t,r)}},value:{validate:(0,a.assertNodeType)("Expression","Pattern","RestElement")},shorthand:{validate:(0,a.assertValueType)("boolean"),default:!1},decorators:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Decorator"))),optional:!0}},visitor:["key","value","decorators"],aliases:["UserWhitespacable","Property","ObjectMember"]}),(0,o.default)("RestElement",{visitor:["argument","typeAnnotation"],aliases:["LVal"],fields:{argument:{validate:(0,a.assertNodeType)("LVal")},decorators:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Decorator")))}}}),(0,o.default)("ReturnStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:(0,a.assertNodeType)("Expression"),optional:!0}}}),(0,o.default)("SequenceExpression",{visitor:["expressions"],fields:{expressions:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Expression")))}},aliases:["Expression"]}),(0,o.default)("SwitchCase",{visitor:["test","consequent"],fields:{test:{validate:(0,a.assertNodeType)("Expression"),optional:!0},consequent:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Statement")))}}}),(0,o.default)("SwitchStatement",{visitor:["discriminant","cases"],aliases:["Statement","BlockParent","Scopable"],fields:{discriminant:{validate:(0,a.assertNodeType)("Expression")},cases:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("SwitchCase")))}}}),(0,o.default)("ThisExpression",{aliases:["Expression"]}),(0,o.default)("ThrowStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:(0,a.assertNodeType)("Expression")}}}),(0,o.default)("TryStatement",{visitor:["block","handler","finalizer"],aliases:["Statement"],fields:{body:{validate:(0,a.assertNodeType)("BlockStatement")},handler:{optional:!0,handler:(0,a.assertNodeType)("BlockStatement")},finalizer:{optional:!0,validate:(0,a.assertNodeType)("BlockStatement")}}}),(0,o.default)("UnaryExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!0},argument:{validate:(0,a.assertNodeType)("Expression")},operator:{validate:a.assertOneOf.apply(void 0,s.UNARY_OPERATORS)}},visitor:["argument"],aliases:["UnaryLike","Expression"]}),(0,o.default)("UpdateExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!1},argument:{validate:(0,a.assertNodeType)("Expression")},operator:{validate:a.assertOneOf.apply(void 0,s.UPDATE_OPERATORS)}},visitor:["argument"],aliases:["Expression"]}),(0,o.default)("VariableDeclaration",{builder:["kind","declarations"],visitor:["declarations"],aliases:["Statement","Declaration"],fields:{kind:{validate:(0,a.chain)((0,a.assertValueType)("string"),(0,a.assertOneOf)("var","let","const"))},declarations:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("VariableDeclarator")))}}}),(0,o.default)("VariableDeclarator",{visitor:["id","init"],fields:{id:{validate:(0,a.assertNodeType)("LVal")},init:{optional:!0,validate:(0,a.assertNodeType)("Expression")}}}),(0,o.default)("WhileStatement",{visitor:["test","body"],aliases:["Statement","BlockParent","Loop","While","Scopable"],fields:{test:{validate:(0,a.assertNodeType)("Expression")},body:{validate:(0,a.assertNodeType)("BlockStatement","Statement")}}}),(0,o.default)("WithStatement",{visitor:["object","body"],aliases:["Statement"],fields:{object:{object:(0,a.assertNodeType)("Expression")},body:{validate:(0,a.assertNodeType)("BlockStatement","Statement")}}})},function(e,t,r){"use strict";var n=r(26),i=function(e){return e&&e.__esModule?e:{default:e}}(n);(0,i.default)("AssignmentPattern",{visitor:["left","right"],aliases:["Pattern","LVal"],fields:{left:{validate:(0,n.assertNodeType)("Identifier")},right:{validate:(0,n.assertNodeType)("Expression")},decorators:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Decorator")))}}}),(0,i.default)("ArrayPattern",{visitor:["elements","typeAnnotation"],aliases:["Pattern","LVal"],fields:{elements:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Identifier","Pattern","RestElement")))},decorators:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Decorator")))}}}),(0,i.default)("ArrowFunctionExpression",{builder:["params","body","async"],visitor:["params","body","returnType","typeParameters"],aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:{params:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("LVal")))},body:{validate:(0,n.assertNodeType)("BlockStatement","Expression")},async:{validate:(0,n.assertValueType)("boolean"),default:!1}}}),(0,i.default)("ClassBody",{visitor:["body"],fields:{body:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("ClassMethod","ClassProperty")))}}}),(0,i.default)("ClassDeclaration",{builder:["id","superClass","body","decorators"],visitor:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],aliases:["Scopable","Class","Statement","Declaration","Pureish"],fields:{id:{validate:(0,n.assertNodeType)("Identifier")},body:{validate:(0,n.assertNodeType)("ClassBody")},superClass:{optional:!0,validate:(0,n.assertNodeType)("Expression")},decorators:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Decorator")))}}}),(0,i.default)("ClassExpression",{inherits:"ClassDeclaration",aliases:["Scopable","Class","Expression","Pureish"],fields:{id:{optional:!0,validate:(0,n.assertNodeType)("Identifier")},body:{validate:(0,n.assertNodeType)("ClassBody")},superClass:{optional:!0,validate:(0,n.assertNodeType)("Expression")},decorators:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Decorator")))}}}),(0,i.default)("ExportAllDeclaration",{visitor:["source"],aliases:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],fields:{source:{validate:(0,n.assertNodeType)("StringLiteral")}}}),(0,i.default)("ExportDefaultDeclaration",{visitor:["declaration"],aliases:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],fields:{declaration:{validate:(0,n.assertNodeType)("FunctionDeclaration","ClassDeclaration","Expression")}}}),(0,i.default)("ExportNamedDeclaration",{visitor:["declaration","specifiers","source"],aliases:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],fields:{declaration:{validate:(0,n.assertNodeType)("Declaration"),optional:!0},specifiers:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("ExportSpecifier")))},source:{validate:(0,n.assertNodeType)("StringLiteral"),optional:!0}}}),(0,i.default)("ExportSpecifier",{visitor:["local","exported"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,n.assertNodeType)("Identifier")},exported:{validate:(0,n.assertNodeType)("Identifier")}}}),(0,i.default)("ForOfStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:(0,n.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0,n.assertNodeType)("Expression")},body:{validate:(0,n.assertNodeType)("Statement")}}}),(0,i.default)("ImportDeclaration",{visitor:["specifiers","source"],aliases:["Statement","Declaration","ModuleDeclaration"],fields:{specifiers:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("ImportSpecifier","ImportDefaultSpecifier","ImportNamespaceSpecifier")))},source:{validate:(0,n.assertNodeType)("StringLiteral")}}}),(0,i.default)("ImportDefaultSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,n.assertNodeType)("Identifier")}}}),(0,i.default)("ImportNamespaceSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,n.assertNodeType)("Identifier")}}}),(0,i.default)("ImportSpecifier",{visitor:["local","imported"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,n.assertNodeType)("Identifier")},imported:{validate:(0,n.assertNodeType)("Identifier")},importKind:{validate:(0,n.assertOneOf)(null,"type","typeof")}}}),(0,i.default)("MetaProperty",{visitor:["meta","property"],aliases:["Expression"],fields:{meta:{validate:(0,n.assertValueType)("string")},property:{validate:(0,n.assertValueType)("string")}}}),(0,i.default)("ClassMethod",{aliases:["Function","Scopable","BlockParent","FunctionParent","Method"],builder:["kind","key","params","body","computed","static"],visitor:["key","params","body","decorators","returnType","typeParameters"],fields:{kind:{validate:(0,n.chain)((0,n.assertValueType)("string"),(0,n.assertOneOf)("get","set","method","constructor")),default:"method"},computed:{default:!1,validate:(0,n.assertValueType)("boolean")},static:{default:!1,validate:(0,n.assertValueType)("boolean")},key:{validate:function(e,t,r){var i=e.computed?["Expression"]:["Identifier","StringLiteral","NumericLiteral"];n.assertNodeType.apply(void 0,i)(e,t,r)}},params:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("LVal")))},body:{validate:(0,n.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,n.assertValueType)("boolean")},async:{default:!1,validate:(0,n.assertValueType)("boolean")}}}),(0,i.default)("ObjectPattern",{visitor:["properties","typeAnnotation"],aliases:["Pattern","LVal"],fields:{properties:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("RestProperty","Property")))},decorators:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Decorator")))}}}),(0,i.default)("SpreadElement",{visitor:["argument"],aliases:["UnaryLike"],fields:{argument:{validate:(0,n.assertNodeType)("Expression")}}}),(0,i.default)("Super",{aliases:["Expression"]}),(0,i.default)("TaggedTemplateExpression",{visitor:["tag","quasi"],aliases:["Expression"],fields:{tag:{validate:(0,n.assertNodeType)("Expression")},quasi:{validate:(0,n.assertNodeType)("TemplateLiteral")}}}),(0,i.default)("TemplateElement",{builder:["value","tail"],fields:{value:{},tail:{validate:(0,n.assertValueType)("boolean"),default:!1}}}),(0,i.default)("TemplateLiteral",{visitor:["quasis","expressions"],aliases:["Expression","Literal"],fields:{quasis:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("TemplateElement")))},expressions:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Expression")))}}}),(0,i.default)("YieldExpression",{builder:["argument","delegate"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{delegate:{validate:(0,n.assertValueType)("boolean"),default:!1},argument:{optional:!0,validate:(0,n.assertNodeType)("Expression")}}})},function(e,t,r){"use strict";var n=r(26),i=function(e){return e&&e.__esModule?e:{default:e}}(n);(0,i.default)("AwaitExpression",{builder:["argument"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{argument:{validate:(0,n.assertNodeType)("Expression")}}}),(0,i.default)("ForAwaitStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:(0,n.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0,n.assertNodeType)("Expression")},body:{validate:(0,n.assertNodeType)("Statement")}}}),(0,i.default)("BindExpression",{visitor:["object","callee"],aliases:["Expression"],fields:{}}),(0,i.default)("Import",{aliases:["Expression"]}),(0,i.default)("Decorator",{visitor:["expression"],fields:{expression:{validate:(0,n.assertNodeType)("Expression")}}}),(0,i.default)("DoExpression",{visitor:["body"],aliases:["Expression"],fields:{body:{validate:(0,n.assertNodeType)("BlockStatement")}}}),(0,i.default)("ExportDefaultSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0,n.assertNodeType)("Identifier")}}}),(0,i.default)("ExportNamespaceSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0,n.assertNodeType)("Identifier")}}}),(0,i.default)("RestProperty",{visitor:["argument"],aliases:["UnaryLike"],fields:{argument:{validate:(0,n.assertNodeType)("LVal")}}}),(0,i.default)("SpreadProperty",{visitor:["argument"],aliases:["UnaryLike"],fields:{argument:{validate:(0,n.assertNodeType)("Expression")}}})},function(e,t,r){"use strict";var n=r(26),i=function(e){return e&&e.__esModule?e:{default:e}}(n);(0,i.default)("AnyTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,i.default)("ArrayTypeAnnotation",{visitor:["elementType"],aliases:["Flow"],fields:{}}),(0,i.default)("BooleanTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,i.default)("BooleanLiteralTypeAnnotation",{aliases:["Flow"],fields:{}}),(0,i.default)("NullLiteralTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,i.default)("ClassImplements",{visitor:["id","typeParameters"],aliases:["Flow"],fields:{}}),(0,i.default)("ClassProperty",{visitor:["key","value","typeAnnotation","decorators"],builder:["key","value","typeAnnotation","decorators","computed"],aliases:["Property"],fields:{computed:{validate:(0,n.assertValueType)("boolean"),default:!1}}}),(0,i.default)("DeclareClass",{visitor:["id","typeParameters","extends","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareFunction",{visitor:["id"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareInterface",{visitor:["id","typeParameters","extends","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareModule",{visitor:["id","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareModuleExports",{visitor:["typeAnnotation"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareTypeAlias",{visitor:["id","typeParameters","right"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareOpaqueType",{visitor:["id","typeParameters","supertype"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareVariable",{visitor:["id"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareExportDeclaration",{visitor:["declaration","specifiers","source"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("ExistentialTypeParam",{aliases:["Flow"]}),(0,i.default)("FunctionTypeAnnotation",{visitor:["typeParameters","params","rest","returnType"],aliases:["Flow"],fields:{}}),(0,i.default)("FunctionTypeParam",{visitor:["name","typeAnnotation"],aliases:["Flow"],fields:{}}),(0,i.default)("GenericTypeAnnotation",{visitor:["id","typeParameters"],aliases:["Flow"],fields:{}}),(0,i.default)("InterfaceExtends",{visitor:["id","typeParameters"],aliases:["Flow"],fields:{}}),(0,i.default)("InterfaceDeclaration",{visitor:["id","typeParameters","extends","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("IntersectionTypeAnnotation",{visitor:["types"],aliases:["Flow"],fields:{}}),(0,i.default)("MixedTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"]}),(0,i.default)("EmptyTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"]}),(0,i.default)("NullableTypeAnnotation",{visitor:["typeAnnotation"],aliases:["Flow"],fields:{}}),(0,i.default)("NumericLiteralTypeAnnotation",{aliases:["Flow"],fields:{}}),(0,i.default)("NumberTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,i.default)("StringLiteralTypeAnnotation",{aliases:["Flow"],fields:{}}),(0,i.default)("StringTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,i.default)("ThisTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,i.default)("TupleTypeAnnotation",{visitor:["types"],aliases:["Flow"],fields:{}}),(0,i.default)("TypeofTypeAnnotation",{visitor:["argument"],aliases:["Flow"],fields:{}}),(0,i.default)("TypeAlias",{visitor:["id","typeParameters","right"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("OpaqueType",{visitor:["id","typeParameters","impltype","supertype"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("TypeAnnotation",{visitor:["typeAnnotation"],aliases:["Flow"],fields:{}}),(0,i.default)("TypeCastExpression",{visitor:["expression","typeAnnotation"],aliases:["Flow","ExpressionWrapper","Expression"],fields:{}}),(0,i.default)("TypeParameter",{visitor:["bound"],aliases:["Flow"],fields:{}}),(0,i.default)("TypeParameterDeclaration",{visitor:["params"],aliases:["Flow"],fields:{}}),(0,i.default)("TypeParameterInstantiation",{visitor:["params"],aliases:["Flow"],fields:{}}),(0,i.default)("ObjectTypeAnnotation",{visitor:["properties","indexers","callProperties"],aliases:["Flow"],fields:{}}),(0,i.default)("ObjectTypeCallProperty",{visitor:["value"],aliases:["Flow","UserWhitespacable"],fields:{}}),(0,i.default)("ObjectTypeIndexer",{visitor:["id","key","value"],aliases:["Flow","UserWhitespacable"],fields:{}}),(0,i.default)("ObjectTypeProperty",{visitor:["key","value"],aliases:["Flow","UserWhitespacable"],fields:{}}),(0,i.default)("ObjectTypeSpreadProperty",{visitor:["argument"],aliases:["Flow","UserWhitespacable"],fields:{}}),(0,i.default)("QualifiedTypeIdentifier",{visitor:["id","qualification"],aliases:["Flow"],fields:{}}),(0,i.default)("UnionTypeAnnotation",{visitor:["types"],aliases:["Flow"],fields:{}}),(0,i.default)("VoidTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}})},function(e,t,r){"use strict";r(26),r(386),r(387),r(389),r(391),r(392),r(388)},function(e,t,r){"use strict";var n=r(26),i=function(e){return e&&e.__esModule?e:{default:e}}(n);(0,i.default)("JSXAttribute",{visitor:["name","value"],aliases:["JSX","Immutable"],fields:{name:{validate:(0,n.assertNodeType)("JSXIdentifier","JSXNamespacedName")},value:{optional:!0,validate:(0,n.assertNodeType)("JSXElement","StringLiteral","JSXExpressionContainer")}}}),(0,i.default)("JSXClosingElement",{visitor:["name"],aliases:["JSX","Immutable"],fields:{name:{validate:(0,n.assertNodeType)("JSXIdentifier","JSXMemberExpression")}}}),(0,i.default)("JSXElement",{builder:["openingElement","closingElement","children","selfClosing"],visitor:["openingElement","children","closingElement"],aliases:["JSX","Immutable","Expression"],fields:{openingElement:{validate:(0,n.assertNodeType)("JSXOpeningElement")},closingElement:{optional:!0,validate:(0,n.assertNodeType)("JSXClosingElement")},children:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("JSXText","JSXExpressionContainer","JSXSpreadChild","JSXElement")))}}}),(0,i.default)("JSXEmptyExpression",{aliases:["JSX","Expression"]}),(0,i.default)("JSXExpressionContainer",{visitor:["expression"],aliases:["JSX","Immutable"],fields:{expression:{validate:(0,n.assertNodeType)("Expression")}}}),(0,i.default)("JSXSpreadChild",{visitor:["expression"],aliases:["JSX","Immutable"],fields:{expression:{validate:(0,n.assertNodeType)("Expression")}}}),(0,i.default)("JSXIdentifier",{builder:["name"],aliases:["JSX","Expression"],fields:{name:{validate:(0,n.assertValueType)("string")}}}),(0,i.default)("JSXMemberExpression",{visitor:["object","property"],aliases:["JSX","Expression"],fields:{object:{validate:(0,n.assertNodeType)("JSXMemberExpression","JSXIdentifier")},property:{validate:(0,n.assertNodeType)("JSXIdentifier")}}}),(0,i.default)("JSXNamespacedName",{visitor:["namespace","name"],aliases:["JSX"],fields:{namespace:{validate:(0,n.assertNodeType)("JSXIdentifier")},name:{validate:(0,n.assertNodeType)("JSXIdentifier")}}}),(0,i.default)("JSXOpeningElement",{builder:["name","attributes","selfClosing"],visitor:["name","attributes"],aliases:["JSX","Immutable"],fields:{name:{validate:(0,n.assertNodeType)("JSXIdentifier","JSXMemberExpression")},selfClosing:{default:!1,validate:(0,n.assertValueType)("boolean")},attributes:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("JSXAttribute","JSXSpreadAttribute")))}}}),(0,i.default)("JSXSpreadAttribute",{visitor:["argument"],aliases:["JSX"],fields:{argument:{validate:(0,n.assertNodeType)("Expression")}}}),(0,i.default)("JSXText",{aliases:["JSX","Immutable"],builder:["value"],fields:{value:{validate:(0,n.assertValueType)("string")}}})},function(e,t,r){"use strict";var n=r(26),i=function(e){return e&&e.__esModule?e:{default:e}}(n);(0,i.default)("Noop",{visitor:[]}),(0,i.default)("ParenthesizedExpression",{visitor:["expression"],aliases:["Expression","ExpressionWrapper"],fields:{expression:{validate:(0,n.assertNodeType)("Expression")}}})},function(e,t,r){"use strict";function n(e){var t=i(e);return 1===t.length?t[0]:o.unionTypeAnnotation(t)}function i(e){for(var t={},r={},n=[],s=[],a=0;a<e.length;a++){var u=e[a];if(u&&!(s.indexOf(u)>=0)){if(o.isAnyTypeAnnotation(u))return[u];if(o.isFlowBaseAnnotation(u))r[u.type]=u;else if(o.isUnionTypeAnnotation(u))n.indexOf(u.types)<0&&(e=e.concat(u.types),n.push(u.types));else if(o.isGenericTypeAnnotation(u)){var l=u.id.name;if(t[l]){var c=t[l];c.typeParameters?u.typeParameters&&(c.typeParameters.params=i(c.typeParameters.params.concat(u.typeParameters.params))):c=u.typeParameters}else t[l]=u}else s.push(u)}}for(var f in r)s.push(r[f]);for(var p in t)s.push(t[p]);return s}function s(e){if("string"===e)return o.stringTypeAnnotation();if("number"===e)return o.numberTypeAnnotation();if("undefined"===e)return o.voidTypeAnnotation();if("boolean"===e)return o.booleanTypeAnnotation();if("function"===e)return o.genericTypeAnnotation(o.identifier("Function"));if("object"===e)return o.genericTypeAnnotation(o.identifier("Object"));if("symbol"===e)return o.genericTypeAnnotation(o.identifier("Symbol"));throw new Error("Invalid typeof value")}t.__esModule=!0,t.createUnionTypeAnnotation=n,t.removeTypeDuplicates=i,t.createTypeAnnotationBasedOnTypeof=s;var a=r(1),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(a)},function(e,t,r){"use strict";function n(e){return!!e&&/^[a-z]|\-/.test(e)}function i(e,t){for(var r=e.value.split(/\r\n|\n|\r/),n=0,i=0;i<r.length;i++)r[i].match(/[^ \t]/)&&(n=i);for(var s="",a=0;a<r.length;a++){var u=r[a],l=0===a,c=a===r.length-1,f=a===n,p=u.replace(/\t/g," ");l||(p=p.replace(/^[ ]+/,"")),c||(p=p.replace(/[ ]+$/,"")),p&&(f||(p+=" "),s+=p)}s&&t.push(o.stringLiteral(s))}function s(e){for(var t=[],r=0;r<e.children.length;r++){var n=e.children[r];o.isJSXText(n)?i(n,t):(o.isJSXExpressionContainer(n)&&(n=n.expression),o.isJSXEmptyExpression(n)||t.push(n))}return t}t.__esModule=!0,t.isReactComponent=void 0,t.isCompatTag=n,t.buildChildren=s;var a=r(1),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(a);t.isReactComponent=o.buildMatchMemberExpression("React.Component")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r=E.getBindingIdentifiers.keys[t.type];if(r)for(var n=0;n<r.length;n++){var i=r[n],s=t[i];if(Array.isArray(s)){if(s.indexOf(e)>=0)return!0}else if(s===e)return!0}return!1}function s(e,t){switch(t.type){case"BindExpression":return t.object===e||t.callee===e;case"MemberExpression":case"JSXMemberExpression":return!(t.property!==e||!t.computed)||t.object===e;case"MetaProperty":return!1;case"ObjectProperty":if(t.key===e)return t.computed;case"VariableDeclarator":return t.id!==e;case"ArrowFunctionExpression":case"FunctionDeclaration":case"FunctionExpression":for(var r=t.params,n=Array.isArray(r),i=0,r=n?r:(0,b.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}if(s===e)return!1}return t.id!==e;case"ExportSpecifier":return!t.source&&t.local===e;case"ExportNamespaceSpecifier":case"ExportDefaultSpecifier":return!1;case"JSXAttribute":return t.name!==e;case"ClassProperty":return t.key===e?t.computed:t.value===e;case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"ImportSpecifier":return!1;case"ClassDeclaration":case"ClassExpression":return t.id!==e;case"ClassMethod":case"ObjectMethod":return t.key===e&&t.computed;case"LabeledStatement":return!1;case"CatchClause":return t.param!==e;case"RestElement":return!1;case"AssignmentExpression":case"AssignmentPattern":return t.right===e;case"ObjectPattern":case"ArrayPattern":return!1}return!0}function a(e){return"string"==typeof e&&!A.default.keyword.isReservedWordES6(e,!0)&&("await"!==e&&A.default.keyword.isIdentifierNameES6(e))}function o(e){return _.isVariableDeclaration(e)&&("var"!==e.kind||e[D.BLOCK_SCOPED_SYMBOL])}function u(e){return _.isFunctionDeclaration(e)||_.isClassDeclaration(e)||_.isLet(e)}function l(e){return _.isVariableDeclaration(e,{kind:"var"})&&!e[D.BLOCK_SCOPED_SYMBOL]}function c(e){return _.isImportDefaultSpecifier(e)||_.isIdentifier(e.imported||e.exported,{name:"default"})}function f(e,t){return(!_.isBlockStatement(e)||!_.isFunction(t,{body:e}))&&_.isScopable(e)}function p(e){return!!_.isType(e.type,"Immutable")||!!_.isIdentifier(e)&&"undefined"===e.name}function d(e,t){if("object"!==(void 0===e?"undefined":(0,v.default)(e))||"object"!==(void 0===e?"undefined":(0,v.default)(e))||null==e||null==t)return e===t;if(e.type!==t.type)return!1;for(var r=(0,m.default)(_.NODE_FIELDS[e.type]||e.type),n=r,i=Array.isArray(n),s=0,n=i?n:(0,b.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a;if((0,v.default)(e[o])!==(0,v.default)(t[o]))return!1;if(Array.isArray(e[o])){if(!Array.isArray(t[o]))return!1;if(e[o].length!==t[o].length)return!1;for(var u=0;u<e[o].length;u++)if(!d(e[o][u],t[o][u]))return!1}else if(!d(e[o],t[o]))return!1}return!0}t.__esModule=!0;var h=r(14),m=n(h),y=r(11),v=n(y),g=r(2),b=n(g);t.isBinding=i,t.isReferenced=s,t.isValidIdentifier=a,t.isLet=o,t.isBlockScoped=u,t.isVar=l,t.isSpecifierDefault=c,t.isScope=f,t.isImmutable=p,t.isNodesEquivalent=d;var E=r(226),x=r(97),A=n(x),S=r(1),_=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(S),D=r(135)},function(e,t){"use strict";function r(e,t,r){e instanceof RegExp&&(e=n(e,r)),t instanceof RegExp&&(t=n(t,r));var s=i(e,t,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+e.length,s[1]),post:r.slice(s[1]+t.length)}}function n(e,t){var r=t.match(e);return r?r[0]:null}function i(e,t,r){var n,i,s,a,o,u=r.indexOf(e),l=r.indexOf(t,u+1),c=u;if(u>=0&&l>0){for(n=[],s=r.length;c>=0&&!o;)c==u?(n.push(c),u=r.indexOf(e,c+1)):1==n.length?o=[n.pop(),l]:(i=n.pop(),i<s&&(s=i,a=l),l=r.indexOf(t,c+1)),c=u<l&&u>=0?u:l;n.length&&(o=[s,a])}return o}e.exports=r,r.range=i},function(e,t){"use strict";function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function n(e){return 3*e.length/4-r(e)}function i(e){var t,n,i,s,a,o=e.length;s=r(e),a=new c(3*o/4-s),n=s>0?o-4:o;var u=0;for(t=0;t<n;t+=4)i=l[e.charCodeAt(t)]<<18|l[e.charCodeAt(t+1)]<<12|l[e.charCodeAt(t+2)]<<6|l[e.charCodeAt(t+3)],a[u++]=i>>16&255,a[u++]=i>>8&255,a[u++]=255&i;return 2===s?(i=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,a[u++]=255&i):1===s&&(i=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a}function s(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function a(e,t,r){for(var n,i=[],a=t;a<r;a+=3)n=(e[a]<<16)+(e[a+1]<<8)+e[a+2],i.push(s(n));return i.join("")}function o(e){for(var t,r=e.length,n=r%3,i="",s=[],o=0,l=r-n;o<l;o+=16383)s.push(a(e,o,o+16383>l?l:o+16383));return 1===n?(t=e[r-1],i+=u[t>>2],i+=u[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=u[t>>10],i+=u[t>>4&63],i+=u[t<<2&63],i+="="),s.push(i),s.join("")}t.byteLength=n,t.toByteArray=i,t.fromByteArray=o;for(var u=[],l=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,d=f.length;p<d;++p)u[p]=f[p],l[f.charCodeAt(p)]=p;l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},function(e,t,r){"use strict";function n(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function i(e){return e.split("\\\\").join(m).split("\\{").join(y).split("\\}").join(v).split("\\,").join(g).split("\\.").join(b)}function s(e){return e.split(m).join("\\").split(y).join("{").split(v).join("}").split(g).join(",").split(b).join(".")}function a(e){if(!e)return[""];var t=[],r=h("{","}",e);if(!r)return e.split(",");var n=r.pre,i=r.body,s=r.post,o=n.split(",");o[o.length-1]+="{"+i+"}";var u=a(s);return s.length&&(o[o.length-1]+=u.shift(),o.push.apply(o,u)),t.push.apply(t,o),t}function o(e){return e?("{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2)),p(i(e),!0).map(s)):[]}function u(e){return"{"+e+"}"}function l(e){return/^-?0\d/.test(e)}function c(e,t){return e<=t}function f(e,t){return e>=t}function p(e,t){var r=[],i=h("{","}",e);if(!i||/\$$/.test(i.pre))return[e];var s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),m=s||o,y=i.body.indexOf(",")>=0;if(!m&&!y)return i.post.match(/,.*\}/)?(e=i.pre+"{"+i.body+v+i.post,p(e)):[e];var g;if(m)g=i.body.split(/\.\./);else if(g=a(i.body),1===g.length&&(g=p(g[0],!1).map(u),1===g.length)){var b=i.post.length?p(i.post,!1):[""];return b.map(function(e){return i.pre+g[0]+e})}var E,x=i.pre,b=i.post.length?p(i.post,!1):[""];if(m){var A=n(g[0]),S=n(g[1]),_=Math.max(g[0].length,g[1].length),D=3==g.length?Math.abs(n(g[2])):1,C=c;S<A&&(D*=-1,C=f);var w=g.some(l);E=[];for(var P=A;C(P,S);P+=D){var k;if(o)"\\"===(k=String.fromCharCode(P))&&(k="");else if(k=String(P),w){var F=_-k.length;if(F>0){var T=new Array(F+1).join("0");k=P<0?"-"+T+k.slice(1):T+k}}E.push(k)}}else E=d(g,function(e){return p(e,!1)});for(var O=0;O<E.length;O++)for(var B=0;B<b.length;B++){var R=x+E[O]+b[B];(!t||m||R)&&r.push(R)}return r}var d=r(402),h=r(396);e.exports=o;var m="\0SLASH"+Math.random()+"\0",y="\0OPEN"+Math.random()+"\0",v="\0CLOSE"+Math.random()+"\0",g="\0COMMA"+Math.random()+"\0",b="\0PERIOD"+Math.random()+"\0"},function(e,t,r){(function(e){"use strict";function n(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(n()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=s.prototype):(null===e&&(e=new s(t)),e.length=t),e}function s(e,t,r){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return a(this,e,t,r)}function a(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number') ;return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?p(e,t,r,n):"string"==typeof t?c(e,t,r):d(e,t)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t,r,n){return o(t),t<=0?i(e,t):void 0!==r?"string"==typeof n?i(e,t).fill(r,n):i(e,t).fill(r):i(e,t)}function l(e,t){if(o(t),e=i(e,t<0?0:0|h(t)),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function c(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|y(t,r);e=i(e,n);var a=e.write(t,r);return a!==n&&(e=e.slice(0,a)),e}function f(e,t){var r=t.length<0?0:0|h(t.length);e=i(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function p(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),s.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=s.prototype):e=f(e,t),e}function d(e,t){if(s.isBuffer(t)){var r=0|h(t.length);return e=i(e,r),0===e.length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||X(t.length)?i(e,0):f(e,t);if("Buffer"===t.type&&Q(t.data))return f(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function h(e){if(e>=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function m(e){return+e!=e&&(e=0),s.alloc(+e)}function y(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(n)return Y(e).length;t=(""+t).toLowerCase(),n=!0}}function v(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return P(this,t,r);case"ascii":return F(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return w(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:E(e,t,r,n,i);if("number"==typeof t)return t&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):E(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function E(e,t,r,n,i){function s(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var a=1,o=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,o/=2,u/=2,r/=2}var l;if(i){var c=-1;for(l=r;l<o;l++)if(s(e,l)===s(t,-1===c?0:l-c)){if(-1===c&&(c=l),l-c+1===u)return c*a}else-1!==c&&(l-=l-c),c=-1}else for(r+u>o&&(r=o-u),l=r;l>=0;l--){for(var f=!0,p=0;p<u;p++)if(s(e,l+p)!==s(t,p)){f=!1;break}if(f)return l}return-1}function x(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var a=0;a<n;++a){var o=parseInt(t.substr(2*a,2),16);if(isNaN(o))return a;e[r+a]=o}return a}function A(e,t,r,n){return J(Y(t,e.length-r),e,r,n)}function S(e,t,r,n){return J(q(t),e,r,n)}function _(e,t,r,n){return S(e,t,r,n)}function D(e,t,r,n){return J(H(t),e,r,n)}function C(e,t,r,n){return J(K(t,e.length-r),e,r,n)}function w(e,t,r){return 0===t&&r===e.length?z.fromByteArray(e):z.fromByteArray(e.slice(t,r))}function P(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var s=e[i],a=null,o=s>239?4:s>223?3:s>191?2:1;if(i+o<=r){var u,l,c,f;switch(o){case 1:s<128&&(a=s);break;case 2:u=e[i+1],128==(192&u)&&(f=(31&s)<<6|63&u)>127&&(a=f);break;case 3:u=e[i+1],l=e[i+2],128==(192&u)&&128==(192&l)&&(f=(15&s)<<12|(63&u)<<6|63&l)>2047&&(f<55296||f>57343)&&(a=f);break;case 4:u=e[i+1],l=e[i+2],c=e[i+3],128==(192&u)&&128==(192&l)&&128==(192&c)&&(f=(15&s)<<18|(63&u)<<12|(63&l)<<6|63&c)>65535&&f<1114112&&(a=f)}}null===a?(a=65533,o=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=o}return k(n)}function k(e){var t=e.length;if(t<=Z)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Z));return r}function F(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function T(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function O(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",s=t;s<r;++s)i+=W(e[s]);return i}function B(e,t,r){for(var n=e.slice(t,r),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}function R(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,r,n,i,a){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function M(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,s=Math.min(e.length-r,2);i<s;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function N(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,s=Math.min(e.length-r,4);i<s;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function L(e,t,r,n,i,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,n,i){return i||L(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return i||L(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(e,t,r,n,52,8),r+8}function V(e){if(e=G(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function G(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function W(e){return e<16?"0"+e.toString(16):e.toString(16)}function Y(e,t){t=t||1/0;for(var r,n=e.length,i=null,s=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function q(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function K(e,t){for(var r,n,i,s=[],a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,s.push(i),s.push(n);return s}function H(e){return z.toByteArray(V(e))}function J(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function X(e){return e!==e}var z=r(397),$=r(465),Q=r(400);t.Buffer=s,t.SlowBuffer=m,t.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=n(),s.poolSize=8192,s._augment=function(e){return e.__proto__=s.prototype,e},s.from=function(e,t,r){return a(null,e,t,r)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(e,t,r){return u(null,e,t,r)},s.allocUnsafe=function(e){return l(null,e)},s.allocUnsafeSlow=function(e){return l(null,e)},s.isBuffer=function(e){return!(null==e||!e._isBuffer)},s.compare=function(e,t){if(!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Q(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=s.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(!s.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},s.byteLength=y,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},s.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?P(this,0,e):v.apply(this,arguments)},s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},s.prototype.compare=function(e,t,r,n,i){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var a=i-n,o=r-t,u=Math.min(a,o),l=this.slice(n,i),c=e.slice(t,r),f=0;f<u;++f)if(l[f]!==c[f]){a=l[f],o=c[f];break}return a<o?-1:o<a?1:0},s.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},s.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},s.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},s.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":return S(this,e,t,r);case"latin1":case"binary":return _(this,e,t,r);case"base64":return D(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;s.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n;if(s.TYPED_ARRAY_SUPPORT)n=this.subarray(e,t),n.__proto__=s.prototype;else{var i=t-e;n=new s(i,void 0);for(var a=0;a<i;++a)n[a]=this[a+e]}return n},s.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n},s.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},s.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=t,i=1,s=this[e+--n];n>0&&(i*=256);)s+=this[e+--n]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s},s.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),$.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),$.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),$.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),$.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t|=0,r|=0,!n){I(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},s.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t|=0,r|=0,!n){I(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},s.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},s.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);I(this,e,t,r,i-1,-i)}var s=0,a=1,o=0;for(this[t]=255&e;++s<r&&(a*=256);)e<0&&0===o&&0!==this[t+s-1]&&(o=1),this[t+s]=(e/a>>0)-o&255;return t+r},s.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);I(this,e,t,r,i-1,-i)}var s=r-1,a=1,o=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===o&&0!==this[t+s+1]&&(o=1),this[t+s]=(e/a>>0)-o&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},s.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,a=n-r;if(this===e&&r<t&&t<n)for(i=a-1;i>=0;--i)e[i+t]=this[i+r];else if(a<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+a),t);return a},s.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var a;if("number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var o=s.isBuffer(e)?e:Y(new s(e,n).toString()),u=o.length;for(a=0;a<r-t;++a)this[a+t]=o[a%u]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(t,function(){return this}())},function(e,t){"use strict";var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){(function(t){"use strict";function n(e){this.enabled=e&&void 0!==e.enabled?e.enabled:c}function i(e){var t=function e(){return s.apply(e,arguments)};return t._styles=e,t.enabled=this.enabled,t.__proto__=h,t}function s(){var e=arguments,t=e.length,r=0!==t&&String(arguments[0]);if(t>1)for(var n=1;n<t;n++)r+=" "+e[n];if(!this.enabled||!r)return r;var i=this._styles,s=i.length,a=o.dim.open;for(!p||-1===i.indexOf("gray")&&-1===i.indexOf("grey")||(o.dim.open="");s--;){var u=o[i[s]];r=u.open+r.replace(u.closeRe,u.open)+u.close}return o.dim.open=a,r}var a=r(460),o=r(289),u=r(622),l=r(464),c=r(623),f=Object.defineProperties,p="win32"===t.platform&&!/^xterm/i.test(t.env.TERM);p&&(o.blue.open="[94m");var d=function(){var e={};return Object.keys(o).forEach(function(t){o[t].closeRe=new RegExp(a(o[t].close),"g"),e[t]={get:function(){return i.call(this,this._styles.concat(t))}}}),e}(),h=f(function(){},d);f(n.prototype,function(){var e={};return Object.keys(d).forEach(function(t){e[t]={get:function(){return i.call(this,[t])}}}),e}()),e.exports=new n,e.exports.styles=o,e.exports.hasColor=l,e.exports.stripColor=u,e.exports.supportsColor=c}).call(t,r(8))},function(e,t){"use strict";e.exports=function(e,t){for(var n=[],i=0;i<e.length;i++){var s=t(e[i],i);r(s)?n.push.apply(n,s):n.push(s)}return n};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){(function(e){"use strict";function n(t){return new e(t,"base64").toString()}function i(e){return e.split(",").pop()}function s(e,r){var n=t.mapFileCommentRegex.exec(e),i=n[1]||n[2],s=u.resolve(r,i);try{return o.readFileSync(s,"utf8")}catch(e){throw new Error("An error occurred while trying to read the map file at "+s+"\n"+e)}}function a(e,t){t=t||{},t.isFileComment&&(e=s(e,t.commentFileDir)),t.hasComment&&(e=i(e)),t.isEncoded&&(e=n(e)),(t.isJSON||t.isEncoded)&&(e=JSON.parse(e)),this.sourcemap=e}var o=r(115),u=r(19);Object.defineProperty(t,"commentRegex",{get:function(){return/^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/gm}}),Object.defineProperty(t,"mapFileCommentRegex",{get:function(){return/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/gm}}),a.prototype.toJSON=function(e){return JSON.stringify(this.sourcemap,null,e)},a.prototype.toBase64=function(){var t=this.toJSON();return new e(t).toString("base64")},a.prototype.toComment=function(e){var t=this.toBase64(),r="sourceMappingURL=data:application/json;charset=utf-8;base64,"+t;return e&&e.multiline?"/*# "+r+" */":"//# "+r},a.prototype.toObject=function(){return JSON.parse(this.toJSON())},a.prototype.addProperty=function(e,t){if(this.sourcemap.hasOwnProperty(e))throw new Error("property %s already exists on the sourcemap, use set property instead");return this.setProperty(e,t)},a.prototype.setProperty=function(e,t){return this.sourcemap[e]=t,this},a.prototype.getProperty=function(e){return this.sourcemap[e]},t.fromObject=function(e){return new a(e)},t.fromJSON=function(e){return new a(e,{isJSON:!0})},t.fromBase64=function(e){return new a(e,{isEncoded:!0})},t.fromComment=function(e){return e=e.replace(/^\/\*/g,"//").replace(/\*\/$/g,""),new a(e,{isEncoded:!0,hasComment:!0})},t.fromMapFileComment=function(e,t){return new a(e,{commentFileDir:t,isFileComment:!0,isJSON:!0})},t.fromSource=function(e){var r=e.match(t.commentRegex);return r?t.fromComment(r.pop()):null},t.fromMapFileSource=function(e,r){var n=e.match(t.mapFileCommentRegex);return n?t.fromMapFileComment(n.pop(),r):null},t.removeComments=function(e){return e.replace(t.commentRegex,"")},t.removeMapFileComments=function(e){return e.replace(t.mapFileCommentRegex,"")},t.generateMapFileComment=function(e,t){var r="sourceMappingURL="+e;return t&&t.multiline?"/*# "+r+" */":"//# "+r}}).call(t,r(399).Buffer)},function(e,t,r){"use strict";r(59),r(157),e.exports=r(439)},function(e,t,r){"use strict";var n=r(5),i=n.JSON||(n.JSON={stringify:JSON.stringify});e.exports=function(e){return i.stringify.apply(i,arguments)}},function(e,t,r){"use strict";r(96),r(157),r(59),r(441),r(451),r(450),r(449),e.exports=r(5).Map},function(e,t,r){"use strict";r(442),e.exports=9007199254740991},function(e,t,r){"use strict";r(443),e.exports=r(5).Object.assign},function(e,t,r){"use strict";r(444);var n=r(5).Object;e.exports=function(e,t){return n.create(e,t)}},function(e,t,r){"use strict";r(158),e.exports=r(5).Object.getOwnPropertySymbols},function(e,t,r){"use strict";r(445),e.exports=r(5).Object.keys},function(e,t,r){"use strict";r(446),e.exports=r(5).Object.setPrototypeOf},function(e,t,r){"use strict";r(158),e.exports=r(5).Symbol.for},function(e,t,r){"use strict";r(158),r(96),r(452),r(453),e.exports=r(5).Symbol},function(e,t,r){"use strict";r(157),r(59),e.exports=r(156).f("iterator")},function(e,t,r){"use strict";r(96),r(59),r(447),r(455),r(454),e.exports=r(5).WeakMap},function(e,t,r){"use strict";r(96),r(59),r(448),r(457),r(456),e.exports=r(5).WeakSet},function(e,t){"use strict";e.exports=function(){}},function(e,t,r){"use strict";var n=r(55);e.exports=function(e,t){var r=[];return n(e,!1,r.push,r,t),r}},function(e,t,r){"use strict";var n=r(37),i=r(153),s=r(438);e.exports=function(e){return function(t,r,a){var o,u=n(t),l=i(u.length),c=s(a,l);if(e&&r!=r){for(;l>c;)if((o=u[c++])!=o)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===r)return e||c||0;return!e&&-1}}},function(e,t,r){"use strict";var n=r(16),i=r(232),s=r(13)("species");e.exports=function(e){var t;return i(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!i(t.prototype)||(t=void 0),n(t)&&null===(t=t[s])&&(t=void 0)),void 0===t?Array:t}},function(e,t,r){"use strict";var n=r(421);e.exports=function(e,t){return new(n(e))(t)}},function(e,t,r){"use strict";var n=r(23).f,i=r(90),s=r(146),a=r(43),o=r(136),u=r(55),l=r(143),c=r(233),f=r(436),p=r(22),d=r(57).fastKey,h=r(58),m=p?"_s":"size",y=function(e,t){var r,n=d(t);if("F"!==n)return e._i[n];for(r=e._f;r;r=r.n)if(r.k==t)return r};e.exports={getConstructor:function(e,t,r,l){var c=e(function(e,n){o(e,c,t,"_i"),e._t=t,e._i=i(null),e._f=void 0,e._l=void 0,e[m]=0,void 0!=n&&u(n,r,e[l],e)});return s(c.prototype,{clear:function(){for(var e=h(this,t),r=e._i,n=e._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete r[n.i];e._f=e._l=void 0,e[m]=0},delete:function(e){var r=h(this,t),n=y(r,e);if(n){var i=n.n,s=n.p;delete r._i[n.i],n.r=!0,s&&(s.n=i),i&&(i.p=s),r._f==n&&(r._f=i),r._l==n&&(r._l=s),r[m]--}return!!n},forEach:function(e){h(this,t);for(var r,n=a(e,arguments.length>1?arguments[1]:void 0,3);r=r?r.n:this._f;)for(n(r.v,r.k,this);r&&r.r;)r=r.p},has:function(e){return!!y(h(this,t),e)}}),p&&n(c.prototype,"size",{get:function(){return h(this,t)[m]}}),c},def:function(e,t,r){var n,i,s=y(e,t);return s?s.v=r:(e._l=s={i:i=d(t,!0),k:t,v:r,p:n=e._l,n:void 0,r:!1},e._f||(e._f=s),n&&(n.n=s),e[m]++,"F"!==i&&(e._i[i]=s)),e},getEntry:y,setStrong:function(e,t,r){l(e,t,function(e,r){this._t=h(e,t),this._k=r,this._l=void 0},function(){for(var e=this,t=e._k,r=e._l;r&&r.r;)r=r.p;return e._t&&(e._l=r=r?r.n:e._t._f)?"keys"==t?c(0,r.k):"values"==t?c(0,r.v):c(0,[r.k,r.v]):(e._t=void 0,c(1))},r?"entries":"values",!r,!0),f(t)}}},function(e,t,r){"use strict";var n=r(228),i=r(419);e.exports=function(e){return function(){if(n(this)!=e)throw TypeError(e+"#toJSON isn't generic");return i(this)}}},function(e,t,r){"use strict";var n=r(44),i=r(145),s=r(91);e.exports=function(e){var t=n(e),r=i.f;if(r)for(var a,o=r(e),u=s.f,l=0;o.length>l;)u.call(e,a=o[l++])&&t.push(a);return t}},function(e,t,r){"use strict";var n=r(15).document;e.exports=n&&n.documentElement},function(e,t,r){"use strict";var n=r(56),i=r(13)("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||s[i]===e)}},function(e,t,r){"use strict";var n=r(21);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){var s=e.return;throw void 0!==s&&n(s.call(e)),t}}},function(e,t,r){"use strict";var n=r(90),i=r(92),s=r(93),a={};r(29)(a,r(13)("iterator"),function(){return this}),e.exports=function(e,t,r){e.prototype=n(a,{next:i(1,r)}),s(e,t+" Iterator")}},function(e,t,r){"use strict";var n=r(44),i=r(37);e.exports=function(e,t){for(var r,s=i(e),a=n(s),o=a.length,u=0;o>u;)if(s[r=a[u++]]===t)return r}},function(e,t,r){"use strict";var n=r(23),i=r(21),s=r(44);e.exports=r(22)?Object.defineProperties:function(e,t){i(e);for(var r,a=s(t),o=a.length,u=0;o>u;)n.f(e,r=a[u++],t[r]);return e}},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(37),s=r(236).f,a={}.toString,o="object"==("undefined"==typeof window?"undefined":n(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],u=function(e){try{return s(e)}catch(e){return o.slice()}};e.exports.f=function(e){return o&&"[object Window]"==a.call(e)?u(e):s(i(e))}},function(e,t,r){"use strict";var n=r(28),i=r(94),s=r(150)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),n(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,r){"use strict";var n=r(12),i=r(5),s=r(27);e.exports=function(e,t){var r=(i.Object||{})[e]||Object[e],a={};a[e]=t(r),n(n.S+n.F*s(function(){r(1)}),"Object",a)}},function(e,t,r){"use strict";var n=r(16),i=r(21),s=function(e,t){if(i(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{n=r(43)(Function.call,r(235).f(Object.prototype,"__proto__").set,2),n(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,r){return s(e,r),t?e.__proto__=r:n(e,r),e}}({},!1):void 0),check:s}},function(e,t,r){"use strict";var n=r(15),i=r(5),s=r(23),a=r(22),o=r(13)("species");e.exports=function(e){var t="function"==typeof i[e]?i[e]:n[e];a&&t&&!t[o]&&s.f(t,o,{configurable:!0,get:function(){return this}})}},function(e,t,r){"use strict";var n=r(152),i=r(140);e.exports=function(e){return function(t,r){var s,a,o=String(i(t)),u=n(r),l=o.length;return u<0||u>=l?e?"":void 0:(s=o.charCodeAt(u),s<55296||s>56319||u+1===l||(a=o.charCodeAt(u+1))<56320||a>57343?e?o.charAt(u):s:e?o.slice(u,u+2):a-56320+(s-55296<<10)+65536)}}},function(e,t,r){"use strict";var n=r(152),i=Math.max,s=Math.min;e.exports=function(e,t){return e=n(e),e<0?i(e+t,0):s(e,t)}},function(e,t,r){"use strict";var n=r(21),i=r(238);e.exports=r(5).getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return n(t.call(e))}},function(e,t,r){"use strict";var n=r(418),i=r(233),s=r(56),a=r(37);e.exports=r(143)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,i(1)):"keys"==t?i(0,r):"values"==t?i(0,e[r]):i(0,[r,e[r]])},"values"),s.Arguments=s.Array,n("keys"),n("values"),n("entries")},function(e,t,r){"use strict";var n=r(423),i=r(58);e.exports=r(139)("Map",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=n.getEntry(i(this,"Map"),e);return t&&t.v},set:function(e,t){return n.def(i(this,"Map"),0===e?0:e,t)}},n,!0)},function(e,t,r){"use strict";var n=r(12);n(n.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(e,t,r){"use strict";var n=r(12);n(n.S+n.F,"Object",{assign:r(234)})},function(e,t,r){"use strict";var n=r(12);n(n.S,"Object",{create:r(90)})},function(e,t,r){"use strict";var n=r(94),i=r(44);r(434)("keys",function(){return function(e){return i(n(e))}})},function(e,t,r){"use strict";var n=r(12);n(n.S,"Object",{setPrototypeOf:r(435).set})},function(e,t,r){"use strict";var n,i=r(137)(0),s=r(147),a=r(57),o=r(234),u=r(229),l=r(16),c=r(27),f=r(58),p=a.getWeak,d=Object.isExtensible,h=u.ufstore,m={},y=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},v={get:function(e){if(l(e)){var t=p(e);return!0===t?h(f(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return u.def(f(this,"WeakMap"),e,t)}},g=e.exports=r(139)("WeakMap",y,v,u,!0,!0);c(function(){return 7!=(new g).set((Object.freeze||Object)(m),7).get(m)})&&(n=u.getConstructor(y,"WeakMap"),o(n.prototype,v),a.NEED=!0,i(["delete","has","get","set"],function(e){var t=g.prototype,r=t[e];s(t,e,function(t,i){if(l(t)&&!d(t)){this._f||(this._f=new n);var s=this._f[e](t,i);return"set"==e?this:s}return r.call(this,t,i)})}))},function(e,t,r){"use strict" ;var n=r(229),i=r(58);r(139)("WeakSet",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return n.def(i(this,"WeakSet"),e,!0)}},n,!1,!0)},function(e,t,r){"use strict";r(148)("Map")},function(e,t,r){"use strict";r(149)("Map")},function(e,t,r){"use strict";var n=r(12);n(n.P+n.R,"Map",{toJSON:r(424)("Map")})},function(e,t,r){"use strict";r(155)("asyncIterator")},function(e,t,r){"use strict";r(155)("observable")},function(e,t,r){"use strict";r(148)("WeakMap")},function(e,t,r){"use strict";r(149)("WeakMap")},function(e,t,r){"use strict";r(148)("WeakSet")},function(e,t,r){"use strict";r(149)("WeakSet")},function(e,t,r){"use strict";function n(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}function i(e){function r(){if(r.enabled){var e=r,n=+new Date,i=n-(l||n);e.diff=i,e.prev=l,e.curr=n,l=n;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var o=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,function(r,n){if("%%"===r)return r;o++;var i=t.formatters[n];if("function"==typeof i){var a=s[o];r=i.call(e,a),s.splice(o,1),o--}return r}),t.formatArgs.call(e,s);(r.log||t.log||console.log.bind(console)).apply(e,s)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=n(e),"function"==typeof t.init&&t.init(r),r}function s(e){t.save(e),t.names=[],t.skips=[];for(var r=("string"==typeof e?e:"").split(/[\s,]+/),n=r.length,i=0;i<n;i++)r[i]&&(e=r[i].replace(/\*/g,".*?"),"-"===e[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))}function a(){t.enable("")}function o(e){var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1}function u(e){return e instanceof Error?e.stack||e.message:e}t=e.exports=i.debug=i.default=i,t.coerce=u,t.disable=a,t.enable=s,t.enabled=o,t.humanize=r(602),t.names=[],t.skips=[],t.formatters={};var l},function(e,t,r){"use strict";function n(e){var t=0,r=0,n=0;for(var i in e){var s=e[i],a=s[0],o=s[1];(a>r||a===r&&o>n)&&(r=a,n=o,t=Number(i))}return t}var i=r(615),s=/^(?:( )+|\t+)/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");var t,r,a=0,o=0,u=0,l={};e.split(/\n/g).forEach(function(e){if(e){var n,i=e.match(s);i?(n=i[0].length,i[1]?o++:a++):n=0;var c=n-u;u=n,c?(r=c>0,t=l[r?c:-c],t?t[0]++:t=l[c]=[1,0]):t&&(t[1]+=Number(r))}});var c,f,p=n(l);return p?o>=a?(c="space",f=i(" ",p)):(c="tab",f=i("\t",p)):(c=null,f=""),{amount:p,type:c,indent:f}}},function(e,t){"use strict";var r=/[|\\{}()[\]^$+*?.]/g;e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(r,"\\$&")}},function(e,t){"use strict";!function(){function t(e){if(null==e)return!1;switch(e.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"Literal":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":return!0}return!1}function r(e){if(null==e)return!1;switch(e.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return!0}return!1}function n(e){if(null==e)return!1;switch(e.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":return!0}return!1}function i(e){return n(e)||null!=e&&"FunctionDeclaration"===e.type}function s(e){switch(e.type){case"IfStatement":return null!=e.alternate?e.alternate:e.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return e.body}return null}function a(e){var t;if("IfStatement"!==e.type)return!1;if(null==e.alternate)return!1;t=e.consequent;do{if("IfStatement"===t.type&&null==t.alternate)return!0;t=s(t)}while(t);return!1}e.exports={isExpression:t,isStatement:n,isIterationStatement:r,isSourceElement:i,isProblematicIfStatement:a,trailingStatement:s}}()},function(e,t,r){"use strict";!function(){function t(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return!0;default:return!1}}function n(e,t){return!(!t&&"yield"===e)&&i(e,t)}function i(e,r){if(r&&t(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function s(e,t){return"null"===e||"true"===e||"false"===e||n(e,t)}function a(e,t){return"null"===e||"true"===e||"false"===e||i(e,t)}function o(e){return"eval"===e||"arguments"===e}function u(e){var t,r,n;if(0===e.length)return!1;if(n=e.charCodeAt(0),!d.isIdentifierStartES5(n))return!1;for(t=1,r=e.length;t<r;++t)if(n=e.charCodeAt(t),!d.isIdentifierPartES5(n))return!1;return!0}function l(e,t){return 1024*(e-55296)+(t-56320)+65536}function c(e){var t,r,n,i,s;if(0===e.length)return!1;for(s=d.isIdentifierStartES6,t=0,r=e.length;t<r;++t){if(55296<=(n=e.charCodeAt(t))&&n<=56319){if(++t>=r)return!1;if(!(56320<=(i=e.charCodeAt(t))&&i<=57343))return!1;n=l(n,i)}if(!s(n))return!1;s=d.isIdentifierPartES6}return!0}function f(e,t){return u(e)&&!s(e,t)}function p(e,t){return c(e)&&!a(e,t)}var d=r(240);e.exports={isKeywordES5:n,isKeywordES6:i,isReservedWordES5:s,isReservedWordES6:a,isRestrictedWord:o,isIdentifierNameES5:u,isIdentifierNameES6:c,isIdentifierES5:f,isIdentifierES6:p}}()},function(e,t,r){"use strict";e.exports=r(630)},function(e,t,r){"use strict";var n=r(180),i=new RegExp(n().source);e.exports=i.test.bind(i)},function(e,t){"use strict";t.read=function(e,t,r,n,i){var s,a,o=8*i-n-1,u=(1<<o)-1,l=u>>1,c=-7,f=r?i-1:0,p=r?-1:1,d=e[t+f];for(f+=p,s=d&(1<<-c)-1,d>>=-c,c+=o;c>0;s=256*s+e[t+f],f+=p,c-=8);for(a=s&(1<<-c)-1,s>>=-c,c+=n;c>0;a=256*a+e[t+f],f+=p,c-=8);if(0===s)s=1-l;else{if(s===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),s-=l}return(d?-1:1)*a*Math.pow(2,s-n)},t.write=function(e,t,r,n,i,s){var a,o,u,l=8*s-i-1,c=(1<<l)-1,f=c>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:s-1,h=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),t+=a+f>=1?p/u:p*Math.pow(2,1-f),t*u>=2&&(a++,u/=2),a+f>=c?(o=0,a=c):a+f>=1?(o=(t*u-1)*Math.pow(2,i),a+=f):(o=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&o,d+=h,o/=256,i-=8);for(a=a<<i|o,l+=i;l>0;e[r+d]=255&a,d+=h,a/=256,l-=8);e[r+d-h]|=128*m}},function(e,t,r){"use strict";var n=function(e,t,r,n,i,s,a,o){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[r,n,i,s,a,o],c=0;u=new Error(t.replace(/%s/g,function(){return l[c++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};e.exports=n},function(e,t,r){"use strict";var n=r(603);e.exports=Number.isFinite||function(e){return!("number"!=typeof e||n(e)||e===1/0||e===-1/0)}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyu]{1,5}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g,t.matchToToken=function(e){var t={type:"invalid",value:e[0]};return e[1]?(t.type="string",t.closed=!(!e[3]&&!e[4])):e[5]?t.type="comment":e[6]?(t.type="comment",t.closed=!!e[7]):e[8]?t.type="regex":e[9]?t.type="number":e[10]?t.type="name":e[11]?t.type="punctuator":e[12]&&(t.type="whitespace"),t}},function(e,t,r){var n;(function(e,i){"use strict";var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(a){var o="object"==s(t)&&t,u="object"==s(e)&&e&&e.exports==o&&e,l="object"==(void 0===i?"undefined":s(i))&&i;l.global!==l&&l.window!==l||(a=l);var c={},f=c.hasOwnProperty,p=function(e,t){var r;for(r in e)f.call(e,r)&&t(r,e[r])},d=function(e,t){return t?(p(t,function(t,r){e[t]=r}),e):e},h=function(e,t){for(var r=e.length,n=-1;++n<r;)t(e[n])},m=c.toString,y=function(e){return"[object Array]"==m.call(e)},v=function(e){return"[object Object]"==m.call(e)},g=function(e){return"string"==typeof e||"[object String]"==m.call(e)},b=function(e){return"number"==typeof e||"[object Number]"==m.call(e)},E=function(e){return"function"==typeof e||"[object Function]"==m.call(e)},x=function(e){return"[object Map]"==m.call(e)},A=function(e){return"[object Set]"==m.call(e)},S={'"':'\\"',"'":"\\'","\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},_=/["'\\\b\f\n\r\t]/,D=/[0-9]/,C=/[ !#-&\(-\[\]-~]/,w=function e(t,r){var n={escapeEverything:!1,escapeEtago:!1,quotes:"single",wrap:!1,es6:!1,json:!1,compact:!0,lowercaseHex:!1,numbers:"decimal",indent:"\t",__indent__:"",__inline1__:!1,__inline2__:!1},i=r&&r.json;i&&(n.quotes="double",n.wrap=!0),r=d(n,r),"single"!=r.quotes&&"double"!=r.quotes&&(r.quotes="single");var s,a="double"==r.quotes?'"':"'",o=r.compact,u=r.indent,l=r.lowercaseHex,c="",f=r.__inline1__,m=r.__inline2__,w=o?"":"\n",P=!0,k="binary"==r.numbers,F="octal"==r.numbers,T="decimal"==r.numbers,O="hexadecimal"==r.numbers;if(i&&t&&E(t.toJSON)&&(t=t.toJSON()),!g(t)){if(x(t))return 0==t.size?"new Map()":(o||(r.__inline1__=!0),"new Map("+e(Array.from(t),r)+")");if(A(t))return 0==t.size?"new Set()":"new Set("+e(Array.from(t),r)+")";if(y(t))return s=[],r.wrap=!0,f?(r.__inline1__=!1,r.__inline2__=!0):(c=r.__indent__,u+=c,r.__indent__=u),h(t,function(t){P=!1,m&&(r.__inline2__=!1),s.push((o||m?"":u)+e(t,r))}),P?"[]":m?"["+s.join(", ")+"]":"["+w+s.join(","+w)+w+(o?"":c)+"]";if(!b(t))return v(t)?(s=[],r.wrap=!0,c=r.__indent__,u+=c,r.__indent__=u,p(t,function(t,n){P=!1,s.push((o?"":u)+e(t,r)+":"+(o?"":" ")+e(n,r))}),P?"{}":"{"+w+s.join(","+w)+w+(o?"":c)+"}"):i?JSON.stringify(t)||"null":String(t);if(i)return JSON.stringify(t);if(T)return String(t);if(O){var B=t.toString(16);return l||(B=B.toUpperCase()),"0x"+B}if(k)return"0b"+t.toString(2);if(F)return"0o"+t.toString(8)}var R,I,M,N=t,L=-1,j=N.length;for(s="";++L<j;){var U=N.charAt(L);if(r.es6&&(R=N.charCodeAt(L))>=55296&&R<=56319&&j>L+1&&(I=N.charCodeAt(L+1))>=56320&&I<=57343){M=1024*(R-55296)+I-56320+65536;var V=M.toString(16);l||(V=V.toUpperCase()),s+="\\u{"+V+"}",L++}else{if(!r.escapeEverything){if(C.test(U)){s+=U;continue}if('"'==U){s+=a==U?'\\"':U;continue}if("'"==U){s+=a==U?"\\'":U;continue}}if("\0"!=U||i||D.test(N.charAt(L+1)))if(_.test(U))s+=S[U];else{var G=U.charCodeAt(0),V=G.toString(16);l||(V=V.toUpperCase());var W=V.length>2||i,Y="\\"+(W?"u":"x")+("0000"+V).slice(W?-4:-2);s+=Y}else s+="\\0"}}return r.wrap&&(s=a+s+a),r.escapeEtago?s.replace(/<\/(script|style)/gi,"<\\/$1"):s};w.version="1.3.0","object"==s(r(49))&&r(49)?void 0!==(n=function(){return w}.call(t,r,t,e))&&(e.exports=n):o&&!o.nodeType?u?u.exports=w:o.jsesc=w:a.jsesc=w}(void 0)}).call(t,r(39)(e),function(){return this}())},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i="object"===n(t)?t:{};i.parse=function(){var e,t,r,i,s,a,o={"'":"'",'"':'"',"\\":"\\","/":"/","\n":"",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},u=[" ","\t","\r","\n","\v","\f"," ","\ufeff"],l=function(e){return""===e?"EOF":"'"+e+"'"},c=function(n){var i=new SyntaxError;throw i.message=n+" at line "+t+" column "+r+" of the JSON5 data. Still to read: "+JSON.stringify(s.substring(e-1,e+19)),i.at=e,i.lineNumber=t,i.columnNumber=r,i},f=function(n){return n&&n!==i&&c("Expected "+l(n)+" instead of "+l(i)),i=s.charAt(e),e++,r++,("\n"===i||"\r"===i&&"\n"!==p())&&(t++,r=0),i},p=function(){return s.charAt(e)},d=function(){var e=i;for("_"!==i&&"$"!==i&&(i<"a"||i>"z")&&(i<"A"||i>"Z")&&c("Bad identifier as unquoted key");f()&&("_"===i||"$"===i||i>="a"&&i<="z"||i>="A"&&i<="Z"||i>="0"&&i<="9");)e+=i;return e},h=function(){var e,t="",r="",n=10;if("-"!==i&&"+"!==i||(t=i,f(i)),"I"===i)return e=E(),("number"!=typeof e||isNaN(e))&&c("Unexpected word for number"),"-"===t?-e:e;if("N"===i)return e=E(),isNaN(e)||c("expected word to be NaN"),e;switch("0"===i&&(r+=i,f(),"x"===i||"X"===i?(r+=i,f(),n=16):i>="0"&&i<="9"&&c("Octal literal")),n){case 10:for(;i>="0"&&i<="9";)r+=i,f();if("."===i)for(r+=".";f()&&i>="0"&&i<="9";)r+=i;if("e"===i||"E"===i)for(r+=i,f(),"-"!==i&&"+"!==i||(r+=i,f());i>="0"&&i<="9";)r+=i,f();break;case 16:for(;i>="0"&&i<="9"||i>="A"&&i<="F"||i>="a"&&i<="f";)r+=i,f()}if(e="-"===t?-r:+r,isFinite(e))return e;c("Bad number")},m=function(){var e,t,r,n,s="";if('"'===i||"'"===i)for(r=i;f();){if(i===r)return f(),s;if("\\"===i)if(f(),"u"===i){for(n=0,t=0;t<4&&(e=parseInt(f(),16),isFinite(e));t+=1)n=16*n+e;s+=String.fromCharCode(n)}else if("\r"===i)"\n"===p()&&f();else{if("string"!=typeof o[i])break;s+=o[i]}else{if("\n"===i)break;s+=i}}c("Bad string")},y=function(){"/"!==i&&c("Not an inline comment");do{if(f(),"\n"===i||"\r"===i)return void f()}while(i)},v=function(){"*"!==i&&c("Not a block comment");do{for(f();"*"===i;)if(f("*"),"/"===i)return void f("/")}while(i);c("Unterminated block comment")},g=function(){"/"!==i&&c("Not a comment"),f("/"),"/"===i?y():"*"===i?v():c("Unrecognized comment")},b=function(){for(;i;)if("/"===i)g();else{if(!(u.indexOf(i)>=0))return;f()}},E=function(){switch(i){case"t":return f("t"),f("r"),f("u"),f("e"),!0;case"f":return f("f"),f("a"),f("l"),f("s"),f("e"),!1;case"n":return f("n"),f("u"),f("l"),f("l"),null;case"I":return f("I"),f("n"),f("f"),f("i"),f("n"),f("i"),f("t"),f("y"),1/0;case"N":return f("N"),f("a"),f("N"),NaN}c("Unexpected "+l(i))},x=function(){var e=[];if("["===i)for(f("["),b();i;){if("]"===i)return f("]"),e;if(","===i?c("Missing array element"):e.push(a()),b(),","!==i)return f("]"),e;f(","),b()}c("Bad array")},A=function(){var e,t={};if("{"===i)for(f("{"),b();i;){if("}"===i)return f("}"),t;if(e='"'===i||"'"===i?m():d(),b(),f(":"),t[e]=a(),b(),","!==i)return f("}"),t;f(","),b()}c("Bad object")};return a=function(){switch(b(),i){case"{":return A();case"[":return x();case'"':case"'":return m();case"-":case"+":case".":return h();default:return i>="0"&&i<="9"?h():E()}},function(o,u){var l;return s=String(o),e=0,t=1,r=1,i=" ",l=a(),b(),i&&c("Syntax error"),"function"==typeof u?function e(t,r){var i,s,a=t[r];if(a&&"object"===(void 0===a?"undefined":n(a)))for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(s=e(a,i),void 0!==s?a[i]=s:delete a[i]);return u.call(t,r,a)}({"":l},""):l}}(),i.stringify=function(e,t,r){function s(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"_"===e||"$"===e}function a(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||"_"===e||"$"===e}function o(e){if("string"!=typeof e)return!1;if(!a(e[0]))return!1;for(var t=1,r=e.length;t<r;){if(!s(e[t]))return!1;t++}return!0}function u(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}function l(e){return"[object Date]"===Object.prototype.toString.call(e)}function c(e){for(var t=0;t<y.length;t++)if(y[t]===e)throw new TypeError("Converting circular structure to JSON")}function f(e,t,r){if(!e)return"";e.length>10&&(e=e.substring(0,10));for(var n=r?"":"\n",i=0;i<t;i++)n+=e;return n}function p(e){return v.lastIndex=0,v.test(e)?'"'+e.replace(v,function(e){var t=g[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function d(e,t,r){var i,s,a=h(e,t,r);switch(a&&!l(a)&&(a=a.valueOf()),void 0===a?"undefined":n(a)){case"boolean":return a.toString();case"number":return isNaN(a)||!isFinite(a)?"null":a.toString();case"string":return p(a.toString());case"object":if(null===a)return"null";if(u(a)){c(a),i="[",y.push(a);for(var v=0;v<a.length;v++)s=d(a,v,!1),i+=f(m,y.length),i+=null===s||void 0===s?"null":s,v<a.length-1?i+=",":m&&(i+="\n");y.pop(),a.length&&(i+=f(m,y.length,!0)),i+="]"}else{c(a),i="{";var g=!1;y.push(a);for(var b in a)if(a.hasOwnProperty(b)){var E=d(a,b,!1);r=!1,void 0!==E&&null!==E&&(i+=f(m,y.length),g=!0,t=o(b)?b:p(b),i+=t+":"+(m?" ":"")+E+",")}y.pop(),i=g?i.substring(0,i.length-1)+f(m,y.length)+"}":"{}"}return i;default:return}}if(t&&"function"!=typeof t&&!u(t))throw new Error("Replacer must be a function or an array");var h=function(e,r,n){var i=e[r];return i&&i.toJSON&&"function"==typeof i.toJSON&&(i=i.toJSON()),"function"==typeof t?t.call(e,r,i):t?n||u(e)||t.indexOf(r)>=0?i:void 0:i};i.isWord=o;var m,y=[];r&&("string"==typeof r?m=r:"number"==typeof r&&r>=0&&(m=f(" ",r,!0)));var v=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,g={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},b={"":e};return void 0===e?h(b,"",!0):d(b,"",!0)}},function(e,t){"use strict";var r=[],n=[];e.exports=function(e,t){if(e===t)return 0;var i=e.length,s=t.length;if(0===i)return s;if(0===s)return i;for(var a,o,u,l,c=0,f=0;c<i;)n[c]=e.charCodeAt(c),r[c]=++c;for(;f<s;)for(a=t.charCodeAt(f),u=f++,o=f,c=0;c<i;c++)l=a===n[c]?u:u+1,u=r[c],o=r[c]=u>o?l>o?o+1:l:l>u?u+1:l;return o}},function(e,t,r){"use strict";var n=r(38),i=r(17),s=n(i,"DataView");e.exports=s},function(e,t,r){"use strict";function n(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var i=r(536),s=r(537),a=r(538),o=r(539),u=r(540);n.prototype.clear=i,n.prototype.delete=s,n.prototype.get=a,n.prototype.has=o,n.prototype.set=u,e.exports=n},function(e,t,r){"use strict";var n=r(38),i=r(17),s=n(i,"Promise");e.exports=s},function(e,t,r){"use strict";var n=r(38),i=r(17),s=n(i,"WeakMap");e.exports=s},function(e,t){"use strict";function r(e,t){return e.set(t[0],t[1]),e}e.exports=r},function(e,t){"use strict";function r(e,t){return e.add(t),e}e.exports=r},function(e,t){"use strict";function r(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}e.exports=r},function(e,t){"use strict";function r(e,t){for(var r=-1,n=null==e?0:e.length,i=0,s=[];++r<n;){var a=e[r];t(a,r,e)&&(s[i++]=a)}return s}e.exports=r},function(e,t,r){"use strict";function n(e,t){return!!(null==e?0:e.length)&&i(e,t,0)>-1}var i=r(166);e.exports=n},function(e,t){"use strict";function r(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}e.exports=r},function(e,t){"use strict";function r(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}e.exports=r},function(e,t,r){"use strict";function n(e,t){return e&&i(t,s(t),e)}var i=r(31),s=r(32);e.exports=n},function(e,t,r){"use strict";function n(e,t){return e&&i(t,s(t),e)}var i=r(31),s=r(47);e.exports=n},function(e,t){"use strict";function r(e,t,r){return e===e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e}e.exports=r},function(e,t,r){"use strict";var n=r(18),i=Object.create,s=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=s},function(e,t,r){"use strict";var n=r(489),i=r(526),s=i(n);e.exports=s},function(e,t,r){"use strict";function n(e,t,r,a,o){var u=-1,l=e.length;for(r||(r=s),o||(o=[]);++u<l;){var c=e[u];t>0&&r(c)?t>1?n(c,t-1,r,a,o):i(o,c):a||(o[o.length]=c)}return o}var i=r(161),s=r(543);e.exports=n},function(e,t,r){"use strict";function n(e,t){return e&&i(e,t,s)}var i=r(248),s=r(32);e.exports=n},function(e,t){"use strict";function r(e,t){return null!=e&&i.call(e,t)}var n=Object.prototype,i=n.hasOwnProperty;e.exports=r},function(e,t){"use strict";function r(e,t){return null!=e&&t in Object(e)}e.exports=r},function(e,t){"use strict";function r(e,t,r,n){for(var i=r-1,s=e.length;++i<s;)if(n(e[i],t))return i;return-1}e.exports=r},function(e,t,r){"use strict";function n(e){return s(e)&&i(e)==a}var i=r(30),s=r(25),a="[object Arguments]";e.exports=n},function(e,t,r){"use strict";function n(e,t,r,n,y,g){var b=l(e),E=l(t),x=b?h:u(e),A=E?h:u(t);x=x==d?m:x,A=A==d?m:A;var S=x==m,_=A==m,D=x==A;if(D&&c(e)){if(!c(t))return!1;b=!0,S=!1}if(D&&!S)return g||(g=new i),b||f(e)?s(e,t,r,n,y,g):a(e,t,x,r,n,y,g);if(!(r&p)){var C=S&&v.call(e,"__wrapped__"),w=_&&v.call(t,"__wrapped__");if(C||w){var P=C?e.value():e,k=w?t.value():t;return g||(g=new i),y(P,k,r,n,g)}}return!!D&&(g||(g=new i),o(e,t,r,n,y,g))}var i=r(99),s=r(260),a=r(530),o=r(531),u=r(264),l=r(6),c=r(113),f=r(177),p=1,d="[object Arguments]",h="[object Array]",m="[object Object]",y=Object.prototype,v=y.hasOwnProperty;e.exports=n},function(e,t,r){"use strict";function n(e,t,r,n){var u=r.length,l=u,c=!n;if(null==e)return!l;for(e=Object(e);u--;){var f=r[u];if(c&&f[2]?f[1]!==e[f[0]]:!(f[0]in e))return!1}for(;++u<l;){f=r[u];var p=f[0],d=e[p],h=f[1];if(c&&f[2]){if(void 0===d&&!(p in e))return!1}else{var m=new i;if(n)var y=n(d,h,p,e,t,m);if(!(void 0===y?s(h,d,a|o,n,m):y))return!1}}return!0}var i=r(99),s=r(251),a=1,o=2;e.exports=n},function(e,t){"use strict";function r(e){return e!==e}e.exports=r},function(e,t,r){"use strict";function n(e){return!(!a(e)||s(e))&&(i(e)?h:l).test(o(e))}var i=r(175),s=r(545),a=r(18),o=r(272),u=/[\\^$.*+?()[\]{}|]/g,l=/^\[object .+?Constructor\]$/,c=Function.prototype,f=Object.prototype,p=c.toString,d=f.hasOwnProperty,h=RegExp("^"+p.call(d).replace(u,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=n},function(e,t,r){"use strict";function n(e){return s(e)&&i(e)==a}var i=r(30),s=r(25),a="[object RegExp]";e.exports=n},function(e,t,r){"use strict";function n(e){return a(e)&&s(e.length)&&!!o[i(e)]}var i=r(30),s=r(176),a=r(25),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,e.exports=n},function(e,t,r){"use strict";function n(e){if(!i(e))return s(e);var t=[];for(var r in Object(e))o.call(e,r)&&"constructor"!=r&&t.push(r);return t}var i=r(105),s=r(557),a=Object.prototype,o=a.hasOwnProperty;e.exports=n},function(e,t,r){"use strict";function n(e){if(!i(e))return a(e);var t=s(e),r=[];for(var n in e)("constructor"!=n||!t&&u.call(e,n))&&r.push(n);return r}var i=r(18),s=r(105),a=r(558),o=Object.prototype,u=o.hasOwnProperty;e.exports=n},function(e,t,r){"use strict";function n(e){var t=s(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(r){return r===e||i(r,e,t)}}var i=r(495),s=r(533),a=r(269);e.exports=n},function(e,t,r){"use strict";function n(e,t){return o(e)&&u(t)?l(c(e),t):function(r){var n=s(r,e);return void 0===n&&n===t?a(r,e):i(t,n,f|p)}}var i=r(251),s=r(583),a=r(584),o=r(173),u=r(267),l=r(269),c=r(108),f=1,p=2;e.exports=n},function(e,t,r){"use strict";function n(e,t,r,c,f){e!==t&&a(t,function(a,l){if(u(a))f||(f=new i),o(e,t,l,r,n,c,f);else{var p=c?c(e[l],a,l+"",e,t,f):void 0;void 0===p&&(p=a),s(e,l,p)}},l)}var i=r(99),s=r(247),a=r(248),o=r(505),u=r(18),l=r(47);e.exports=n},function(e,t,r){"use strict";function n(e,t,r,n,g,b,E){var x=e[r],A=t[r],S=E.get(A);if(S)return void i(e,r,S);var _=b?b(x,A,r+"",e,t,E):void 0,D=void 0===_;if(D){var C=c(A),w=!C&&p(A),P=!C&&!w&&y(A);_=A,C||w||P?c(x)?_=x:f(x)?_=o(x):w?(D=!1,_=s(A,!0)):P?(D=!1,_=a(A,!0)):_=[]:m(A)||l(A)?(_=x,l(x)?_=v(x):(!h(x)||n&&d(x))&&(_=u(A))):D=!1}D&&(E.set(A,_),g(_,A,n,b,E),E.delete(A)),i(e,r,_)}var i=r(247),s=r(256),a=r(257),o=r(168),u=r(266),l=r(112),c=r(6),f=r(585),p=r(113),d=r(175),h=r(18),m=r(275),y=r(177),v=r(599);e.exports=n},function(e,t,r){"use strict";function n(e,t,r){var n=-1;t=i(t.length?t:[c],u(s));var f=a(e,function(e,r,s){return{criteria:i(t,function(t){return t(e)}),index:++n,value:e}});return o(f,function(e,t){return l(e,t,r)})}var i=r(60),s=r(61),a=r(252),o=r(512),u=r(102),l=r(522),c=r(110);e.exports=n},function(e,t){"use strict";function r(e){return function(t){return null==t?void 0:t[e]}}e.exports=r},function(e,t,r){"use strict";function n(e){return function(t){return i(t,e)}}var i=r(249);e.exports=n},function(e,t,r){"use strict";function n(e,t,r,n){var l=n?a:s,f=-1,p=t.length,d=e;for(e===t&&(t=u(t)),r&&(d=i(e,o(r)));++f<p;)for(var h=0,m=t[f],y=r?r(m):m;(h=l(d,y,h,n))>-1;)d!==e&&c.call(d,h,1),c.call(e,h,1);return e}var i=r(60),s=r(166),a=r(492),o=r(102),u=r(168),l=Array.prototype,c=l.splice;e.exports=n},function(e,t){"use strict";function r(e,t){var r="";if(!e||t<1||t>n)return r;do{t%2&&(r+=e),(t=i(t/2))&&(e+=e)}while(t);return r}var n=9007199254740991,i=Math.floor;e.exports=r},function(e,t,r){"use strict";var n=r(576),i=r(259),s=r(110),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:s;e.exports=a},function(e,t){"use strict";function r(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}e.exports=r},function(e,t){"use strict";function r(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}e.exports=r},function(e,t,r){"use strict";function n(e,t,r){var n=-1,f=s,p=e.length,d=!0,h=[],m=h;if(r)d=!1,f=a;else if(p>=c){var y=t?null:u(e);if(y)return l(y);d=!1,f=o,m=new i}else m=t?[]:h;e:for(;++n<p;){var v=e[n],g=t?t(v):v;if(v=r||0!==v?v:0,d&&g===g){for(var b=m.length;b--;)if(m[b]===g)continue e;t&&m.push(g),h.push(v)}else f(m,g,r)||(m!==h&&m.push(g),h.push(v))}return h}var i=r(242),s=r(480),a=r(481),o=r(254),u=r(528),l=r(107),c=200;e.exports=n},function(e,t,r){"use strict";function n(e,t){return i(t,function(t){return e[t]})}var i=r(60);e.exports=n},function(e,t,r){"use strict";function n(e,t){var r=t?i(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var i=r(167);e.exports=n},function(e,t,r){"use strict";function n(e,t,r){var n=t?r(a(e),o):a(e);return s(n,i,new e.constructor)}var i=r(476),s=r(246),a=r(268),o=1;e.exports=n},function(e,t){"use strict";function r(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}var n=/\w*$/;e.exports=r},function(e,t,r){"use strict";function n(e,t,r){var n=t?r(a(e),o):a(e);return s(n,i,new e.constructor)}var i=r(477),s=r(246),a=r(107),o=1;e.exports=n},function(e,t,r){"use strict";function n(e){return a?Object(a.call(e)):{}}var i=r(45),s=i?i.prototype:void 0,a=s?s.valueOf:void 0;e.exports=n},function(e,t,r){"use strict";function n(e,t){if(e!==t){var r=void 0!==e,n=null===e,s=e===e,a=i(e),o=void 0!==t,u=null===t,l=t===t,c=i(t);if(!u&&!c&&!a&&e>t||a&&o&&l&&!u&&!c||n&&o&&l||!r&&l||!s)return 1;if(!n&&!a&&!c&&e<t||c&&r&&s&&!n&&!a||u&&r&&s||!o&&s||!l)return-1}return 0}var i=r(62);e.exports=n},function(e,t,r){"use strict";function n(e,t,r){for(var n=-1,s=e.criteria,a=t.criteria,o=s.length,u=r.length;++n<o;){var l=i(s[n],a[n]);if(l){if(n>=u)return l;return l*("desc"==r[n]?-1:1)}}return e.index-t.index}var i=r(521);e.exports=n},function(e,t,r){"use strict";function n(e,t){return i(e,s(e),t)}var i=r(31),s=r(170);e.exports=n},function(e,t,r){"use strict";function n(e,t){return i(e,s(e),t)}var i=r(31),s=r(263);e.exports=n},function(e,t,r){"use strict";var n=r(17),i=n["__core-js_shared__"];e.exports=i},function(e,t,r){"use strict";function n(e,t){return function(r,n){if(null==r)return r;if(!i(r))return e(r,n);for(var s=r.length,a=t?s:-1,o=Object(r);(t?a--:++a<s)&&!1!==n(o[a],a,o););return r}}var i=r(24);e.exports=n},function(e,t){"use strict";function r(e){return function(t,r,n){for(var i=-1,s=Object(t),a=n(t),o=a.length;o--;){var u=a[e?o:++i];if(!1===r(s[u],u,s))break}return t}}e.exports=r},function(e,t,r){"use strict";var n=r(241),i=r(591),s=r(107),a=n&&1/s(new n([,-0]))[1]==1/0?function(e){return new n(e)}:i;e.exports=a},function(e,t,r){"use strict";function n(e,t,r,n){return void 0===e||i(e,s[r])&&!a.call(n,r)?t:e}var i=r(46),s=Object.prototype,a=s.hasOwnProperty;e.exports=n},function(e,t,r){"use strict";function n(e,t,r,n,i,S,D){switch(r){case A:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case x:return!(e.byteLength!=t.byteLength||!S(new s(e),new s(t)));case p:case d:case y:return a(+e,+t);case h:return e.name==t.name&&e.message==t.message;case v:case b:return e==t+"";case m:var C=u;case g:var w=n&c;if(C||(C=l),e.size!=t.size&&!w)return!1;var P=D.get(e);if(P)return P==t;n|=f,D.set(e,t);var k=o(C(e),C(t),n,i,S,D);return D.delete(e),k;case E:if(_)return _.call(e)==_.call(t)}return!1}var i=r(45),s=r(243),a=r(46),o=r(260),u=r(268),l=r(107),c=1,f=2,p="[object Boolean]",d="[object Date]",h="[object Error]",m="[object Map]",y="[object Number]",v="[object RegExp]",g="[object Set]",b="[object String]",E="[object Symbol]",x="[object ArrayBuffer]",A="[object DataView]",S=i?i.prototype:void 0,_=S?S.valueOf:void 0;e.exports=n},function(e,t,r){"use strict";function n(e,t,r,n,a,u){var l=r&s,c=i(e),f=c.length;if(f!=i(t).length&&!l)return!1;for(var p=f;p--;){var d=c[p];if(!(l?d in t:o.call(t,d)))return!1}var h=u.get(e);if(h&&u.get(t))return h==t;var m=!0;u.set(e,t),u.set(t,e);for(var y=l;++p<f;){d=c[p];var v=e[d],g=t[d];if(n)var b=l?n(g,v,d,t,e,u):n(v,g,d,e,t,u);if(!(void 0===b?v===g||a(v,g,r,n,u):b)){m=!1;break}y||(y="constructor"==d)}if(m&&!y){var E=e.constructor,x=t.constructor;E!=x&&"constructor"in e&&"constructor"in t&&!("function"==typeof E&&E instanceof E&&"function"==typeof x&&x instanceof x)&&(m=!1)}return u.delete(e),u.delete(t),m}var i=r(262),s=1,a=Object.prototype,o=a.hasOwnProperty;e.exports=n},function(e,t,r){"use strict";function n(e){return i(e,a,s)}var i=r(250),s=r(263),a=r(47);e.exports=n},function(e,t,r){"use strict";function n(e){for(var t=s(e),r=t.length;r--;){var n=t[r],a=e[n];t[r]=[n,a,i(a)]}return t}var i=r(267),s=r(32);e.exports=n},function(e,t,r){"use strict";function n(e){var t=a.call(e,u),r=e[u];try{e[u]=void 0;var n=!0}catch(e){}var i=o.call(e);return n&&(t?e[u]=r:delete e[u]),i}var i=r(45),s=Object.prototype,a=s.hasOwnProperty,o=s.toString,u=i?i.toStringTag:void 0;e.exports=n},function(e,t){"use strict";function r(e,t){return null==e?void 0:e[t]}e.exports=r},function(e,t,r){"use strict";function n(){this.__data__=i?i(null):{},this.size=0}var i=r(106);e.exports=n},function(e,t){"use strict";function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}e.exports=r},function(e,t,r){"use strict";function n(e){var t=this.__data__;if(i){var r=t[e];return r===s?void 0:r}return o.call(t,e)?t[e]:void 0}var i=r(106),s="__lodash_hash_undefined__",a=Object.prototype,o=a.hasOwnProperty;e.exports=n},function(e,t,r){"use strict" ;function n(e){var t=this.__data__;return i?void 0!==t[e]:a.call(t,e)}var i=r(106),s=Object.prototype,a=s.hasOwnProperty;e.exports=n},function(e,t,r){"use strict";function n(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=i&&void 0===t?s:t,this}var i=r(106),s="__lodash_hash_undefined__";e.exports=n},function(e,t){"use strict";function r(e){var t=e.length,r=e.constructor(t);return t&&"string"==typeof e[0]&&i.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var n=Object.prototype,i=n.hasOwnProperty;e.exports=r},function(e,t,r){"use strict";function n(e,t,r,n){var F=e.constructor;switch(t){case b:return i(e);case f:case p:return new F(+e);case E:return s(e,n);case x:case A:case S:case _:case D:case C:case w:case P:case k:return c(e,n);case d:return a(e,n,r);case h:case v:return new F(e);case m:return o(e);case y:return u(e,n,r);case g:return l(e)}}var i=r(167),s=r(516),a=r(517),o=r(518),u=r(519),l=r(520),c=r(257),f="[object Boolean]",p="[object Date]",d="[object Map]",h="[object Number]",m="[object RegExp]",y="[object Set]",v="[object String]",g="[object Symbol]",b="[object ArrayBuffer]",E="[object DataView]",x="[object Float32Array]",A="[object Float64Array]",S="[object Int8Array]",_="[object Int16Array]",D="[object Int32Array]",C="[object Uint8Array]",w="[object Uint8ClampedArray]",P="[object Uint16Array]",k="[object Uint32Array]";e.exports=n},function(e,t,r){"use strict";function n(e){return a(e)||s(e)||!!(o&&e&&e[o])}var i=r(45),s=r(112),a=r(6),o=i?i.isConcatSpreadable:void 0;e.exports=n},function(e,t){"use strict";function r(e){var t=void 0===e?"undefined":n(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=r},function(e,t,r){"use strict";function n(e){return!!s&&s in e}var i=r(525),s=function(){var e=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.exports=n},function(e,t){"use strict";function r(){this.__data__=[],this.size=0}e.exports=r},function(e,t,r){"use strict";function n(e){var t=this.__data__,r=i(t,e);return!(r<0)&&(r==t.length-1?t.pop():a.call(t,r,1),--this.size,!0)}var i=r(100),s=Array.prototype,a=s.splice;e.exports=n},function(e,t,r){"use strict";function n(e){var t=this.__data__,r=i(t,e);return r<0?void 0:t[r][1]}var i=r(100);e.exports=n},function(e,t,r){"use strict";function n(e){return i(this.__data__,e)>-1}var i=r(100);e.exports=n},function(e,t,r){"use strict";function n(e,t){var r=this.__data__,n=i(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var i=r(100);e.exports=n},function(e,t,r){"use strict";function n(){this.size=0,this.__data__={hash:new i,map:new(a||s),string:new i}}var i=r(473),s=r(98),a=r(159);e.exports=n},function(e,t,r){"use strict";function n(e){var t=i(this,e).delete(e);return this.size-=t?1:0,t}var i=r(104);e.exports=n},function(e,t,r){"use strict";function n(e){return i(this,e).get(e)}var i=r(104);e.exports=n},function(e,t,r){"use strict";function n(e){return i(this,e).has(e)}var i=r(104);e.exports=n},function(e,t,r){"use strict";function n(e,t){var r=i(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var i=r(104);e.exports=n},function(e,t,r){"use strict";function n(e){var t=i(e,function(e){return r.size===s&&r.clear(),e}),r=t.cache;return t}var i=r(589),s=500;e.exports=n},function(e,t,r){"use strict";var n=r(271),i=n(Object.keys,Object);e.exports=i},function(e,t){"use strict";function r(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}e.exports=r},function(e,t){"use strict";function r(e){return i.call(e)}var n=Object.prototype,i=n.toString;e.exports=r},function(e,t,r){"use strict";function n(e,t,r){return t=s(void 0===t?e.length-1:t,0),function(){for(var n=arguments,a=-1,o=s(n.length-t,0),u=Array(o);++a<o;)u[a]=n[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=n[a];return l[t]=r(u),i(e,this,l)}}var i=r(244),s=Math.max;e.exports=n},function(e,t){"use strict";function r(e){return this.__data__.set(e,n),this}var n="__lodash_hash_undefined__";e.exports=r},function(e,t){"use strict";function r(e){return this.__data__.has(e)}e.exports=r},function(e,t,r){"use strict";var n=r(511),i=r(564),s=i(n);e.exports=s},function(e,t){"use strict";function r(e){var t=0,r=0;return function(){var a=s(),o=i-(a-r);if(r=a,o>0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var n=800,i=16,s=Date.now;e.exports=r},function(e,t,r){"use strict";function n(){this.__data__=new i,this.size=0}var i=r(98);e.exports=n},function(e,t){"use strict";function r(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}e.exports=r},function(e,t){"use strict";function r(e){return this.__data__.get(e)}e.exports=r},function(e,t){"use strict";function r(e){return this.__data__.has(e)}e.exports=r},function(e,t,r){"use strict";function n(e,t){var r=this.__data__;if(r instanceof i){var n=r.__data__;if(!s||n.length<o-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(n)}return r.set(e,t),this.size=r.size,this}var i=r(98),s=r(159),a=r(160),o=200;e.exports=n},function(e,t){"use strict";function r(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}e.exports=r},function(e,t,r){"use strict";var n=r(556),i=/^\./,s=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,o=n(function(e){var t=[];return i.test(e)&&t.push(""),e.replace(s,function(e,r,n,i){t.push(n?i.replace(a,"$1"):r||e)}),t});e.exports=o},function(e,t,r){"use strict";var n=r(31),i=r(103),s=r(47),a=i(function(e,t){n(t,s(t),e)});e.exports=a},function(e,t,r){"use strict";var n=r(31),i=r(103),s=r(47),a=i(function(e,t,r,i){n(t,s(t),e,i)});e.exports=a},function(e,t,r){"use strict";function n(e){return i(e,s|a)}var i=r(164),s=1,a=4;e.exports=n},function(e,t,r){"use strict";function n(e,t){return t="function"==typeof t?t:void 0,i(e,s|a,t)}var i=r(164),s=1,a=4;e.exports=n},function(e,t){"use strict";function r(e){return function(){return e}}e.exports=r},function(e,t,r){"use strict";function n(e){return e=i(e),e&&a.test(e)?e.replace(s,"\\$&"):e}var i=r(114),s=/[\\^$.*+?()[\]{}|]/g,a=RegExp(s.source);e.exports=n},function(e,t,r){"use strict";e.exports=r(572)},function(e,t,r){"use strict";var n=r(258),i=r(580),s=n(i);e.exports=s},function(e,t,r){"use strict";function n(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var u=null==r?0:a(r);return u<0&&(u=o(n+u,0)),i(e,s(t,3),u)}var i=r(165),s=r(61),a=r(48),o=Math.max;e.exports=n},function(e,t,r){"use strict";var n=r(258),i=r(582),s=n(i);e.exports=s},function(e,t,r){"use strict";function n(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var l=n-1;return void 0!==r&&(l=a(r),l=r<0?o(n+l,0):u(l,n-1)),i(e,s(t,3),l,!0)}var i=r(165),s=r(61),a=r(48),o=Math.max,u=Math.min;e.exports=n},function(e,t,r){"use strict";function n(e,t,r){var n=null==e?void 0:i(e,t);return void 0===n?r:n}var i=r(249);e.exports=n},function(e,t,r){"use strict";function n(e,t){return null!=e&&s(e,t,i)}var i=r(491),s=r(265);e.exports=n},function(e,t,r){"use strict";function n(e){return s(e)&&i(e)}var i=r(24),s=r(25);e.exports=n},function(e,t,r){"use strict";function n(e){return"number"==typeof e&&e==i(e)}var i=r(48);e.exports=n},function(e,t,r){"use strict";function n(e){return"string"==typeof e||!s(e)&&a(e)&&i(e)==o}var i=r(30),s=r(6),a=r(25),o="[object String]";e.exports=n},function(e,t,r){"use strict";function n(e,t){return(o(e)?i:a)(e,s(t,3))}var i=r(60),s=r(61),a=r(252),o=r(6);e.exports=n},function(e,t,r){"use strict";function n(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(s);var r=function r(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var a=e.apply(this,n);return r.cache=s.set(i,a)||s,a};return r.cache=new(n.Cache||i),r}var i=r(160),s="Expected a function";n.Cache=i,e.exports=n},function(e,t,r){"use strict";var n=r(504),i=r(103),s=i(function(e,t,r,i){n(e,t,r,i)});e.exports=s},function(e,t){"use strict";function r(){}e.exports=r},function(e,t,r){"use strict";function n(e){return a(e)?i(o(e)):s(e)}var i=r(507),s=r(508),a=r(173),o=r(108);e.exports=n},function(e,t,r){"use strict";function n(e,t){return e&&e.length&&t&&t.length?i(e,t):e}var i=r(509);e.exports=n},function(e,t,r){"use strict";var n=r(488),i=r(506),s=r(101),a=r(172),o=s(function(e,t){if(null==e)return[];var r=t.length;return r>1&&a(e,t[0],t[1])?t=[]:r>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,n(t,1),[])});e.exports=o},function(e,t,r){"use strict";function n(e,t,r){return e=o(e),r=null==r?0:i(a(r),0,e.length),t=s(t),e.slice(r,r+t.length)==t}var i=r(485),s=r(253),a=r(48),o=r(114);e.exports=n},function(e,t){"use strict";function r(){return!1}e.exports=r},function(e,t,r){"use strict";function n(e){if(!e)return 0===e?e:0;if((e=i(e))===s||e===-s){return(e<0?-1:1)*a}return e===e?e:0}var i=r(598),s=1/0,a=1.7976931348623157e308;e.exports=n},function(e,t,r){"use strict";function n(e){if("number"==typeof e)return e;if(s(e))return a;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var r=l.test(e);return r||c.test(e)?f(e.slice(2),r?2:8):u.test(e)?a:+e}var i=r(18),s=r(62),a=NaN,o=/^\s+|\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt;e.exports=n},function(e,t,r){"use strict";function n(e){return i(e,s(e))}var i=r(31),s=r(47);e.exports=n},function(e,t,r){"use strict";function n(e){return e&&e.length?i(e):[]}var i=r(514);e.exports=n},function(e,t,r){"use strict";function n(e,t){return t=t||{},function(r,n,i){return s(r,e,t)}}function i(e,t){e=e||{},t=t||{};var r={};return Object.keys(t).forEach(function(e){r[e]=t[e]}),Object.keys(e).forEach(function(t){r[t]=e[t]}),r}function s(e,t,r){if("string"!=typeof t)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new a(t,r).match(e))}function a(e,t){if(!(this instanceof a))return new a(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==m.sep&&(e=e.split(m.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function o(){if(!this._made){var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error),this.debug(this.pattern,r),r=this.globParts=r.map(function(e){return e.split(_)}),this.debug(this.pattern,r),r=r.map(function(e,t,r){return e.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,r),this.set=r}}function u(){var e=this.pattern,t=!1,r=this.options,n=0;if(!r.nonegate){for(var i=0,s=e.length;i<s&&"!"===e.charAt(i);i++)t=!t,n++;n&&(this.pattern=e.substr(n)),this.negate=t}}function l(e,t){if(t||(t=this instanceof a?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:v(e)}function c(e,t){function r(){if(i){switch(i){case"*":a+=E,o=!0;break;case"?":a+=b,o=!0;break;default:a+="\\"+i}v.debug("clearStateChar %j %j",i,a),i=!1}}if(e.length>65536)throw new TypeError("pattern is too long");var n=this.options;if(!n.noglobstar&&"**"===e)return y;if(""===e)return"";for(var i,s,a="",o=!!n.nocase,u=!1,l=[],c=[],f=!1,p=-1,h=-1,m="."===e.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",v=this,x=0,A=e.length;x<A&&(s=e.charAt(x));x++)if(this.debug("%s\t%s %s %j",e,x,a,s),u&&S[s])a+="\\"+s,u=!1;else switch(s){case"/":return!1;case"\\":r(),u=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",e,x,a,s),f){this.debug(" in class"),"!"===s&&x===h+1&&(s="^"),a+=s;continue}v.debug("call clearStateChar %j",i),r(),i=s,n.noext&&r();continue;case"(":if(f){a+="(";continue}if(!i){a+="\\(";continue}l.push({type:i,start:x-1,reStart:a.length,open:g[i].open,close:g[i].close}),a+="!"===i?"(?:(?!(?:":"(?:",this.debug("plType %j %j",i,a),i=!1;continue;case")":if(f||!l.length){a+="\\)";continue}r(),o=!0;var _=l.pop();a+=_.close,"!"===_.type&&c.push(_),_.reEnd=a.length;continue;case"|":if(f||!l.length||u){a+="\\|",u=!1;continue}r(),a+="|";continue;case"[":if(r(),f){a+="\\"+s;continue}f=!0,h=x,p=a.length,a+=s;continue;case"]":if(x===h+1||!f){a+="\\"+s,u=!1;continue}if(f){var C=e.substring(h+1,x);try{RegExp("["+C+"]")}catch(e){var w=this.parse(C,D);a=a.substr(0,p)+"\\["+w[0]+"\\]",o=o||w[1],f=!1;continue}}o=!0,f=!1,a+=s;continue;default:r(),u?u=!1:!S[s]||"^"===s&&f||(a+="\\"),a+=s}for(f&&(C=e.substr(h+1),w=this.parse(C,D),a=a.substr(0,p)+"\\["+w[0],o=o||w[1]),_=l.pop();_;_=l.pop()){var P=a.slice(_.reStart+_.open.length);this.debug("setting tail",a,_),P=P.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(e,t,r){return r||(r="\\"),t+t+r+"|"}),this.debug("tail=%j\n %s",P,P,_,a);var k="*"===_.type?E:"?"===_.type?b:"\\"+_.type;o=!0,a=a.slice(0,_.reStart)+k+"\\("+P}r(),u&&(a+="\\\\");var F=!1;switch(a.charAt(0)){case".":case"[":case"(":F=!0}for(var T=c.length-1;T>-1;T--){var O=c[T],B=a.slice(0,O.reStart),R=a.slice(O.reStart,O.reEnd-8),I=a.slice(O.reEnd-8,O.reEnd),M=a.slice(O.reEnd);I+=M;var N=B.split("(").length-1,L=M;for(x=0;x<N;x++)L=L.replace(/\)[+*?]?/,"");M=L;var j="";""===M&&t!==D&&(j="$");a=B+R+M+j+I}if(""!==a&&o&&(a="(?=.)"+a),F&&(a=m+a),t===D)return[a,o];if(!o)return d(e);var U=n.nocase?"i":"";try{var V=new RegExp("^"+a+"$",U)}catch(e){return new RegExp("$.")}return V._glob=e,V._src=a,V}function f(){if(this.regexp||!1===this.regexp)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1,this.regexp;var t=this.options,r=t.noglobstar?E:t.dot?x:A,n=t.nocase?"i":"",i=e.map(function(e){return e.map(function(e){return e===y?r:"string"==typeof e?h(e):e._src}).join("\\/")}).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{this.regexp=new RegExp(i,n)}catch(e){this.regexp=!1}return this.regexp}function p(e,t){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return""===e;if("/"===e&&t)return!0;var r=this.options;"/"!==m.sep&&(e=e.split(m.sep).join("/")),e=e.split(_),this.debug(this.pattern,"split",e);var n=this.set;this.debug(this.pattern,"set",n);var i,s;for(s=e.length-1;s>=0&&!(i=e[s]);s--);for(s=0;s<n.length;s++){var a=n[s],o=e;r.matchBase&&1===a.length&&(o=[i]);if(this.matchOne(o,a,t))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate}function d(e){return e.replace(/\\(.)/g,"$1")}function h(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}e.exports=s,s.Minimatch=a;var m={sep:"/"};try{m=r(19)}catch(e){}var y=s.GLOBSTAR=a.GLOBSTAR={},v=r(398),g={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},b="[^/]",E=b+"*?",x="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",A="(?:(?!(?:\\/|^)\\.).)*?",S=function(e){return e.split("").reduce(function(e,t){return e[t]=!0,e},{})}("().*{}+?[]^$\\!"),_=/\/+/;s.filter=n,s.defaults=function(e){if(!e||!Object.keys(e).length)return s;var t=s,r=function(r,n,s){return t.minimatch(r,n,i(e,s))};return r.Minimatch=function(r,n){return new t.Minimatch(r,i(e,n))},r},a.defaults=function(e){return e&&Object.keys(e).length?s.defaults(e).Minimatch:a},a.prototype.debug=function(){},a.prototype.make=o,a.prototype.parseNegate=u,s.braceExpand=function(e,t){return l(e,t)},a.prototype.braceExpand=l,a.prototype.parse=c;var D={};s.makeRe=function(e,t){return new a(e,t||{}).makeRe()},a.prototype.makeRe=f,s.match=function(e,t,r){r=r||{};var n=new a(t,r);return e=e.filter(function(e){return n.match(e)}),n.options.nonull&&!e.length&&e.push(t),e},a.prototype.match=p,a.prototype.matchOne=function(e,t,r){var n=this.options;this.debug("matchOne",{this:this,file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var i=0,s=0,a=e.length,o=t.length;i<a&&s<o;i++,s++){this.debug("matchOne loop");var u=t[s],l=e[i];if(this.debug(t,u,l),!1===u)return!1;if(u===y){this.debug("GLOBSTAR",[t,u,l]);var c=i,f=s+1;if(f===o){for(this.debug("** at the end");i<a;i++)if("."===e[i]||".."===e[i]||!n.dot&&"."===e[i].charAt(0))return!1;return!0}for(;c<a;){var p=e[c];if(this.debug("\nglobstar while",e,c,t,f,p),this.matchOne(e.slice(c),t.slice(f),r))return this.debug("globstar found match!",c,a,p),!0;if("."===p||".."===p||!n.dot&&"."===p.charAt(0)){this.debug("dot detected!",e,c,t,f);break}this.debug("globstar swallow a segment, and continue"),c++}return!(!r||(this.debug("\n>>> no match, partial?",e,c,t,f),c!==a))}var d;if("string"==typeof u?(d=n.nocase?l.toLowerCase()===u.toLowerCase():l===u,this.debug("string match",u,l,d)):(d=l.match(u),this.debug("pattern match",u,l,d)),!d)return!1}if(i===a&&s===o)return!0;if(i===a)return r;if(s===o){return i===a-1&&""===e[i]}throw new Error("wtf?")}},function(e,t){"use strict";function r(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*f;case"days":case"day":case"d":return r*c;case"hours":case"hour":case"hrs":case"hr":case"h":return r*l;case"minutes":case"minute":case"mins":case"min":case"m":return r*u;case"seconds":case"second":case"secs":case"sec":case"s":return r*o;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function n(e){return e>=c?Math.round(e/c)+"d":e>=l?Math.round(e/l)+"h":e>=u?Math.round(e/u)+"m":e>=o?Math.round(e/o)+"s":e+"ms"}function i(e){return s(e,c,"day")||s(e,l,"hour")||s(e,u,"minute")||s(e,o,"second")||e+" ms"}function s(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=1e3,u=60*o,l=60*u,c=24*l,f=365.25*c;e.exports=function(e,t){t=t||{};var s=void 0===e?"undefined":a(e);if("string"===s&&e.length>0)return r(e);if("number"===s&&!1===isNaN(e))return t.long?i(e):n(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t){"use strict";e.exports=Number.isNaN||function(e){return e!==e}},function(e,t,r){(function(t){"use strict";function r(e){return"/"===e.charAt(0)}function n(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,r=t.exec(e),n=r[1]||"",i=Boolean(n&&":"!==n.charAt(1));return Boolean(r[2]||i)}e.exports="win32"===t.platform?n:r,e.exports.posix=r,e.exports.win32=n}).call(t,r(8))},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var i=r(14),s=function(e){return e&&e.__esModule?e:{default:e}}(i),a=r(1),o=n(a),u=r(116),l=n(u),c=Object.prototype.hasOwnProperty;t.hoist=function(e){function t(e,t){o.assertVariableDeclaration(e);var n=[];return e.declarations.forEach(function(e){r[e.id.name]=o.identifier(e.id.name),e.init?n.push(o.assignmentExpression("=",e.id,e.init)):t&&n.push(e.id)}),0===n.length?null:1===n.length?n[0]:o.sequenceExpression(n)}o.assertFunction(e.node);var r={};e.get("body").traverse({VariableDeclaration:{exit:function(e){var r=t(e.node,!1);null===r?e.remove():l.replaceWithOrRemove(e,o.expressionStatement(r)),e.skip()}},ForStatement:function(e){var r=e.node.init;o.isVariableDeclaration(r)&&l.replaceWithOrRemove(e.get("init"),t(r,!1))},ForXStatement:function(e){var r=e.get("left");r.isVariableDeclaration()&&l.replaceWithOrRemove(r,t(r.node,!0))},FunctionDeclaration:function(e){var t=e.node;r[t.id.name]=t.id;var n=o.expressionStatement(o.assignmentExpression("=",t.id,o.functionExpression(t.id,t.params,t.body,t.generator,t.expression)));e.parentPath.isBlockStatement()?(e.parentPath.unshiftContainer("body",n),e.remove()):l.replaceWithOrRemove(e,n),e.skip()},FunctionExpression:function(e){e.skip()}});var n={};e.get("params").forEach(function(e){var t=e.node;o.isIdentifier(t)&&(n[t.name]=t)});var i=[];return(0,s.default)(r).forEach(function(e){c.call(n,e)||i.push(o.variableDeclarator(r[e],null))}),0===i.length?null:o.variableDeclaration("var",i)}},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(){return r(610)}},function(e,t,r){"use strict";function n(){d.default.ok(this instanceof n)}function i(e){n.call(this),m.assertLiteral(e),this.returnLoc=e}function s(e,t,r){n.call(this),m.assertLiteral(e),m.assertLiteral(t),r?m.assertIdentifier(r):r=null,this.breakLoc=e,this.continueLoc=t,this.label=r}function a(e){n.call(this),m.assertLiteral(e),this.breakLoc=e}function o(e,t,r){n.call(this),m.assertLiteral(e),t?d.default.ok(t instanceof u):t=null,r?d.default.ok(r instanceof l):r=null,d.default.ok(t||r),this.firstLoc=e,this.catchEntry=t,this.finallyEntry=r}function u(e,t){n.call(this),m.assertLiteral(e),m.assertIdentifier(t),this.firstLoc=e,this.paramId=t}function l(e,t){n.call(this),m.assertLiteral(e),m.assertLiteral(t),this.firstLoc=e,this.afterLoc=t}function c(e,t){n.call(this),m.assertLiteral(e),m.assertIdentifier(t),this.breakLoc=e,this.label=t}function f(e){d.default.ok(this instanceof f);var t=r(283).Emitter;d.default.ok(e instanceof t),this.emitter=e,this.entryStack=[new i(e.finalLoc)]}var p=r(64),d=function(e){return e&&e.__esModule?e:{default:e}}(p),h=r(1),m=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(h),y=r(117);(0,y.inherits)(i,n),t.FunctionEntry=i,(0,y.inherits)(s,n),t.LoopEntry=s,(0,y.inherits)(a,n),t.SwitchEntry=a,(0,y.inherits)(o,n),t.TryEntry=o,(0,y.inherits)(u,n),t.CatchEntry=u,(0,y.inherits)(l,n),t.FinallyEntry=l,(0,y.inherits)(c,n),t.LabeledEntry=c;var v=f.prototype;t.LeapManager=f,v.withEntry=function(e,t){d.default.ok(e instanceof n),this.entryStack.push(e);try{t.call(this.emitter)}finally{var r=this.entryStack.pop();d.default.strictEqual(r,e)}},v._findLeapLocation=function(e,t){for(var r=this.entryStack.length-1;r>=0;--r){var n=this.entryStack[r],i=n[e];if(i)if(t){if(n.label&&n.label.name===t.name)return i}else if(!(n instanceof c))return i}return null},v.getBreakLoc=function(e){return this._findLeapLocation("breakLoc",e)},v.getContinueLoc=function(e){return this._findLeapLocation("continueLoc",e)}},function(e,t,r){"use strict";function n(e,t){function r(e){function t(e){return r||(Array.isArray(e)?e.some(t):o.isNode(e)&&(s.default.strictEqual(r,!1),r=n(e))),r}o.assertNode(e);var r=!1,i=o.VISITOR_KEYS[e.type];if(i)for(var a=0;a<i.length;a++){var u=i[a],l=e[u];t(l)}return r}function n(n){o.assertNode(n);var i=u(n);return l.call(i,e)?i[e]:l.call(c,n.type)?i[e]=!1:l.call(t,n.type)?i[e]=!0:i[e]=r(n)}return n.onlyChildren=r,n}var i=r(64),s=function(e){return e&&e.__esModule?e:{default:e}}(i),a=r(1),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(a),u=r(281).makeAccessor(),l=Object.prototype.hasOwnProperty,c={FunctionExpression:!0,ArrowFunctionExpression:!0},f={CallExpression:!0,ForInStatement:!0,UnaryExpression:!0,BinaryExpression:!0,AssignmentExpression:!0,UpdateExpression:!0,NewExpression:!0},p={YieldExpression:!0,BreakStatement:!0,ContinueStatement:!0,ReturnStatement:!0,ThrowStatement:!0};for(var d in p)l.call(p,d)&&(f[d]=p[d]);t.hasSideEffects=n("hasSideEffects",f),t.containsLeap=n("containsLeap",p)},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){if(!e.node||!a.isFunction(e.node))throw new Error("replaceShorthandObjectMethod can only be called on Function AST node paths.");if(!a.isObjectMethod(e.node))return e;if(!e.node.generator)return e;var t=e.node.params.map(function(e){return a.cloneDeep(e)}),r=a.functionExpression(null,t,a.cloneDeep(e.node.body),e.node.generator,e.node.async);return u.replaceWithOrRemove(e,a.objectProperty(a.cloneDeep(e.node.key),r,e.node.computed,!1)),e.get("value")}t.__esModule=!0,t.default=i;var s=r(1),a=n(s),o=r(116),u=n(o)},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=e.node;return f.assertFunction(t),t.id||(t.id=e.scope.parent.generateUidIdentifier("callee")),t.generator&&f.isFunctionDeclaration(t)?a(e):t.id}function a(e){var t=e.node;f.assertIdentifier(t.id);var r=e.findParent(function(e){return e.isProgram()||e.isBlockStatement()});if(!r)return t.id;var n=r.node;l.default.ok(Array.isArray(n.body));var i=g(n);i.decl||(i.decl=f.variableDeclaration("var",[]),r.unshiftContainer("body",i.decl),i.declPath=r.get("body.0")),l.default.strictEqual(i.declPath.node,i.decl);var s=r.scope.generateUidIdentifier("marked"),a=f.callExpression(v.runtimeProperty("mark"),[t.id]),o=i.decl.declarations.push(f.variableDeclarator(s,a))-1,u=i.declPath.get("declarations."+o+".init");return l.default.strictEqual(u.node,a),u.addComment("leading","#__PURE__"),s}function o(e,t){var r={didRenameArguments:!1,argsId:t};return e.traverse(b,r),r.didRenameArguments}var u=r(64),l=i(u),c=r(1),f=n(c),p=r(605),d=r(283),h=r(609),m=i(h),y=r(116),v=n(y);t.name="regenerator-transform",t.visitor={Function:{exit:function(e,t){var r=e.node;if(r.generator){if(r.async){if(!1===t.opts.asyncGenerators)return}else if(!1===t.opts.generators)return}else{if(!r.async)return;if(!1===t.opts.async)return}e=(0,m.default)(e),r=e.node;var n=e.scope.generateUidIdentifier("context"),i=e.scope.generateUidIdentifier("args");e.ensureBlock();var a=e.get("body");r.async&&a.traverse(x),a.traverse(E,{context:n});var u=[],l=[];a.get("body").forEach(function(e){var t=e.node;f.isExpressionStatement(t)&&f.isStringLiteral(t.expression)?u.push(t):t&&null!=t._blockHoist?u.push(t):l.push(t)}),u.length>0&&(a.node.body=l);var c=s(e);f.assertIdentifier(r.id);var h=f.identifier(r.id.name+"$"),y=(0,p.hoist)(e);if(o(e,i)){y=y||f.variableDeclaration("var",[]);var g=f.identifier("arguments");g._shadowedFunctionLiteral=e,y.declarations.push(f.variableDeclarator(i,g))}var b=new d.Emitter(n);b.explode(e.get("body")),y&&y.declarations.length>0&&u.push(y);var A=[b.getContextFunction(h),r.generator?c:f.nullLiteral(),f.thisExpression()],S=b.getTryLocsList();S&&A.push(S);var _=f.callExpression(v.runtimeProperty(r.async?"async":"wrap"),A);u.push(f.returnStatement(_)),r.body=f.blockStatement(u);var D=a.node.directives;D&&(r.body.directives=D);var C=r.generator;C&&(r.generator=!1),r.async&&(r.async=!1),C&&f.isExpression(r)&&(v.replaceWithOrRemove(e,f.callExpression(v.runtimeProperty("mark"),[r])),e.addComment("leading","#__PURE__")),e.requeue()}}};var g=r(281).makeAccessor(),b={"FunctionExpression|FunctionDeclaration":function(e){e.skip()},Identifier:function(e,t){"arguments"===e.node.name&&v.isReference(e)&&(v.replaceWithOrRemove(e,t.argsId),t.didRenameArguments=!0)}},E={MetaProperty:function(e){var t=e.node;"function"===t.meta.name&&"sent"===t.property.name&&v.replaceWithOrRemove(e,f.memberExpression(this.context,f.identifier("_sent")))}},x={Function:function(e){e.skip()},AwaitExpression:function(e){var t=e.node.argument;v.replaceWithOrRemove(e,f.yieldExpression(f.callExpression(v.runtimeProperty("awrap"),[t]),!1))}}},function(e,t,r){"use strict";var n=r(282);t.REGULAR={d:n().addRange(48,57),D:n().addRange(0,47).addRange(58,65535),s:n(32,160,5760,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:n().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,65535),w:n(95).addRange(48,57).addRange(65,90).addRange(97,122),W:n(96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,65535)},t.UNICODE={d:n().addRange(48,57),D:n().addRange(0,47).addRange(58,1114111),s:n(32,160,5760,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:n().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,1114111),w:n(95).addRange(48,57).addRange(65,90).addRange(97,122),W:n(96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,1114111)},t.UNICODE_IGNORE_CASE={d:n().addRange(48,57),D:n().addRange(0,47).addRange(58,1114111),s:n(32,160,5760,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:n().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,1114111),w:n(95,383,8490).addRange(48,57).addRange(65,90).addRange(97,122),W:n(75,83,96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,1114111)}},function(e,t,r){"use strict";function n(e){return S?A?m.UNICODE_IGNORE_CASE[e]:m.UNICODE[e]:m.REGULAR[e]}function i(e,t){return v.call(e,t)}function s(e,t){for(var r in t)e[r]=t[r]}function a(e,t){if(t){var r=p(t,"");switch(r.type){case"characterClass":case"group":case"value":break;default:r=o(r,t)}s(e,r)}}function o(e,t){return{type:"group",behavior:"ignore",body:[e],raw:"(?:"+t+")"}}function u(e){return!!i(h,e)&&h[e]}function l(e){var t=d();e.body.forEach(function(e){switch(e.type){case"value":if(t.add(e.codePoint),A&&S){var r=u(e.codePoint);r&&t.add(r)}break;case"characterClassRange":var i=e.min.codePoint,s=e.max.codePoint;t.addRange(i,s),A&&S&&t.iuAddRange(i,s);break;case"characterClassEscape":t.add(n(e.value));break;default:throw Error("Unknown term type: "+e.type)}});return e.negative&&(t=(S?g:b).clone().remove(t)),a(e,t.toString()),e}function c(e){switch(e.type){case"dot":a(e,(S?E:x).toString());break;case"characterClass":e=l(e);break;case"characterClassEscape":a(e,n(e.value).toString());break;case"alternative":case"disjunction":case"group":case"quantifier":e.body=e.body.map(c);break;case"value":var t=e.codePoint,r=d(t);if(A&&S){var i=u(t);i&&r.add(i)}a(e,r.toString());break;case"anchor":case"empty":case"group":case"reference":break;default:throw Error("Unknown term type: "+e.type)}return e}var f=r(613).generate,p=r(614).parse,d=r(282),h=r(631),m=r(611),y={},v=y.hasOwnProperty,g=d().addRange(0,1114111),b=d().addRange(0,65535),E=g.clone().remove(10,13,8232,8233),x=E.clone().intersection(b);d.prototype.iuAddRange=function(e,t){var r=this;do{var n=u(e);n&&r.add(n)}while(++e<=t);return r};var A=!1,S=!1;e.exports=function(e,t){var r=p(e,t);return A=!!t&&t.indexOf("i")>-1,S=!!t&&t.indexOf("u")>-1,s(r,c(r)),f(r)}},function(e,t,r){var n;(function(e,i){"use strict";var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};(function(){function a(){var e,t,r=[],n=-1,i=arguments.length;if(!i)return"";for(var s="";++n<i;){var a=Number(arguments[n]);if(!isFinite(a)||a<0||a>1114111||k(a)!=a)throw RangeError("Invalid code point: "+a);a<=65535?r.push(a):(a-=65536,e=55296+(a>>10),t=a%1024+56320,r.push(e,t)),(n+1==i||r.length>16384)&&(s+=P.apply(null,r),r.length=0)}return s}function o(e,t){if(-1==t.indexOf("|")){if(e==t)return;throw Error("Invalid node type: "+e)}if(t=o.hasOwnProperty(t)?o[t]:o[t]=RegExp("^(?:"+t+")$"),!t.test(e))throw Error("Invalid node type: "+e) }function u(e){var t=e.type;if(u.hasOwnProperty(t)&&"function"==typeof u[t])return u[t](e);throw Error("Invalid node type: "+t)}function l(e){o(e.type,"alternative");var t=e.body,r=t?t.length:0;if(1==r)return x(t[0]);for(var n=-1,i="";++n<r;)i+=x(t[n]);return i}function c(e){switch(o(e.type,"anchor"),e.kind){case"start":return"^";case"end":return"$";case"boundary":return"\\b";case"not-boundary":return"\\B";default:throw Error("Invalid assertion")}}function f(e){return o(e.type,"anchor|characterClass|characterClassEscape|dot|group|reference|value"),u(e)}function p(e){o(e.type,"characterClass");var t=e.body,r=t?t.length:0,n=-1,i="[";for(e.negative&&(i+="^");++n<r;)i+=m(t[n]);return i+="]"}function d(e){return o(e.type,"characterClassEscape"),"\\"+e.value}function h(e){o(e.type,"characterClassRange");var t=e.min,r=e.max;if("characterClassRange"==t.type||"characterClassRange"==r.type)throw Error("Invalid character class range");return m(t)+"-"+m(r)}function m(e){return o(e.type,"anchor|characterClassEscape|characterClassRange|dot|value"),u(e)}function y(e){o(e.type,"disjunction");var t=e.body,r=t?t.length:0;if(0==r)throw Error("No body");if(1==r)return u(t[0]);for(var n=-1,i="";++n<r;)0!=n&&(i+="|"),i+=u(t[n]);return i}function v(e){return o(e.type,"dot"),"."}function g(e){o(e.type,"group");var t="(";switch(e.behavior){case"normal":break;case"ignore":t+="?:";break;case"lookahead":t+="?=";break;case"negativeLookahead":t+="?!";break;default:throw Error("Invalid behaviour: "+e.behaviour)}var r=e.body,n=r?r.length:0;if(1==n)t+=u(r[0]);else for(var i=-1;++i<n;)t+=u(r[i]);return t+=")"}function b(e){o(e.type,"quantifier");var t="",r=e.min,n=e.max;switch(n){case void 0:case null:switch(r){case 0:t="*";break;case 1:t="+";break;default:t="{"+r+",}"}break;default:t=r==n?"{"+r+"}":0==r&&1==n?"?":"{"+r+","+n+"}"}return e.greedy||(t+="?"),f(e.body[0])+t}function E(e){return o(e.type,"reference"),"\\"+e.matchIndex}function x(e){return o(e.type,"anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|value"),u(e)}function A(e){o(e.type,"value");var t=e.kind,r=e.codePoint;switch(t){case"controlLetter":return"\\c"+a(r+64);case"hexadecimalEscape":return"\\x"+("00"+r.toString(16).toUpperCase()).slice(-2);case"identifier":return"\\"+a(r);case"null":return"\\"+r;case"octal":return"\\"+r.toString(8);case"singleEscape":switch(r){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r";default:throw Error("Invalid codepoint: "+r)}case"symbol":return a(r);case"unicodeEscape":return"\\u"+("0000"+r.toString(16).toUpperCase()).slice(-4);case"unicodeCodePointEscape":return"\\u{"+r.toString(16).toUpperCase()+"}";default:throw Error("Unsupported node kind: "+t)}}var S={function:!0,object:!0},_=S["undefined"==typeof window?"undefined":s(window)]&&window||this,D=S[s(t)]&&t,C=S[s(e)]&&e&&!e.nodeType&&e,w=D&&C&&"object"==(void 0===i?"undefined":s(i))&&i;!w||w.global!==w&&w.window!==w&&w.self!==w||(_=w);var P=String.fromCharCode,k=Math.floor;u.alternative=l,u.anchor=c,u.characterClass=p,u.characterClassEscape=d,u.characterClassRange=h,u.disjunction=y,u.dot=v,u.group=g,u.quantifier=b,u.reference=E,u.value=A,"object"==s(r(49))&&r(49)?void 0!==(n=function(){return{generate:u}}.call(t,r,t,e))&&(e.exports=n):D&&C?D.generate=u:_.regjsgen={generate:u}}).call(void 0)}).call(t,r(39)(e),function(){return this}())},function(e,t){"use strict";!function(){function t(e,t){function r(t){return t.raw=e.substring(t.range[0],t.range[1]),t}function n(e,t){return e.range[0]=t,r(e)}function i(e,t){return r({type:"anchor",kind:e,range:[$-t,$]})}function s(e,t,n,i){return r({type:"value",kind:e,codePoint:t,range:[n,i]})}function a(e,t,r,n){return n=n||0,s(e,t,$-(r.length+n),$)}function o(e){var t=e[0],r=t.charCodeAt(0);if(z){var n;if(1===t.length&&r>=55296&&r<=56319&&(n=x().charCodeAt(0))>=56320&&n<=57343)return $++,s("symbol",1024*(r-55296)+n-56320+65536,$-2,$)}return s("symbol",r,$-1,$)}function u(e,t,n){return r({type:"disjunction",body:e,range:[t,n]})}function l(){return r({type:"dot",range:[$-1,$]})}function c(e){return r({type:"characterClassEscape",value:e,range:[$-2,$]})}function f(e){return r({type:"reference",matchIndex:parseInt(e,10),range:[$-1-e.length,$]})}function p(e,t,n,i){return r({type:"group",behavior:e,body:t,range:[n,i]})}function d(e,t,n,i){return null==i&&(n=$-1,i=$),r({type:"quantifier",min:e,max:t,greedy:!0,body:null,range:[n,i]})}function h(e,t,n){return r({type:"alternative",body:e,range:[t,n]})}function m(e,t,n,i){return r({type:"characterClass",body:e,negative:t,range:[n,i]})}function y(e,t,n,i){return e.codePoint>t.codePoint&&K("invalid range in character class",e.raw+"-"+t.raw,n,i),r({type:"characterClassRange",min:e,max:t,range:[n,i]})}function v(e){return"alternative"===e.type?e.body:[e]}function g(t){t=t||1;var r=e.substring($,$+t);return $+=t||1,r}function b(e){E(e)||K("character",e)}function E(t){if(e.indexOf(t,$)===$)return g(t.length)}function x(){return e[$]}function A(t){return e.indexOf(t,$)===$}function S(t){return e[$+1]===t}function _(t){var r=e.substring($),n=r.match(t);return n&&(n.range=[],n.range[0]=$,g(n[0].length),n.range[1]=$),n}function D(){var e=[],t=$;for(e.push(C());E("|");)e.push(C());return 1===e.length?e[0]:u(e,t,$)}function C(){for(var e,t=[],r=$;e=w();)t.push(e);return 1===t.length?t[0]:h(t,r,$)}function w(){if($>=e.length||A("|")||A(")"))return null;var t=k();if(t)return t;var r=T();r||K("Expected atom");var i=F()||!1;return i?(i.body=v(r),n(i,r.range[0]),i):r}function P(e,t,r,n){var i=null,s=$;if(E(e))i=t;else{if(!E(r))return!1;i=n}var a=D();a||K("Expected disjunction"),b(")");var o=p(i,v(a),s,$);return"normal"==i&&X&&J++,o}function k(){return E("^")?i("start",1):E("$")?i("end",1):E("\\b")?i("boundary",2):E("\\B")?i("not-boundary",2):P("(?=","lookahead","(?!","negativeLookahead")}function F(){var e,t,r,n,i=$;return E("*")?t=d(0):E("+")?t=d(1):E("?")?t=d(0,1):(e=_(/^\{([0-9]+)\}/))?(r=parseInt(e[1],10),t=d(r,r,e.range[0],e.range[1])):(e=_(/^\{([0-9]+),\}/))?(r=parseInt(e[1],10),t=d(r,void 0,e.range[0],e.range[1])):(e=_(/^\{([0-9]+),([0-9]+)\}/))&&(r=parseInt(e[1],10),n=parseInt(e[2],10),r>n&&K("numbers out of order in {} quantifier","",i,$),t=d(r,n,e.range[0],e.range[1])),t&&E("?")&&(t.greedy=!1,t.range[1]+=1),t}function T(){var e;return(e=_(/^[^^$\\.*+?(){[|]/))?o(e):E(".")?l():E("\\")?(e=R(),e||K("atomEscape"),e):(e=j())?e:P("(?:","ignore","(","normal")}function O(e){if(z){var t,n;if("unicodeEscape"==e.kind&&(t=e.codePoint)>=55296&&t<=56319&&A("\\")&&S("u")){var i=$;$++;var s=B();"unicodeEscape"==s.kind&&(n=s.codePoint)>=56320&&n<=57343?(e.range[1]=s.range[1],e.codePoint=1024*(t-55296)+n-56320+65536,e.type="value",e.kind="unicodeCodePointEscape",r(e)):$=i}}return e}function B(){return R(!0)}function R(e){var t,r=$;if(t=I())return t;if(e){if(E("b"))return a("singleEscape",8,"\\b");E("B")&&K("\\B not possible inside of CharacterClass","",r)}return t=M()}function I(){var e,t;if(e=_(/^(?!0)\d+/)){t=e[0];var r=parseInt(e[0],10);return r<=J?f(e[0]):(H.push(r),g(-e[0].length),(e=_(/^[0-7]{1,3}/))?a("octal",parseInt(e[0],8),e[0],1):(e=o(_(/^[89]/)),n(e,e.range[0]-1)))}return(e=_(/^[0-7]{1,3}/))?(t=e[0],/^0{1,3}$/.test(t)?a("null",0,"0",t.length+1):a("octal",parseInt(t,8),t,1)):!!(e=_(/^[dDsSwW]/))&&c(e[0])}function M(){var e;if(e=_(/^[fnrtv]/)){var t=0;switch(e[0]){case"t":t=9;break;case"n":t=10;break;case"v":t=11;break;case"f":t=12;break;case"r":t=13}return a("singleEscape",t,"\\"+e[0])}return(e=_(/^c([a-zA-Z])/))?a("controlLetter",e[1].charCodeAt(0)%32,e[1],2):(e=_(/^x([0-9a-fA-F]{2})/))?a("hexadecimalEscape",parseInt(e[1],16),e[1],2):(e=_(/^u([0-9a-fA-F]{4})/))?O(a("unicodeEscape",parseInt(e[1],16),e[1],2)):z&&(e=_(/^u\{([0-9a-fA-F]+)\}/))?a("unicodeCodePointEscape",parseInt(e[1],16),e[1],4):L()}function N(e){var t=new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]");return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&t.test(String.fromCharCode(e))}function L(){var e;return N(x())?E("")?a("identifier",8204,""):E("")?a("identifier",8205,""):null:(e=g(),a("identifier",e.charCodeAt(0),e,1))}function j(){var e,t=$;return(e=_(/^\[\^/))?(e=U(),b("]"),m(e,!0,t,$)):E("[")?(e=U(),b("]"),m(e,!1,t,$)):null}function U(){var e;return A("]")?[]:(e=G(),e||K("nonEmptyClassRanges"),e)}function V(e){var t,r,n;if(A("-")&&!S("]")){b("-"),n=Y(),n||K("classAtom"),r=$;var i=U();return i||K("classRanges"),t=e.range[0],"empty"===i.type?[y(e,n,t,r)]:[y(e,n,t,r)].concat(i)}return n=W(),n||K("nonEmptyClassRangesNoDash"),[e].concat(n)}function G(){var e=Y();return e||K("classAtom"),A("]")?[e]:V(e)}function W(){var e=Y();return e||K("classAtom"),A("]")?e:V(e)}function Y(){return E("-")?o("-"):q()}function q(){var e;return(e=_(/^[^\\\]-]/))?o(e[0]):E("\\")?(e=B(),e||K("classEscape"),O(e)):void 0}function K(t,r,n,i){n=null==n?$:n,i=null==i?n:i;var s=Math.max(0,n-10),a=Math.min(i+10,e.length),o=" "+e.substring(s,a),u=" "+new Array(n-s+1).join(" ")+"^";throw SyntaxError(t+" at position "+n+(r?": "+r:"")+"\n"+o+"\n"+u)}var H=[],J=0,X=!0,z=-1!==(t||"").indexOf("u"),$=0;""===(e=String(e))&&(e="(?:)");var Q=D();Q.range[1]!==e.length&&K("Could not parse entire input - got stuck","",Q.range[1]);for(var Z=0;Z<H.length;Z++)if(H[Z]<=J)return $=0,X=!1,D();return Q}var r={parse:t};void 0!==e&&e.exports?e.exports=r:window.regjsparser=r}()},function(e,t,r){"use strict";var n=r(467);e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("Expected `input` to be a string");if(t<0||!n(t))throw new TypeError("Expected `count` to be a positive finite number");var r="";do{1&t&&(r+=e),e+=e}while(t>>=1);return r}},function(e,t){"use strict";var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e<r.length)return r[e];throw new TypeError("Must be between 0 and 63: "+e)},t.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1}},function(e,t){"use strict";function r(e,n,i,s,a,o){var u=Math.floor((n-e)/2)+e,l=a(i,s[u],!0);return 0===l?u:l>0?n-u>1?r(u,n,i,s,a,o):o==t.LEAST_UPPER_BOUND?n<s.length?n:-1:u:u-e>1?r(e,u,i,s,a,o):o==t.LEAST_UPPER_BOUND?u:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,n,i,s){if(0===n.length)return-1;var a=r(-1,n.length,e,n,i,s||t.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&0===i(n[a],n[a-1],!0);)--a;return a}},function(e,t,r){"use strict";function n(e,t){var r=e.generatedLine,n=t.generatedLine,i=e.generatedColumn,a=t.generatedColumn;return n>r||n==r&&a>=i||s.compareByGeneratedPositionsInflated(e,t)<=0}function i(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var s=r(63);i.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},i.prototype.add=function(e){n(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},i.prototype.toArray=function(){return this._sorted||(this._array.sort(s.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.MappingList=i},function(e,t){"use strict";function r(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function n(e,t){return Math.round(e+Math.random()*(t-e))}function i(e,t,s,a){if(s<a){var o=n(s,a),u=s-1;r(e,o,a);for(var l=e[a],c=s;c<a;c++)t(e[c],l)<=0&&(u+=1,r(e,u,c));r(e,u+1,c);var f=u+1;i(e,t,s,f-1),i(e,t,f+1,a)}}t.quickSort=function(e,t){i(e,t,0,e.length-1)}},function(e,t,r){"use strict";function n(e){var t=e;return"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=t.sections?new a(t):new i(t)}function i(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=o.getArg(t,"version"),n=o.getArg(t,"sources"),i=o.getArg(t,"names",[]),s=o.getArg(t,"sourceRoot",null),a=o.getArg(t,"sourcesContent",null),u=o.getArg(t,"mappings"),c=o.getArg(t,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);n=n.map(String).map(o.normalize).map(function(e){return s&&o.isAbsolute(s)&&o.isAbsolute(e)?o.relative(s,e):e}),this._names=l.fromArray(i.map(String),!0),this._sources=l.fromArray(n,!0),this.sourceRoot=s,this.sourcesContent=a,this._mappings=u,this.file=c}function s(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function a(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=o.getArg(t,"version"),i=o.getArg(t,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new l,this._names=new l;var s={line:-1,column:0};this._sections=i.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=o.getArg(e,"offset"),r=o.getArg(t,"line"),i=o.getArg(t,"column");if(r<s.line||r===s.line&&i<s.column)throw new Error("Section offsets must be ordered and non-overlapping.");return s=t,{generatedOffset:{generatedLine:r+1,generatedColumn:i+1},consumer:new n(o.getArg(e,"map"))}})}var o=r(63),u=r(617),l=r(285).ArraySet,c=r(286),f=r(619).quickSort;n.fromSourceMap=function(e){return i.fromSourceMap(e)},n.prototype._version=3,n.prototype.__generatedMappings=null,Object.defineProperty(n.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),n.prototype.__originalMappings=null,Object.defineProperty(n.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),n.prototype._charIsMappingSeparator=function(e,t){var r=e.charAt(t);return";"===r||","===r},n.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},n.GENERATED_ORDER=1,n.ORIGINAL_ORDER=2,n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.prototype.eachMapping=function(e,t,r){var i,s=t||null,a=r||n.GENERATED_ORDER;switch(a){case n.GENERATED_ORDER:i=this._generatedMappings;break;case n.ORIGINAL_ORDER:i=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;i.map(function(e){var t=null===e.source?null:this._sources.at(e.source);return null!=t&&null!=u&&(t=o.join(u,t)),{source:t,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}},this).forEach(e,s)},n.prototype.allGeneratedPositionsFor=function(e){var t=o.getArg(e,"line"),r={source:o.getArg(e,"source"),originalLine:t,originalColumn:o.getArg(e,"column",0)};if(null!=this.sourceRoot&&(r.source=o.relative(this.sourceRoot,r.source)),!this._sources.has(r.source))return[];r.source=this._sources.indexOf(r.source);var n=[],i=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,u.LEAST_UPPER_BOUND);if(i>=0){var s=this._originalMappings[i];if(void 0===e.column)for(var a=s.originalLine;s&&s.originalLine===a;)n.push({line:o.getArg(s,"generatedLine",null),column:o.getArg(s,"generatedColumn",null),lastColumn:o.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var l=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==l;)n.push({line:o.getArg(s,"generatedLine",null),column:o.getArg(s,"generatedColumn",null),lastColumn:o.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return n},t.SourceMapConsumer=n,i.prototype=Object.create(n.prototype),i.prototype.consumer=n,i.fromSourceMap=function(e){var t=Object.create(i.prototype),r=t._names=l.fromArray(e._names.toArray(),!0),n=t._sources=l.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var a=e._mappings.toArray().slice(),u=t.__generatedMappings=[],c=t.__originalMappings=[],p=0,d=a.length;p<d;p++){var h=a[p],m=new s;m.generatedLine=h.generatedLine,m.generatedColumn=h.generatedColumn,h.source&&(m.source=n.indexOf(h.source),m.originalLine=h.originalLine,m.originalColumn=h.originalColumn,h.name&&(m.name=r.indexOf(h.name)),c.push(m)),u.push(m)}return f(t.__originalMappings,o.compareByOriginalPositions),t},i.prototype._version=3,Object.defineProperty(i.prototype,"sources",{get:function(){return this._sources.toArray().map(function(e){return null!=this.sourceRoot?o.join(this.sourceRoot,e):e},this)}}),i.prototype._parseMappings=function(e,t){for(var r,n,i,a,u,l=1,p=0,d=0,h=0,m=0,y=0,v=e.length,g=0,b={},E={},x=[],A=[];g<v;)if(";"===e.charAt(g))l++,g++,p=0;else if(","===e.charAt(g))g++;else{for(r=new s,r.generatedLine=l,a=g;a<v&&!this._charIsMappingSeparator(e,a);a++);if(n=e.slice(g,a),i=b[n])g+=n.length;else{for(i=[];g<a;)c.decode(e,g,E),u=E.value,g=E.rest,i.push(u);if(2===i.length)throw new Error("Found a source, but no line and column");if(3===i.length)throw new Error("Found a source and line, but no column");b[n]=i}r.generatedColumn=p+i[0],p=r.generatedColumn,i.length>1&&(r.source=m+i[1],m+=i[1],r.originalLine=d+i[2],d=r.originalLine,r.originalLine+=1,r.originalColumn=h+i[3],h=r.originalColumn,i.length>4&&(r.name=y+i[4],y+=i[4])),A.push(r),"number"==typeof r.originalLine&&x.push(r)}f(A,o.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,f(x,o.compareByOriginalPositions),this.__originalMappings=x},i.prototype._findMapping=function(e,t,r,n,i,s){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[n]);return u.search(e,t,i,s)},i.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var r=this._generatedMappings[e+1];if(t.generatedLine===r.generatedLine){t.lastGeneratedColumn=r.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},i.prototype.originalPositionFor=function(e){var t={generatedLine:o.getArg(e,"line"),generatedColumn:o.getArg(e,"column")},r=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",o.compareByGeneratedPositionsDeflated,o.getArg(e,"bias",n.GREATEST_LOWER_BOUND));if(r>=0){var i=this._generatedMappings[r];if(i.generatedLine===t.generatedLine){var s=o.getArg(i,"source",null);null!==s&&(s=this._sources.at(s),null!=this.sourceRoot&&(s=o.join(this.sourceRoot,s)));var a=o.getArg(i,"name",null);return null!==a&&(a=this._names.at(a)),{source:s,line:o.getArg(i,"originalLine",null),column:o.getArg(i,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},i.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},i.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=o.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=o.urlParse(this.sourceRoot))){var n=e.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(n))return this.sourcesContent[this._sources.indexOf(n)];if((!r.path||"/"==r.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},i.prototype.generatedPositionFor=function(e){var t=o.getArg(e,"source");if(null!=this.sourceRoot&&(t=o.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};t=this._sources.indexOf(t);var r={source:t,originalLine:o.getArg(e,"line"),originalColumn:o.getArg(e,"column")},i=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,o.getArg(e,"bias",n.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===r.source)return{line:o.getArg(s,"generatedLine",null),column:o.getArg(s,"generatedColumn",null),lastColumn:o.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},t.BasicSourceMapConsumer=i,a.prototype=Object.create(n.prototype),a.prototype.constructor=n,a.prototype._version=3,Object.defineProperty(a.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}}),a.prototype.originalPositionFor=function(e){var t={generatedLine:o.getArg(e,"line"),generatedColumn:o.getArg(e,"column")},r=u.search(t,this._sections,function(e,t){var r=e.generatedLine-t.generatedOffset.generatedLine;return r||e.generatedColumn-t.generatedOffset.generatedColumn}),n=this._sections[r];return n?n.consumer.originalPositionFor({line:t.generatedLine-(n.generatedOffset.generatedLine-1),column:t.generatedColumn-(n.generatedOffset.generatedLine===t.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},a.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},a.prototype.sourceContentFor=function(e,t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r],i=n.consumer.sourceContentFor(e,!0);if(i)return i}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},a.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t];if(-1!==r.consumer.sources.indexOf(o.getArg(e,"source"))){var n=r.consumer.generatedPositionFor(e);if(n){return{line:n.line+(r.generatedOffset.generatedLine-1),column:n.column+(r.generatedOffset.generatedLine===n.line?r.generatedOffset.generatedColumn-1:0)}}}}return{line:null,column:null}},a.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var n=this._sections[r],i=n.consumer._generatedMappings,s=0;s<i.length;s++){var a=i[s],u=n.consumer._sources.at(a.source);null!==n.consumer.sourceRoot&&(u=o.join(n.consumer.sourceRoot,u)),this._sources.add(u),u=this._sources.indexOf(u);var l=n.consumer._names.at(a.name);this._names.add(l),l=this._names.indexOf(l);var c={source:u,generatedLine:a.generatedLine+(n.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(n.generatedOffset.generatedLine===a.generatedLine?n.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:l};this.__generatedMappings.push(c),"number"==typeof c.originalLine&&this.__originalMappings.push(c)}f(this.__generatedMappings,o.compareByGeneratedPositionsDeflated),f(this.__originalMappings,o.compareByOriginalPositions)},t.IndexedSourceMapConsumer=a},function(e,t,r){"use strict";function n(e,t,r,n,i){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==r?null:r,this.name=null==i?null:i,this[o]=!0,null!=n&&this.add(n)}var i=r(287).SourceMapGenerator,s=r(63),a=/(\r?\n)/,o="$$$isSourceNode$$$";n.fromStringWithSourceMap=function(e,t,r){function i(e,t){if(null===e||void 0===e.source)o.add(t);else{var i=r?s.join(r,e.source):e.source;o.add(new n(e.originalLine,e.originalColumn,i,t,e.name))}}var o=new n,u=e.split(a),l=function(){return u.shift()+(u.shift()||"")},c=1,f=0,p=null;return t.eachMapping(function(e){if(null!==p){if(!(c<e.generatedLine)){var t=u[0],r=t.substr(0,e.generatedColumn-f);return u[0]=t.substr(e.generatedColumn-f),f=e.generatedColumn,i(p,r),void(p=e)}i(p,l()),c++,f=0}for(;c<e.generatedLine;)o.add(l()),c++;if(f<e.generatedColumn){var t=u[0];o.add(t.substr(0,e.generatedColumn)),u[0]=t.substr(e.generatedColumn),f=e.generatedColumn}p=e},this),u.length>0&&(p&&i(p,l()),o.add(u.join(""))),t.sources.forEach(function(e){var n=t.sourceContentFor(e);null!=n&&(null!=r&&(e=s.join(r,e)),o.setSourceContent(e,n))}),o},n.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else{if(!e[o]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},n.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[o]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},n.prototype.walk=function(e){for(var t,r=0,n=this.children.length;r<n;r++)t=this.children[r],t[o]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},n.prototype.join=function(e){var t,r,n=this.children.length;if(n>0){for(t=[],r=0;r<n-1;r++)t.push(this.children[r]),t.push(e);t.push(this.children[r]),this.children=t}return this},n.prototype.replaceRight=function(e,t){var r=this.children[this.children.length-1];return r[o]?r.replaceRight(e,t):"string"==typeof r?this.children[this.children.length-1]=r.replace(e,t):this.children.push("".replace(e,t)),this},n.prototype.setSourceContent=function(e,t){this.sourceContents[s.toSetString(e)]=t},n.prototype.walkSourceContents=function(e){for(var t=0,r=this.children.length;t<r;t++)this.children[t][o]&&this.children[t].walkSourceContents(e);for(var n=Object.keys(this.sourceContents),t=0,r=n.length;t<r;t++)e(s.fromSetString(n[t]),this.sourceContents[n[t]])},n.prototype.toString=function(){var e="";return this.walk(function(t){e+=t}),e},n.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},r=new i(e),n=!1,s=null,a=null,o=null,u=null;return this.walk(function(e,i){t.code+=e,null!==i.source&&null!==i.line&&null!==i.column?(s===i.source&&a===i.line&&o===i.column&&u===i.name||r.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:t.line,column:t.column},name:i.name}),s=i.source,a=i.line,o=i.column,u=i.name,n=!0):n&&(r.addMapping({generated:{line:t.line,column:t.column}}),s=null,n=!1);for(var l=0,c=e.length;l<c;l++)10===e.charCodeAt(l)?(t.line++,t.column=0,l+1===c?(s=null,n=!1):n&&r.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:t.line,column:t.column},name:i.name})):t.column++}),this.walkSourceContents(function(e,t){r.setSourceContent(e,t)}),{code:t.code,map:r}},t.SourceNode=n},function(e,t,r){"use strict";var n=r(180)();e.exports=function(e){return"string"==typeof e?e.replace(n,""):e}},function(e,t,r){(function(t){"use strict";var r=t.argv,n=r.indexOf("--"),i=function(e){e="--"+e;var t=r.indexOf(e);return-1!==t&&(-1===n||t<n)};e.exports=function(){return"FORCE_COLOR"in t.env||!(i("no-color")||i("no-colors")||i("color=false"))&&(!!(i("color")||i("colors")||i("color=true")||i("color=always"))||!(t.stdout&&!t.stdout.isTTY)&&("win32"===t.platform||("COLORTERM"in t.env||"dumb"!==t.env.TERM&&!!/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(t.env.TERM))))}()}).call(t,r(8))},function(e,t){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function e(t){function n(){}function i(){return r(s.foo)}n.prototype=t;var s=new n;return i(),i(),t}},function(e,t){"use strict";e.exports=function(e){for(var t=e.length;/[\s\uFEFF\u00A0]/.test(e[t-1]);)t--;return e.slice(0,t)}},function(e,t){"use strict";"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e){return e&&"object"===(void 0===e?"undefined":r(e))&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.version="6.26.0"},function(e,t){"use strict";function r(e,t){var r=void 0;return null!=t.url?r=t.url:(r="Inline Babel script",++p>1&&(r+=" ("+p+")")),e(t.content,l({filename:r},n(t))).code}function n(e){return{presets:e.presets||["react","es2015"],plugins:e.plugins||["transform-class-properties","transform-object-rest-spread","transform-flow-strip-types"],sourceMaps:"inline"}}function i(e,t){var n=document.createElement("script");n.text=r(e,t),f.appendChild(n)}function s(e,t,r){var n=new XMLHttpRequest;return n.open("GET",e,!0),"overrideMimeType"in n&&n.overrideMimeType("text/plain"),n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)throw r(),new Error("Could not load "+e);t(n.responseText)}},n.send(null)}function a(e,t){var r=e.getAttribute(t);return""===r?[]:r?r.split(",").map(function(e){return e.trim()}):null}function o(e,t){function r(){var t,r;for(r=0;r<o;r++)if(t=n[r],t.loaded&&!t.executed)t.executed=!0,i(e,t);else if(!t.loaded&&!t.error&&!t.async)break}var n=[],o=t.length;t.forEach(function(e,t){var i={async:e.hasAttribute("async"),error:!1,executed:!1,plugins:a(e,"data-plugins"),presets:a(e,"data-presets")};e.src?(n[t]=l({},i,{content:null,loaded:!1,url:e.src}),s(e.src,function(e){n[t].loaded=!0,n[t].content=e,r()},function(){n[t].error=!0,r()})):n[t]=l({},i,{content:e.innerHTML,loaded:!0,url:null})}),r()}function u(e,t){f=document.getElementsByTagName("head")[0],t||(t=document.getElementsByTagName("script"));for(var r=[],n=0;n<t.length;n++){var i=t.item(n),s=i.type.split(";")[0];-1!==c.indexOf(s)&&r.push(i)}0!==r.length&&(console.warn("You are using the in-browser Babel transformer. Be sure to precompile your scripts for production - https://babeljs.io/docs/setup/"),o(e,r))}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};t.runScripts=u;var c=["text/jsx","text/babel"],f=void 0,p=0},function(e,t){e.exports={builtin:{Array:!1,ArrayBuffer:!1,Boolean:!1,constructor:!1,DataView:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Float32Array:!1,Float64Array:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,Promise:!1,propertyIsEnumerable:!1,Proxy:!1,RangeError:!1,ReferenceError:!1,Reflect:!1,RegExp:!1,Set:!1,String:!1,Symbol:!1,SyntaxError:!1,System:!1,toLocaleString:!1,toString:!1,TypeError:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,undefined:!1,unescape:!1,URIError:!1, valueOf:!1,WeakMap:!1,WeakSet:!1},es5:{Array:!1,Boolean:!1,constructor:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,propertyIsEnumerable:!1,RangeError:!1,ReferenceError:!1,RegExp:!1,String:!1,SyntaxError:!1,toLocaleString:!1,toString:!1,TypeError:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1},es6:{Array:!1,ArrayBuffer:!1,Boolean:!1,constructor:!1,DataView:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Float32Array:!1,Float64Array:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,Promise:!1,propertyIsEnumerable:!1,Proxy:!1,RangeError:!1,ReferenceError:!1,Reflect:!1,RegExp:!1,Set:!1,String:!1,Symbol:!1,SyntaxError:!1,System:!1,toLocaleString:!1,toString:!1,TypeError:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1,WeakMap:!1,WeakSet:!1},browser:{addEventListener:!1,alert:!1,AnalyserNode:!1,Animation:!1,AnimationEffectReadOnly:!1,AnimationEffectTiming:!1,AnimationEffectTimingReadOnly:!1,AnimationEvent:!1,AnimationPlaybackEvent:!1,AnimationTimeline:!1,applicationCache:!1,ApplicationCache:!1,ApplicationCacheErrorEvent:!1,atob:!1,Attr:!1,Audio:!1,AudioBuffer:!1,AudioBufferSourceNode:!1,AudioContext:!1,AudioDestinationNode:!1,AudioListener:!1,AudioNode:!1,AudioParam:!1,AudioProcessingEvent:!1,AutocompleteErrorEvent:!1,BarProp:!1,BatteryManager:!1,BeforeUnloadEvent:!1,BiquadFilterNode:!1,Blob:!1,blur:!1,btoa:!1,Cache:!1,caches:!1,CacheStorage:!1,cancelAnimationFrame:!1,cancelIdleCallback:!1,CanvasGradient:!1,CanvasPattern:!1,CanvasRenderingContext2D:!1,CDATASection:!1,ChannelMergerNode:!1,ChannelSplitterNode:!1,CharacterData:!1,clearInterval:!1,clearTimeout:!1,clientInformation:!1,ClientRect:!1,ClientRectList:!1,ClipboardEvent:!1,close:!1,closed:!1,CloseEvent:!1,Comment:!1,CompositionEvent:!1,confirm:!1,console:!1,ConvolverNode:!1,createImageBitmap:!1,Credential:!1,CredentialsContainer:!1,crypto:!1,Crypto:!1,CryptoKey:!1,CSS:!1,CSSAnimation:!1,CSSFontFaceRule:!1,CSSImportRule:!1,CSSKeyframeRule:!1,CSSKeyframesRule:!1,CSSMediaRule:!1,CSSPageRule:!1,CSSRule:!1,CSSRuleList:!1,CSSStyleDeclaration:!1,CSSStyleRule:!1,CSSStyleSheet:!1,CSSSupportsRule:!1,CSSTransition:!1,CSSUnknownRule:!1,CSSViewportRule:!1,customElements:!1,CustomEvent:!1,DataTransfer:!1,DataTransferItem:!1,DataTransferItemList:!1,Debug:!1,defaultStatus:!1,defaultstatus:!1,DelayNode:!1,DeviceMotionEvent:!1,DeviceOrientationEvent:!1,devicePixelRatio:!1,dispatchEvent:!1,document:!1,Document:!1,DocumentFragment:!1,DocumentTimeline:!1,DocumentType:!1,DOMError:!1,DOMException:!1,DOMImplementation:!1,DOMParser:!1,DOMSettableTokenList:!1,DOMStringList:!1,DOMStringMap:!1,DOMTokenList:!1,DragEvent:!1,DynamicsCompressorNode:!1,Element:!1,ElementTimeControl:!1,ErrorEvent:!1,event:!1,Event:!1,EventSource:!1,EventTarget:!1,external:!1,FederatedCredential:!1,fetch:!1,File:!1,FileError:!1,FileList:!1,FileReader:!1,find:!1,focus:!1,FocusEvent:!1,FontFace:!1,FormData:!1,frameElement:!1,frames:!1,GainNode:!1,Gamepad:!1,GamepadButton:!1,GamepadEvent:!1,getComputedStyle:!1,getSelection:!1,HashChangeEvent:!1,Headers:!1,history:!1,History:!1,HTMLAllCollection:!1,HTMLAnchorElement:!1,HTMLAppletElement:!1,HTMLAreaElement:!1,HTMLAudioElement:!1,HTMLBaseElement:!1,HTMLBlockquoteElement:!1,HTMLBodyElement:!1,HTMLBRElement:!1,HTMLButtonElement:!1,HTMLCanvasElement:!1,HTMLCollection:!1,HTMLContentElement:!1,HTMLDataListElement:!1,HTMLDetailsElement:!1,HTMLDialogElement:!1,HTMLDirectoryElement:!1,HTMLDivElement:!1,HTMLDListElement:!1,HTMLDocument:!1,HTMLElement:!1,HTMLEmbedElement:!1,HTMLFieldSetElement:!1,HTMLFontElement:!1,HTMLFormControlsCollection:!1,HTMLFormElement:!1,HTMLFrameElement:!1,HTMLFrameSetElement:!1,HTMLHeadElement:!1,HTMLHeadingElement:!1,HTMLHRElement:!1,HTMLHtmlElement:!1,HTMLIFrameElement:!1,HTMLImageElement:!1,HTMLInputElement:!1,HTMLIsIndexElement:!1,HTMLKeygenElement:!1,HTMLLabelElement:!1,HTMLLayerElement:!1,HTMLLegendElement:!1,HTMLLIElement:!1,HTMLLinkElement:!1,HTMLMapElement:!1,HTMLMarqueeElement:!1,HTMLMediaElement:!1,HTMLMenuElement:!1,HTMLMetaElement:!1,HTMLMeterElement:!1,HTMLModElement:!1,HTMLObjectElement:!1,HTMLOListElement:!1,HTMLOptGroupElement:!1,HTMLOptionElement:!1,HTMLOptionsCollection:!1,HTMLOutputElement:!1,HTMLParagraphElement:!1,HTMLParamElement:!1,HTMLPictureElement:!1,HTMLPreElement:!1,HTMLProgressElement:!1,HTMLQuoteElement:!1,HTMLScriptElement:!1,HTMLSelectElement:!1,HTMLShadowElement:!1,HTMLSourceElement:!1,HTMLSpanElement:!1,HTMLStyleElement:!1,HTMLTableCaptionElement:!1,HTMLTableCellElement:!1,HTMLTableColElement:!1,HTMLTableElement:!1,HTMLTableRowElement:!1,HTMLTableSectionElement:!1,HTMLTemplateElement:!1,HTMLTextAreaElement:!1,HTMLTitleElement:!1,HTMLTrackElement:!1,HTMLUListElement:!1,HTMLUnknownElement:!1,HTMLVideoElement:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBEnvironment:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,Image:!1,ImageBitmap:!1,ImageData:!1,indexedDB:!1,innerHeight:!1,innerWidth:!1,InputEvent:!1,InputMethodContext:!1,IntersectionObserver:!1,IntersectionObserverEntry:!1,Intl:!1,KeyboardEvent:!1,KeyframeEffect:!1,KeyframeEffectReadOnly:!1,length:!1,localStorage:!1,location:!1,Location:!1,locationbar:!1,matchMedia:!1,MediaElementAudioSourceNode:!1,MediaEncryptedEvent:!1,MediaError:!1,MediaKeyError:!1,MediaKeyEvent:!1,MediaKeyMessageEvent:!1,MediaKeys:!1,MediaKeySession:!1,MediaKeyStatusMap:!1,MediaKeySystemAccess:!1,MediaList:!1,MediaQueryList:!1,MediaQueryListEvent:!1,MediaSource:!1,MediaRecorder:!1,MediaStream:!1,MediaStreamAudioDestinationNode:!1,MediaStreamAudioSourceNode:!1,MediaStreamEvent:!1,MediaStreamTrack:!1,menubar:!1,MessageChannel:!1,MessageEvent:!1,MessagePort:!1,MIDIAccess:!1,MIDIConnectionEvent:!1,MIDIInput:!1,MIDIInputMap:!1,MIDIMessageEvent:!1,MIDIOutput:!1,MIDIOutputMap:!1,MIDIPort:!1,MimeType:!1,MimeTypeArray:!1,MouseEvent:!1,moveBy:!1,moveTo:!1,MutationEvent:!1,MutationObserver:!1,MutationRecord:!1,name:!1,NamedNodeMap:!1,navigator:!1,Navigator:!1,Node:!1,NodeFilter:!1,NodeIterator:!1,NodeList:!1,Notification:!1,OfflineAudioCompletionEvent:!1,OfflineAudioContext:!1,offscreenBuffering:!1,onbeforeunload:!0,onblur:!0,onerror:!0,onfocus:!0,onload:!0,onresize:!0,onunload:!0,open:!1,openDatabase:!1,opener:!1,opera:!1,Option:!1,OscillatorNode:!1,outerHeight:!1,outerWidth:!1,PageTransitionEvent:!1,pageXOffset:!1,pageYOffset:!1,parent:!1,PasswordCredential:!1,Path2D:!1,performance:!1,Performance:!1,PerformanceEntry:!1,PerformanceMark:!1,PerformanceMeasure:!1,PerformanceNavigation:!1,PerformanceResourceTiming:!1,PerformanceTiming:!1,PeriodicWave:!1,Permissions:!1,PermissionStatus:!1,personalbar:!1,Plugin:!1,PluginArray:!1,PopStateEvent:!1,postMessage:!1,print:!1,ProcessingInstruction:!1,ProgressEvent:!1,PromiseRejectionEvent:!1,prompt:!1,PushManager:!1,PushSubscription:!1,RadioNodeList:!1,Range:!1,ReadableByteStream:!1,ReadableStream:!1,removeEventListener:!1,Request:!1,requestAnimationFrame:!1,requestIdleCallback:!1,resizeBy:!1,resizeTo:!1,Response:!1,RTCIceCandidate:!1,RTCSessionDescription:!1,RTCPeerConnection:!1,screen:!1,Screen:!1,screenLeft:!1,ScreenOrientation:!1,screenTop:!1,screenX:!1,screenY:!1,ScriptProcessorNode:!1,scroll:!1,scrollbars:!1,scrollBy:!1,scrollTo:!1,scrollX:!1,scrollY:!1,SecurityPolicyViolationEvent:!1,Selection:!1,self:!1,ServiceWorker:!1,ServiceWorkerContainer:!1,ServiceWorkerRegistration:!1,sessionStorage:!1,setInterval:!1,setTimeout:!1,ShadowRoot:!1,SharedKeyframeList:!1,SharedWorker:!1,showModalDialog:!1,SiteBoundCredential:!1,speechSynthesis:!1,SpeechSynthesisEvent:!1,SpeechSynthesisUtterance:!1,status:!1,statusbar:!1,stop:!1,Storage:!1,StorageEvent:!1,styleMedia:!1,StyleSheet:!1,StyleSheetList:!1,SubtleCrypto:!1,SVGAElement:!1,SVGAltGlyphDefElement:!1,SVGAltGlyphElement:!1,SVGAltGlyphItemElement:!1,SVGAngle:!1,SVGAnimateColorElement:!1,SVGAnimatedAngle:!1,SVGAnimatedBoolean:!1,SVGAnimatedEnumeration:!1,SVGAnimatedInteger:!1,SVGAnimatedLength:!1,SVGAnimatedLengthList:!1,SVGAnimatedNumber:!1,SVGAnimatedNumberList:!1,SVGAnimatedPathData:!1,SVGAnimatedPoints:!1,SVGAnimatedPreserveAspectRatio:!1,SVGAnimatedRect:!1,SVGAnimatedString:!1,SVGAnimatedTransformList:!1,SVGAnimateElement:!1,SVGAnimateMotionElement:!1,SVGAnimateTransformElement:!1,SVGAnimationElement:!1,SVGCircleElement:!1,SVGClipPathElement:!1,SVGColor:!1,SVGColorProfileElement:!1,SVGColorProfileRule:!1,SVGComponentTransferFunctionElement:!1,SVGCSSRule:!1,SVGCursorElement:!1,SVGDefsElement:!1,SVGDescElement:!1,SVGDiscardElement:!1,SVGDocument:!1,SVGElement:!1,SVGElementInstance:!1,SVGElementInstanceList:!1,SVGEllipseElement:!1,SVGEvent:!1,SVGExternalResourcesRequired:!1,SVGFEBlendElement:!1,SVGFEColorMatrixElement:!1,SVGFEComponentTransferElement:!1,SVGFECompositeElement:!1,SVGFEConvolveMatrixElement:!1,SVGFEDiffuseLightingElement:!1,SVGFEDisplacementMapElement:!1,SVGFEDistantLightElement:!1,SVGFEDropShadowElement:!1,SVGFEFloodElement:!1,SVGFEFuncAElement:!1,SVGFEFuncBElement:!1,SVGFEFuncGElement:!1,SVGFEFuncRElement:!1,SVGFEGaussianBlurElement:!1,SVGFEImageElement:!1,SVGFEMergeElement:!1,SVGFEMergeNodeElement:!1,SVGFEMorphologyElement:!1,SVGFEOffsetElement:!1,SVGFEPointLightElement:!1,SVGFESpecularLightingElement:!1,SVGFESpotLightElement:!1,SVGFETileElement:!1,SVGFETurbulenceElement:!1,SVGFilterElement:!1,SVGFilterPrimitiveStandardAttributes:!1,SVGFitToViewBox:!1,SVGFontElement:!1,SVGFontFaceElement:!1,SVGFontFaceFormatElement:!1,SVGFontFaceNameElement:!1,SVGFontFaceSrcElement:!1,SVGFontFaceUriElement:!1,SVGForeignObjectElement:!1,SVGGElement:!1,SVGGeometryElement:!1,SVGGlyphElement:!1,SVGGlyphRefElement:!1,SVGGradientElement:!1,SVGGraphicsElement:!1,SVGHKernElement:!1,SVGICCColor:!1,SVGImageElement:!1,SVGLangSpace:!1,SVGLength:!1,SVGLengthList:!1,SVGLinearGradientElement:!1,SVGLineElement:!1,SVGLocatable:!1,SVGMarkerElement:!1,SVGMaskElement:!1,SVGMatrix:!1,SVGMetadataElement:!1,SVGMissingGlyphElement:!1,SVGMPathElement:!1,SVGNumber:!1,SVGNumberList:!1,SVGPaint:!1,SVGPathElement:!1,SVGPathSeg:!1,SVGPathSegArcAbs:!1,SVGPathSegArcRel:!1,SVGPathSegClosePath:!1,SVGPathSegCurvetoCubicAbs:!1,SVGPathSegCurvetoCubicRel:!1,SVGPathSegCurvetoCubicSmoothAbs:!1,SVGPathSegCurvetoCubicSmoothRel:!1,SVGPathSegCurvetoQuadraticAbs:!1,SVGPathSegCurvetoQuadraticRel:!1,SVGPathSegCurvetoQuadraticSmoothAbs:!1,SVGPathSegCurvetoQuadraticSmoothRel:!1,SVGPathSegLinetoAbs:!1,SVGPathSegLinetoHorizontalAbs:!1,SVGPathSegLinetoHorizontalRel:!1,SVGPathSegLinetoRel:!1,SVGPathSegLinetoVerticalAbs:!1,SVGPathSegLinetoVerticalRel:!1,SVGPathSegList:!1,SVGPathSegMovetoAbs:!1,SVGPathSegMovetoRel:!1,SVGPatternElement:!1,SVGPoint:!1,SVGPointList:!1,SVGPolygonElement:!1,SVGPolylineElement:!1,SVGPreserveAspectRatio:!1,SVGRadialGradientElement:!1,SVGRect:!1,SVGRectElement:!1,SVGRenderingIntent:!1,SVGScriptElement:!1,SVGSetElement:!1,SVGStopElement:!1,SVGStringList:!1,SVGStylable:!1,SVGStyleElement:!1,SVGSVGElement:!1,SVGSwitchElement:!1,SVGSymbolElement:!1,SVGTests:!1,SVGTextContentElement:!1,SVGTextElement:!1,SVGTextPathElement:!1,SVGTextPositioningElement:!1,SVGTitleElement:!1,SVGTransform:!1,SVGTransformable:!1,SVGTransformList:!1,SVGTRefElement:!1,SVGTSpanElement:!1,SVGUnitTypes:!1,SVGURIReference:!1,SVGUseElement:!1,SVGViewElement:!1,SVGViewSpec:!1,SVGVKernElement:!1,SVGZoomAndPan:!1,SVGZoomEvent:!1,Text:!1,TextDecoder:!1,TextEncoder:!1,TextEvent:!1,TextMetrics:!1,TextTrack:!1,TextTrackCue:!1,TextTrackCueList:!1,TextTrackList:!1,TimeEvent:!1,TimeRanges:!1,toolbar:!1,top:!1,Touch:!1,TouchEvent:!1,TouchList:!1,TrackEvent:!1,TransitionEvent:!1,TreeWalker:!1,UIEvent:!1,URL:!1,URLSearchParams:!1,ValidityState:!1,VTTCue:!1,WaveShaperNode:!1,WebGLActiveInfo:!1,WebGLBuffer:!1,WebGLContextEvent:!1,WebGLFramebuffer:!1,WebGLProgram:!1,WebGLRenderbuffer:!1,WebGLRenderingContext:!1,WebGLShader:!1,WebGLShaderPrecisionFormat:!1,WebGLTexture:!1,WebGLUniformLocation:!1,WebSocket:!1,WheelEvent:!1,window:!1,Window:!1,Worker:!1,XDomainRequest:!1,XMLDocument:!1,XMLHttpRequest:!1,XMLHttpRequestEventTarget:!1,XMLHttpRequestProgressEvent:!1,XMLHttpRequestUpload:!1,XMLSerializer:!1,XPathEvaluator:!1,XPathException:!1,XPathExpression:!1,XPathNamespace:!1,XPathNSResolver:!1,XPathResult:!1,XSLTProcessor:!1},worker:{applicationCache:!1,atob:!1,Blob:!1,BroadcastChannel:!1,btoa:!1,Cache:!1,caches:!1,clearInterval:!1,clearTimeout:!1,close:!0,console:!1,fetch:!1,FileReaderSync:!1,FormData:!1,Headers:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,ImageData:!1,importScripts:!0,indexedDB:!1,location:!1,MessageChannel:!1,MessagePort:!1,name:!1,navigator:!1,Notification:!1,onclose:!0,onconnect:!0,onerror:!0,onlanguagechange:!0,onmessage:!0,onoffline:!0,ononline:!0,onrejectionhandled:!0,onunhandledrejection:!0,performance:!1,Performance:!1,PerformanceEntry:!1,PerformanceMark:!1,PerformanceMeasure:!1,PerformanceNavigation:!1,PerformanceResourceTiming:!1,PerformanceTiming:!1,postMessage:!0,Promise:!1,Request:!1,Response:!1,self:!0,ServiceWorkerRegistration:!1,setInterval:!1,setTimeout:!1,TextDecoder:!1,TextEncoder:!1,URL:!1,URLSearchParams:!1,WebSocket:!1,Worker:!1,XMLHttpRequest:!1},node:{__dirname:!1,__filename:!1,arguments:!1,Buffer:!1,clearImmediate:!1,clearInterval:!1,clearTimeout:!1,console:!1,exports:!0,GLOBAL:!1,global:!1,Intl:!1,module:!1,process:!1,require:!1,root:!1,setImmediate:!1,setInterval:!1,setTimeout:!1},commonjs:{exports:!0,module:!1,require:!1,global:!1},amd:{define:!1,require:!1},mocha:{after:!1,afterEach:!1,before:!1,beforeEach:!1,context:!1,describe:!1,it:!1,mocha:!1,run:!1,setup:!1,specify:!1,suite:!1,suiteSetup:!1,suiteTeardown:!1,teardown:!1,test:!1,xcontext:!1,xdescribe:!1,xit:!1,xspecify:!1},jasmine:{afterAll:!1,afterEach:!1,beforeAll:!1,beforeEach:!1,describe:!1,expect:!1,fail:!1,fdescribe:!1,fit:!1,it:!1,jasmine:!1,pending:!1,runs:!1,spyOn:!1,spyOnProperty:!1,waits:!1,waitsFor:!1,xdescribe:!1,xit:!1},jest:{afterAll:!1,afterEach:!1,beforeAll:!1,beforeEach:!1,check:!1,describe:!1,expect:!1,gen:!1,it:!1,fdescribe:!1,fit:!1,jest:!1,pit:!1,require:!1,test:!1,xdescribe:!1,xit:!1,xtest:!1},qunit:{asyncTest:!1,deepEqual:!1,equal:!1,expect:!1,module:!1,notDeepEqual:!1,notEqual:!1,notOk:!1,notPropEqual:!1,notStrictEqual:!1,ok:!1,propEqual:!1,QUnit:!1,raises:!1,start:!1,stop:!1,strictEqual:!1,test:!1,throws:!1},phantomjs:{console:!0,exports:!0,phantom:!0,require:!0,WebPage:!0},couch:{emit:!1,exports:!1,getRow:!1,log:!1,module:!1,provides:!1,require:!1,respond:!1,send:!1,start:!1,sum:!1},rhino:{defineClass:!1,deserialize:!1,gc:!1,help:!1,importClass:!1,importPackage:!1,java:!1,load:!1,loadClass:!1,Packages:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},nashorn:{__DIR__:!1,__FILE__:!1,__LINE__:!1,com:!1,edu:!1,exit:!1,Java:!1,java:!1,javafx:!1,JavaImporter:!1,javax:!1,JSAdapter:!1,load:!1,loadWithNewGlobal:!1,org:!1,Packages:!1,print:!1,quit:!1},wsh:{ActiveXObject:!0,Enumerator:!0,GetObject:!0,ScriptEngine:!0,ScriptEngineBuildVersion:!0,ScriptEngineMajorVersion:!0,ScriptEngineMinorVersion:!0,VBArray:!0,WScript:!0,WSH:!0,XDomainRequest:!0},jquery:{$:!1,jQuery:!1},yui:{Y:!1,YUI:!1,YUI_config:!1},shelljs:{cat:!1,cd:!1,chmod:!1,config:!1,cp:!1,dirs:!1,echo:!1,env:!1,error:!1,exec:!1,exit:!1,find:!1,grep:!1,ls:!1,ln:!1,mkdir:!1,mv:!1,popd:!1,pushd:!1,pwd:!1,rm:!1,sed:!1,set:!1,target:!1,tempdir:!1,test:!1,touch:!1,which:!1},prototypejs:{$:!1,$$:!1,$A:!1,$break:!1,$continue:!1,$F:!1,$H:!1,$R:!1,$w:!1,Abstract:!1,Ajax:!1,Autocompleter:!1,Builder:!1,Class:!1,Control:!1,Draggable:!1,Draggables:!1,Droppables:!1,Effect:!1,Element:!1,Enumerable:!1,Event:!1,Field:!1,Form:!1,Hash:!1,Insertion:!1,ObjectRange:!1,PeriodicalExecuter:!1,Position:!1,Prototype:!1,Scriptaculous:!1,Selector:!1,Sortable:!1,SortableObserver:!1,Sound:!1,Template:!1,Toggle:!1,Try:!1},meteor:{$:!1,_:!1,Accounts:!1,AccountsClient:!1,AccountsServer:!1,AccountsCommon:!1,App:!1,Assets:!1,Blaze:!1,check:!1,Cordova:!1,DDP:!1,DDPServer:!1,DDPRateLimiter:!1,Deps:!1,EJSON:!1,Email:!1,HTTP:!1,Log:!1,Match:!1,Meteor:!1,Mongo:!1,MongoInternals:!1,Npm:!1,Package:!1,Plugin:!1,process:!1,Random:!1,ReactiveDict:!1,ReactiveVar:!1,Router:!1,ServiceConfiguration:!1,Session:!1,share:!1,Spacebars:!1,Template:!1,Tinytest:!1,Tracker:!1,UI:!1,Utils:!1,WebApp:!1,WebAppInternals:!1},mongo:{_isWindows:!1,_rand:!1,BulkWriteResult:!1,cat:!1,cd:!1,connect:!1,db:!1,getHostName:!1,getMemInfo:!1,hostname:!1,ISODate:!1,listFiles:!1,load:!1,ls:!1,md5sumFile:!1,mkdir:!1,Mongo:!1,NumberInt:!1,NumberLong:!1,ObjectId:!1,PlanCache:!1,print:!1,printjson:!1,pwd:!1,quit:!1,removeFile:!1,rs:!1,sh:!1,UUID:!1,version:!1,WriteResult:!1},applescript:{$:!1,Application:!1,Automation:!1,console:!1,delay:!1,Library:!1,ObjC:!1,ObjectSpecifier:!1,Path:!1,Progress:!1,Ref:!1},serviceworker:{caches:!1,Cache:!1,CacheStorage:!1,Client:!1,clients:!1,Clients:!1,ExtendableEvent:!1,ExtendableMessageEvent:!1,FetchEvent:!1,importScripts:!1,registration:!1,self:!1,ServiceWorker:!1,ServiceWorkerContainer:!1,ServiceWorkerGlobalScope:!1,ServiceWorkerMessageEvent:!1,ServiceWorkerRegistration:!1,skipWaiting:!1,WindowClient:!1},atomtest:{advanceClock:!1,fakeClearInterval:!1,fakeClearTimeout:!1,fakeSetInterval:!1,fakeSetTimeout:!1,resetTimeouts:!1,waitsForPromise:!1},embertest:{andThen:!1,click:!1,currentPath:!1,currentRouteName:!1,currentURL:!1,fillIn:!1,find:!1,findWithAssert:!1,keyEvent:!1,pauseTest:!1,resumeTest:!1,triggerEvent:!1,visit:!1},protractor:{$:!1,$$:!1,browser:!1,By:!1,by:!1,DartObject:!1,element:!1,protractor:!1},"shared-node-browser":{clearInterval:!1,clearTimeout:!1,console:!1,setInterval:!1,setTimeout:!1},webextensions:{browser:!1,chrome:!1,opr:!1},greasemonkey:{GM_addStyle:!1,GM_deleteValue:!1,GM_getResourceText:!1,GM_getResourceURL:!1,GM_getValue:!1,GM_info:!1,GM_listValues:!1,GM_log:!1,GM_openInTab:!1,GM_registerMenuCommand:!1,GM_setClipboard:!1,GM_setValue:!1,GM_xmlhttpRequest:!1,unsafeWindow:!1}}},function(e,t){e.exports={75:8490,83:383,107:8490,115:383,181:924,197:8491,383:83,452:453,453:452,455:456,456:455,458:459,459:458,497:498,498:497,837:8126,914:976,917:1013,920:1012,921:8126,922:1008,924:181,928:982,929:1009,931:962,934:981,937:8486,962:931,976:914,977:1012,981:934,982:928,1008:922,1009:929,1012:[920,977],1013:917,7776:7835,7835:7776,8126:[837,921],8486:937,8490:75,8491:197,66560:66600,66561:66601,66562:66602,66563:66603,66564:66604,66565:66605,66566:66606,66567:66607,66568:66608,66569:66609,66570:66610,66571:66611,66572:66612,66573:66613,66574:66614,66575:66615,66576:66616,66577:66617,66578:66618,66579:66619,66580:66620,66581:66621,66582:66622,66583:66623,66584:66624,66585:66625,66586:66626,66587:66627,66588:66628,66589:66629,66590:66630,66591:66631,66592:66632,66593:66633,66594:66634,66595:66635,66596:66636,66597:66637,66598:66638,66599:66639,66600:66560,66601:66561,66602:66562,66603:66563,66604:66564,66605:66565,66606:66566,66607:66567,66608:66568,66609:66569,66610:66570,66611:66571,66612:66572,66613:66573,66614:66574,66615:66575,66616:66576,66617:66577,66618:66578,66619:66579,66620:66580,66621:66581,66622:66582,66623:66583,66624:66584,66625:66585,66626:66586,66627:66587,66628:66588,66629:66589,66630:66590,66631:66591,66632:66592,66633:66593,66634:66594,66635:66595,66636:66596,66637:66597,66638:66598,66639:66599,68736:68800,68737:68801,68738:68802,68739:68803,68740:68804,68741:68805,68742:68806,68743:68807,68744:68808,68745:68809,68746:68810,68747:68811,68748:68812,68749:68813,68750:68814,68751:68815,68752:68816,68753:68817,68754:68818,68755:68819,68756:68820,68757:68821,68758:68822,68759:68823,68760:68824,68761:68825,68762:68826,68763:68827,68764:68828,68765:68829,68766:68830,68767:68831,68768:68832,68769:68833,68770:68834,68771:68835,68772:68836,68773:68837,68774:68838,68775:68839,68776:68840,68777:68841,68778:68842,68779:68843,68780:68844,68781:68845,68782:68846,68783:68847,68784:68848,68785:68849,68786:68850,68800:68736,68801:68737,68802:68738,68803:68739,68804:68740,68805:68741,68806:68742,68807:68743,68808:68744,68809:68745,68810:68746,68811:68747,68812:68748,68813:68749,68814:68750,68815:68751,68816:68752,68817:68753,68818:68754,68819:68755,68820:68756,68821:68757,68822:68758,68823:68759,68824:68760,68825:68761,68826:68762,68827:68763,68828:68764,68829:68765,68830:68766,68831:68767,68832:68768,68833:68769,68834:68770,68835:68771,68836:68772,68837:68773,68838:68774,68839:68775,68840:68776,68841:68777,68842:68778,68843:68779,68844:68780,68845:68781,68846:68782,68847:68783,68848:68784,68849:68785,68850:68786,71840:71872,71841:71873,71842:71874,71843:71875,71844:71876,71845:71877,71846:71878,71847:71879,71848:71880,71849:71881,71850:71882,71851:71883,71852:71884,71853:71885,71854:71886,71855:71887,71856:71888,71857:71889,71858:71890,71859:71891,71860:71892,71861:71893,71862:71894,71863:71895,71864:71896,71865:71897,71866:71898,71867:71899,71868:71900,71869:71901,71870:71902,71871:71903,71872:71840,71873:71841,71874:71842,71875:71843,71876:71844,71877:71845,71878:71846,71879:71847,71880:71848,71881:71849,71882:71850,71883:71851,71884:71852,71885:71853,71886:71854,71887:71855,71888:71856,71889:71857,71890:71858,71891:71859,71892:71860,71893:71861,71894:71862,71895:71863,71896:71864,71897:71865,71898:71866,71899:71867,71900:71868,71901:71869,71902:71870,71903:71871}}]))}); assets/js/instant_click.min.js 0000777 00000011020 15251157102 0012427 0 ustar 00 let _chromiumMajorVersionInUserAgent=null,_speculationRulesType,_allowQueryString,_allowExternalLinks,_useWhitelist,_delayOnHover=65,_lastTouchstartEvent,_mouseoverTimer,_preloadedList=new Set;function init(){let e=document.createElement("link").relList,t=e.supports("prefetch")&&e.supports("modulepreload");if(!t)return;let n="instantVaryAccept"in document.body.dataset||"Shopify"in window,r=navigator.userAgent.indexOf("Chrome/");if(r>-1&&(_chromiumMajorVersionInUserAgent=parseInt(navigator.userAgent.substring(r+7))),n&&_chromiumMajorVersionInUserAgent&&_chromiumMajorVersionInUserAgent<110)return;if(_speculationRulesType="none",HTMLScriptElement.supports&&HTMLScriptElement.supports("speculationrules")){let s=document.body.dataset.instantSpecrules;"prerender"==s?_speculationRulesType="prerender":"no"!=s&&(_speculationRulesType="prefetch")}let i="instantMousedownShortcut"in document.body.dataset;_allowQueryString="instantAllowQueryString"in document.body.dataset,_allowExternalLinks="instantAllowExternalLinks"in document.body.dataset,_useWhitelist="instantWhitelist"in document.body.dataset;let o=!1,a=!1,l=!1;if("instantIntensity"in document.body.dataset){let u=document.body.dataset.instantIntensity;if("mousedown"!=u||i||(o=!0),"mousedown-only"!=u||i||(o=!0,a=!0),"viewport"==u){let c=document.documentElement.clientWidth*document.documentElement.clientHeight<45e4,d=navigator.connection&&navigator.connection.saveData,p=navigator.connection&&navigator.connection.effectiveType&&navigator.connection.effectiveType.includes("2g");!c||d||p||(l=!0)}"viewport-all"==u&&(l=!0);let h=parseInt(u);isNaN(h)||(_delayOnHover=h)}let m={capture:!0,passive:!0};if(a?document.addEventListener("touchstart",touchstartEmptyListener,m):document.addEventListener("touchstart",touchstartListener,m),o||document.addEventListener("mouseover",mouseoverListener,m),o&&document.addEventListener("mousedown",mousedownListener,m),i&&document.addEventListener("mousedown",mousedownShortcutListener,m),l){let f=window.requestIdleCallback;f||(f=e=>{e()}),f(function e(){let t=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){let n=e.target;t.unobserve(n),preload(n.href)}})});document.querySelectorAll("a").forEach(e=>{isPreloadable(e)&&t.observe(e)})},{timeout:1500})}}function touchstartListener(e){_lastTouchstartEvent=e;let t=e.target.closest("a");isPreloadable(t)&&preload(t.href,"high")}function touchstartEmptyListener(e){_lastTouchstartEvent=e}function mouseoverListener(e){if(isEventLikelyTriggeredByTouch(e)||!("closest"in e.target))return;let t=e.target.closest("a");isPreloadable(t)&&(t.addEventListener("mouseout",mouseoutListener,{passive:!0}),_mouseoverTimer=setTimeout(()=>{preload(t.href,"high"),_mouseoverTimer=null},_delayOnHover))}function mousedownListener(e){if(isEventLikelyTriggeredByTouch(e))return;let t=e.target.closest("a");isPreloadable(t)&&preload(t.href,"high")}function mouseoutListener(e){(!e.relatedTarget||e.target.closest("a")!=e.relatedTarget.closest("a"))&&_mouseoverTimer&&(clearTimeout(_mouseoverTimer),_mouseoverTimer=null)}function mousedownShortcutListener(e){if(isEventLikelyTriggeredByTouch(e))return;let t=e.target.closest("a");if(e.which>1||e.metaKey||e.ctrlKey||!t)return;t.addEventListener("click",function(e){1337!=e.detail&&e.preventDefault()},{capture:!0,passive:!1,once:!0});let n=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1,detail:1337});t.dispatchEvent(n)}function isEventLikelyTriggeredByTouch(e){if(!_lastTouchstartEvent||!e||e.target!=_lastTouchstartEvent.target)return!1;let t=e.timeStamp,n=t-_lastTouchstartEvent.timeStamp;return n<2500}function isPreloadable(e){if(e&&e.href&&(!_useWhitelist||"instant"in e.dataset)&&(e.origin==location.origin||(_allowExternalLinks||"instant"in e.dataset)&&_chromiumMajorVersionInUserAgent)){if(["http:","https:"].includes(e.protocol)&&("http:"!=e.protocol||"https:"!=location.protocol)&&(_allowQueryString||!e.search||"instant"in e.dataset)&&(!e.hash||e.pathname+e.search!=location.pathname+location.search)&&!("noInstant"in e.dataset))return!0}}function preload(e,t="auto"){!_preloadedList.has(e)&&("none"!=_speculationRulesType?preloadUsingSpeculationRules(e):preloadUsingLinkElement(e,t),_preloadedList.add(e))}function preloadUsingSpeculationRules(e){let t=document.createElement("script");t.type="speculationrules",t.textContent=JSON.stringify({[_speculationRulesType]:[{source:"list",urls:[e]}]}),document.head.appendChild(t)}function preloadUsingLinkElement(e,t="auto"){let n=document.createElement("link");n.rel="prefetch",n.href=e,n.fetchPriority=t,n.as="document",document.head.appendChild(n)}init(); assets/js/webfontloader.js 0000777 00000030331 15251157102 0011661 0 ustar 00 /* Web Font Loader v1.6.28 - (c) Adobe Systems, Google. License: Apache 2.0 */(function(){function aa(a,b,c){return a.call.apply(a.bind,arguments)}function ba(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function p(a,b,c){p=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?aa:ba;return p.apply(null,arguments)}var q=Date.now||function(){return+new Date};function ca(a,b){this.a=a;this.o=b||a;this.c=this.o.document}var da=!!window.FontFace;function t(a,b,c,d){b=a.c.createElement(b);if(c)for(var e in c)c.hasOwnProperty(e)&&("style"==e?b.style.cssText=c[e]:b.setAttribute(e,c[e]));d&&b.appendChild(a.c.createTextNode(d));return b}function u(a,b,c){a=a.c.getElementsByTagName(b)[0];a||(a=document.documentElement);a.insertBefore(c,a.lastChild)}function v(a){a.parentNode&&a.parentNode.removeChild(a)} function w(a,b,c){b=b||[];c=c||[];for(var d=a.className.split(/\s+/),e=0;e<b.length;e+=1){for(var f=!1,g=0;g<d.length;g+=1)if(b[e]===d[g]){f=!0;break}f||d.push(b[e])}b=[];for(e=0;e<d.length;e+=1){f=!1;for(g=0;g<c.length;g+=1)if(d[e]===c[g]){f=!0;break}f||b.push(d[e])}a.className=b.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function y(a,b){for(var c=a.className.split(/\s+/),d=0,e=c.length;d<e;d++)if(c[d]==b)return!0;return!1} function ea(a){return a.o.location.hostname||a.a.location.hostname}function z(a,b,c){function d(){m&&e&&f&&(m(g),m=null)}b=t(a,"link",{rel:"stylesheet",href:b,media:"all"});var e=!1,f=!0,g=null,m=c||null;da?(b.onload=function(){e=!0;d()},b.onerror=function(){e=!0;g=Error("Stylesheet failed to load");d()}):setTimeout(function(){e=!0;d()},0);u(a,"head",b)} function A(a,b,c,d){var e=a.c.getElementsByTagName("head")[0];if(e){var f=t(a,"script",{src:b}),g=!1;f.onload=f.onreadystatechange=function(){g||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(g=!0,c&&c(null),f.onload=f.onreadystatechange=null,"HEAD"==f.parentNode.tagName&&e.removeChild(f))};e.appendChild(f);setTimeout(function(){g||(g=!0,c&&c(Error("Script load timeout")))},d||5E3);return f}return null};function B(){this.a=0;this.c=null}function C(a){a.a++;return function(){a.a--;D(a)}}function E(a,b){a.c=b;D(a)}function D(a){0==a.a&&a.c&&(a.c(),a.c=null)};function F(a){this.a=a||"-"}F.prototype.c=function(a){for(var b=[],c=0;c<arguments.length;c++)b.push(arguments[c].replace(/[\W_]+/g,"").toLowerCase());return b.join(this.a)};function G(a,b){this.c=a;this.f=4;this.a="n";var c=(b||"n4").match(/^([nio])([1-9])$/i);c&&(this.a=c[1],this.f=parseInt(c[2],10))}function fa(a){return H(a)+" "+(a.f+"00")+" 300px "+I(a.c)}function I(a){var b=[];a=a.split(/,\s*/);for(var c=0;c<a.length;c++){var d=a[c].replace(/['"]/g,"");-1!=d.indexOf(" ")||/^\d/.test(d)?b.push("'"+d+"'"):b.push(d)}return b.join(",")}function J(a){return a.a+a.f}function H(a){var b="normal";"o"===a.a?b="oblique":"i"===a.a&&(b="italic");return b} function ga(a){var b=4,c="n",d=null;a&&((d=a.match(/(normal|oblique|italic)/i))&&d[1]&&(c=d[1].substr(0,1).toLowerCase()),(d=a.match(/([1-9]00|normal|bold)/i))&&d[1]&&(/bold/i.test(d[1])?b=7:/[1-9]00/.test(d[1])&&(b=parseInt(d[1].substr(0,1),10))));return c+b};function ha(a,b){this.c=a;this.f=a.o.document.documentElement;this.h=b;this.a=new F("-");this.j=!1!==b.events;this.g=!1!==b.classes}function ia(a){a.g&&w(a.f,[a.a.c("wf","loading")]);K(a,"loading")}function L(a){if(a.g){var b=y(a.f,a.a.c("wf","active")),c=[],d=[a.a.c("wf","loading")];b||c.push(a.a.c("wf","inactive"));w(a.f,c,d)}K(a,"inactive")}function K(a,b,c){if(a.j&&a.h[b])if(c)a.h[b](c.c,J(c));else a.h[b]()};function ja(){this.c={}}function ka(a,b,c){var d=[],e;for(e in b)if(b.hasOwnProperty(e)){var f=a.c[e];f&&d.push(f(b[e],c))}return d};function M(a,b){this.c=a;this.f=b;this.a=t(this.c,"span",{"aria-hidden":"true"},this.f)}function N(a){u(a.c,"body",a.a)}function O(a){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+I(a.c)+";"+("font-style:"+H(a)+";font-weight:"+(a.f+"00")+";")};function P(a,b,c,d,e,f){this.g=a;this.j=b;this.a=d;this.c=c;this.f=e||3E3;this.h=f||void 0}P.prototype.start=function(){var a=this.c.o.document,b=this,c=q(),d=new Promise(function(d,e){function f(){q()-c>=b.f?e():a.fonts.load(fa(b.a),b.h).then(function(a){1<=a.length?d():setTimeout(f,25)},function(){e()})}f()}),e=null,f=new Promise(function(a,d){e=setTimeout(d,b.f)});Promise.race([f,d]).then(function(){e&&(clearTimeout(e),e=null);b.g(b.a)},function(){b.j(b.a)})};function Q(a,b,c,d,e,f,g){this.v=a;this.B=b;this.c=c;this.a=d;this.s=g||"BESbswy";this.f={};this.w=e||3E3;this.u=f||null;this.m=this.j=this.h=this.g=null;this.g=new M(this.c,this.s);this.h=new M(this.c,this.s);this.j=new M(this.c,this.s);this.m=new M(this.c,this.s);a=new G(this.a.c+",serif",J(this.a));a=O(a);this.g.a.style.cssText=a;a=new G(this.a.c+",sans-serif",J(this.a));a=O(a);this.h.a.style.cssText=a;a=new G("serif",J(this.a));a=O(a);this.j.a.style.cssText=a;a=new G("sans-serif",J(this.a));a= O(a);this.m.a.style.cssText=a;N(this.g);N(this.h);N(this.j);N(this.m)}var R={D:"serif",C:"sans-serif"},S=null;function T(){if(null===S){var a=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);S=!!a&&(536>parseInt(a[1],10)||536===parseInt(a[1],10)&&11>=parseInt(a[2],10))}return S}Q.prototype.start=function(){this.f.serif=this.j.a.offsetWidth;this.f["sans-serif"]=this.m.a.offsetWidth;this.A=q();U(this)}; function la(a,b,c){for(var d in R)if(R.hasOwnProperty(d)&&b===a.f[R[d]]&&c===a.f[R[d]])return!0;return!1}function U(a){var b=a.g.a.offsetWidth,c=a.h.a.offsetWidth,d;(d=b===a.f.serif&&c===a.f["sans-serif"])||(d=T()&&la(a,b,c));d?q()-a.A>=a.w?T()&&la(a,b,c)&&(null===a.u||a.u.hasOwnProperty(a.a.c))?V(a,a.v):V(a,a.B):ma(a):V(a,a.v)}function ma(a){setTimeout(p(function(){U(this)},a),50)}function V(a,b){setTimeout(p(function(){v(this.g.a);v(this.h.a);v(this.j.a);v(this.m.a);b(this.a)},a),0)};function W(a,b,c){this.c=a;this.a=b;this.f=0;this.m=this.j=!1;this.s=c}var X=null;W.prototype.g=function(a){var b=this.a;b.g&&w(b.f,[b.a.c("wf",a.c,J(a).toString(),"active")],[b.a.c("wf",a.c,J(a).toString(),"loading"),b.a.c("wf",a.c,J(a).toString(),"inactive")]);K(b,"fontactive",a);this.m=!0;na(this)}; W.prototype.h=function(a){var b=this.a;if(b.g){var c=y(b.f,b.a.c("wf",a.c,J(a).toString(),"active")),d=[],e=[b.a.c("wf",a.c,J(a).toString(),"loading")];c||d.push(b.a.c("wf",a.c,J(a).toString(),"inactive"));w(b.f,d,e)}K(b,"fontinactive",a);na(this)};function na(a){0==--a.f&&a.j&&(a.m?(a=a.a,a.g&&w(a.f,[a.a.c("wf","active")],[a.a.c("wf","loading"),a.a.c("wf","inactive")]),K(a,"active")):L(a.a))};function oa(a){this.j=a;this.a=new ja;this.h=0;this.f=this.g=!0}oa.prototype.load=function(a){this.c=new ca(this.j,a.context||this.j);this.g=!1!==a.events;this.f=!1!==a.classes;pa(this,new ha(this.c,a),a)}; function qa(a,b,c,d,e){var f=0==--a.h;(a.f||a.g)&&setTimeout(function(){var a=e||null,m=d||null||{};if(0===c.length&&f)L(b.a);else{b.f+=c.length;f&&(b.j=f);var h,l=[];for(h=0;h<c.length;h++){var k=c[h],n=m[k.c],r=b.a,x=k;r.g&&w(r.f,[r.a.c("wf",x.c,J(x).toString(),"loading")]);K(r,"fontloading",x);r=null;if(null===X)if(window.FontFace){var x=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent),xa=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor); X=x?42<parseInt(x[1],10):xa?!1:!0}else X=!1;X?r=new P(p(b.g,b),p(b.h,b),b.c,k,b.s,n):r=new Q(p(b.g,b),p(b.h,b),b.c,k,b.s,a,n);l.push(r)}for(h=0;h<l.length;h++)l[h].start()}},0)}function pa(a,b,c){var d=[],e=c.timeout;ia(b);var d=ka(a.a,c,a.c),f=new W(a.c,b,e);a.h=d.length;b=0;for(c=d.length;b<c;b++)d[b].load(function(b,d,c){qa(a,f,b,d,c)})};function ra(a,b){this.c=a;this.a=b} ra.prototype.load=function(a){function b(){if(f["__mti_fntLst"+d]){var c=f["__mti_fntLst"+d](),e=[],h;if(c)for(var l=0;l<c.length;l++){var k=c[l].fontfamily;void 0!=c[l].fontStyle&&void 0!=c[l].fontWeight?(h=c[l].fontStyle+c[l].fontWeight,e.push(new G(k,h))):e.push(new G(k))}a(e)}else setTimeout(function(){b()},50)}var c=this,d=c.a.projectId,e=c.a.version;if(d){var f=c.c.o;A(this.c,(c.a.api||"https://fast.fonts.net/jsapi")+"/"+d+".js"+(e?"?v="+e:""),function(e){e?a([]):(f["__MonotypeConfiguration__"+ d]=function(){return c.a},b())}).id="__MonotypeAPIScript__"+d}else a([])};function sa(a,b){this.c=a;this.a=b}sa.prototype.load=function(a){var b,c,d=this.a.urls||[],e=this.a.families||[],f=this.a.testStrings||{},g=new B;b=0;for(c=d.length;b<c;b++)z(this.c,d[b],C(g));var m=[];b=0;for(c=e.length;b<c;b++)if(d=e[b].split(":"),d[1])for(var h=d[1].split(","),l=0;l<h.length;l+=1)m.push(new G(d[0],h[l]));else m.push(new G(d[0]));E(g,function(){a(m,f)})};function ta(a,b){a?this.c=a:this.c=ua;this.a=[];this.f=[];this.g=b||""}var ua="https://fonts.googleapis.com/css";function va(a,b){for(var c=b.length,d=0;d<c;d++){var e=b[d].split(":");3==e.length&&a.f.push(e.pop());var f="";2==e.length&&""!=e[1]&&(f=":");a.a.push(e.join(f))}} function wa(a){if(0==a.a.length)throw Error("No fonts to load!");if(-1!=a.c.indexOf("kit="))return a.c;for(var b=a.a.length,c=[],d=0;d<b;d++)c.push(a.a[d].replace(/ /g,"+"));b=a.c+"?family="+c.join("%7C");0<a.f.length&&(b+="&subset="+a.f.join(","));0<a.g.length&&(b+="&text="+encodeURIComponent(a.g));return b};function ya(a){this.f=a;this.a=[];this.c={}} var za={latin:"BESbswy","latin-ext":"\u00e7\u00f6\u00fc\u011f\u015f",cyrillic:"\u0439\u044f\u0416",greek:"\u03b1\u03b2\u03a3",khmer:"\u1780\u1781\u1782",Hanuman:"\u1780\u1781\u1782"},Aa={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},Ba={i:"i",italic:"i",n:"n",normal:"n"}, Ca=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/; function Da(a){for(var b=a.f.length,c=0;c<b;c++){var d=a.f[c].split(":"),e=d[0].replace(/\+/g," "),f=["n4"];if(2<=d.length){var g;var m=d[1];g=[];if(m)for(var m=m.split(","),h=m.length,l=0;l<h;l++){var k;k=m[l];if(k.match(/^[\w-]+$/)){var n=Ca.exec(k.toLowerCase());if(null==n)k="";else{k=n[2];k=null==k||""==k?"n":Ba[k];n=n[1];if(null==n||""==n)n="4";else var r=Aa[n],n=r?r:isNaN(n)?"4":n.substr(0,1);k=[k,n].join("")}}else k="";k&&g.push(k)}0<g.length&&(f=g);3==d.length&&(d=d[2],g=[],d=d?d.split(","): g,0<d.length&&(d=za[d[0]])&&(a.c[e]=d))}a.c[e]||(d=za[e])&&(a.c[e]=d);for(d=0;d<f.length;d+=1)a.a.push(new G(e,f[d]))}};function Ea(a,b){this.c=a;this.a=b}var Fa={Arimo:!0,Cousine:!0,Tinos:!0};Ea.prototype.load=function(a){var b=new B,c=this.c,d=new ta(this.a.api,this.a.text),e=this.a.families;va(d,e);var f=new ya(e);Da(f);z(c,wa(d),C(b));E(b,function(){a(f.a,f.c,Fa)})};function Ga(a,b){this.c=a;this.a=b}Ga.prototype.load=function(a){var b=this.a.id,c=this.c.o;b?A(this.c,(this.a.api||"https://use.typekit.net")+"/"+b+".js",function(b){if(b)a([]);else if(c.Typekit&&c.Typekit.config&&c.Typekit.config.fn){b=c.Typekit.config.fn;for(var e=[],f=0;f<b.length;f+=2)for(var g=b[f],m=b[f+1],h=0;h<m.length;h++)e.push(new G(g,m[h]));try{c.Typekit.load({events:!1,classes:!1,async:!0})}catch(l){}a(e)}},2E3):a([])};function Ha(a,b){this.c=a;this.f=b;this.a=[]}Ha.prototype.load=function(a){var b=this.f.id,c=this.c.o,d=this;b?(c.__webfontfontdeckmodule__||(c.__webfontfontdeckmodule__={}),c.__webfontfontdeckmodule__[b]=function(b,c){for(var g=0,m=c.fonts.length;g<m;++g){var h=c.fonts[g];d.a.push(new G(h.name,ga("font-weight:"+h.weight+";font-style:"+h.style)))}a(d.a)},A(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+ea(this.c)+"/"+b+".js",function(b){b&&a([])})):a([])};var Y=new oa(window);Y.a.c.custom=function(a,b){return new sa(b,a)};Y.a.c.fontdeck=function(a,b){return new Ha(b,a)};Y.a.c.monotype=function(a,b){return new ra(b,a)};Y.a.c.typekit=function(a,b){return new Ga(b,a)};Y.a.c.google=function(a,b){return new Ea(b,a)};var Z={load:p(Y.load,Y)};"function"===typeof define&&define.amd?define(function(){return Z}):"undefined"!==typeof module&&module.exports?module.exports=Z:(window.WebFont=Z,window.WebFontConfig&&Y.load(window.WebFontConfig));}()); assets/js/lazyload.lib.js 0000777 00000061624 15251157102 0011423 0 ustar 00 (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? (module.exports = factory()) : typeof define === 'function' && define.amd ? define(factory) : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self), (global.LazyLoad = factory())); })(this, function () { 'use strict'; function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } var runningOnBrowser = typeof window !== 'undefined'; var isBot = (runningOnBrowser && !('onscroll' in window)) || (typeof navigator !== 'undefined' && /(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent)); var supportsIntersectionObserver = runningOnBrowser && 'IntersectionObserver' in window; var supportsClassList = runningOnBrowser && 'classList' in document.createElement('p'); var isHiDpi = runningOnBrowser && window.devicePixelRatio > 1; var defaultSettings = { elements_selector: '.lazy', container: isBot || runningOnBrowser ? document : null, threshold: 300, thresholds: null, data_src: 'src', data_srcset: 'srcset', data_sizes: 'sizes', data_bg: 'bg', data_bg_hidpi: 'bg-hidpi', data_bg_multi: 'bg-multi', data_bg_multi_hidpi: 'bg-multi-hidpi', data_poster: 'poster', class_applied: 'applied', class_loading: 'litespeed-loading', class_loaded: 'litespeed-loaded', // https://docs.litespeedtech.com/lscache/lscwp/pageopt/#lazy-load-images class_error: 'error', class_entered: 'entered', class_exited: 'exited', unobserve_completed: true, unobserve_entered: false, cancel_on_exit: true, callback_enter: null, callback_exit: null, callback_applied: null, callback_loading: null, callback_loaded: null, callback_error: null, callback_finish: null, callback_cancel: null, use_native: false, }; var getExtendedSettings = function getExtendedSettings(customSettings) { return _extends({}, defaultSettings, customSettings); }; /* Creates instance and notifies it through the window element */ var createInstance = function createInstance(classObj, options) { var event; var eventString = 'LazyLoad::Initialized'; var instance = new classObj(options); try { // Works in modern browsers event = new CustomEvent(eventString, { detail: { instance: instance, }, }); } catch (err) { // Works in Internet Explorer (all versions) event = document.createEvent('CustomEvent'); event.initCustomEvent(eventString, false, false, { instance: instance, }); } window.dispatchEvent(event); }; /* Auto initialization of one or more instances of lazyload, depending on the options passed in (plain object or an array) */ var autoInitialize = function autoInitialize(classObj, options) { if (!options) { return; } if (!options.length) { // Plain object createInstance(classObj, options); } else { // Array of objects for (var i = 0, optionsItem; (optionsItem = options[i]); i += 1) { createInstance(classObj, optionsItem); } } }; var SRC = 'src'; var SRCSET = 'srcset'; var SIZES = 'sizes'; var POSTER = 'poster'; var ORIGINALS = 'llOriginalAttrs'; var statusLoading = 'loading'; var statusLoaded = 'loaded'; var statusApplied = 'applied'; var statusEntered = 'entered'; var statusError = 'error'; var statusNative = 'native'; var dataPrefix = 'data-'; var statusDataName = 'll-status'; var getData = function getData(element, attribute) { return element.getAttribute(dataPrefix + attribute); }; var setData = function setData(element, attribute, value) { var attrName = dataPrefix + attribute; if (value === null) { element.removeAttribute(attrName); return; } element.setAttribute(attrName, value); }; var getStatus = function getStatus(element) { return getData(element, statusDataName); }; var setStatus = function setStatus(element, status) { return setData(element, statusDataName, status); }; var resetStatus = function resetStatus(element) { return setStatus(element, null); }; var hasEmptyStatus = function hasEmptyStatus(element) { return getStatus(element) === null; }; var hasStatusLoading = function hasStatusLoading(element) { return getStatus(element) === statusLoading; }; var hasStatusError = function hasStatusError(element) { return getStatus(element) === statusError; }; var hasStatusNative = function hasStatusNative(element) { return getStatus(element) === statusNative; }; var statusesAfterLoading = [statusLoading, statusLoaded, statusApplied, statusError]; var hadStartedLoading = function hadStartedLoading(element) { return statusesAfterLoading.indexOf(getStatus(element)) >= 0; }; var safeCallback = function safeCallback(callback, arg1, arg2, arg3) { if (!callback) { return; } if (arg3 !== undefined) { callback(arg1, arg2, arg3); return; } if (arg2 !== undefined) { callback(arg1, arg2); return; } callback(arg1); }; var addClass = function addClass(element, className) { if (supportsClassList) { element.classList.add(className); return; } element.className += (element.className ? ' ' : '') + className; }; var removeClass = function removeClass(element, className) { if (supportsClassList) { element.classList.remove(className); return; } element.className = element.className .replace(new RegExp('(^|\\s+)' + className + '(\\s+|$)'), ' ') .replace(/^\s+/, '') .replace(/\s+$/, ''); }; var addTempImage = function addTempImage(element) { element.llTempImage = document.createElement('IMG'); }; var deleteTempImage = function deleteTempImage(element) { delete element.llTempImage; }; var getTempImage = function getTempImage(element) { return element.llTempImage; }; var unobserve = function unobserve(element, instance) { if (!instance) return; var observer = instance._observer; if (!observer) return; observer.unobserve(element); }; var resetObserver = function resetObserver(observer) { observer.disconnect(); }; var unobserveEntered = function unobserveEntered(element, settings, instance) { if (settings.unobserve_entered) unobserve(element, instance); }; var updateLoadingCount = function updateLoadingCount(instance, delta) { if (!instance) return; instance.loadingCount += delta; }; var decreaseToLoadCount = function decreaseToLoadCount(instance) { if (!instance) return; instance.toLoadCount -= 1; }; var setToLoadCount = function setToLoadCount(instance, value) { if (!instance) return; instance.toLoadCount = value; }; var isSomethingLoading = function isSomethingLoading(instance) { return instance.loadingCount > 0; }; var haveElementsToLoad = function haveElementsToLoad(instance) { return instance.toLoadCount > 0; }; var getSourceTags = function getSourceTags(parentTag) { var sourceTags = []; for (var i = 0, childTag; (childTag = parentTag.children[i]); i += 1) { if (childTag.tagName === 'SOURCE') { sourceTags.push(childTag); } } return sourceTags; }; var forEachPictureSource = function forEachPictureSource(element, fn) { var parent = element.parentNode; if (!parent || parent.tagName !== 'PICTURE') { return; } var sourceTags = getSourceTags(parent); sourceTags.forEach(fn); }; var forEachVideoSource = function forEachVideoSource(element, fn) { var sourceTags = getSourceTags(element); sourceTags.forEach(fn); }; var attrsSrc = [SRC]; var attrsSrcPoster = [SRC, POSTER]; var attrsSrcSrcsetSizes = [SRC, SRCSET, SIZES]; var hasOriginalAttrs = function hasOriginalAttrs(element) { return !!element[ORIGINALS]; }; var getOriginalAttrs = function getOriginalAttrs(element) { return element[ORIGINALS]; }; var deleteOriginalAttrs = function deleteOriginalAttrs(element) { return delete element[ORIGINALS]; }; // ## SAVE ## var setOriginalsObject = function setOriginalsObject(element, attributes) { if (hasOriginalAttrs(element)) { return; } var originals = {}; attributes.forEach(function (attribute) { originals[attribute] = element.getAttribute(attribute); }); element[ORIGINALS] = originals; }; var saveOriginalBackgroundStyle = function saveOriginalBackgroundStyle(element) { if (hasOriginalAttrs(element)) { return; } element[ORIGINALS] = { backgroundImage: element.style.backgroundImage, }; }; // ## RESTORE ## var setOrResetAttribute = function setOrResetAttribute(element, attrName, value) { if (!value) { element.removeAttribute(attrName); return; } element.setAttribute(attrName, value); }; var restoreOriginalAttrs = function restoreOriginalAttrs(element, attributes) { if (!hasOriginalAttrs(element)) { return; } var originals = getOriginalAttrs(element); attributes.forEach(function (attribute) { setOrResetAttribute(element, attribute, originals[attribute]); }); }; var restoreOriginalBgImage = function restoreOriginalBgImage(element) { if (!hasOriginalAttrs(element)) { return; } var originals = getOriginalAttrs(element); element.style.backgroundImage = originals.backgroundImage; }; var manageApplied = function manageApplied(element, settings, instance) { addClass(element, settings.class_applied); setStatus(element, statusApplied); // Instance is not provided when loading is called from static class if (!instance) return; if (settings.unobserve_completed) { // Unobserve now because we can't do it on load unobserve(element, settings); } safeCallback(settings.callback_applied, element, instance); }; var manageLoading = function manageLoading(element, settings, instance) { addClass(element, settings.class_loading); setStatus(element, statusLoading); // Instance is not provided when loading is called from static class if (!instance) return; updateLoadingCount(instance, +1); safeCallback(settings.callback_loading, element, instance); }; var setAttributeIfValue = function setAttributeIfValue(element, attrName, value) { if (!value) { return; } element.setAttribute(attrName, value); }; var setImageAttributes = function setImageAttributes(element, settings) { setAttributeIfValue(element, SIZES, getData(element, settings.data_sizes)); setAttributeIfValue(element, SRCSET, getData(element, settings.data_srcset)); setAttributeIfValue(element, SRC, getData(element, settings.data_src)); }; var setSourcesImg = function setSourcesImg(imgEl, settings) { forEachPictureSource(imgEl, function (sourceTag) { setOriginalsObject(sourceTag, attrsSrcSrcsetSizes); setImageAttributes(sourceTag, settings); }); setOriginalsObject(imgEl, attrsSrcSrcsetSizes); setImageAttributes(imgEl, settings); }; var setSourcesIframe = function setSourcesIframe(iframe, settings) { setOriginalsObject(iframe, attrsSrc); setAttributeIfValue(iframe, SRC, getData(iframe, settings.data_src)); }; var setSourcesVideo = function setSourcesVideo(videoEl, settings) { forEachVideoSource(videoEl, function (sourceEl) { setOriginalsObject(sourceEl, attrsSrc); setAttributeIfValue(sourceEl, SRC, getData(sourceEl, settings.data_src)); }); setOriginalsObject(videoEl, attrsSrcPoster); setAttributeIfValue(videoEl, POSTER, getData(videoEl, settings.data_poster)); setAttributeIfValue(videoEl, SRC, getData(videoEl, settings.data_src)); videoEl.load(); }; var setBackground = function setBackground(element, settings, instance) { var bg1xValue = getData(element, settings.data_bg); var bgHiDpiValue = getData(element, settings.data_bg_hidpi); var bgDataValue = isHiDpi && bgHiDpiValue ? bgHiDpiValue : bg1xValue; if (!bgDataValue) return; element.style.backgroundImage = 'url("'.concat(bgDataValue, '")'); getTempImage(element).setAttribute(SRC, bgDataValue); manageLoading(element, settings, instance); }; // NOTE: THE TEMP IMAGE TRICK CANNOT BE DONE WITH data-multi-bg // BECAUSE INSIDE ITS VALUES MUST BE WRAPPED WITH URL() AND ONE OF THEM // COULD BE A GRADIENT BACKGROUND IMAGE var setMultiBackground = function setMultiBackground(element, settings, instance) { var bg1xValue = getData(element, settings.data_bg_multi); var bgHiDpiValue = getData(element, settings.data_bg_multi_hidpi); var bgDataValue = isHiDpi && bgHiDpiValue ? bgHiDpiValue : bg1xValue; if (!bgDataValue) { return; } element.style.backgroundImage = bgDataValue; manageApplied(element, settings, instance); }; var setSourcesFunctions = { IMG: setSourcesImg, IFRAME: setSourcesIframe, VIDEO: setSourcesVideo, }; var setSourcesNative = function setSourcesNative(element, settings) { var setSourcesFunction = setSourcesFunctions[element.tagName]; if (!setSourcesFunction) { return; } setSourcesFunction(element, settings); }; var setSources = function setSources(element, settings, instance) { var setSourcesFunction = setSourcesFunctions[element.tagName]; if (!setSourcesFunction) { return; } setSourcesFunction(element, settings); manageLoading(element, settings, instance); }; var elementsWithLoadEvent = ['IMG', 'IFRAME', 'VIDEO']; var hasLoadEvent = function hasLoadEvent(element) { return elementsWithLoadEvent.indexOf(element.tagName) > -1; }; var checkFinish = function checkFinish(settings, instance) { if (instance && !isSomethingLoading(instance) && !haveElementsToLoad(instance)) { safeCallback(settings.callback_finish, instance); } }; var addEventListener = function addEventListener(element, eventName, handler) { element.addEventListener(eventName, handler); element.llEvLisnrs[eventName] = handler; }; var removeEventListener = function removeEventListener(element, eventName, handler) { element.removeEventListener(eventName, handler); }; var hasEventListeners = function hasEventListeners(element) { return !!element.llEvLisnrs; }; var addEventListeners = function addEventListeners(element, loadHandler, errorHandler) { if (!hasEventListeners(element)) element.llEvLisnrs = {}; var loadEventName = element.tagName === 'VIDEO' ? 'loadeddata' : 'load'; addEventListener(element, loadEventName, loadHandler); addEventListener(element, 'error', errorHandler); }; var removeEventListeners = function removeEventListeners(element) { if (!hasEventListeners(element)) { return; } var eventListeners = element.llEvLisnrs; for (var eventName in eventListeners) { var handler = eventListeners[eventName]; removeEventListener(element, eventName, handler); } delete element.llEvLisnrs; }; var doneHandler = function doneHandler(element, settings, instance) { deleteTempImage(element); updateLoadingCount(instance, -1); decreaseToLoadCount(instance); removeClass(element, settings.class_loading); if (settings.unobserve_completed) { unobserve(element, instance); } }; var loadHandler = function loadHandler(event, element, settings, instance) { var goingNative = hasStatusNative(element); doneHandler(element, settings, instance); addClass(element, settings.class_loaded); setStatus(element, statusLoaded); safeCallback(settings.callback_loaded, element, instance); if (!goingNative) checkFinish(settings, instance); }; var errorHandler = function errorHandler(event, element, settings, instance) { var goingNative = hasStatusNative(element); doneHandler(element, settings, instance); addClass(element, settings.class_error); setStatus(element, statusError); safeCallback(settings.callback_error, element, instance); if (!goingNative) checkFinish(settings, instance); }; var addOneShotEventListeners = function addOneShotEventListeners(element, settings, instance) { var elementToListenTo = getTempImage(element) || element; if (hasEventListeners(elementToListenTo)) { // This happens when loading is retried twice return; } var _loadHandler = function _loadHandler(event) { loadHandler(event, element, settings, instance); removeEventListeners(elementToListenTo); }; var _errorHandler = function _errorHandler(event) { errorHandler(event, element, settings, instance); removeEventListeners(elementToListenTo); }; addEventListeners(elementToListenTo, _loadHandler, _errorHandler); }; var loadBackground = function loadBackground(element, settings, instance) { addTempImage(element); addOneShotEventListeners(element, settings, instance); saveOriginalBackgroundStyle(element); setBackground(element, settings, instance); setMultiBackground(element, settings, instance); }; var loadRegular = function loadRegular(element, settings, instance) { addOneShotEventListeners(element, settings, instance); setSources(element, settings, instance); }; var load = function load(element, settings, instance) { if (hasLoadEvent(element)) { loadRegular(element, settings, instance); } else { loadBackground(element, settings, instance); } }; var loadNative = function loadNative(element, settings, instance) { element.setAttribute('loading', 'lazy'); addOneShotEventListeners(element, settings, instance); setSourcesNative(element, settings); setStatus(element, statusNative); }; var removeImageAttributes = function removeImageAttributes(element) { element.removeAttribute(SRC); element.removeAttribute(SRCSET); element.removeAttribute(SIZES); }; var resetSourcesImg = function resetSourcesImg(element) { forEachPictureSource(element, function (sourceTag) { removeImageAttributes(sourceTag); }); removeImageAttributes(element); }; var restoreImg = function restoreImg(imgEl) { forEachPictureSource(imgEl, function (sourceEl) { restoreOriginalAttrs(sourceEl, attrsSrcSrcsetSizes); }); restoreOriginalAttrs(imgEl, attrsSrcSrcsetSizes); }; var restoreVideo = function restoreVideo(videoEl) { forEachVideoSource(videoEl, function (sourceEl) { restoreOriginalAttrs(sourceEl, attrsSrc); }); restoreOriginalAttrs(videoEl, attrsSrcPoster); videoEl.load(); }; var restoreIframe = function restoreIframe(iframeEl) { restoreOriginalAttrs(iframeEl, attrsSrc); }; var restoreFunctions = { IMG: restoreImg, IFRAME: restoreIframe, VIDEO: restoreVideo, }; var restoreAttributes = function restoreAttributes(element) { var restoreFunction = restoreFunctions[element.tagName]; if (!restoreFunction) { restoreOriginalBgImage(element); return; } restoreFunction(element); }; var resetClasses = function resetClasses(element, settings) { if (hasEmptyStatus(element) || hasStatusNative(element)) { return; } removeClass(element, settings.class_entered); removeClass(element, settings.class_exited); removeClass(element, settings.class_applied); removeClass(element, settings.class_loading); removeClass(element, settings.class_loaded); removeClass(element, settings.class_error); }; var restore = function restore(element, settings) { restoreAttributes(element); resetClasses(element, settings); resetStatus(element); deleteOriginalAttrs(element); }; var cancelLoading = function cancelLoading(element, entry, settings, instance) { if (!settings.cancel_on_exit) return; if (!hasStatusLoading(element)) return; if (element.tagName !== 'IMG') return; //Works only on images removeEventListeners(element); resetSourcesImg(element); restoreImg(element); removeClass(element, settings.class_loading); updateLoadingCount(instance, -1); resetStatus(element); safeCallback(settings.callback_cancel, element, entry, instance); }; var onEnter = function onEnter(element, entry, settings, instance) { var dontLoad = hadStartedLoading(element); /* Save status before setting it, to prevent loading it again. Fixes #526. */ setStatus(element, statusEntered); addClass(element, settings.class_entered); removeClass(element, settings.class_exited); unobserveEntered(element, settings, instance); safeCallback(settings.callback_enter, element, entry, instance); if (dontLoad) return; load(element, settings, instance); }; var onExit = function onExit(element, entry, settings, instance) { if (hasEmptyStatus(element)) return; //Ignore the first pass, at landing addClass(element, settings.class_exited); cancelLoading(element, entry, settings, instance); safeCallback(settings.callback_exit, element, entry, instance); }; var tagsWithNativeLazy = ['IMG', 'IFRAME', 'VIDEO']; var shouldUseNative = function shouldUseNative(settings) { return settings.use_native && 'loading' in HTMLImageElement.prototype; }; var loadAllNative = function loadAllNative(elements, settings, instance) { elements.forEach(function (element) { if (tagsWithNativeLazy.indexOf(element.tagName) === -1) { return; } loadNative(element, settings, instance); }); setToLoadCount(instance, 0); }; var isIntersecting = function isIntersecting(entry) { return entry.isIntersecting || entry.intersectionRatio > 0; }; var getObserverSettings = function getObserverSettings(settings) { return { root: settings.container === document ? null : settings.container, rootMargin: settings.thresholds || settings.threshold + 'px', }; }; var intersectionHandler = function intersectionHandler(entries, settings, instance) { entries.forEach(function (entry) { return isIntersecting(entry) ? onEnter(entry.target, entry, settings, instance) : onExit(entry.target, entry, settings, instance); }); }; var observeElements = function observeElements(observer, elements) { elements.forEach(function (element) { observer.observe(element); }); }; var updateObserver = function updateObserver(observer, elementsToObserve) { resetObserver(observer); observeElements(observer, elementsToObserve); }; var setObserver = function setObserver(settings, instance) { if (!supportsIntersectionObserver || shouldUseNative(settings)) { return; } instance._observer = new IntersectionObserver(function (entries) { intersectionHandler(entries, settings, instance); }, getObserverSettings(settings)); }; var toArray = function toArray(nodeSet) { return Array.prototype.slice.call(nodeSet); }; var queryElements = function queryElements(settings) { return settings.container.querySelectorAll(settings.elements_selector); }; var excludeManagedElements = function excludeManagedElements(elements) { return toArray(elements).filter(hasEmptyStatus); }; var hasError = function hasError(element) { return hasStatusError(element); }; var filterErrorElements = function filterErrorElements(elements) { return toArray(elements).filter(hasError); }; var getElementsToLoad = function getElementsToLoad(elements, settings) { return excludeManagedElements(elements || queryElements(settings)); }; var retryLazyLoad = function retryLazyLoad(settings, instance) { var errorElements = filterErrorElements(queryElements(settings)); errorElements.forEach(function (element) { removeClass(element, settings.class_error); resetStatus(element); }); instance.update(); }; var setOnlineCheck = function setOnlineCheck(settings, instance) { if (!runningOnBrowser) { return; } window.addEventListener('online', function () { retryLazyLoad(settings, instance); }); }; var LazyLoad = function LazyLoad(customSettings, elements) { var settings = getExtendedSettings(customSettings); this._settings = settings; this.loadingCount = 0; setObserver(settings, this); setOnlineCheck(settings, this); this.update(elements); }; LazyLoad.prototype = { update: function update(givenNodeset) { var settings = this._settings; var elementsToLoad = getElementsToLoad(givenNodeset, settings); setToLoadCount(this, elementsToLoad.length); if (isBot || !supportsIntersectionObserver) { this.loadAll(elementsToLoad); return; } if (shouldUseNative(settings)) { loadAllNative(elementsToLoad, settings, this); return; } updateObserver(this._observer, elementsToLoad); }, destroy: function destroy() { // Observer if (this._observer) { this._observer.disconnect(); } // Clean custom attributes on elements queryElements(this._settings).forEach(function (element) { deleteOriginalAttrs(element); }); // Delete all internal props delete this._observer; delete this._settings; delete this.loadingCount; delete this.toLoadCount; }, loadAll: function loadAll(elements) { var _this = this; var settings = this._settings; var elementsToLoad = getElementsToLoad(elements, settings); elementsToLoad.forEach(function (element) { unobserve(element, _this); load(element, settings, _this); }); }, restoreAll: function restoreAll() { var settings = this._settings; queryElements(settings).forEach(function (element) { restore(element, settings); }); }, }; LazyLoad.load = function (element, customSettings) { var settings = getExtendedSettings(customSettings); load(element, settings); }; LazyLoad.resetStatus = function (element) { resetStatus(element); }; // Automatic instances creation if required (useful for async script loading) // if (runningOnBrowser) { // autoInitialize(LazyLoad, window.lazyLoadOptions); // } return LazyLoad; }); assets/js/iziModal.min.js 0000777 00000063232 15251157102 0011366 0 ustar 00 /* * iziModal | v1.6.0 * https://izimodal.marcelodolza.com/ * by Marcelo Dolce. */ !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=function(e,i){return void 0===i&&(i="undefined"!=typeof window?require("jquery"):require("jquery")(e)),t(i),i}:t(jQuery)}(function(t){function e(){var t,e=document.createElement("fakeelement"),i={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(t in i)if(void 0!==e.style[t])return i[t]}function i(t){return 9===t?navigator.appVersion.indexOf("MSIE 9.")!==-1:(userAgent=navigator.userAgent,userAgent.indexOf("MSIE ")>-1||userAgent.indexOf("Trident/")>-1)}function n(t){var e=/%|px|em|cm|vh|vw/;return parseInt(String(t).split(e)[0])}function o(e){var i=e.replace(/^.*#/,""),n=t(e);n.attr("id",i+"-tmp"),window.location.hash=e,n.attr("id",i)}var s=t(window),a=t(document),r="iziModal",l={CLOSING:"closing",CLOSED:"closed",OPENING:"opening",OPENED:"opened",DESTROYED:"destroyed"},d=e(),h=!!/Mobi/.test(navigator.userAgent);window.$iziModal={},window.$iziModal.autoOpen=0,window.$iziModal.history=!1;var c=function(t,e){this.init(t,e)};return c.prototype={constructor:c,init:function(e,i){var n=this;this.$element=t(e),void 0!==this.$element[0].id&&""!==this.$element[0].id?this.id=this.$element[0].id:(this.id=r+Math.floor(1e7*Math.random()+1),this.$element.attr("id",this.id)),this.classes=void 0!==this.$element.attr("class")?this.$element.attr("class"):"",this.content=this.$element.html(),this.state=l.CLOSED,this.options=i,this.width=0,this.timer=null,this.timerTimeout=null,this.progressBar=null,this.isPaused=!1,this.isFullscreen=!1,this.headerHeight=0,this.modalHeight=0,this.$overlay=t('<div class="'+r+'-overlay" style="background-color:'+i.overlayColor+'"></div>'),this.$navigate=t('<div class="'+r+'-navigate"><div class="'+r+'-navigate-caption">Use</div><button class="'+r+'-navigate-prev"></button><button class="'+r+'-navigate-next"></button></div>'),this.group={name:this.$element.attr("data-"+r+"-group"),index:null,ids:[]},this.$element.attr("aria-hidden","true"),this.$element.attr("aria-labelledby",this.id),this.$element.attr("role","dialog"),this.$element.hasClass("iziModal")||this.$element.addClass("iziModal"),void 0===this.group.name&&""!==i.group&&(this.group.name=i.group,this.$element.attr("data-"+r+"-group",i.group)),this.options.loop===!0&&this.$element.attr("data-"+r+"-loop",!0),t.each(this.options,function(t,e){var o=n.$element.attr("data-"+r+"-"+t);try{"undefined"!=typeof o&&(""===o||"true"==o?i[t]=!0:"false"==o?i[t]=!1:"function"==typeof e?i[t]=new Function(o):i[t]=o)}catch(s){}}),i.appendTo!==!1&&this.$element.appendTo(i.appendTo),i.iframe===!0?(this.$element.html('<div class="'+r+'-wrap"><div class="'+r+'-content"><iframe class="'+r+'-iframe"></iframe>'+this.content+"</div></div>"),null!==i.iframeHeight&&this.$element.find("."+r+"-iframe").css("height",i.iframeHeight)):this.$element.html('<div class="'+r+'-wrap"><div class="'+r+'-content">'+this.content+"</div></div>"),null!==this.options.background&&this.$element.css("background",this.options.background),this.$wrap=this.$element.find("."+r+"-wrap"),null===i.zindex||isNaN(parseInt(i.zindex))||(this.$element.css("z-index",i.zindex),this.$navigate.css("z-index",i.zindex-1),this.$overlay.css("z-index",i.zindex-2)),""!==i.radius&&this.$element.css("border-radius",i.radius),""!==i.padding&&this.$element.find("."+r+"-content").css("padding",i.padding),""!==i.theme&&("light"===i.theme?this.$element.addClass(r+"-light"):this.$element.addClass(i.theme)),i.rtl===!0&&this.$element.addClass(r+"-rtl"),i.openFullscreen===!0&&(this.isFullscreen=!0,this.$element.addClass("isFullscreen")),this.createHeader(),this.recalcWidth(),this.recalcVerticalPos(),!n.options.afterRender||"function"!=typeof n.options.afterRender&&"object"!=typeof n.options.afterRender||n.options.afterRender(n)},createHeader:function(){this.$header=t('<div class="'+r+'-header"><h2 class="'+r+'-header-title">'+this.options.title+'</h2><p class="'+r+'-header-subtitle">'+this.options.subtitle+'</p><div class="'+r+'-header-buttons"></div></div>'),this.options.closeButton===!0&&this.$header.find("."+r+"-header-buttons").append('<a href="javascript:void(0)" class="'+r+"-button "+r+'-button-close" data-'+r+"-close></a>"),this.options.fullscreen===!0&&this.$header.find("."+r+"-header-buttons").append('<a href="javascript:void(0)" class="'+r+"-button "+r+'-button-fullscreen" data-'+r+"-fullscreen></a>"),this.options.timeoutProgressbar===!0&&this.$header.prepend('<div class="'+r+'-progressbar"><div style="background-color:'+this.options.timeoutProgressbarColor+'"></div></div>'),""===this.options.subtitle&&this.$header.addClass(r+"-noSubtitle"),""!==this.options.title&&(null!==this.options.headerColor&&(this.options.borderBottom===!0&&this.$element.css("border-bottom","3px solid "+this.options.headerColor),this.$header.css("background",this.options.headerColor)),null===this.options.icon&&null===this.options.iconText||(this.$header.prepend('<i class="'+r+'-header-icon"></i>'),null!==this.options.icon&&this.$header.find("."+r+"-header-icon").addClass(this.options.icon).css("color",this.options.iconColor),null!==this.options.iconText&&this.$header.find("."+r+"-header-icon").html(this.options.iconText)),this.$element.css("overflow","hidden").prepend(this.$header))},setGroup:function(e){var i=this,n=this.group.name||e;if(this.group.ids=[],void 0!==e&&e!==this.group.name&&(n=e,this.group.name=n,this.$element.attr("data-"+r+"-group",n)),void 0!==n&&""!==n){var o=0;t.each(t("."+r+"[data-"+r+"-group="+n+"]"),function(e,n){i.group.ids.push(t(this)[0].id),i.id==t(this)[0].id&&(i.group.index=o),o++})}},toggle:function(){this.state==l.OPENED&&this.close(),this.state==l.CLOSED&&this.open()},startProgress:function(t){var e=this;this.isPaused=!1,clearTimeout(this.timerTimeout),this.options.timeoutProgressbar===!0?(this.progressBar={hideEta:null,maxHideTime:null,currentTime:(new Date).getTime(),el:this.$element.find("."+r+"-progressbar > div"),updateProgress:function(){if(!e.isPaused){e.progressBar.currentTime=e.progressBar.currentTime+10;var t=(e.progressBar.hideEta-e.progressBar.currentTime)/e.progressBar.maxHideTime*100;e.progressBar.el.width(t+"%"),t<0&&e.close()}}},t>0&&(this.progressBar.maxHideTime=parseFloat(t),this.progressBar.hideEta=(new Date).getTime()+this.progressBar.maxHideTime,this.timerTimeout=setInterval(this.progressBar.updateProgress,10))):this.timerTimeout=setTimeout(function(){e.close()},e.options.timeout)},pauseProgress:function(){this.isPaused=!0},resumeProgress:function(){this.isPaused=!1},resetProgress:function(t){clearTimeout(this.timerTimeout),this.progressBar={},this.$element.find("."+r+"-progressbar > div").width("100%")},open:function(e){function i(){s.state=l.OPENED,s.$element.trigger(l.OPENED),!s.options.onOpened||"function"!=typeof s.options.onOpened&&"object"!=typeof s.options.onOpened||s.options.onOpened(s)}function n(){s.$element.off("click","[data-"+r+"-close]").on("click","[data-"+r+"-close]",function(e){e.preventDefault();var i=t(e.currentTarget).attr("data-"+r+"-transitionOut");void 0!==i?s.close({transition:i}):s.close()}),s.$element.off("click","[data-"+r+"-fullscreen]").on("click","[data-"+r+"-fullscreen]",function(t){t.preventDefault(),s.isFullscreen===!0?(s.isFullscreen=!1,s.$element.removeClass("isFullscreen")):(s.isFullscreen=!0,s.$element.addClass("isFullscreen")),s.options.onFullscreen&&"function"==typeof s.options.onFullscreen&&s.options.onFullscreen(s),s.$element.trigger("fullscreen",s)}),s.$navigate.off("click","."+r+"-navigate-next").on("click","."+r+"-navigate-next",function(t){s.next(t)}),s.$element.off("click","[data-"+r+"-next]").on("click","[data-"+r+"-next]",function(t){s.next(t)}),s.$navigate.off("click","."+r+"-navigate-prev").on("click","."+r+"-navigate-prev",function(t){s.prev(t)}),s.$element.off("click","[data-"+r+"-prev]").on("click","[data-"+r+"-prev]",function(t){s.prev(t)})}var s=this;try{void 0!==e&&e.preventClose===!1&&t.each(t("."+r),function(e,i){if(void 0!==t(i).data().iziModal){var n=t(i).iziModal("getState");"opened"!=n&&"opening"!=n||t(i).iziModal("close")}})}catch(c){}if(function(){if(s.options.history){var t=document.title;document.title=t+" - "+s.options.title,o("#"+s.id),document.title=t,window.$iziModal.history=!0}else window.$iziModal.history=!1}(),this.state==l.CLOSED){if(n(),this.setGroup(),this.state=l.OPENING,this.$element.trigger(l.OPENING),this.$element.attr("aria-hidden","false"),this.options.timeoutProgressbar===!0&&this.$element.find("."+r+"-progressbar > div").width("100%"),this.options.iframe===!0){this.$element.find("."+r+"-content").addClass(r+"-content-loader"),this.$element.find("."+r+"-iframe").on("load",function(){t(this).parent().removeClass(r+"-content-loader")});var u=null;try{u=""!==t(e.currentTarget).attr("href")?t(e.currentTarget).attr("href"):null}catch(c){}if(null===this.options.iframeURL||null!==u&&void 0!==u||(u=this.options.iframeURL),null===u||void 0===u)throw new Error("Failed to find iframe URL");this.$element.find("."+r+"-iframe").attr("src",u)}(this.options.bodyOverflow||h)&&(t("html").addClass(r+"-isOverflow"),h&&t("body").css("overflow","hidden")),this.options.onOpening&&"function"==typeof this.options.onOpening&&this.options.onOpening(this),function(){if(s.group.ids.length>1){s.$navigate.appendTo("body"),s.$navigate.addClass("fadeIn"),s.options.navigateCaption===!0&&s.$navigate.find("."+r+"-navigate-caption").show();var n=s.$element.outerWidth();s.options.navigateArrows!==!1?"closeScreenEdge"===s.options.navigateArrows?(s.$navigate.find("."+r+"-navigate-prev").css("left",0).show(),s.$navigate.find("."+r+"-navigate-next").css("right",0).show()):(s.$navigate.find("."+r+"-navigate-prev").css("margin-left",-(n/2+84)).show(),s.$navigate.find("."+r+"-navigate-next").css("margin-right",-(n/2+84)).show()):(s.$navigate.find("."+r+"-navigate-prev").hide(),s.$navigate.find("."+r+"-navigate-next").hide());var o;0===s.group.index&&(o=t("."+r+"[data-"+r+'-group="'+s.group.name+'"][data-'+r+"-loop]").length,0===o&&s.options.loop===!1&&s.$navigate.find("."+r+"-navigate-prev").hide()),s.group.index+1===s.group.ids.length&&(o=t("."+r+"[data-"+r+'-group="'+s.group.name+'"][data-'+r+"-loop]").length,0===o&&s.options.loop===!1&&s.$navigate.find("."+r+"-navigate-next").hide())}s.options.overlay===!0&&(s.options.appendToOverlay===!1?s.$overlay.appendTo("body"):s.$overlay.appendTo(s.options.appendToOverlay)),s.options.transitionInOverlay&&s.$overlay.addClass(s.options.transitionInOverlay);var a=s.options.transitionIn;"object"==typeof e&&(void 0===e.transition&&void 0===e.transitionIn||(a=e.transition||e.transitionIn),void 0!==e.zindex&&s.setZindex(e.zindex)),""!==a&&void 0!==d?(s.$element.addClass("transitionIn "+a).show(),s.$wrap.one(d,function(){s.$element.removeClass(a+" transitionIn"),s.$overlay.removeClass(s.options.transitionInOverlay),s.$navigate.removeClass("fadeIn"),i()})):(s.$element.show(),i()),s.options.pauseOnHover!==!0||s.options.pauseOnHover!==!0||s.options.timeout===!1||isNaN(parseInt(s.options.timeout))||s.options.timeout===!1||0===s.options.timeout||(s.$element.off("mouseenter").on("mouseenter",function(t){t.preventDefault(),s.isPaused=!0}),s.$element.off("mouseleave").on("mouseleave",function(t){t.preventDefault(),s.isPaused=!1}))}(),this.options.timeout===!1||isNaN(parseInt(this.options.timeout))||this.options.timeout===!1||0===this.options.timeout||s.startProgress(this.options.timeout),this.options.overlayClose&&!this.$element.hasClass(this.options.transitionOut)&&this.$overlay.click(function(){s.close()}),this.options.focusInput&&this.$element.find(":input:not(button):enabled:visible:first").focus(),function p(){s.recalcLayout(),s.timer=setTimeout(p,300)}(),a.on("keydown."+r,function(t){s.options.closeOnEscape&&27===t.keyCode&&s.close()})}},close:function(e){function i(){n.state=l.CLOSED,n.$element.trigger(l.CLOSED),n.options.iframe===!0&&n.$element.find("."+r+"-iframe").attr("src",""),(n.options.bodyOverflow||h)&&(t("html").removeClass(r+"-isOverflow"),h&&t("body").css("overflow","auto")),n.options.onClosed&&"function"==typeof n.options.onClosed&&n.options.onClosed(n),n.options.restoreDefaultContent===!0&&n.$element.find("."+r+"-content").html(n.content),0===t("."+r+":visible").length&&t("html").removeClass(r+"-isAttached")}var n=this;if(this.state==l.OPENED||this.state==l.OPENING){a.off("keydown."+r),this.state=l.CLOSING,this.$element.trigger(l.CLOSING),this.$element.attr("aria-hidden","true"),clearTimeout(this.timer),clearTimeout(this.timerTimeout),n.options.onClosing&&"function"==typeof n.options.onClosing&&n.options.onClosing(this);var o=this.options.transitionOut;"object"==typeof e&&(void 0===e.transition&&void 0===e.transitionOut||(o=e.transition||e.transitionOut)),o===!1||""===o||void 0===d?(this.$element.hide(),this.$overlay.remove(),this.$navigate.remove(),i()):(this.$element.attr("class",[this.classes,r,o,"light"==this.options.theme?r+"-light":this.options.theme,this.isFullscreen===!0?"isFullscreen":"",this.options.rtl?r+"-rtl":""].join(" ")),this.$overlay.attr("class",r+"-overlay "+this.options.transitionOutOverlay),n.options.navigateArrows===!1||h||this.$navigate.attr("class",r+"-navigate fadeOut"),this.$element.one(d,function(){n.$element.hasClass(o)&&n.$element.removeClass(o+" transitionOut").hide(),n.$overlay.removeClass(n.options.transitionOutOverlay).remove(),n.$navigate.removeClass("fadeOut").remove(),i()}))}},next:function(e){var i=this,n="fadeInRight",o="fadeOutLeft",s=t("."+r+":visible"),a={};a.out=this,void 0!==e&&"object"!=typeof e?(e.preventDefault(),s=t(e.currentTarget),n=s.attr("data-"+r+"-transitionIn"),o=s.attr("data-"+r+"-transitionOut")):void 0!==e&&(void 0!==e.transitionIn&&(n=e.transitionIn),void 0!==e.transitionOut&&(o=e.transitionOut)),this.close({transition:o}),setTimeout(function(){for(var e=t("."+r+"[data-"+r+'-group="'+i.group.name+'"][data-'+r+"-loop]").length,o=i.group.index+1;o<=i.group.ids.length;o++){try{a["in"]=t("#"+i.group.ids[o]).data().iziModal}catch(s){}if("undefined"!=typeof a["in"]){t("#"+i.group.ids[o]).iziModal("open",{transition:n});break}if(o==i.group.ids.length&&e>0||i.options.loop===!0)for(var l=0;l<=i.group.ids.length;l++)if(a["in"]=t("#"+i.group.ids[l]).data().iziModal,"undefined"!=typeof a["in"]){t("#"+i.group.ids[l]).iziModal("open",{transition:n});break}}},200),t(document).trigger(r+"-group-change",a)},prev:function(e){var i=this,n="fadeInLeft",o="fadeOutRight",s=t("."+r+":visible"),a={};a.out=this,void 0!==e&&"object"!=typeof e?(e.preventDefault(),s=t(e.currentTarget),n=s.attr("data-"+r+"-transitionIn"),o=s.attr("data-"+r+"-transitionOut")):void 0!==e&&(void 0!==e.transitionIn&&(n=e.transitionIn),void 0!==e.transitionOut&&(o=e.transitionOut)),this.close({transition:o}),setTimeout(function(){for(var e=t("."+r+"[data-"+r+'-group="'+i.group.name+'"][data-'+r+"-loop]").length,o=i.group.index;o>=0;o--){try{a["in"]=t("#"+i.group.ids[o-1]).data().iziModal}catch(s){}if("undefined"!=typeof a["in"]){t("#"+i.group.ids[o-1]).iziModal("open",{transition:n});break}if(0===o&&e>0||i.options.loop===!0)for(var l=i.group.ids.length-1;l>=0;l--)if(a["in"]=t("#"+i.group.ids[l]).data().iziModal,"undefined"!=typeof a["in"]){t("#"+i.group.ids[l]).iziModal("open",{transition:n});break}}},200),t(document).trigger(r+"-group-change",a)},destroy:function(){var e=t.Event("destroy");this.$element.trigger(e),a.off("keydown."+r),clearTimeout(this.timer),clearTimeout(this.timerTimeout),this.options.iframe===!0&&this.$element.find("."+r+"-iframe").remove(),this.$element.html(this.$element.find("."+r+"-content").html()),this.$element.off("click","[data-"+r+"-close]"),this.$element.off("click","[data-"+r+"-fullscreen]"),this.$element.off("."+r).removeData(r).attr("style",""),this.$overlay.remove(),this.$navigate.remove(),this.$element.trigger(l.DESTROYED),this.$element=null},getState:function(){return this.state},getGroup:function(){return this.group},setWidth:function(t){this.options.width=t,this.recalcWidth();var e=this.$element.outerWidth();this.options.navigateArrows!==!0&&"closeToModal"!=this.options.navigateArrows||(this.$navigate.find("."+r+"-navigate-prev").css("margin-left",-(e/2+84)).show(),this.$navigate.find("."+r+"-navigate-next").css("margin-right",-(e/2+84)).show())},setTop:function(t){this.options.top=t,this.recalcVerticalPos(!1)},setBottom:function(t){this.options.bottom=t,this.recalcVerticalPos(!1)},setHeader:function(t){t?this.$element.find("."+r+"-header").show():(this.headerHeight=0,this.$element.find("."+r+"-header").hide())},setTitle:function(t){this.options.title=t,0===this.headerHeight&&this.createHeader(),0===this.$header.find("."+r+"-header-title").length&&this.$header.append('<h2 class="'+r+'-header-title"></h2>'),this.$header.find("."+r+"-header-title").html(t)},setSubtitle:function(t){""===t?(this.$header.find("."+r+"-header-subtitle").remove(),this.$header.addClass(r+"-noSubtitle")):(0===this.$header.find("."+r+"-header-subtitle").length&&this.$header.append('<p class="'+r+'-header-subtitle"></p>'),this.$header.removeClass(r+"-noSubtitle")),this.$header.find("."+r+"-header-subtitle").html(t),this.options.subtitle=t},setIcon:function(t){0===this.$header.find("."+r+"-header-icon").length&&this.$header.prepend('<i class="'+r+'-header-icon"></i>'),this.$header.find("."+r+"-header-icon").attr("class",r+"-header-icon "+t),this.options.icon=t},setIconText:function(t){this.$header.find("."+r+"-header-icon").html(t),this.options.iconText=t},setHeaderColor:function(t){this.options.borderBottom===!0&&this.$element.css("border-bottom","3px solid "+t),this.$header.css("background",t),this.options.headerColor=t},setBackground:function(t){t===!1?(this.options.background=null,this.$element.css("background","")):(this.$element.css("background",t),this.options.background=t)},setZindex:function(t){isNaN(parseInt(this.options.zindex))||(this.options.zindex=t,this.$element.css("z-index",t),this.$navigate.css("z-index",t-1),this.$overlay.css("z-index",t-2))},setFullscreen:function(t){t?(this.isFullscreen=!0,this.$element.addClass("isFullscreen")):(this.isFullscreen=!1,this.$element.removeClass("isFullscreen"))},setContent:function(t){if("object"==typeof t){var e=t["default"]||!1;e===!0&&(this.content=t.content),t=t.content}this.options.iframe===!1&&this.$element.find("."+r+"-content").html(t)},setTransitionIn:function(t){this.options.transitionIn=t},setTransitionOut:function(t){this.options.transitionOut=t},setTimeout:function(t){this.options.timeout=t},resetContent:function(){this.$element.find("."+r+"-content").html(this.content)},startLoading:function(){this.$element.find("."+r+"-loader").length||this.$element.append('<div class="'+r+'-loader fadeIn"></div>'),this.$element.find("."+r+"-loader").css({top:this.headerHeight,borderRadius:this.options.radius})},stopLoading:function(){var t=this.$element.find("."+r+"-loader");t.length||(this.$element.prepend('<div class="'+r+'-loader fadeIn"></div>'),t=this.$element.find("."+r+"-loader").css("border-radius",this.options.radius)),t.removeClass("fadeIn").addClass("fadeOut"),setTimeout(function(){t.remove()},600)},recalcWidth:function(){var t=this;if(this.$element.css("max-width",this.options.width),i()){var e=t.options.width;e.toString().split("%").length>1&&(e=t.$element.outerWidth()),t.$element.css({left:"50%",marginLeft:-(e/2)})}},recalcVerticalPos:function(t){null!==this.options.top&&this.options.top!==!1?(this.$element.css("margin-top",this.options.top),0===this.options.top&&this.$element.css({borderTopRightRadius:0,borderTopLeftRadius:0})):t===!1&&this.$element.css({marginTop:"",borderRadius:this.options.radius}),null!==this.options.bottom&&this.options.bottom!==!1?(this.$element.css("margin-bottom",this.options.bottom),0===this.options.bottom&&this.$element.css({borderBottomRightRadius:0,borderBottomLeftRadius:0})):t===!1&&this.$element.css({marginBottom:"",borderRadius:this.options.radius})},recalcLayout:function(){var e=this,o=s.height(),a=this.$element.outerHeight(),d=this.$element.outerWidth(),h=this.$element.find("."+r+"-content")[0].scrollHeight,c=h+this.headerHeight,u=this.$element.innerHeight()-this.headerHeight,p=(parseInt(-((this.$element.innerHeight()+1)/2))+"px",this.$wrap.scrollTop()),f=0;i()&&(d>=s.width()||this.isFullscreen===!0?this.$element.css({left:"0",marginLeft:""}):this.$element.css({left:"50%",marginLeft:-(d/2)})),this.options.borderBottom===!0&&""!==this.options.title&&(f=3),this.$element.find("."+r+"-header").length&&this.$element.find("."+r+"-header").is(":visible")?(this.headerHeight=parseInt(this.$element.find("."+r+"-header").innerHeight()),this.$element.css("overflow","hidden")):(this.headerHeight=0,this.$element.css("overflow","")),this.$element.find("."+r+"-loader").length&&this.$element.find("."+r+"-loader").css("top",this.headerHeight),a!==this.modalHeight&&(this.modalHeight=a,this.options.onResize&&"function"==typeof this.options.onResize&&this.options.onResize(this)),this.state!=l.OPENED&&this.state!=l.OPENING||(this.options.iframe===!0&&(o<this.options.iframeHeight+this.headerHeight+f||this.isFullscreen===!0?this.$element.find("."+r+"-iframe").css("height",o-(this.headerHeight+f)):this.$element.find("."+r+"-iframe").css("height",this.options.iframeHeight)),a==o?this.$element.addClass("isAttached"):this.$element.removeClass("isAttached"),this.isFullscreen===!1&&this.$element.width()>=s.width()?this.$element.find("."+r+"-button-fullscreen").hide():this.$element.find("."+r+"-button-fullscreen").show(),this.recalcButtons(),this.isFullscreen===!1&&(o=o-(n(this.options.top)||0)-(n(this.options.bottom)||0)),c>o?(this.options.top>0&&null===this.options.bottom&&h<s.height()&&this.$element.addClass("isAttachedBottom"),this.options.bottom>0&&null===this.options.top&&h<s.height()&&this.$element.addClass("isAttachedTop"),1===t("."+r+":visible").length&&t("html").addClass(r+"-isAttached"),this.$element.css("height",o)):(this.$element.css("height",h+(this.headerHeight+f)),this.$element.removeClass("isAttachedTop isAttachedBottom"),1===t("."+r+":visible").length&&t("html").removeClass(r+"-isAttached")),function(){h>u&&c>o?(e.$element.addClass("hasScroll"),e.$wrap.css("height",a-(e.headerHeight+f))):(e.$element.removeClass("hasScroll"),e.$wrap.css("height","auto"))}(),function(){u+p<h-30?e.$element.addClass("hasShadow"):e.$element.removeClass("hasShadow")}())},recalcButtons:function(){var t=this.$header.find("."+r+"-header-buttons").innerWidth()+10;this.options.rtl===!0?this.$header.css("padding-left",t):this.$header.css("padding-right",t)}},s.off("load."+r).on("load."+r,function(e){var i=document.location.hash;if(0===window.$iziModal.autoOpen&&!t("."+r).is(":visible"))try{var n=t(i).data();"undefined"!=typeof n&&n.iziModal.options.autoOpen!==!1&&t(i).iziModal("open")}catch(o){}}),s.off("hashchange."+r).on("hashchange."+r,function(e){var i=document.location.hash;if(""!==i)try{var n=t(i).data();"undefined"!=typeof n&&"opening"!==t(i).iziModal("getState")&&setTimeout(function(){t(i).iziModal("open",{preventClose:!1})},200)}catch(o){}else window.$iziModal.history&&t.each(t("."+r),function(e,i){if(void 0!==t(i).data().iziModal){var n=t(i).iziModal("getState");"opened"!=n&&"opening"!=n||t(i).iziModal("close")}})}),a.off("click","[data-"+r+"-open]").on("click","[data-"+r+"-open]",function(e){e.preventDefault();var i=t("."+r+":visible"),n=t(e.currentTarget).attr("data-"+r+"-open"),o=t(e.currentTarget).attr("data-"+r+"-preventClose"),s=t(e.currentTarget).attr("data-"+r+"-transitionIn"),a=t(e.currentTarget).attr("data-"+r+"-transitionOut"),l=t(e.currentTarget).attr("data-"+r+"-zindex");void 0!==l&&t(n).iziModal("setZindex",l),void 0===o&&(void 0!==a?i.iziModal("close",{transition:a}):i.iziModal("close")),setTimeout(function(){void 0!==s?t(n).iziModal("open",{transition:s}):t(n).iziModal("open")},200)}),a.off("keyup."+r).on("keyup."+r,function(e){if(t("."+r+":visible").length){var i=t("."+r+":visible")[0].id,n=t("#"+i).data().iziModal.options.arrowKeys,o=t("#"+i).iziModal("getGroup"),s=e||window.event,a=s.target||s.srcElement;void 0===i||!n||void 0===o.name||s.ctrlKey||s.metaKey||s.altKey||"INPUT"===a.tagName.toUpperCase()||"TEXTAREA"==a.tagName.toUpperCase()||(37===s.keyCode?t("#"+i).iziModal("prev",s):39===s.keyCode&&t("#"+i).iziModal("next",s))}}),t.fn[r]=function(e,i){if(!t(this).length&&"object"==typeof e){var n={$el:document.createElement("div"),id:this.selector.split("#"),"class":this.selector.split(".")};if(n.id.length>1){try{n.$el=document.createElement(id[0])}catch(o){}n.$el.id=this.selector.split("#")[1].trim()}else if(n["class"].length>1){try{n.$el=document.createElement(n["class"][0])}catch(o){}for(var s=1;s<n["class"].length;s++)n.$el.classList.add(n["class"][s].trim())}document.body.appendChild(n.$el),this.push(t(this.selector))}for(var a=this,l=0;l<a.length;l++){var d=t(a[l]),h=d.data(r),u=t.extend({},t.fn[r].defaults,d.data(),"object"==typeof e&&e);if(h||e&&"object"!=typeof e){if("string"==typeof e&&"undefined"!=typeof h)return h[e].apply(h,[].concat(i))}else d.data(r,h=new c(d,u));u.autoOpen&&(isNaN(parseInt(u.autoOpen))?u.autoOpen===!0&&h.open():setTimeout(function(){h.open()},u.autoOpen),window.$iziModal.autoOpen++)}return this},t.fn[r].defaults={title:"",subtitle:"",headerColor:"#88A0B9",background:null,theme:"",icon:null,iconText:null,iconColor:"",rtl:!1,width:600,top:null,bottom:null,borderBottom:!0,padding:0,radius:3,zindex:999,iframe:!1,iframeHeight:400,iframeURL:null,focusInput:!0,group:"",loop:!1,arrowKeys:!0,navigateCaption:!0,navigateArrows:!0,history:!1,restoreDefaultContent:!1,autoOpen:0,bodyOverflow:!1,fullscreen:!1,openFullscreen:!1,closeOnEscape:!0,closeButton:!0,appendTo:"body",appendToOverlay:"body",overlay:!0,overlayClose:!0,overlayColor:"rgba(0, 0, 0, 0.4)",timeout:!1,timeoutProgressbar:!1,pauseOnHover:!1,timeoutProgressbarColor:"rgba(255,255,255,0.5)",transitionIn:"comingIn",transitionOut:"comingOut",transitionInOverlay:"fadeIn",transitionOutOverlay:"fadeOut",onFullscreen:function(){},onResize:function(){},onOpening:function(){},onOpened:function(){},onClosing:function(){},onClosed:function(){},afterRender:function(){}},t.fn[r].Constructor=c,t.fn.iziModal}); assets/js/component.crawler.js 0000777 00000005664 15251157102 0012501 0 ustar 00 /** * Crawler simulation module * @author Hai Zheng */ class CrawlerSimulate extends React.Component { constructor(props) { super(props); this.state = { list: props.list, }; this.handleInputChange = this.handleInputChange.bind(this); this.delRow = this.delRow.bind(this); this.addNew = this.addNew.bind(this); } handleInputChange(e, index) { const target = e.target; const value = target.type === 'checkbox' ? target.checked : target.value; const list = this.state.list; list[index][target.dataset.type] = value; this.setState({ list: list, }); } delRow(index) { const data = this.state.list; data.splice(index, 1); this.setState({ list: data }); } addNew() { const list = this.state.list; list.push({ name: '', vals: '' }); this.setState({ list: list }); } render() { return ( <React.Fragment> {this.state.list.map((item, i) => ( <SimulationBlock item={item} key={i} index={i} handleInputChange={this.handleInputChange} delRow={this.delRow} /> ))} <p> <button type="button" className="button button-link litespeed-form-action litespeed-link-with-icon" onClick={this.addNew}> <span className="dashicons dashicons-plus-alt"></span> {litespeed_data['lang']['add_cookie_simulation_row']} </button> </p> </React.Fragment> ); } } // { name: '', vals: '' } class SimulationBlock extends React.Component { constructor(props) { super(props); this.handleInputChange = this.handleInputChange.bind(this); this.delRow = this.delRow.bind(this); } handleInputChange(e) { this.props.handleInputChange(e, this.props.index); } delRow() { this.props.delRow(this.props.index); } render() { const item = this.props.item; return ( <div className="litespeed-block"> <div className="litespeed-col-auto"> <label className="litespeed-form-label">{litespeed_data['lang']['cookie_name']}</label> <input type="text" name={litespeed_data['ids']['crawler_cookies'] + '[name][]'} className="regular-text" value={item.name} data-type="name" onChange={this.handleInputChange} /> </div> <div className="litespeed-col-auto"> <label className="litespeed-form-label">{litespeed_data['lang']['cookie_values']}</label> <textarea rows="5" cols="40" name={litespeed_data['ids']['crawler_cookies'] + '[vals][]'} placeholder={litespeed_data['lang']['one_per_line']} value={Array.isArray(item.vals) ? item.vals.join('\n') : item.vals} data-type="vals" onChange={this.handleInputChange} /> </div> <div className="litespeed-col-auto"> <button type="button" className="button button-link litespeed-collection-button litespeed-danger" onClick={this.delRow}> <span className="dashicons dashicons-dismiss"></span> <span className="screen-reader-text">{litespeed_data['lang']['remove_cookie_simulation']}</span> </button> </div> </div> ); } } assets/js/js_delay.min.js 0000777 00000003265 15251157102 0011410 0 ustar 00 window.litespeed_ui_events=window.litespeed_ui_events||["mouseover","click","keydown","wheel","touchmove","touchstart"];var urlCreator=window.URL||window.webkitURL;function litespeed_load_delayed_js_force(){console.log("[LiteSpeed] Start Load JS Delayed"),litespeed_ui_events.forEach(e=>{window.removeEventListener(e,litespeed_load_delayed_js_force,{passive:!0})}),document.querySelectorAll("iframe[data-litespeed-src]").forEach(e=>{e.setAttribute("src",e.getAttribute("data-litespeed-src"))}),"loading"==document.readyState?window.addEventListener("DOMContentLoaded",litespeed_load_delayed_js):litespeed_load_delayed_js()}litespeed_ui_events.forEach(e=>{window.addEventListener(e,litespeed_load_delayed_js_force,{passive:!0})});async function litespeed_load_delayed_js(){let t=[];for(var d in document.querySelectorAll('script[type="litespeed/javascript"]').forEach(e=>{t.push(e)}),t)await new Promise(e=>litespeed_load_one(t[d],e));document.dispatchEvent(new Event("DOMContentLiteSpeedLoaded")),window.dispatchEvent(new Event("DOMContentLiteSpeedLoaded"))}function litespeed_load_one(t,e){console.log("[LiteSpeed] Load ",t);var d=document.createElement("script");d.addEventListener("load",e),d.addEventListener("error",e),t.getAttributeNames().forEach(e=>{"type"!=e&&d.setAttribute("data-src"==e?"src":e,t.getAttribute(e))});let a=!(d.type="text/javascript");!d.src&&t.textContent&&(d.src=litespeed_inline2src(t.textContent),a=!0),t.after(d),t.remove(),a&&e()}function litespeed_inline2src(t){try{var d=urlCreator.createObjectURL(new Blob([t.replace(/^(?:<!--)?(.*?)(?:-->)?$/gm,"$1")],{type:"text/javascript"}))}catch(e){d="data:text/javascript;base64,"+btoa(t.replace(/^(?:<!--)?(.*?)(?:-->)?$/gm,"$1"))}return d} assets/js/css_async.min.js 0000777 00000002511 15251157102 0011574 0 ustar 00 !function(a){"use strict";var b=function(b,c,d){function e(a){return h.body?a():void setTimeout(function(){e(a)})}function f(){i.addEventListener&&i.removeEventListener("load",f),i.media=d||"all"}var g,h=a.document,i=h.createElement("link");if(c)g=c;else{var j=(h.body||h.getElementsByTagName("head")[0]).childNodes;g=j[j.length-1]}var k=h.styleSheets;i.rel="stylesheet",i.href=b,i.media="only x",e(function(){g.parentNode.insertBefore(i,c?g:g.nextSibling)});var l=function(a){for(var b=i.href,c=k.length;c--;)if(k[c].href===b)return a();setTimeout(function(){l(a)})};return i.addEventListener&&i.addEventListener("load",f),i.onloadcssdefined=l,l(f),i};"undefined"!=typeof exports?exports.loadCSS=b:a.loadCSS=b}("undefined"!=typeof global?global:this);!function(a){if(a.loadCSS){var b=loadCSS.relpreload={};if(b.support=function(){try{return a.document.createElement("link").relList.supports("preload")}catch(b){return!1}},b.poly=function(){for(var b=a.document.getElementsByTagName("link"),c=0;c<b.length;c++){var d=b[c];"preload"===d.rel&&"style"===d.getAttribute("as")&&(a.loadCSS(d.href,d,d.getAttribute("media")),d.rel=null)}},!b.support()){b.poly();var c=a.setInterval(b.poly,300);a.addEventListener&&a.addEventListener("load",function(){b.poly(),a.clearInterval(c)}),a.attachEvent&&a.attachEvent("onload",function(){a.clearInterval(c)})}}}(this); qc-ping.txt 0000777 00000000120 15251157102 0006642 0 ustar 00 For QUIC.cloud connectivity ping test, please do not delete, generated by LSCWP lib/html-min.cls.php 0000777 00000017744 15251157102 0010353 0 ustar 00 <?php // phpcs:ignoreFile /** * Compress HTML * * This is a heavy regex-based removal of whitespace, unnecessary comments and * tokens. IE conditional comments are preserved. There are also options to have * STYLE and SCRIPT blocks compressed by callback functions. * * A test suite is available. * * @package Minify * @author Stephen Clay <steve@mrclay.org> */ namespace LiteSpeed\Lib; defined( 'WPINC' ) || exit; class HTML_MIN { /** * @var string */ protected $_html = ''; /** * @var boolean */ protected $_jsCleanComments = true; protected $_skipComments = array(); /** * "Minify" an HTML page * * @param string $html * * @param array $options * * 'cssMinifier' : (optional) callback function to process content of STYLE * elements. * * 'jsMinifier' : (optional) callback function to process content of SCRIPT * elements. Note: the type attribute is ignored. * * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If * unset, minify will sniff for an XHTML doctype. * * @return string */ public static function minify( $html, $options = array() ) { $min = new self( $html, $options ); return $min->process(); } /** * Create a minifier object * * @param string $html * * @param array $options * * 'cssMinifier' : (optional) callback function to process content of STYLE * elements. * * 'jsMinifier' : (optional) callback function to process content of SCRIPT * elements. Note: the type attribute is ignored. * * 'jsCleanComments' : (optional) whether to remove HTML comments beginning and end of script block * * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If * unset, minify will sniff for an XHTML doctype. */ public function __construct( $html, $options = array() ) { $this->_html = str_replace( "\r\n", "\n", trim( $html ) ); if ( isset( $options['xhtml'] ) ) { $this->_isXhtml = (bool) $options['xhtml']; } if ( isset( $options['cssMinifier'] ) ) { $this->_cssMinifier = $options['cssMinifier']; } if ( isset( $options['jsMinifier'] ) ) { $this->_jsMinifier = $options['jsMinifier']; } if ( isset( $options['jsCleanComments'] ) ) { $this->_jsCleanComments = (bool) $options['jsCleanComments']; } if ( isset( $options['skipComments'] ) ) { $this->_skipComments = $options['skipComments']; } } /** * Minify the markeup given in the constructor * * @return string */ public function process() { if ( $this->_isXhtml === null ) { $this->_isXhtml = ( false !== strpos( $this->_html, '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML' ) ); } $this->_replacementHash = 'MINIFYHTML' . md5( $_SERVER['REQUEST_TIME'] ); $this->_placeholders = array(); // replace SCRIPTs (and minify) with placeholders $this->_html = preg_replace_callback( '/(\\s*)<script(\\b[^>]*?>)([\\s\\S]*?)<\\/script>(\\s*)/i', array( $this, '_removeScriptCB' ), $this->_html ); // replace STYLEs (and minify) with placeholders $this->_html = preg_replace_callback( '/\\s*<style(\\b[^>]*>)([\\s\\S]*?)<\\/style>\\s*/i', array( $this, '_removeStyleCB' ), $this->_html ); // remove HTML comments (not containing IE conditional comments). $this->_html = preg_replace_callback( '/<!--([\\s\\S]*?)-->/', array( $this, '_commentCB' ), $this->_html ); // replace PREs with placeholders $this->_html = preg_replace_callback( '/\\s*<pre(\\b[^>]*?>[\\s\\S]*?<\\/pre>)\\s*/i', array( $this, '_removePreCB' ), $this->_html ); // replace TEXTAREAs with placeholders $this->_html = preg_replace_callback( '/\\s*<textarea(\\b[^>]*?>[\\s\\S]*?<\\/textarea>)\\s*/i', array( $this, '_removeTextareaCB' ), $this->_html ); // trim each line. // @todo take into account attribute values that span multiple lines. $this->_html = preg_replace( '/^\\s+|\\s+$/m', '', $this->_html ); // remove ws around block/undisplayed elements $this->_html = preg_replace( '/\\s+(<\\/?(?:area|article|aside|base(?:font)?|blockquote|body' . '|canvas|caption|center|col(?:group)?|dd|dir|div|dl|dt|fieldset|figcaption|figure|footer|form' . '|frame(?:set)?|h[1-6]|head|header|hgroup|hr|html|legend|li|link|main|map|menu|meta|nav' . '|ol|opt(?:group|ion)|output|p|param|section|t(?:able|body|head|d|h||r|foot|itle)' . '|ul|video)\\b[^>]*>)/i', '$1', $this->_html ); // remove ws outside of all elements $this->_html = preg_replace( '/>(\\s(?:\\s*))?([^<]+)(\\s(?:\s*))?</', '>$1$2$3<', $this->_html ); // use newlines before 1st attribute in open tags (to limit line lengths) // $this->_html = preg_replace('/(<[a-z\\-]+)\\s+([^>]+>)/i', "$1\n$2", $this->_html); // fill placeholders $this->_html = str_replace( array_keys( $this->_placeholders ), array_values( $this->_placeholders ), $this->_html ); // issue 229: multi-pass to catch scripts that didn't get replaced in textareas $this->_html = str_replace( array_keys( $this->_placeholders ), array_values( $this->_placeholders ), $this->_html ); return $this->_html; } /** * From LSCWP 6.2: Changed the function to test for special comments that will be skipped. See: https://github.com/litespeedtech/lscache_wp/pull/622 */ protected function _commentCB( $m ) { // If is IE conditional comment return it. if ( 0 === strpos( $m[1], '[' ) || false !== strpos( $m[1], '<![' ) ) { return $m[0]; } // Check if comment text is present in Page Optimization -> HTML Settings -> HTML Keep comments if ( count( $this->_skipComments ) > 0 ) { foreach ( $this->_skipComments as $comment ) { if ( $comment && strpos( $m[1], $comment ) !== false ) { return $m[0]; } } } // Comment can be removed. return ''; } protected function _reservePlace( $content ) { $placeholder = '%' . $this->_replacementHash . count( $this->_placeholders ) . '%'; $this->_placeholders[ $placeholder ] = $content; return $placeholder; } protected $_isXhtml = null; protected $_replacementHash = null; protected $_placeholders = array(); protected $_cssMinifier = null; protected $_jsMinifier = null; protected function _removePreCB( $m ) { return $this->_reservePlace( "<pre{$m[1]}" ); } protected function _removeTextareaCB( $m ) { return $this->_reservePlace( "<textarea{$m[1]}" ); } protected function _removeStyleCB( $m ) { $openStyle = "<style{$m[1]}"; $css = $m[2]; // remove HTML comments $css = preg_replace( '/(?:^\\s*<!--|-->\\s*$)/', '', $css ); // remove CDATA section markers $css = $this->_removeCdata( $css ); // minify $minifier = $this->_cssMinifier ? $this->_cssMinifier : 'trim'; $css = call_user_func( $minifier, $css ); return $this->_reservePlace( $this->_needsCdata( $css ) ? "{$openStyle}/*<![CDATA[*/{$css}/*]]>*/</style>" : "{$openStyle}{$css}</style>" ); } protected function _removeScriptCB( $m ) { $openScript = "<script{$m[2]}"; $js = $m[3]; // whitespace surrounding? preserve at least one space $ws1 = ( $m[1] === '' ) ? '' : ' '; $ws2 = ( $m[4] === '' ) ? '' : ' '; // remove HTML comments (and ending "//" if present) if ( $this->_jsCleanComments ) { $js = preg_replace( '/(?:^\\s*<!--\\s*|\\s*(?:\\/\\/)?\\s*-->\\s*$)/', '', $js ); } // remove CDATA section markers $js = $this->_removeCdata( $js ); // minify /** * Added 2nd param by LiteSpeed * * @since 2.2.3 */ if ( $this->_jsMinifier ) { $js = call_user_func( $this->_jsMinifier, $js, trim( $m[2] ) ); } else { $js = trim( $js ); } return $this->_reservePlace( $this->_needsCdata( $js ) ? "{$ws1}{$openScript}/*<![CDATA[*/{$js}/*]]>*/</script>{$ws2}" : "{$ws1}{$openScript}{$js}</script>{$ws2}" ); } protected function _removeCdata( $str ) { return ( false !== strpos( $str, '<![CDATA[' ) ) ? str_replace( array( '<![CDATA[', ']]>' ), '', $str ) : $str; } protected function _needsCdata( $str ) { return ( $this->_isXhtml && preg_match( '/(?:[<&]|\\-\\-|\\]\\]>)/', $str ) ); } } lib/css_js_min/pathconverter/converter.cls.php 0000777 00000012600 15251157102 0015632 0 ustar 00 <?php // phpcs:ignoreFile /** * modified PHP implementation of Matthias Mullie's convert path class * Convert paths relative from 1 file to another. * * E.g. * ../../images/icon.jpg relative to /css/imports/icons.css * becomes * ../images/icon.jpg relative to /css/minified.css * * @author Matthias Mullie <pathconverter@mullie.eu> * @copyright Copyright (c) 2015, Matthias Mullie. All rights reserved * @license MIT License */ namespace LiteSpeed\Lib\CSS_JS_MIN\PathConverter; defined( 'WPINC' ) || exit; interface ConverterInterface { /** * Convert file paths. * * @param string $path The path to be converted * * @return string The new path */ public function convert( $path ); } class Converter implements ConverterInterface { /** * @var string */ protected $from; /** * @var string */ protected $to; /** * @param string $from The original base path (directory, not file!) * @param string $to The new base path (directory, not file!) * @param string $root Root directory (defaults to `getcwd`) */ public function __construct( $from, $to, $root = '' ) { $shared = $this->shared( $from, $to ); if ( $shared === '' ) { // when both paths have nothing in common, one of them is probably // absolute while the other is relative $root = $root ?: getcwd(); $from = strpos( $from, $root ) === 0 ? $from : preg_replace( '/\/+/', '/', $root . '/' . $from ); $to = strpos( $to, $root ) === 0 ? $to : preg_replace( '/\/+/', '/', $root . '/' . $to ); // or traveling the tree via `..` // attempt to resolve path, or assume it's fine if it doesn't exist $from = @realpath( $from ) ?: $from; $to = @realpath( $to ) ?: $to; } $from = $this->dirname( $from ); $to = $this->dirname( $to ); $from = $this->normalize( $from ); $to = $this->normalize( $to ); $this->from = $from; $this->to = $to; } /** * Normalize path. * * @param string $path * * @return string */ protected function normalize( $path ) { // deal with different operating systems' directory structure $path = rtrim( str_replace( DIRECTORY_SEPARATOR, '/', $path ), '/' ); // remove leading current directory. if ( substr( $path, 0, 2 ) === './' ) { $path = substr( $path, 2 ); } // remove references to current directory in the path. $path = str_replace( '/./', '/', $path ); /* * Example: * /home/forkcms/frontend/cache/compiled_templates/../../core/layout/css/../images/img.gif * to * /home/forkcms/frontend/core/layout/images/img.gif */ do { $path = preg_replace( '/[^\/]+(?<!\.\.)\/\.\.\//', '', $path, -1, $count ); } while ( $count ); return $path; } /** * Figure out the shared path of 2 locations. * * Example: * /home/forkcms/frontend/core/layout/images/img.gif * and * /home/forkcms/frontend/cache/minified_css * share * /home/forkcms/frontend * * @param string $path1 * @param string $path2 * * @return string */ protected function shared( $path1, $path2 ) { // $path could theoretically be empty (e.g. no path is given), in which // case it shouldn't expand to array(''), which would compare to one's // root / $path1 = $path1 ? explode( '/', $path1 ) : array(); $path2 = $path2 ? explode( '/', $path2 ) : array(); $shared = array(); // compare paths & strip identical ancestors foreach ( $path1 as $i => $chunk ) { if ( isset( $path2[ $i ] ) && $path1[ $i ] == $path2[ $i ] ) { $shared[] = $chunk; } else { break; } } return implode( '/', $shared ); } /** * Convert paths relative from 1 file to another. * * E.g. * ../images/img.gif relative to /home/forkcms/frontend/core/layout/css * should become: * ../../core/layout/images/img.gif relative to * /home/forkcms/frontend/cache/minified_css * * @param string $path The relative path that needs to be converted * * @return string The new relative path */ public function convert( $path ) { // quit early if conversion makes no sense if ( $this->from === $this->to ) { return $path; } $path = $this->normalize( $path ); // if we're not dealing with a relative path, just return absolute if ( strpos( $path, '/' ) === 0 ) { return $path; } // normalize paths $path = $this->normalize( $this->from . '/' . $path ); // strip shared ancestor paths $shared = $this->shared( $path, $this->to ); $path = mb_substr( $path, mb_strlen( $shared ) ); $to = mb_substr( $this->to, mb_strlen( $shared ) ); // add .. for every directory that needs to be traversed to new path $to = str_repeat( '../', count( array_filter( explode( '/', $to ) ) ) ); return $to . ltrim( $path, '/' ); } /** * Attempt to get the directory name from a path. * * @param string $path * * @return string */ protected function dirname( $path ) { if ( @is_file( $path ) ) { return dirname( $path ); } if ( @is_dir( $path ) ) { return rtrim( $path, '/' ); } // no known file/dir, start making assumptions // ends in / = dir if ( mb_substr( $path, -1 ) === '/' ) { return rtrim( $path, '/' ); } // has a dot in the name, likely a file if ( preg_match( '/.*\..*$/', basename( $path ) ) !== 0 ) { return dirname( $path ); } // you're on your own here! return $path; } } class NoConverter implements ConverterInterface { /** * {@inheritdoc} */ public function convert( $path ) { return $path; } } lib/css_js_min/pathconverter/LICENSE 0000777 00000002043 15251157102 0013337 0 ustar 00 Copyright (c) 2015 Matthias Mullie Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. lib/css_js_min/minify/css.cls.php 0000777 00000065145 15251157102 0013036 0 ustar 00 <?php // phpcs:ignoreFile /** * css.cls.php - modified PHP implementation of Matthias Mullie's CSS minifier * * @author Matthias Mullie <minify@mullie.eu> * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved * @license MIT License */ namespace LiteSpeed\Lib\CSS_JS_MIN\Minify; use LiteSpeed\Lib\CSS_JS_MIN\Minify\Minify; use LiteSpeed\Lib\CSS_JS_MIN\Minify\Exception\FileImportException; use LiteSpeed\Lib\CSS_JS_MIN\PathConverter\Converter; use LiteSpeed\Lib\CSS_JS_MIN\PathConverter\ConverterInterface; defined( 'WPINC' ) || exit; class CSS extends Minify { /** * @var int maximum import size in kB */ protected $maxImportSize = 5; /** * @var string[] valid import extensions */ protected $importExtensions = array( 'gif' => 'data:image/gif', 'png' => 'data:image/png', 'jpe' => 'data:image/jpeg', 'jpg' => 'data:image/jpeg', 'jpeg' => 'data:image/jpeg', 'svg' => 'data:image/svg+xml', 'woff' => 'data:application/x-font-woff', 'woff2' => 'data:application/x-font-woff2', 'avif' => 'data:image/avif', 'apng' => 'data:image/apng', 'webp' => 'data:image/webp', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'xbm' => 'image/x-xbitmap', ); /** * Set the maximum size if files to be imported. * * Files larger than this size (in kB) will not be imported into the CSS. * Importing files into the CSS as data-uri will save you some connections, * but we should only import relatively small decorative images so that our * CSS file doesn't get too bulky. * * @param int $size Size in kB */ public function setMaxImportSize( $size ) { $this->maxImportSize = $size; } /** * Set the type of extensions to be imported into the CSS (to save network * connections). * Keys of the array should be the file extensions & respective values * should be the data type. * * @param string[] $extensions Array of file extensions */ public function setImportExtensions( array $extensions ) { $this->importExtensions = $extensions; } /** * Move any import statements to the top. * * @param string $content Nearly finished CSS content * * @return string */ public function moveImportsToTop( $content ) { if ( preg_match_all( '/(;?)(@import (?<url>url\()?(?P<quotes>["\']?).+?(?P=quotes)(?(url)\)));?/', $content, $matches ) ) { // remove from content foreach ( $matches[0] as $import ) { $content = str_replace( $import, '', $content ); } // add to top $content = implode( ';', $matches[2] ) . ';' . trim( $content, ';' ); } return $content; } /** * Combine CSS from import statements. * * \@import's will be loaded and their content merged into the original file, * to save HTTP requests. * * @param string $source The file to combine imports for * @param string $content The CSS content to combine imports for * @param string[] $parents Parent paths, for circular reference checks * * @return string * * @throws FileImportException */ protected function combineImports( $source, $content, $parents ) { $importRegexes = array( // @import url(xxx) '/ # import statement @import # whitespace \s+ # open url() url\( # (optional) open path enclosure (?P<quotes>["\']?) # fetch path (?P<path>.+?) # (optional) close path enclosure (?P=quotes) # close url() \) # (optional) trailing whitespace \s* # (optional) media statement(s) (?P<media>[^;]*) # (optional) trailing whitespace \s* # (optional) closing semi-colon ;? /ix', // @import 'xxx' '/ # import statement @import # whitespace \s+ # open path enclosure (?P<quotes>["\']) # fetch path (?P<path>.+?) # close path enclosure (?P=quotes) # (optional) trailing whitespace \s* # (optional) media statement(s) (?P<media>[^;]*) # (optional) trailing whitespace \s* # (optional) closing semi-colon ;? /ix', ); // find all relative imports in css $matches = array(); foreach ( $importRegexes as $importRegex ) { if ( preg_match_all( $importRegex, $content, $regexMatches, PREG_SET_ORDER ) ) { $matches = array_merge( $matches, $regexMatches ); } } $search = array(); $replace = array(); // loop the matches foreach ( $matches as $match ) { // get the path for the file that will be imported $importPath = dirname( $source ) . '/' . $match['path']; // only replace the import with the content if we can grab the // content of the file if ( ! $this->canImportByPath( $match['path'] ) || ! $this->canImportFile( $importPath ) ) { continue; } // check if current file was not imported previously in the same // import chain. if ( in_array( $importPath, $parents ) ) { throw new FileImportException( 'Failed to import file "' . $importPath . '": circular reference detected.' ); } // grab referenced file & minify it (which may include importing // yet other @import statements recursively) $minifier = new self( $importPath ); $minifier->setMaxImportSize( $this->maxImportSize ); $minifier->setImportExtensions( $this->importExtensions ); $importContent = $minifier->execute( $source, $parents ); // check if this is only valid for certain media if ( ! empty( $match['media'] ) ) { $importContent = '@media ' . $match['media'] . '{' . $importContent . '}'; } // add to replacement array $search[] = $match[0]; $replace[] = $importContent; } // replace the import statements return str_replace( $search, $replace, $content ); } /** * Import files into the CSS, base64 encoded. * * Included images @url(image.jpg) will be loaded and their content merged into the * original file, to save HTTP requests. * * @param string $source The file to import files for * @param string $content The CSS content to import files for * * @return string */ protected function importFiles( $source, $content ) { $regex = '/url\((["\']?)(.+?)\\1\)/i'; if ( $this->importExtensions && preg_match_all( $regex, $content, $matches, PREG_SET_ORDER ) ) { $search = array(); $replace = array(); // loop the matches foreach ( $matches as $match ) { $extension = substr( strrchr( $match[2], '.' ), 1 ); if ( $extension && ! array_key_exists( $extension, $this->importExtensions ) ) { continue; } // get the path for the file that will be imported $path = $match[2]; $path = dirname( $source ) . '/' . $path; // only replace the import with the content if we're able to get // the content of the file, and it's relatively small if ( $this->canImportFile( $path ) && $this->canImportBySize( $path ) ) { // grab content && base64-ize $importContent = $this->load( $path ); $importContent = base64_encode( $importContent ); // build replacement $search[] = $match[0]; $replace[] = 'url(' . $this->importExtensions[ $extension ] . ';base64,' . $importContent . ')'; } } // replace the import statements $content = str_replace( $search, $replace, $content ); } return $content; } /** * Minify the data. * Perform CSS optimizations. * * @param string[optional] $path Path to write the data to * @param string[] $parents Parent paths, for circular reference checks * * @return string The minified data */ public function execute( $path = null, $parents = array() ) { $content = ''; // loop CSS data (raw data and files) foreach ( $this->data as $source => $css ) { /* * Let's first take out strings & comments, since we can't just * remove whitespace anywhere. If whitespace occurs inside a string, * we should leave it alone. E.g.: * p { content: "a test" } */ $this->extractStrings(); $this->stripComments(); $this->extractMath(); $this->extractCustomProperties(); $css = $this->replace( $css ); $css = $this->stripWhitespace( $css ); $css = $this->convertLegacyColors( $css ); $css = $this->cleanupModernColors( $css ); $css = $this->shortenHEXColors( $css ); $css = $this->shortenZeroes( $css ); $css = $this->shortenFontWeights( $css ); $css = $this->stripEmptyTags( $css ); // restore the string we've extracted earlier $css = $this->restoreExtractedData( $css ); $source = is_int( $source ) ? '' : $source; $parents = $source ? array_merge( $parents, array( $source ) ) : $parents; $css = $this->combineImports( $source, $css, $parents ); $css = $this->importFiles( $source, $css ); /* * If we'll save to a new path, we'll have to fix the relative paths * to be relative no longer to the source file, but to the new path. * If we don't write to a file, fall back to same path so no * conversion happens (because we still want it to go through most * of the move code, which also addresses url() & @import syntax...) */ $converter = $this->getPathConverter( $source, $path ?: $source ); $css = $this->move( $converter, $css ); // combine css $content .= $css; } $content = $this->moveImportsToTop( $content ); return $content; } /** * Moving a css file should update all relative urls. * Relative references (e.g. ../images/image.gif) in a certain css file, * will have to be updated when a file is being saved at another location * (e.g. ../../images/image.gif, if the new CSS file is 1 folder deeper). * * @param ConverterInterface $converter Relative path converter * @param string $content The CSS content to update relative urls for * * @return string */ protected function move( ConverterInterface $converter, $content ) { /* * Relative path references will usually be enclosed by url(). @import * is an exception, where url() is not necessary around the path (but is * allowed). * This *could* be 1 regular expression, where both regular expressions * in this array are on different sides of a |. But we're using named * patterns in both regexes, the same name on both regexes. This is only * possible with a (?J) modifier, but that only works after a fairly * recent PCRE version. That's why I'm doing 2 separate regular * expressions & combining the matches after executing of both. */ $relativeRegexes = array( // url(xxx) '/ # open url() url\( \s* # open path enclosure (?P<quotes>["\'])? # fetch path (?P<path>.+?) # close path enclosure (?(quotes)(?P=quotes)) \s* # close url() \) /ix', // @import "xxx" '/ # import statement @import # whitespace \s+ # we don\'t have to check for @import url(), because the # condition above will already catch these # open path enclosure (?P<quotes>["\']) # fetch path (?P<path>.+?) # close path enclosure (?P=quotes) /ix', ); // find all relative urls in css $matches = array(); foreach ( $relativeRegexes as $relativeRegex ) { if ( preg_match_all( $relativeRegex, $content, $regexMatches, PREG_SET_ORDER ) ) { $matches = array_merge( $matches, $regexMatches ); } } $search = array(); $replace = array(); // loop all urls foreach ( $matches as $match ) { // determine if it's a url() or an @import match $type = ( strpos( $match[0], '@import' ) === 0 ? 'import' : 'url' ); $url = $match['path']; if ( $this->canImportByPath( $url ) ) { // attempting to interpret GET-params makes no sense, so let's discard them for awhile $params = strrchr( $url, '?' ); $url = $params ? substr( $url, 0, -strlen( $params ) ) : $url; // fix relative url $url = $converter->convert( $url ); // now that the path has been converted, re-apply GET-params $url .= $params; } /* * Urls with control characters above 0x7e should be quoted. * According to Mozilla's parser, whitespace is only allowed at the * end of unquoted urls. * Urls with `)` (as could happen with data: uris) should also be * quoted to avoid being confused for the url() closing parentheses. * And urls with a # have also been reported to cause issues. * Urls with quotes inside should also remain escaped. * * @see https://developer.mozilla.org/nl/docs/Web/CSS/url#The_url()_functional_notation * @see https://hg.mozilla.org/mozilla-central/rev/14abca4e7378 * @see https://github.com/matthiasmullie/minify/issues/193 */ $url = trim( $url ); if ( preg_match( '/[\s\)\'"#\x{7f}-\x{9f}]/u', $url ) ) { $url = $match['quotes'] . $url . $match['quotes']; } // build replacement $search[] = $match[0]; if ( $type === 'url' ) { $replace[] = 'url(' . $url . ')'; } elseif ( $type === 'import' ) { $replace[] = '@import "' . $url . '"'; } } // replace urls return str_replace( $search, $replace, $content ); } /** * Shorthand HEX color codes. * #FF0000FF -> #f00 -> red * #FF00FF00 -> transparent. * * @param string $content The CSS content to shorten the HEX color codes for * * @return string */ protected function shortenHexColors( $content ) { // shorten repeating patterns within HEX .. $content = preg_replace( '/(?<=[: ])#([0-9a-f])\\1([0-9a-f])\\2([0-9a-f])\\3(?:([0-9a-f])\\4)?(?=[; }])/i', '#$1$2$3$4', $content ); // remove alpha channel if it's pointless .. $content = preg_replace( '/(?<=[: ])#([0-9a-f]{6})ff(?=[; }])/i', '#$1', $content ); $content = preg_replace( '/(?<=[: ])#([0-9a-f]{3})f(?=[; }])/i', '#$1', $content ); // replace `transparent` with shortcut .. $content = preg_replace( '/(?<=[: ])#[0-9a-f]{6}00(?=[; }])/i', '#fff0', $content ); $colors = array( // make these more readable '#00f' => 'blue', '#dc143c' => 'crimson', '#0ff' => 'cyan', '#8b0000' => 'darkred', '#696969' => 'dimgray', '#ff69b4' => 'hotpink', '#0f0' => 'lime', '#fdf5e6' => 'oldlace', '#87ceeb' => 'skyblue', '#d8bfd8' => 'thistle', // we can shorten some even more by replacing them with their color name '#f0ffff' => 'azure', '#f5f5dc' => 'beige', '#ffe4c4' => 'bisque', '#a52a2a' => 'brown', '#ff7f50' => 'coral', '#ffd700' => 'gold', '#808080' => 'gray', '#008000' => 'green', '#4b0082' => 'indigo', '#fffff0' => 'ivory', '#f0e68c' => 'khaki', '#faf0e6' => 'linen', '#800000' => 'maroon', '#000080' => 'navy', '#808000' => 'olive', '#ffa500' => 'orange', '#da70d6' => 'orchid', '#cd853f' => 'peru', '#ffc0cb' => 'pink', '#dda0dd' => 'plum', '#800080' => 'purple', '#f00' => 'red', '#fa8072' => 'salmon', '#a0522d' => 'sienna', '#c0c0c0' => 'silver', '#fffafa' => 'snow', '#d2b48c' => 'tan', '#008080' => 'teal', '#ff6347' => 'tomato', '#ee82ee' => 'violet', '#f5deb3' => 'wheat', // or the other way around 'black' => '#000', 'fuchsia' => '#f0f', 'magenta' => '#f0f', 'white' => '#fff', 'yellow' => '#ff0', // and also `transparent` 'transparent' => '#fff0', ); return preg_replace_callback( '/(?<=[: ])(' . implode( '|', array_keys( $colors ) ) . ')(?=[; }])/i', function ( $match ) use ( $colors ) { return $colors[ strtolower( $match[0] ) ]; }, $content ); } /** * Convert RGB|HSL color codes. * rgb(255,0,0,.5) -> rgb(255 0 0 / .5). * rgb(255,0,0) -> #f00. * * @param string $content The CSS content to shorten the RGB color codes for * * @return string */ protected function convertLegacyColors( $content ) { /* https://drafts.csswg.org/css-color/#color-syntax-legacy https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/hsl */ // convert legacy color syntax $content = preg_replace( '/(rgb)a?\(\s*([0-9]{1,3}%?)\s*,\s*([0-9]{1,3}%?)\s*,\s*([0-9]{1,3}%?)\s*,\s*([0,1]?(?:\.[0-9]*)?)\s*\)/i', '$1($2 $3 $4 / $5)', $content ); $content = preg_replace( '/(rgb)a?\(\s*([0-9]{1,3}%?)\s*,\s*([0-9]{1,3}%?)\s*,\s*([0-9]{1,3}%?)\s*\)/i', '$1($2 $3 $4)', $content ); $content = preg_replace( '/(hsl)a?\(\s*([0-9]+(?:deg|grad|rad|turn)?)\s*,\s*([0-9]{1,3}%)\s*,\s*([0-9]{1,3}%)\s*,\s*([0,1]?(?:\.[0-9]*)?)\s*\)/i', '$1($2 $3 $4 / $5)', $content ); $content = preg_replace( '/(hsl)a?\(\s*([0-9]+(?:deg|grad|rad|turn)?)\s*,\s*([0-9]{1,3}%)\s*,\s*([0-9]{1,3}%)\s*\)/i', '$1($2 $3 $4)', $content ); // convert `rgb` to `hex` $dec = '([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])'; return preg_replace_callback( "/rgb\($dec $dec $dec\)/i", function ( $match ) { return sprintf( '#%02x%02x%02x', $match[1], $match[2], $match[3] ); }, $content ); } /** * Cleanup RGB|HSL|HWB|LCH|LAB * rgb(255 0 0 / 1) -> rgb(255 0 0). * rgb(255 0 0 / 0) -> transparent. * * @param string $content The CSS content to cleanup HSL|HWB|LCH|LAB * * @return string */ protected function cleanupModernColors( $content ) { /* https://drafts.csswg.org/css-color/#color-syntax-modern https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/hwb https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/lch https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/lab https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/oklch https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/oklab */ $tag = '(rgb|hsl|hwb|(?:(?:ok)?(?:lch|lab)))'; // remove alpha channel if it's pointless .. $content = preg_replace( '/' . $tag . '\(\s*([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+\/\s+1(?:(?:\.\d?)*|00%)?\s*\)/i', '$1($2 $3 $4)', $content ); // replace `transparent` with shortcut .. $content = preg_replace( '/' . $tag . '\(\s*[^\s]+\s+[^\s]+\s+[^\s]+\s+\/\s+0(?:[\.0%]*)?\s*\)/i', '#fff0', $content ); return $content; } /** * Shorten CSS font weights. * * @param string $content The CSS content to shorten the font weights for * * @return string */ protected function shortenFontWeights( $content ) { $weights = array( 'normal' => 400, 'bold' => 700, ); $callback = function ( $match ) use ( $weights ) { return $match[1] . $weights[ $match[2] ]; }; return preg_replace_callback( '/(font-weight\s*:\s*)(' . implode( '|', array_keys( $weights ) ) . ')(?=[;}])/', $callback, $content ); } /** * Shorthand 0 values to plain 0, instead of e.g. -0em. * * @param string $content The CSS content to shorten the zero values for * * @return string */ protected function shortenZeroes( $content ) { // we don't want to strip units in `calc()` expressions: // `5px - 0px` is valid, but `5px - 0` is not // `10px * 0` is valid (equates to 0), and so is `10 * 0px`, but // `10 * 0` is invalid // we've extracted calcs earlier, so we don't need to worry about this // reusable bits of code throughout these regexes: // before & after are used to make sure we don't match lose unintended // 0-like values (e.g. in #000, or in http://url/1.0) // units can be stripped from 0 values, or used to recognize non 0 // values (where wa may be able to strip a .0 suffix) $before = '(?<=[:(, ])'; $after = '(?=[ ,);}])'; $units = '(em|ex|%|px|cm|mm|in|pt|pc|ch|rem|vh|vw|vmin|vmax|vm)'; // strip units after zeroes (0px -> 0) // NOTE: it should be safe to remove all units for a 0 value, but in // practice, Webkit (especially Safari) seems to stumble over at least // 0%, potentially other units as well. Only stripping 'px' for now. // @see https://github.com/matthiasmullie/minify/issues/60 $content = preg_replace( '/' . $before . '(-?0*(\.0+)?)(?<=0)px' . $after . '/', '\\1', $content ); // strip 0-digits (.0 -> 0) $content = preg_replace( '/' . $before . '\.0+' . $units . '?' . $after . '/', '0\\1', $content ); // strip trailing 0: 50.10 -> 50.1, 50.10px -> 50.1px $content = preg_replace( '/' . $before . '(-?[0-9]+\.[0-9]+)0+' . $units . '?' . $after . '/', '\\1\\2', $content ); // strip trailing 0: 50.00 -> 50, 50.00px -> 50px $content = preg_replace( '/' . $before . '(-?[0-9]+)\.0+' . $units . '?' . $after . '/', '\\1\\2', $content ); // strip leading 0: 0.1 -> .1, 01.1 -> 1.1 $content = preg_replace( '/' . $before . '(-?)0+([0-9]*\.[0-9]+)' . $units . '?' . $after . '/', '\\1\\2\\3', $content ); // strip negative zeroes (-0 -> 0) & truncate zeroes (00 -> 0) $content = preg_replace( '/' . $before . '-?0+' . $units . '?' . $after . '/', '0\\1', $content ); // IE doesn't seem to understand a unitless flex-basis value (correct - // it goes against the spec), so let's add it in again (make it `%`, // which is only 1 char: 0%, 0px, 0 anything, it's all just the same) // @see https://developer.mozilla.org/nl/docs/Web/CSS/flex $content = preg_replace( '/flex:([0-9]+\s[0-9]+\s)0([;\}])/', 'flex:${1}0%${2}', $content ); $content = preg_replace( '/flex-basis:0([;\}])/', 'flex-basis:0%${1}', $content ); return $content; } /** * Strip empty tags from source code. * * @param string $content * * @return string */ protected function stripEmptyTags( $content ) { $content = preg_replace( '/(?<=^)[^\{\};]+\{\s*\}/', '', $content ); $content = preg_replace( '/(?<=(\}|;))[^\{\};]+\{\s*\}/', '', $content ); return $content; } /** * Strip comments from source code. */ protected function stripComments() { $this->stripMultilineComments(); } /** * Strip whitespace. * * @param string $content The CSS content to strip the whitespace for * * @return string */ protected function stripWhitespace( $content ) { // remove leading & trailing whitespace $content = preg_replace( '/^\s*/m', '', $content ); $content = preg_replace( '/\s*$/m', '', $content ); // replace newlines with a single space $content = preg_replace( '/\s+/', ' ', $content ); // remove whitespace around meta characters // inspired by stackoverflow.com/questions/15195750/minify-compress-css-with-regex $content = preg_replace( '/\s*([\*$~^|]?+=|[{};,>~]|!important\b)\s*/', '$1', $content ); $content = preg_replace( '/([\[(:>\+])\s+/', '$1', $content ); $content = preg_replace( '/\s+([\]\)>\+])/', '$1', $content ); $content = preg_replace( '/\s+(:)(?![^\}]*\{)/', '$1', $content ); // whitespace around + and - can only be stripped inside some pseudo- // classes, like `:nth-child(3+2n)` // not in things like `calc(3px + 2px)`, shorthands like `3px -2px`, or // selectors like `div.weird- p` $pseudos = array( 'nth-child', 'nth-last-child', 'nth-last-of-type', 'nth-of-type' ); $content = preg_replace( '/:(' . implode( '|', $pseudos ) . ')\(\s*([+-]?)\s*(.+?)\s*([+-]?)\s*(.*?)\s*\)/', ':$1($2$3$4$5)', $content ); // remove semicolon/whitespace followed by closing bracket $content = str_replace( ';}', '}', $content ); return trim( $content ); } /** * Replace all occurrences of functions that may contain math, where * whitespace around operators needs to be preserved (e.g. calc, clamp). */ protected function extractMath() { $functions = array( 'calc', 'clamp', 'min', 'max' ); $pattern = '/\b(' . implode( '|', $functions ) . ')(\(.+?)(?=$|;|})/m'; // PHP only supports $this inside anonymous functions since 5.4 $minifier = $this; $callback = function ( $match ) use ( $minifier, $pattern, &$callback ) { $function = $match[1]; $length = strlen( $match[2] ); $expr = ''; $opened = 0; // the regular expression for extracting math has 1 significant problem: // it can't determine the correct closing parenthesis... // instead, it'll match a larger portion of code to where it's certain that // the calc() musts have ended, and we'll figure out which is the correct // closing parenthesis here, by counting how many have opened for ( $i = 0; $i < $length; ++$i ) { $char = $match[2][ $i ]; $expr .= $char; if ( $char === '(' ) { ++$opened; } elseif ( $char === ')' && --$opened === 0 ) { break; } } // now that we've figured out where the calc() starts and ends, extract it $count = count( $minifier->extracted ); $placeholder = 'math(' . $count . ')'; $minifier->extracted[ $placeholder ] = $function . '(' . trim( substr( $expr, 1, -1 ) ) . ')'; // and since we've captured more code than required, we may have some leftover // calc() in here too - go recursive on the remaining but of code to go figure // that out and extract what is needed $rest = $minifier->str_replace_first( $function . $expr, '', $match[0] ); $rest = preg_replace_callback( $pattern, $callback, $rest ); return $placeholder . $rest; }; $this->registerPattern( $pattern, $callback ); } /** * Replace custom properties, whose values may be used in scenarios where * we wouldn't want them to be minified (e.g. inside calc). */ protected function extractCustomProperties() { // PHP only supports $this inside anonymous functions since 5.4 $minifier = $this; $this->registerPattern( '/(?<=^|[;}{])\s*(--[^:;{}"\'\s]+)\s*:([^;{}]+)/m', function ( $match ) use ( $minifier ) { $placeholder = '--custom-' . count( $minifier->extracted ) . ':0'; $minifier->extracted[ $placeholder ] = $match[1] . ':' . trim( $match[2] ); return $placeholder; } ); } /** * Check if file is small enough to be imported. * * @param string $path The path to the file * * @return bool */ protected function canImportBySize( $path ) { return ( $size = @filesize( $path ) ) && $size <= $this->maxImportSize * 1024; } /** * Check if file a file can be imported, going by the path. * * @param string $path * * @return bool */ protected function canImportByPath( $path ) { return preg_match( '/^(data:|https?:|\\/)/', $path ) === 0; } /** * Return a converter to update relative paths to be relative to the new * destination. * * @param string $source * @param string $target * * @return ConverterInterface */ protected function getPathConverter( $source, $target ) { return new Converter( $source, $target ); } } lib/css_js_min/minify/data/js/operators_before.txt 0000777 00000000163 15251157102 0016370 0 ustar 00 + - * / % = += -= *= /= %= <<= >>= >>>= &= ^= |= & | ^ ~ << >> >>> == === != !== > < >= <= && || ! . [ ? : , ; ( { lib/css_js_min/minify/data/js/operators_after.txt 0000777 00000000162 15251157102 0016226 0 ustar 00 + - * / % = += -= *= /= %= <<= >>= >>>= &= ^= |= & | ^ << >> >>> == === != !== > < >= <= && || . [ ] ? : , ; ( ) } lib/css_js_min/minify/data/js/keywords_reserved.txt 0000777 00000000636 15251157102 0016603 0 ustar 00 do if in for let new try var case else enum eval null this true void with break catch class const false super throw while yield delete export import public return static switch typeof default extends finally package private continue debugger function arguments interface protected implements instanceof abstract boolean byte char double final float goto int long native short synchronized throws transient volatile lib/css_js_min/minify/data/js/keywords_before.txt 0000777 00000000247 15251157102 0016224 0 ustar 00 do in let new var case else enum void with class const yield delete export import public static typeof extends package private function protected implements instanceof lib/css_js_min/minify/data/js/keywords_after.txt 0000777 00000000071 15251157102 0016056 0 ustar 00 in public extends private protected implements instanceof lib/css_js_min/minify/data/js/operators.txt 0000777 00000000170 15251157102 0015044 0 ustar 00 + - * / % = += -= *= /= %= <<= >>= >>>= &= ^= |= & | ^ ~ << >> >>> == === != !== > < >= <= && || ! . [ ] ? : , ; ( ) { } lib/css_js_min/minify/minify.cls.php 0000777 00000035626 15251157102 0013542 0 ustar 00 <?php // phpcs:ignoreFile /** * modified PHP implementation of Matthias Mullie's Abstract minifier class. * * @author Matthias Mullie <minify@mullie.eu> * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved * @license MIT License */ namespace LiteSpeed\Lib\CSS_JS_MIN\Minify; use LiteSpeed\Lib\CSS_JS_MIN\Minify\Exception\IOException; defined( 'WPINC' ) || exit; abstract class Minify { /** * The data to be minified. * * @var string[] */ protected $data = array(); /** * Array of patterns to match. * * @var string[] */ protected $patterns = array(); /** * This array will hold content of strings and regular expressions that have * been extracted from the JS source code, so we can reliably match "code", * without having to worry about potential "code-like" characters inside. * * @internal * * @var string[] */ public $extracted = array(); /** * Init the minify class - optionally, code may be passed along already. */ public function __construct( /* $data = null, ... */ ) { // it's possible to add the source through the constructor as well ;) if ( func_num_args() ) { call_user_func_array( array( $this, 'add' ), func_get_args() ); } } /** * Add a file or straight-up code to be minified. * * @param string|string[] $data * * @return static */ public function add( $data /* $data = null, ... */ ) { // bogus "usage" of parameter $data: scrutinizer warns this variable is // not used (we're using func_get_args instead to support overloading), // but it still needs to be defined because it makes no sense to have // this function without argument :) $args = array( $data ) + func_get_args(); // this method can be overloaded foreach ( $args as $data ) { if ( is_array( $data ) ) { call_user_func_array( array( $this, 'add' ), $data ); continue; } // redefine var $data = (string) $data; // load data $value = $this->load( $data ); $key = ( $data != $value ) ? $data : count( $this->data ); // replace CR linefeeds etc. // @see https://github.com/matthiasmullie/minify/pull/139 $value = str_replace( array( "\r\n", "\r" ), "\n", $value ); // store data $this->data[ $key ] = $value; } return $this; } /** * Add a file to be minified. * * @param string|string[] $data * * @return static * * @throws IOException */ public function addFile( $data /* $data = null, ... */ ) { // bogus "usage" of parameter $data: scrutinizer warns this variable is // not used (we're using func_get_args instead to support overloading), // but it still needs to be defined because it makes no sense to have // this function without argument :) $args = array( $data ) + func_get_args(); // this method can be overloaded foreach ( $args as $path ) { if ( is_array( $path ) ) { call_user_func_array( array( $this, 'addFile' ), $path ); continue; } // redefine var $path = (string) $path; // check if we can read the file if ( ! $this->canImportFile( $path ) ) { throw new IOException( 'The file "' . $path . '" could not be opened for reading. Check if PHP has enough permissions.' ); } $this->add( $path ); } return $this; } /** * Minify the data & (optionally) saves it to a file. * * @param string[optional] $path Path to write the data to * * @return string The minified data */ public function minify( $path = null ) { $content = $this->execute( $path ); // save to path if ( $path !== null ) { $this->save( $content, $path ); } return $content; } /** * Minify & gzip the data & (optionally) saves it to a file. * * @param string[optional] $path Path to write the data to * @param int[optional] $level Compression level, from 0 to 9 * * @return string The minified & gzipped data */ public function gzip( $path = null, $level = 9 ) { $content = $this->execute( $path ); $content = gzencode( $content, $level, FORCE_GZIP ); // save to path if ( $path !== null ) { $this->save( $content, $path ); } return $content; } /** * Minify the data. * * @param string[optional] $path Path to write the data to * * @return string The minified data */ abstract public function execute( $path = null ); /** * Load data. * * @param string $data Either a path to a file or the content itself * * @return string */ protected function load( $data ) { // check if the data is a file if ( $this->canImportFile( $data ) ) { $data = file_get_contents( $data ); // strip BOM, if any if ( substr( $data, 0, 3 ) == "\xef\xbb\xbf" ) { $data = substr( $data, 3 ); } } return $data; } /** * Save to file. * * @param string $content The minified data * @param string $path The path to save the minified data to * * @throws IOException */ protected function save( $content, $path ) { $handler = $this->openFileForWriting( $path ); $this->writeToFile( $handler, $content ); @fclose( $handler ); } /** * Register a pattern to execute against the source content. * * If $replacement is a string, it must be plain text. Placeholders like $1 or \2 don't work. * If you need that functionality, use a callback instead. * * @param string $pattern PCRE pattern * @param string|callable $replacement Replacement value for matched pattern */ protected function registerPattern( $pattern, $replacement = '' ) { // study the pattern, we'll execute it more than once $pattern .= 'S'; $this->patterns[] = array( $pattern, $replacement ); } /** * Both JS and CSS use the same form of multi-line comment, so putting the common code here. */ protected function stripMultilineComments() { // First extract comments we want to keep, so they can be restored later // PHP only supports $this inside anonymous functions since 5.4 $minifier = $this; $callback = function ( $match ) use ( $minifier ) { $count = count( $minifier->extracted ); $placeholder = '/*' . $count . '*/'; $minifier->extracted[ $placeholder ] = $match[0]; return $placeholder; }; $this->registerPattern( '/ # optional newline \n? # start comment \/\* # comment content (?: # either starts with an ! ! | # or, after some number of characters which do not end the comment (?:(?!\*\/).)*? # there is either a @license or @preserve tag @(?:license|preserve) ) # then match to the end of the comment .*?\*\/\n? /ixs', $callback ); // Then strip all other comments $this->registerPattern( '/\/\*.*?\*\//s', '' ); } /** * We can't "just" run some regular expressions against JavaScript: it's a * complex language. E.g. having an occurrence of // xyz would be a comment, * unless it's used within a string. Of you could have something that looks * like a 'string', but inside a comment. * The only way to accurately replace these pieces is to traverse the JS one * character at a time and try to find whatever starts first. * * @param string $content The content to replace patterns in * * @return string The (manipulated) content */ protected function replace( $content ) { $contentLength = strlen( $content ); $output = ''; $processedOffset = 0; $positions = array_fill( 0, count( $this->patterns ), -1 ); $matches = array(); while ( $processedOffset < $contentLength ) { // find first match for all patterns foreach ( $this->patterns as $i => $pattern ) { list($pattern, $replacement) = $pattern; // we can safely ignore patterns for positions we've unset earlier, // because we know these won't show up anymore if ( array_key_exists( $i, $positions ) == false ) { continue; } // no need to re-run matches that are still in the part of the // content that hasn't been processed if ( $positions[ $i ] >= $processedOffset ) { continue; } $match = null; if ( preg_match( $pattern, $content, $match, PREG_OFFSET_CAPTURE, $processedOffset ) ) { $matches[ $i ] = $match; // we'll store the match position as well; that way, we // don't have to redo all preg_matches after changing only // the first (we'll still know where those others are) $positions[ $i ] = $match[0][1]; } else { // if the pattern couldn't be matched, there's no point in // executing it again in later runs on this same content; // ignore this one until we reach end of content unset( $matches[ $i ], $positions[ $i ] ); } } // no more matches to find: everything's been processed, break out if ( ! $matches ) { // output the remaining content $output .= substr( $content, $processedOffset ); break; } // see which of the patterns actually found the first thing (we'll // only want to execute that one, since we're unsure if what the // other found was not inside what the first found) $matchOffset = min( $positions ); $firstPattern = array_search( $matchOffset, $positions ); $match = $matches[ $firstPattern ]; // execute the pattern that matches earliest in the content string list(, $replacement) = $this->patterns[ $firstPattern ]; // add the part of the input between $processedOffset and the first match; // that content wasn't matched by anything $output .= substr( $content, $processedOffset, $matchOffset - $processedOffset ); // add the replacement for the match $output .= $this->executeReplacement( $replacement, $match ); // advance $processedOffset past the match $processedOffset = $matchOffset + strlen( $match[0][0] ); } return $output; } /** * If $replacement is a callback, execute it, passing in the match data. * If it's a string, just pass it through. * * @param string|callable $replacement Replacement value * @param array $match Match data, in PREG_OFFSET_CAPTURE form * * @return string */ protected function executeReplacement( $replacement, $match ) { if ( ! is_callable( $replacement ) ) { return $replacement; } // convert $match from the PREG_OFFSET_CAPTURE form to the form the callback expects foreach ( $match as &$matchItem ) { $matchItem = $matchItem[0]; } return $replacement( $match ); } /** * Strings are a pattern we need to match, in order to ignore potential * code-like content inside them, but we just want all of the string * content to remain untouched. * * This method will replace all string content with simple STRING# * placeholder text, so we've rid all strings from characters that may be * misinterpreted. Original string content will be saved in $this->extracted * and after doing all other minifying, we can restore the original content * via restoreStrings(). * * @param string[optional] $chars * @param string[optional] $placeholderPrefix */ protected function extractStrings( $chars = '\'"', $placeholderPrefix = '' ) { // PHP only supports $this inside anonymous functions since 5.4 $minifier = $this; $callback = function ( $match ) use ( $minifier, $placeholderPrefix ) { // check the second index here, because the first always contains a quote if ( $match[2] === '' ) { /* * Empty strings need no placeholder; they can't be confused for * anything else anyway. * But we still needed to match them, for the extraction routine * to skip over this particular string. */ return $match[0]; } $count = count( $minifier->extracted ); $placeholder = $match[1] . $placeholderPrefix . $count . $match[1]; $minifier->extracted[ $placeholder ] = $match[1] . $match[2] . $match[1]; return $placeholder; }; /* * The \\ messiness explained: * * Don't count ' or " as end-of-string if it's escaped (has backslash * in front of it) * * Unless... that backslash itself is escaped (another leading slash), * in which case it's no longer escaping the ' or " * * So there can be either no backslash, or an even number * * multiply all of that times 4, to account for the escaping that has * to be done to pass the backslash into the PHP string without it being * considered as escape-char (times 2) and to get it in the regex, * escaped (times 2) */ $this->registerPattern( '/([' . $chars . '])(.*?(?<!\\\\)(\\\\\\\\)*+)\\1/s', $callback ); } /** * This method will restore all extracted data (strings, regexes) that were * replaced with placeholder text in extract*(). The original content was * saved in $this->extracted. * * @param string $content * * @return string */ protected function restoreExtractedData( $content ) { if ( ! $this->extracted ) { // nothing was extracted, nothing to restore return $content; } $content = strtr( $content, $this->extracted ); $this->extracted = array(); return $content; } /** * Check if the path is a regular file and can be read. * * @param string $path * * @return bool */ protected function canImportFile( $path ) { $parsed = parse_url( $path ); if ( // file is elsewhere isset( $parsed['host'] ) // file responds to queries (may change, or need to bypass cache) || isset( $parsed['query'] ) ) { return false; } try { return strlen( $path ) < PHP_MAXPATHLEN && @is_file( $path ) && is_readable( $path ); } // catch openbasedir exceptions which are not caught by @ on is_file() catch ( \Exception $e ) { return false; } } /** * Attempts to open file specified by $path for writing. * * @param string $path The path to the file * * @return resource Specifier for the target file * * @throws IOException */ protected function openFileForWriting( $path ) { if ( $path === '' || ( $handler = @fopen( $path, 'w' ) ) === false ) { throw new IOException( 'The file "' . $path . '" could not be opened for writing. Check if PHP has enough permissions.' ); } return $handler; } /** * Attempts to write $content to the file specified by $handler. $path is used for printing exceptions. * * @param resource $handler The resource to write to * @param string $content The content to write * @param string $path The path to the file (for exception printing only) * * @throws IOException */ protected function writeToFile( $handler, $content, $path = '' ) { if ( ! is_resource( $handler ) || ( $result = @fwrite( $handler, $content ) ) === false || ( $result < strlen( $content ) ) ) { throw new IOException( 'The file "' . $path . '" could not be written to. Check your disk space and file permissions.' ); } } protected static function str_replace_first( $search, $replace, $subject ) { $pos = strpos( $subject, $search ); if ( $pos !== false ) { return substr_replace( $subject, $replace, $pos, strlen( $search ) ); } return $subject; } } lib/css_js_min/minify/LICENSE 0000777 00000002043 15251157102 0011746 0 ustar 00 Copyright (c) 2012 Matthias Mullie Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. lib/css_js_min/minify/js.cls.php 0000777 00000111322 15251157102 0012647 0 ustar 00 <?php // phpcs:ignoreFile /** * js.cls.php - modified PHP implementation of Matthias Mullie's JavaScript minifier * * @author Matthias Mullie <minify@mullie.eu> * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved * @license MIT License */ namespace LiteSpeed\Lib\CSS_JS_MIN\Minify; defined( 'WPINC' ) || exit; class JS extends Minify { /** * Var-matching regex based on http://stackoverflow.com/a/9337047/802993. * * Note that regular expressions using that bit must have the PCRE_UTF8 * pattern modifier (/u) set. * * @internal * * @var string */ const REGEX_VARIABLE = '\b[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\x{02c1}\x{02c6}-\x{02d1}\x{02e0}-\x{02e4}\x{02ec}\x{02ee}\x{0370}-\x{0374}\x{0376}\x{0377}\x{037a}-\x{037d}\x{0386}\x{0388}-\x{038a}\x{038c}\x{038e}-\x{03a1}\x{03a3}-\x{03f5}\x{03f7}-\x{0481}\x{048a}-\x{0527}\x{0531}-\x{0556}\x{0559}\x{0561}-\x{0587}\x{05d0}-\x{05ea}\x{05f0}-\x{05f2}\x{0620}-\x{064a}\x{066e}\x{066f}\x{0671}-\x{06d3}\x{06d5}\x{06e5}\x{06e6}\x{06ee}\x{06ef}\x{06fa}-\x{06fc}\x{06ff}\x{0710}\x{0712}-\x{072f}\x{074d}-\x{07a5}\x{07b1}\x{07ca}-\x{07ea}\x{07f4}\x{07f5}\x{07fa}\x{0800}-\x{0815}\x{081a}\x{0824}\x{0828}\x{0840}-\x{0858}\x{08a0}\x{08a2}-\x{08ac}\x{0904}-\x{0939}\x{093d}\x{0950}\x{0958}-\x{0961}\x{0971}-\x{0977}\x{0979}-\x{097f}\x{0985}-\x{098c}\x{098f}\x{0990}\x{0993}-\x{09a8}\x{09aa}-\x{09b0}\x{09b2}\x{09b6}-\x{09b9}\x{09bd}\x{09ce}\x{09dc}\x{09dd}\x{09df}-\x{09e1}\x{09f0}\x{09f1}\x{0a05}-\x{0a0a}\x{0a0f}\x{0a10}\x{0a13}-\x{0a28}\x{0a2a}-\x{0a30}\x{0a32}\x{0a33}\x{0a35}\x{0a36}\x{0a38}\x{0a39}\x{0a59}-\x{0a5c}\x{0a5e}\x{0a72}-\x{0a74}\x{0a85}-\x{0a8d}\x{0a8f}-\x{0a91}\x{0a93}-\x{0aa8}\x{0aaa}-\x{0ab0}\x{0ab2}\x{0ab3}\x{0ab5}-\x{0ab9}\x{0abd}\x{0ad0}\x{0ae0}\x{0ae1}\x{0b05}-\x{0b0c}\x{0b0f}\x{0b10}\x{0b13}-\x{0b28}\x{0b2a}-\x{0b30}\x{0b32}\x{0b33}\x{0b35}-\x{0b39}\x{0b3d}\x{0b5c}\x{0b5d}\x{0b5f}-\x{0b61}\x{0b71}\x{0b83}\x{0b85}-\x{0b8a}\x{0b8e}-\x{0b90}\x{0b92}-\x{0b95}\x{0b99}\x{0b9a}\x{0b9c}\x{0b9e}\x{0b9f}\x{0ba3}\x{0ba4}\x{0ba8}-\x{0baa}\x{0bae}-\x{0bb9}\x{0bd0}\x{0c05}-\x{0c0c}\x{0c0e}-\x{0c10}\x{0c12}-\x{0c28}\x{0c2a}-\x{0c33}\x{0c35}-\x{0c39}\x{0c3d}\x{0c58}\x{0c59}\x{0c60}\x{0c61}\x{0c85}-\x{0c8c}\x{0c8e}-\x{0c90}\x{0c92}-\x{0ca8}\x{0caa}-\x{0cb3}\x{0cb5}-\x{0cb9}\x{0cbd}\x{0cde}\x{0ce0}\x{0ce1}\x{0cf1}\x{0cf2}\x{0d05}-\x{0d0c}\x{0d0e}-\x{0d10}\x{0d12}-\x{0d3a}\x{0d3d}\x{0d4e}\x{0d60}\x{0d61}\x{0d7a}-\x{0d7f}\x{0d85}-\x{0d96}\x{0d9a}-\x{0db1}\x{0db3}-\x{0dbb}\x{0dbd}\x{0dc0}-\x{0dc6}\x{0e01}-\x{0e30}\x{0e32}\x{0e33}\x{0e40}-\x{0e46}\x{0e81}\x{0e82}\x{0e84}\x{0e87}\x{0e88}\x{0e8a}\x{0e8d}\x{0e94}-\x{0e97}\x{0e99}-\x{0e9f}\x{0ea1}-\x{0ea3}\x{0ea5}\x{0ea7}\x{0eaa}\x{0eab}\x{0ead}-\x{0eb0}\x{0eb2}\x{0eb3}\x{0ebd}\x{0ec0}-\x{0ec4}\x{0ec6}\x{0edc}-\x{0edf}\x{0f00}\x{0f40}-\x{0f47}\x{0f49}-\x{0f6c}\x{0f88}-\x{0f8c}\x{1000}-\x{102a}\x{103f}\x{1050}-\x{1055}\x{105a}-\x{105d}\x{1061}\x{1065}\x{1066}\x{106e}-\x{1070}\x{1075}-\x{1081}\x{108e}\x{10a0}-\x{10c5}\x{10c7}\x{10cd}\x{10d0}-\x{10fa}\x{10fc}-\x{1248}\x{124a}-\x{124d}\x{1250}-\x{1256}\x{1258}\x{125a}-\x{125d}\x{1260}-\x{1288}\x{128a}-\x{128d}\x{1290}-\x{12b0}\x{12b2}-\x{12b5}\x{12b8}-\x{12be}\x{12c0}\x{12c2}-\x{12c5}\x{12c8}-\x{12d6}\x{12d8}-\x{1310}\x{1312}-\x{1315}\x{1318}-\x{135a}\x{1380}-\x{138f}\x{13a0}-\x{13f4}\x{1401}-\x{166c}\x{166f}-\x{167f}\x{1681}-\x{169a}\x{16a0}-\x{16ea}\x{16ee}-\x{16f0}\x{1700}-\x{170c}\x{170e}-\x{1711}\x{1720}-\x{1731}\x{1740}-\x{1751}\x{1760}-\x{176c}\x{176e}-\x{1770}\x{1780}-\x{17b3}\x{17d7}\x{17dc}\x{1820}-\x{1877}\x{1880}-\x{18a8}\x{18aa}\x{18b0}-\x{18f5}\x{1900}-\x{191c}\x{1950}-\x{196d}\x{1970}-\x{1974}\x{1980}-\x{19ab}\x{19c1}-\x{19c7}\x{1a00}-\x{1a16}\x{1a20}-\x{1a54}\x{1aa7}\x{1b05}-\x{1b33}\x{1b45}-\x{1b4b}\x{1b83}-\x{1ba0}\x{1bae}\x{1baf}\x{1bba}-\x{1be5}\x{1c00}-\x{1c23}\x{1c4d}-\x{1c4f}\x{1c5a}-\x{1c7d}\x{1ce9}-\x{1cec}\x{1cee}-\x{1cf1}\x{1cf5}\x{1cf6}\x{1d00}-\x{1dbf}\x{1e00}-\x{1f15}\x{1f18}-\x{1f1d}\x{1f20}-\x{1f45}\x{1f48}-\x{1f4d}\x{1f50}-\x{1f57}\x{1f59}\x{1f5b}\x{1f5d}\x{1f5f}-\x{1f7d}\x{1f80}-\x{1fb4}\x{1fb6}-\x{1fbc}\x{1fbe}\x{1fc2}-\x{1fc4}\x{1fc6}-\x{1fcc}\x{1fd0}-\x{1fd3}\x{1fd6}-\x{1fdb}\x{1fe0}-\x{1fec}\x{1ff2}-\x{1ff4}\x{1ff6}-\x{1ffc}\x{2071}\x{207f}\x{2090}-\x{209c}\x{2102}\x{2107}\x{210a}-\x{2113}\x{2115}\x{2119}-\x{211d}\x{2124}\x{2126}\x{2128}\x{212a}-\x{212d}\x{212f}-\x{2139}\x{213c}-\x{213f}\x{2145}-\x{2149}\x{214e}\x{2160}-\x{2188}\x{2c00}-\x{2c2e}\x{2c30}-\x{2c5e}\x{2c60}-\x{2ce4}\x{2ceb}-\x{2cee}\x{2cf2}\x{2cf3}\x{2d00}-\x{2d25}\x{2d27}\x{2d2d}\x{2d30}-\x{2d67}\x{2d6f}\x{2d80}-\x{2d96}\x{2da0}-\x{2da6}\x{2da8}-\x{2dae}\x{2db0}-\x{2db6}\x{2db8}-\x{2dbe}\x{2dc0}-\x{2dc6}\x{2dc8}-\x{2dce}\x{2dd0}-\x{2dd6}\x{2dd8}-\x{2dde}\x{2e2f}\x{3005}-\x{3007}\x{3021}-\x{3029}\x{3031}-\x{3035}\x{3038}-\x{303c}\x{3041}-\x{3096}\x{309d}-\x{309f}\x{30a1}-\x{30fa}\x{30fc}-\x{30ff}\x{3105}-\x{312d}\x{3131}-\x{318e}\x{31a0}-\x{31ba}\x{31f0}-\x{31ff}\x{3400}-\x{4db5}\x{4e00}-\x{9fcc}\x{a000}-\x{a48c}\x{a4d0}-\x{a4fd}\x{a500}-\x{a60c}\x{a610}-\x{a61f}\x{a62a}\x{a62b}\x{a640}-\x{a66e}\x{a67f}-\x{a697}\x{a6a0}-\x{a6ef}\x{a717}-\x{a71f}\x{a722}-\x{a788}\x{a78b}-\x{a78e}\x{a790}-\x{a793}\x{a7a0}-\x{a7aa}\x{a7f8}-\x{a801}\x{a803}-\x{a805}\x{a807}-\x{a80a}\x{a80c}-\x{a822}\x{a840}-\x{a873}\x{a882}-\x{a8b3}\x{a8f2}-\x{a8f7}\x{a8fb}\x{a90a}-\x{a925}\x{a930}-\x{a946}\x{a960}-\x{a97c}\x{a984}-\x{a9b2}\x{a9cf}\x{aa00}-\x{aa28}\x{aa40}-\x{aa42}\x{aa44}-\x{aa4b}\x{aa60}-\x{aa76}\x{aa7a}\x{aa80}-\x{aaaf}\x{aab1}\x{aab5}\x{aab6}\x{aab9}-\x{aabd}\x{aac0}\x{aac2}\x{aadb}-\x{aadd}\x{aae0}-\x{aaea}\x{aaf2}-\x{aaf4}\x{ab01}-\x{ab06}\x{ab09}-\x{ab0e}\x{ab11}-\x{ab16}\x{ab20}-\x{ab26}\x{ab28}-\x{ab2e}\x{abc0}-\x{abe2}\x{ac00}-\x{d7a3}\x{d7b0}-\x{d7c6}\x{d7cb}-\x{d7fb}\x{f900}-\x{fa6d}\x{fa70}-\x{fad9}\x{fb00}-\x{fb06}\x{fb13}-\x{fb17}\x{fb1d}\x{fb1f}-\x{fb28}\x{fb2a}-\x{fb36}\x{fb38}-\x{fb3c}\x{fb3e}\x{fb40}\x{fb41}\x{fb43}\x{fb44}\x{fb46}-\x{fbb1}\x{fbd3}-\x{fd3d}\x{fd50}-\x{fd8f}\x{fd92}-\x{fdc7}\x{fdf0}-\x{fdfb}\x{fe70}-\x{fe74}\x{fe76}-\x{fefc}\x{ff21}-\x{ff3a}\x{ff41}-\x{ff5a}\x{ff66}-\x{ffbe}\x{ffc2}-\x{ffc7}\x{ffca}-\x{ffcf}\x{ffd2}-\x{ffd7}\x{ffda}-\x{ffdc}][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\x{02c1}\x{02c6}-\x{02d1}\x{02e0}-\x{02e4}\x{02ec}\x{02ee}\x{0370}-\x{0374}\x{0376}\x{0377}\x{037a}-\x{037d}\x{0386}\x{0388}-\x{038a}\x{038c}\x{038e}-\x{03a1}\x{03a3}-\x{03f5}\x{03f7}-\x{0481}\x{048a}-\x{0527}\x{0531}-\x{0556}\x{0559}\x{0561}-\x{0587}\x{05d0}-\x{05ea}\x{05f0}-\x{05f2}\x{0620}-\x{064a}\x{066e}\x{066f}\x{0671}-\x{06d3}\x{06d5}\x{06e5}\x{06e6}\x{06ee}\x{06ef}\x{06fa}-\x{06fc}\x{06ff}\x{0710}\x{0712}-\x{072f}\x{074d}-\x{07a5}\x{07b1}\x{07ca}-\x{07ea}\x{07f4}\x{07f5}\x{07fa}\x{0800}-\x{0815}\x{081a}\x{0824}\x{0828}\x{0840}-\x{0858}\x{08a0}\x{08a2}-\x{08ac}\x{0904}-\x{0939}\x{093d}\x{0950}\x{0958}-\x{0961}\x{0971}-\x{0977}\x{0979}-\x{097f}\x{0985}-\x{098c}\x{098f}\x{0990}\x{0993}-\x{09a8}\x{09aa}-\x{09b0}\x{09b2}\x{09b6}-\x{09b9}\x{09bd}\x{09ce}\x{09dc}\x{09dd}\x{09df}-\x{09e1}\x{09f0}\x{09f1}\x{0a05}-\x{0a0a}\x{0a0f}\x{0a10}\x{0a13}-\x{0a28}\x{0a2a}-\x{0a30}\x{0a32}\x{0a33}\x{0a35}\x{0a36}\x{0a38}\x{0a39}\x{0a59}-\x{0a5c}\x{0a5e}\x{0a72}-\x{0a74}\x{0a85}-\x{0a8d}\x{0a8f}-\x{0a91}\x{0a93}-\x{0aa8}\x{0aaa}-\x{0ab0}\x{0ab2}\x{0ab3}\x{0ab5}-\x{0ab9}\x{0abd}\x{0ad0}\x{0ae0}\x{0ae1}\x{0b05}-\x{0b0c}\x{0b0f}\x{0b10}\x{0b13}-\x{0b28}\x{0b2a}-\x{0b30}\x{0b32}\x{0b33}\x{0b35}-\x{0b39}\x{0b3d}\x{0b5c}\x{0b5d}\x{0b5f}-\x{0b61}\x{0b71}\x{0b83}\x{0b85}-\x{0b8a}\x{0b8e}-\x{0b90}\x{0b92}-\x{0b95}\x{0b99}\x{0b9a}\x{0b9c}\x{0b9e}\x{0b9f}\x{0ba3}\x{0ba4}\x{0ba8}-\x{0baa}\x{0bae}-\x{0bb9}\x{0bd0}\x{0c05}-\x{0c0c}\x{0c0e}-\x{0c10}\x{0c12}-\x{0c28}\x{0c2a}-\x{0c33}\x{0c35}-\x{0c39}\x{0c3d}\x{0c58}\x{0c59}\x{0c60}\x{0c61}\x{0c85}-\x{0c8c}\x{0c8e}-\x{0c90}\x{0c92}-\x{0ca8}\x{0caa}-\x{0cb3}\x{0cb5}-\x{0cb9}\x{0cbd}\x{0cde}\x{0ce0}\x{0ce1}\x{0cf1}\x{0cf2}\x{0d05}-\x{0d0c}\x{0d0e}-\x{0d10}\x{0d12}-\x{0d3a}\x{0d3d}\x{0d4e}\x{0d60}\x{0d61}\x{0d7a}-\x{0d7f}\x{0d85}-\x{0d96}\x{0d9a}-\x{0db1}\x{0db3}-\x{0dbb}\x{0dbd}\x{0dc0}-\x{0dc6}\x{0e01}-\x{0e30}\x{0e32}\x{0e33}\x{0e40}-\x{0e46}\x{0e81}\x{0e82}\x{0e84}\x{0e87}\x{0e88}\x{0e8a}\x{0e8d}\x{0e94}-\x{0e97}\x{0e99}-\x{0e9f}\x{0ea1}-\x{0ea3}\x{0ea5}\x{0ea7}\x{0eaa}\x{0eab}\x{0ead}-\x{0eb0}\x{0eb2}\x{0eb3}\x{0ebd}\x{0ec0}-\x{0ec4}\x{0ec6}\x{0edc}-\x{0edf}\x{0f00}\x{0f40}-\x{0f47}\x{0f49}-\x{0f6c}\x{0f88}-\x{0f8c}\x{1000}-\x{102a}\x{103f}\x{1050}-\x{1055}\x{105a}-\x{105d}\x{1061}\x{1065}\x{1066}\x{106e}-\x{1070}\x{1075}-\x{1081}\x{108e}\x{10a0}-\x{10c5}\x{10c7}\x{10cd}\x{10d0}-\x{10fa}\x{10fc}-\x{1248}\x{124a}-\x{124d}\x{1250}-\x{1256}\x{1258}\x{125a}-\x{125d}\x{1260}-\x{1288}\x{128a}-\x{128d}\x{1290}-\x{12b0}\x{12b2}-\x{12b5}\x{12b8}-\x{12be}\x{12c0}\x{12c2}-\x{12c5}\x{12c8}-\x{12d6}\x{12d8}-\x{1310}\x{1312}-\x{1315}\x{1318}-\x{135a}\x{1380}-\x{138f}\x{13a0}-\x{13f4}\x{1401}-\x{166c}\x{166f}-\x{167f}\x{1681}-\x{169a}\x{16a0}-\x{16ea}\x{16ee}-\x{16f0}\x{1700}-\x{170c}\x{170e}-\x{1711}\x{1720}-\x{1731}\x{1740}-\x{1751}\x{1760}-\x{176c}\x{176e}-\x{1770}\x{1780}-\x{17b3}\x{17d7}\x{17dc}\x{1820}-\x{1877}\x{1880}-\x{18a8}\x{18aa}\x{18b0}-\x{18f5}\x{1900}-\x{191c}\x{1950}-\x{196d}\x{1970}-\x{1974}\x{1980}-\x{19ab}\x{19c1}-\x{19c7}\x{1a00}-\x{1a16}\x{1a20}-\x{1a54}\x{1aa7}\x{1b05}-\x{1b33}\x{1b45}-\x{1b4b}\x{1b83}-\x{1ba0}\x{1bae}\x{1baf}\x{1bba}-\x{1be5}\x{1c00}-\x{1c23}\x{1c4d}-\x{1c4f}\x{1c5a}-\x{1c7d}\x{1ce9}-\x{1cec}\x{1cee}-\x{1cf1}\x{1cf5}\x{1cf6}\x{1d00}-\x{1dbf}\x{1e00}-\x{1f15}\x{1f18}-\x{1f1d}\x{1f20}-\x{1f45}\x{1f48}-\x{1f4d}\x{1f50}-\x{1f57}\x{1f59}\x{1f5b}\x{1f5d}\x{1f5f}-\x{1f7d}\x{1f80}-\x{1fb4}\x{1fb6}-\x{1fbc}\x{1fbe}\x{1fc2}-\x{1fc4}\x{1fc6}-\x{1fcc}\x{1fd0}-\x{1fd3}\x{1fd6}-\x{1fdb}\x{1fe0}-\x{1fec}\x{1ff2}-\x{1ff4}\x{1ff6}-\x{1ffc}\x{2071}\x{207f}\x{2090}-\x{209c}\x{2102}\x{2107}\x{210a}-\x{2113}\x{2115}\x{2119}-\x{211d}\x{2124}\x{2126}\x{2128}\x{212a}-\x{212d}\x{212f}-\x{2139}\x{213c}-\x{213f}\x{2145}-\x{2149}\x{214e}\x{2160}-\x{2188}\x{2c00}-\x{2c2e}\x{2c30}-\x{2c5e}\x{2c60}-\x{2ce4}\x{2ceb}-\x{2cee}\x{2cf2}\x{2cf3}\x{2d00}-\x{2d25}\x{2d27}\x{2d2d}\x{2d30}-\x{2d67}\x{2d6f}\x{2d80}-\x{2d96}\x{2da0}-\x{2da6}\x{2da8}-\x{2dae}\x{2db0}-\x{2db6}\x{2db8}-\x{2dbe}\x{2dc0}-\x{2dc6}\x{2dc8}-\x{2dce}\x{2dd0}-\x{2dd6}\x{2dd8}-\x{2dde}\x{2e2f}\x{3005}-\x{3007}\x{3021}-\x{3029}\x{3031}-\x{3035}\x{3038}-\x{303c}\x{3041}-\x{3096}\x{309d}-\x{309f}\x{30a1}-\x{30fa}\x{30fc}-\x{30ff}\x{3105}-\x{312d}\x{3131}-\x{318e}\x{31a0}-\x{31ba}\x{31f0}-\x{31ff}\x{3400}-\x{4db5}\x{4e00}-\x{9fcc}\x{a000}-\x{a48c}\x{a4d0}-\x{a4fd}\x{a500}-\x{a60c}\x{a610}-\x{a61f}\x{a62a}\x{a62b}\x{a640}-\x{a66e}\x{a67f}-\x{a697}\x{a6a0}-\x{a6ef}\x{a717}-\x{a71f}\x{a722}-\x{a788}\x{a78b}-\x{a78e}\x{a790}-\x{a793}\x{a7a0}-\x{a7aa}\x{a7f8}-\x{a801}\x{a803}-\x{a805}\x{a807}-\x{a80a}\x{a80c}-\x{a822}\x{a840}-\x{a873}\x{a882}-\x{a8b3}\x{a8f2}-\x{a8f7}\x{a8fb}\x{a90a}-\x{a925}\x{a930}-\x{a946}\x{a960}-\x{a97c}\x{a984}-\x{a9b2}\x{a9cf}\x{aa00}-\x{aa28}\x{aa40}-\x{aa42}\x{aa44}-\x{aa4b}\x{aa60}-\x{aa76}\x{aa7a}\x{aa80}-\x{aaaf}\x{aab1}\x{aab5}\x{aab6}\x{aab9}-\x{aabd}\x{aac0}\x{aac2}\x{aadb}-\x{aadd}\x{aae0}-\x{aaea}\x{aaf2}-\x{aaf4}\x{ab01}-\x{ab06}\x{ab09}-\x{ab0e}\x{ab11}-\x{ab16}\x{ab20}-\x{ab26}\x{ab28}-\x{ab2e}\x{abc0}-\x{abe2}\x{ac00}-\x{d7a3}\x{d7b0}-\x{d7c6}\x{d7cb}-\x{d7fb}\x{f900}-\x{fa6d}\x{fa70}-\x{fad9}\x{fb00}-\x{fb06}\x{fb13}-\x{fb17}\x{fb1d}\x{fb1f}-\x{fb28}\x{fb2a}-\x{fb36}\x{fb38}-\x{fb3c}\x{fb3e}\x{fb40}\x{fb41}\x{fb43}\x{fb44}\x{fb46}-\x{fbb1}\x{fbd3}-\x{fd3d}\x{fd50}-\x{fd8f}\x{fd92}-\x{fdc7}\x{fdf0}-\x{fdfb}\x{fe70}-\x{fe74}\x{fe76}-\x{fefc}\x{ff21}-\x{ff3a}\x{ff41}-\x{ff5a}\x{ff66}-\x{ffbe}\x{ffc2}-\x{ffc7}\x{ffca}-\x{ffcf}\x{ffd2}-\x{ffd7}\x{ffda}-\x{ffdc}0-9\x{0300}-\x{036f}\x{0483}-\x{0487}\x{0591}-\x{05bd}\x{05bf}\x{05c1}\x{05c2}\x{05c4}\x{05c5}\x{05c7}\x{0610}-\x{061a}\x{064b}-\x{0669}\x{0670}\x{06d6}-\x{06dc}\x{06df}-\x{06e4}\x{06e7}\x{06e8}\x{06ea}-\x{06ed}\x{06f0}-\x{06f9}\x{0711}\x{0730}-\x{074a}\x{07a6}-\x{07b0}\x{07c0}-\x{07c9}\x{07eb}-\x{07f3}\x{0816}-\x{0819}\x{081b}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082d}\x{0859}-\x{085b}\x{08e4}-\x{08fe}\x{0900}-\x{0903}\x{093a}-\x{093c}\x{093e}-\x{094f}\x{0951}-\x{0957}\x{0962}\x{0963}\x{0966}-\x{096f}\x{0981}-\x{0983}\x{09bc}\x{09be}-\x{09c4}\x{09c7}\x{09c8}\x{09cb}-\x{09cd}\x{09d7}\x{09e2}\x{09e3}\x{09e6}-\x{09ef}\x{0a01}-\x{0a03}\x{0a3c}\x{0a3e}-\x{0a42}\x{0a47}\x{0a48}\x{0a4b}-\x{0a4d}\x{0a51}\x{0a66}-\x{0a71}\x{0a75}\x{0a81}-\x{0a83}\x{0abc}\x{0abe}-\x{0ac5}\x{0ac7}-\x{0ac9}\x{0acb}-\x{0acd}\x{0ae2}\x{0ae3}\x{0ae6}-\x{0aef}\x{0b01}-\x{0b03}\x{0b3c}\x{0b3e}-\x{0b44}\x{0b47}\x{0b48}\x{0b4b}-\x{0b4d}\x{0b56}\x{0b57}\x{0b62}\x{0b63}\x{0b66}-\x{0b6f}\x{0b82}\x{0bbe}-\x{0bc2}\x{0bc6}-\x{0bc8}\x{0bca}-\x{0bcd}\x{0bd7}\x{0be6}-\x{0bef}\x{0c01}-\x{0c03}\x{0c3e}-\x{0c44}\x{0c46}-\x{0c48}\x{0c4a}-\x{0c4d}\x{0c55}\x{0c56}\x{0c62}\x{0c63}\x{0c66}-\x{0c6f}\x{0c82}\x{0c83}\x{0cbc}\x{0cbe}-\x{0cc4}\x{0cc6}-\x{0cc8}\x{0cca}-\x{0ccd}\x{0cd5}\x{0cd6}\x{0ce2}\x{0ce3}\x{0ce6}-\x{0cef}\x{0d02}\x{0d03}\x{0d3e}-\x{0d44}\x{0d46}-\x{0d48}\x{0d4a}-\x{0d4d}\x{0d57}\x{0d62}\x{0d63}\x{0d66}-\x{0d6f}\x{0d82}\x{0d83}\x{0dca}\x{0dcf}-\x{0dd4}\x{0dd6}\x{0dd8}-\x{0ddf}\x{0df2}\x{0df3}\x{0e31}\x{0e34}-\x{0e3a}\x{0e47}-\x{0e4e}\x{0e50}-\x{0e59}\x{0eb1}\x{0eb4}-\x{0eb9}\x{0ebb}\x{0ebc}\x{0ec8}-\x{0ecd}\x{0ed0}-\x{0ed9}\x{0f18}\x{0f19}\x{0f20}-\x{0f29}\x{0f35}\x{0f37}\x{0f39}\x{0f3e}\x{0f3f}\x{0f71}-\x{0f84}\x{0f86}\x{0f87}\x{0f8d}-\x{0f97}\x{0f99}-\x{0fbc}\x{0fc6}\x{102b}-\x{103e}\x{1040}-\x{1049}\x{1056}-\x{1059}\x{105e}-\x{1060}\x{1062}-\x{1064}\x{1067}-\x{106d}\x{1071}-\x{1074}\x{1082}-\x{108d}\x{108f}-\x{109d}\x{135d}-\x{135f}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}\x{1753}\x{1772}\x{1773}\x{17b4}-\x{17d3}\x{17dd}\x{17e0}-\x{17e9}\x{180b}-\x{180d}\x{1810}-\x{1819}\x{18a9}\x{1920}-\x{192b}\x{1930}-\x{193b}\x{1946}-\x{194f}\x{19b0}-\x{19c0}\x{19c8}\x{19c9}\x{19d0}-\x{19d9}\x{1a17}-\x{1a1b}\x{1a55}-\x{1a5e}\x{1a60}-\x{1a7c}\x{1a7f}-\x{1a89}\x{1a90}-\x{1a99}\x{1b00}-\x{1b04}\x{1b34}-\x{1b44}\x{1b50}-\x{1b59}\x{1b6b}-\x{1b73}\x{1b80}-\x{1b82}\x{1ba1}-\x{1bad}\x{1bb0}-\x{1bb9}\x{1be6}-\x{1bf3}\x{1c24}-\x{1c37}\x{1c40}-\x{1c49}\x{1c50}-\x{1c59}\x{1cd0}-\x{1cd2}\x{1cd4}-\x{1ce8}\x{1ced}\x{1cf2}-\x{1cf4}\x{1dc0}-\x{1de6}\x{1dfc}-\x{1dff}\x{200c}\x{200d}\x{203f}\x{2040}\x{2054}\x{20d0}-\x{20dc}\x{20e1}\x{20e5}-\x{20f0}\x{2cef}-\x{2cf1}\x{2d7f}\x{2de0}-\x{2dff}\x{302a}-\x{302f}\x{3099}\x{309a}\x{a620}-\x{a629}\x{a66f}\x{a674}-\x{a67d}\x{a69f}\x{a6f0}\x{a6f1}\x{a802}\x{a806}\x{a80b}\x{a823}-\x{a827}\x{a880}\x{a881}\x{a8b4}-\x{a8c4}\x{a8d0}-\x{a8d9}\x{a8e0}-\x{a8f1}\x{a900}-\x{a909}\x{a926}-\x{a92d}\x{a947}-\x{a953}\x{a980}-\x{a983}\x{a9b3}-\x{a9c0}\x{a9d0}-\x{a9d9}\x{aa29}-\x{aa36}\x{aa43}\x{aa4c}\x{aa4d}\x{aa50}-\x{aa59}\x{aa7b}\x{aab0}\x{aab2}-\x{aab4}\x{aab7}\x{aab8}\x{aabe}\x{aabf}\x{aac1}\x{aaeb}-\x{aaef}\x{aaf5}\x{aaf6}\x{abe3}-\x{abea}\x{abec}\x{abed}\x{abf0}-\x{abf9}\x{fb1e}\x{fe00}-\x{fe0f}\x{fe20}-\x{fe26}\x{fe33}\x{fe34}\x{fe4d}-\x{fe4f}\x{ff10}-\x{ff19}\x{ff3f}]*\b'; /** * Full list of JavaScript reserved words. * Will be loaded from /data/js/keywords_reserved.txt. * * @see https://mathiasbynens.be/notes/reserved-keywords * * @var string[] */ protected $keywordsReserved = array(); /** * List of JavaScript reserved words that accept a <variable, value, ...> * after them. Some end of lines are not the end of a statement, like with * these keywords. * * E.g.: we shouldn't insert a ; after this else * else * console.log('this is quite fine') * * Will be loaded from /data/js/keywords_before.txt * * @var string[] */ protected $keywordsBefore = array(); /** * List of JavaScript reserved words that accept a <variable, value, ...> * before them. Some end of lines are not the end of a statement, like when * continued by one of these keywords on the newline. * * E.g.: we shouldn't insert a ; before this instanceof * variable * instanceof String * * Will be loaded from /data/js/keywords_after.txt * * @var string[] */ protected $keywordsAfter = array(); /** * List of all JavaScript operators. * * Will be loaded from /data/js/operators.txt * * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators * * @var string[] */ protected $operators = array(); /** * List of JavaScript operators that accept a <variable, value, ...> after * them. Some end of lines are not the end of a statement, like with these * operators. * * Note: Most operators are fine, we've only removed ++ and --. * ++ & -- have to be joined with the value they're in-/decrementing. * * Will be loaded from /data/js/operators_before.txt * * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators * * @var string[] */ protected $operatorsBefore = array(); /** * List of JavaScript operators that accept a <variable, value, ...> before * them. Some end of lines are not the end of a statement, like when * continued by one of these operators on the newline. * * Note: Most operators are fine, we've only removed ), ], ++, --, ! and ~. * There can't be a newline separating ! or ~ and whatever it is negating. * ++ & -- have to be joined with the value they're in-/decrementing. * ) & ] are "special" in that they have lots or usecases. () for example * is used for function calls, for grouping, in if () and for (), ... * * Will be loaded from /data/js/operators_after.txt * * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators * * @var string[] */ protected $operatorsAfter = array(); public function __construct() { call_user_func_array( array( '\\LiteSpeed\\Lib\\CSS_JS_MIN\\Minify\\Minify', '__construct' ), func_get_args() ); $dataDir = __DIR__ . '/data/js/'; $options = FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES; $this->keywordsReserved = file( $dataDir . 'keywords_reserved.txt', $options ); $this->keywordsBefore = file( $dataDir . 'keywords_before.txt', $options ); $this->keywordsAfter = file( $dataDir . 'keywords_after.txt', $options ); $this->operators = file( $dataDir . 'operators.txt', $options ); $this->operatorsBefore = file( $dataDir . 'operators_before.txt', $options ); $this->operatorsAfter = file( $dataDir . 'operators_after.txt', $options ); } /** * Minify the data. * Perform JS optimizations. * * @param string[optional] $path Path to write the data to * * @return string The minified data */ public function execute( $path = null ) { $content = ''; /* * Let's first take out strings, comments and regular expressions. * All of these can contain JS code-like characters, and we should make * sure any further magic ignores anything inside of these. * * Consider this example, where we should not strip any whitespace: * var str = "a test"; * * Comments will be removed altogether, strings and regular expressions * will be replaced by placeholder text, which we'll restore later. */ $this->extractStrings( '\'"`' ); $this->stripComments(); $this->extractRegex(); // loop files foreach ( $this->data as $source => $js ) { // take out strings, comments & regex (for which we've registered // the regexes just a few lines earlier) $js = $this->replace( $js ); $js = $this->propertyNotation( $js ); $js = $this->shortenBools( $js ); $js = $this->stripWhitespace( $js ); // combine js: separating the scripts by a ; $content .= $js . ';'; } // clean up leftover `;`s from the combination of multiple scripts $content = ltrim( $content, ';' ); $content = (string) substr( $content, 0, -1 ); /* * Earlier, we extracted strings & regular expressions and replaced them * with placeholder text. This will restore them. */ $content = $this->restoreExtractedData( $content ); return $content; } /** * Strip comments from source code. */ protected function stripComments() { $this->stripMultilineComments(); // single-line comments $this->registerPattern( '/\/\/.*$/m', '' ); } /** * JS can have /-delimited regular expressions, like: /ab+c/.match(string). * * The content inside the regex can contain characters that may be confused * for JS code: e.g. it could contain whitespace it needs to match & we * don't want to strip whitespace in there. * * The regex can be pretty simple: we don't have to care about comments, * (which also use slashes) because stripComments() will have stripped those * already. * * This method will replace all string content with simple REGEX# * placeholder text, so we've rid all regular expressions from characters * that may be misinterpreted. Original regex content will be saved in * $this->extracted and after doing all other minifying, we can restore the * original content via restoreRegex() */ protected function extractRegex() { // PHP only supports $this inside anonymous functions since 5.4 $minifier = $this; $callback = function ( $match ) use ( $minifier ) { $count = count( $minifier->extracted ); $placeholder = '"' . $count . '"'; $minifier->extracted[ $placeholder ] = $match[0]; return $placeholder; }; // match all chars except `/` and `\` // `\` is allowed though, along with whatever char follows (which is the // one being escaped) // this should allow all chars, except for an unescaped `/` (= the one // closing the regex) // then also ignore bare `/` inside `[]`, where they don't need to be // escaped: anything inside `[]` can be ignored safely $pattern = '\\/(?!\*)(?:[^\\[\\/\\\\\n\r]++|(?:\\\\.)++|(?:\\[(?:[^\\]\\\\\n\r]++|(?:\\\\.)++)++\\])++)++\\/[gimuy]*'; // a regular expression can only be followed by a few operators or some // of the RegExp methods (a `\` followed by a variable or value is // likely part of a division, not a regex) $keywords = array( 'do', 'in', 'new', 'else', 'throw', 'yield', 'delete', 'return', 'typeof' ); $before = '(^|[=:,;\+\-\*\?\/\}\(\{\[&\|!]|' . implode( '|', $keywords ) . ')\s*'; $propertiesAndMethods = array( // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#Properties_2 'constructor', 'flags', 'global', 'ignoreCase', 'multiline', 'source', 'sticky', 'unicode', // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#Methods_2 'compile(', 'exec(', 'test(', 'toSource(', 'toString(', ); $delimiters = array_fill( 0, count( $propertiesAndMethods ), '/' ); $propertiesAndMethods = array_map( 'preg_quote', $propertiesAndMethods, $delimiters ); $after = '(?=\s*([\.,;:\)\}&\|+]|\/\/|$|\.(' . implode( '|', $propertiesAndMethods ) . ')))'; $this->registerPattern( '/' . $before . '\K' . $pattern . $after . '/', $callback ); // regular expressions following a `)` are rather annoying to detect... // quite often, `/` after `)` is a division operator & if it happens to // be followed by another one (or a comment), it is likely to be // confused for a regular expression // however, it's perfectly possible for a regex to follow a `)`: after // a single-line `if()`, `while()`, ... statement, for example // since, when they occur like that, they're always the start of a // statement, there's only a limited amount of ways they can be useful: // by calling the regex methods directly // if a regex following `)` is not followed by `.<property or method>`, // it's quite likely not a regex $before = '\)\s*'; $after = '(?=\s*\.(' . implode( '|', $propertiesAndMethods ) . '))'; $this->registerPattern( '/' . $before . '\K' . $pattern . $after . '/', $callback ); // 1 more edge case: a regex can be followed by a lot more operators or // keywords if there's a newline (ASI) in between, where the operator // actually starts a new statement // (https://github.com/matthiasmullie/minify/issues/56) $operators = $this->getOperatorsForRegex( $this->operatorsBefore, '/' ); $operators += $this->getOperatorsForRegex( $this->keywordsReserved, '/' ); $after = '(?=\s*\n\s*(' . implode( '|', $operators ) . '))'; $this->registerPattern( '/' . $pattern . $after . '/', $callback ); } /** * Strip whitespace. * * We won't strip *all* whitespace, but as much as possible. The thing that * we'll preserve are newlines we're unsure about. * JavaScript doesn't require statements to be terminated with a semicolon. * It will automatically fix missing semicolons with ASI (automatic semi- * colon insertion) at the end of line causing errors (without semicolon.) * * Because it's sometimes hard to tell if a newline is part of a statement * that should be terminated or not, we'll just leave some of them alone. * * @param string $content The content to strip the whitespace for * * @return string */ protected function stripWhitespace( $content ) { // uniform line endings, make them all line feed $content = str_replace( array( "\r\n", "\r" ), "\n", $content ); // collapse all non-line feed whitespace into a single space $content = preg_replace( '/[^\S\n]+/', ' ', $content ); // strip leading & trailing whitespace $content = str_replace( array( " \n", "\n " ), "\n", $content ); // collapse consecutive line feeds into just 1 $content = preg_replace( '/\n+/', "\n", $content ); $operatorsBefore = $this->getOperatorsForRegex( $this->operatorsBefore, '/' ); $operatorsAfter = $this->getOperatorsForRegex( $this->operatorsAfter, '/' ); $operators = $this->getOperatorsForRegex( $this->operators, '/' ); $keywordsBefore = $this->getKeywordsForRegex( $this->keywordsBefore, '/' ); $keywordsAfter = $this->getKeywordsForRegex( $this->keywordsAfter, '/' ); // strip whitespace that ends in (or next line begin with) an operator // that allows statements to be broken up over multiple lines unset( $operatorsBefore['+'], $operatorsBefore['-'], $operatorsAfter['+'], $operatorsAfter['-'] ); $content = preg_replace( array( '/(' . implode( '|', $operatorsBefore ) . ')\s+/', '/\s+(' . implode( '|', $operatorsAfter ) . ')/', ), '\\1', $content ); // make sure + and - can't be mistaken for, or joined into ++ and -- $content = preg_replace( array( '/(?<![\+\-])\s*([\+\-])(?![\+\-])/', '/(?<![\+\-])([\+\-])\s*(?![\+\-])/', ), '\\1', $content ); // collapse whitespace around reserved words into single space $content = preg_replace( '/(^|[;\}\s])\K(' . implode( '|', $keywordsBefore ) . ')\s+/', '\\2 ', $content ); $content = preg_replace( '/\s+(' . implode( '|', $keywordsAfter ) . ')(?=([;\{\s]|$))/', ' \\1', $content ); /* * We didn't strip whitespace after a couple of operators because they * could be used in different contexts and we can't be sure it's ok to * strip the newlines. However, we can safely strip any non-line feed * whitespace that follows them. */ $operatorsDiffBefore = array_diff( $operators, $operatorsBefore ); $operatorsDiffAfter = array_diff( $operators, $operatorsAfter ); $content = preg_replace( '/(' . implode( '|', $operatorsDiffBefore ) . ')[^\S\n]+/', '\\1', $content ); $content = preg_replace( '/[^\S\n]+(' . implode( '|', $operatorsDiffAfter ) . ')/', '\\1', $content ); /* * Whitespace after `return` can be omitted in a few occasions * (such as when followed by a string or regex) * Same for whitespace in between `)` and `{`, or between `{` and some * keywords. */ $content = preg_replace( '/\breturn\s+(["\'\/\+\-])/', 'return$1', $content ); $content = preg_replace( '/\)\s+\{/', '){', $content ); $content = preg_replace( '/}\n(else|catch|finally)\b/', '}$1', $content ); /* * Get rid of double semicolons, except where they can be used like: * "for(v=1,_=b;;)", "for(v=1;;v++)" or "for(;;ja||(ja=true))". * I'll safeguard these double semicolons inside for-loops by * temporarily replacing them with an invalid condition: they won't have * a double semicolon and will be easy to spot to restore afterwards. */ $content = preg_replace( '/\bfor\(([^;]*);;([^;]*)\)/', 'for(\\1;-;\\2)', $content ); $content = preg_replace( '/;+/', ';', $content ); $content = preg_replace( '/\bfor\(([^;]*);-;([^;]*)\)/', 'for(\\1;;\\2)', $content ); /* * Next, we'll be removing all semicolons where ASI kicks in. * for-loops however, can have an empty body (ending in only a * semicolon), like: `for(i=1;i<3;i++);`, of `for(i in list);` * Here, nothing happens during the loop; it's just used to keep * increasing `i`. With that ; omitted, the next line would be expected * to be the for-loop's body... Same goes for while loops. * I'm going to double that semicolon (if any) so after the next line, * which strips semicolons here & there, we're still left with this one. * Note the special recursive construct in the three inner parts of the for: * (\{([^\{\}]*(?-2))*[^\{\}]*\})? - it is intended to match inline * functions bodies, e.g.: i<arr.map(function(e){return e}).length. * Also note that the construct is applied only once and multiplied * for each part of the for, otherwise it risks a catastrophic backtracking. * The limitation is that it will not allow closures in more than one * of the three parts for a specific for() case. * REGEX throwing catastrophic backtracking: $content = preg_replace('/(for\([^;\{]*(\{([^\{\}]*(?-2))*[^\{\}]*\})?[^;\{]*;[^;\{]*(\{([^\{\}]*(?-2))*[^\{\}]*\})?[^;\{]*;[^;\{]*(\{([^\{\}]*(?-2))*[^\{\}]*\})?[^;\{]*\));(\}|$)/s', '\\1;;\\8', $content); */ $content = preg_replace( '/(for\((?:[^;\{]*|[^;\{]*function[^;\{]*(\{([^\{\}]*(?-2))*[^\{\}]*\})?[^;\{]*);[^;\{]*;[^;\{]*\));(\}|$)/s', '\\1;;\\4', $content ); $content = preg_replace( '/(for\([^;\{]*;(?:[^;\{]*|[^;\{]*function[^;\{]*(\{([^\{\}]*(?-2))*[^\{\}]*\})?[^;\{]*);[^;\{]*\));(\}|$)/s', '\\1;;\\4', $content ); $content = preg_replace( '/(for\([^;\{]*;[^;\{]*;(?:[^;\{]*|[^;\{]*function[^;\{]*(\{([^\{\}]*(?-2))*[^\{\}]*\})?[^;\{]*)\));(\}|$)/s', '\\1;;\\4', $content ); $content = preg_replace( '/(for\([^;\{]+\s+in\s+[^;\{]+\));(\}|$)/s', '\\1;;\\2', $content ); /* * Do the same for the if's that don't have a body but are followed by ;} */ $content = preg_replace( '/(\bif\s*\([^{;]*\));\}/s', '\\1;;}', $content ); /* * Below will also keep `;` after a `do{}while();` along with `while();` * While these could be stripped after do-while, detecting this * distinction is cumbersome, so I'll play it safe and make sure `;` * after any kind of `while` is kept. */ $content = preg_replace( '/(while\([^;\{]+\));(\}|$)/s', '\\1;;\\2', $content ); /* * We also can't strip empty else-statements. Even though they're * useless and probably shouldn't be in the code in the first place, we * shouldn't be stripping the `;` that follows it as it breaks the code. * We can just remove those useless else-statements completely. * * @see https://github.com/matthiasmullie/minify/issues/91 */ $content = preg_replace( '/else;/s', '', $content ); /* * We also don't really want to terminate statements followed by closing * curly braces (which we've ignored completely up until now) or end-of- * script: ASI will kick in here & we're all about minifying. * Semicolons at beginning of the file don't make any sense either. */ $content = preg_replace( '/;(\}|$)/s', '\\1', $content ); $content = ltrim( $content, ';' ); // get rid of remaining whitespace af beginning/end return trim( $content ); } /** * We'll strip whitespace around certain operators with regular expressions. * This will prepare the given array by escaping all characters. * * @param string[] $operators * @param string $delimiter * * @return string[] */ protected function getOperatorsForRegex( array $operators, $delimiter = '/' ) { // escape operators for use in regex $delimiters = array_fill( 0, count( $operators ), $delimiter ); $escaped = array_map( 'preg_quote', $operators, $delimiters ); $operators = array_combine( $operators, $escaped ); // ignore + & - for now, they'll get special treatment unset( $operators['+'], $operators['-'] ); // dot can not just immediately follow a number; it can be confused for // decimal point, or calling a method on it, e.g. 42 .toString() $operators['.'] = '(?<![0-9]\s)\.'; // don't confuse = with other assignment shortcuts (e.g. +=) $chars = preg_quote( '+-*\=<>%&|', $delimiter ); $operators['='] = '(?<![' . $chars . '])\='; return $operators; } /** * We'll strip whitespace around certain keywords with regular expressions. * This will prepare the given array by escaping all characters. * * @param string[] $keywords * @param string $delimiter * * @return string[] */ protected function getKeywordsForRegex( array $keywords, $delimiter = '/' ) { // escape keywords for use in regex $delimiter = array_fill( 0, count( $keywords ), $delimiter ); $escaped = array_map( 'preg_quote', $keywords, $delimiter ); // add word boundaries array_walk( $keywords, function ( $value ) { return '\b' . $value . '\b'; } ); $keywords = array_combine( $keywords, $escaped ); return $keywords; } /** * Replaces all occurrences of array['key'] by array.key. * * @param string $content * * @return string */ protected function propertyNotation( $content ) { // PHP only supports $this inside anonymous functions since 5.4 $minifier = $this; $keywords = $this->keywordsReserved; $callback = function ( $match ) use ( $minifier, $keywords ) { $property = trim( $minifier->extracted[ $match[1] ], '\'"' ); /* * Check if the property is a reserved keyword. In this context (as * property of an object literal/array) it shouldn't matter, but IE8 * freaks out with "Expected identifier". */ if ( in_array( $property, $keywords ) ) { return $match[0]; } /* * See if the property is in a variable-like format (e.g. * array['key-here'] can't be replaced by array.key-here since '-' * is not a valid character there. */ if ( ! preg_match( '/^' . $minifier::REGEX_VARIABLE . '$/u', $property ) ) { return $match[0]; } return '.' . $property; }; /* * Figure out if previous character is a variable name (of the array * we want to use property notation on) - this is to make sure * standalone ['value'] arrays aren't confused for keys-of-an-array. * We can (and only have to) check the last character, because PHP's * regex implementation doesn't allow unfixed-length look-behind * assertions. */ preg_match( '/(\[[^\]]+\])[^\]]*$/', static::REGEX_VARIABLE, $previousChar ); $previousChar = $previousChar[1]; /* * Make sure word preceding the ['value'] is not a keyword, e.g. * return['x']. Because -again- PHP's regex implementation doesn't allow * unfixed-length look-behind assertions, I'm just going to do a lot of * separate look-behind assertions, one for each keyword. */ $keywords = $this->getKeywordsForRegex( $keywords ); $keywords = '(?<!' . implode( ')(?<!', $keywords ) . ')'; return preg_replace_callback( '/(?<=' . $previousChar . '|\])' . $keywords . '\[\s*(([\'"])[0-9]+\\2)\s*\]/u', $callback, $content ); } /** * Replaces true & false by !0 and !1. * * @param string $content * * @return string */ protected function shortenBools( $content ) { /* * 'true' or 'false' could be used as property names (which may be * followed by whitespace) - we must not replace those! * Since PHP doesn't allow variable-length (to account for the * whitespace) lookbehind assertions, I need to capture the leading * character and check if it's a `.` */ $callback = function ( $match ) { if ( trim( $match[1] ) === '.' ) { return $match[0]; } return $match[1] . ( $match[2] === 'true' ? '!0' : '!1' ); }; $content = preg_replace_callback( '/(^|.\s*)\b(true|false)\b(?!:)/', $callback, $content ); // for(;;) is exactly the same as while(true), but shorter :) $content = preg_replace( '/\bwhile\(!0\){/', 'for(;;){', $content ); // now make sure we didn't turn any do ... while(true) into do ... for(;;) preg_match_all( '/\bdo\b/', $content, $dos, PREG_OFFSET_CAPTURE | PREG_SET_ORDER ); // go backward to make sure positional offsets aren't altered when $content changes $dos = array_reverse( $dos ); foreach ( $dos as $do ) { $offsetDo = $do[0][1]; // find all `while` (now `for`) following `do`: one of those must be // associated with the `do` and be turned back into `while` preg_match_all( '/\bfor\(;;\)/', $content, $whiles, PREG_OFFSET_CAPTURE | PREG_SET_ORDER, $offsetDo ); foreach ( $whiles as $while ) { $offsetWhile = $while[0][1]; $open = substr_count( $content, '{', $offsetDo, $offsetWhile - $offsetDo ); $close = substr_count( $content, '}', $offsetDo, $offsetWhile - $offsetDo ); if ( $open === $close ) { // only restore `while` if amount of `{` and `}` are the same; // otherwise, that `for` isn't associated with this `do` $content = substr_replace( $content, 'while(!0)', $offsetWhile, strlen( 'for(;;)' ) ); break; } } } return $content; } } lib/css_js_min/minify/exception.cls.php 0000777 00000000720 15251157102 0014230 0 ustar 00 <?php // phpcs:ignoreFile /** * exception.cls.php - modified PHP implementation of Matthias Mullie's Exceptions Classes. * * @author Matthias Mullie <minify@mullie.eu> */ namespace LiteSpeed\Lib\CSS_JS_MIN\Minify\Exception; defined( 'WPINC' ) || exit; abstract class Exception extends \Exception { } abstract class BasicException extends Exception { } class FileImportException extends BasicException { } class IOException extends BasicException { } lib/php-compatibility.func.php 0000777 00000012563 15251157102 0012430 0 ustar 00 <?php // phpcs:ignoreFile /** * LiteSpeed PHP compatibility functions for lower PHP version * * @since 1.1.3 * @package LiteSpeed * @subpackage LiteSpeed_Cache/lib */ defined( 'WPINC' ) || exit; /** * http_build_url() compatibility */ if ( ! function_exists( 'http_build_url' ) ) { if ( ! defined( 'HTTP_URL_REPLACE' ) ) { define( 'HTTP_URL_REPLACE', 1 ); // Replace every part of the first URL when there's one of the second URL } if ( ! defined( 'HTTP_URL_JOIN_PATH' ) ) { define( 'HTTP_URL_JOIN_PATH', 2 ); // Join relative paths } if ( ! defined( 'HTTP_URL_JOIN_QUERY' ) ) { define( 'HTTP_URL_JOIN_QUERY', 4 ); // Join query strings } if ( ! defined( 'HTTP_URL_STRIP_USER' ) ) { define( 'HTTP_URL_STRIP_USER', 8 ); // Strip any user authentication information } if ( ! defined( 'HTTP_URL_STRIP_PASS' ) ) { define( 'HTTP_URL_STRIP_PASS', 16 ); // Strip any password authentication information } if ( ! defined( 'HTTP_URL_STRIP_AUTH' ) ) { define( 'HTTP_URL_STRIP_AUTH', 32 ); // Strip any authentication information } if ( ! defined( 'HTTP_URL_STRIP_PORT' ) ) { define( 'HTTP_URL_STRIP_PORT', 64 ); // Strip explicit port numbers } if ( ! defined( 'HTTP_URL_STRIP_PATH' ) ) { define( 'HTTP_URL_STRIP_PATH', 128 ); // Strip complete path } if ( ! defined( 'HTTP_URL_STRIP_QUERY' ) ) { define( 'HTTP_URL_STRIP_QUERY', 256 ); // Strip query string } if ( ! defined( 'HTTP_URL_STRIP_FRAGMENT' ) ) { define( 'HTTP_URL_STRIP_FRAGMENT', 512 ); // Strip any fragments (#identifier) } if ( ! defined( 'HTTP_URL_STRIP_ALL' ) ) { define( 'HTTP_URL_STRIP_ALL', 1024 ); // Strip anything but scheme and host } // Build an URL // The parts of the second URL will be merged into the first according to the flags argument. // // @param mixed (Part(s) of) an URL in form of a string or associative array like parse_url() returns // @param mixed Same as the first argument // @param int A bitmask of binary or'ed HTTP_URL constants (Optional)HTTP_URL_REPLACE is the default // @param array If set, it will be filled with the parts of the composed url like parse_url() would return function http_build_url( $url, $parts = array(), $flags = HTTP_URL_REPLACE, &$new_url = false ) { $keys = array( 'user', 'pass', 'port', 'path', 'query', 'fragment' ); // HTTP_URL_STRIP_ALL becomes all the HTTP_URL_STRIP_Xs if ( $flags & HTTP_URL_STRIP_ALL ) { $flags |= HTTP_URL_STRIP_USER; $flags |= HTTP_URL_STRIP_PASS; $flags |= HTTP_URL_STRIP_PORT; $flags |= HTTP_URL_STRIP_PATH; $flags |= HTTP_URL_STRIP_QUERY; $flags |= HTTP_URL_STRIP_FRAGMENT; } // HTTP_URL_STRIP_AUTH becomes HTTP_URL_STRIP_USER and HTTP_URL_STRIP_PASS elseif ( $flags & HTTP_URL_STRIP_AUTH ) { $flags |= HTTP_URL_STRIP_USER; $flags |= HTTP_URL_STRIP_PASS; } // Parse the original URL // - Suggestion by Sayed Ahad Abbas // In case you send a parse_url array as input $parse_url = ! is_array( $url ) ? parse_url( $url ) : $url; // Scheme and Host are always replaced if ( isset( $parts['scheme'] ) ) { $parse_url['scheme'] = $parts['scheme']; } if ( isset( $parts['host'] ) ) { $parse_url['host'] = $parts['host']; } // (If applicable) Replace the original URL with it's new parts if ( $flags & HTTP_URL_REPLACE ) { foreach ( $keys as $key ) { if ( isset( $parts[ $key ] ) ) { $parse_url[ $key ] = $parts[ $key ]; } } } else { // Join the original URL path with the new path if ( isset( $parts['path'] ) && ( $flags & HTTP_URL_JOIN_PATH ) ) { if ( isset( $parse_url['path'] ) ) { $parse_url['path'] = rtrim( str_replace( basename( $parse_url['path'] ), '', $parse_url['path'] ), '/' ) . '/' . ltrim( $parts['path'], '/' ); } else { $parse_url['path'] = $parts['path']; } } // Join the original query string with the new query string if ( isset( $parts['query'] ) && ( $flags & HTTP_URL_JOIN_QUERY ) ) { if ( isset( $parse_url['query'] ) ) { $parse_url['query'] .= '&' . $parts['query']; } else { $parse_url['query'] = $parts['query']; } } } // Strips all the applicable sections of the URL // Note: Scheme and Host are never stripped foreach ( $keys as $key ) { if ( $flags & (int) constant( 'HTTP_URL_STRIP_' . strtoupper( $key ) ) ) { unset( $parse_url[ $key ] ); } } $new_url = $parse_url; return ( isset( $parse_url['scheme'] ) ? $parse_url['scheme'] . '://' : '' ) . ( isset( $parse_url['user'] ) ? $parse_url['user'] . ( isset( $parse_url['pass'] ) ? ':' . $parse_url['pass'] : '' ) . '@' : '' ) . ( isset( $parse_url['host'] ) ? $parse_url['host'] : '' ) . ( isset( $parse_url['port'] ) ? ':' . $parse_url['port'] : '' ) . ( isset( $parse_url['path'] ) ? $parse_url['path'] : '' ) . ( isset( $parse_url['query'] ) ? '?' . $parse_url['query'] : '' ) . ( isset( $parse_url['fragment'] ) ? '#' . $parse_url['fragment'] : '' ); } } if ( ! function_exists( 'array_key_first' ) ) { function array_key_first( array $arr ) { foreach ( $arr as $k => $unused ) { return $k; } return null; } } if ( ! function_exists( 'array_column' ) ) { function array_column( $array, $column_name ) { return array_map( function ( $element ) use ( $column_name ) { return $element[ $column_name ]; }, $array ); } } lib/guest.cls.php 0000777 00000020121 15251157102 0007734 0 ustar 00 <?php /** * Guest vary handler for LiteSpeed Cache. * * NOTE: This file is loaded directly without WordPress, so WP functions are NOT available. * * @package LiteSpeed * @since 4.1 */ namespace LiteSpeed\Lib; /** * Update guest vary * * @since 4.1 */ class Guest { const CONF_FILE = '.litespeed_conf.dat'; const HASH = 'hash'; // Not set-able const O_CACHE_LOGIN_COOKIE = 'cache-login_cookie'; const O_DEBUG = 'debug'; const O_DEBUG_IPS = 'debug-ips'; const O_UTIL_NO_HTTPS_VARY = 'util-no_https_vary'; /** * Client IP address. * * @var string */ private static $_ip; /** * Vary cookie name. * * @var string */ private static $_vary_name = '_lscache_vary'; /** * Configuration array. * * @var array|false */ private $_conf = false; /** * Guest Mode lists cache. * * @var array */ private $_gm_lists = [ 'ips' => null, 'uas' => null, ]; /** * Constructor * * @since 4.1 */ public function __construct() { ! defined( 'LSCWP_CONTENT_FOLDER' ) && define( 'LSCWP_CONTENT_FOLDER', dirname( __DIR__, 3 ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- No WP available $this->_conf = file_get_contents( LSCWP_CONTENT_FOLDER . '/' . self::CONF_FILE ); if ( $this->_conf ) { $this->_conf = json_decode( $this->_conf, true ); } if ( ! empty( $this->_conf[ self::O_CACHE_LOGIN_COOKIE ] ) ) { self::$_vary_name = $this->_conf[ self::O_CACHE_LOGIN_COOKIE ]; } } /** * Update Guest vary. * * @since 4.0 * @return void */ public function update_guest_vary() { // This process must not be cached // @reference https://wordpress.org/support/topic/soft-404-from-google-search-on-litespeed-cache-guest-vary-php/#post-16838583 header( 'X-Robots-Tag: noindex' ); header( 'X-LiteSpeed-Cache-Control: no-cache' ); if ( $this->always_guest() ) { echo '[]'; exit; } // If contains vary already, don't reload to avoid infinite loop when parent page having browser cache if ( $this->_conf && self::has_vary() ) { echo '[]'; exit; } // Send vary cookie $vary = 'guest_mode:1'; if ( $this->_conf && empty( $this->_conf[ self::O_DEBUG ] ) ) { $vary = md5( $this->_conf[ self::HASH ] . $vary ); } $expire = time() + 2 * 86400; $is_ssl = ! empty( $this->_conf[ self::O_UTIL_NO_HTTPS_VARY ] ) ? false : $this->is_ssl(); setcookie( self::$_vary_name, $vary, $expire, '/', false, $is_ssl, true ); // phpcs:ignore WordPress.WP.AlternativeFunctions.json_encode_json_encode -- No WP available echo json_encode( [ 'reload' => 'yes' ] ); exit; } /** * WP's is_ssl() func * * @since 4.1 * @return bool */ private function is_ssl() { // phpcs:disable WordPress.Security.ValidatedSanitizedInput -- No WP available if ( isset( $_SERVER['HTTPS'] ) ) { if ( 'on' === strtolower( $_SERVER['HTTPS'] ) ) { return true; } if ( '1' === $_SERVER['HTTPS'] ) { return true; } } elseif ( isset( $_SERVER['SERVER_PORT'] ) && '443' === $_SERVER['SERVER_PORT'] ) { return true; } // phpcs:enable WordPress.Security.ValidatedSanitizedInput return false; } /** * Check if default vary has a value * * @since 1.1.3 * @access public * @return string|false */ public static function has_vary() { if ( empty( $_COOKIE[ self::$_vary_name ] ) ) { return false; } // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash -- No WP available return $_COOKIE[ self::$_vary_name ]; } /** * Load Guest Mode list from file. * * Priority: cloud synced file > plugin data file * * @since 7.7 * @param string $type 'ips' or 'uas'. * @return array */ private function _load_gm_list( $type ) { if ( null !== $this->_gm_lists[ $type ] ) { return $this->_gm_lists[ $type ]; } $this->_gm_lists[ $type ] = []; $filename = 'gm_' . $type . '.txt'; // Try cloud synced file first, then fallback to plugin data file $files = [ LSCWP_CONTENT_FOLDER . '/litespeed/cloud/' . $filename, dirname( __DIR__ ) . '/data/' . $filename, ]; foreach ( $files as $file ) { if ( file_exists( $file ) ) { // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- No WP available $content = file_get_contents( $file ); if ( $content ) { $this->_gm_lists[ $type ] = array_filter( array_map( 'trim', explode( "\n", $content ) ) ); break; } } } return $this->_gm_lists[ $type ]; } /** * Detect if is a guest visitor or not * * @since 4.0 * @return bool */ public function always_guest() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { return false; } $guest_uas = $this->_load_gm_list( 'uas' ); if ( $guest_uas ) { $quoted_uas = []; foreach ( $guest_uas as $v ) { $quoted_uas[] = preg_quote( $v, '#' ); } // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash -- No WP available $match = preg_match( '#' . implode( '|', $quoted_uas ) . '#i', $_SERVER['HTTP_USER_AGENT'] ); if ( $match ) { return true; } } $guest_ips = $this->_load_gm_list( 'ips' ); if ( $this->ip_access( $guest_ips ) ) { return true; } return false; } /** * Check if the ip is in the range (supports CIDR notation) * * @since 1.1.0 * @since 7.7 Added CIDR support * @access public * @param array $ip_list List of IPs or CIDRs. * @return bool */ public function ip_access( $ip_list ) { if ( ! $ip_list ) { return false; } if ( ! isset( self::$_ip ) ) { self::$_ip = self::get_ip(); } foreach ( $ip_list as $ip_entry ) { $ip_entry = trim( $ip_entry ); // Check CIDR format if ( strpos( $ip_entry, '/' ) !== false ) { if ( $this->_ip_in_cidr( self::$_ip, $ip_entry ) ) { return true; } } elseif ( self::$_ip === $ip_entry ) { // Exact match return true; } } return false; } /** * Check if IP is within CIDR range * * @since 7.7 * @access private * @param string $ip IP address to check. * @param string $cidr CIDR notation (e.g., 192.168.1.0/24). * @return bool */ private function _ip_in_cidr( $ip, $cidr ) { list( $subnet, $mask ) = explode( '/', $cidr, 2 ); // Mask must be numeric and > 0 if ( ! is_numeric( $mask ) || $mask <= 0 ) { return false; } $mask = (int) $mask; // Determine IP version and validate $is_ipv6 = filter_var( $subnet, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 ); $max_mask = $is_ipv6 ? 128 : 32; $byte_len = $is_ipv6 ? 16 : 4; $ip_filter = $is_ipv6 ? FILTER_FLAG_IPV6 : FILTER_FLAG_IPV4; if ( ! filter_var( $ip, FILTER_VALIDATE_IP, $ip_filter ) ) { return false; } if ( $mask > $max_mask ) { return false; } $ip_bin = inet_pton( $ip ); $subnet_bin = inet_pton( $subnet ); if ( false === $ip_bin || false === $subnet_bin ) { return false; } // Build mask $full_bytes = (int) ( $mask / 8 ); $rem_bits = $mask % 8; $mask_bin = str_repeat( "\xff", $full_bytes ); if ( $rem_bits > 0 ) { $mask_bin .= chr( 0xff << ( 8 - $rem_bits ) ); } $mask_bin = str_pad( $mask_bin, $byte_len, "\x00" ); return ( $ip_bin & $mask_bin ) === ( $subnet_bin & $mask_bin ); } /** * Get client ip * * @since 1.1.0 * @since 1.6.5 changed to public * @access public * @return string */ public static function get_ip() { $_ip = ''; if ( function_exists( 'apache_request_headers' ) ) { $apache_headers = apache_request_headers(); $_ip = ! empty( $apache_headers['True-Client-IP'] ) ? $apache_headers['True-Client-IP'] : false; if ( ! $_ip ) { $_ip = ! empty( $apache_headers['X-Forwarded-For'] ) ? $apache_headers['X-Forwarded-For'] : false; $_ip = explode( ',', $_ip ); $_ip = $_ip[0]; } } if ( ! $_ip ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash -- No WP available $_ip = ! empty( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : ''; } return $_ip; } } lib/urirewriter.cls.php 0000777 00000021745 15251157102 0011205 0 ustar 00 <?php // phpcs:ignoreFile /** * Rewrite file-relative URIs as root-relative in CSS files * * @package Minify * @author Stephen Clay <steve@mrclay.org> */ namespace LiteSpeed\Lib; defined( 'WPINC' ) || exit; class UriRewriter { /** * rewrite() and rewriteRelative() append debugging information here * * @var string */ public static $debugText = ''; /** * In CSS content, rewrite file relative URIs as root relative * * @param string $css * * @param string $currentDir The directory of the current CSS file. * * @param string $docRoot The document root of the web site in which * the CSS file resides (default = $_SERVER['DOCUMENT_ROOT']). * * @param array $symlinks (default = array()) If the CSS file is stored in * a symlink-ed directory, provide an array of link paths to * target paths, where the link paths are within the document root. Because * paths need to be normalized for this to work, use "//" to substitute * the doc root in the link paths (the array keys). E.g.: * <code> * array('//symlink' => '/real/target/path') // unix * array('//static' => 'D:\\staticStorage') // Windows * </code> * * @return string */ public static function rewrite( $css, $currentDir, $docRoot = null, $symlinks = array() ) { self::$_docRoot = self::_realpath( $docRoot ? $docRoot : $_SERVER['DOCUMENT_ROOT'] ); self::$_currentDir = self::_realpath( $currentDir ); self::$_symlinks = array(); // normalize symlinks in order to map to link foreach ( $symlinks as $link => $target ) { $link = ( $link === '//' ) ? self::$_docRoot : str_replace( '//', self::$_docRoot . '/', $link ); $link = strtr( $link, '/', DIRECTORY_SEPARATOR ); self::$_symlinks[ $link ] = self::_realpath( $target ); } self::$debugText .= 'docRoot : ' . self::$_docRoot . "\n" . 'currentDir : ' . self::$_currentDir . "\n"; if ( self::$_symlinks ) { self::$debugText .= 'symlinks : ' . var_export( self::$_symlinks, 1 ) . "\n"; } self::$debugText .= "\n"; $css = self::_trimUrls( $css ); $css = self::_owlifySvgPaths( $css ); // rewrite $pattern = '/@import\\s+([\'"])(.*?)[\'"]/'; $css = preg_replace_callback( $pattern, __CLASS__ . '::_processUriCB', $css ); $pattern = '/url\\(\\s*([\'"](.*?)[\'"]|[^\\)\\s]+)\\s*\\)/'; $css = preg_replace_callback( $pattern, __CLASS__ . '::_processUriCB', $css ); $css = self::_unOwlify( $css ); return $css; } /** * In CSS content, prepend a path to relative URIs * * @param string $css * * @param string $path The path to prepend. * * @return string */ public static function prepend( $css, $path ) { self::$_prependPath = $path; $css = self::_trimUrls( $css ); $css = self::_owlifySvgPaths( $css ); // append $pattern = '/@import\\s+([\'"])(.*?)[\'"]/'; $css = preg_replace_callback( $pattern, __CLASS__ . '::_processUriCB', $css ); $pattern = '/url\\(\\s*([\'"](.*?)[\'"]|[^\\)\\s]+)\\s*\\)/'; $css = preg_replace_callback( $pattern, __CLASS__ . '::_processUriCB', $css ); $css = self::_unOwlify( $css ); self::$_prependPath = null; return $css; } /** * Get a root relative URI from a file relative URI * * <code> * UriRewriter::rewriteRelative( * '../img/hello.gif' * , '/home/user/www/css' // path of CSS file * , '/home/user/www' // doc root * ); * // returns '/img/hello.gif' * * // example where static files are stored in a symlinked directory * UriRewriter::rewriteRelative( * 'hello.gif' * , '/var/staticFiles/theme' * , '/home/user/www' * , array('/home/user/www/static' => '/var/staticFiles') * ); * // returns '/static/theme/hello.gif' * </code> * * @param string $uri file relative URI * * @param string $realCurrentDir realpath of the current file's directory. * * @param string $realDocRoot realpath of the site document root. * * @param array $symlinks (default = array()) If the file is stored in * a symlink-ed directory, provide an array of link paths to * real target paths, where the link paths "appear" to be within the document * root. E.g.: * <code> * array('/home/foo/www/not/real/path' => '/real/target/path') // unix * array('C:\\htdocs\\not\\real' => 'D:\\real\\target\\path') // Windows * </code> * * @return string */ public static function rewriteRelative( $uri, $realCurrentDir, $realDocRoot, $symlinks = array() ) { // prepend path with current dir separator (OS-independent) $path = strtr( $realCurrentDir, '/', DIRECTORY_SEPARATOR ); $path .= DIRECTORY_SEPARATOR . strtr( $uri, '/', DIRECTORY_SEPARATOR ); self::$debugText .= "file-relative URI : {$uri}\n" . "path prepended : {$path}\n"; // "unresolve" a symlink back to doc root foreach ( $symlinks as $link => $target ) { if ( 0 === strpos( $path, $target ) ) { // replace $target with $link $path = $link . substr( $path, strlen( $target ) ); self::$debugText .= "symlink unresolved : {$path}\n"; break; } } // strip doc root $path = substr( $path, strlen( $realDocRoot ) ); self::$debugText .= "docroot stripped : {$path}\n"; // fix to root-relative URI $uri = strtr( $path, '/\\', '//' ); $uri = self::removeDots( $uri ); self::$debugText .= "traversals removed : {$uri}\n\n"; return $uri; } /** * Remove instances of "./" and "../" where possible from a root-relative URI * * @param string $uri * * @return string */ public static function removeDots( $uri ) { $uri = str_replace( '/./', '/', $uri ); // inspired by patch from Oleg Cherniy do { $uri = preg_replace( '@/[^/]+/\\.\\./@', '/', $uri, 1, $changed ); } while ( $changed ); return $uri; } /** * Get realpath with any trailing slash removed. If realpath() fails, * just remove the trailing slash. * * @param string $path * * @return mixed path with no trailing slash */ protected static function _realpath( $path ) { $realPath = realpath( $path ); if ( $realPath !== false ) { $path = $realPath; } return rtrim( $path, '/\\' ); } /** * Directory of this stylesheet * * @var string */ private static $_currentDir = ''; /** * DOC_ROOT * * @var string */ private static $_docRoot = ''; /** * directory replacements to map symlink targets back to their * source (within the document root) E.g. '/var/www/symlink' => '/var/realpath' * * @var array */ private static $_symlinks = array(); /** * Path to prepend * * @var string */ private static $_prependPath = null; /** * @param string $css * * @return string */ private static function _trimUrls( $css ) { $pattern = '/ url\\( # url( \\s* ([^\\)]+?) # 1 = URI (assuming does not contain ")") \\s* \\) # ) /x'; return preg_replace( $pattern, 'url($1)', $css ); } /** * @param array $m * * @return string */ private static function _processUriCB( $m ) { // $m matched either '/@import\\s+([\'"])(.*?)[\'"]/' or '/url\\(\\s*([^\\)\\s]+)\\s*\\)/' $isImport = ( $m[0][0] === '@' ); // determine URI and the quote character (if any) if ( $isImport ) { $quoteChar = $m[1]; $uri = $m[2]; } else { // $m[1] is either quoted or not $quoteChar = ( $m[1][0] === "'" || $m[1][0] === '"' ) ? $m[1][0] : ''; $uri = ( $quoteChar === '' ) ? $m[1] : substr( $m[1], 1, strlen( $m[1] ) - 2 ); } if ( $uri === '' ) { return $m[0]; } // if not anchor id, not root/scheme relative, and not starts with scheme if ( ! preg_match( '~^(#|/|[a-z]+\:)~', $uri ) ) { // URI is file-relative: rewrite depending on options if ( self::$_prependPath === null ) { $uri = self::rewriteRelative( $uri, self::$_currentDir, self::$_docRoot, self::$_symlinks ); } else { $uri = self::$_prependPath . $uri; if ( $uri[0] === '/' ) { $root = ''; $rootRelative = $uri; $uri = $root . self::removeDots( $rootRelative ); } elseif ( preg_match( '@^((https?\:)?//([^/]+))/@', $uri, $m ) && ( false !== strpos( $m[3], '.' ) ) ) { $root = $m[1]; $rootRelative = substr( $uri, strlen( $root ) ); $uri = $root . self::removeDots( $rootRelative ); } } } if ( $isImport ) { return "@import {$quoteChar}{$uri}{$quoteChar}"; } else { return "url({$quoteChar}{$uri}{$quoteChar})"; } } /** * Mungs some inline SVG URL declarations so they won't be touched * * @link https://github.com/mrclay/minify/issues/517 * @see _unOwlify * * @param string $css * @return string */ private static function _owlifySvgPaths( $css ) { $pattern = '~\b((?:clip-path|mask|-webkit-mask)\s*\:\s*)url(\(\s*#\w+\s*\))~'; return preg_replace( $pattern, '$1owl$2', $css ); } /** * Undo work of _owlify * * @see _owlifySvgPaths * * @param string $css * @return string */ private static function _unOwlify( $css ) { $pattern = '~\b((?:clip-path|mask|-webkit-mask)\s*\:\s*)owl~'; return preg_replace( $pattern, '$1url', $css ); } } lib/object-cache.php 0000777 00000003514 15251157102 0010343 0 ustar 00 <?php // phpcs:ignoreFile /** * Plugin Name: LiteSpeed Cache - Object Cache (Drop-in) * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed. * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com */ defined( 'WPINC' ) || exit; /** * LiteSpeed Object Cache * * @since 1.8 */ ! defined( 'LSCWP_OBJECT_CACHE' ) && define( 'LSCWP_OBJECT_CACHE', true ); // Initialize const `LSCWP_DIR` and locate LSCWP plugin folder $lscwp_dir = ( defined( 'WP_PLUGIN_DIR' ) ? WP_PLUGIN_DIR : WP_CONTENT_DIR . '/plugins' ) . '/litespeed-cache/'; // Use plugin as higher priority than MU plugin if ( ! file_exists( $lscwp_dir . 'litespeed-cache.php' ) ) { // Check if is mu plugin or not $lscwp_dir = ( defined( 'WPMU_PLUGIN_DIR' ) ? WPMU_PLUGIN_DIR : WP_CONTENT_DIR . '/mu-plugins' ) . '/litespeed-cache/'; if ( ! file_exists( $lscwp_dir . 'litespeed-cache.php' ) ) { $lscwp_dir = ''; } } $data_file = WP_CONTENT_DIR . '/.litespeed_conf.dat'; $lib_file = $lscwp_dir . 'src/object.lib.php'; // Can't find LSCWP location, terminate object cache process if ( ! $lscwp_dir || ! file_exists( $data_file ) || ( ! file_exists( $lib_file ) ) ) { if ( ! is_admin() ) { // Bypass object cache for frontend require_once ABSPATH . WPINC . '/cache.php'; } else { $err = 'Can NOT find LSCWP path for object cache initialization in ' . __FILE__; error_log( $err ); add_action( is_network_admin() ? 'network_admin_notices' : 'admin_notices', function () use ( &$err ) { echo $err; } ); } } elseif ( ! LSCWP_OBJECT_CACHE ) { // Disable cache wp_using_ext_object_cache( false ); } // Init object cache & LSCWP elseif ( file_exists( $lib_file ) ) { require_once $lib_file; } phpcs.ruleset.xml 0000777 00000005450 15251157102 0010077 0 ustar 00 <?xml version="1.0"?> <ruleset name="CustomWordPress"> <description>WordPress with no whitespace changes and relaxed rules</description> <rule ref="WordPress" /> <rule ref="WordPress.WhiteSpace"> <severity>0</severity> </rule> <rule ref="Generic.WhiteSpace"> <severity>0</severity> </rule> <rule ref="Squiz.WhiteSpace"> <severity>0</severity> </rule> <rule ref="PEAR.WhiteSpace"> <severity>0</severity> </rule> <rule ref="WordPress.Arrays"> <severity>0</severity> </rule> <rule ref="Generic.Functions.FunctionCallArgumentSpacing"> <severity>0</severity> </rule> <rule ref="Squiz.Arrays.ArrayDeclaration"> <severity>0</severity> </rule> <rule ref="Squiz.Functions.MultiLineFunctionDeclaration"> <severity>0</severity> </rule> <rule ref="PEAR.Functions.FunctionCallSignature"> <severity>0</severity> </rule> <rule ref="Generic.WhiteSpace.LanguageConstructSpacing"> <severity>0</severity> </rule> <rule ref="Generic.Functions.CallTimePassByReference"> <severity>0</severity> <exclude name="Generic.Functions.CallTimePassByReference" /> </rule> <rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"> <severity>0</severity> <exclude name="Squiz.WhiteSpace.LanguageConstructSpacing" /> </rule> <rule ref="Squiz.WhiteSpace.PropertyLabelSpacing"> <severity>0</severity> <exclude name="Squiz.WhiteSpace.PropertyLabelSpacing" /> </rule> <rule ref="WordPress.Files.FileName"> <severity>0</severity> </rule> <rule ref="WordPress-Docs"> <severity>0</severity> </rule> <rule ref="PSR2.Classes.PropertyDeclaration.Underscore"> <exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/> </rule> <rule ref="PSR2.Methods.MethodDeclaration.Underscore"> <exclude name="PSR2.Methods.MethodDeclaration.Underscore"/> </rule> <rule ref="Universal.Arrays.DisallowShortArraySyntax"> <severity>0</severity> <exclude name="Universal.Arrays.DisallowShortArraySyntax.Found"/> </rule> <rule ref="Squiz.PHP.CommentedOutCode"> <severity>0</severity> </rule> <rule ref="Squiz.Commenting.InlineComment"> <severity>0</severity> </rule> <rule ref="WordPress.WP.I18n"> <severity>0</severity> </rule> <rule ref="WordPress.DB.DirectDatabaseQuery.NoCaching"> <severity>0</severity> </rule> <rule ref="WordPress.Security" /> <rule ref="WordPress.NamingConventions" /> <rule ref="WordPress.PHP" /> <file>cli/</file> <file>lib/</file> <file>src/</file> <file>tpl/</file> <file>thirdparty/</file> <file>autoload.php</file> <file>litespeed-cache.php</file> </ruleset>